Skip to content

Commit ec7f213

Browse files
Max CharlambCopilot
andcommitted
Use Interop.BOOL for all BOOL parameters matching native IDL
Standardize 29 parameters across IDacDbiInterface and DacDbiImpl to use Interop.BOOL/Interop.BOOL* instead of int/int* where the native IDL defines BOOL/BOOL*. Both are 4-byte signed integers so this is binary compatible but improves type consistency with the IDL contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 693593c commit ec7f213

2 files changed

Lines changed: 58 additions & 58 deletions

File tree

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public int FlushCache()
2727
public int DacSetTargetConsistencyChecks(Interop.BOOL fEnableAsserts)
2828
=> _legacy is not null ? _legacy.DacSetTargetConsistencyChecks(fEnableAsserts) : HResults.E_NOTIMPL;
2929

30-
public int IsLeftSideInitialized(int* pResult)
30+
public int IsLeftSideInitialized(Interop.BOOL* pResult)
3131
=> _legacy is not null ? _legacy.IsLeftSideInitialized(pResult) : HResults.E_NOTIMPL;
3232

3333
public int GetAppDomainFromId(uint appdomainId, ulong* pRetVal)
@@ -42,7 +42,7 @@ public int GetAppDomainObject(ulong vmAppDomain, ulong* pRetVal)
4242
public int GetAssemblyFromDomainAssembly(ulong vmDomainAssembly, ulong* vmAssembly)
4343
=> _legacy is not null ? _legacy.GetAssemblyFromDomainAssembly(vmDomainAssembly, vmAssembly) : HResults.E_NOTIMPL;
4444

45-
public int IsAssemblyFullyTrusted(ulong vmDomainAssembly, int* pResult)
45+
public int IsAssemblyFullyTrusted(ulong vmDomainAssembly, Interop.BOOL* pResult)
4646
=> _legacy is not null ? _legacy.IsAssemblyFullyTrusted(vmDomainAssembly, pResult) : HResults.E_NOTIMPL;
4747

4848
public int GetAppDomainFullName(ulong vmAppDomain, IStringHolder pStrName)
@@ -51,13 +51,13 @@ public int GetAppDomainFullName(ulong vmAppDomain, IStringHolder pStrName)
5151
public int GetModuleSimpleName(ulong vmModule, IStringHolder pStrFilename)
5252
=> _legacy is not null ? _legacy.GetModuleSimpleName(vmModule, pStrFilename) : HResults.E_NOTIMPL;
5353

54-
public int GetAssemblyPath(ulong vmAssembly, IStringHolder pStrFilename, int* pResult)
54+
public int GetAssemblyPath(ulong vmAssembly, IStringHolder pStrFilename, Interop.BOOL* pResult)
5555
=> _legacy is not null ? _legacy.GetAssemblyPath(vmAssembly, pStrFilename, pResult) : HResults.E_NOTIMPL;
5656

5757
public int ResolveTypeReference(DacDbiTypeRefData* pTypeRefInfo, DacDbiTypeRefData* pTargetRefInfo)
5858
=> _legacy is not null ? _legacy.ResolveTypeReference(pTypeRefInfo, pTargetRefInfo) : HResults.E_NOTIMPL;
5959

60-
public int GetModulePath(ulong vmModule, IStringHolder pStrFilename, int* pResult)
60+
public int GetModulePath(ulong vmModule, IStringHolder pStrFilename, Interop.BOOL* pResult)
6161
=> _legacy is not null ? _legacy.GetModulePath(vmModule, pStrFilename, pResult) : HResults.E_NOTIMPL;
6262

6363
public int GetMetadata(ulong vmModule, DacDbiTargetBuffer* pTargetBuffer)
@@ -78,13 +78,13 @@ public int GetModuleForDomainAssembly(ulong vmDomainAssembly, ulong* pModule)
7878
public int GetAddressType(ulong address, int* pRetVal)
7979
=> _legacy is not null ? _legacy.GetAddressType(address, pRetVal) : HResults.E_NOTIMPL;
8080

81-
public int IsTransitionStub(ulong address, int* pResult)
81+
public int IsTransitionStub(ulong address, Interop.BOOL* pResult)
8282
=> _legacy is not null ? _legacy.IsTransitionStub(address, pResult) : HResults.E_NOTIMPL;
8383

