ReactOS 0.4.15-dev-7887-g64a59a1
w32knapi.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <objbase.h>
#include <windowsx.h>
#include <ndk/ntndk.h>
#include <winddi.h>
#include <ddrawi.h>
#include <prntfont.h>
#include <imm.h>
#include <ntusrtyp.h>
#include <ntuser.h>
#include <callback.h>
#include <ntgdityp.h>
#include <ntgdi.h>
#include <ntgdihdl.h>
#include "../apitest.h"
Include dependency graph for w32knapi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SYCALL_ENTRY
 

Macros

#define NTOS_MODE_USER
 
#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define _NOPARAM_ROUTINE_CREATEMENU   gNOPARAM_ROUTINE_CREATEMENU[g_OsIdx]
 
#define _NOPARAM_ROUTINE_CREATEMENUPOPUP   gNOPARAM_ROUTINE_CREATEMENUPOPUP[g_OsIdx]
 
#define _NOPARAM_ROUTINE_LOADUSERAPIHOOK   gNOPARAM_ROUTINE_LOADUSERAPIHOOK[g_OsIdx]
 
#define _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT   gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT[g_OsIdx]
 
#define _ONEPARAM_ROUTINE_MAPDEKTOPOBJECT   gONEPARAM_ROUTINE_MAPDEKTOPOBJECT[g_OsIdx]
 
#define _ONEPARAM_ROUTINE_SWAPMOUSEBUTTON   gONEPARAM_ROUTINE_SWAPMOUSEBUTTON[g_OsIdx]
 
#define _HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW   gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW[g_OsIdx]
 
#define _HWND_ROUTINE_GETWNDCONTEXTHLPID   gHWND_ROUTINE_GETWNDCONTEXTHLPID[g_OsIdx]
 
#define _HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID   gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID[g_OsIdx]
 

Typedefs

typedef struct SYCALL_ENTRYPSYSCALL_ENTRY
 
typedef UINT ASPI[5]
 

Functions

BOOL IsHandleValid (HGDIOBJ hobj)
 
PVOID GetHandleUserData (HGDIOBJ hobj)
 
DWORD Syscall (LPWSTR lpszFunction, int cParams, void *pParams)
 
BOOL InitOsVersion (VOID)
 

Variables

HINSTANCE g_hInstance
 
HMODULE g_hModule
 
PGDI_TABLE_ENTRY GdiHandleTable
 
UINT g_OsIdx
 
ASPI gNOPARAM_ROUTINE_CREATEMENU
 
ASPI gNOPARAM_ROUTINE_CREATEMENUPOPUP
 
ASPI gNOPARAM_ROUTINE_LOADUSERAPIHOOK
 
ASPI gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT
 
ASPI gONEPARAM_ROUTINE_MAPDEKTOPOBJECT
 
ASPI gONEPARAM_ROUTINE_SWAPMOUSEBUTTON
 
ASPI gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW
 
ASPI gHWND_ROUTINE_GETWNDCONTEXTHLPID
 
ASPI gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID
 

Macro Definition Documentation

◆ _HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW

#define _HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW   gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW[g_OsIdx]

Definition at line 65 of file w32knapi.h.

◆ _HWND_ROUTINE_GETWNDCONTEXTHLPID

#define _HWND_ROUTINE_GETWNDCONTEXTHLPID   gHWND_ROUTINE_GETWNDCONTEXTHLPID[g_OsIdx]

Definition at line 66 of file w32knapi.h.

◆ _HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID

#define _HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID   gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID[g_OsIdx]

Definition at line 67 of file w32knapi.h.

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 7 of file w32knapi.h.

◆ _NOPARAM_ROUTINE_CREATEMENU

#define _NOPARAM_ROUTINE_CREATEMENU   gNOPARAM_ROUTINE_CREATEMENU[g_OsIdx]

Definition at line 59 of file w32knapi.h.

◆ _NOPARAM_ROUTINE_CREATEMENUPOPUP

#define _NOPARAM_ROUTINE_CREATEMENUPOPUP   gNOPARAM_ROUTINE_CREATEMENUPOPUP[g_OsIdx]

Definition at line 60 of file w32knapi.h.

◆ _NOPARAM_ROUTINE_LOADUSERAPIHOOK

#define _NOPARAM_ROUTINE_LOADUSERAPIHOOK   gNOPARAM_ROUTINE_LOADUSERAPIHOOK[g_OsIdx]

Definition at line 61 of file w32knapi.h.

◆ _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT

#define _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT   gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT[g_OsIdx]

Definition at line 62 of file w32knapi.h.

◆ _ONEPARAM_ROUTINE_MAPDEKTOPOBJECT

#define _ONEPARAM_ROUTINE_MAPDEKTOPOBJECT   gONEPARAM_ROUTINE_MAPDEKTOPOBJECT[g_OsIdx]

Definition at line 63 of file w32knapi.h.

◆ _ONEPARAM_ROUTINE_SWAPMOUSEBUTTON

#define _ONEPARAM_ROUTINE_SWAPMOUSEBUTTON   gONEPARAM_ROUTINE_SWAPMOUSEBUTTON[g_OsIdx]

