Post · 4 min read· pp. 1876–1879

WIN32_CALLOUTS_OPERATION

The values of the WIN32_CALLOUTS_OPERATION enumeration (formally _WIN32_CALLOUTS_OPERATION) are shared by the kernel and WIN32K.SYS (or, specifically, WIN32KBASE.SYS in Windows 10) in the scheme of callouts through which the kernel subcontracts the user-mode support of the Win32 subsystem.

Before Windows 8, this scheme required the registration of ever more callback routines. At first, these were each an argument of the PsEstablishWin32Callouts function. This could only get more and more clumsy. A reform for Windows XP gathered the routines’ addresses into a structure to pass as the function’s one argument. Windows 8 consolidated this menagerie so that the caller of PsEstablishWin32Callouts supplies just the one routine that fits the EX_CALLBACK_FUNCTION prototype:

text
NTSTATUS 
CalloutDispatchRoutine (
    PVOID CallbackContext, 
    PVOID Argument1, 
    PVOID Argument2);

Though for general purposes the three arguments for the CalloutDispatchRoutine are pointers to void, what the kernel actually passes for Argument1 is a WIN32_CALLOUTS_OPERATION which in turn tells what is passed as Argument2.

There is, of course, a high correlation between the WIN32_CALLOUT_OPERATION values and the separate routines in earlier versions, and even between each value and the corresponding routine’s index into the earlier structure.

Documentation Status

The WIN32_CALLOUTS_OPERATION enumeration is not formally documented but Microsoft has published a C-language definition. This is in the NTOSP.H which Microsoft published with the Windows Driver Kit (WDK) for the original and 1511 releases of Windows 10. Publication of this header was apparently an oversight. Though it is chock full of previously undisclosed definitions for kernel-mode programming, it is supplied in a subdirectory (named “minwin”) of a directory named “um” as if to suggest user-mode programming. Mistake or not, this disclosure has not been repeated in later kits.

An almost equivalent disclosure is of type information from symbol files, presently only for a driver named NetAdapterCx.sys. Starting with the 1803 release of Windows 10, the symbol files for this driver, as made available by Microsoft at its public symbol server, are private symbol files. They have type information for the WIN32_CALLOUTS_OPERATION from the driver’s inclusion of NTOSP.H.

Values

Microsoft’s names for the enumeration and for some of its defined values are known with certainty only for some versions of Windows 10, as described above.

ValueSymbolVersions
0x00000000Win32ProcessCallout6.2 and higher
0x00000001Win32ThreadCallout6.2 and higher
0x00000002Win32GlobalAtomTableCallout6.2 and higher
0x00000003Win32PowerEventCallout6.2 and higher
0x00000004Win32PowerStateCallout6.2 and higher
0x00000005Win32PowerInfoCallout6.2 and higher
0x00000006Win32JobCallout6.2 and higher
0x00000007Win32BatchFlushCallout6.2 and higher
0x00000008Win32DesktopOpenCallout6.2 and higher
0x00000009Win32DesktopOkToCloseCallout6.2 and higher
0x0000000AWin32DesktopCloseCallout6.2 and higher
0x0000000BWin32DesktopDeleteCallout6.2 and higher
0x0000000CWin32WindowStationOkToCloseCallout6.2 and higher
0x0000000DWin32WindowStationCloseCallout6.2 and higher
0x0000000EWin32WindowStationDeleteCallout6.2 and higher
0x0000000FWin32WindowStationParseCallout6.2 and higher
0x00000010Win32WindowStationOpenCallout6.2 and higher
0x00000011Win32LicensingCallout6.2 and higher
0x00000012Win32CompositionObjectOpenCallout6.2 and higher
0x00000013Win32CompositionObjectOkToCloseCallout6.2 and higher
0x00000014Win32CompositionObjectCloseCallout6.2 and higher
0x00000015Win32CompositionObjectDeleteCallout6.2 and higher
0x00000016Win32ProcessFreezeCallout6.2 and higher
0x00000017Win32ProcessThawCallout6.2 and higher
0x00000018Win32JobGetInterferenceCountsCallout6.3 and higher
0x00000019Win32GetCpuStatisticsCallout6.3 and higher
0x0000001AWin32SubsystemProcessQueryCallout10.0 and higher
0x0000001BWin32RawInputManagerObjectOpenCallout10.0 and higher
0x0000001CWin32RawInputManagerObjectOkToCloseCallout10.0 and higher
0x0000001DWin32RawInputManagerObjectCloseCallout10.0 and higher
0x0000001EWin32RawInputManagerObjectDeleteCallout10.0 and higher
0x0000001FWin32WakeRitForShutdownCallout10.0 and higher
0x00000020Win32WerStartCallout1511 and higher
0x00000021Win32CoreMessagingObjectOpenCallout1607 and higher
0x00000022Win32CoreMessagingObjectOkToCloseCallout1607 and higher
0x00000023Win32CoreMessagingObjectCloseCallout1607 and higher
0x00000024Win32CoreMessagingObjectDeleteCallout1607 and higher
0x00000025Win32ActivationObjectOpenCallout1903 and higher
0x00000026Win32ActivationObjectOkToCloseCallout1903 and higher
0x00000027Win32ActivationObjectCloseCallout1903 and higher
0x00000028Win32ActivationObjectDeleteCallout1903 and higher
0x00000025 (1703 to 1809); 0x00000029Win32ProcessTimerDelayCallout1703 and higher
0x00000026 (1703 to 1809); 0x0000002AWin32GetProcessTimerStatisticsCallout1703 and higher
0x00000018 (6.2); 0x00000020 (10.0); 0x00000021 (1511); 0x00000027 (1803 to 1809); 0x0000002BWin32CalloutsMax10.0 and higher

