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.

181 lines
6.5 KiB

  1. #ifndef _TESTCORE_H_
  2. #define _TESTCORE_H_
  3. #define FIRST 0x00000000L
  4. #define NAMESPACE 0x00000000L
  5. #define NAMESPACES 0x00000001L
  6. #define USER 0x00000002L
  7. #define GROUP 0x00000003L
  8. #define DOMAIN 0x00000004L
  9. #define COMPUTER 0x00000005L
  10. #define SERVICE 0x00000006L
  11. #define FILESERVICE 0x00000007L
  12. #define SCHEMA 0x00000008L
  13. #define PRINTJOB 0x00000009L
  14. #define PRINTER 0x0000000AL
  15. #define PRINTQUEUE 0x0000000BL
  16. #define PRINTDEVICE 0x0000000CL
  17. #define SESSION 0x0000000DL
  18. #define RESOURCE 0x0000000EL
  19. #define FILESHARE 0x0000000FL
  20. #define OTHER 0x00000010L
  21. #define NDSROOT 0x00000011L
  22. #define NDSORG 0x00000012L
  23. #define NDSOU 0x00000013L
  24. #define NDSALIAS 0x00000014L
  25. #define NDSDIRECTORYMAP 0x00000015L
  26. #define NDSDISTRIBUTIONLIST 0x00000016L
  27. #define NDSAFPSERVER 0x00000017L
  28. #define NDSCOMMUNICATIONSSERVER 0x00000018L
  29. #define NDSMESSAGEROUTINGGROUP 0x00000019L
  30. #define NDSNETWARESERVER 0x0000001AL
  31. #define NDSORGANIZATIONALROLE 0x0000001BL
  32. #define NDSPRINTQUEUE 0x0000001CL
  33. #define NDSPRINTSERVER 0x0000001DL
  34. #define NDSPROFILE 0x0000001EL
  35. #define NDSVOLUME 0x0000001FL
  36. #define CLASS 0x00000020L
  37. #define PROPERTY 0x00000021L
  38. #define SYNTAX 0x00000022L
  39. #define LIMIT 0x00000023L
  40. #define ADSVW_INI_FILE _T("adsvw.ini")
  41. #define LBOUND 0
  42. #define SEPARATOR_S _T("# ")
  43. #define SEPARATOR_C _T('#')
  44. #define RELEASE( p ) \
  45. if( NULL != p ) \
  46. { \
  47. p->Release( ); \
  48. }
  49. #define FREE_MEMORY( mem ) \
  50. if( NULL != mem ) \
  51. { \
  52. FreeADsMem( mem ); \
  53. }
  54. #define FREE_ARRAY( mem, count ) \
  55. if( NULL != mem ) \
  56. { \
  57. FreeADsMem( mem ); \
  58. }
  59. //*******************************************************************
  60. ADSTYPE ADsTypeFromSyntaxString( WCHAR* pszSyntax );
  61. ADSTYPE ADsTypeFromString( CString& strText );
  62. CString StringFromADsType( ADSTYPE );
  63. DWORD TypeFromString( WCHAR* );
  64. DWORD TypeFromString( CHAR* );
  65. void StringFromType( DWORD, WCHAR* );
  66. void StringFromType( DWORD, CHAR* );
  67. void StringFromType( DWORD, CString& );
  68. BOOL MakeQualifiedName ( CHAR*, CHAR*, DWORD );
  69. BOOL MakeQualifiedName ( WCHAR*, WCHAR*, DWORD );
  70. BOOL MakeQualifiedName ( CString&, CString&, DWORD );
  71. CString OleDsGetErrorText ( HRESULT );
  72. HRESULT BuildFilter( BOOL*, DWORD, VARIANT* );
  73. BOOL GetFilter( DWORD, VARIANT*, VARIANT* );
  74. BOOL SetFilter( MEMBERS*, BOOL*, DWORD );
  75. BOOL SetFilter( IADsContainer*, BOOL*, DWORD );
  76. CString FromVariantToString( VARIANT& );
  77. CString FromVariantArrayToString( VARIANT& v, TCHAR* pszSeparator = NULL );
  78. HRESULT BuildVariantArray( VARTYPE, CString&, VARIANT&, TCHAR cSeparator = SEPARATOR_C );
  79. COleDsObject* CreateOleDsObject ( DWORD dwType, IUnknown* );
  80. void ErrorOnPutProperty( CString& strFuncSet,
  81. CString& strProperty,
  82. CString& strPropValue,
  83. HRESULT hResult,
  84. BOOL bUseGeneric,
  85. BOOL bUserEx );
  86. BOOL CheckIfValidClassName( CHAR* );
  87. BOOL CheckIfValidClassName( WCHAR* );
  88. int GetImageListIndex ( DWORD );
  89. UINT GetBitmapImageId ( DWORD );
  90. BSTR AllocBSTR ( WCHAR* );
  91. BSTR AllocBSTR ( CHAR* );
  92. TCHAR* AllocTCHAR ( CHAR* );
  93. TCHAR* AllocTCHAR ( WCHAR* );
  94. WCHAR* AllocWCHAR ( CHAR* );
  95. WCHAR* AllocWCHAR ( WCHAR* );
  96. HRESULT Get( IADs*, CHAR*, VARIANT* );
  97. HRESULT Get( IADs*, WCHAR*, VARIANT* );
  98. HRESULT Put( IADs*, CHAR*, VARIANT );
  99. HRESULT Put( IADs*, WCHAR*, VARIANT );
  100. void StringCat( CHAR*, BSTR );
  101. void StringCat( WCHAR*, BSTR );
  102. void GetLastProfileString( TCHAR*, CString& );
  103. void SetLastProfileString( TCHAR*, CString& );
  104. HRESULT CreateBlobArrayFromFile ( CString&, VARIANT& );
  105. HRESULT CreateBlobArray ( CString&, VARIANT& );
  106. HRESULT CreateBlobArrayEx ( CString&, VARIANT&, TCHAR cSeparator = SEPARATOR_C );
  107. CString Blob2String ( void*, DWORD );
  108. HRESULT String2Blob ( TCHAR*, void**, DWORD* );
  109. void Convert ( CHAR* , CHAR* );
  110. void Convert ( WCHAR* , CHAR* );
  111. void Convert ( CHAR* , WCHAR* );
  112. void Convert ( WCHAR* , WCHAR* );
  113. IDispatch* CopyACE ( IDispatch* );
  114. IDispatch* CopyACL ( IDispatch* );
  115. IDispatch* CopySD ( IDispatch* );
  116. HRESULT LARGE_INTEGERToString( TCHAR* szString, LARGE_INTEGER* pValue );
  117. HRESULT StringToLARGE_INTEGER( TCHAR* szString, LARGE_INTEGER* pValue );
  118. BOOL ConvertFromPropertyValue( VARIANT& rVar, TCHAR* szText );
  119. long GetVARIANTSize ( VARIANT &rVar );
  120. HRESULT GetVARIANTAt ( long lIdx, VARIANT& vArray, VARIANT &vItem );
  121. CString FromLargeInteger( IDispatch* pDisp );
  122. IDispatch* CreateLargeInteger( CString& strText );
  123. CString GetValueAt( CString& szText, TCHAR cSep, long lValue );
  124. long GetValuesCount( CString& szText, TCHAR cSep );
  125. #ifdef _DEBUG
  126. #define ERROR_HERE( szText ) \
  127. { \
  128. TCHAR* pszText; \
  129. \
  130. pszText = szText; \
  131. Convert( pszText, __FILE__ ); \
  132. _tcscat( pszText, _T( " Line: " ) ); \
  133. _itot( __LINE__, pszText + _tcslen( pszText ), 10 ); \
  134. }
  135. #else
  136. #define ERROR_HERE( szText ) NULL
  137. #endif
  138. HRESULT PurgeObject( IADsContainer* pParent, IUnknown* pIUnknown, LPWSTR pszPrefix = NULL );
  139. #endif