VirtualBox

Changeset 49150 in vbox


Ignore:
Timestamp:
Oct 17, 2013 7:22:02 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90010
Message:

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

Location:
trunk
Files:
1 added
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nt/nt.h

    r49147 r49150  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Internal Header for the Native NT code.
     3 * IPRT - Header for code using the Native NT API.
    44 */
    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
     
    2525 */
    2626
     27#ifndef ___iprt_nt_nt_h___
     28#define ___iprt_nt_nt_h___
    2729
    28 #ifndef ___internal_r3_nt_h___
    29 #define ___internal_r3_nt_h___
    30 
    31 
    32 /*******************************************************************************
    33 *   Header Files                                                               *
    34 *******************************************************************************/
    3530#include <ntstatus.h>
    3631#ifdef IPRT_NT_USE_WINTERNL
     
    3934# include <winnt.h>
    4035# include <winternl.h>
     36# undef WIN32_NO_STATUS
     37# include <ntstatus.h>
    4138# define IPRT_NT_NEED_API_GROUP_1
    4239
     
    4845# include <ntifs.h>
    4946#endif
    50 #include "internal/iprt.h"
     47#include <iprt/types.h>
    5148
    5249
    53 /*******************************************************************************
    54 *   Defined Constants And Macros                                               *
    55 *******************************************************************************/
     50/** @name Useful macros
     51 * @{ */
    5652/** Indicates that we're targetting native NT in the current source. */
    57 #define RT_USE_NATIVE_NT                1
     53#define RTNT_USE_NATIVE_NT              1
    5854/** 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 }
    6056/** 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/** @}  */
    6859
    6960
    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 * @{ */
     63RT_C_DECLS_BEGIN
     64
     65RTDECL(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);
     68RTDECL(int) RTNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions,
    7769                     ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir);
    78 int  rtNtPathClose(HANDLE hHandle);
     70RTDECL(int) RTNtPathClose(HANDLE hHandle);
     71
     72RT_C_DECLS_END
     73/** @} */
    7974
    8075
    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 * @{ */
    10978RT_C_DECLS_BEGIN
    11079
     
    11988} FILE_FS_ATTRIBUTE_INFORMATION;
    12089typedef FILE_FS_ATTRIBUTE_INFORMATION *PFILE_FS_ATTRIBUTE_INFORMATION;
     90
     91typedef 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;
     103typedef FS_INFORMATION_CLASS *PFS_INFORMATION_CLASS;
    121104extern "C" NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
    122105
     
    134117NTSTATUS NTAPI NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG);
    135118
    136 
    137119RT_C_DECLS_END
     120/** @} */
    138121
    139122#endif
  • trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp

    r44528 r49150  
    3838#endif
    3939
    40 #include <Windows.h>
     40#define USE_NT_DEVICE_IO_CONTROL_FILE
     41#ifdef USE_NT_DEVICE_IO_CONTROL_FILE
     42# include <iprt/nt/nt-and-windows.h>
     43#else
     44# include <Windows.h>
     45#endif
    4146
    4247#include <VBox/sup.h>
     
    7580static int suplibOsStartService(void);
    7681static int suplibOsStopService(void);
     82#ifdef USE_NT_DEVICE_IO_CONTROL_FILE
     83static int suplibConvertNtStatus(NTSTATUS rcNt);
     84#else
    7785static int suplibConvertWin32Err(int);
     86#endif
    7887
    7988
     
    496505    PSUPREQHDR pHdr = (PSUPREQHDR)pvReq;
    497506    Assert(cbReq == RT_MAX(pHdr->cbIn, pHdr->cbOut));
     507# ifdef USE_NT_DEVICE_IO_CONTROL_FILE
     508    IO_STATUS_BLOCK Ios;
     509    Ios.Status = -1;
     510    Ios.Information = 0;
     511    NTSTATUS rcNt = NtDeviceIoControlFile((HANDLE)pThis->hDevice, NULL /*hEvent*/, NULL /*pfnApc*/, NULL /*pvApcCtx*/, &Ios,
     512                                          (ULONG)uFunction,
     513                                          pvReq /*pvInput */, pHdr->cbIn /* cbInput */,
     514                                          pvReq /*pvOutput*/, pHdr->cbOut /* cbOutput */);
     515    if (NT_SUCCESS(rcNt))
     516    {
     517        if (NT_SUCCESS(Ios.Status))
     518            return VINF_SUCCESS;
     519        rcNt = Ios.Status;
     520    }
     521    return suplibConvertNtStatus(rcNt);
     522
     523# else
    498524    DWORD cbReturned = (ULONG)pHdr->cbOut;
    499525    if (DeviceIoControl((HANDLE)pThis->hDevice, uFunction, pvReq, pHdr->cbIn, pvReq, cbReturned, &cbReturned, NULL))
    500526        return 0;
    501527    return suplibConvertWin32Err(GetLastError());
     528# endif
    502529}
    503530
     
    508535     * Issue device I/O control.
    509536     */
     537# ifdef USE_NT_DEVICE_IO_CONTROL_FILE
     538    IO_STATUS_BLOCK Ios;
     539    Ios.Status = -1;
     540    Ios.Information = 0;
     541    NTSTATUS rcNt = NtDeviceIoControlFile((HANDLE)pThis->hDevice, NULL /*hEvent*/, NULL /*pfnApc*/, NULL /*pvApcCtx*/, &Ios,
     542                                          (ULONG)uFunction,
     543                                          (PVOID)idCpu /*pvInput */, 0 /* cbInput */,
     544                                          NULL /*pvOutput*/, 0 /* cbOutput */);
     545    if (NT_SUCCESS(rcNt))
     546    {
     547        if (NT_SUCCESS(Ios.Status))
     548            return VINF_SUCCESS;
     549        rcNt = Ios.Status;
     550    }
     551    return suplibConvertNtStatus(rcNt);
     552# else
    510553    DWORD cbReturned = 0;
    511554    if (DeviceIoControl((HANDLE)pThis->hDevice, uFunction, NULL, 0, (LPVOID)idCpu, 0, &cbReturned, NULL))
    512555        return VINF_SUCCESS;
    513556    return suplibConvertWin32Err(GetLastError());
     557# endif
    514558}
    515559
     
    521565    if (*ppvPages)
    522566        return VINF_SUCCESS;
    523     return suplibConvertWin32Err(GetLastError());
     567    return RTErrConvertFromWin32(GetLastError());
    524568}
    525569
     
    530574    if (VirtualFree(pvPages, 0, MEM_RELEASE))
    531575        return VINF_SUCCESS;
    532     return suplibConvertWin32Err(GetLastError());
    533 }
    534 
    535 
     576    return RTErrConvertFromWin32(GetLastError());
     577}
     578
     579
     580# ifndef USE_NT_DEVICE_IO_CONTROL_FILE
    536581/**
    537582 * Converts a supdrv win32 error code to an IPRT status code.
     
    585630    return RTErrConvertFromWin32(rc);
    586631}
     632# else
     633/**
     634 * Reverse of VBoxDrvNtErr2NtStatus
     635 * returns VBox status code.
     636 * @param   rcNt    NT status code.
     637 */
     638static int suplibConvertNtStatus(NTSTATUS rcNt)
     639{
     640    switch (rcNt)
     641    {
     642        case STATUS_SUCCESS:                    return VINF_SUCCESS;
     643        case STATUS_NOT_SUPPORTED:              return VERR_GENERAL_FAILURE;
     644        case STATUS_INVALID_PARAMETER:          return VERR_INVALID_PARAMETER;
     645        case STATUS_UNKNOWN_REVISION:           return VERR_INVALID_MAGIC;
     646        case STATUS_INVALID_HANDLE:             return VERR_INVALID_HANDLE;
     647        case STATUS_INVALID_ADDRESS:            return VERR_INVALID_POINTER;
     648        case STATUS_NOT_LOCKED:                 return VERR_LOCK_FAILED;
     649        case STATUS_IMAGE_ALREADY_LOADED:       return VERR_ALREADY_LOADED;
     650        case STATUS_ACCESS_DENIED:              return VERR_PERMISSION_DENIED;
     651        case STATUS_REVISION_MISMATCH:          return VERR_VERSION_MISMATCH;
     652    }
     653
     654    /* Fall back on IPRT for the rest. */
     655    return RTErrConvertFromNtStatus(rcNt);
     656}
     657# endif
    587658
    588659#endif /* !IN_SUP_HARDENED_R3 */
  • trunk/src/VBox/Runtime/include/internal/dir.h

    r47535 r49150  
    9191    /** Handle to the opened directory search. */
    9292    HANDLE              hDir;
    93 #  ifndef RT_USE_NATIVE_NT
     93#  ifndef RTNT_USE_NATIVE_NT
    9494    /** Find data buffer.
    9595     * fDataUnread indicates valid data. */
  • trunk/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp

    r48935 r49150  
    105105    bool fObjDir;
    106106#endif
    107     rc = rtNtPathOpenDir(pszPathBuf,
     107    rc = RTNtPathOpenDir(pszPathBuf,
    108108                         FILE_READ_DATA | SYNCHRONIZE,
    109109                         FILE_SHARE_READ | FILE_SHARE_WRITE,
     
    149149     */
    150150    pDir->u32Magic = ~RTDIR_MAGIC;
    151     if (pDir->hDir != MY_INVALID_HANDLE_VALUE)
    152     {
    153         int rc = rtNtPathClose(pDir->hDir);
     151    if (pDir->hDir != RTNT_INVALID_HANDLE_VALUE)
     152    {
     153        int rc = RTNtPathClose(pDir->hDir);
    154154        AssertRC(rc);
    155         pDir->hDir = MY_INVALID_HANDLE_VALUE;
     155        pDir->hDir = RTNT_INVALID_HANDLE_VALUE;
    156156    }
    157157    RTStrFree(pDir->pszName);
     
    281281     */
    282282    NTSTATUS rcNt;
    283     IO_STATUS_BLOCK Ios = MY_IO_STATUS_BLOCK_INITIALIZER;
     283    IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER;
    284284    if (pThis->enmInfoClass != (FILE_INFORMATION_CLASS)0)
    285285    {
  • trunk/src/VBox/Runtime/r3/nt/fs-nt.cpp

    r48935 r49150  
    5353     */
    5454    HANDLE hFile;
    55     int rc = rtNtPathOpen(pszFsPath,
     55    int rc = RTNtPathOpen(pszFsPath,
    5656                          GENERIC_READ,
    5757                          FILE_ATTRIBUTE_NORMAL,
     
    6868         */
    6969        FILE_FS_SIZE_INFORMATION FsSizeInfo;
    70         IO_STATUS_BLOCK Ios = MY_IO_STATUS_BLOCK_INITIALIZER;
     70        IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER;
    7171        NTSTATUS rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &FsSizeInfo, sizeof(FsSizeInfo), FileFsSizeInformation);
    7272        if (NT_SUCCESS(rcNt))
     
    108108            rc = RTErrConvertFromNtStatus(rcNt);
    109109
    110         rtNtPathClose(hFile);
     110        RTNtPathClose(hFile);
    111111    }
    112112    return rc;
     
    126126     */
    127127    HANDLE hFile;
    128     int rc = rtNtPathOpen(pszFsPath,
     128    int rc = RTNtPathOpen(pszFsPath,
    129129                          GENERIC_READ,
    130130                          FILE_ATTRIBUTE_NORMAL,
     
    145145             uint8_t abBuf[sizeof(FILE_FS_VOLUME_INFORMATION) + 4096];
    146146        } u;
    147         IO_STATUS_BLOCK Ios = MY_IO_STATUS_BLOCK_INITIALIZER;
     147        IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER;
    148148        NTSTATUS rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &u, sizeof(u), FileFsVolumeInformation);
    149149        if (NT_SUCCESS(rcNt))
     
    152152            rc = RTErrConvertFromNtStatus(rcNt);
    153153
    154         rtNtPathClose(hFile);
     154        RTNtPathClose(hFile);
    155155    }
    156156    return rc;
     
    170170     */
    171171    HANDLE hFile;
    172     int rc = rtNtPathOpen(pszFsPath,
     172    int rc = RTNtPathOpen(pszFsPath,
    173173                          GENERIC_READ,
    174174                          FILE_ATTRIBUTE_NORMAL,
     
    189189            uint8_t abBuf[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 4096];
    190190        } u;
    191         IO_STATUS_BLOCK Ios = MY_IO_STATUS_BLOCK_INITIALIZER;
     191        IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER;
    192192        NTSTATUS rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &u, sizeof(u), FileFsAttributeInformation);
    193193        if (NT_SUCCESS(rcNt))
     
    220220            rc = RTErrConvertFromNtStatus(rcNt);
    221221
    222         rtNtPathClose(hFile);
     222        RTNtPathClose(hFile);
    223223    }
    224224    return rc;
     
    240240     */
    241241    HANDLE hFile;
    242     int rc = rtNtPathOpen(pszFsPath,
     242    int rc = RTNtPathOpen(pszFsPath,
    243243                          GENERIC_READ,
    244244                          FILE_ATTRIBUTE_NORMAL,
     
    259259            uint8_t abBuf[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 4096];
    260260        } u;
    261         IO_STATUS_BLOCK Ios = MY_IO_STATUS_BLOCK_INITIALIZER;
     261        IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER;
    262262        NTSTATUS rcNt = NtQueryVolumeInformationFile(hFile, &Ios, &u, sizeof(u), FileFsAttributeInformation);
    263263        if (NT_SUCCESS(rcNt))
     
    278278            rc = RTErrConvertFromNtStatus(rcNt);
    279279
    280         rtNtPathClose(hFile);
    281     }
    282     return rc;
    283 }
    284 
     280        RTNtPathClose(hFile);
     281    }
     282    return rc;
     283}
     284
  • 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 
  • trunk/src/VBox/Runtime/r3/nt/pathint-nt.cpp

    r47535 r49150  
    203203 * @param   puAction            Where to return the action taken. Optional.
    204204 */
    205 int  rtNtPathOpen(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess,
    206                   ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs,
    207                   PHANDLE phHandle, PULONG_PTR puAction)
    208 {
    209     *phHandle = MY_INVALID_HANDLE_VALUE;
     205RTDECL(int) RTNtPathOpen(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess,
     206                         ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs,
     207                         PHANDLE phHandle, PULONG_PTR puAction)
     208{
     209    *phHandle = RTNT_INVALID_HANDLE_VALUE;
    210210
    211211    HANDLE         hRootDir;
     
    214214    if (RT_SUCCESS(rc))
    215215    {
    216         HANDLE              hFile = MY_INVALID_HANDLE_VALUE;
    217         IO_STATUS_BLOCK     Ios   = MY_IO_STATUS_BLOCK_INITIALIZER;
     216        HANDLE              hFile = RTNT_INVALID_HANDLE_VALUE;
     217        IO_STATUS_BLOCK     Ios   = RTNT_IO_STATUS_BLOCK_INITIALIZER;
    218218        OBJECT_ATTRIBUTES   ObjAttr;
    219219        InitializeObjectAttributes(&ObjAttr, &NtName, fObjAttribs, hRootDir, NULL);
     
    263263 *                              directory).
    264264 */
    265 int  rtNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions,
    266                      ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir)
    267 {
    268     *phHandle = MY_INVALID_HANDLE_VALUE;
     265RTDECL(int) RTNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions,
     266                            ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir)
     267{
     268    *phHandle = RTNT_INVALID_HANDLE_VALUE;
    269269
    270270    HANDLE         hRootDir;
     
    273273    if (RT_SUCCESS(rc))
    274274    {
    275         HANDLE              hFile = MY_INVALID_HANDLE_VALUE;
    276         IO_STATUS_BLOCK     Ios   = MY_IO_STATUS_BLOCK_INITIALIZER;
     275        HANDLE              hFile = RTNT_INVALID_HANDLE_VALUE;
     276        IO_STATUS_BLOCK     Ios   = RTNT_IO_STATUS_BLOCK_INITIALIZER;
    277277        OBJECT_ATTRIBUTES   ObjAttr;
    278278        InitializeObjectAttributes(&ObjAttr, &NtName, fObjAttribs, hRootDir, NULL);
     
    347347 * @param   hHandle             The handle value.
    348348 */
    349 int rtNtPathClose(HANDLE hHandle)
     349RTDECL(int) RTNtPathClose(HANDLE hHandle)
    350350{
    351351    NTSTATUS rcNt = NtClose(hHandle);
  • trunk/src/VBox/Runtime/r3/win/ntdll-mini-implib.c

    r47535 r49150  
    172172}
    173173
     174NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext,
     175                                              PIO_STATUS_BLOCK IoStatusBlock, ULONG IoControlCode, PVOID InputBuffer,
     176                                              LONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength)
     177{
     178    return -1;
     179}
     180
Note: See TracChangeset for help on using the changeset viewer.

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