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.

50 lines
950 B

  1. #include <stdinc.h>
  2. BOOL
  3. W32::SetFileAttributesW(
  4. PCWSTR lpFileName,
  5. DWORD dwFileAttributes,
  6. DWORD &rdwWin32Error,
  7. ULONG cELEV,
  8. va_list ap
  9. )
  10. {
  11. rdwWin32Error = ERROR_SUCCESS;
  12. BOOL fSuccess = ::SetFileAttributesW(lpFileName, dwFileAttributes);
  13. if ((!fSuccess) && (cELEV != 0))
  14. {
  15. if (::IsLastErrorInList(cELEV, ap, rdwWin32Error))
  16. fSuccess = TRUE;
  17. }
  18. return fSuccess;
  19. }
  20. BOOL
  21. W32::SetFileAttributesW(
  22. PCWSTR lpFileName,
  23. DWORD dwFileAttributes,
  24. DWORD &rdwWin32Error,
  25. ULONG cELEV,
  26. ...
  27. )
  28. {
  29. BOOL fSuccess;
  30. va_list ap;
  31. va_start(ap, cELEV);
  32. fSuccess = W32::SetFileAttributesW(lpFileName, dwFileAttributes, rdwWin32Error, cELEV, ap);
  33. va_end(ap);
  34. return fSuccess;
  35. }
  36. BOOL
  37. W32::SetFileAttributesW(
  38. PCWSTR lpFileName,
  39. DWORD dwFileAttributes
  40. )
  41. {
  42. DWORD x;
  43. return W32::SetFileAttributesW(lpFileName, dwFileAttributes, x, 0);
  44. }