VirtualBox

Ignore:
Timestamp:
Oct 17, 2013 7:22:02 AM (11 years ago)
Author:
vboxsync
Message:

SUPR3: Use NtDeviceIoControlFile instead of DeviceIoControl to avoid wasting precious ticks on silly API conversions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/nt/internal-r3-nt.h

    r47535 r49150  
    55
    66/*
    7  * Copyright (C) 2010-2012 Oracle Corporation
     7 * Copyright (C) 2010-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030
    3131
    32 /*******************************************************************************
    33 *   Header Files                                                               *
    34 *******************************************************************************/
    35 #include <ntstatus.h>
    36 #ifdef IPRT_NT_USE_WINTERNL
    37 # define WIN32_NO_STATUS
    38 # include <windef.h>
    39 # include <winnt.h>
    40 # include <winternl.h>
    41 # define IPRT_NT_NEED_API_GROUP_1
    42 
    43 #elif defined(IPRT_NT_USE_WDM)
    44 # include <wdm.h>
    45 # define IPRT_NT_NEED_API_GROUP_1
    46 
    47 #else
    48 # include <ntifs.h>
    49 #endif
     32#include <iprt/nt/nt.h>
    5033#include "internal/iprt.h"
    5134
    52 
    53 /*******************************************************************************
    54 *   Defined Constants And Macros                                               *
    55 *******************************************************************************/
    56 /** Indicates that we're targetting native NT in the current source. */
    57 #define RT_USE_NATIVE_NT                1
    58 /** Initializes a IO_STATUS_BLOCK. */
    59 #define MY_IO_STATUS_BLOCK_INITIALIZER  { STATUS_FAILED_DRIVER_ENTRY, ~(uintptr_t)42 }
    60 /** Similar to INVALID_HANDLE_VALUE in the Windows environment. */
    61 #define MY_INVALID_HANDLE_VALUE         ( (HANDLE)~(uintptr_t)0 )
    6235
    6336#ifdef DEBUG_bird
     
    6639# define IPRT_WITH_NT_PATH_PASSTHRU 1
    6740#endif
    68 
    69 
    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,
    77                      ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir);
    78 int  rtNtPathClose(HANDLE hHandle);
    7941
    8042
     
    10264}
    10365
    104 
    105 /*******************************************************************************
    106 *   NT APIs                                                                    *
    107 *******************************************************************************/
    108 
    109 RT_C_DECLS_BEGIN
    110 
    111 #ifdef IPRT_NT_NEED_API_GROUP_1
    112 
    113 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
    114 {
    115     ULONG   FileSystemAttributes;
    116     LONG    MaximumComponentNameLength;
    117     ULONG   FileSystemNameLength;
    118     WCHAR   FileSystemName[1];
    119 } FILE_FS_ATTRIBUTE_INFORMATION;
    120 typedef FILE_FS_ATTRIBUTE_INFORMATION *PFILE_FS_ATTRIBUTE_INFORMATION;
    121 extern "C" NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
    122 
    12366#endif
    12467
    125 NTSTATUS NTAPI NtOpenDirectoryObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
    126 
    127 typedef struct _OBJECT_DIRECTORY_INFORMATION
    128 {
    129     UNICODE_STRING Name;
    130     UNICODE_STRING TypeName;
    131 } OBJECT_DIRECTORY_INFORMATION;
    132 typedef OBJECT_DIRECTORY_INFORMATION *POBJECT_DIRECTORY_INFORMATION;
    133 
    134 NTSTATUS NTAPI NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG);
    135 
    136 
    137 RT_C_DECLS_END
    138 
    139 #endif
    140 
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette