Closed BinToss closed 2 years ago
In hindsight, this may be a request for the Windows API itself, rather than a wrapper. Still, If anyone knows how this SafeHandle became null, I'd appreciate an explanation and some suggestions.
Edit: I may need to double-check if SeBackupPrivilege was set properly.
You passed in a null SafeHandle yourself: templateFile: null
.
.NET interop cannot handle a null SafeHandle
. You must create a SafeHandle
with an invalid/null native handle and pass that in explicitly.
Ah, thank you! The documentation said the parameter could be null, but I suppose that isn't the case.
The following code block results in an exception thrown by mscorlib (.NET Framework 4.6.2) with little explanation of its cause.
Which parameter caused the NullArgumentException? templateFile? filename? securityAttributes? Is it an issue that did not originate from my code or even PInvoke.Kernel32 for that matter?