NCryptStreamClose function (ncryptprotect.h)

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

Syntax

SECURITY_STATUS NCryptStreamClose(
  [in] NCRYPT_STREAM_HANDLE hStream
);

Parameters

[in] 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

Requirement Value
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