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.

134 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1995 Intel Corp
  3. Module Name:
  4. dthook.h
  5. Abstract:
  6. Header file containing definitions, function prototypes, and other
  7. stuff for the Debug/Trace hooks in WinSock 2.
  8. Author:
  9. Michael A. Grafton
  10. --*/
  11. #ifndef DTHOOK_H
  12. #define DTHOOK_H
  13. #include <windows.h>
  14. #include "dt_dll.h"
  15. //
  16. // Function Declarations
  17. //
  18. LPFNWSANOTIFY
  19. GetPreApiNotifyFP(void);
  20. LPFNWSANOTIFY
  21. GetPostApiNotifyFP(void);
  22. void
  23. DTHookInitialize(void);
  24. void
  25. DTHookShutdown(void);
  26. #ifdef DEBUG_TRACING
  27. #define PREAPINOTIFY(x) \
  28. ( GetPreApiNotifyFP() ? ( (*(GetPreApiNotifyFP())) x ) : FALSE)
  29. #define POSTAPINOTIFY(x) \
  30. if ( GetPostApiNotifyFP() ) { \
  31. (VOID) ( (*(GetPostApiNotifyFP())) x ); \
  32. } else
  33. #else
  34. #define PREAPINOTIFY(x) FALSE
  35. #define POSTAPINOTIFY(x)
  36. #endif // DEBUG_TRACING
  37. #ifdef DEBUG_TRACING
  38. // In this case we need function prototypes for the DTHOOK_ prefaced versions
  39. // of all the upcall functions. Alas, the task of keeping these identical to
  40. // the normal WPU function prototypes is an error-prone manual process.
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. BOOL WSPAPI DTHOOK_WPUCloseEvent( WSAEVENT hEvent,
  45. LPINT lpErrno );
  46. int WSPAPI DTHOOK_WPUCloseSocketHandle( SOCKET s,
  47. LPINT lpErrno );
  48. WSAEVENT WSPAPI DTHOOK_WPUCreateEvent( LPINT lpErrno );
  49. SOCKET WSPAPI DTHOOK_WPUCreateSocketHandle( DWORD dwCatalogEntryId,
  50. DWORD_PTR dwContext,
  51. LPINT lpErrno );
  52. int WSPAPI DTHOOK_WPUFDIsSet ( SOCKET s,
  53. fd_set FAR * set );
  54. int WSPAPI DTHOOK_WPUGetProviderPath( LPGUID lpProviderId,
  55. WCHAR FAR * lpszProviderDllPath,
  56. LPINT lpProviderDllPathLen,
  57. LPINT lpErrno );
  58. SOCKET WSPAPI DTHOOK_WPUModifyIFSHandle( DWORD dwCatalogEntryId,
  59. SOCKET ProposedHandle,
  60. LPINT lpErrno );
  61. BOOL WSPAPI DTHOOK_WPUPostMessage( HWND hWnd,
  62. UINT Msg,
  63. WPARAM wParam,
  64. LPARAM lParam );
  65. int WSPAPI DTHOOK_WPUQueryBlockingCallback( DWORD dwCatalogEntryId,
  66. LPBLOCKINGCALLBACK FAR * lplpfnCallback,
  67. PDWORD_PTR lpdwContext,
  68. LPINT lpErrno );
  69. int WSPAPI DTHOOK_WPUQuerySocketHandleContext( SOCKET s,
  70. PDWORD_PTR lpContext,
  71. LPINT lpErrno );
  72. int WSPAPI DTHOOK_WPUQueueApc( LPWSATHREADID lpThreadId,
  73. LPWSAUSERAPC lpfnUserApc,
  74. DWORD_PTR dwContext,
  75. LPINT lpErrno );
  76. BOOL WSPAPI DTHOOK_WPUResetEvent( WSAEVENT hEvent,
  77. LPINT lpErrno );
  78. BOOL WSPAPI DTHOOK_WPUSetEvent( WSAEVENT hEvent,
  79. LPINT lpErrno );
  80. int WSPAPI DTHOOK_WPUOpenCurrentThread( OUT LPWSATHREADID lpThreadId,
  81. OUT LPINT lpErrno );
  82. int WSPAPI DTHOOK_WPUCloseThread( IN LPWSATHREADID lpThreadId,
  83. OUT LPINT lpErrno );
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif // DEBUG_TRACING
  88. #endif // DTHOOK_H