Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

util-reg.c File Reference

Some utility functions for accessing the registry. More...

#include <wdm.h>
#include "cbm_driver.h"

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.
NTSTATUS cbm_registry_open_hardwarekey (OUT PHANDLE HandleKey, OUT PDEVICE_OBJECT *Pdo, IN PDEVICE_EXTENSION Pdx)
 Open the hardware key for another driver.
NTSTATUS cbm_registry_close (IN HANDLE HandleKey)
 Close a registry key.
NTSTATUS cbm_registry_close_hardwarekey (IN HANDLE HandleKey, IN PDEVICE_OBJECT Pdo)
 Close a hardware registry key.
NTSTATUS cbm_registry_read_ulong (IN HANDLE HandleKey, IN PCWSTR KeyName, OUT PULONG Value)
 Read a ULONG value out of a registry key.
NTSTATUS cbm_registry_write_ulong (IN HANDLE HandleKey, IN PCWSTR KeyName, IN ULONG Value)
 Write a ULONG value out of a registry key.


Detailed Description

Some utility functions for accessing the registry.

**************************************************************

Author:
Spiro Trikaliotis
Version:
Id
util-reg.c,v 1.12 2006/02/24 12:01:20 trikalio Exp


Definition in file util-reg.c.


Function Documentation

NTSTATUS cbm_registry_close IN HANDLE  HandleKey  ) 
 

Close a registry key.

This function closes a registry key.

Parameters:
HandleKey The HANDLE of the registry path.
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.
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 231 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.

Parameters:
HandleKey The HANDLE of the registry path.
Pdo Pointer to the DEVICE_OBJECT for which we found the hardware key.
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.

Definition at line 261 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.

Parameters:
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.
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.
A call to this function must be balanced with a call to cbm_registry_close().

Todo:
| OBJ_KERNEL_HANDLE

Definition at line 44 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.

Parameters:
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
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.
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:<O6weQL8qEHA.3428@TK2MSFTNGP11.phx.gbl> on microsoft.public.development.device.drivers, http://groups.google.com/groups?selm=O6weQL8qEHA.3428%40TK2MSFTNGP11.phx.gbl

Definition at line 96 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.

Parameters:
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.
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.
If the value cannot be read, the return value in *Value will not be changed.

Definition at line 300 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.

Parameters:
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.
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values.

Definition at line 357 of file util-reg.c.

References DBG_PREFIX, FUNC_ENTER, and FUNC_PARAM.

Referenced by ParPortAllowInterruptIoctl().


Generated on Sun Apr 30 18:46:16 2006 for opencbm by  doxygen 1.4.2