VirtualBox

Changeset 62713 in vbox


Ignore:
Timestamp:
Jul 29, 2016 9:31:16 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
109287
Message:

nt.h/rtFileNativeSetAttributes-win.cpp

Location:
trunk
Files:
2 edited

Legend:

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

    r62674 r62713  
    4242# define NtQuerySystemInformation       ZwQuerySystemInformation
    4343# define NtQuerySecurityObject          ZwQuerySecurityObject
     44# define NtSetInformationFile           ZwSetInformationFile
    4445# define NtClose                        ZwClose
    4546# define NtCreateFile                   ZwCreateFile
     
    16001601NTSYSAPI NTSTATUS NTAPI NtQueryDirectoryFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG,
    16011602                                             FILE_INFORMATION_CLASS, BOOLEAN, PUNICODE_STRING, BOOLEAN);
     1603NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
     1604
    16021605
    16031606/** For use with KeyBasicInformation. */
     
    23682371#endif
    23692372
     2373/*NTSYSAPI ULONG NTAPI RtlNtStatusToDosError(NTSTATUS rcNt);*/
     2374
     2375
    23702376RT_C_DECLS_END
    23712377/** @} */
  • trunk/src/VBox/Runtime/r3/win/rtFileNativeSetAttributes-win.cpp

    r62592 r62713  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
    31 /* APIs used here require DDK headers. */
    32 #pragma warning(disable: 4668)
    33 #include <wdm.h>
    34 #pragma warning(default: 4668)
     31#include <iprt/nt/nt.h>
     32#include <iprt/string.h>
    3533
    36 /* Declare ntdll exports. */
    37 extern "C"
    38 {
    39 NTSYSAPI ULONG NTAPI RtlNtStatusToDosError (IN NTSTATUS Status);
    40 
    41 NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE FileHandle,
    42                                              OUT PIO_STATUS_BLOCK IoStatusBlock,
    43                                              IN PVOID FileInformation,
    44                                              IN ULONG Length,
    45                                              IN FILE_INFORMATION_CLASS FileInformationClass);
    46 }
    4734
    4835/** Windows/NT worker.
     
    5138{
    5239    IO_STATUS_BLOCK IoStatusBlock;
    53     memset(&IoStatusBlock, 0, sizeof(IoStatusBlock));
     40    RT_ZERO(IoStatusBlock);
    5441
    5542    /*
     
    5946     */
    6047    FILE_BASIC_INFORMATION Info;
    61     memset(&Info, 0, sizeof(Info));
     48    RT_ZERO(Info);
    6249    Info.FileAttributes = fAttributes;
    6350
    6451    /** @todo resolve dynamically to avoid dragging in NtDll? */
    65     NTSTATUS Status = NtSetInformationFile(hFile,
    66                                            &IoStatusBlock,
    67                                            &Info,
    68                                            sizeof(Info),
    69                                            FileBasicInformation);
    70 
    71     return RtlNtStatusToDosError(Status);
     52    NTSTATUS rcNt = NtSetInformationFile(hFile,
     53                                         &IoStatusBlock,
     54                                         &Info,
     55                                         sizeof(Info),
     56                                         FileBasicInformation);
     57    return RtlNtStatusToDosError(rcNt);
    7258}
    7359
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