Definition at line 64 of file w32knapi.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 8 of file w32knapi.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 5 of file w32knapi.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 6 of file w32knapi.h.

Typedef Documentation

◆ ASPI

typedef UINT ASPI[5]

Definition at line 48 of file w32knapi.h.

◆ PSYSCALL_ENTRY

Function Documentation

◆ GetHandleUserData()

PVOID GetHandleUserData ( HGDIOBJ  hobj)

Definition at line 33 of file w32knapi.c.

34{
35 USHORT Index = (ULONG_PTR)hobj;
37
38 if (pentry->KernelData == NULL ||
39 pentry->KernelData < (PVOID)0x80000000 ||
40 (USHORT)pentry->FullUnique != (USHORT)((ULONG_PTR)hobj >> 16))
41 {
42 return NULL;
43 }
44
45 return pentry->UserData;
46}
#define NULL
Definition: types.h:112
#define ULONG_PTR
Definition: config.h:101
unsigned short USHORT
Definition: pedump.c:61
Definition: gdi.h:2
PVOID KernelData
Definition: gdi.h:3
USHORT FullUnique
Definition: ntgdihdl.h:210
PVOID UserData
Definition: gdi.h:6
PGDI_TABLE_ENTRY GdiHandleTable
Definition: w32knapi.c:5
_In_ WDFCOLLECTION _In_ ULONG Index

◆ InitOsVersion()

BOOL InitOsVersion ( VOID  )

◆ IsHandleValid()

BOOL IsHandleValid ( HGDIOBJ  hobj)

Definition at line 17 of file w32knapi.c.

18{
19 USHORT Index = (ULONG_PTR)hobj;
21
22 if (pentry->KernelData == NULL ||
23 pentry->KernelData < (PVOID)0x80000000 ||
24 (USHORT)pentry->FullUnique != (USHORT)((ULONG_PTR)hobj >> 16))
25 {
26 return FALSE;
27 }
28
29 return TRUE;
30}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

◆ Syscall()

DWORD Syscall ( LPWSTR  lpszFunction,
int  cParams,
void pParams 
)

Definition at line 90 of file w32knapi.c.

91{
92 char szFunctionName[MAX_PATH];
94
95 sprintf(szFunctionName, "%ls", pszFunction);
96 proc = (FARPROC)GetProcAddress(g_hModule, szFunctionName);
97 if (!proc)
98 {
99 printf("Couldn't find proc: %s\n", szFunctionName);
100 return FALSE;
101 }
102
103 return IntSyscall(proc, cParams, pParams);
104}
int(* FARPROC)()
Definition: compat.h:36
#define GetProcAddress(x, y)
Definition: compat.h:753
#define MAX_PATH
Definition: compat.h:34
#define printf
Definition: freeldr.h:93
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static HANDLE proc()
Definition: pdb.c:34
static DWORD WINAPI IntSyscall(FARPROC proc, UINT cParams, PVOID pFirstParam)
Definition: w32knapi.c:50
HMODULE g_hModule
Definition: w32knapi.c:4

Referenced by NtUserEnumDisplayMonitors1().

Variable Documentation

◆ g_hInstance

HINSTANCE g_hInstance
extern

Definition at line 18 of file MainWindow.cpp.

◆ g_hModule

◆ g_OsIdx

UINT g_OsIdx
extern

Definition at line 4 of file osver.c.

Referenced by InitOsVersion(), and WinMain().

◆ GdiHandleTable

PGDI_TABLE_ENTRY GdiHandleTable
extern

Definition at line 26 of file gdihv.c.

◆ gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW

ASPI gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW
extern

Definition at line 13 of file osver.c.

◆ gHWND_ROUTINE_GETWNDCONTEXTHLPID

ASPI gHWND_ROUTINE_GETWNDCONTEXTHLPID
extern

Definition at line 14 of file osver.c.

◆ gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID

ASPI gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID
extern

Definition at line 15 of file osver.c.

◆ gNOPARAM_ROUTINE_CREATEMENU

ASPI gNOPARAM_ROUTINE_CREATEMENU
extern

Definition at line 6 of file osver.c.

◆ gNOPARAM_ROUTINE_CREATEMENUPOPUP

ASPI gNOPARAM_ROUTINE_CREATEMENUPOPUP
extern

Definition at line 7 of file osver.c.

◆ gNOPARAM_ROUTINE_LOADUSERAPIHOOK

ASPI gNOPARAM_ROUTINE_LOADUSERAPIHOOK
extern

Definition at line 8 of file osver.c.

◆ gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT

ASPI gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT
extern

Definition at line 9 of file osver.c.

◆ gONEPARAM_ROUTINE_MAPDEKTOPOBJECT

ASPI gONEPARAM_ROUTINE_MAPDEKTOPOBJECT
extern

Definition at line 10 of file osver.c.

◆ gONEPARAM_ROUTINE_SWAPMOUSEBUTTON

ASPI gONEPARAM_ROUTINE_SWAPMOUSEBUTTON
extern

Definition at line 11 of file osver.c.