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.

91 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. FTMan
  5. File Name:
  6. Global.h
  7. Abstract:
  8. Definitions of useful global functions
  9. Author:
  10. Cristian Teodorescu October 29, 1998
  11. Notes:
  12. Revision History:
  13. --*/
  14. /////////////////////////////////////////////////////////////////////////////
  15. #if !defined(AFX_GLOBAL_H_INCLUDED_)
  16. #define AFX_GLOBAL_H_INCLUDED_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif // _MSC_VER > 1000
  20. #include <fttypes.h>
  21. #include <winioctl.h>
  22. /////////////////////////////////////////////////////////////////////////////////////////////
  23. // Display stuff
  24. // Display the last system error message prefixed ( or not ) with another string taken from
  25. // our resources explaining the context of the failure
  26. BOOL DisplaySystemErrorMessage( UINT unContextMsgID=0 );
  27. // Format the size of a volume in a "readable" way
  28. // ( in GB, MB, KB depending on the size )
  29. void FormatVolumeSize( CString& strSize, LONGLONG llSize );
  30. // Display a message in the first pane of the main frame status bar
  31. BOOL DisplayStatusBarMessage( LPCTSTR lpszMsg );
  32. // Displays a message in the first pane of the main frame status bar
  33. BOOL DisplayStatusBarMessage( UINT unMsgID );
  34. // Copy a Unicode character array into a CString
  35. void CopyW2Str( CString& strDest, LPWSTR strSource, ULONG ulLength );
  36. // Copy a CString content into a Unicode character array
  37. void CopyStr2W( LPWSTR strDest, CString& strSource );
  38. /////////////////////////////////////////////////////////////////////////////////////////////
  39. // Volume stuff
  40. // Open a volume given its name
  41. // The name must be like this: "\\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\"
  42. HANDLE OpenVolume( const CString& strVolumeName );
  43. // Query the drive letter and the name of the volume given its NT Name
  44. // The name will be like this: "\\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
  45. BOOL QueryDriveLetterAndVolumeName( CString& strNTName, TCHAR& cDriveLetter, CString& strVolumeName );
  46. // Query the mount manager for all mount paths of the given volumes
  47. // Each found mount path is added to the corresponding volume in array arrItems ( if any )
  48. void QueryMountList( CObArray& arrVolumesData );
  49. // Scans an array of CLVTreeItemData and converts all physical partitions to FT partitions.
  50. // Then return the logical volume ID's of all items in the array
  51. BOOL ConvertPartitionsToFT( CObArray& arrVolumeData, FT_LOGICAL_DISK_ID* arrVolID );
  52. // Scans an array of CLVTreeItemData and deconverts all physical partitions from FT partitions.
  53. BOOL DeconvertPartitionsFromFT( CObArray& arrVolumeData, FT_LOGICAL_DISK_ID* arrVolID, int nItems = -1 );
  54. //////////////////////////////////////////////////////////////////////////////////////////////
  55. // System stuff
  56. // Checks whether the current user is a member of the Administrators' group
  57. BOOL CheckAdministratorsMembership( BOOL& bIsAdministrator );
  58. #endif // !defined(AFX_GLOBAL_H_INCLUDED_)