OpenCBM
|
Some utility functions for accessing the registry. More...
Go to the source code of this file.
Functions | |
NTSTATUS | cbm_registry_open_for_read (OUT PHANDLE HandleKey, IN PUNICODE_STRING Path) |
Open a registry path for reading. More... | |
NTSTATUS | cbm_registry_open_hardwarekey (OUT PHANDLE HandleKey, OUT PDEVICE_OBJECT *Pdo, IN PDEVICE_EXTENSION Pdx) |
Open the hardware key for another driver. More... | |
NTSTATUS | cbm_registry_close (IN HANDLE HandleKey) |
Close a registry key. More... | |
NTSTATUS | cbm_registry_close_hardwarekey (IN HANDLE HandleKey, IN PDEVICE_OBJECT Pdo) |
Close a hardware registry key. More... | |
NTSTATUS | cbm_registry_read_ulong (IN HANDLE HandleKey, IN PCWSTR KeyName, OUT PULONG Value) |
Read a ULONG value out of a registry key. More... | |
NTSTATUS | cbm_registry_write_ulong (IN HANDLE HandleKey, IN PCWSTR KeyName, IN ULONG Value) |
Write a ULONG value out of a registry key. More... | |
NTSTATUS cbm_registry_close | ( | IN HANDLE | HandleKey | ) |
Close a registry key.
This function closes a registry key.
HandleKey | The HANDLE of the registry path. |
If the registry key was obtained with a call to cbm_registry_open_hardwarekey(), you must not use this function, but use cbm_registry_close_hardwarekey() instead.
Definition at line 230 of file util-reg.c.
References FUNC_ENTER.
Referenced by cbm_init_registry(), and cbm_registry_close_hardwarekey().
NTSTATUS cbm_registry_close_hardwarekey | ( | IN HANDLE | HandleKey, |
IN PDEVICE_OBJECT | Pdo | ||
) |
Close a hardware registry key.
This function closes a registry key pointing to a hardware registry key.
HandleKey | The HANDLE of the registry path. |
Pdo | Pointer to the DEVICE_OBJECT for which we found the hardware key. |
Definition at line 260 of file util-reg.c.
References cbm_registry_close(), and FUNC_ENTER.
Referenced by ParPortAllowInterruptIoctl().
NTSTATUS cbm_registry_open_for_read | ( | OUT PHANDLE | HandleKey, |
IN PUNICODE_STRING | Path | ||
) |
Open a registry path for reading.
This function opens a registry key ("path"). This way, its entries can be read afterwards.
HandleKey | Pointer to a HANDLE which will contain the handle to the registry key ("path") on exit |
Path | Pointer to a UNICODE_STRING which points to the registry key to be opened. |
A call to this function must be balanced with a call to cbm_registry_close().
Definition at line 43 of file util-reg.c.
References DBG_PREFIX, FUNC_ENTER, and FUNC_PARAM.
Referenced by cbm_init_registry().
NTSTATUS cbm_registry_open_hardwarekey | ( | OUT PHANDLE | HandleKey, |
OUT PDEVICE_OBJECT * | Pdo, | ||
IN PDEVICE_EXTENSION | Pdx | ||
) |
Open the hardware key for another driver.
This function opens a the "hardware" registry key for the parallel port driver.
HandleKey | Pointer to a HANDLE which will contain the handle to the registry key ("path") on exit |
Pdo | Pointer to the DEVICE_OBJECT for which we found the hardware key. |
Pdx | The PDX of the driver which is calling this function |
A call to this function must be balanced with a call to cbm_registry_close_hardwarekey().
Thanks to Doron Holan [MS] for pointing out how to do it (MsgId:O6weQ on microsoft.public.development.device.drivers, L8qE HA.34 28@T K2MSF TNGP 11.ph x.gb lhttp://groups.google.com/groups?selm=O6weQL8qEHA.3428%40TK2MSFTNGP11.phx.gbl
Definition at line 95 of file util-reg.c.
References CbmOpenDeviceRegistryKey(), DBG_ASSERT, and FUNC_ENTER.
Referenced by ParPortAllowInterruptIoctl().
NTSTATUS cbm_registry_read_ulong | ( | IN HANDLE | HandleKey, |
IN PCWSTR | KeyName, | ||
OUT PULONG | Value | ||
) |
Read a ULONG value out of a registry key.
This function reads a ULONG value out of the registry.
HandleKey | The HANDLE of the registry path. |
KeyName | A null-terminated wide char string which contains the name of the value to be read. |
Value | Pointer to a memory location which will hold the return value. |
If the value cannot be read, the return value in *Value will not be changed.
Definition at line 299 of file util-reg.c.
References DBG_PREFIX, FUNC_ENTER, and FUNC_PARAM.
Referenced by cbm_init_registry(), and ParPortAllowInterruptIoctl().
NTSTATUS cbm_registry_write_ulong | ( | IN HANDLE | HandleKey, |
IN PCWSTR | KeyName, | ||
IN ULONG | Value | ||
) |
Write a ULONG value out of a registry key.
This function writes a ULONG value to the registry.
HandleKey | The HANDLE of the registry path. |
KeyName | A null-terminated wide char string which contains the name of the value to be read. |
Value | The value to be written to that memory entry. |
Definition at line 356 of file util-reg.c.
References DBG_PREFIX, FUNC_ENTER, and FUNC_PARAM.
Referenced by ParPortAllowInterruptIoctl().