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.

65 lines
1.6 KiB

  1. #include <stdinc.h>
  2. HANDLE
  3. W32::CreateFileW(
  4. PCWSTR lpFileName,
  5. DWORD dwDesiredAccess,
  6. DWORD dwShareMode,
  7. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  8. DWORD dwCreationDisposition,
  9. DWORD dwFlagsAndAttributes,
  10. HANDLE hTemplateFile,
  11. DWORD &rdwWin32Error,
  12. ULONG cELEV,
  13. va_list ap
  14. )
  15. {
  16. rdwWin32Error = ERROR_SUCCESS;
  17. HANDLE hResult = ::CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
  18. if ((hResult == INVALID_HANDLE_VALUE) && (cELEV != 0))
  19. {
  20. if (::IsLastErrorInList(cELEV, ap, rdwWin32Error))
  21. hResult = NULL;
  22. }
  23. return hResult;
  24. }
  25. HANDLE
  26. W32::CreateFileW(
  27. PCWSTR lpFileName,
  28. DWORD dwDesiredAccess,
  29. DWORD dwShareMode,
  30. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  31. DWORD dwCreationDisposition,
  32. DWORD dwFlagsAndAttributes,
  33. HANDLE hTemplateFile,
  34. DWORD &rdwWin32Error,
  35. ULONG cELEV,
  36. ...
  37. )
  38. {
  39. va_list ap;
  40. HANDLE h;
  41. va_start(ap, cELEV);
  42. h = W32::CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile, rdwWin32Error, cELEV, ap);
  43. va_end(ap);
  44. return h;
  45. }
  46. HANDLE
  47. W32::CreateFileW(
  48. PCWSTR lpFileName,
  49. DWORD dwDesiredAccess,
  50. DWORD dwShareMode,
  51. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  52. DWORD dwCreationDisposition,
  53. DWORD dwFlagsAndAttributes,
  54. HANDLE hTemplateFile
  55. )
  56. {
  57. DWORD x;
  58. return W32::CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile, x, 0);
  59. }