Share via


WOWCallback16Ex

Use the WOWCallback16Ex function in 32-bit code called from 16-bit code (through generic thunks) to call back to the 16-bit side (generic callback).

BOOL WINAPI WOWCallback16Ex(
  DWORD vpfn16,
  DWORD dwFlags,
  DWORD cbArgs,
  PVOID pArgs,
  PDWORD pdwRetCode
);

Parameters

  • vpfn16
    [in] A 16:16 pointer to 16-bit callback routine, passed from the 16-bit side.

  • dwFlags
    [in] Specifies the calling convention. This parameter can be one of the following values.

    Value Meaning
    WCB16_CDECL
    0x1
    Calls a _cdecl callback routine.
    WCB16_PASCAL
    0x0
    Calls a _pascal callback routine (default).
  • cbArgs
    [in] Count of bytes in arguments (used to properly clean the 16-bit stack).

  • pArgs
    [in] Arguments for the callback routine.

  • pdwRetCode
    [out] Receives the return code from the callback routine.

Return Value

If cbArgs is larger than the WCB16_MAX_ARGS bytes that the system supports, the return value is FALSE and the GetLastError function returns the ERROR_INVALID_PARAMETER value. Otherwise, the return value is TRUE and the DWORD pointed to by pdwRetCode contains the return code from the callback routine. If the callback routine returns a WORD type instead of a DWORD type, the upper 16 bits of the return code are undefined and should be ignored by using LOWORD on the return value.

Remarks

WOWCallback16Ex allows any combination of arguments up to WCB16_MAX_CBARGS bytes total to be passed to the 16-bit callback routine. Regardless of the value of cbArgs, WCB16_MAX_CBARGS bytes will always be copied from pArgs to the 16-bit stack. If pArgs is less than WCB16_MAX_CBARGS bytes from the end of a page and the next page is inaccessible, WOWCallback16Ex will incur an access violation.

The arguments pointed to by pArgs must be in the correct order for the callback routine's calling convention. For example, to call a Pascal routine, place the arguments in the pArgs array in reverse order, with the least significant word first for DWORD types and offset first for far pointers.

When you call a _cdecl routine, place the arguments in the pArgs array in the order listed in the function prototype with the least significant word first for DWORD types and offset first for far pointers.

Requirements

Client Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header

Declared in Wownt32.h.

Library

Use Wow32.lib.

DLL Requires Wow32.dll.

See Also

Generic Thunks Overview
32-bit Generic Thunk Functions
LOWORD