ReactOS  0.4.14-dev-358-gbef841c
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  ServiceName.Length = (wcslen(argv[1]) + 52) * sizeof(WCHAR);
20  ServiceName.Buffer = (LPWSTR)malloc(ServiceName.Length + sizeof(UNICODE_NULL));
21  wsprintf(ServiceName.Buffer,
22  L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%S",
23  argv[1]);
24  wprintf(L"%s %d %Ud\n", ServiceName.Buffer, ServiceName.Length, wcslen(ServiceName.Buffer));
26  free(ServiceName.Buffer);
27  if (!NT_SUCCESS(Status))
28  {
29  wprintf(L"Failed: %X\n", Status);
30  return 1;
31  }
32  return 0;
33 }
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
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
Status
Definition: gdiplustypes.h:24
NTSTATUS NtUnloadDriver(IN PUNICODE_STRING DriverServiceName)
Definition: driver.c:2147
#define malloc
Definition: debug_ros.c:4
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define wsprintf
Definition: winuser.h:5766
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)