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.

126 lines
3.1 KiB

  1. /****************************************************************************/
  2. // Directory Integrity Service, header file
  3. //
  4. // Copyright (C) 2000, Microsoft Corporation
  5. /****************************************************************************/
  6. #include <windows.h>
  7. #include <shellapi.h>
  8. #include <stdio.h>
  9. #include <process.h>
  10. #include <sddl.h>
  11. #include <initguid.h>
  12. #include <ole2.h>
  13. #include <objbase.h>
  14. #include <comdef.h>
  15. #include <adoid.h>
  16. #include <adoint.h>
  17. #include <winsta.h>
  18. #include <Lm.h>
  19. #include <Clusapi.h>
  20. #include "tssdcommon.h"
  21. #include "trace.h"
  22. typedef enum _SERVER_STATUS {
  23. NotResponding,
  24. Responding
  25. } SERVER_STATUS;
  26. typedef struct {
  27. unsigned int count; // number of servers
  28. WCHAR **ServerNameArray; // Names
  29. } SDRecoverServerNames;
  30. // Shortcut VARIANT class to handle cleanup on destruction and common code
  31. // inlining.
  32. class CVar : public VARIANT
  33. {
  34. public:
  35. CVar() { VariantInit(this); }
  36. CVar(VARTYPE vt, SCODE scode = 0) {
  37. VariantInit(this);
  38. this->vt = vt;
  39. this->scode = scode;
  40. }
  41. CVar(VARIANT var) { *this = var; }
  42. ~CVar() { VariantClear(this); }
  43. void InitNull() { this->vt = VT_NULL; }
  44. void InitFromLong(long L) { this->vt = VT_I4; this->lVal = L; }
  45. void InitNoParam() {
  46. this->vt = VT_ERROR;
  47. this->lVal = DISP_E_PARAMNOTFOUND;
  48. }
  49. HRESULT InitFromWSTR(PCWSTR WStr) {
  50. this->bstrVal = SysAllocString(WStr);
  51. if (this->bstrVal != NULL) {
  52. this->vt = VT_BSTR;
  53. return S_OK;
  54. }
  55. else {
  56. return E_OUTOFMEMORY;
  57. }
  58. }
  59. // Inits from a non-NULL-terminated set of WCHARs.
  60. HRESULT InitFromWChars(WCHAR *WChars, unsigned Len) {
  61. this->bstrVal = SysAllocStringLen(WChars, Len);
  62. if (this->bstrVal != NULL) {
  63. this->vt = VT_BSTR;
  64. return S_OK;
  65. }
  66. else {
  67. return E_OUTOFMEMORY;
  68. }
  69. }
  70. HRESULT InitEmptyBSTR(unsigned Size) {
  71. this->bstrVal = SysAllocStringLen(L"", Size);
  72. if (this->bstrVal != NULL) {
  73. this->vt = VT_BSTR;
  74. return S_OK;
  75. }
  76. else {
  77. return E_OUTOFMEMORY;
  78. }
  79. }
  80. HRESULT Clear() { return VariantClear(this); }
  81. };
  82. HRESULT CreateADOStoredProcCommand(
  83. PWSTR CmdName,
  84. ADOCommand **ppCommand,
  85. ADOParameters **ppParameters);
  86. HRESULT AddADOInputStringParam(
  87. PWSTR Param,
  88. PWSTR ParamName,
  89. ADOCommand *pCommand,
  90. ADOParameters *pParameters,
  91. BOOL bNullOnNull);
  92. HRESULT GetRowArrayStringField(
  93. SAFEARRAY *pSA,
  94. unsigned RowIndex,
  95. unsigned FieldIndex,
  96. WCHAR *OutStr,
  97. unsigned MaxOutStr);
  98. void PostSessDirErrorMsgEvent(unsigned EventCode, WCHAR *szMsg, WORD wType);
  99. RPC_STATUS RPC_ENTRY SDRPCAccessCheck(RPC_IF_HANDLE idIF, void *Binding);
  100. RPC_STATUS RPC_ENTRY SDQueryRPCAccessCheck(RPC_IF_HANDLE idIF, void *Binding);
  101. BOOL CheckRPCClientProtoSeq(void *ClientBinding, WCHAR *SeqExpected);