Source code of Windows XP (NT5)
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.

182 lines
3.0 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Class: Common
  4. //
  5. // Purpose: Contains Winnt routines and properties that are common to
  6. // all Winnt objects. Winnt objects get the routines and
  7. // properties through C++ inheritance.
  8. //
  9. //-------------------------------------------------------------------------
  10. #define MAX_DWORD 0xFFFFFFFF
  11. #define SCHEMA_NAME L"Schema"
  12. HRESULT
  13. LoadTypeInfoEntry(
  14. CDispatchMgr * pDispMgr,
  15. REFIID libid,
  16. REFIID iid,
  17. void * pIntf,
  18. DISPID SpecialId
  19. );
  20. HRESULT
  21. MakeUncName(
  22. LPWSTR szSrcBuffer,
  23. LPWSTR szTargBuffer
  24. );
  25. HRESULT
  26. ValidateOutParameter(
  27. BSTR * retval
  28. );
  29. HRESULT
  30. BuildADsPath(
  31. BSTR Parent,
  32. BSTR Name,
  33. BSTR *pADsPath
  34. );
  35. HRESULT
  36. BuildSchemaPath(
  37. BSTR bstrADsPath,
  38. BSTR bstrClass,
  39. BSTR *pSchemaPath
  40. );
  41. HRESULT
  42. BuildADsGuid(
  43. REFCLSID clsid,
  44. BSTR *pADsClass
  45. );
  46. //
  47. // Accessing Well-known object types
  48. //
  49. typedef struct _filters {
  50. WCHAR szObjectName[MAX_PATH];
  51. DWORD dwFilterId;
  52. } FILTERS, *PFILTERS;
  53. extern PFILTERS gpFilters;
  54. extern DWORD gdwMaxFilters;
  55. HRESULT
  56. BuildADsPathFromNDSPath(
  57. LPWSTR szNDSTreeName,
  58. LPWSTR szNDSDNName,
  59. LPWSTR *ppszADsPathName
  60. );
  61. HRESULT
  62. BuildNDSParentPathFromNDSPath(
  63. LPWSTR szNDSPathName,
  64. LPWSTR szNDSParentPathName,
  65. LPWSTR szCommonName
  66. );
  67. HRESULT
  68. BuildNDSPathFromNDSParentPath(
  69. LPWSTR szNDSParentPathName,
  70. LPWSTR szNDSObjectCommonName,
  71. LPWSTR szNDSPathName
  72. );
  73. typedef struct _KEYDATA {
  74. DWORD cTokens;
  75. LPWSTR pTokens[1];
  76. } KEYDATA, *PKEYDATA;
  77. PKEYDATA
  78. CreateTokenList(
  79. LPWSTR pKeyData,
  80. WCHAR ch
  81. );
  82. HRESULT
  83. NDSConvertDATEtoDWORD(
  84. DATE daDate,
  85. DWORD *pdwDate
  86. );
  87. HRESULT
  88. NDSConvertDWORDtoDATE(
  89. DWORD dwTime,
  90. DATE * pdaTime
  91. );
  92. HRESULT
  93. ConvertSYSTEMTIMEtoDWORD(
  94. CONST SYSTEMTIME *pSystemTime,
  95. DWORD *pdwDate
  96. );
  97. HRESULT
  98. ConvertDWORDtoSYSTEMTIME(
  99. DWORD dwDate,
  100. LPSYSTEMTIME pSystemTime
  101. );
  102. DWORD
  103. ADsNwNdsOpenObject(
  104. IN LPWSTR ObjectDN,
  105. IN CCredentials& Credentials,
  106. OUT HANDLE * lphObject,
  107. OUT LPWSTR lpObjectFullName OPTIONAL,
  108. OUT LPWSTR lpObjectClassName OPTIONAL,
  109. OUT LPDWORD lpdwModificationTime,
  110. OUT LPDWORD lpdwSubordinateCount OPTIONAL
  111. );
  112. //
  113. // Extended error information for NDS
  114. //
  115. HRESULT
  116. CheckAndSetExtendedError(
  117. DWORD dwRetval
  118. );
  119. //
  120. // Copy functionality within the namespace
  121. //
  122. HRESULT
  123. CopyObject(
  124. IN NDS_CONTEXT_HANDLE hDestADsContext,
  125. IN LPWSTR pszSrcADsPath,
  126. IN LPWSTR pszDestContainer,
  127. IN LPWSTR pszCommonName, //optional
  128. IN CCredentials& Credentials,
  129. OUT VOID ** ppObject
  130. );
  131. HRESULT
  132. MoveObject(
  133. IN NDS_CONTEXT_HANDLE hDestADsContext,
  134. IN LPWSTR pszSrcADsPath,
  135. IN LPWSTR pszDestContainer,
  136. IN LPWSTR pszCommonName, //optional
  137. IN CCredentials& Credentials,
  138. OUT VOID ** ppObject
  139. );
  140. HRESULT
  141. InitializeNWLibrary(
  142. void
  143. );