PcwCloseInstance function (wdm.h)

The PcwCloseInstance function closes a counterset instance that was created using PcwCreateInstance. Most developers will use a CTRPP-generated CloseXxx function instead of calling this function directly.

Syntax

void PcwCloseInstance(
  [in] PPCW_INSTANCE Instance
);

Parameters

[in] Instance

A pointer to the counterset instance to close.

Return value

None

Remarks

Use the PcwCreateInstance function to create a counterset instance.

You cannot call PcwCloseInstance on an instance if you have already called PcwUnregister for the corresponding counterset registration. When you unregister the counterset, any remaining instances are closed for you. Closing them again will crash the system.

CTRPP-generated CloseXxx function

Most developers do not need to call PcwCloseInstance directly. Instead, they will compile a manifest with the CTRPP tool and use the CloseXxx function from the CTRPP-generated header. The generated function will look like this:

EXTERN_C FORCEINLINE VOID
CloseMyCounterset(
    __in PPCW_INSTANCE Instance
    )
{
    PAGED_CODE();

    PcwCloseInstance(Instance);
}

The CTRPP-generated Close function will be named PrefixCloseCounterSet. Prefix is usually blank, but may be present if the -prefix parameter was used on the CTRPP command-line. CounterSet is the name of the counterset, as specified in the manifest.

Requirements

Requirement Value
Minimum supported client Available in Windows 7 and later versions of Windows.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL IRQL <= APC_LEVEL

See also

PcwCreateInstance function