Closed kennykerr closed 5 months ago
Conversely, there are many structs that have at least one InvalidHandleValue
attribute but lack a corresponding RAIIFree
attribute. Is that intentional?
- HIORING
Disassembling kernelbase![...]::VerifyValidIoRingHandle
reveals it returns INVALID_HANDLE_VALUE
when provided -1
and 0
, so will add that.
- PTP_CLEANUP_GROUP
Documented as an opaque struct pointer. We can minimally add 0
to the invalid handle value list here.
- PTP_POOL
Same as above.
- SOCKET
Will add -1
per INVALID_SOCKET
.
Regarding the longer list of types that have InvalidHandleValue
markings but not RAIIFree
, this is just an artifact of the RAII effort not being complete. Will try to get those all covered.
Live checklist:
IDirectorySearch::CloseSearchHandle
)AmsiUninitialize
/ AmsiCloseSession
)AmsiUninitialize
/ AmsiCloseSession
)IAccessor::ReleaseAccessor
)PrjStopVirtualizing
)JetCloseFileInstance
)JetCloseTable
)DeleteDC
or ReleaseDC
)CertStoreProvFreeFindCTL
)NULL
)ImmLockIMCC
and ImmUnlockIMCC
functions, needs closer investigation)RasHangUpA
and RasHangUpW
exist)AuthzUnregisterSecurityEventSource
)CloseDriver
)mmioClose
)
Taking another stab at supporting
RAIIFree
in Rust, but the following structs have theRAIIFree
attribute but lack at least oneInvalidHandleValue
attribute. Is that intentional? Are we meant to assume that zero is thus the invalid value?