ReactOS  0.4.15-dev-3302-ga37d9a4
unload.c File Reference
#include <windows.h>
#include <stdlib.h>
#include <ntndk.h>
Include dependency graph for unload.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

int wmain (int argc, WCHAR *argv[])
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 4 of file unload.c.

Function Documentation

◆ wmain()

int wmain ( int  argc,
WCHAR argv[] 
)

Definition at line 9 of file unload.c.

10 {
13 
14  if (argc != 2)
15  {
16  wprintf(L"Usage: unload <ServiceName>\n");
17  return 0;
18  }
19 
20  ServiceName.Length = (USHORT)((52 + wcslen(argv[1])) * sizeof(WCHAR));
21  ServiceName.MaximumLength = ServiceName.Length + sizeof(UNICODE_NULL);
22  ServiceName.Buffer = malloc(ServiceName.MaximumLength);
23  wsprintf(ServiceName.Buffer,
24  L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%s",
25  argv[1]);
26  wprintf(L"Unloading %wZ\n", &ServiceName);
27 
29  free(ServiceName.Buffer);
30  if (!NT_SUCCESS(Status))
31  {
32  wprintf(L"Failed: 0x%08lx\n", Status);
33  return 1;
34  }
35 
36  return 0;
37 }
static int argc
Definition: ServiceArgs.c:12
#define free
Definition: debug_ros.c:5
LONG NTSTATUS
Definition: precomp.h:26
#define wprintf(...)
Definition: whoami.c:18
#define argv
Definition: mplay32.c:18
#define UNICODE_NULL
Status
Definition: gdiplustypes.h:24
LPTSTR ServiceName
Definition: ServiceMain.c:15
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const WCHAR L[]
Definition: oid.c:1250
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NtUnloadDriver(IN PUNICODE_STRING DriverServiceName)
Definition: driver.c:2181
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define malloc
Definition: debug_ros.c:4
#define wsprintf
Definition: winuser.h:5841