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.

75 lines
1.9 KiB

  1. struct PER_USER_PATH
  2. {
  3. LPWSTR wszFile;
  4. LPWSTR wszPerUserFile;
  5. LPSTR szFile;
  6. LPSTR szPerUserFile;
  7. DWORD cFileLen; // Length of the file name in symbols
  8. BOOL bInitANSIFailed; // Indicates that path name is not
  9. // translatable to ANSI
  10. BOOL bWildCardUsed; // TRUE if file name has * in it.
  11. LPSTR szPerUserDir; // Per-user directory for a file
  12. LPWSTR wszPerUserDir; // Per-user directory for a file
  13. DWORD cPerUserDirLen;
  14. PER_USER_PATH():
  15. wszFile(NULL), wszPerUserDir(NULL),
  16. szFile(NULL), szPerUserDir(NULL), cFileLen(0),
  17. bInitANSIFailed(FALSE), bWildCardUsed(FALSE),
  18. wszPerUserFile(NULL), szPerUserFile(NULL),
  19. cPerUserDirLen(0)
  20. {
  21. }
  22. ~PER_USER_PATH()
  23. {
  24. if (wszFile) {
  25. LocalFree(wszFile);
  26. }
  27. if (wszPerUserDir) {
  28. LocalFree(wszPerUserDir);
  29. }
  30. if (szFile) {
  31. LocalFree(szFile);
  32. }
  33. if (szPerUserDir) {
  34. LocalFree(szPerUserDir);
  35. }
  36. if (szPerUserFile) {
  37. LocalFree(szPerUserFile);
  38. }
  39. if (wszPerUserFile) {
  40. LocalFree(wszPerUserFile);
  41. }
  42. }
  43. DWORD Init(IN HKEY hKey, IN DWORD dwIndex);
  44. LPCSTR PathForFileA(IN LPCSTR szInFile, IN DWORD dwInLen);
  45. LPCWSTR PathForFileW(IN LPCWSTR wszInFile, IN DWORD dwInLen);
  46. private:
  47. BOOL InitANSI();
  48. };
  49. class CPerUserPaths
  50. {
  51. private:
  52. PER_USER_PATH* m_pPaths;
  53. DWORD m_cPaths;
  54. public:
  55. CPerUserPaths();
  56. ~CPerUserPaths();
  57. BOOL Init();
  58. LPCSTR GetPerUserPathA(IN LPCSTR lpFileName);
  59. LPCWSTR GetPerUserPathW(IN LPCWSTR lpFileName);
  60. private:
  61. BOOL IsAppCompatOn();
  62. };