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.

66 lines
1.7 KiB

  1. #pragma once
  2. #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
  3. #define _WIN32_WINNT 0x0510 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
  4. #endif
  5. #include <windows.h>
  6. #include <sddl.h>
  7. #include <tchar.h>
  8. #include <wbemidl.h>
  9. //
  10. // This struct is used by the version api
  11. //
  12. typedef struct
  13. {
  14. WORD wLanguage;
  15. WORD wCodePage;
  16. } LANGANDCODEPAGE;
  17. void MyOutputDebug(TCHAR *fmt, ...);
  18. void ClearLog();
  19. void Log( LPCTSTR fmt, ... );
  20. void LogError( PTCHAR szAction, DWORD dwErrorCode );
  21. bool GetUDDIInstallPath( PTCHAR szInstallPath, DWORD dwLen );
  22. int GetFileVersionStr( LPTSTR outBuf, DWORD dwBufCharSize );
  23. HRESULT GetOSProductSuiteMask( LPCTSTR szRemoteServer, UINT *pdwMask );
  24. HRESULT IsStandardServer( LPCTSTR szRemoteServer, BOOL *bResult );
  25. BOOL GetLocalSidString( WELL_KNOWN_SID_TYPE sidType, LPTSTR szOutBuf, DWORD cbOutBuf );
  26. BOOL GetLocalSidString( LPCTSTR szUserName, LPTSTR szOutBuf, DWORD cbOutBuf );
  27. BOOL GetRemoteAcctName( LPCTSTR szMachineName, LPCTSTR szSidStr, LPTSTR szOutStr, LPDWORD cbOutStr, LPTSTR szDomain, LPDWORD cbDomain );
  28. #define ENTER() CFunctionMarker fa( __FUNCTION__ )
  29. class CFunctionMarker
  30. {
  31. private:
  32. TCHAR m_szFunctionName[100];
  33. public:
  34. CFunctionMarker( char *aszFunctionName )
  35. {
  36. #ifdef _UNICODE
  37. int iCount = MultiByteToWideChar(
  38. CP_ACP,
  39. 0,
  40. aszFunctionName,
  41. -1,
  42. m_szFunctionName,
  43. sizeof( m_szFunctionName ) / sizeof( TCHAR ) );
  44. #else
  45. strncpy( m_szFunctionName, aszFunctionName, sizeof( m_szFunctionName ) );
  46. #endif
  47. Log( TEXT( "Entering %s" ), m_szFunctionName );
  48. }
  49. ~CFunctionMarker()
  50. {
  51. Log( TEXT( "Leaving %s" ), m_szFunctionName );
  52. }
  53. };