VirtualBox

Changeset 63073 in vbox


Ignore:
Timestamp:
Aug 5, 2016 10:46:32 PM (8 years ago)
Author:
vboxsync
Message:

GA/NT/SharedFolders: warnings

Location:
trunk/src/VBox/Additions/WINNT/SharedFolders/driver
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/Win2kWorkarounds.c

    r62522 r63073  
    129129
    130130    RtlInitUnicodeString(&RoutineName, L"RtlGetVersion");
    131     pfn = (PFNRTLGETVERSION)MmGetSystemRoutineAddress(&RoutineName);
     131    pfn = (PFNRTLGETVERSION)(uintptr_t)MmGetSystemRoutineAddress(&RoutineName);
    132132    if (!pfn)
    133133        pfn = Fake_RtlGetVersion;
    134     ASMAtomicWritePtr(&g_pfnRtlGetVersion, pfn);
     134    ASMAtomicWritePtr((void * volatile *)&g_pfnRtlGetVersion, (void *)(uintptr_t)pfn);
    135135
    136136    return pfn(pVerInfo);
     
    169169
    170170    RtlInitUnicodeString(&RoutineName, L"PsGetProcessImageFileName");
    171     pfn = (PFNPSGETPROCESSIMAGEFILENAME)MmGetSystemRoutineAddress(&RoutineName);
     171    pfn = (PFNPSGETPROCESSIMAGEFILENAME)(uintptr_t)MmGetSystemRoutineAddress(&RoutineName);
    172172    if (!pfn)
    173173        pfn = Fake_PsGetProcessImageFileName;
    174     ASMAtomicWritePtr(&g_pfnPsGetProcessImageFileName, pfn);
     174    ASMAtomicWritePtr((void * volatile *)&g_pfnPsGetProcessImageFileName, (void *)(uintptr_t)pfn);
    175175
    176176    return pfn(pProcess);
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/file.c

    r62522 r63073  
    11/* $Id$ */
    22/** @file
    3  *
    4  * VirtualBox Windows Guest Shared Folders
    5  *
    6  * File System Driver file routines
     3 * VirtualBox Windows Guest Shared Folders - File System Driver file routines.
    74 */
    85
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h

    r62522 r63073  
    11/* $Id$ */
    22/** @file
    3  *
    4  * VirtualBox Windows Guest Shared Folders
    5  *
    6  * File System Driver header file
     3 * VirtualBox Windows Guest Shared Folders - File System Driver header file
    74 */
    85
     
    3128 * System and RX headers.
    3229 */
    33 #include <ntifs.h>
    34 #include <windef.h>
    35 
    36 #include "rx.h"
     30#include <iprt/nt/nt.h> /* includes ntifs.h + wdm.h */
     31#include <iprt/win/windef.h>
     32#include <iprt/nt/rx.h>
    3733
    3834/*
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.c

    r62522 r63073  
    11/* $Id$ */
    22/** @file
    3  *
    4  * VirtualBox Windows Guest Shared Folders
    5  *
    6  * File System Driver system helpers
     3 * VirtualBox Windows Guest Shared Folders - File System Driver system helpers
    74 */
    85
     
    1916 */
    2017
    21 #include <ntifs.h>
    22 #include <ntdddisk.h>
     18#include <iprt/nt/nt.h> /* includes ntifs.h and wdm.h */
     19#include <iprt/win/ntdddisk.h>
    2320
    2421#include "vbsfhlp.h"
     
    2825#endif
    2926
    30 void vbsfHlpSleep (ULONG ulMillies)
     27void vbsfHlpSleep(ULONG ulMillies)
    3128{
    3229    KEVENT event;
     
    4744 *
    4845 */
    49 uint32_t VBoxToNTFileAttributes (uint32_t fMode)
     46uint32_t VBoxToNTFileAttributes(uint32_t fMode)
    5047{
    5148    uint32_t FileAttributes = 0;
     
    8885 *
    8986 */
    90 uint32_t NTToVBoxFileAttributes (uint32_t fMode)
     87uint32_t NTToVBoxFileAttributes(uint32_t fMode)
    9188{
    9289    uint32_t FileAttributes = 0;
     
    121118}
    122119
    123 NTSTATUS vbsfHlpCreateDriveLetter (WCHAR Letter, UNICODE_STRING *pDeviceName)
     120NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName)
    124121{
    125122    UNICODE_STRING driveName;
     
    129126    driveName.Buffer[driveName.Length/sizeof(WCHAR) - 2] = Letter;
    130127
    131     return IoCreateSymbolicLink (&driveName, pDeviceName);
    132 }
    133 
    134 NTSTATUS vbsfHlpDeleteDriveLetter (WCHAR Letter)
     128    return IoCreateSymbolicLink(&driveName, pDeviceName);
     129}
     130
     131NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter)
    135132{
    136133    UNICODE_STRING driveName;
     
    140137    driveName.Buffer[driveName.Length/sizeof(WCHAR) - 2] = Letter;
    141138
    142     return IoDeleteSymbolicLink (&driveName);
     139    return IoDeleteSymbolicLink(&driveName);
    143140}
    144141
     
    150147     *
    151148     */
    152 NTSTATUS VBoxErrorToNTStatus (int vboxRC)
     149NTSTATUS VBoxErrorToNTStatus(int vboxRC)
    153150{
    154151    NTSTATUS Status;
     
    241238}
    242239
    243 PVOID vbsfAllocNonPagedMem (ULONG ulSize)
     240PVOID vbsfAllocNonPagedMem(ULONG ulSize)
    244241{
    245242    PVOID pMemory = NULL;
     
    270267}
    271268
    272 void vbsfFreeNonPagedMem (PVOID lpMem)
     269void vbsfFreeNonPagedMem(PVOID lpMem)
    273270{
    274271#ifdef DEBUG
     
    313310#endif
    314311
    315 #if defined(DEBUG) || defined (LOG_ENABLED)
     312#if defined(DEBUG) || defined(LOG_ENABLED)
     313
    316314static PCHAR PnPMinorFunctionString(LONG MinorFunction)
    317315{
     
    371369PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction)
    372370{
    373     switch (MinorFunction)
    374     {
    375     case IRP_MJ_CREATE:
    376         return "IRP_MJ_CREATE";
    377     case IRP_MJ_CREATE_NAMED_PIPE:
    378         return "IRP_MJ_CREATE_NAMED_PIPE";
    379     case IRP_MJ_CLOSE:
    380         return "IRP_MJ_CLOSE";
    381     case IRP_MJ_READ:
    382         return "IRP_MJ_READ";
    383     case IRP_MJ_WRITE:
    384         return "IRP_MJ_WRITE";
    385     case IRP_MJ_QUERY_INFORMATION:
    386         return "IRP_MJ_QUERY_INFORMATION";
    387     case IRP_MJ_SET_INFORMATION:
    388         return "IRP_MJ_SET_INFORMATION";
    389     case IRP_MJ_QUERY_EA:
    390         return "IRP_MJ_QUERY_EA";
    391     case IRP_MJ_SET_EA:
    392         return "IRP_MJ_SET_EA";
    393     case IRP_MJ_FLUSH_BUFFERS:
    394         return "IRP_MJ_FLUSH_BUFFERS";
    395     case IRP_MJ_QUERY_VOLUME_INFORMATION:
    396         return "IRP_MJ_QUERY_VOLUME_INFORMATION";
    397     case IRP_MJ_SET_VOLUME_INFORMATION:
    398         return "IRP_MJ_SET_VOLUME_INFORMATION";
    399     case IRP_MJ_DIRECTORY_CONTROL:
    400         return "IRP_MJ_DIRECTORY_CONTROL";
    401     case IRP_MJ_FILE_SYSTEM_CONTROL:
    402         return "IRP_MJ_FILE_SYSTEM_CONTROL";
    403     case IRP_MJ_DEVICE_CONTROL:
    404         return "IRP_MJ_DEVICE_CONTROL";
    405     case IRP_MJ_INTERNAL_DEVICE_CONTROL:
    406         return "IRP_MJ_INTERNAL_DEVICE_CONTROL";
    407     case IRP_MJ_SHUTDOWN:
    408         return "IRP_MJ_SHUTDOWN";
    409     case IRP_MJ_LOCK_CONTROL:
    410         return "IRP_MJ_LOCK_CONTROL";
    411     case IRP_MJ_CLEANUP:
    412         return "IRP_MJ_CLEANUP";
    413     case IRP_MJ_CREATE_MAILSLOT:
    414         return "IRP_MJ_CREATE_MAILSLOT";
    415     case IRP_MJ_QUERY_SECURITY:
    416         return "IRP_MJ_QUERY_SECURITY";
    417     case IRP_MJ_SET_SECURITY:
    418         return "IRP_MJ_SET_SECURITY";
    419     case IRP_MJ_POWER:
    420         return "IRP_MJ_POWER";
    421     case IRP_MJ_SYSTEM_CONTROL:
    422         return "IRP_MJ_SYSTEM_CONTROL";
    423     case IRP_MJ_DEVICE_CHANGE:
    424         return "IRP_MJ_DEVICE_CHANGE";
    425     case IRP_MJ_QUERY_QUOTA:
    426         return "IRP_MJ_QUERY_QUOTA";
    427     case IRP_MJ_SET_QUOTA:
    428         return "IRP_MJ_SET_QUOTA";
    429     case IRP_MJ_PNP:
    430         return PnPMinorFunctionString(MinorFunction);
    431 
    432     default:
    433         return "unknown_pnp_irp";
    434     }
    435 }
    436 #endif
     371    switch (MajorFunction)
     372    {
     373        case IRP_MJ_CREATE:
     374            return "IRP_MJ_CREATE";
     375        case IRP_MJ_CREATE_NAMED_PIPE:
     376            return "IRP_MJ_CREATE_NAMED_PIPE";
     377        case IRP_MJ_CLOSE:
     378            return "IRP_MJ_CLOSE";
     379        case IRP_MJ_READ:
     380            return "IRP_MJ_READ";
     381        case IRP_MJ_WRITE:
     382            return "IRP_MJ_WRITE";
     383        case IRP_MJ_QUERY_INFORMATION:
     384            return "IRP_MJ_QUERY_INFORMATION";
     385        case IRP_MJ_SET_INFORMATION:
     386            return "IRP_MJ_SET_INFORMATION";
     387        case IRP_MJ_QUERY_EA:
     388            return "IRP_MJ_QUERY_EA";
     389        case IRP_MJ_SET_EA:
     390            return "IRP_MJ_SET_EA";
     391        case IRP_MJ_FLUSH_BUFFERS:
     392            return "IRP_MJ_FLUSH_BUFFERS";
     393        case IRP_MJ_QUERY_VOLUME_INFORMATION:
     394            return "IRP_MJ_QUERY_VOLUME_INFORMATION";
     395        case IRP_MJ_SET_VOLUME_INFORMATION:
     396            return "IRP_MJ_SET_VOLUME_INFORMATION";
     397        case IRP_MJ_DIRECTORY_CONTROL:
     398            return "IRP_MJ_DIRECTORY_CONTROL";
     399        case IRP_MJ_FILE_SYSTEM_CONTROL:
     400            return "IRP_MJ_FILE_SYSTEM_CONTROL";
     401        case IRP_MJ_DEVICE_CONTROL:
     402            return "IRP_MJ_DEVICE_CONTROL";
     403        case IRP_MJ_INTERNAL_DEVICE_CONTROL:
     404            return "IRP_MJ_INTERNAL_DEVICE_CONTROL";
     405        case IRP_MJ_SHUTDOWN:
     406            return "IRP_MJ_SHUTDOWN";
     407        case IRP_MJ_LOCK_CONTROL:
     408            return "IRP_MJ_LOCK_CONTROL";
     409        case IRP_MJ_CLEANUP:
     410            return "IRP_MJ_CLEANUP";
     411        case IRP_MJ_CREATE_MAILSLOT:
     412            return "IRP_MJ_CREATE_MAILSLOT";
     413        case IRP_MJ_QUERY_SECURITY:
     414            return "IRP_MJ_QUERY_SECURITY";
     415        case IRP_MJ_SET_SECURITY:
     416            return "IRP_MJ_SET_SECURITY";
     417        case IRP_MJ_POWER:
     418            return "IRP_MJ_POWER";
     419        case IRP_MJ_SYSTEM_CONTROL:
     420            return "IRP_MJ_SYSTEM_CONTROL";
     421        case IRP_MJ_DEVICE_CHANGE:
     422            return "IRP_MJ_DEVICE_CHANGE";
     423        case IRP_MJ_QUERY_QUOTA:
     424            return "IRP_MJ_QUERY_QUOTA";
     425        case IRP_MJ_SET_QUOTA:
     426            return "IRP_MJ_SET_QUOTA";
     427        case IRP_MJ_PNP:
     428            return PnPMinorFunctionString(MinorFunction);
     429
     430        default:
     431            return "unknown_pnp_irp";
     432    }
     433}
     434
     435#endif /* DEBUG || LOG_ENABLED */
    437436
    438437/** Allocate and initialize a SHFLSTRING from a UNICODE string.
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsfhlp.h

    r62522 r63073  
    11/* $Id$ */
    22/** @file
    3  *
    4  * VirtualBox Windows Guest Shared Folders
    5  *
    6  * File System Driver helpers
     3 * VirtualBox Windows Guest Shared Folders - File System Driver helpers
    74 */
    85
     
    1815 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1916 */
     17
    2018#ifndef __VBSFHLP__H
    2119#define __VBSFHLP__H
    2220
    23 #include <ntifs.h>
    24 #include <ntverp.h>
     21#include <iprt/nt/nt.h> /* includes ntifs.h and wdm.h */
     22#include <iprt/win/ntverp.h>
    2523
    2624#include <VBox/log.h>
     
    2826
    2927
    30 void vbsfHlpSleep (ULONG ulMillies);
    31 NTSTATUS vbsfHlpCreateDriveLetter (WCHAR Letter, UNICODE_STRING *pDeviceName);
    32 NTSTATUS vbsfHlpDeleteDriveLetter (WCHAR Letter);
     28void     vbsfHlpSleep(ULONG ulMillies);
     29NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName);
     30NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter);
    3331
    3432/**
     
    3937 *
    4038 */
    41 uint32_t VBoxToNTFileAttributes (uint32_t fMode);
     39uint32_t VBoxToNTFileAttributes(uint32_t fMode);
    4240
    4341/**
     
    4846 *
    4947 */
    50 uint32_t NTToVBoxFileAttributes (uint32_t fMode);
     48uint32_t NTToVBoxFileAttributes(uint32_t fMode);
    5149
    5250/**
     
    5755 *
    5856 */
    59 NTSTATUS VBoxErrorToNTStatus (int vboxRC);
     57NTSTATUS VBoxErrorToNTStatus(int vboxRC);
    6058
    61 PVOID vbsfAllocNonPagedMem (ULONG ulSize);
    62 void vbsfFreeNonPagedMem (PVOID lpMem);
     59PVOID    vbsfAllocNonPagedMem(ULONG ulSize);
     60void     vbsfFreeNonPagedMem(PVOID lpMem);
    6361
    64 #if defined(DEBUG) || defined (LOG_ENABLED)
     62#if defined(DEBUG) || defined(LOG_ENABLED)
    6563PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction);
    6664#endif
     
    6866NTSTATUS vbsfShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb);
    6967
    70 #endif /* __VBSFHLP__H */
     68#endif /* !__VBSFHLP__H */
     69
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