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.

103 lines
4.8 KiB

  1. //////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Win32Unicode.h
  4. //
  5. // Copyright (C) 1998, 1999 Microsoft Corporation. All rights reserved.
  6. //
  7. // Abstract :
  8. //
  9. // History :
  10. //
  11. // 05/06/1999 luish Created
  12. //
  13. //////////////////////////////////////////////////////////////////////////////////////////////
  14. #if !defined(__WIN32API_)
  15. #define __WIN32API_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #include <windows.h>
  20. #include <stdio.h>
  21. #define OS_VERSION_WIN32S 0x00000000
  22. #define OS_VERSION_WIN95 0x00000001
  23. #define OS_VERSION_WIN95_OSR1 0x00000002
  24. #define OS_VERSION_WIN95_OSR2 0x00000004
  25. #define OS_VERSION_WIN95_OSR3 0x00000008
  26. #define OS_VERSION_WIN95_OSR4 0x00000010
  27. #define OS_VERSION_WIN98 0x00000020
  28. #define OS_VERSION_WIN98_OSR1 0x00000040
  29. #define OS_VERSION_WIN98_OSR2 0x00000080
  30. #define OS_VERSION_WIN98_OSR3 0x00000100
  31. #define OS_VERSION_WIN98_OSR4 0x00000200
  32. #define OS_VERSION_WINNT 0x00000400
  33. #define OS_VERSION_9x (OS_VERSION_WIN95 | OS_VERSION_WIN95_OSR1 | OS_VERSION_WIN95_OSR2 | OS_VERSION_WIN95_OSR3 | OS_VERSION_WIN95_OSR4 | OS_VERSION_WIN98 | OS_VERSION_WIN98_OSR1 | OS_VERSION_WIN98_OSR2 | OS_VERSION_WIN98_OSR3 | OS_VERSION_WIN98_OSR4)
  34. #define OS_VERSION_NT (OS_VERSION_WINNT)
  35. #define KILOBYTES(a) ((((a).HighPart & 0x3ff) << 22)||(((a).LowPart) >> 10))
  36. class CWin32API
  37. {
  38. public :
  39. CWin32API(void);
  40. ~CWin32API(void);
  41. static DWORD WideCharToMultiByte(LPCWSTR wszSourceString, const DWORD dwSourceLen, LPSTR szDestinationString, const DWORD dwDestinationLen);
  42. static DWORD MultiByteToWideChar(LPCSTR szSourceString, const DWORD dwSourceLen, LPWSTR wszDestinationString, const DWORD dwDestinationLen);
  43. DWORD GetOSVersion(void);
  44. DWORD GetDriveType(LPCSTR lpRootPathName);
  45. DWORD GetDriveType(LPCWSTR lpRootPathName);
  46. BOOL IsDriveFormatted(LPCSTR lpRootPathName);
  47. BOOL IsDriveFormatted(LPCWSTR lpRootPathName);
  48. DWORD GetDriveSize(LPCSTR lpRootPathName);
  49. DWORD GetDriveSize(LPCWSTR lpRootPathName);
  50. DWORD GetDriveFreeSpace(LPCSTR lpRootPathName);
  51. DWORD GetDriveFreeSpace(LPCWSTR lpRootPathName);
  52. DWORD GetDriveUserFreeSpace(LPCSTR lpRootPathName);
  53. DWORD GetDriveUserFreeSpace(LPCWSTR lpRootPathName);
  54. BOOL GetVolumeInformation(LPCSTR lpRootPathName, LPSTR lpVolumeLabel, const DWORD dwVolumeLabelSize, LPDWORD lpdwVolumeSerialNumber);
  55. BOOL GetVolumeInformation(LPCWSTR lpRootPathName, LPSTR lpVolumeLabel, const DWORD dwVolumeLabelSize, LPDWORD lpdwVolumeSerialNumber);
  56. BOOL CreateProcess(LPSTR lpCommandLine, PROCESS_INFORMATION * lpProcessInfo);
  57. BOOL CreateProcess(LPWSTR lpCommandLine, PROCESS_INFORMATION * lpProcessInfo);
  58. BOOL CreateProcess(LPSTR lpApplication, LPSTR lpCommandLine, PROCESS_INFORMATION * lpProcessInfo);
  59. BOOL CreateProcess(LPWSTR lpApplication, LPWSTR lpCommandLine, PROCESS_INFORMATION * lpProcessInfo);
  60. BOOL CreateDirectory(LPCSTR lpPathName, const BOOL fInitAppManRoot);
  61. BOOL CreateDirectory(LPCWSTR lpPathName, const BOOL fInitAppManRoot);
  62. BOOL RemoveDirectory(LPCSTR lpPathName);
  63. BOOL RemoveDirectory(LPCWSTR lpPathName);
  64. DWORD GetDirectorySize(LPCSTR lpPathName);
  65. DWORD GetDirectorySize(LPCWSTR lpPathName);
  66. BOOL IsValidFilename(LPCSTR lpFilename);
  67. BOOL IsValidFilename(LPCWSTR lpFilename);
  68. BOOL FileExists(LPCSTR lpFileName);
  69. BOOL FileExists(LPCWSTR lpFileName);
  70. DWORD FileAttributes(LPCSTR lpFilename);
  71. DWORD FileAttributes(LPCWSTR lpFilename);
  72. DWORD GetFileSize(LPCSTR lpFileName);
  73. DWORD GetFileSize(LPCWSTR lpFileName);
  74. HANDLE CreateFile(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes);
  75. HANDLE CreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes);
  76. BOOL DeleteFile(LPCSTR lpFileName);
  77. BOOL DeleteFile(LPCWSTR lpFileName);
  78. HANDLE CreateFileMapping(HANDLE hFile, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName);
  79. HANDLE CreateFileMapping(HANDLE hFile, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName);
  80. BOOL CopyFile(LPCSTR lpSourceFileName, LPCSTR lpDestinationFileName, BOOL bFailIfExists);
  81. BOOL CopyFile(LPCWSTR lpSourceFileName, LPCWSTR lpDestinationFileName, BOOL bFailIfExists);
  82. BOOL SetFileAttributes(LPCSTR lpFileName, const DWORD dwFileAttributes);
  83. BOOL SetFileAttributes(LPCWSTR lpFileName, const DWORD dwFileAttributes);
  84. private :
  85. DWORD m_dwOSVersion;
  86. };
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif // __WIN32API_