VirtualBox

Changeset 82833 in vbox


Ignore:
Timestamp:
Jan 22, 2020 4:22:59 PM (5 years ago)
Author:
vboxsync
Message:

IPRT/nt: Added OBJECT_BASIC_INFORMATION and promoted rtNtPathFromHandle to public access. ticketref:19003

Location:
trunk
Files:
2 edited

Legend:

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

    r80212 r82833  
    390390 */
    391391RTDECL(int) RTNtPathEnsureSpace(struct _UNICODE_STRING *pNtName, size_t cwcMin);
     392
     393/**
     394 * Gets the NT path to the object represented by the given handle.
     395 *
     396 * @returns IPRT status code.
     397 * @param   pNtName             Where to return the NT path.  Free using
     398 *                              RTUtf16Alloc.
     399 * @param   hHandle             The handle.
     400 * @param   cwcExtra            How much extra space is needed.
     401 */
     402RTDECL(int) RTNtPathFromHandle(struct _UNICODE_STRING *pNtName, HANDLE hHandle, size_t cwcExtra);
    392403
    393404/**
     
    27492760
    27502761#endif /* IPRT_NT_USE_WINTERNL */
     2762
     2763/** For use with ObjectBasicInformation.
     2764 * A watered down version of this struct appears under the name
     2765 * PUBLIC_OBJECT_BASIC_INFORMATION in ntifs.h.  It only defines
     2766 * the first four members, so don't trust the rest.  */
     2767typedef struct _OBJECT_BASIC_INFORMATION
     2768{
     2769    ULONG Attributes;
     2770    ACCESS_MASK GrantedAccess;
     2771    ULONG HandleCount;
     2772    ULONG PointerCount;
     2773    /* Not in ntifs.h: */
     2774    ULONG PagedPoolCharge;
     2775    ULONG NonPagedPoolCharge;
     2776    ULONG Reserved[3];
     2777    ULONG NameInfoSize;
     2778    ULONG TypeInfoSize;
     2779    ULONG SecurityDescriptorSize;
     2780    LARGE_INTEGER CreationTime;
     2781} OBJECT_BASIC_INFORMATION;
     2782typedef OBJECT_BASIC_INFORMATION *POBJECT_BASIC_INFORMATION;
    27512783
    27522784/** For use with ObjectHandleFlagInformation. */
  • trunk/src/VBox/Runtime/r3/nt/pathint-nt.cpp

    r78200 r82833  
    572572 * @param   cwcExtra            How much extra space is needed.
    573573 */
    574 static int rtNtPathFromHandle(struct _UNICODE_STRING *pNtName, HANDLE hHandle, size_t cwcExtra)
     574RTDECL(int) RTNtPathFromHandle(struct _UNICODE_STRING *pNtName, HANDLE hHandle, size_t cwcExtra)
    575575{
    576576    /*
     
    634634    {
    635635        RTUtf16Free(pNtName->Buffer);
    636         rc = rtNtPathFromHandle(pNtName, *phRootDir, pNtName->Length / sizeof(RTUTF16) + 2);
     636        rc = RTNtPathFromHandle(pNtName, *phRootDir, pNtName->Length / sizeof(RTUTF16) + 2);
    637637        if (RT_SUCCESS(rc))
    638638        {
     
    646646        UNICODE_STRING RootDir;
    647647        size_t const   cwcAppend = pNtName->Length / sizeof(RTUTF16);
    648         rc = rtNtPathFromHandle(&RootDir, *phRootDir, cwcAppend + 2);
     648        rc = RTNtPathFromHandle(&RootDir, *phRootDir, cwcAppend + 2);
    649649        if (RT_SUCCESS(rc))
    650650        {
     
    802802                                            {
    803803                                                RTUtf16Free(pwszDst);
    804                                                 rc = rtNtPathFromHandle(pNtName, *phRootDir, cwcMax + 2);
     804                                                rc = RTNtPathFromHandle(pNtName, *phRootDir, cwcMax + 2);
    805805                                                if (RT_FAILURE(rc))
    806806                                                    return rc;
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