Skip to content

Commit 4dd2396

Browse files
committed
docs: document GetHandleInfo(), GetHandleInformation(SafeHandle)
1 parent e38511c commit 4dd2396

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

deadlock-dotnet-sdk/Windows.Win32/PInvoke.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,9 @@ public static bool PrivilegeCheck(SafeHandle ClientToken, ref PRIVILEGE_SET Requ
208208
public static SafeFileHandle OpenProcessToken(SafeFileHandle ProcessHandle, TOKEN_ACCESS_MASK DesiredAccess)
209209
=> OpenProcessToken(ProcessHandle, DesiredAccess, out SafeFileHandle TokenHandle) ? TokenHandle : throw new Win32Exception();
210210

211+
/// <summary>Get the handle's flags/attributes.</summary>
212+
/// <param name="hObject"><inheritdoc cref="GetHandleInformation(HANDLE, uint*)" path="/param[@name='hObject']"/></param>
213+
/// <returns>A copy of the handle's current flags/attributes as <see cref="HANDLE_FLAGS"/></returns>
214+
/// <exception cref="Win32Exception">The P/Invoke operation failed.</exception>
211215
public static HANDLE_FLAGS GetHandleInformation(SafeHandle hObject) => GetHandleInformation(hObject, out uint flags) ? (HANDLE_FLAGS)flags : throw new Win32Exception();
212216
}

deadlock-dotnet-sdk/Windows.Win32/SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ public unsafe string GetHandleObjectType()
8080
: throw new NTStatusException(status);
8181
}
8282

83+
/// <summary>
84+
/// Get the current HANDLE_FLAGS of this handle if it is still open.
85+
/// </summary>
86+
/// <returns></returns>
87+
/// <exception cref="Win32Exception">Failed to get handle information -OR- failed to open process to duplicate handle.</exception>
8388
public unsafe HANDLE_FLAGS GetHandleInfo()
8489
{
8590
try

0 commit comments

Comments
 (0)