2000-09-08 04:56:55 +02:00
|
|
|
/* registry.h: shared info for cygwin
|
|
|
|
|
2013-01-21 05:38:31 +01:00
|
|
|
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
2014-12-02 11:49:47 +01:00
|
|
|
2011, 2012, 2014 Red Hat, Inc.
|
2000-09-08 04:56:55 +02:00
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
class reg_key
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2011-04-19 12:02:06 +02:00
|
|
|
HANDLE key;
|
|
|
|
NTSTATUS key_is_invalid;
|
2006-01-03 18:44:26 +01:00
|
|
|
DWORD _disposition;
|
2000-09-08 04:56:55 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
reg_key (HKEY toplev, REGSAM access, ...);
|
2004-12-03 03:00:37 +01:00
|
|
|
reg_key (bool isHKLM, REGSAM access, ...);
|
2000-09-08 04:56:55 +02:00
|
|
|
|
|
|
|
void *operator new (size_t, void *p) {return p;}
|
|
|
|
void build_reg (HKEY key, REGSAM access, va_list av);
|
|
|
|
|
2011-04-23 15:15:46 +02:00
|
|
|
bool error () {return key == NULL;}
|
2000-09-08 04:56:55 +02:00
|
|
|
|
2011-04-23 15:15:46 +02:00
|
|
|
DWORD get_dword (PCWSTR, DWORD);
|
|
|
|
NTSTATUS get_string (PCWSTR, PWCHAR, size_t, PCWSTR);
|
2000-09-08 04:56:55 +02:00
|
|
|
|
2011-04-23 15:15:46 +02:00
|
|
|
NTSTATUS set_dword (PCWSTR, DWORD);
|
|
|
|
NTSTATUS set_string (PCWSTR, PCWSTR);
|
2009-10-20 16:54:47 +02:00
|
|
|
|
2006-01-03 18:44:26 +01:00
|
|
|
bool created () const {return _disposition & REG_CREATED_NEW_KEY;}
|
2000-09-08 04:56:55 +02:00
|
|
|
|
|
|
|
~reg_key ();
|
|
|
|
};
|