Changeset 49150 in vbox for trunk/include/iprt
- Timestamp:
- Oct 17, 2013 7:22:02 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 90010
- Location:
- trunk/include/iprt/nt
- Files:
-
- 1 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/nt/nt.h
r49147 r49150 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Internal Header for the Native NT code.3 * IPRT - Header for code using the Native NT API. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2010-201 2Oracle Corporation7 * Copyright (C) 2010-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 */ 26 26 27 #ifndef ___iprt_nt_nt_h___ 28 #define ___iprt_nt_nt_h___ 27 29 28 #ifndef ___internal_r3_nt_h___29 #define ___internal_r3_nt_h___30 31 32 /*******************************************************************************33 * Header Files *34 *******************************************************************************/35 30 #include <ntstatus.h> 36 31 #ifdef IPRT_NT_USE_WINTERNL … … 39 34 # include <winnt.h> 40 35 # include <winternl.h> 36 # undef WIN32_NO_STATUS 37 # include <ntstatus.h> 41 38 # define IPRT_NT_NEED_API_GROUP_1 42 39 … … 48 45 # include <ntifs.h> 49 46 #endif 50 #include "internal/iprt.h"47 #include <iprt/types.h> 51 48 52 49 53 /******************************************************************************* 54 * Defined Constants And Macros * 55 *******************************************************************************/ 50 /** @name Useful macros 51 * @{ */ 56 52 /** Indicates that we're targetting native NT in the current source. */ 57 #define RT _USE_NATIVE_NT153 #define RTNT_USE_NATIVE_NT 1 58 54 /** Initializes a IO_STATUS_BLOCK. */ 59 #define MY_IO_STATUS_BLOCK_INITIALIZER { STATUS_FAILED_DRIVER_ENTRY, ~(uintptr_t)42 }55 #define RTNT_IO_STATUS_BLOCK_INITIALIZER { STATUS_FAILED_DRIVER_ENTRY, ~(uintptr_t)42 } 60 56 /** Similar to INVALID_HANDLE_VALUE in the Windows environment. */ 61 #define MY_INVALID_HANDLE_VALUE ( (HANDLE)~(uintptr_t)0 ) 62 63 #ifdef DEBUG_bird 64 /** Enables the "\\!\" NT path pass thru as well as hacks for listing NT object 65 * directories. */ 66 # define IPRT_WITH_NT_PATH_PASSTHRU 1 67 #endif 57 #define RTNT_INVALID_HANDLE_VALUE ( (HANDLE)~(uintptr_t)0 ) 58 /** @} */ 68 59 69 60 70 /******************************************************************************* 71 * Internal Functions * 72 *******************************************************************************/ 73 int rtNtPathOpen(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess, 74 ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs, 75 PHANDLE phHandle, PULONG_PTR puDisposition); 76 int rtNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions, 61 /** @name IPRT helper functions for NT 62 * @{ */ 63 RT_C_DECLS_BEGIN 64 65 RTDECL(int) RTNtPathOpen(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess, 66 ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs, 67 PHANDLE phHandle, PULONG_PTR puDisposition); 68 RTDECL(int) RTNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions, 77 69 ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir); 78 int rtNtPathClose(HANDLE hHandle); 70 RTDECL(int) RTNtPathClose(HANDLE hHandle); 71 72 RT_C_DECLS_END 73 /** @} */ 79 74 80 75 81 /** 82 * Internal helper for comparing a WCHAR string with a char string. 83 * 84 * @returns @c true if equal, @c false if not. 85 * @param pwsz1 The first string. 86 * @param cb1 The length of the first string, in bytes. 87 * @param psz2 The second string. 88 * @param cch2 The length of the second string. 89 */ 90 DECLINLINE(bool) rtNtCompWideStrAndAscii(WCHAR const *pwsz1, size_t cch1, const char *psz2, size_t cch2) 91 { 92 if (cch1 != cch2 * 2) 93 return false; 94 while (cch2-- > 0) 95 { 96 unsigned ch1 = *pwsz1++; 97 unsigned ch2 = (unsigned char)*psz2++; 98 if (ch1 != ch2) 99 return false; 100 } 101 return true; 102 } 103 104 105 /******************************************************************************* 106 * NT APIs * 107 *******************************************************************************/ 108 76 /** @name NT API delcarations. 77 * @{ */ 109 78 RT_C_DECLS_BEGIN 110 79 … … 119 88 } FILE_FS_ATTRIBUTE_INFORMATION; 120 89 typedef FILE_FS_ATTRIBUTE_INFORMATION *PFILE_FS_ATTRIBUTE_INFORMATION; 90 91 typedef enum 92 { 93 FileFsVolumeInformation = 1, 94 FileFsLabelInformation, 95 FileFsSizeInformation, 96 FileFsDeviceInformation, 97 FileFsAttributeInformation, 98 FileFsControlInformation, 99 FileFsFullSizeInformation, 100 FileFsObjectIdInformation, 101 FileFsMaximumInformation 102 } FS_INFORMATION_CLASS; 103 typedef FS_INFORMATION_CLASS *PFS_INFORMATION_CLASS; 121 104 extern "C" NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS); 122 105 … … 134 117 NTSTATUS NTAPI NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG); 135 118 136 137 119 RT_C_DECLS_END 120 /** @} */ 138 121 139 122 #endif
Note:
See TracChangeset
for help on using the changeset viewer.