84-
public int GetCompilerFlags(ulong vmDomainAssembly, int* pfAllowJITOpts, int* pfEnableEnC)
84+
public int GetCompilerFlags(ulong vmDomainAssembly, Interop.BOOL* pfAllowJITOpts, Interop.BOOL* pfEnableEnC)
8585
=> _legacy is not null ? _legacy.GetCompilerFlags(vmDomainAssembly, pfAllowJITOpts, pfEnableEnC) : HResults.E_NOTIMPL;
8686

87-
public int SetCompilerFlags(ulong vmDomainAssembly, int fAllowJitOpts, int fEnableEnC)
87+
public int SetCompilerFlags(ulong vmDomainAssembly, Interop.BOOL fAllowJitOpts, Interop.BOOL fEnableEnC)
8888
=> _legacy is not null ? _legacy.SetCompilerFlags(vmDomainAssembly, fAllowJitOpts, fEnableEnC) : HResults.E_NOTIMPL;
8989

9090
public int EnumerateAppDomains(nint fpCallback, nint pUserData)
@@ -99,13 +99,13 @@ public int EnumerateModulesInAssembly(ulong vmAssembly, nint fpCallback, nint pU
9999
public int RequestSyncAtEvent()
100100
=> _legacy is not null ? _legacy.RequestSyncAtEvent() : HResults.E_NOTIMPL;
101101

102-
public int SetSendExceptionsOutsideOfJMC(int sendExceptionsOutsideOfJMC)
102+
public int SetSendExceptionsOutsideOfJMC(Interop.BOOL sendExceptionsOutsideOfJMC)
103103
=> _legacy is not null ? _legacy.SetSendExceptionsOutsideOfJMC(sendExceptionsOutsideOfJMC) : HResults.E_NOTIMPL;
104104

105105
public int MarkDebuggerAttachPending()
106106
=> _legacy is not null ? _legacy.MarkDebuggerAttachPending() : HResults.E_NOTIMPL;
107107

108-
public int MarkDebuggerAttached(int fAttached)
108+
public int MarkDebuggerAttached(Interop.BOOL fAttached)
109109
=> _legacy is not null ? _legacy.MarkDebuggerAttached(fAttached) : HResults.E_NOTIMPL;
110110

111111
public int Hijack(ulong vmThread, uint dwThreadId, nint pRecord, nint pOriginalContext, uint cbSizeContext, int reason, nint pUserData, ulong* pRemoteContextAddr)
@@ -129,7 +129,7 @@ public int GetThreadAllocInfo(ulong vmThread, DacDbiThreadAllocInfo* pThreadAllo
129129
public int SetDebugState(ulong vmThread, int debugState)
130130
=> _legacy is not null ? _legacy.SetDebugState(vmThread, debugState) : HResults.E_NOTIMPL;
131131

132-
public int HasUnhandledException(ulong vmThread, int* pResult)
132+
public int HasUnhandledException(ulong vmThread, Interop.BOOL* pResult)
133133
=> _legacy is not null ? _legacy.HasUnhandledException(vmThread, pResult) : HResults.E_NOTIMPL;
134134

135135
public int GetUserState(ulong vmThread, int* pRetVal)
@@ -165,7 +165,7 @@ public int GetCurrentAppDomain(ulong* pRetVal)
165165
public int ResolveAssembly(ulong vmScope, uint tkAssemblyRef, ulong* pRetVal)
166166
=> _legacy is not null ? _legacy.ResolveAssembly(vmScope, tkAssemblyRef, pRetVal) : HResults.E_NOTIMPL;
167167

168-
public int GetNativeCodeSequencePointsAndVarInfo(ulong vmMethodDesc, ulong startAddress, int fCodeAvailable, nint pNativeVarData, nint pSequencePoints)
168+
public int GetNativeCodeSequencePointsAndVarInfo(ulong vmMethodDesc, ulong startAddress, Interop.BOOL fCodeAvailable, nint pNativeVarData, nint pSequencePoints)
169169
=> _legacy is not null ? _legacy.GetNativeCodeSequencePointsAndVarInfo(vmMethodDesc, startAddress, fCodeAvailable, pNativeVarData, pSequencePoints) : HResults.E_NOTIMPL;
170170

171171
public int GetManagedStoppedContext(ulong vmThread, ulong* pRetVal)
@@ -183,7 +183,7 @@ public int GetStackWalkCurrentContext(nuint pSFIHandle, nint pContext)
183183
public int SetStackWalkCurrentContext(ulong vmThread, nuint pSFIHandle, int flag, nint pContext)
184184
=> _legacy is not null ? _legacy.SetStackWalkCurrentContext(vmThread, pSFIHandle, flag, pContext) : HResults.E_NOTIMPL;
185185

186-
public int UnwindStackWalkFrame(nuint pSFIHandle, int* pResult)
186+
public int UnwindStackWalkFrame(nuint pSFIHandle, Interop.BOOL* pResult)
187187
=> _legacy is not null ? _legacy.UnwindStackWalkFrame(pSFIHandle, pResult) : HResults.E_NOTIMPL;
188188

189189
public int CheckContext(ulong vmThread, nint pContext)
@@ -198,7 +198,7 @@ public int GetCountOfInternalFrames(ulong vmThread, uint* pRetVal)
198198
public int EnumerateInternalFrames(ulong vmThread, nint fpCallback, nint pUserData)
199199
=> _legacy is not null ? _legacy.EnumerateInternalFrames(vmThread, fpCallback, pUserData) : HResults.E_NOTIMPL;
200200

201-
public int IsMatchingParentFrame(ulong fpToCheck, ulong fpParent, int* pResult)
201+
public int IsMatchingParentFrame(ulong fpToCheck, ulong fpParent, Interop.BOOL* pResult)
202202
=> _legacy is not null ? _legacy.IsMatchingParentFrame(fpToCheck, fpParent, pResult) : HResults.E_NOTIMPL;
203203

204204
public int GetStackParameterSize(ulong controlPC, uint* pRetVal)
@@ -207,13 +207,13 @@ public int GetStackParameterSize(ulong controlPC, uint* pRetVal)
207207
public int GetFramePointer(nuint pSFIHandle, ulong* pRetVal)
208208
=> _legacy is not null ? _legacy.GetFramePointer(pSFIHandle, pRetVal) : HResults.E_NOTIMPL;
209209

210-
public int IsLeafFrame(ulong vmThread, nint pContext, int* pResult)
210+
public int IsLeafFrame(ulong vmThread, nint pContext, Interop.BOOL* pResult)
211211
=> _legacy is not null ? _legacy.IsLeafFrame(vmThread, pContext, pResult) : HResults.E_NOTIMPL;
212212

213213
public int GetContext(ulong vmThread, nint pContextBuffer)
214214
=> _legacy is not null ? _legacy.GetContext(vmThread, pContextBuffer) : HResults.E_NOTIMPL;
215215

216-
public int ConvertContextToDebuggerRegDisplay(nint pInContext, nint pOutDRD, int fActive)
216+
public int ConvertContextToDebuggerRegDisplay(nint pInContext, nint pOutDRD, Interop.BOOL fActive)
217217
=> _legacy is not null ? _legacy.ConvertContextToDebuggerRegDisplay(pInContext, pOutDRD, fActive) : HResults.E_NOTIMPL;
218218

219219
public int IsDiagnosticsHiddenOrLCGMethod(ulong vmMethodDesc, int* pRetVal)
@@ -222,7 +222,7 @@ public int IsDiagnosticsHiddenOrLCGMethod(ulong vmMethodDesc, int* pRetVal)
222222
public int GetVarArgSig(ulong VASigCookieAddr, ulong* pArgBase, DacDbiTargetBuffer* pRetVal)
223223
=> _legacy is not null ? _legacy.GetVarArgSig(VASigCookieAddr, pArgBase, pRetVal) : HResults.E_NOTIMPL;
224224

225-
public int RequiresAlign8(ulong thExact, int* pResult)
225+
public int RequiresAlign8(ulong thExact, Interop.BOOL* pResult)
226226
=> _legacy is not null ? _legacy.RequiresAlign8(thExact, pResult) : HResults.E_NOTIMPL;
227227

228228
public int ResolveExactGenericArgsToken(uint dwExactGenericArgsTokenIndex, ulong rawToken, ulong* pRetVal)
@@ -237,10 +237,10 @@ public int GetNativeCodeInfo(ulong vmDomainAssembly, uint functionToken, nint pJ
237237
public int GetNativeCodeInfoForAddr(ulong codeAddress, nint pCodeInfo, ulong* pVmModule, uint* pFunctionToken)
238238
=> _legacy is not null ? _legacy.GetNativeCodeInfoForAddr(codeAddress, pCodeInfo, pVmModule, pFunctionToken) : HResults.E_NOTIMPL;
239239

240-
public int IsValueType(ulong vmTypeHandle, int* pResult)
240+
public int IsValueType(ulong vmTypeHandle, Interop.BOOL* pResult)
241241
=> _legacy is not null ? _legacy.IsValueType(vmTypeHandle, pResult) : HResults.E_NOTIMPL;
242242

243-
public int HasTypeParams(ulong vmTypeHandle, int* pResult)
243+
public int HasTypeParams(ulong vmTypeHandle, Interop.BOOL* pResult)
244244
=> _legacy is not null ? _legacy.HasTypeParams(vmTypeHandle, pResult) : HResults.E_NOTIMPL;
245245

246246
public int GetClassInfo(ulong vmAppDomain, ulong thExact, nint pData)
@@ -276,7 +276,7 @@ public int GetThreadStaticAddress(ulong vmField, ulong vmRuntimeThread, ulong* p
276276
public int GetCollectibleTypeStaticAddress(ulong vmField, ulong vmAppDomain, ulong* pRetVal)
277277
=> _legacy is not null ? _legacy.GetCollectibleTypeStaticAddress(vmField, vmAppDomain, pRetVal) : HResults.E_NOTIMPL;
278278

279-
public int GetEnCHangingFieldInfo(nint pEnCFieldInfo, nint pFieldData, int* pfStatic)
279+
public int GetEnCHangingFieldInfo(nint pEnCFieldInfo, nint pFieldData, Interop.BOOL* pfStatic)
280280
=> _legacy is not null ? _legacy.GetEnCHangingFieldInfo(pEnCFieldInfo, pFieldData, pfStatic) : HResults.E_NOTIMPL;
281281

282282
public int GetTypeHandleParams(ulong vmAppDomain, ulong vmTypeHandle, nint pParams)
@@ -285,19 +285,19 @@ public int GetTypeHandleParams(ulong vmAppDomain, ulong vmTypeHandle, nint pPara
285285
public int GetSimpleType(ulong vmAppDomain, int simpleType, uint* pMetadataToken, ulong* pVmModule, ulong* pVmDomainAssembly)
286286
=> _legacy is not null ? _legacy.GetSimpleType(vmAppDomain, simpleType, pMetadataToken, pVmModule, pVmDomainAssembly) : HResults.E_NOTIMPL;
287287

288-
public int IsExceptionObject(ulong vmObject, int* pResult)
288+
public int IsExceptionObject(ulong vmObject, Interop.BOOL* pResult)
289289
=> _legacy is not null ? _legacy.IsExceptionObject(vmObject, pResult) : HResults.E_NOTIMPL;
290290

291291
public int GetStackFramesFromException(ulong vmObject, nint pDacStackFrames)
292292
=> _legacy is not null ? _legacy.GetStackFramesFromException(vmObject, pDacStackFrames) : HResults.E_NOTIMPL;
293293

294-
public int IsRcw(ulong vmObject, int* pResult)
294+
public int IsRcw(ulong vmObject, Interop.BOOL* pResult)
295295
=> _legacy is not null ? _legacy.IsRcw(vmObject, pResult) : HResults.E_NOTIMPL;
296296

297-
public int GetRcwCachedInterfaceTypes(ulong vmObject, ulong vmAppDomain, int bIInspectableOnly, nint pDacInterfaces)
297+
public int GetRcwCachedInterfaceTypes(ulong vmObject, ulong vmAppDomain, Interop.BOOL bIInspectableOnly, nint pDacInterfaces)
298298
=> _legacy is not null ? _legacy.GetRcwCachedInterfaceTypes(vmObject, vmAppDomain, bIInspectableOnly, pDacInterfaces) : HResults.E_NOTIMPL;
299299

300-
public int GetRcwCachedInterfacePointers(ulong vmObject, int bIInspectableOnly, nint pDacItfPtrs)
300+
public int GetRcwCachedInterfacePointers(ulong vmObject, Interop.BOOL bIInspectableOnly, nint pDacItfPtrs)
301301
=> _legacy is not null ? _legacy.GetRcwCachedInterfacePointers(vmObject, bIInspectableOnly, pDacItfPtrs) : HResults.E_NOTIMPL;
302302

303303
public int GetCachedWinRTTypesForIIDs(ulong vmAppDomain, nint pIids, nint pTypes)
@@ -345,10 +345,10 @@ public int GetNGENCompilerFlags(uint* pdwFlags)
345345
public int GetVmObjectHandle(ulong handleAddress, ulong* pRetVal)
346346
=> _legacy is not null ? _legacy.GetVmObjectHandle(handleAddress, pRetVal) : HResults.E_NOTIMPL;
347347

348-
public int IsVmObjectHandleValid(ulong vmHandle, int* pResult)
348+
public int IsVmObjectHandleValid(ulong vmHandle, Interop.BOOL* pResult)
349349
=> _legacy is not null ? _legacy.IsVmObjectHandleValid(vmHandle, pResult) : HResults.E_NOTIMPL;
350350

351-
public int IsWinRTModule(ulong vmModule, int* isWinRT)
351+
public int IsWinRTModule(ulong vmModule, Interop.BOOL* isWinRT)
352352
=> _legacy is not null ? _legacy.IsWinRTModule(vmModule, isWinRT) : HResults.E_NOTIMPL;
353353

354354
public int GetAppDomainIdFromVmObjectHandle(ulong vmHandle, uint* pRetVal)
@@ -396,7 +396,7 @@ public int IsValidObject(ulong obj, Interop.BOOL* pResult)
396396
public int GetAppDomainForObject(ulong obj, ulong* pApp, ulong* pModule, ulong* pDomainAssembly, Interop.BOOL* pResult)
397397
=> _legacy is not null ? _legacy.GetAppDomainForObject(obj, pApp, pModule, pDomainAssembly, pResult) : HResults.E_NOTIMPL;
398398

399-
public int CreateRefWalk(nuint* pHandle, int walkStacks, int walkFQ, uint handleWalkMask)
399+
public int CreateRefWalk(nuint* pHandle, Interop.BOOL walkStacks, Interop.BOOL walkFQ, uint handleWalkMask)
400400
=> _legacy is not null ? _legacy.CreateRefWalk(pHandle, walkStacks, walkFQ, handleWalkMask) : HResults.E_NOTIMPL;
401401

402402
public int DeleteRefWalk(nuint handle)
@@ -438,7 +438,7 @@ public int GetSharedReJitInfo(ulong vmReJitInfo, ulong* pSharedReJitInfo)
438438
public int GetSharedReJitInfoData(ulong sharedReJitInfo, DacDbiSharedReJitInfo* pData)
439439
=> _legacy is not null ? _legacy.GetSharedReJitInfoData(sharedReJitInfo, pData) : HResults.E_NOTIMPL;
440440

441-
public int AreOptimizationsDisabled(ulong vmModule, uint methodTk, int* pOptimizationsDisabled)
441+
public int AreOptimizationsDisabled(ulong vmModule, uint methodTk, Interop.BOOL* pOptimizationsDisabled)
442442
=> _legacy is not null ? _legacy.AreOptimizationsDisabled(vmModule, methodTk, pOptimizationsDisabled) : HResults.E_NOTIMPL;
443443

444444
public int GetDefinesBitField(uint* pDefines)
@@ -459,10 +459,10 @@ public int GetILCodeVersionNode(ulong vmNativeCodeVersionNode, ulong* pVmILCodeV
459459
public int GetILCodeVersionNodeData(ulong ilCodeVersionNode, DacDbiSharedReJitInfo* pData)
460460
=> _legacy is not null ? _legacy.GetILCodeVersionNodeData(ilCodeVersionNode, pData) : HResults.E_NOTIMPL;
461461

462-
public int EnableGCNotificationEvents(int fEnable)
462+
public int EnableGCNotificationEvents(Interop.BOOL fEnable)
463463
=> _legacy is not null ? _legacy.EnableGCNotificationEvents(fEnable) : HResults.E_NOTIMPL;
464464

465-
public int IsDelegate(ulong vmObject, int* pResult)
465+
public int IsDelegate(ulong vmObject, Interop.BOOL* pResult)
466466
=> _legacy is not null ? _legacy.IsDelegate(vmObject, pResult) : HResults.E_NOTIMPL;
467467

468468
public int GetDelegateType(ulong delegateObject, int* delegateType)

0 commit comments

Comments
 (0)