SmartcardAcquireRemoveLock (WDM) routine

The SmartcardAcquireRemoveLock routine increments a counter of references to the driver.

Syntax

NTSTATUS SmartcardAcquireRemoveLock(
  _In_ PSMARTCARD_EXTENSION SmartcardExtension
);

Parameters

  • SmartcardExtension [in]
    A pointer to a SMARTCARD_EXTENSION structure that contains the device extension for the smart card device which, in turn, contains the reference counter to increment.

Return value

SmartcardAcquireRemoveLock returns one of the following NTSTATUS values:

Return code Description
STATUS_SUCCESS

The lock was obtained successfully.

STATUS_DELETE_PENDING

The driver is about to unload.

 

Remarks

If the driver is about to unload, no additional code should be executed (in other words, SmartcardAcquireRemoveLock should return immediately).

SmartcardAcquireRemoveLock should be called whenever an entry-point routine to the driver is called (for example, whenever the device I/O control routine is called). SmartcardAcquireRemoveLock makes sure that the driver does not unload while other driver code is being executed.

Requirements

Target platform

Desktop

Version

Available in Windows XP and later versions of Windows.

Header

Smclib.h (include Smclib.h)

Library

Smclib.lib

IRQL

<= DISPATCH_LEVEL

See also

SMARTCARD_EXTENSION

 

 

Send comments about this topic to Microsoft