Use only NtCreateKey and better suited access rights. Modified: trunk/reactos/lib/kernel32/file/move.c _____
Modified: trunk/reactos/lib/kernel32/file/move.c --- trunk/reactos/lib/kernel32/file/move.c 2005-12-29 22:43:44 UTC (rev 20447) +++ trunk/reactos/lib/kernel32/file/move.c 2005-12-29 22:54:24 UTC (rev 20448) @@ -109,24 +109,17 @@
NULL, NULL);
- Status = NtOpenKey(&Reboot, - KEY_ALL_ACCESS, - &ObjectAttributes); + Status = NtCreateKey(&Reboot, + KEY_QUERY_VALUE | KEY_SET_VALUE, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + NULL);
if (!NT_SUCCESS(Status)) { - Status = NtCreateKey(&Reboot, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_NON_VOLATILE, - NULL); - } - - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtCreateKey() failed (Status %lx)\n", Status); + DPRINT1("NtCreateKey() failed (Status 0x%lx)\n", Status); RtlFreeUnicodeString( &source_name ); RtlFreeUnicodeString( &dest_name ); return FALSE;