1706f2543Smrg/*
2706f2543Smrg *Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved.
3706f2543Smrg *
4706f2543Smrg *Permission is hereby granted, free of charge, to any person obtaining
5706f2543Smrg * a copy of this software and associated documentation files (the
6706f2543Smrg *"Software"), to deal in the Software without restriction, including
7706f2543Smrg *without limitation the rights to use, copy, modify, merge, publish,
8706f2543Smrg *distribute, sublicense, and/or sell copies of the Software, and to
9706f2543Smrg *permit persons to whom the Software is furnished to do so, subject to
10706f2543Smrg *the following conditions:
11706f2543Smrg *
12706f2543Smrg *The above copyright notice and this permission notice shall be
13706f2543Smrg *included in all copies or substantial portions of the Software.
14706f2543Smrg *
15706f2543Smrg *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16706f2543Smrg *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17706f2543Smrg *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18706f2543Smrg *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
19706f2543Smrg *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20706f2543Smrg *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21706f2543Smrg *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22706f2543Smrg *
23706f2543Smrg *Except as contained in this notice, the name of Harold L Hunt II
24706f2543Smrg *shall not be used in advertising or otherwise to promote the sale, use
25706f2543Smrg *or other dealings in this Software without prior written authorization
26706f2543Smrg *from Harold L Hunt II.
27706f2543Smrg *
28706f2543Smrg * Authors:	Harold L Hunt II
29706f2543Smrg */
30706f2543Smrg
31706f2543Smrg#ifdef HAVE_XWIN_CONFIG_H
32706f2543Smrg#include <xwin-config.h>
33706f2543Smrg#endif
34706f2543Smrg#include "win.h"
35706f2543Smrg
36706f2543Smrg/* Prototypes */
37706f2543SmrgDWORD
38706f2543SmrgwinGetRegistryDWORD (HKEY hkey, char *pszRegistryKey);
39706f2543Smrg
40706f2543SmrgDWORD
41706f2543SmrgwinGetRegistryDWORD (HKEY hkey, char *pszRegistryKey)
42706f2543Smrg{
43706f2543Smrg  HKEY		hkResult;
44706f2543Smrg  DWORD		dwDisposition;
45706f2543Smrg
46706f2543Smrg  RegCreateKeyEx (hkey,
47706f2543Smrg		  pszRegistryKey,
48706f2543Smrg		  0,
49706f2543Smrg		  '\0',
50706f2543Smrg		  REG_OPTION_NON_VOLATILE,
51706f2543Smrg		  KEY_READ,
52706f2543Smrg		  NULL,
53706f2543Smrg		  &hkResult,
54706f2543Smrg		  &dwDisposition);
55706f2543Smrg
56706f2543Smrg  if (dwDisposition == REG_CREATED_NEW_KEY)
57706f2543Smrg    {
58706f2543Smrg      ErrorF ("winGetRegistryDWORD - Created new key: %s\n", pszRegistryKey);
59706f2543Smrg    }
60706f2543Smrg  else if (dwDisposition == REG_OPENED_EXISTING_KEY)
61706f2543Smrg    {
62706f2543Smrg      ErrorF ("winGetRegistryDWORD - Opened existing key: %s\n",
63706f2543Smrg	      pszRegistryKey);
64706f2543Smrg    }
65706f2543Smrg
66706f2543Smrg  /* Free the registry key handle */
67706f2543Smrg  RegCloseKey (hkResult);
68706f2543Smrg  hkResult = NULL;
69706f2543Smrg
70706f2543Smrg  return 0;
71706f2543Smrg}
72