From b2f09cf903c983d721ae3374da2f1f134920a57a Mon Sep 17 00:00:00 2001 From: Benjamin DELPY Date: Fri, 29 Jul 2016 20:18:26 +0200 Subject: [PATCH] [internal] RPC modules no more needed --- modules/rpc/kull_m_rpc_ms-dtyp.h | 5 -- modules/rpc/kull_m_rpc_pac.c | 84 -------------------------------- modules/rpc/kull_m_rpc_pac.h | 12 ----- 3 files changed, 101 deletions(-) delete mode 100644 modules/rpc/kull_m_rpc_ms-dtyp.h delete mode 100644 modules/rpc/kull_m_rpc_pac.c delete mode 100644 modules/rpc/kull_m_rpc_pac.h diff --git a/modules/rpc/kull_m_rpc_ms-dtyp.h b/modules/rpc/kull_m_rpc_ms-dtyp.h deleted file mode 100644 index 737576d..0000000 --- a/modules/rpc/kull_m_rpc_ms-dtyp.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include "kull_m_rpc.h" - -typedef DWORD NET_API_STATUS; -typedef UNICODE_STRING RPC_UNICODE_STRING; \ No newline at end of file diff --git a/modules/rpc/kull_m_rpc_pac.c b/modules/rpc/kull_m_rpc_pac.c deleted file mode 100644 index 80525b7..0000000 --- a/modules/rpc/kull_m_rpc_pac.c +++ /dev/null @@ -1,84 +0,0 @@ -/* Benjamin DELPY `gentilkiwi` - http://blog.gentilkiwi.com - benjamin@gentilkiwi.com - Licence : https://creativecommons.org/licenses/by/4.0/ -*/ -#include "kull_m_rpc_pac.h" - -BOOL kuhl_m_pac_DecodeValidationInformation(PVOID data, DWORD size, PKERB_VALIDATION_INFO *pObject) -{ - BOOL status = FALSE; - RPC_STATUS rpcStatus; - KULL_M_RPC_FCNSTRUCT UserState = {data, size}; - handle_t pHandle; - - *pObject = NULL; - rpcStatus = MesDecodeIncrementalHandleCreate(&UserState, ReadFcn, &pHandle); - if(NT_SUCCESS(rpcStatus)) - { - rpcStatus = MesIncrementalHandleReset(pHandle, NULL, NULL, NULL, NULL, MES_DECODE); - if(NT_SUCCESS(rpcStatus)) - { - RpcTryExcept - PKERB_VALIDATION_INFO_Decode(pHandle, pObject); - status = (*pObject != NULL); - RpcExcept(RPC_EXCEPTION) - PRINT_ERROR(L"RPC Exception 0x%08x (%u)\n", RpcExceptionCode(), RpcExceptionCode()); - RpcEndExcept - } - else PRINT_ERROR(L"MesIncrementalHandleReset: %08x\n", rpcStatus); - MesHandleFree(pHandle); - } - else PRINT_ERROR(L"MesDecodeIncrementalHandleCreate: %08x\n", rpcStatus); - return status; -} - -void kuhl_m_pac_FreeValidationInformation(PKERB_VALIDATION_INFO *pObject) -{ - RPC_STATUS rpcStatus; - handle_t pHandle; - - rpcStatus = MesDecodeIncrementalHandleCreate(NULL, NULL, &pHandle); - if(NT_SUCCESS(rpcStatus)) - { - PKERB_VALIDATION_INFO_Free(pHandle, pObject); - *pObject = NULL; - MesHandleFree(pHandle); - } - else PRINT_ERROR(L"MesDecodeIncrementalHandleCreate: %08x\n", rpcStatus); -} - -BOOL kuhl_m_pac_EncodeValidationInformation(PKERB_VALIDATION_INFO pObject, PVOID *data, DWORD *size) -{ - BOOL status = FALSE; - RPC_STATUS rpcStatus; - KULL_M_RPC_FCNSTRUCT UserState; - handle_t pHandle; - - rpcStatus = MesEncodeIncrementalHandleCreate(&UserState, ReadFcn, WriteFcn, &pHandle); - if(NT_SUCCESS(rpcStatus)) - { - *size = (DWORD) PKERB_VALIDATION_INFO_AlignSize(pHandle, &pObject); - if(*data = LocalAlloc(LPTR, *size)) - { - rpcStatus = MesIncrementalHandleReset(pHandle, NULL, NULL, NULL, NULL, MES_ENCODE); - if(NT_SUCCESS(rpcStatus)) - { - UserState.addr = *data; - UserState.size = *size; - PKERB_VALIDATION_INFO_Encode(pHandle, &pObject); - status = TRUE; - } - else PRINT_ERROR(L"MesIncrementalHandleReset: %08x\n", rpcStatus); - - if(!status) - { - *data = LocalFree(*data); - *size = 0; - } - } - MesHandleFree(pHandle); - } - else PRINT_ERROR(L"MesEncodeIncrementalHandleCreate: %08x\n", rpcStatus); - return status; -} \ No newline at end of file diff --git a/modules/rpc/kull_m_rpc_pac.h b/modules/rpc/kull_m_rpc_pac.h deleted file mode 100644 index 5b0e047..0000000 --- a/modules/rpc/kull_m_rpc_pac.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Benjamin DELPY `gentilkiwi` - http://blog.gentilkiwi.com - benjamin@gentilkiwi.com - Licence : https://creativecommons.org/licenses/by/4.0/ -*/ -#pragma once -#include "globals.h" -#include "kull_m_rpc_ms-pac.h" - -BOOL kuhl_m_pac_DecodeValidationInformation(PVOID data, DWORD size, PKERB_VALIDATION_INFO *pObject); -void kuhl_m_pac_FreeValidationInformation(PKERB_VALIDATION_INFO *pObject); -BOOL kuhl_m_pac_EncodeValidationInformation(PKERB_VALIDATION_INFO pObject, PVOID *data, DWORD *size); \ No newline at end of file