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.

197 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. utils.h
  5. Abstract:
  6. definitions of utility functions.
  7. Author:
  8. Bob Watson (a-robw)
  9. Revision History:
  10. 23 nov 94
  11. --*/
  12. #ifndef _UTILS_H_
  13. #define _UTILS_H_
  14. #ifdef _UNICODE
  15. typedef struct _WOFSTRUCT {
  16. BYTE cBytes;
  17. BYTE fFixedDisk;
  18. WORD nErrCode;
  19. WORD Reserved1;
  20. WORD Reserved2;
  21. WCHAR szPathName[OFS_MAXPATHNAME];
  22. } WOFSTRUCT, *LPWOFSTRUCT;
  23. typedef WOFSTRUCT TOFSTRUCT, *LPTOFSTRUCT;
  24. #else
  25. typedef OFSTRUCT TOFSTRUCT, *LPTOFSTRUCT;
  26. #endif
  27. #ifdef _UNICODE
  28. #define GetProcAddressT GetProcAddressW
  29. #define OpenFileT OpenFileW
  30. // wide character function prototypes
  31. FARPROC
  32. GetProcAddressW (
  33. IN HMODULE hModule,
  34. IN LPCWSTR lpwszProc
  35. );
  36. HFILE
  37. OpenFileW(
  38. LPCTSTR lpwszFile,
  39. LPWOFSTRUCT lpWOpenBuff,
  40. UINT fuMode
  41. );
  42. #else // if _UNICODE not defined
  43. #define GetProcAddressT GetProcAddress
  44. #define OpenFileT OpenFile
  45. #endif
  46. //
  47. // utility routines
  48. //
  49. DWORD
  50. QuietGetFileAttributes (
  51. IN LPCTSTR lpszFileName
  52. );
  53. BOOL
  54. EnableSecurityPriv (
  55. VOID
  56. );
  57. BOOL
  58. EnableAllPriv (
  59. VOID
  60. );
  61. BOOL
  62. TrimSpaces (
  63. IN OUT LPTSTR szString
  64. );
  65. BOOL
  66. IsUncPath (
  67. IN LPCTSTR szPath
  68. );
  69. LPTSTR
  70. GetFileNameFromPath (
  71. IN LPCTSTR szPath
  72. );
  73. BOOL
  74. CenterWindow (
  75. HWND hwndChild,
  76. HWND hwndParent
  77. );
  78. UINT
  79. GetDriveTypeFromDosPath (
  80. IN LPCTSTR szDosPath
  81. );
  82. LPCTSTR
  83. GetItemFromIniEntry (
  84. IN LPCTSTR szEntry,
  85. IN DWORD dwItem
  86. );
  87. LPCTSTR
  88. GetStringResource (
  89. IN HANDLE hInstance,
  90. IN UINT nId
  91. );
  92. LPCTSTR
  93. GetQuotedStringResource (
  94. IN HANDLE hInstance,
  95. IN UINT nId
  96. );
  97. LPCTSTR
  98. EnquoteString (
  99. IN LPCTSTR szInString
  100. );
  101. LONG
  102. GetExpandedFileName (
  103. IN LPTSTR szInFileName,
  104. IN DWORD dwMaxExpandedSize,
  105. OUT LPTSTR szExpandedFileName,
  106. OUT LPTSTR *pFileNamePart
  107. );
  108. LONG
  109. CreateDirectoryFromPath (
  110. IN LPCTSTR szPath,
  111. IN LPSECURITY_ATTRIBUTES lpSA
  112. );
  113. BOOL
  114. FileExists (
  115. IN LPCTSTR szPath
  116. );
  117. LPCTSTR
  118. GetKeyFromIniEntry (
  119. IN LPCTSTR szEntry
  120. );
  121. DWORD
  122. StripQuotes (
  123. IN OUT LPSTR szBuff
  124. );
  125. BOOL
  126. GetInfPath (
  127. IN HWND hWnd,
  128. IN UINT nFileNameId,
  129. OUT LPTSTR szPathBuffer
  130. );
  131. BOOL
  132. GetFilePath (
  133. IN LPCTSTR szFileName,
  134. OUT LPTSTR szPathBuffer
  135. );
  136. BOOL
  137. DrawRaisedShading (
  138. IN LPRECT prShadeRect,
  139. IN LPPAINTSTRUCT ps,
  140. IN LONG lDepth,
  141. IN HPEN hpenHighlight,
  142. IN HPEN hpenShadow
  143. );
  144. BOOL
  145. DrawSeparatorLine (
  146. IN LPRECT lprLine,
  147. IN LPPAINTSTRUCT ps,
  148. IN HPEN hpenLine
  149. );
  150. DWORD
  151. GetFileSizeFromPath (
  152. LPCTSTR szPath
  153. );
  154. #endif //_UTILS_H_