ReactOS  0.4.14-dev-49-gfb4591c
condrv.h File Reference
#include <wdm.h>
Include dependency graph for condrv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _CONDRV_DRIVER
 

Macros

#define CONDRV_TAG   ' noC'
 
#define DD_CONDRV_TAG   '1noC'
 
#define CONDRV_CONS_TAG   '2noC'
 

Typedefs

typedef struct _CONDRV_DRIVER CONDRV_DRIVER
 
typedef struct _CONDRV_DRIVERPCONDRV_DRIVER
 

Functions

NTSTATUS NTAPI ConDrvCreateController (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 
NTSTATUS NTAPI ConDrvDeleteController (IN PDRIVER_OBJECT DriverObject)
 

Macro Definition Documentation

◆ CONDRV_CONS_TAG

#define CONDRV_CONS_TAG   '2noC'

Definition at line 24 of file condrv.h.

◆ CONDRV_TAG

#define CONDRV_TAG   ' noC'

Definition at line 22 of file condrv.h.

◆ DD_CONDRV_TAG

#define DD_CONDRV_TAG   '1noC'

Definition at line 23 of file condrv.h.

Typedef Documentation

◆ CONDRV_DRIVER

◆ PCONDRV_DRIVER

Function Documentation

◆ ConDrvCreateController()

NTSTATUS NTAPI ConDrvCreateController ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 21 of file control.c.

23 {
25  UNICODE_STRING DeviceName, SymlinkName;
27  PDEVICE_OBJECT Controller = NULL;
28 
29  DPRINT1("Create the Controller device...\n");
30 
33 
34  /* Get the driver extension */
36  DriverObject);
37 
38  /* Create the Controller device, if it doesn't exist */
40  0,
44  FALSE,
45  &Controller);
46  if (!NT_SUCCESS(Status)) goto Done;
47 
48  Status = IoCreateSymbolicLink(&SymlinkName, &DeviceName);
49  if (!NT_SUCCESS(Status))
50  {
51  IoDeleteDevice(Controller);
52  goto Done;
53  }
54 
55  Controller->Flags &= ~DO_DEVICE_INITIALIZING;
56 
57  /* Save the Controller device */
58  DriverExtension->Controller = Controller;
59 
60 Done:
61  DPRINT1("Done, Status = 0x%08lx\n", Status);
62  return Status;
63 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
LONG NTSTATUS
Definition: precomp.h:26
WCHAR DeviceName[]
Definition: adapter.cpp:21
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1842
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
#define DD_CONDRV_CTRL_SYMLNK_NAME_U
Definition: ntddcon.h:80
Status
Definition: gdiplustypes.h:24
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define FILE_DEVICE_UNKNOWN
Definition: winioctl.h:139
#define DPRINT1
Definition: precomp.h:8
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define DD_CONDRV_CTRL_DEVICE_NAME_U
Definition: ntddcon.h:78
struct _CONDRV_DRIVER * PCONDRV_DRIVER
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by DriverEntry().

◆ ConDrvDeleteController()

NTSTATUS NTAPI ConDrvDeleteController ( IN PDRIVER_OBJECT  DriverObject)

Definition at line 66 of file control.c.

67 {
69  PDEVICE_OBJECT Controller;
70  UNICODE_STRING SymlinkName;
71 
72  DPRINT1("Delete the Controller device...\n");
73 
74  /* Retrieve the Controller device */
76  if (!Controller) return STATUS_OBJECT_TYPE_MISMATCH;
77 
79  IoDeleteSymbolicLink(&SymlinkName);
80 
81  /* Delete the controller device itself */
82  IoDeleteDevice(Controller);
83 
84  DPRINT1("Done, Status = 0x%08lx\n", Status);
85  return Status;
86 }
LONG NTSTATUS
Definition: precomp.h:26
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:259
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1842
#define DD_CONDRV_CTRL_SYMLNK_NAME_U
Definition: ntddcon.h:80
Status
Definition: gdiplustypes.h:24
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define DPRINT1
Definition: precomp.h:8
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
struct _CONDRV_DRIVER * PCONDRV_DRIVER
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by ConDrvUnload().