Skip to content

Commit 33f0cfd

Browse files
committed
Fix incorrect handling of parameters.
1 parent 7793650 commit 33f0cfd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

NtApiDotNet/NtDebug.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static NtDebug Create(string name, NtObject root, DebugObjectFlags flags)
5353
{
5454
using (ObjectAttributes obja = new ObjectAttributes(name, AttributeFlags.CaseInsensitive, root))
5555
{
56-
return Create(obja, DebugAccessRights.MaximumAllowed, DebugObjectFlags.None);
56+
return Create(obja, DebugAccessRights.MaximumAllowed, flags);
5757
}
5858
}
5959

@@ -102,7 +102,7 @@ public static NtDebug Open(string name, NtObject root, DebugAccessRights desired
102102
{
103103
using (ObjectAttributes obja = new ObjectAttributes(name, AttributeFlags.CaseInsensitive | AttributeFlags.OpenIf, root))
104104
{
105-
return Create(obja, DebugAccessRights.MaximumAllowed, DebugObjectFlags.None);
105+
return Create(obja, desired_access, DebugObjectFlags.None);
106106
}
107107
}
108108

@@ -114,7 +114,7 @@ public static NtDebug Open(string name, NtObject root, DebugAccessRights desired
114114
/// <returns>The debug object</returns>
115115
public static NtDebug Open(ObjectAttributes object_attributes, DebugAccessRights desired_access)
116116
{
117-
return Create(object_attributes, DebugAccessRights.MaximumAllowed, DebugObjectFlags.None, true).Result;
117+
return Create(object_attributes, desired_access, DebugObjectFlags.None, true).Result;
118118
}
119119

120120
/// <summary>
@@ -126,7 +126,7 @@ public static NtDebug Open(ObjectAttributes object_attributes, DebugAccessRights
126126
/// <returns>The NT status code and object result.</returns>
127127
public static NtResult<NtDebug> Open(ObjectAttributes object_attributes, DebugAccessRights desired_access, bool throw_on_error)
128128
{
129-
return Create(object_attributes, DebugAccessRights.MaximumAllowed, DebugObjectFlags.None, throw_on_error);
129+
return Create(object_attributes, desired_access, DebugObjectFlags.None, throw_on_error);
130130
}
131131

132132
/// <summary>
@@ -142,7 +142,7 @@ public static NtResult<NtDebug> OpenCurrent(bool throw_on_error)
142142
return new NtResult<NtDebug>();
143143
}
144144
return DuplicateFrom(NtProcess.Current, current_debug_object, 0,
145-
DuplicateObjectOptions.SameAttributes | DuplicateObjectOptions.SameAccess, false);
145+
DuplicateObjectOptions.SameAttributes | DuplicateObjectOptions.SameAccess, throw_on_error);
146146
}
147147

148148
#endregion

0 commit comments

Comments
 (0)