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.

54 lines
2.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1998.
  5. //
  6. // File: NtOpen.hxx
  7. //
  8. // Contents: Helper routines over Nt I/O API
  9. //
  10. // History: 09-Dec-97 Kyle Added header
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. HANDLE CiNtOpen( WCHAR const * pwcsPath,
  15. ACCESS_MASK DesiredAccess,
  16. ULONG ShareAccess,
  17. ULONG OpenOptions );
  18. NTSTATUS CiNtOpenNoThrow( HANDLE & handle,
  19. WCHAR const * pwcsPath,
  20. ACCESS_MASK DesiredAccess,
  21. ULONG ShareAccess,
  22. ULONG OpenOptions );
  23. inline BOOL IsSharingViolation( DWORD dwStatus )
  24. {
  25. return STATUS_SHARING_VIOLATION == dwStatus ||
  26. STATUS_OPLOCK_NOT_GRANTED == dwStatus ||
  27. STATUS_OPLOCK_BREAK_IN_PROGRESS == dwStatus ||
  28. ERROR_SHARING_VIOLATION == dwStatus ||
  29. FILTER_E_IN_USE == dwStatus ||
  30. STG_E_SHAREVIOLATION == dwStatus ||
  31. HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION) == dwStatus;
  32. }
  33. inline BOOL IsNetDisconnect( DWORD dwStatus )
  34. {
  35. return STATUS_BAD_NETWORK_NAME == dwStatus ||
  36. STATUS_LOGON_FAILURE == dwStatus ||
  37. STATUS_NETWORK_UNREACHABLE == dwStatus ||
  38. STATUS_NETWORK_NAME_DELETED == dwStatus ||
  39. STATUS_BAD_NETWORK_PATH == dwStatus ||
  40. STATUS_NETWORK_BUSY == dwStatus ||
  41. STATUS_UNEXPECTED_NETWORK_ERROR == dwStatus ||
  42. STATUS_VIRTUAL_CIRCUIT_CLOSED == dwStatus ||
  43. STATUS_LOCAL_DISCONNECT == dwStatus ||
  44. STATUS_REMOTE_DISCONNECT == dwStatus ||
  45. STATUS_REQUEST_NOT_ACCEPTED == dwStatus ||
  46. STATUS_HOST_UNREACHABLE == dwStatus ||
  47. STATUS_PROTOCOL_UNREACHABLE == dwStatus ||
  48. STATUS_LINK_FAILED == dwStatus;
  49. }