SDC C-Project CF Review 프로그램
LYW
2021-09-14 ffe71aadfdcb4a9ea2ac4d8d320983d42ef3cad5
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*
HISTORY
 
09Jul99 JET Added DrvNextValue() and DrvCloseValue() definitions
 
/****************************************************************************
 *
 *   registry.h
 *
 *   Copyright (c) 1992 Microsoft Corporation.  All Rights Reserved.
 *
 *   This file contains public definitions for maintaining registry information
 *   for drivers managing kernel driver registry related data.
 ****************************************************************************/
 
#ifndef _REGISTRY_H
  #define _REGISTRY_H
 
#include <winsvc.h>
 
/***************************************************************************
 *
 * Constants for accessing the registry
 *
 ***************************************************************************/
 
/*
 *  Path to service node key
 */
 
#define STR_SERVICES_NODE TEXT("SYSTEM\\CurrentControlSet\\Services\\")
 
/*
 *  Node sub-key for device parameters
 */
 
//#define STR_DEVICE_DATA TEXT("Parameters")
 
/*
 *  Name of Base group where sound drivers normally go
 */
 
#define STR_BASE_GROUP TEXT("Base")
 
/*
 *  Name of driver group for synthesizers
 *     - we use our own name here to make sure
 *       we are loaded after things like the PAS driver.  (Base is a
 *       known group and drivers in it are always loaded before unknown
 *       groups like this one).
 */
 
#define STR_SYNTH_GROUP TEXT("Motion Drivers")
 
/*
 *  Name of service
 */
 
#define STR_DRIVER TEXT("\\Driver\\")
 
/*
 *  Path to kernel drivers directory from system directory
 */
 
#define STR_DRIVERS_DIR TEXT("\\SystemRoot\\System32\\drivers\\")
 
/*
 *  Extension for drivers
 */
 
#define STR_SYS_EXT TEXT(".SYS")
 
/****************************************************************************
 
 Driver types
 
 ****************************************************************************/
 
typedef enum {
    SoundDriverTypeNormal = 1,
    SoundDriverTypeSynth /* Go in the synth group */
} SOUND_KERNEL_MODE_DRIVER_TYPE;
 
/****************************************************************************
 
Our registry access data
 
****************************************************************************/
#pragma pack(push, 4)
typedef struct {
    SC_HANDLE ServiceManagerHandle;           // Handle to the service controller
#ifndef WIN64
  SC_HANDLE    Dummy0;
#endif
    CHAR  DriverName[20];                    // Name of driver
    CHAR  TempKeySaveFileName[MAX_PATH];     // Where parameters key is saved
    DWORD  dwDevice;                          // Number current device
    SOUND_KERNEL_MODE_DRIVER_TYPE DriverType; // Type of device driver
    DWORD  dwDeviceUsage;                     // How many users this device
} REG_ACCESS, *PREG_ACCESS;
#pragma pack(pop)
 
/****************************************************************************
 
Test if configuration etc can be supported
 
****************************************************************************/
 
  #define DrvAccess(RegAccess) ((RegAccess)->ServiceManagerHandle != NULL)
 
/****************************************************************************
 
 Function prototypes
 
 ****************************************************************************/
  #ifdef __cplusplus
extern "C" {
  #endif
 
  //HKEY CALLBACK DrvCreateDeviceKey(PREG_ACCESS RegAccess);
  HKEY CALLBACK DrvOpenRegKey( DWORD dwDevice, LPCTSTR Path );
  BOOL CALLBACK DrvSetKnownVxd( DWORD dwDevice );
  BOOL CALLBACK DrvCreateServicesNode( DWORD dwDevice, BOOL Create );
  VOID CALLBACK DrvCloseServiceManager( DWORD dwDevice );
  BOOL CALLBACK DrvDeleteServicesNode( DWORD dwDevice );
  //BOOL CALLBACK DrvSaveParametersKey(PREG_ACCESS RegAccess);
  //BOOL CALLBACK DrvRestoreParametersKey(PREG_ACCESS RegAccess);
  HKEY CALLBACK DrvOpenDeviceKey( DWORD dwDevice );
 
  //      Set a device DWORD parameter
  LONG CALLBACK DrvSetDeviceDword(
    DWORD dwDevice,
    LPTSTR ValueName,
    DWORD dwValue );
 
  //     Read current DWORD parameter setting
  LONG CALLBACK DrvQueryDeviceDword(
    DWORD dwDevice,
    PTCHAR ValueName,
    PDWORD pValue,
    DWORD  defValue );
 
  //      Set a device STRING parameter
  LONG CALLBACK DrvSetDeviceString(
    DWORD dwDevice,
    PTCHAR ValueName,
    PTCHAR Value );
 
  //     Read current STRING parameter setting
  LONG CALLBACK DrvQueryDeviceString(
    DWORD dwDevice,
    PTCHAR ValueName,
    PTCHAR pValue,
    DWORD  valuelength,
    PTCHAR defValue );
 
  BOOL CALLBACK DrvLoadKernelDriver( DWORD dwDevice );
  BOOL CALLBACK DrvUnloadKernelDriver( DWORD dwDevice );
  BOOL CALLBACK DrvIsDriverLoaded( DWORD dwDevice );
  BOOL CALLBACK DrvConfigureDriver( DWORD dwDevice,PVOID Context );
 
  LRESULT CALLBACK DrvRemoveDriver( DWORD dwDevice );
  BOOL CALLBACK DrvRemoveDevice( DWORD dwDevice );
  LONG CALLBACK DrvNumberOfDevices();
  VOID CALLBACK DrvSetMapperName( LPTSTR SetupName );
 
  // Nc Specific
  HKEY CALLBACK DrvOpenNcKey( DWORD device, DWORD control, LPCTSTR Section );
  LONG CALLBACK DrvSetNcDword( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, DWORD Value );
  LONG CALLBACK DrvQueryNcDword( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, PDWORD pValue,
                   DWORD defValue );
  LONG CALLBACK DrvSetNcDouble( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, double Value );
  LONG CALLBACK DrvQueryNcDouble( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, double *pValue,
                   double defValue );
  LONG CALLBACK DrvSetNcString( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, LPTSTR Value );
  LONG CALLBACK DrvQueryNcString( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, LPTSTR pValue,
                   DWORD ValueLength, LPTSTR defValue );
  LONG CALLBACK DrvSetNcBool( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, BOOL Value );
  LONG CALLBACK DrvQueryNcBool( DWORD device, DWORD ControlNumber, LPCTSTR Section, LPTSTR ValueName, PBOOL pValue,
                   BOOL defValue );
  void          DrvCloseValue(DWORD device, DWORD control);
  BOOL          DrvNextValue(DWORD device,DWORD control,LPCTSTR Reg_Key,LPTSTR value_name_bfr);
 
  #ifdef __cplusplus
}
  #endif
 
#endif // _REGISTRY_H