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.

176 lines
4.8 KiB

  1. /*++=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. resources.h
  5. Abstract:
  6. Defines and other global manifests used in the W3Spoof project.
  7. Author:
  8. Paul M Midgen (pmidge) 13-August-2000
  9. Revision History:
  10. 13-August-2000 pmidge
  11. Created
  12. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--*/
  13. #ifndef __RESOURCES_H__
  14. #define __RESOURCES_H__
  15. #define SHELLMESSAGE_W3SICON (WM_USER+12387)
  16. #define INITIAL_DATA_BUFFER_SIZE 4096
  17. #define SOCKET_CLOSE_ABORTIVE 0
  18. #define SOCKET_CLOSE_GRACEFUL 1
  19. #define CK_INVALID_KEY 0xFFFFFFFF
  20. #define CK_NEW_CONNECTION 0x00000000
  21. #define CK_NORMAL 0x00000001
  22. #define CK_CANCEL_IO 0x00000002
  23. #define CK_TERMINATE_THREAD 0x00000003
  24. #define TPO_MAX_POOL_THREADS 0x00000001
  25. #define TPO_MAX_ACTIVE_THREADS 0x00000002
  26. #define TPO_SERVER_LISTEN_PORT 0x00000003
  27. #define TPO_CONDITIONAL_ACCEPT 0x00000004
  28. #define ERROR_FAILURE 0xFFFFF666
  29. typedef DWORD (WINAPI *THREADFUNC)(LPVOID lpv);
  30. #define DECLAREIUNKNOWN() \
  31. HRESULT __stdcall QueryInterface(REFIID riid, void** ppv); \
  32. ULONG __stdcall AddRef(void); \
  33. ULONG __stdcall Release(void);
  34. #define DECLAREIDISPATCH() \
  35. HRESULT __stdcall GetTypeInfoCount(UINT* pctinfo); \
  36. HRESULT __stdcall GetTypeInfo(UINT index, LCID lcid, ITypeInfo** ppti); \
  37. HRESULT __stdcall GetIDsOfNames(REFIID riid, LPOLESTR* arNames, UINT cNames, LCID lcid, DISPID* arDispId); \
  38. HRESULT __stdcall Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD flags, DISPPARAMS* pdp, VARIANT* pvr, EXCEPINFO* pei, UINT* pae);
  39. #define DECLAREIPROVIDECLASSINFO() \
  40. HRESULT __stdcall GetClassInfo(ITypeInfo** ppti);
  41. #define DECLAREIOBJECTWITHSITE() \
  42. HRESULT __stdcall SetSite(IUnknown* pUnkSite); \
  43. HRESULT __stdcall GetSite(REFIID riid, void** ppvSite);
  44. #define SAFECLOSE(x) if((x!=INVALID_HANDLE_VALUE) && (x!=NULL)) { CloseHandle(x); x=NULL; }
  45. #define SAFECLOSESOCKET(x) if(x!=INVALID_SOCKET) { closesocket(x); x=INVALID_SOCKET; }
  46. #define SAFEDELETE(x) if(x) { delete x; x=NULL; }
  47. #define SAFEDELETEBUF(x) if(DWORD(x)) {delete [] x; x=NULL;}
  48. #define SAFERELEASE(x) if(x) { x->Release(); x=NULL; }
  49. #define SAFETERMINATE(x) if(x) { x->Terminate(); }
  50. #define SAFEDELETEBSTR(x) if(x) { SysFreeString(x); x=NULL; }
  51. #define VALIDSOCKET(x) ((x!=INVALID_SOCKET) ? TRUE : FALSE)
  52. #define VALIDDISPID(x) ((x!=DISPID_UNKNOWN) ? TRUE : FALSE)
  53. #define SOCKADDRBUFSIZE (sizeof(SOCKADDR_IN)+16)
  54. #define NEWVARIANT(x) VARIANT x; VariantInit(&x);
  55. #define GETIOCTX(x) (x ? ((PIOCTX)((DWORD_PTR)x - sizeof(DWORD_PTR))) : NULL)
  56. //
  57. // forward decls
  58. //
  59. class CW3Spoof;
  60. //
  61. // typedefs
  62. //
  63. typedef class IOCTX* PIOCTX;
  64. typedef class CSession SESSIONOBJ;
  65. typedef class CSession* PSESSIONOBJ;
  66. typedef class CSocket SOCKETOBJ;
  67. typedef class CSocket* PSOCKETOBJ;
  68. typedef class CRequest REQUESTOBJ;
  69. typedef class CRequest* PREQUESTOBJ;
  70. typedef class CResponse RESPONSEOBJ;
  71. typedef class CResponse* PRESPONSEOBJ;
  72. typedef class CUrl URLOBJ;
  73. typedef class CUrl* PURLOBJ;
  74. typedef class CHeaders HEADERSOBJ;
  75. typedef class CHeaders* PHEADERSOBJ;
  76. typedef class CEntity ENTITYOBJ;
  77. typedef class CEntity* PENTITYOBJ;
  78. typedef struct sockaddr_in SOCKADDR_IN;
  79. typedef struct sockaddr_in* PSOCKADDR_IN;
  80. typedef CRITICAL_SECTION CRITSEC;
  81. typedef LPCRITICAL_SECTION PCRITSEC;
  82. typedef BY_HANDLE_FILE_INFORMATION BHFI;
  83. typedef LPBY_HANDLE_FILE_INFORMATION LPBHFI;
  84. typedef URL_COMPONENTSW URLCOMP;
  85. typedef LPURL_COMPONENTSW PURLCOMP;
  86. typedef struct _HOSTINFO
  87. {
  88. char* name;
  89. char* addr;
  90. u_short port;
  91. }
  92. HOSTINFO, *PHOSTINFO;
  93. typedef enum _state
  94. {
  95. ST_CREATED,
  96. ST_OPENING,
  97. ST_OPEN,
  98. ST_CLOSING,
  99. ST_CLOSED,
  100. ST_ERROR
  101. }
  102. STATE, *PSTATE;
  103. typedef enum _serverstate
  104. {
  105. SS_START_STATE = 0,
  106. SS_SOCKET_CONNECTED,
  107. SS_REQUEST_PENDING,
  108. SS_REQUEST_COMPLETE,
  109. SS_RESPONSE_PENDING,
  110. SS_RESPONSE_COMPLETE,
  111. SS_SOCKET_DISCONNECTED
  112. }
  113. SERVERSTATE, *PSERVERSTATE;
  114. #define SCRIPTHANDLERS 5
  115. typedef enum _tagScriptDispid
  116. {
  117. Global = -1,
  118. OnConnect = 0,
  119. OnDataAvailable,
  120. OnRequest,
  121. OnResponse,
  122. OnClose
  123. }
  124. SCRIPTDISPID, *PSCRIPTDISPID;
  125. typedef enum _tagIOTYPE
  126. {
  127. IOCT_CONNECT = 0,
  128. IOCT_RECV,
  129. IOCT_SEND,
  130. IOCT_DUMMY
  131. }
  132. IOTYPE, *PIOTYPE;
  133. typedef struct _dispidtableentry
  134. {
  135. DWORD hash;
  136. DISPID dispid;
  137. LPWSTR name;
  138. }
  139. DISPIDTABLEENTRY, *PDISPIDTABLEENTRY;
  140. #endif /* __RESOURCES_H__ */