Package: Winreg

Dependencies

   with Interfaces.C;
   with System;

Description

This file contains thelowlevel bindings to the windows registry Have a look at the windows documentation for a description.

Header

package Winreg is
 

Type Summary

BYTE derived from unsigned_char
DWORD derived from Unsigned
Error derived from long
FILETIME derived from DWORD
FORMATFLAGS derived from DWORD
HKEY derived from DWORD
long derived from long
LPBYTE derived from LPVOID
Inherited Operations:  "<", "<=", "=", ">", ">=", FormatMessage, RegEnumValue, RegQueryValueEx, RegSetValueEx, To_LPVOID
LPDWORD derived from LPVOID
Overridden Operations:  RegEnumValue, RegQueryValueEx
New Operations:  RegCreateKeyEx, RegQueryInfoKey, To_LPDWORD
Inherited Operations:  "<", "<=", "=", ">", ">=", FormatMessage, RegSetValueEx, To_LPVOID
LPREGDATATYPE
LpSecurity_Attributes
LPTSTR derived from LPVOID
Overridden Operations:  FormatMessage, RegEnumValue
New Operations:  RegCreateKeyEx, RegDeleteValue, RegEnumKey, RegQueryInfoKey, To_LPTSTR
Inherited Operations:  "<", "<=", "=", ">", ">=", RegQueryValueEx, RegSetValueEx, To_LPVOID
LPVOID derived from Address
New Operations:  FormatMessage, RegEnumValue, RegQueryValueEx, RegSetValueEx, To_LPVOID
Inherited Operations:  "<", "<=", "=", ">", ">="
Option derived from DWORD
PFILETIME
PHKEY derived from LPVOID
New Operations:  RegCreateKeyEx, RegOpenKeyEx
Inherited Operations:  "<", "<=", "=", ">", ">=", FormatMessage, RegEnumValue, RegQueryValueEx, RegSetValueEx, To_LPVOID
REGDATATYPE derived from DWORD
Regsam derived from DWORD
Security_Attributes

Constants and Named Numbers

ERROR_ACCESS_DENIED : constant Error := 5;
ERROR_FILE_NOT_FOUND : constant Error := 2;
ERROR_MORE_DATA : constant Error := 259;
ERROR_SUCCESS : constant Error := 0;
FORMAT_MESSAGE_FROM_STRING : constant FORMATFLAGS := 1024;
FORMAT_MESSAGE_FROM_SYSTEM : constant FORMATFLAGS := 4096;
HKEY_CLASSES_ROOT : constant HKEY := 16#80000000#;
HKEY_CURRENT_CONFIG : constant HKEY := 16#80000005#;
HKEY_CURRENT_USER : constant HKEY := 16#80000001#;
HKEY_LOCAL_MACHINE : constant HKEY := 16#80000002#;
HKEY_PERFORMANCE_DATA : constant HKEY := 16#80000004#;
HKEY_USERS : constant HKEY := 16#80000003#;
KEY_ALL_ACCESS : constant Regsam := 16#f003f#;
KEY_CREATE_SUB_KEY : constant Regsam := 4;
KEY_ENUMERATE_SUB_KEYS : constant Regsam := 8;
KEY_NOTIFY : constant Regsam := 16;
KEY_QUERY_VALUE : constant Regsam := 1;
KEY_SET_VALUE : constant Regsam := 2;
REG_BINARY : constant REGDATATYPE := 3;
REG_DWORD : constant REGDATATYPE := 4;
REG_EXPAND_SZ : constant REGDATATYPE := 2;
REG_MULTI_SZ : constant REGDATATYPE := 7;
REG_NONE : constant REGDATATYPE := 0;
REG_OPTION_BACKUP_RESTORE : constant Option := 4;
REG_OPTION_CREATE_LINK : constant Option := 2;
REG_OPTION_NON_VOLATILE : constant Option := 0;
REG_OPTION_VOLATILE : constant Option := 1;
REG_SZ : constant REGDATATYPE := 1;
VOIDNULL : constant LPVOID := LPVOID(System.Null_Address);

Other Items:

subtype TSTRING is Wide_String;
Windows TString is of type Wide (except on Win95)

type LONG is new Interfaces.C.long;

type DWORD is new Interfaces.C.Unsigned;

