Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. apidllp.h
  5. Abstract:
  6. Common header file for APIDLL data structures.
  7. Author:
  8. Wesley Witt (wesw) 12-July-1995
  9. Environment:
  10. User Mode
  11. --*/
  12. extern "C" {
  13. #include <nt.h>
  14. }
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <windows.h>
  18. #include <dbghelp.h>
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include "apimon.h"
  23. #if defined(_M_ALPHA)
  24. #define FRAME_SIZE 128
  25. #else
  26. #define FRAME_SIZE 96
  27. #endif
  28. #define MAX_FRAMES 512
  29. #define MAX_STACK_SIZE (MAX_FRAMES * FRAME_SIZE)
  30. typedef struct _THREAD_STACK {
  31. DWORD_PTR Pointer;
  32. DWORD ThreadNum;
  33. CHAR Body[MAX_STACK_SIZE];
  34. } THREAD_STACK, *PTHREAD_STACK;
  35. extern "C" {
  36. typedef DWORD (__stdcall *PGETCURRENTTHREADID)(VOID);
  37. typedef LPVOID (__stdcall *PTLSGETVALUE)(DWORD);
  38. typedef BOOL (__stdcall *PTLSSETVALUE)(DWORD,LPVOID);
  39. typedef LPVOID (__stdcall *PVIRTUALALLOC)(LPVOID,DWORD,DWORD,DWORD);
  40. typedef DWORD (__stdcall *PGETLASTERROR)(VOID);
  41. typedef VOID (__stdcall *PSETLASTERROR)(DWORD);
  42. typedef BOOL (__stdcall *PQUERYPERFORMANCECOUNTER)(LARGE_INTEGER *);
  43. extern PVOID MemPtr;
  44. extern LPDWORD ApiCounter;
  45. extern LPDWORD ApiTraceEnabled;
  46. extern DWORD TlsReEnter;
  47. extern DWORD TlsStack;
  48. extern PTLSGETVALUE pTlsGetValue;
  49. extern PTLSSETVALUE pTlsSetValue;
  50. extern PGETLASTERROR pGetLastError;
  51. extern PSETLASTERROR pSetLastError;
  52. extern PQUERYPERFORMANCECOUNTER pQueryPerformanceCounter;
  53. extern PVIRTUALALLOC pVirtualAlloc;
  54. extern DWORD ThunkOverhead;
  55. extern DWORD ThunkCallOverhead;
  56. }
  57. enum {
  58. APITYPE_NORMAL,
  59. APITYPE_LOADLIBRARYA,
  60. APITYPE_LOADLIBRARYW,
  61. APITYPE_FREELIBRARY,
  62. APITYPE_REGISTERCLASSA,
  63. APITYPE_REGISTERCLASSW,
  64. APITYPE_GETPROCADDRESS,
  65. APITYPE_SETWINDOWLONG,
  66. APITYPE_WNDPROC
  67. };
  68. extern "C" void
  69. ApiMonThunk(
  70. void
  71. );
  72. extern "C" void
  73. ApiMonThunkComplete(
  74. void
  75. );
  76. extern "C" VOID
  77. HandleDynamicDllLoadA(
  78. ULONG_PTR DllAddress,
  79. LPSTR DllName
  80. );
  81. extern "C" VOID
  82. HandleDynamicDllLoadW(
  83. ULONG_PTR DllAddress,
  84. LPWSTR DllName
  85. );
  86. extern "C" VOID
  87. HandleRegisterClassA(
  88. WNDCLASSA *pWndClassA
  89. );
  90. extern "C" VOID
  91. HandleRegisterClassW(
  92. WNDCLASSW *pWndClassW
  93. );
  94. extern "C" LONG_PTR
  95. HandleSetWindowLong(
  96. HWND hWindow,
  97. LONG lOffset,
  98. LPARAM lValue
  99. );
  100. extern "C" ULONG_PTR
  101. HandleGetProcAddress(
  102. ULONG_PTR ProcAddress
  103. );
  104. extern "C" void
  105. __cdecl
  106. dprintf(
  107. char *format,
  108. ...
  109. );
  110. extern "C" BOOL
  111. PentiumGetPerformanceCounter(
  112. PLARGE_INTEGER Counter
  113. );
  114. LPSTR
  115. UnDname(
  116. LPSTR sym,
  117. LPSTR undecsym,
  118. DWORD bufsize
  119. );
  120. PUCHAR
  121. CreateMachApiThunk(
  122. PULONG_PTR IatAddress,
  123. PUCHAR Text,
  124. PDLL_INFO DllInfo,
  125. PAPI_INFO ApiInfo
  126. );
  127. extern "C" VOID
  128. ApiTrace(
  129. PAPI_INFO ApiInfo,
  130. #ifdef _M_ALPHA
  131. DWORDLONG Arg[MAX_TRACE_ARGS],
  132. #else
  133. ULONG Arg[MAX_TRACE_ARGS],
  134. #endif
  135. ULONG ReturnValue,
  136. ULONG Caller,
  137. DWORDLONG EnterTime,
  138. DWORDLONG ExitTime,
  139. ULONG LastError
  140. );
  141. extern SYSTEM_INFO SystemInfo;