ReactOS  0.4.14-dev-376-gaedba84
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 "resource.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 66 of file w32knapi.h.

◆ _HWND_ROUTINE_GETWNDCONTEXTHLPID

#define _HWND_ROUTINE_GETWNDCONTEXTHLPID   gHWND_ROUTINE_GETWNDCONTEXTHLPID[g_OsIdx]

Definition at line 67 of file w32knapi.h.

◆ _HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID

#define _HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID   gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID[g_OsIdx]

Definition at line 68 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 60 of file w32knapi.h.

◆ _NOPARAM_ROUTINE_CREATEMENUPOPUP

#define _NOPARAM_ROUTINE_CREATEMENUPOPUP   gNOPARAM_ROUTINE_CREATEMENUPOPUP[g_OsIdx]

Definition at line 61 of file w32knapi.h.

◆ _NOPARAM_ROUTINE_LOADUSERAPIHOOK

#define _NOPARAM_ROUTINE_LOADUSERAPIHOOK   gNOPARAM_ROUTINE_LOADUSERAPIHOOK[g_OsIdx]

Definition at line 62 of file w32knapi.h.

◆ _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT

#define _ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT   gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT[g_OsIdx]

Definition at line 63 of file w32knapi.h.

◆ _ONEPARAM_ROUTINE_MAPDEKTOPOBJECT

#define _ONEPARAM_ROUTINE_MAPDEKTOPOBJECT   gONEPARAM_ROUTINE_MAPDEKTOPOBJECT[g_OsIdx]

Definition at line 64 of file w32knapi.h.

◆ _ONEPARAM_ROUTINE_SWAPMOUSEBUTTON

#define _ONEPARAM_ROUTINE_SWAPMOUSEBUTTON   gONEPARAM_ROUTINE_SWAPMOUSEBUTTON[g_OsIdx]

Definition at line 65 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 49 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 }
PVOID UserData
Definition: gdi.h:6
USHORT FullUnique
Definition: ntgdihdl.h:223
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18
Definition: gdi.h:1
unsigned short USHORT
Definition: pedump.c:61
PVOID KernelData
Definition: gdi.h:3
#define ULONG_PTR
Definition: config.h:101
PGDI_TABLE_ENTRY GdiHandleTable
Definition: w32knapi.c:5

◆ 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
USHORT FullUnique
Definition: ntgdihdl.h:223
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18
Definition: gdi.h:1
unsigned short USHORT
Definition: pedump.c:61
PVOID KernelData
Definition: gdi.h:3
#define ULONG_PTR
Definition: config.h:101
PGDI_TABLE_ENTRY GdiHandleTable
Definition: w32knapi.c:5

◆ Syscall()

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

Definition at line 90 of file w32knapi.c.

91 {
92  char szFunctionName[MAX_PATH];
93  FARPROC proc;
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 }
HMODULE g_hModule
Definition: w32knapi.c:4
static DWORD WINAPI IntSyscall(FARPROC proc, UINT cParams, PVOID pFirstParam)
Definition: w32knapi.c:50
static HANDLE proc()
Definition: pdb.c:32
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define MAX_PATH
Definition: compat.h:26
#define GetProcAddress(x, y)
Definition: compat.h:418
int(* FARPROC)()
Definition: compat.h:28
#define printf
Definition: config.h:203

Referenced by NtUserEnumDisplayMonitors1().

Variable Documentation

◆ g_hInstance

HINSTANCE g_hInstance

Definition at line 18 of file MainWindow.cpp.

◆ g_hModule

◆ g_OsIdx

UINT g_OsIdx

Definition at line 4 of file osver.c.

Referenced by InitOsVersion(), and WinMain().

◆ GdiHandleTable

PGDI_TABLE_ENTRY GdiHandleTable

Definition at line 26 of file gdihv.c.

◆ gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW

ASPI gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW

Definition at line 13 of file osver.c.

◆ gHWND_ROUTINE_GETWNDCONTEXTHLPID

ASPI gHWND_ROUTINE_GETWNDCONTEXTHLPID

Definition at line 14 of file osver.c.

◆ gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID

ASPI gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID

Definition at line 15 of file osver.c.

◆ gNOPARAM_ROUTINE_CREATEMENU

ASPI gNOPARAM_ROUTINE_CREATEMENU

Definition at line 6 of file osver.c.

◆ gNOPARAM_ROUTINE_CREATEMENUPOPUP

ASPI gNOPARAM_ROUTINE_CREATEMENUPOPUP

Definition at line 7 of file osver.c.

◆ gNOPARAM_ROUTINE_LOADUSERAPIHOOK

ASPI gNOPARAM_ROUTINE_LOADUSERAPIHOOK

Definition at line 8 of file osver.c.

◆ gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT

ASPI gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT

Definition at line 9 of file osver.c.

◆ gONEPARAM_ROUTINE_MAPDEKTOPOBJECT

ASPI gONEPARAM_ROUTINE_MAPDEKTOPOBJECT

Definition at line 10 of file osver.c.

◆ gONEPARAM_ROUTINE_SWAPMOUSEBUTTON

ASPI gONEPARAM_ROUTINE_SWAPMOUSEBUTTON

Definition at line 11 of file osver.c.