NCryptStreamClose function

The NCryptStreamClose function closes a data protection stream object opened by using the NCryptStreamOpenToProtect or NCryptStreamOpenToUnprotect functions.

Syntax

SECURITY_STATUS NCryptStreamClose(
  NCRYPT_STREAM_HANDLE hStream
);

Parameters

hStream

Data stream handle returned by NCryptStreamOpenToProtect or NCryptStreamOpenToUnprotect.

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.

Return code Description
ERROR_SUCCESS
The function was successful.
NTE_INVALID_HANDLE
The handle specified by the hStream parameter is not valid.

Requirements

   
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header ncryptprotect.h
Library NCrypt.lib
DLL NCrypt.dll

See Also

CNG DPAPI Functions

NCryptStreamOpenToProtect

NCryptStreamOpenToUnprotect

NCryptStreamUpdate