summaryrefslogtreecommitdiff
path: root/support/dktools/dk4wregc.ctr
blob: be050baa2389cfb026e77d966af6422052339b55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%%	options

copyright owner	=	Dirk Krause
copyright year	=	2015-xxxx
license		=	bsd



%%	header

/**	@file
	Access Windows registry (close registry key).

	CRT on Windows: Not used.
*/

#ifndef DK4CONF_H_INCLUDED
#include "dk4conf.h"
#endif

#ifndef DK4TYPES_H_INCLUDED
#include "dk4types.h"
#endif

#ifndef DK4ERROR_H_INCLUDED
#include "dk4error.h"
#endif

#ifndef DK4WREGK_H_INCLUDED
#include "dk4wregk.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**	Close a registry key handle structure.
	@param	kptr	Key handle structure to close.
*/
void
dk4wreg_close_key(void *kptr);

#ifdef __cplusplus
}
#endif


%%	module


#include "dk4conf.h"
#include "dk4wregt.h"
#include "dk4wregc.h"
#ifndef DK4MEM_H_INCLUDED
#include "dk4mem.h"
#endif

#if DK4_ON_WINDOWS

#ifndef WINDOWS_H_INCLUDED
#include <windows.h>
#define	WINDOWS_H_INCLUDED 1
#endif
#ifndef WINBASE_H_INCLUDED
#include <winbase.h>
#define	WINBASE_H_INCLUDED 1
#endif
#ifndef WINREG_H_INCLUDED
#include <winreg.h>
#define	WINREG_H_INCLUDED 1
#endif

#endif



$!trace-include



void
dk4wreg_close_key(void *kptr)
{
#if DK4_ON_WINDOWS
  dk4_wreg_key_t	*hptr;
#endif
  if (kptr) {
#if DK4_ON_WINDOWS
    hptr = (dk4_wreg_key_t *)kptr;
    RegCloseKey(hptr->hk);   
#else
#endif
    dk4mem_free(kptr);
  }
}