Changeset 92203 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Nov 4, 2021 12:29:20 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r91789 r92203 92 92 /** Enables generating UID from NT SIDs so the GMM can share free memory 93 93 * among VMs running as the same user. */ 94 //#define VBOXDRV_WITH_SID_TO_UID_MAPPING94 #define VBOXDRV_WITH_SID_TO_UID_MAPPING 95 95 96 96 /* Missing if we're compiling against older WDKs. */ … … 875 875 */ 876 876 UNICODE_STRING UniStr = RTNT_NULL_UNISTR(); 877 rcNt = RtlConvertSidToUnicodeString(&UniStr, &pTokenUser->User.Sid, TRUE /*AllocateDesitnationString*/);877 rcNt = RtlConvertSidToUnicodeString(&UniStr, pTokenUser->User.Sid, TRUE /*AllocateDesitnationString*/); 878 878 if (NT_SUCCESS(rcNt)) 879 879 { … … 892 892 pNtUserIdNew->cchSid = (uint16_t)cchSid; 893 893 pNtUserIdNew->cRefs = 1; 894 Log5Func(("pNtUserId=%p cchSid=%u hash=%#x '%s'\n", pNtUserIdNew, cchSid, pNtUserIdNew->HashCore.Key, pszSid)); 894 895 895 896 /* … … 910 911 { 911 912 /* Found matching: Retain reference and free the new entry we prepared. */ 912 uint32_t c Refs = ASMAtomicIncU32(&pNtUserId->cRefs);913 Assert(cRefs < _16K); 913 uint32_t const cRefs = ASMAtomicIncU32(&pNtUserId->cRefs); 914 Assert(cRefs < _16K); RT_NOREF(cRefs); 914 915 RTSpinlockRelease(g_hNtUserIdLock); 916 Log5Func(("Using %p / %#x instead\n", pNtUserId, pNtUserId->UidCore.Key)); 915 917 } 916 918 else … … 924 926 } 925 927 RTSpinlockRelease(g_hNtUserIdLock); 928 if (pNtUserId) 929 Log5Func(("Using %p / %#x (the prepared one)\n", pNtUserId, pNtUserId->UidCore.Key)); 930 else 931 LogRelFunc(("supdrvNtUserIdMakeForSession: failed to insert new\n")); 926 932 } 927 933 } … … 936 942 } 937 943 RTSpinlockRelease(g_hNtUserIdLock); 944 if (pNtUserId) 945 Log5Func(("Using %p / %#x (the prepared one, no conflict)\n", pNtUserId, pNtUserId->UidCore.Key)); 946 else 947 LogRelFunc(("failed to insert!! WTF!?!\n")); 938 948 } 939 949 … … 956 966 } 957 967 else 968 { 958 969 rc = RTErrConvertFromNtStatus(rcNt); 970 LogFunc(("RtlConvertSidToUnicodeString failed: %#x / %Rrc\n", rcNt, rc)); 971 } 959 972 ExFreePool(pTokenUser); 960 973 } 961 974 else 975 { 962 976 rc = RTErrConvertFromNtStatus(rcNt); 977 LogFunc(("SeQueryInformationToken failed: %#x / %Rrc\n", rcNt, rc)); 978 } 963 979 964 980 SeReleaseSubjectContext(&Ctx); … … 976 992 if (pNtUserId) 977 993 { 978 uint32_t cRefs = ASMAtomicDecU32(&pNtUserId->cRefs); 994 uint32_t const cRefs = ASMAtomicDecU32(&pNtUserId->cRefs); 995 Log5Func(("%p / %#x: cRefs=%d\n", pNtUserId, pNtUserId->cRefs)); 979 996 Assert(cRefs < _8K); 980 997 if (cRefs == 0)
Note:
See TracChangeset
for help on using the changeset viewer.