Go to the source code of this file.
◆ AddAssociation()
Definition at line 171 of file assoc.c.
174{
177
181 {
183 return lRet;
184 }
185
189
191 {
193 return lRet;
194 }
195
199
201 {
203 return lRet;
204 }
205
207}
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
#define RegCloseKey(hKey)
#define KEY_CREATE_SUB_KEY
#define REG_OPTION_NON_VOLATILE
#define HKEY_LOCAL_MACHINE
Referenced by CommandAssoc().
◆ CommandAssoc()
Definition at line 238 of file assoc.c.
239{
242
243
245 {
247 return 0;
248 }
249
250
252 {
254 goto Quit;
255 }
256
258 if (pEqualSign !=
NULL)
259 {
260 PTSTR pszFileType = pEqualSign + 1;
261
262
263 *pEqualSign = 0;
264
265
266
267 if (*pszFileType == 0)
268 {
270 }
271 else
272
273 {
276 }
277
279 {
281 {
283 }
284
285 }
286 }
287 else
288 {
289
292 {
294 retval = 1;
295 }
296 }
297
298Quit:
300 {
301 if (retval != 0)
303 }
304 else
305 {
307 }
308
309 return retval;
310}
static LONG PrintAssociation(IN PCTSTR pszExtension)
static LONG AddAssociation(IN PCTSTR pszExtension, IN PCTSTR pszType)
static LONG PrintAllAssociations(VOID)
static LONG RemoveAssociation(IN PCTSTR pszExtension)
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
#define ConErrResPrintf(uID,...)
#define STRING_ASSOC_ERROR
#define STRING_ERROR_WHILE_PROCESSING
#define STRING_ASSOC_HELP
#define ERROR_FILE_NOT_FOUND
◆ PrintAllAssociations()
static LONG PrintAllAssociations |
( |
VOID |
| ) |
|
|
static |
Definition at line 108 of file assoc.c.
109{
116
120 {
122 return lRet;
123 }
124
128 {
131 return lRet;
132 }
133
134 ++dwExtLen;
136 if (!pszExtName)
137 {
138 WARN(
"Cannot allocate memory for pszExtName!\n");
141 }
142
143 for (dwKeyCtr = 0; dwKeyCtr < dwNumKeys; ++dwKeyCtr)
144 {
145 DWORD dwBufSize = dwExtLen;
146 lRet =
RegEnumKeyEx(hKeyClasses, dwKeyCtr, pszExtName, &dwBufSize,
148
150 {
151
152 if (*pszExtName ==
_T(
'.'))
154 }
155 else
156 {
160 return lRet;
161 }
162 }
163
165
168}
static LONG PrintAssociationEx(IN HKEY hKeyClasses, IN PCTSTR pszExtension)
#define ERROR_NOT_ENOUGH_MEMORY
#define KEY_ENUMERATE_SUB_KEYS
Referenced by CommandAssoc().
◆ PrintAssociation()
Definition at line 87 of file assoc.c.
89{
92
96 {
98 return lRet;
99 }
100
102
104 return lRet;
105}
Referenced by CommandAssoc().
◆ PrintAssociationEx()
Definition at line 23 of file assoc.c.
26{
29 DWORD dwFileTypeLen = 0;
31
34 {
37 return lRet;
38 }
39
40
42
43
45 {
47 return lRet;
48 }
50 {
53 return lRet;
54 }
55
56 ++dwFileTypeLen;
58 if (!pszFileType)
59 {
60 WARN(
"Cannot allocate memory for pszFileType!\n");
63 }
64
65
68
70 {
73 return lRet;
74 }
75
76
77 if (dwFileTypeLen != 0)
78 {
80 }
81
84}
#define ConOutPrintf(szStr,...)
Referenced by PrintAllAssociations(), and PrintAssociation().
◆ RemoveAssociation()
Definition at line 210 of file assoc.c.
212{
215
219 {
221 return lRet;
222 }
223
226
228 {
231 return lRet;
232 }
233
235}
Referenced by CommandAssoc().