mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:35:40 +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;
|
||||
}
|
8
rosapps/sysutils/utils/driver/unload/unload.rbuild
Normal file
8
rosapps/sysutils/utils/driver/unload/unload.rbuild
Normal file
|
@ -0,0 +1,8 @@
|
|||
<module name="unload" type="win32cui" installbase="bin" installname="unload.exe" unicode="true">
|
||||
<define name="__USE_W32API" />
|
||||
<library>msvcrt</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
<library>user32</library>
|
||||
<file>unload.c</file>
|
||||
</module>
|
Loading…
Add table
Add a link
Reference in a new issue