Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define NCRYPT_KEY_PROTECTION_ALGORITHM_LOCKEDCREDENTIALS L"LOCKEDCREDENTIALS"
- //
- // LOCKEDCREDENTIALS=%ProtectionDomain%[,%EnterpriseID%]
- //
- /****************************************************************************
- PFNCryptStreamOutputCallbackEx
- pvCallbackCtxt
- The arguments specified by NCRYPT_PROTECT_STREAM_INFO_EX.
- pbData
- A pointer to a block of processed data that is available to the application. If
- data is not available yet, but the descriptor is, this will be NULL.
- cbData
- The size, in bytes, of the block of processed data at pbData.
- hDescriptor
- Handle of Protection Descriptor.
- fFinal
- Specifies that the last block of data is being processed and that this
- is the last time the callback will be executed.
- Return Value
- Returns a status code that indicates the success or failure of the function.
- Possible return codes include, but are not limited to, the following.
- ERROR_SUCCESS
- NTE_INVALID_PARAMETER
- NTE_BAD_FLAGS
- NTE_BAD_DATA
- NTE_NO_MEMORY
- NTE_NOT_FOUND
- NTE_NOT_SUPPORTED
- NTE_INVALID_HANDLE
- NTE_BAD_KEY
- NTE_BAD_PROVIDER
- NTE_BAD_TYPE
- ****************************************************************************/
- typedef
- SECURITY_STATUS
- (WINAPI *PFNCryptStreamOutputCallbackEx)(
- _In_ void *pvCallbackCtxt,
- _In_reads_bytes_opt_(cbData)
- const BYTE *pbData,
- SIZE_T cbData,
- _In_ NCRYPT_DESCRIPTOR_HANDLE hDescriptor,
- BOOL fFinal
- );
- /****************************************************************************
- NCRYPT_PROTECT_STREAM_INFO_EX
- The NCRYPT_PROTECT_STREAM_INFO_EX structure is used to enable stream processing
- of data rather than single block processing.
- This structure is passed to the NCryptStreamOpenToUnprotectEx function. There
- is not equivalent NCryptStreamOpenToProtectEx function, thus you need to use
- the PFNCryptStreamOutputCallback, NCRYPT_PROTECT_STREAM_INFO and
- NCryptStreamOpenToProtect functions.
- pfnStreamOutput
- [in] The address of a callback function used to read from and write
- data to a disk when processing large messages.
- pvCallbackCtxt
- [in] A pointer to the argument to pass to the callback function.
- ****************************************************************************/
- typedef struct NCRYPT_PROTECT_STREAM_INFO_EX {
- PFNCryptStreamOutputCallbackEx pfnStreamOutput;
- void *pvCallbackCtxt;
- } NCRYPT_PROTECT_STREAM_INFO_EX;
- /****************************************************************************
- NCryptStreamOpenToUnprotectEx
- pStreamInfo
- [in] A pointer to NCRYPT_PROTECT_STREAM_INFO_EX.
- dwFlags
- The following flags are supported.
- NCRYPT_SILENT_FLAG
- hWnd
- [in, optional] A window handle (HWND) to be used as the parent of any user
- interface that is displayed.
- phStream
- [out] Receives a pointer to a stream handle.
- Return Value
- Returns a status code that indicates the success or failure of the function.
- Possible return codes include, but are not limited to, the following.
- ERROR_SUCCESS
- NTE_INVALID_PARAMETER
- NTE_BAD_FLAGS
- NTE_BAD_DATA
- NTE_NO_MEMORY
- NTE_NOT_FOUND
- NTE_NOT_SUPPORTED
- NTE_INVALID_HANDLE
- NTE_BAD_KEY
- NTE_BAD_PROVIDER
- NTE_BAD_TYPE
- NTE_DECRYPTION_FAILURE
- ****************************************************************************/
- SECURITY_STATUS
- WINAPI
- NCryptStreamOpenToUnprotectEx(
- _In_ NCRYPT_PROTECT_STREAM_INFO_EX *pStreamInfo,
- DWORD dwFlags,
- _In_opt_ HWND hWnd,
- _Out_ NCRYPT_STREAM_HANDLE *phStream
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement