- DPRINT("NtCreateMutant(0x%x, 0x%x, 0x%x)\n", MutantHandle, DesiredAccess, ObjectAttributes);
-
- /* Check Output Safety */
- if(PreviousMode == UserMode) {
-
- _SEH_TRY {
-
- ProbeForWrite(MutantHandle,
- sizeof(HANDLE),
- sizeof(ULONG));
- } _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) {
-
+ DPRINT("NtCreateMutant(0x%p, 0x%x, 0x%p)\n",
+ MutantHandle, DesiredAccess, ObjectAttributes);
+
+ /* Check if we were called from user-mode */
+ if(PreviousMode != KernelMode)
+ {
+ /* Enter SEH Block */
+ _SEH_TRY
+ {
+ /* Check handle pointer */
+ ProbeForWriteHandle(MutantHandle);
+ }
+ _SEH_EXCEPT(_SEH_ExSystemExceptionFilter)
+ {