}

NTSTATUS
EncryptData(
    _In_        BCRYPT_KEY_HANDLE   KeyHandle,
    _In_        DWORD               KeyObjectLength,
    _In_reads_bytes_(InitVectorLength)
                PBYTE               InitVector,
    _In_        DWORD               InitVectorLength,
    _In_reads_bytes_(ChainingModeLength)
                PBYTE               ChainingMode,
    _In_        DWORD               ChainingModeLength,
    _In_reads_bytes_(PlainTextLength)
				PBYTE               PlainText,
    _In_        DWORD               PlainTextLength,
    _Outptr_result_bytebuffer_(*CipherTextLengthPointer) 
                PBYTE               *CipherTextPointer,
    _Out_       DWORD               *CipherTextLengthPointer
    )
{
    NTSTATUS    Status;

    BCRYPT_KEY_HANDLE   EncryptKeyHandle = NULL;

    DWORD   ResultLength = 0;
    PBYTE   TempInitVector = NULL;
    DWORD   TempInitVectorLength = 0;
    PBYTE   CipherText = NULL;
    DWORD   CipherTextLength = 0;
    PBYTE   KeyObject = NULL;
    
Esempio n. 2
0
    Info API for Windows SLC redpill patch.

Revision History:

--*/

#include "redpill.h"
#include <wchar.h>

HRESULT 
WINAPI
SLGetWindowsInformation(
    _In_                        PCWSTR                      pwszValueName,
    _Out_opt_                   SLDATATYPE*                 peDataType,
    _Out_                       UINT*                       pcbValue,
    _Outptr_result_bytebuffer_(*pcbValue) PBYTE*            ppbValue
    )
/*++
Routine Description:

    This function is used to for Windows components to get 
    component policy value.
    
Arguments:

    pwszValueName
        The name of the requested value.
        
    peDataType
        Data type. Following types are supported:
            SL_DATA_SZ     - UNICODE string
Esempio n. 3
0
        }

        //
        //  Run the receive queue service routine now.
        //
        ndisprotServiceReads(pOpenContext);
    }
    while (FALSE);
}

_Success_(return != 0)
PNET_BUFFER_LIST
ndisprotAllocateReceiveNetBufferList(
    _In_  PNDISPROT_OPEN_CONTEXT        pOpenContext,
    _In_  UINT                          DataLength,
    _Outptr_result_bytebuffer_(DataLength)
	      PUCHAR *                      ppDataBuffer
    )
/*++

Routine Description:

    Allocate resources to copy and queue a received net buffer list

Arguments:

    pOpenContext - pointer to open context for received packet
    DataLength - total length in bytes of the net buffer list's first net buffer
    ppDataBuffer - place to return pointer to allocated buffer

Return Value:
Esempio n. 4
0
Arguments:

    cbSize   - Requested size of the buffer
    ppBuffer - Pointer to a VOID pointer that recieves the buffer

Return Value:

    HRESULT
    S_OK - On success
    E_*  - On error

--*/
HRESULT
CWorkingBuffer::GetBuffer(
    _In_                       CONST ULONGLONG cbSize,
    _Outptr_result_bytebuffer_(cbSize) PVOID*          ppBuffer
    )
{
    HRESULT hr = S_OK;

    if (SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER)))
    {
        *ppBuffer = NULL;

        if (cbSize == 0)
        {
            hr = E_INVALIDARG;
        }

        if (m_cbSize == 0)
        {
Esempio n. 5
0
EngUnmapFile(
    _In_ ULONG_PTR iFile)
{
    HANDLE hModule = (HANDLE)iFile;

    EngFreeModule(hModule);

    return TRUE;
}


BOOL
APIENTRY
EngMapFontFileFD(
	_In_ ULONG_PTR iFile,
	_Outptr_result_bytebuffer_(*pcjBuf) PULONG *ppjBuf,
	_Out_ ULONG *pcjBuf)
{
    // www.osr.com/ddk/graphics/gdifncs_0co7.htm
    UNIMPLEMENTED;
    return FALSE;
}

VOID
APIENTRY
EngUnmapFontFileFD(
    _In_ ULONG_PTR iFile)
{
    // http://www.osr.com/ddk/graphics/gdifncs_6wbr.htm
    UNIMPLEMENTED;
}
Esempio n. 6
0
* this function.
*
* Parameters:
*
*     ppBuffer      - Pointer to the allocated buffer; the caller must
*                     call FreeTransferBuffer() when finished with this buffer
*     pulBufferSize - Size of the buffer allocated
*
* Return Value:
*
*    S_OK or a standard COM error code
*
\**************************************************************************/

HRESULT AllocateTransferBuffer(
    _Outptr_result_bytebuffer_(*pulBufferSize) BYTE** ppBuffer,
    _Out_ ULONG* pulBufferSize)
{
    HRESULT hr = S_OK;

    if (ppBuffer && pulBufferSize)
    {
        //
        // Set the buffer size to DEFAULT_BUFFER_SIZE
        //
        *pulBufferSize  = DEFAULT_BUFFER_SIZE;

        //
        // Allocate the memory
        //
        *ppBuffer = (BYTE*) CoTaskMemAlloc(*pulBufferSize);