type LPVOID is new System.Address;

type LPDWORD is new LPVOID;

type LPTSTR is new LPVOID;

subtype LPCTSTR is LPTSTR;

subtype Win32_TSTRING is Interfaces.C.wchar_array;

type FILETIME is new DWORD;

type PFILETIME is access all FILETIME;

type BYTE is new Interfaces.C.unsigned_char;

type LPBYTE is new LPVOID;

type HKEY is new DWORD;

type PHKEY is new LPVOID;

type Option is new DWORD;

type Regsam is new DWORD;

type FORMATFLAGS is new DWORD;

type REGDATATYPE is new DWORD;

type LPREGDATATYPE is access all REGDATATYPE;

type ERROR is new long;

type Security_Attributes is
   record
      Nlength : DWORD;
      LpSecurityDescriptor : LPVOID;
      BInheritHandle : Boolean;
   end record;

type LpSecurity_Attributes is access all Security_Attributes;

function To_LPTSTR (TSTR : Win32_TSTRING )
return LPTSTR;

function To_LPCTSTR (TSTR : Win32_TSTRING )
return LPCTSTR;

function To_LPDWORD (D : DWORD ) return LPDWORD;

function To_TSTRING (S : Win32_TSTRING ) return Wide_String;

function To_Array (S : Wide_String ) return Win32_TSTRING;

function To_LPVOID (TSTR : Win32_TSTRING )
return LPVOID;

function To_TString(S : String) return TSTRING;
Bindings to the Win API

function RegCloseKey (H : HKEY ) return Error;

function RegDeleteKey(
H : HKEY;
LpszSubKey : LPCTSTR) return Error;

function RegDeleteValue(
H : HKEY;
LpszValuename: LPTSTR ) return Error;

function RegEnumKey(
H : HKEY;
DwIndex : DWORD;
LpName : LPTSTR;
CbName : DWORD ) return Error;

function RegCreateKeyEx (
H              : HKEY;
LpszSubkey     : LPCTSTR;
DwReserved     : DWORD;
LpszClass      : LPTSTR;
DwOptions      : Option;
SamDesired     : Regsam;
LpSec          : LpSecurity_Attributes;
PhkResult      : PHKEY;
LpdwDispositon : LPDWORD) return Error;

function RegEnumValue(
H      : HKEY;
DwValueIndex : DWORD;
LpszValue : LPTSTR;
LpcdValue : LPDWORD;
LpdwReserved : DWORD;
LpdwType : LPREGDATATYPE;
LpDataBuffer : LPVOID;
LpcdwDataBuffer : LPDWORD) return Error;

function RegFlush(H : HKEY) return Error;

function RegOpenKeyEx (
H              : HKEY;
LpszSubkey     : LPCTSTR;
DwReserved     : DWORD;
SamDesired     : Regsam;
PhkResult      : PHKEY) return Error;

function RegQueryValueEx(
H    : HKEY;
LpValueName  : LPCTSTR;
LpdwReserved : DWORD;
LpdwType : LPREGDATATYPE;
LpData : LPVOID;
LpdwcData : LPDWORD) return Error;

function RegSetValueEx(
H   : HKEY;
LpszValueName : LPCTSTR;
DwReserved : DWORD;
DwDataType : REGDATATYPE;
LpDATA : LPVOID;
DwBytes : DWORD) return Error;

function RegQueryInfoKey(
H         : HKEY;
LpClass   : LPTSTR;
LpdwClass : LPDWORD;
LpdwReserved : DWORD;
LpdwSubKeys  : LPDWORD;
LpdwMaxSubKey: LPDWORD;
LpdwMaxClass : LPDWORD;
LpdwValues   : LPDWORD;
LpdwMaxValueName : LPDWORD;
LpdwMaxValueData : LPDWORD;
LpcdwSecurityDesc: LPDWORD;
LpftLastWriteTime: PFILETIME) return Error;

function FormatMessage(
DwFlags : FORMATFLAGS;
LpSource : LPVOID;
DwMessageId : DWORD;
DwLanguageId : DWORD;
LpBuffer : LPTSTR;
NSize : DWORD;
Va_List : LPVOID) return DWORD;

private

   --  Implementation-defined ...
end Winreg;