PRESOURCE_TYPE_CONTROL_ROUTINE callback function (resapi.h)

Performs an operation that applies to a resource type. The PRESOURCE_TYPE_CONTROL_ROUTINE type defines a pointer to this function.



DWORD PresourceTypeControlRoutine(
  [in]  LPCWSTR ResourceTypeName,
  [in]  DWORD ControlCode,
  [in]  PVOID InBuffer,
  [in]  DWORD InBufferSize,
  [out] PVOID OutBuffer,
  [in]  DWORD OutBufferSize,
  [out] LPDWORD BytesReturned


[in] ResourceTypeName

Type of resource to be affected by the operation.

[in] ControlCode

Control code that represents the operation to be performed. For a list of valid values for the ControlCode parameter, see Resource Type Control Codes.

[in] InBuffer

Pointer to a buffer containing data to be used in the operation. InBuffer can be NULL if the operation does not require data.

[in] InBufferSize

Size, in bytes, of the buffer pointed to by InBuffer.

[out] OutBuffer

Pointer to a buffer containing data resulting from the operation. OutBuffer can be NULL if the operation returns no data.

[in] OutBufferSize

Size, in bytes, of the available space pointed to by OutBuffer.

[out] BytesReturned

Number of bytes in the buffer pointed to by OutBuffer that actually contain data.

Return value

If the operation succeeds, the function returns ERROR_SUCCESS.

If the operation fails, the function returns a system error code. The following is a possible error code.

Return code Description
The resource DLL requested that the Resource Monitor perform default processing (if any) for ControlCode in addition to processing supplied by the DLL (if any).


Some control codes should be handled by the resource DLL, while others should be left to the Resource Monitor. For effective implementation strategies of the ResourceTypeControl entry-point function, see Implementing ResourceTypeControl.


See Resource DLL Examples.


Minimum supported client None supported
Minimum supported server Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Target Platform Windows
Header resapi.h

See also

Resource DLL Entry-Point Functions