Known interpretations for the callout routine’s Argument2 are:

Argument1Argument2
Win32ProcessCalloutpointer to WIN32_PROCESS_CALLOUT_PARAMETERS
Win32ThreadCalloutpointer to WIN32_THREAD_CALLOUT_PARAMETERS
Win32GlobalAtomTableCalloutpointer to variable to receive address of global atom table
Win32PowerEventCalloutpointer to WIN32_POWEREVENT_PARAMETERS
Win32PowerStateCalloutpointer to WIN32_POWERSTATE_PARAMETERS
Win32PowerInfoCalloutpointer to WIN32_POWERINFO_CALLOUT_PARAMETERS
Win32JobCalloutpointer to WIN32_JOBCALLOUT_PARAMETERS
Win32DesktopOpenCallout Win32WindowStationOpenCallout Win32CompositionObjectOpenCallout Win32RawInputManagerObjectOpenCallout Win32CoreMessagingObjectOpenCallout Win32ActivationObjectOpenCalloutpointer to WIN32_OPENMETHOD_PARAMETERS
Win32DesktopOkToCloseCallout Win32WindowStationOkToCloseCallout Win32CompositionObjectOkToCloseCallout Win32RawInputManagerObjectOkToCloseCallout Win32CoreMessagingObjectOkToCloseCallout Win32ActivationObjectOkToCloseCalloutpointer to WIN32_OKAYTOCLOSEMETHOD_PARAMETERS
Win32DesktopCloseCallout Win32WindowStationCloseCallout Win32CompositionObjectCloseCallout Win32RawInputManagerObjectCloseCallout Win32CoreMessagingObjectCloseCallout Win32ActivationObjectCloseCalloutpointer to WIN32_CLOSEMETHOD_PARAMETERS
Win32DesktopDeleteCallout Win32WindowStationDeleteCallout Win32CompositionObjectDeleteCallout Win32RawInputManagerObjectDeleteCallout Win32CoreMessagingObjectDeleteCallout Win32ActivationObjectDeleteCalloutpointer to WIN32_DELETEMETHOD_PARAMETERS
Win32WindowStationParseCalloutpointer to WIN32_PARSEMETHOD_PARAMETERS
Win32JobGetInterferenceCountsCalloutpointer to WIN32_JOBINTERFERENCEINFO_CALLOUT_PARAMETERS
Win32SubsystemProcessQueryCalloutpointer to WIN32_SUBSYSTEM_PROCESS_QUERY_CALLOUT_PARAMETERS
Win32ProcessTimerDelayCalloutpointer to WIN32_PROCESS_TIMERDELAY_CALLOUT_PARAMETERS
Win32GetProcessTimerStatisticsCalloutpointer to WIN32_PROCESS_TIMER_STATISTICS_CALLOUT_PARAMETERS