mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 15:31:43 +00:00
- Tree cleanups proposed on the mailing list. Move all non-Core OS modules to rosapps. Tests were already moved by Fireball to rostests.
svn path=/trunk/; revision=26033
This commit is contained in:
parent
ad07a1e58f
commit
1e3d5d70e9
420 changed files with 78215 additions and 0 deletions
33
rosapps/sysutils/utils/driver/unload/unload.c
Normal file
33
rosapps/sysutils/utils/driver/unload/unload.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Unload a device driver
|
||||
*/
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <ntndk.h>
|
||||
|
||||
int wmain(int argc, WCHAR * argv[])
|
||||
{
|
||||
NTSTATUS Status;
|
||||
UNICODE_STRING ServiceName;
|
||||
|
||||
if (argc != 2)
|
||||
{
|
||||
wprintf(L"Usage: unload <ServiceName>\n");
|
||||
return 0;
|
||||
}
|
||||
ServiceName.Length = (wcslen(argv[1]) + 52) * sizeof(WCHAR);
|
||||
ServiceName.Buffer = (LPWSTR)malloc(ServiceName.Length + sizeof(UNICODE_NULL));
|
||||
wsprintf(ServiceName.Buffer,
|
||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%S",
|
||||
argv[1]);
|
||||
wprintf(L"%s %d %d\n", ServiceName.Buffer, ServiceName.Length, wcslen(ServiceName.Buffer));
|
||||
Status = NtUnloadDriver(&ServiceName);
|
||||
free(ServiceName.Buffer);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
wprintf(L"Failed: %X\n", Status);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue