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.

83 lines
2.3 KiB

  1. #ifndef __RESOURCES_H__
  2. #define __RESOURCES_H__
  3. #define ERROR_FAILURE 0xFFFFF666
  4. #define DECLAREIUNKNOWN() \
  5. HRESULT __stdcall QueryInterface(REFIID riid, void** ppv); \
  6. ULONG __stdcall AddRef(void); \
  7. ULONG __stdcall Release(void);
  8. #define DECLAREICLASSFACTORY() \
  9. HRESULT __stdcall CreateInstance(IUnknown* outer, REFIID riid, void** ppv); \
  10. HRESULT __stdcall LockServer(BOOL lock);
  11. #define DECLAREIDISPATCH() \
  12. HRESULT __stdcall GetTypeInfoCount(UINT* pctinfo); \
  13. HRESULT __stdcall GetTypeInfo(UINT index, LCID lcid, ITypeInfo** ppti); \
  14. HRESULT __stdcall GetIDsOfNames(REFIID riid, LPOLESTR* arNames, UINT cNames, LCID lcid, DISPID* arDispId); \
  15. HRESULT __stdcall Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD flags, DISPPARAMS* pdp, VARIANT* pvr, EXCEPINFO* pei, UINT* pae);
  16. #define DECLAREIPROVIDECLASSINFO() \
  17. HRESULT __stdcall GetClassInfo(ITypeInfo** ppti);
  18. #define DECLAREIOBJECTWITHSITE() \
  19. HRESULT __stdcall SetSite(IUnknown* pUnkSite); \
  20. HRESULT __stdcall GetSite(REFIID riid, void** ppvSite);
  21. #define SAFECLOSE(x) if((x!=INVALID_HANDLE_VALUE) && (x!=NULL)) { CloseHandle(x); x=NULL; }
  22. #define SAFEDELETE(x) if(x) { delete x; x=NULL; }
  23. #define SAFEDELETEBUF(x) if(DWORD(x)) {delete [] x; x=NULL;}
  24. #define SAFERELEASE(x) if(x) { x->Release(); x=NULL; }
  25. #define SAFEDELETEBSTR(x) if(x) { SysFreeString(x); x=NULL; }
  26. #define VALIDDISPID(x) ((x!=DISPID_UNKNOWN) ? TRUE : FALSE)
  27. #define NEWVARIANT(x) VARIANT x; VariantInit(&x);
  28. #define TF(x) (x?"TRUE":"FALSE")
  29. #define VTF(x) (V_BOOL(x)?"TRUE":"FALSE")
  30. typedef CRITICAL_SECTION CRITSEC;
  31. typedef LPCRITICAL_SECTION PCRITSEC;
  32. typedef BY_HANDLE_FILE_INFORMATION BHFI;
  33. typedef LPBY_HANDLE_FILE_INFORMATION LPBHFI;
  34. typedef struct _dispidtableentry
  35. {
  36. DWORD hash;
  37. DISPID dispid;
  38. LPWSTR name;
  39. }
  40. DISPIDTABLEENTRY, *PDISPIDTABLEENTRY;
  41. typedef enum _tagType
  42. {
  43. TYPE_LPWSTR=0,
  44. TYPE_LPLPWSTR,
  45. TYPE_LPSTR,
  46. TYPE_LPLPSTR,
  47. TYPE_DWORD,
  48. TYPE_LPDWORD
  49. }
  50. TYPE, *PTYPE;
  51. typedef enum _tagPointer
  52. {
  53. NULL_PTR=0,
  54. BAD_PTR,
  55. FREE_PTR,
  56. UNINIT_PTR,
  57. NEGONE_PTR
  58. }
  59. POINTER, *PPOINTER;
  60. typedef enum _tagMemsetFlag
  61. {
  62. INIT_NULL=0,
  63. INIT_SMILEY,
  64. INIT_HEXFF,
  65. INIT_GARBAGE
  66. }
  67. MEMSETFLAG, *PMEMSETFLAG;
  68. #endif /* __RESOURCES_H__ */