2000-09-08 10:56:55 +08:00
|
|
|
/* registry.h: shared info for cygwin
|
|
|
|
|
2013-01-21 12:38:31 +08:00
|
|
|
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
2014-12-02 18:49:47 +08:00
|
|
|
2011, 2012, 2014 Red Hat, Inc.
|
2000-09-08 10:56:55 +08: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 18:02:06 +08:00
|
|
|
HANDLE key;
|
|
|
|
NTSTATUS key_is_invalid;
|
2006-01-04 01:44:26 +08:00
|
|
|
DWORD _disposition;
|
2000-09-08 10:56:55 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
reg_key (HKEY toplev, REGSAM access, ...);
|
2004-12-03 10:00:37 +08:00
|
|
|
reg_key (bool isHKLM, REGSAM access, ...);
|
2000-09-08 10:56:55 +08:00
|
|
|
|
|
|
|
void *operator new (size_t, void *p) {return p;}
|
|
|
|
void build_reg (HKEY key, REGSAM access, va_list av);
|
|
|
|
|
2011-04-23 21:15:46 +08:00
|
|
|
bool error () {return key == NULL;}
|
2000-09-08 10:56:55 +08:00
|
|
|
|
2011-04-23 21:15:46 +08:00
|
|
|
DWORD get_dword (PCWSTR, DWORD);
|
|
|
|
NTSTATUS get_string (PCWSTR, PWCHAR, size_t, PCWSTR);
|
2000-09-08 10:56:55 +08:00
|
|
|
|
2011-04-23 21:15:46 +08:00
|
|
|
NTSTATUS set_dword (PCWSTR, DWORD);
|
|
|
|
NTSTATUS set_string (PCWSTR, PCWSTR);
|
2009-10-20 22:54:47 +08:00
|
|
|
|
2006-01-04 01:44:26 +08:00
|
|
|
bool created () const {return _disposition & REG_CREATED_NEW_KEY;}
|
2000-09-08 10:56:55 +08:00
|
|
|
|
|
|
|
~reg_key ();
|
|
|
|
};
|