次の方法で共有


XXX_Close (Device Manager) (Compact 2013)

3/26/2014

This function closes a device context created by the hOpenContextparameter.

Syntax

BOOL XXX_Close(
  DWORD hOpenContext 
);

Parameters

  • hOpenContext
    [in] Handle returned by the XXX_Open (Device Manager) function, which is used to identify the open context of the device.

Return Value

TRUE indicates success. FALSE indicates failure.

Remarks

An application calls the CloseHandle function to stop using a stream interface driver. The hFile parameter specifies the handle associated with the device context. In response to CloseHandle, the operating system invokes XXX_Close.

The file handle specified for hOpenContextis no longer valid after this function returns; if an application tries to perform stream I/O operations on that handle after calling CloseHandle, those operations fail.

Device Manager uses the XXX prefix. When implementing the stream interface, replace XXX with a prefix appropriate for your implementation or use undecorated entry point names in conjunction with DEVFLAGS_NAKEDENTRIES. For more information about other valid Flags values, see ActivateDeviceEx.

If you have threads blocked in your driver, resources associated with the handle or device instance might not be able to be released. To avoid this, implement the XXX_PreClose (Device Manager) and XXX_PreDeinit (Device Manager) entry points.

Requirements

Header

Developer Implemented

Library

Developer Implemented

See Also

Reference

Stream Interface Driver Functions
ActivateDeviceEx
XXX_Open (Device Manager)
XXX_PreClose (Device Manager)
XXX_PreDeinit (Device Manager)

Other Resources

CloseHandle