newlib/winsup/cygwin/registry.h
Corinna Vinschen cca89be9ad * registry.cc (reg_key::get_dword): Rename from get_int, use DWORD
rather than int type.  Avoid compiler warning.
	(reg_key::set_dword): Rename from set_int, use DWORD rather than int
	type.  Change return type to NTSTATUS.
	(reg_key::get_string): Change return type to NTSTATUS.
	(reg_key::set_string): Ditto.
	* registry.h: Accommodate above changes.
	* environ.cc (regopt): Test return value of reg_key::get_string as
	NTSTATUS.
	* sched.cc (sched_rr_get_interval): Change local int vars to DWORD.
	Call reg_key::get_dword instead of reg_key::get_int.
	* shared.cc (init_installation_root): Test return value of
	reg_key::get_string as NTSTATUS.
	(shared_info::heap_slop_size): Call reg_key::get_dword rather than
	reg_key::get_int.
	(shared_info::heap_chunk_size): Ditto.
	* shared_info.h (CURR_SHARED_MAGIC): Update.
	(class shared_info): Change heap_chunk and heap_slop to DWORD  values.
2011-04-23 13:15:46 +00:00

44 lines
1.1 KiB
C++

/* registry.h: shared info for cygwin
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011 Red Hat, Inc.
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:
HANDLE key;
NTSTATUS key_is_invalid;
DWORD _disposition;
public:
reg_key (HKEY toplev, REGSAM access, ...);
reg_key (bool isHKLM, REGSAM access, ...);
void *operator new (size_t, void *p) {return p;}
void build_reg (HKEY key, REGSAM access, va_list av);
bool error () {return key == NULL;}
DWORD get_dword (PCWSTR, DWORD);
NTSTATUS get_string (PCWSTR, PWCHAR, size_t, PCWSTR);
NTSTATUS set_dword (PCWSTR, DWORD);
NTSTATUS set_string (PCWSTR, PCWSTR);
bool created () const {return _disposition & REG_CREATED_NEW_KEY;}
~reg_key ();
};
/* Evaluates path to the directory of the local user registry hive */
PWCHAR __stdcall get_registry_hive_path (PCWSTR name, PWCHAR path);
void __stdcall load_registry_hive (PCWSTR name);