xref: /reactos/sdk/include/psdk/shlwapi.h (revision 43d07fe6)
1 /*
2  * SHLWAPI.DLL functions
3  *
4  * Copyright (C) 2000 Juergen Schmied
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #ifndef __WINE_SHLWAPI_H
22 #define __WINE_SHLWAPI_H
23 
24 #include <specstrings.h>
25 #include <objbase.h>
26 #include <shtypes.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* defined(__cplusplus) */
31 
32 #include <pshpack8.h>
33 
34 #ifndef NO_SHLWAPI_REG
35 
36 /* Registry functions */
37 
38 DWORD WINAPI SHDeleteEmptyKeyA(_In_ HKEY, _In_opt_ LPCSTR);
39 DWORD WINAPI SHDeleteEmptyKeyW(_In_ HKEY, _In_opt_ LPCWSTR);
40 #define SHDeleteEmptyKey WINELIB_NAME_AW(SHDeleteEmptyKey)
41 
42 DWORD WINAPI SHDeleteKeyA(_In_ HKEY, _In_opt_ LPCSTR);
43 DWORD WINAPI SHDeleteKeyW(_In_ HKEY, _In_opt_ LPCWSTR);
44 #define SHDeleteKey WINELIB_NAME_AW(SHDeleteKey)
45 
46 DWORD WINAPI SHDeleteValueA(_In_ HKEY, _In_opt_ LPCSTR, _In_ LPCSTR);
47 DWORD WINAPI SHDeleteValueW(_In_ HKEY, _In_opt_ LPCWSTR, _In_ LPCWSTR);
48 #define SHDeleteValue WINELIB_NAME_AW(SHDeleteValue)
49 
50 DWORD
51 WINAPI
52 SHGetValueA(
53   _In_ HKEY,
54   _In_opt_ LPCSTR,
55   _In_opt_ LPCSTR,
56   _Out_opt_ LPDWORD,
57   _Out_writes_bytes_opt_(*pcbData) LPVOID,
58   _Inout_opt_ LPDWORD pcbData);
59 
60 DWORD
61 WINAPI
62 SHGetValueW(
63   _In_ HKEY,
64   _In_opt_ LPCWSTR,
65   _In_opt_ LPCWSTR,
66   _Out_opt_ LPDWORD,
67   _Out_writes_bytes_opt_(*pcbData) LPVOID,
68   _Inout_opt_ LPDWORD pcbData);
69 
70 #define SHGetValue WINELIB_NAME_AW(SHGetValue)
71 
72 DWORD
73 WINAPI
74 SHSetValueA(
75   _In_ HKEY,
76   _In_opt_ LPCSTR,
77   _In_opt_ LPCSTR,
78   _In_ DWORD,
79   _In_reads_bytes_opt_(cbData) LPCVOID,
80   _In_ DWORD cbData);
81 
82 DWORD
83 WINAPI
84 SHSetValueW(
85   _In_ HKEY,
86   _In_opt_ LPCWSTR,
87   _In_opt_ LPCWSTR,
88   _In_ DWORD,
89   _In_reads_bytes_opt_(cbData) LPCVOID,
90   _In_ DWORD cbData);
91 
92 #define SHSetValue WINELIB_NAME_AW(SHSetValue)
93 
94 DWORD
95 WINAPI
96 SHQueryValueExA(
97   _In_ HKEY,
98   _In_opt_ LPCSTR,
99   _Reserved_ LPDWORD,
100   _Out_opt_ LPDWORD,
101   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
102   _Inout_opt_ LPDWORD pcbData);
103 
104 DWORD
105 WINAPI
106 SHQueryValueExW(
107   _In_ HKEY,
108   _In_opt_ LPCWSTR,
109   _Reserved_ LPDWORD,
110   _Out_opt_ LPDWORD,
111   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
112   _Inout_opt_ LPDWORD pcbData);
113 
114 #define SHQueryValueEx WINELIB_NAME_AW(SHQueryValueEx)
115 
116 LONG
117 WINAPI
118 SHEnumKeyExA(
119   _In_ HKEY,
120   _In_ DWORD,
121   _Out_writes_(*pcchName) LPSTR,
122   _Inout_ LPDWORD pcchName);
123 
124 LONG
125 WINAPI
126 SHEnumKeyExW(
127   _In_ HKEY,
128   _In_ DWORD,
129   _Out_writes_(*pcchName) LPWSTR,
130   _Inout_ LPDWORD pcchName);
131 
132 #define SHEnumKeyEx WINELIB_NAME_AW(SHEnumKeyEx)
133 
134 LONG
135 WINAPI
136 SHEnumValueA(
137   _In_ HKEY,
138   _In_ DWORD,
139   _Out_writes_opt_(*pcchValueName) LPSTR,
140   _Inout_opt_ LPDWORD pcchValueName,
141   _Out_opt_ LPDWORD,
142   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
143   _Inout_opt_ LPDWORD pcbData);
144 
145 LONG
146 WINAPI
147 SHEnumValueW(
148   _In_ HKEY,
149   _In_ DWORD,
150   _Out_writes_opt_(*pcchValueName) LPWSTR,
151   _Inout_opt_ LPDWORD pcchValueName,
152   _Out_opt_ LPDWORD,
153   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
154   _Inout_opt_ LPDWORD pcbData);
155 
156 #define SHEnumValue WINELIB_NAME_AW(SHEnumValue)
157 
158 LONG
159 WINAPI
160 SHQueryInfoKeyA(
161   _In_ HKEY,
162   _Out_opt_ LPDWORD,
163   _Out_opt_ LPDWORD,
164   _Out_opt_ LPDWORD,
165   _Out_opt_ LPDWORD);
166 
167 LONG
168 WINAPI
169 SHQueryInfoKeyW(
170   _In_ HKEY,
171   _Out_opt_ LPDWORD,
172   _Out_opt_ LPDWORD,
173   _Out_opt_ LPDWORD,
174   _Out_opt_ LPDWORD);
175 
176 #define SHQueryInfoKey WINELIB_NAME_AW(SHQueryInfoKey)
177 
178 DWORD
179 WINAPI
180 SHRegGetPathA(
181   _In_ HKEY,
182   _In_opt_ LPCSTR,
183   _In_opt_ LPCSTR,
184   _Out_writes_(MAX_PATH) LPSTR,
185   _In_ DWORD);
186 
187 DWORD
188 WINAPI
189 SHRegGetPathW(
190   _In_ HKEY,
191   _In_opt_ LPCWSTR,
192   _In_opt_ LPCWSTR,
193   _Out_writes_(MAX_PATH) LPWSTR,
194   _In_ DWORD);
195 
196 #define SHRegGetPath WINELIB_NAME_AW(SHRegGetPath)
197 
198 DWORD
199 WINAPI
200 SHRegSetPathA(
201   _In_ HKEY,
202   _In_opt_ LPCSTR,
203   _In_opt_ LPCSTR,
204   _In_ LPCSTR,
205   _In_ DWORD);
206 
207 DWORD
208 WINAPI
209 SHRegSetPathW(
210   _In_ HKEY,
211   _In_opt_ LPCWSTR,
212   _In_opt_ LPCWSTR,
213   _In_ LPCWSTR,
214   _In_ DWORD);
215 
216 #define SHRegSetPath WINELIB_NAME_AW(SHRegSetPath)
217 
218 DWORD
219 WINAPI
220 SHCopyKeyA(
221   _In_ HKEY,
222   _In_opt_ LPCSTR,
223   _In_ HKEY,
224   _Reserved_ DWORD);
225 
226 DWORD
227 WINAPI
228 SHCopyKeyW(
229   _In_ HKEY,
230   _In_opt_ LPCWSTR,
231   _In_ HKEY,
232   _Reserved_ DWORD);
233 
234 #define SHCopyKey WINELIB_NAME_AW(SHCopyKey)
235 
236 HKEY WINAPI  SHRegDuplicateHKey(_In_ HKEY);
237 
238 /* SHRegGetValue flags */
239 typedef INT SRRF;
240 
241 #define SRRF_RT_REG_NONE 0x1
242 #define SRRF_RT_REG_SZ 0x2
243 #define SRRF_RT_REG_EXPAND_SZ 0x4
244 #define SRRF_RT_REG_BINARY 0x8
245 #define SRRF_RT_REG_DWORD 0x10
246 #define SRRF_RT_REG_MULTI_SZ 0x20
247 #define SRRF_RT_REG_QWORD 0x40
248 
249 #define SRRF_RT_DWORD (SRRF_RT_REG_BINARY|SRRF_RT_REG_DWORD)
250 #define SRRF_RT_QWORD (SRRF_RT_REG_BINARY|SRRF_RT_REG_QWORD)
251 #define SRRF_RT_ANY 0xffff
252 
253 #define SRRF_RM_ANY 0
254 #define SRRF_RM_NORMAL 0x10000
255 #define SRRF_RM_SAFE 0x20000
256 #define SRRF_RM_SAFENETWORK 0x40000
257 
258 #define SRRF_NOEXPAND 0x10000000
259 #define SRRF_ZEROONFAILURE 0x20000000
260 #define SRRF_NOVIRT 0x40000000
261 
262 LSTATUS
263 WINAPI
264 SHRegGetValueA(
265   _In_ HKEY hkey,
266   _In_opt_ LPCSTR pszSubKey,
267   _In_opt_ LPCSTR pszValue,
268   _In_ SRRF srrfFlags,
269   _Out_opt_ LPDWORD pdwType,
270   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID pvData,
271   _Inout_opt_ LPDWORD pcbData);
272 
273 LSTATUS
274 WINAPI
275 SHRegGetValueW(
276   _In_ HKEY hkey,
277   _In_opt_ LPCWSTR pszSubKey,
278   _In_opt_ LPCWSTR pszValue,
279   _In_ SRRF srrfFlags,
280   _Out_opt_ LPDWORD pdwType,
281   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID pvData,
282   _Inout_opt_ LPDWORD pcbData);
283 
284 #define SHRegGetValue WINELIB_NAME_AW(SHRegGetValue)
285 
286 /* Undocumented registry functions */
287 
288 DWORD WINAPI SHDeleteOrphanKeyA(HKEY,LPCSTR);
289 DWORD WINAPI SHDeleteOrphanKeyW(HKEY,LPCWSTR);
290 #define SHDeleteOrphanKey WINELIB_NAME_AW(SHDeleteOrphanKey)
291 
292 
293 /* User registry functions */
294 
295 typedef enum
296 {
297   SHREGDEL_DEFAULT = 0,
298   SHREGDEL_HKCU    = 0x1,
299   SHREGDEL_HKLM    = 0x10,
300   SHREGDEL_BOTH    = SHREGDEL_HKLM | SHREGDEL_HKCU
301 } SHREGDEL_FLAGS;
302 
303 typedef enum
304 {
305   SHREGENUM_DEFAULT = 0,
306   SHREGENUM_HKCU    = 0x1,
307   SHREGENUM_HKLM    = 0x10,
308   SHREGENUM_BOTH    = SHREGENUM_HKLM | SHREGENUM_HKCU
309 } SHREGENUM_FLAGS;
310 
311 #define SHREGSET_HKCU       0x1 /* Apply to HKCU if empty */
312 #define SHREGSET_FORCE_HKCU 0x2 /* Always apply to HKCU */
313 #define SHREGSET_HKLM       0x4 /* Apply to HKLM if empty */
314 #define SHREGSET_FORCE_HKLM 0x8 /* Always apply to HKLM */
315 #define SHREGSET_DEFAULT    (SHREGSET_FORCE_HKCU | SHREGSET_HKLM)
316 
317 typedef HANDLE HUSKEY;
318 typedef HUSKEY *PHUSKEY;
319 
320 LONG
321 WINAPI
322 SHRegCreateUSKeyA(
323   _In_ LPCSTR,
324   _In_ REGSAM,
325   _In_opt_ HUSKEY,
326   _Out_ PHUSKEY,
327   _In_ DWORD);
328 
329 LONG
330 WINAPI
331 SHRegCreateUSKeyW(
332   _In_ LPCWSTR,
333   _In_ REGSAM,
334   _In_opt_ HUSKEY,
335   _Out_ PHUSKEY,
336   _In_ DWORD);
337 
338 #define SHRegCreateUSKey WINELIB_NAME_AW(SHRegCreateUSKey)
339 
340 LONG
341 WINAPI
342 SHRegOpenUSKeyA(
343   _In_ LPCSTR,
344   _In_ REGSAM,
345   _In_opt_ HUSKEY,
346   _Out_ PHUSKEY,
347   _In_ BOOL);
348 
349 LONG
350 WINAPI
351 SHRegOpenUSKeyW(
352   _In_ LPCWSTR,
353   _In_ REGSAM,
354   _In_opt_ HUSKEY,
355   _Out_ PHUSKEY,
356   _In_ BOOL);
357 
358 #define SHRegOpenUSKey WINELIB_NAME_AW(SHRegOpenUSKey)
359 
360 LONG
361 WINAPI
362 SHRegQueryUSValueA(
363   _In_ HUSKEY,
364   _In_opt_ LPCSTR,
365   _Inout_opt_ LPDWORD,
366   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
367   _Inout_opt_ LPDWORD pcbData,
368   _In_ BOOL,
369   _In_reads_bytes_opt_(dwDefaultDataSize) LPVOID,
370   _In_opt_ DWORD dwDefaultDataSize);
371 
372 LONG
373 WINAPI
374 SHRegQueryUSValueW(
375   _In_ HUSKEY,
376   _In_opt_ LPCWSTR,
377   _Inout_opt_ LPDWORD,
378   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
379   _Inout_opt_ LPDWORD pcbData,
380   _In_ BOOL,
381   _In_reads_bytes_opt_(dwDefaultDataSize) LPVOID,
382   _In_opt_ DWORD dwDefaultDataSize);
383 
384 #define SHRegQueryUSValue WINELIB_NAME_AW(SHRegQueryUSValue)
385 
386 LONG
387 WINAPI
388 SHRegWriteUSValueA(
389   _In_ HUSKEY,
390   _In_ LPCSTR,
391   _In_ DWORD,
392   _In_reads_bytes_(cbData) LPVOID,
393   _In_ DWORD cbData,
394   _In_ DWORD);
395 
396 LONG
397 WINAPI
398 SHRegWriteUSValueW(
399   _In_ HUSKEY,
400   _In_ LPCWSTR,
401   _In_ DWORD,
402   _In_reads_bytes_(cbData) LPVOID,
403   _In_ DWORD cbData,
404   _In_ DWORD);
405 
406 #define SHRegWriteUSValue WINELIB_NAME_AW(SHRegWriteUSValue)
407 
408 LONG
409 WINAPI
410 SHRegDeleteUSValueA(
411   _In_ HUSKEY,
412   _In_ LPCSTR,
413   _In_ SHREGDEL_FLAGS);
414 
415 LONG
416 WINAPI
417 SHRegDeleteUSValueW(
418   _In_ HUSKEY,
419   _In_ LPCWSTR,
420   _In_ SHREGDEL_FLAGS);
421 
422 #define SHRegDeleteUSValue WINELIB_NAME_AW(SHRegDeleteUSValue)
423 
424 LONG
425 WINAPI
426 SHRegDeleteEmptyUSKeyA(
427   _In_ HUSKEY,
428   _In_ LPCSTR,
429   _In_ SHREGDEL_FLAGS);
430 
431 LONG
432 WINAPI
433 SHRegDeleteEmptyUSKeyW(
434   _In_ HUSKEY,
435   _In_ LPCWSTR,
436   _In_ SHREGDEL_FLAGS);
437 
438 #define SHRegDeleteEmptyUSKey WINELIB_NAME_AW(SHRegDeleteEmptyUSKey)
439 
440 LONG
441 WINAPI
442 SHRegEnumUSKeyA(
443   _In_ HUSKEY,
444   _In_ DWORD,
445   _Out_writes_to_(*pcchName, *pcchName) LPSTR,
446   _Inout_ LPDWORD pcchName,
447   _In_ SHREGENUM_FLAGS);
448 
449 LONG
450 WINAPI
451 SHRegEnumUSKeyW(
452   _In_ HUSKEY,
453   _In_ DWORD,
454   _Out_writes_to_(*pcchName, *pcchName) LPWSTR,
455   _Inout_ LPDWORD pcchName,
456   _In_ SHREGENUM_FLAGS);
457 
458 #define SHRegEnumUSKey WINELIB_NAME_AW(SHRegEnumUSKey)
459 
460 LONG
461 WINAPI
462 SHRegEnumUSValueA(
463   _In_ HUSKEY,
464   _In_ DWORD,
465   _Out_writes_to_(*pcchValueName, *pcchValueName) LPSTR,
466   _Inout_ LPDWORD pcchValueName,
467   _Out_opt_ LPDWORD,
468   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
469   _Inout_opt_ LPDWORD pcbData,
470   _In_ SHREGENUM_FLAGS);
471 
472 LONG
473 WINAPI
474 SHRegEnumUSValueW(
475   _In_ HUSKEY,
476   _In_ DWORD,
477   _Out_writes_to_(*pcchValueName, *pcchValueName) LPWSTR,
478   _Inout_ LPDWORD pcchValueName,
479   _Out_opt_ LPDWORD,
480   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
481   _Inout_opt_ LPDWORD pcbData,
482   _In_ SHREGENUM_FLAGS);
483 
484 #define SHRegEnumUSValue WINELIB_NAME_AW(SHRegEnumUSValue)
485 
486 LONG
487 WINAPI
488 SHRegQueryInfoUSKeyA(
489   _In_ HUSKEY,
490   _Out_opt_ LPDWORD,
491   _Out_opt_ LPDWORD,
492   _Out_opt_ LPDWORD,
493   _Out_opt_ LPDWORD,
494   _In_ SHREGENUM_FLAGS);
495 
496 LONG
497 WINAPI
498 SHRegQueryInfoUSKeyW(
499   _In_ HUSKEY,
500   _Out_opt_ LPDWORD,
501   _Out_opt_ LPDWORD,
502   _Out_opt_ LPDWORD,
503   _Out_opt_ LPDWORD,
504   _In_ SHREGENUM_FLAGS);
505 
506 #define SHRegQueryInfoUSKey WINELIB_NAME_AW(SHRegQueryInfoUSKey)
507 
508 LONG WINAPI SHRegCloseUSKey(_In_ HUSKEY);
509 
510 LONG
511 WINAPI
512 SHRegGetUSValueA(
513   _In_ LPCSTR,
514   _In_opt_ LPCSTR,
515   _Inout_opt_ LPDWORD,
516   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
517   _Inout_opt_ LPDWORD pcbData,
518   _In_ BOOL,
519   _In_reads_bytes_opt_(dwDefaultDataSize) LPVOID,
520   _In_ DWORD dwDefaultDataSize);
521 
522 LONG
523 WINAPI
524 SHRegGetUSValueW(
525   _In_ LPCWSTR,
526   _In_opt_ LPCWSTR,
527   _Inout_opt_ LPDWORD,
528   _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID,
529   _Inout_opt_ LPDWORD pcbData,
530   _In_ BOOL,
531   _In_reads_bytes_opt_(dwDefaultDataSize) LPVOID,
532   _In_ DWORD dwDefaultDataSize);
533 
534 #define SHRegGetUSValue WINELIB_NAME_AW(SHRegGetUSValue)
535 
536 LONG
537 WINAPI
538 SHRegSetUSValueA(
539   _In_ LPCSTR,
540   _In_ LPCSTR,
541   _In_ DWORD,
542   _In_reads_bytes_opt_(cbData) LPVOID,
543   _In_opt_ DWORD cbData,
544   _In_opt_ DWORD);
545 
546 LONG
547 WINAPI
548 SHRegSetUSValueW(
549   _In_ LPCWSTR,
550   _In_ LPCWSTR,
551   _In_ DWORD,
552   _In_reads_bytes_opt_(cbData) LPVOID,
553   _In_opt_ DWORD cbData,
554   _In_opt_ DWORD);
555 
556 #define SHRegSetUSValue WINELIB_NAME_AW(SHRegSetUSValue)
557 
558 BOOL
559 WINAPI
560 SHRegGetBoolUSValueA(
561   _In_ LPCSTR,
562   _In_opt_ LPCSTR,
563   _In_ BOOL,
564   _In_ BOOL);
565 
566 BOOL
567 WINAPI
568 SHRegGetBoolUSValueW(
569   _In_ LPCWSTR,
570   _In_opt_ LPCWSTR,
571   _In_ BOOL,
572   _In_ BOOL);
573 
574 #define SHRegGetBoolUSValue WINELIB_NAME_AW(SHRegGetBoolUSValue)
575 
576 int WINAPI SHRegGetIntW(_In_ HKEY, _In_opt_ LPCWSTR, _In_ int);
577 
578 /* IQueryAssociation and helpers */
579 enum
580 {
581     ASSOCF_NONE                 = 0x0000,
582     ASSOCF_INIT_NOREMAPCLSID    = 0x0001, /* Don't map clsid->progid */
583     ASSOCF_INIT_BYEXENAME       = 0x0002, /* .exe name given */
584     ASSOCF_OPEN_BYEXENAME       = 0x0002, /* Synonym */
585     ASSOCF_INIT_DEFAULTTOSTAR   = 0x0004, /* Use * as base */
586     ASSOCF_INIT_DEFAULTTOFOLDER = 0x0008, /* Use folder as base */
587     ASSOCF_NOUSERSETTINGS       = 0x0010, /* No HKCU reads */
588     ASSOCF_NOTRUNCATE           = 0x0020, /* Don't truncate return */
589     ASSOCF_VERIFY               = 0x0040, /* Verify data */
590     ASSOCF_REMAPRUNDLL          = 0x0080, /* Get rundll args */
591     ASSOCF_NOFIXUPS             = 0x0100, /* Don't fixup errors */
592     ASSOCF_IGNOREBASECLASS      = 0x0200, /* Don't read baseclass */
593     ASSOCF_INIT_IGNOREUNKNOWN   = 0x0400, /* Fail for unknown progid */
594     ASSOCF_INIT_FIXED_PROGID    = 0x0800, /* Used passed string as progid, don't try to map it */
595     ASSOCF_IS_PROTOCOL          = 0x1000, /* Treat as protocol, that should be mapped */
596     ASSOCF_INIT_FOR_FILE        = 0x2000, /* progid is for file extension association */
597 };
598 
599 typedef DWORD ASSOCF;
600 
601 typedef enum
602 {
603     ASSOCSTR_COMMAND = 1,     /* Verb command */
604     ASSOCSTR_EXECUTABLE,      /* .exe from command string */
605     ASSOCSTR_FRIENDLYDOCNAME, /* Friendly doc type name */
606     ASSOCSTR_FRIENDLYAPPNAME, /* Friendly .exe name */
607     ASSOCSTR_NOOPEN,          /* noopen value */
608     ASSOCSTR_SHELLNEWVALUE,   /* Use shellnew key */
609     ASSOCSTR_DDECOMMAND,      /* DDE command template */
610     ASSOCSTR_DDEIFEXEC,       /* DDE command for process create */
611     ASSOCSTR_DDEAPPLICATION,  /* DDE app name */
612     ASSOCSTR_DDETOPIC,        /* DDE topic */
613     ASSOCSTR_INFOTIP,         /* Infotip */
614     ASSOCSTR_QUICKTIP,        /* Quick infotip */
615     ASSOCSTR_TILEINFO,        /* Properties for tileview */
616     ASSOCSTR_CONTENTTYPE,     /* Mimetype */
617     ASSOCSTR_DEFAULTICON,     /* Icon */
618     ASSOCSTR_SHELLEXTENSION,  /* GUID for shell extension handler */
619     ASSOCSTR_MAX
620 } ASSOCSTR;
621 
622 typedef enum
623 {
624     ASSOCKEY_SHELLEXECCLASS = 1, /* Key for ShellExec */
625     ASSOCKEY_APP,                /* Application */
626     ASSOCKEY_CLASS,              /* Progid or class */
627     ASSOCKEY_BASECLASS,          /* Base class */
628     ASSOCKEY_MAX
629 } ASSOCKEY;
630 
631 typedef enum
632 {
633     ASSOCDATA_MSIDESCRIPTOR = 1, /* Component descriptor */
634     ASSOCDATA_NOACTIVATEHANDLER, /* Don't activate */
635     ASSOCDATA_QUERYCLASSSTORE,   /* Look in Class Store */
636     ASSOCDATA_HASPERUSERASSOC,   /* Use user association */
637     ASSOCDATA_EDITFLAGS,         /* Edit flags */
638     ASSOCDATA_VALUE,             /* pszExtra is value */
639     ASSOCDATA_MAX
640 } ASSOCDATA;
641 
642 typedef enum
643 {
644     ASSOCENUM_NONE
645 } ASSOCENUM;
646 
647 typedef enum
648 {
649     FTA_None                  = 0x00000000,
650     FTA_Exclude               = 0x00000001,
651     FTA_Show                  = 0x00000002,
652     FTA_HasExtension          = 0x00000004,
653     FTA_NoEdit                = 0x00000008,
654     FTA_NoRemove              = 0x00000010,
655     FTA_NoNewVerb             = 0x00000020,
656     FTA_NoEditVerb            = 0x00000040,
657     FTA_NoRemoveVerb          = 0x00000080,
658     FTA_NoEditDesc            = 0x00000100,
659     FTA_NoEditIcon            = 0x00000200,
660     FTA_NoEditDflt            = 0x00000400,
661     FTA_NoEditVerbCmd         = 0x00000800,
662     FTA_NoEditVerbExe         = 0x00001000,
663     FTA_NoDDE                 = 0x00002000,
664     FTA_NoEditMIME            = 0x00008000,
665     FTA_OpenIsSafe            = 0x00010000,
666     FTA_AlwaysUnsafe          = 0x00020000,
667     FTA_NoRecentDocs          = 0x00100000,
668     FTA_SafeForElevation      = 0x00200000, /* Win8+ */
669     FTA_AlwaysUseDirectInvoke = 0x00400000  /* Win8+ */
670 } FILETYPEATTRIBUTEFLAGS;
671 DEFINE_ENUM_FLAG_OPERATORS(FILETYPEATTRIBUTEFLAGS)
672 
673 typedef struct IQueryAssociations *LPQUERYASSOCIATIONS;
674 
675 #define INTERFACE IQueryAssociations
DECLARE_INTERFACE_(IQueryAssociations,IUnknown)676 DECLARE_INTERFACE_(IQueryAssociations,IUnknown)
677 {
678     /*** IUnknown methods ***/
679     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
680     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
681     STDMETHOD_(ULONG,Release)(THIS) PURE;
682     /*** IQueryAssociations methods ***/
683     STDMETHOD(Init)(THIS_ _In_ ASSOCF flags, _In_opt_ LPCWSTR pszAssoc, _In_opt_ HKEY hkProgid, _In_opt_ HWND hwnd) PURE;
684     STDMETHOD(GetString)(THIS_ _In_ ASSOCF flags, _In_ ASSOCSTR str, _In_opt_ LPCWSTR pszExtra, _Out_writes_opt_(*pcchOut) LPWSTR pszOut, _Inout_ DWORD *pcchOut) PURE;
685     STDMETHOD(GetKey)(THIS_ _In_ ASSOCF flags, _In_ ASSOCKEY key, _In_opt_ LPCWSTR pszExtra, _Out_ HKEY *phkeyOut) PURE;
686     STDMETHOD(GetData)(THIS_ _In_ ASSOCF flags, _In_ ASSOCDATA data, _In_opt_ LPCWSTR pszExtra, _Out_writes_bytes_opt_(*pcbOut) LPVOID pvOut, _Inout_opt_ DWORD *pcbOut) PURE;
687     STDMETHOD(GetEnum)(THIS_ _In_ ASSOCF flags, _In_ ASSOCENUM assocenum, _In_opt_ LPCWSTR pszExtra, _In_ REFIID riid, _Outptr_ LPVOID *ppvOut) PURE;
688 };
689 #undef INTERFACE
690 
691 #if !defined(__cplusplus) || defined(CINTERFACE)
692 #define IQueryAssociations_QueryInterface(p,a,b)   (p)->lpVtbl->QueryInterface(p,a,b)
693 #define IQueryAssociations_AddRef(p)               (p)->lpVtbl->AddRef(p)
694 #define IQueryAssociations_Release(p)              (p)->lpVtbl->Release(p)
695 #define IQueryAssociations_Init(p,a,b,c,d)         (p)->lpVtbl->Init(p,a,b,c,d)
696 #define IQueryAssociations_GetString(p,a,b,c,d,e)  (p)->lpVtbl->GetString(p,a,b,c,d,e)
697 #define IQueryAssociations_GetKey(p,a,b,c,d)       (p)->lpVtbl->GetKey(p,a,b,c,d)
698 #define IQueryAssociations_GetData(p,a,b,c,d,e)    (p)->lpVtbl->GetData(p,a,b,c,d,e)
699 #define IQueryAssociations_GetEnum(p,a,b,c,d,e)    (p)->lpVtbl->GetEnum(p,a,b,c,d,e)
700 #endif
701 
702 HRESULT WINAPI AssocCreate(_In_ CLSID, _In_ REFIID, _Outptr_ LPVOID*);
703 
704 HRESULT
705 WINAPI
706 AssocQueryStringA(
707   _In_ ASSOCF,
708   _In_ ASSOCSTR,
709   _In_ LPCSTR,
710   _In_opt_ LPCSTR,
711   _Out_writes_opt_(*pcchOut) LPSTR,
712   _Inout_ LPDWORD pcchOut);
713 
714 HRESULT
715 WINAPI
716 AssocQueryStringW(
717   _In_ ASSOCF,
718   _In_ ASSOCSTR,
719   _In_ LPCWSTR,
720   _In_opt_ LPCWSTR,
721   _Out_writes_opt_(*pcchOut) LPWSTR,
722   _Inout_ LPDWORD pcchOut);
723 
724 #define AssocQueryString WINELIB_NAME_AW(AssocQueryString)
725 
726 HRESULT
727 WINAPI
728 AssocQueryStringByKeyA(
729   _In_ ASSOCF,
730   _In_ ASSOCSTR,
731   _In_ HKEY,
732   _In_opt_ LPCSTR,
733   _Out_writes_opt_(*pcchOut) LPSTR,
734   _Inout_ LPDWORD pcchOut);
735 
736 HRESULT
737 WINAPI
738 AssocQueryStringByKeyW(
739   _In_ ASSOCF,
740   _In_ ASSOCSTR,
741   _In_ HKEY,
742   _In_opt_ LPCWSTR,
743   _Out_writes_opt_(*pcchOut) LPWSTR,
744   _Inout_ LPDWORD pcchOut);
745 
746 #define AssocQueryStringByKey WINELIB_NAME_AW(AssocQueryStringByKey)
747 
748 HRESULT
749 WINAPI
750 AssocQueryKeyA(
751   _In_ ASSOCF,
752   _In_ ASSOCKEY,
753   _In_ LPCSTR,
754   _In_opt_ LPCSTR,
755   _Out_ PHKEY);
756 
757 HRESULT
758 WINAPI
759 AssocQueryKeyW(
760   _In_ ASSOCF,
761   _In_ ASSOCKEY,
762   _In_ LPCWSTR,
763   _In_opt_ LPCWSTR,
764   _Out_ PHKEY);
765 
766 #define AssocQueryKey WINELIB_NAME_AW(AssocQueryKey)
767 
768 BOOL WINAPI AssocIsDangerous(_In_ LPCWSTR);
769 
770 #endif /* NO_SHLWAPI_REG */
771 
772 void WINAPI IUnknown_Set(_Inout_ IUnknown **ppunk, _In_opt_ IUnknown *punk);
773 void WINAPI IUnknown_AtomicRelease(_Inout_opt_ IUnknown **punk);
774 HRESULT WINAPI IUnknown_GetWindow(_In_ IUnknown *punk, _Out_ HWND *phwnd);
775 
776 HRESULT
777 WINAPI
778 IUnknown_SetSite(
779   _In_ IUnknown *punk,
780   _In_opt_ IUnknown *punkSite);
781 
782 HRESULT
783 WINAPI
784 IUnknown_GetSite(
785   _In_ IUnknown *punk,
786   _In_ REFIID riid,
787   _Outptr_ void **ppv);
788 
789 HRESULT
790 WINAPI
791 IUnknown_QueryService(
792   _In_opt_ IUnknown *punk,
793   _In_ REFGUID guidService,
794   _In_ REFIID riid,
795   _Outptr_ void **ppvOut);
796 
797 /* Path functions */
798 #ifndef NO_SHLWAPI_PATH
799 
800 /* GetPathCharType return flags */
801 #define GCT_INVALID     0x0
802 #define GCT_LFNCHAR     0x1
803 #define GCT_SHORTCHAR   0x2
804 #define GCT_WILD        0x4
805 #define GCT_SEPARATOR   0x8
806 
807 LPSTR  WINAPI PathAddBackslashA(_Inout_updates_(MAX_PATH) LPSTR);
808 LPWSTR WINAPI PathAddBackslashW(_Inout_updates_(MAX_PATH) LPWSTR);
809 #define PathAddBackslash WINELIB_NAME_AW(PathAddBackslash)
810 
811 BOOL
812 WINAPI
813 PathAddExtensionA(
814   _Inout_updates_(MAX_PATH) LPSTR,
815   _In_opt_ LPCSTR);
816 
817 BOOL
818 WINAPI
819 PathAddExtensionW(
820   _Inout_updates_(MAX_PATH) LPWSTR,
821   _In_opt_ LPCWSTR);
822 
823 #define PathAddExtension WINELIB_NAME_AW(PathAddExtension)
824 
825 BOOL WINAPI PathAppendA(_Inout_updates_(MAX_PATH) LPSTR, _In_ LPCSTR);
826 BOOL WINAPI PathAppendW(_Inout_updates_(MAX_PATH) LPWSTR, _In_ LPCWSTR);
827 #define PathAppend WINELIB_NAME_AW(PathAppend)
828 
829 LPSTR  WINAPI PathBuildRootA(_Out_writes_(4) LPSTR, int);
830 LPWSTR WINAPI PathBuildRootW(_Out_writes_(4) LPWSTR, int);
831 #define PathBuildRoot WINELIB_NAME_AW(PathBuiltRoot)
832 
833 BOOL WINAPI PathCanonicalizeA(_Out_writes_(MAX_PATH) LPSTR, _In_ LPCSTR);
834 BOOL WINAPI PathCanonicalizeW(_Out_writes_(MAX_PATH) LPWSTR, _In_ LPCWSTR);
835 #define PathCanonicalize WINELIB_NAME_AW(PathCanonicalize)
836 
837 LPSTR
838 WINAPI
839 PathCombineA(
840   _Out_writes_(MAX_PATH) LPSTR,
841   _In_opt_ LPCSTR,
842   _In_opt_ LPCSTR);
843 
844 LPWSTR
845 WINAPI
846 PathCombineW(
847   _Out_writes_(MAX_PATH) LPWSTR,
848   _In_opt_ LPCWSTR,
849   _In_opt_ LPCWSTR);
850 
851 #define PathCombine WINELIB_NAME_AW(PathCombine)
852 
853 BOOL
854 WINAPI
855 PathCompactPathA(
856   _In_opt_ HDC,
857   _Inout_updates_(MAX_PATH) LPSTR,
858   _In_ UINT);
859 
860 BOOL
861 WINAPI
862 PathCompactPathW(
863   _In_opt_ HDC,
864   _Inout_updates_(MAX_PATH) LPWSTR,
865   _In_ UINT);
866 
867 #define PathCompactPath WINELIB_NAME_AW(PathCompactPath)
868 
869 BOOL
870 WINAPI
871 PathCompactPathExA(
872   _Out_writes_(cchMax) LPSTR,
873   _In_ LPCSTR,
874   _In_ UINT cchMax,
875   _In_ DWORD);
876 
877 BOOL
878 WINAPI
879 PathCompactPathExW(
880   _Out_writes_(cchMax) LPWSTR,
881   _In_ LPCWSTR,
882   _In_ UINT cchMax,
883   _In_ DWORD);
884 
885 #define PathCompactPathEx WINELIB_NAME_AW(PathCompactPathEx)
886 
887 int
888 WINAPI
889 PathCommonPrefixA(
890   _In_ LPCSTR,
891   _In_ LPCSTR,
892   _Out_writes_opt_(MAX_PATH) LPSTR);
893 
894 int
895 WINAPI
896 PathCommonPrefixW(
897   _In_ LPCWSTR,
898   _In_ LPCWSTR,
899   _Out_writes_opt_(MAX_PATH) LPWSTR);
900 
901 #define PathCommonPrefix WINELIB_NAME_AW(PathCommonPrefix)
902 
903 HRESULT
904 WINAPI
905 PathCreateFromUrlA(
906   _In_ LPCSTR,
907   _Out_writes_to_(*pcchPath, *pcchPath) LPSTR,
908   _Inout_ LPDWORD pcchPath,
909   DWORD);
910 
911 HRESULT
912 WINAPI
913 PathCreateFromUrlW(
914   _In_ LPCWSTR pszUrl,
915   _Out_writes_to_(*pcchPath, *pcchPath) LPWSTR pszPath,
916   _Inout_ LPDWORD pcchPath,
917   DWORD dwFlags);
918 
919 #define PathCreateFromUrl WINELIB_NAME_AW(PathCreateFromUrl)
920 
921 HRESULT WINAPI PathCreateFromUrlAlloc(_In_ LPCWSTR pszUrl, _Outptr_ LPWSTR* pszPath, DWORD dwReserved);
922 
923 BOOL WINAPI PathFileExistsA(_In_ LPCSTR pszPath);
924 BOOL WINAPI PathFileExistsW(_In_ LPCWSTR pszPath);
925 #define PathFileExists WINELIB_NAME_AW(PathFileExists)
926 
927 BOOL WINAPI PathFileExistsAndAttributesA(LPCSTR lpszPath,DWORD* dwAttr);
928 BOOL WINAPI PathFileExistsAndAttributesW(LPCWSTR lpszPath,DWORD* dwAttr);
929 #define PathFileExistsAndAttributes WINELIB_NAME_AW(PathFileExistsAndAttributes)
930 
931 LPSTR  WINAPI PathFindExtensionA(_In_ LPCSTR pszPath);
932 LPWSTR WINAPI PathFindExtensionW(_In_ LPCWSTR pszPath);
933 #define PathFindExtension WINELIB_NAME_AW(PathFindExtension)
934 
935 LPSTR  WINAPI PathFindFileNameA(_In_ LPCSTR pszPath);
936 LPWSTR WINAPI PathFindFileNameW(_In_ LPCWSTR pszPath);
937 #define PathFindFileName WINELIB_NAME_AW(PathFindFileName)
938 
939 LPSTR  WINAPI PathFindNextComponentA(_In_ LPCSTR);
940 LPWSTR WINAPI PathFindNextComponentW(_In_ LPCWSTR);
941 #define PathFindNextComponent WINELIB_NAME_AW(PathFindNextComponent)
942 
943 BOOL WINAPI PathFindOnPathA(_Inout_updates_(MAX_PATH) LPSTR, _In_opt_ LPCSTR*);
944 BOOL WINAPI PathFindOnPathW(_Inout_updates_(MAX_PATH) LPWSTR, _In_opt_ LPCWSTR*);
945 #define PathFindOnPath WINELIB_NAME_AW(PathFindOnPath)
946 
947 LPSTR  WINAPI PathGetArgsA(_In_ LPCSTR pszPath);
948 LPWSTR WINAPI PathGetArgsW(_In_ LPCWSTR pszPath);
949 #define PathGetArgs WINELIB_NAME_AW(PathGetArgs)
950 
951 UINT WINAPI PathGetCharTypeA(_In_ UCHAR ch);
952 UINT WINAPI PathGetCharTypeW(_In_ WCHAR ch);
953 #define PathGetCharType WINELIB_NAME_AW(PathGetCharType)
954 
955 int WINAPI PathGetDriveNumberA(_In_ LPCSTR);
956 int WINAPI PathGetDriveNumberW(_In_ LPCWSTR);
957 #define PathGetDriveNumber WINELIB_NAME_AW(PathGetDriveNumber)
958 
959 BOOL WINAPI PathIsDirectoryA(_In_ LPCSTR);
960 BOOL WINAPI PathIsDirectoryW(_In_ LPCWSTR);
961 #define PathIsDirectory WINELIB_NAME_AW(PathIsDirectory)
962 
963 BOOL WINAPI PathIsDirectoryEmptyA(_In_ LPCSTR);
964 BOOL WINAPI PathIsDirectoryEmptyW(_In_ LPCWSTR);
965 #define PathIsDirectoryEmpty WINELIB_NAME_AW(PathIsDirectoryEmpty)
966 
967 BOOL WINAPI PathIsFileSpecA(_In_ LPCSTR);
968 BOOL WINAPI PathIsFileSpecW(_In_ LPCWSTR);
969 #define PathIsFileSpec WINELIB_NAME_AW(PathIsFileSpec);
970 
971 BOOL WINAPI PathIsPrefixA(_In_ LPCSTR, _In_ LPCSTR);
972 BOOL WINAPI PathIsPrefixW(_In_ LPCWSTR, _In_ LPCWSTR);
973 #define PathIsPrefix WINELIB_NAME_AW(PathIsPrefix)
974 
975 BOOL WINAPI PathIsRelativeA(_In_ LPCSTR);
976 BOOL WINAPI PathIsRelativeW(_In_ LPCWSTR);
977 #define PathIsRelative WINELIB_NAME_AW(PathIsRelative)
978 
979 BOOL WINAPI PathIsRootA(_In_ LPCSTR);
980 BOOL WINAPI PathIsRootW(_In_ LPCWSTR);
981 #define PathIsRoot WINELIB_NAME_AW(PathIsRoot)
982 
983 BOOL WINAPI PathIsSameRootA(_In_ LPCSTR, _In_ LPCSTR);
984 BOOL WINAPI PathIsSameRootW(_In_ LPCWSTR, _In_ LPCWSTR);
985 #define PathIsSameRoot WINELIB_NAME_AW(PathIsSameRoot)
986 
987 BOOL WINAPI PathIsUNCA(_In_ LPCSTR);
988 BOOL WINAPI PathIsUNCW(_In_ LPCWSTR);
989 #define PathIsUNC WINELIB_NAME_AW(PathIsUNC)
990 
991 BOOL WINAPI PathIsUNCServerA(_In_ LPCSTR);
992 BOOL WINAPI PathIsUNCServerW(_In_ LPCWSTR);
993 #define PathIsUNCServer WINELIB_NAME_AW(PathIsUNCServer)
994 
995 BOOL WINAPI PathIsUNCServerShareA(_In_ LPCSTR);
996 BOOL WINAPI PathIsUNCServerShareW(_In_ LPCWSTR);
997 #define PathIsUNCServerShare WINELIB_NAME_AW(PathIsUNCServerShare)
998 
999 BOOL WINAPI PathIsContentTypeA(_In_ LPCSTR, _In_ LPCSTR);
1000 BOOL WINAPI PathIsContentTypeW(_In_ LPCWSTR, _In_ LPCWSTR);
1001 #define PathIsContentType WINELIB_NAME_AW(PathIsContentType)
1002 
1003 BOOL WINAPI PathIsURLA(_In_ LPCSTR);
1004 BOOL WINAPI PathIsURLW(_In_ LPCWSTR);
1005 #define PathIsURL WINELIB_NAME_AW(PathIsURL)
1006 
1007 BOOL WINAPI PathMakePrettyA(_Inout_ LPSTR);
1008 BOOL WINAPI PathMakePrettyW(_Inout_ LPWSTR);
1009 #define PathMakePretty WINELIB_NAME_AW(PathMakePretty)
1010 
1011 BOOL WINAPI PathMatchSpecA(_In_ LPCSTR, _In_ LPCSTR);
1012 BOOL WINAPI PathMatchSpecW(_In_ LPCWSTR, _In_ LPCWSTR);
1013 #define PathMatchSpec WINELIB_NAME_AW(PathMatchSpec)
1014 
1015 int WINAPI PathParseIconLocationA(_Inout_ LPSTR);
1016 int WINAPI PathParseIconLocationW(_Inout_ LPWSTR);
1017 #define PathParseIconLocation WINELIB_NAME_AW(PathParseIconLocation)
1018 
1019 VOID WINAPI PathQuoteSpacesA(_Inout_updates_(MAX_PATH) LPSTR);
1020 VOID WINAPI PathQuoteSpacesW(_Inout_updates_(MAX_PATH) LPWSTR);
1021 #define PathQuoteSpaces WINELIB_NAME_AW(PathQuoteSpaces)
1022 
1023 BOOL
1024 WINAPI
1025 PathRelativePathToA(
1026   _Out_writes_(MAX_PATH) LPSTR,
1027   _In_ LPCSTR,
1028   _In_ DWORD,
1029   _In_ LPCSTR,
1030   _In_ DWORD);
1031 
1032 BOOL
1033 WINAPI
1034 PathRelativePathToW(
1035   _Out_writes_(MAX_PATH) LPWSTR,
1036   _In_ LPCWSTR,
1037   _In_ DWORD,
1038   _In_ LPCWSTR,
1039   _In_ DWORD);
1040 
1041 #define PathRelativePathTo WINELIB_NAME_AW(PathRelativePathTo)
1042 
1043 VOID WINAPI PathRemoveArgsA(_Inout_ LPSTR);
1044 VOID WINAPI PathRemoveArgsW(_Inout_ LPWSTR);
1045 #define PathRemoveArgs WINELIB_NAME_AW(PathRemoveArgs)
1046 
1047 LPSTR  WINAPI PathRemoveBackslashA(_Inout_ LPSTR);
1048 LPWSTR WINAPI PathRemoveBackslashW(_Inout_ LPWSTR);
1049 #define PathRemoveBackslash WINELIB_NAME_AW(PathRemoveBackslash)
1050 
1051 VOID WINAPI PathRemoveBlanksA(_Inout_ LPSTR);
1052 VOID WINAPI PathRemoveBlanksW(_Inout_ LPWSTR);
1053 #define PathRemoveBlanks WINELIB_NAME_AW(PathRemoveBlanks)
1054 
1055 VOID WINAPI PathRemoveExtensionA(_Inout_ LPSTR);
1056 VOID WINAPI PathRemoveExtensionW(_Inout_ LPWSTR);
1057 #define PathRemoveExtension WINELIB_NAME_AW(PathRemoveExtension)
1058 
1059 BOOL WINAPI PathRemoveFileSpecA(_Inout_ LPSTR);
1060 BOOL WINAPI PathRemoveFileSpecW(_Inout_ LPWSTR);
1061 #define PathRemoveFileSpec WINELIB_NAME_AW(PathRemoveFileSpec)
1062 
1063 BOOL
1064 WINAPI
1065 PathRenameExtensionA(
1066   _Inout_updates_(MAX_PATH) LPSTR,
1067   _In_ LPCSTR);
1068 
1069 BOOL
1070 WINAPI
1071 PathRenameExtensionW(
1072   _Inout_updates_(MAX_PATH) LPWSTR,
1073   _In_ LPCWSTR);
1074 
1075 #define PathRenameExtension WINELIB_NAME_AW(PathRenameExtension)
1076 
1077 BOOL
1078 WINAPI
1079 PathSearchAndQualifyA(
1080   _In_ LPCSTR,
1081   _Out_writes_(cchBuf) LPSTR,
1082   _In_ UINT cchBuf);
1083 
1084 BOOL
1085 WINAPI
1086 PathSearchAndQualifyW(
1087   _In_ LPCWSTR,
1088   _Out_writes_(cchBuf) LPWSTR,
1089   _In_ UINT cchBuf);
1090 
1091 #define PathSearchAndQualify WINELIB_NAME_AW(PathSearchAndQualify)
1092 
1093 VOID WINAPI PathSetDlgItemPathA(_In_ HWND, int, LPCSTR);
1094 VOID WINAPI PathSetDlgItemPathW(_In_ HWND, int, LPCWSTR);
1095 #define PathSetDlgItemPath WINELIB_NAME_AW(PathSetDlgItemPath)
1096 
1097 LPSTR  WINAPI PathSkipRootA(_In_ LPCSTR);
1098 LPWSTR WINAPI PathSkipRootW(_In_ LPCWSTR);
1099 #define PathSkipRoot WINELIB_NAME_AW(PathSkipRoot)
1100 
1101 VOID WINAPI PathStripPathA(_Inout_ LPSTR);
1102 VOID WINAPI PathStripPathW(_Inout_ LPWSTR);
1103 #define PathStripPath WINELIB_NAME_AW(PathStripPath)
1104 
1105 BOOL WINAPI PathStripToRootA(_Inout_ LPSTR);
1106 BOOL WINAPI PathStripToRootW(_Inout_ LPWSTR);
1107 #define PathStripToRoot WINELIB_NAME_AW(PathStripToRoot)
1108 
1109 VOID WINAPI PathUnquoteSpacesA(_Inout_ LPSTR);
1110 VOID WINAPI PathUnquoteSpacesW(_Inout_ LPWSTR);
1111 #define PathUnquoteSpaces WINELIB_NAME_AW(PathUnquoteSpaces)
1112 
1113 BOOL WINAPI PathMakeSystemFolderA(_In_ LPCSTR);
1114 BOOL WINAPI PathMakeSystemFolderW(_In_ LPCWSTR);
1115 #define PathMakeSystemFolder WINELIB_NAME_AW(PathMakeSystemFolder)
1116 
1117 BOOL WINAPI PathUnmakeSystemFolderA(_In_ LPCSTR);
1118 BOOL WINAPI PathUnmakeSystemFolderW(_In_ LPCWSTR);
1119 #define PathUnmakeSystemFolder WINELIB_NAME_AW(PathUnmakeSystemFolder)
1120 
1121 BOOL WINAPI PathIsSystemFolderA(_In_opt_ LPCSTR, _In_ DWORD);
1122 BOOL WINAPI PathIsSystemFolderW(_In_opt_ LPCWSTR, _In_ DWORD);
1123 #define PathIsSystemFolder WINELIB_NAME_AW(PathIsSystemFolder)
1124 
1125 BOOL WINAPI PathIsNetworkPathA(_In_ LPCSTR);
1126 BOOL WINAPI PathIsNetworkPathW(_In_ LPCWSTR);
1127 #define PathIsNetworkPath WINELIB_NAME_AW(PathIsNetworkPath)
1128 
1129 BOOL WINAPI PathIsLFNFileSpecA(_In_ LPCSTR);
1130 BOOL WINAPI PathIsLFNFileSpecW(_In_ LPCWSTR);
1131 #define PathIsLFNFileSpec WINELIB_NAME_AW(PathIsLFNFileSpec)
1132 
1133 LPCSTR
1134 WINAPI
1135 PathFindSuffixArrayA(
1136   _In_ LPCSTR,
1137   _In_reads_(iArraySize) LPCSTR *,
1138   int iArraySize);
1139 
1140 LPCWSTR
1141 WINAPI
1142 PathFindSuffixArrayW(
1143   _In_ LPCWSTR,
1144   _In_reads_(iArraySize) LPCWSTR *,
1145   int iArraySize);
1146 
1147 #define PathFindSuffixArray WINELIB_NAME_AW(PathFindSuffixArray)
1148 
1149 VOID WINAPI PathUndecorateA(_Inout_ LPSTR);
1150 VOID WINAPI PathUndecorateW(_Inout_ LPWSTR);
1151 #define PathUndecorate WINELIB_NAME_AW(PathUndecorate)
1152 
1153 BOOL
1154 WINAPI
1155 PathUnExpandEnvStringsA(
1156   _In_ LPCSTR,
1157   _Out_writes_(cchBuf) LPSTR,
1158   _In_ UINT cchBuf);
1159 
1160 BOOL
1161 WINAPI
1162 PathUnExpandEnvStringsW(
1163   _In_ LPCWSTR,
1164   _Out_writes_(cchBuf) LPWSTR,
1165   _In_ UINT cchBuf);
1166 
1167 #define PathUnExpandEnvStrings WINELIB_NAME_AW(PathUnExpandEnvStrings)
1168 
1169 /* Url functions */
1170 typedef enum {
1171     URL_SCHEME_INVALID     = -1,
1172     URL_SCHEME_UNKNOWN     =  0,
1173     URL_SCHEME_FTP,
1174     URL_SCHEME_HTTP,
1175     URL_SCHEME_GOPHER,
1176     URL_SCHEME_MAILTO,
1177     URL_SCHEME_NEWS,
1178     URL_SCHEME_NNTP,
1179     URL_SCHEME_TELNET,
1180     URL_SCHEME_WAIS,
1181     URL_SCHEME_FILE,
1182     URL_SCHEME_MK,
1183     URL_SCHEME_HTTPS,
1184     URL_SCHEME_SHELL,
1185     URL_SCHEME_SNEWS,
1186     URL_SCHEME_LOCAL,
1187     URL_SCHEME_JAVASCRIPT,
1188     URL_SCHEME_VBSCRIPT,
1189     URL_SCHEME_ABOUT,
1190     URL_SCHEME_RES,
1191     URL_SCHEME_MSSHELLROOTED,
1192     URL_SCHEME_MSSHELLIDLIST,
1193     URL_SCHEME_MSHELP,
1194     URL_SCHEME_MSSHELLDEVICE,
1195     URL_SCHEME_WILDCARD,
1196     URL_SCHEME_SEARCH_MS,
1197     URL_SCHEME_SEARCH,
1198     URL_SCHEME_KNOWNFOLDER,
1199     URL_SCHEME_MAXVALUE
1200 } URL_SCHEME;
1201 
1202 /* These are used by UrlGetPart routine */
1203 typedef enum {
1204     URL_PART_NONE    = 0,
1205     URL_PART_SCHEME  = 1,
1206     URL_PART_HOSTNAME,
1207     URL_PART_USERNAME,
1208     URL_PART_PASSWORD,
1209     URL_PART_PORT,
1210     URL_PART_QUERY
1211 } URL_PART;
1212 
1213 #define URL_PARTFLAG_KEEPSCHEME  0x00000001
1214 
1215 /* These are used by the UrlIs... routines */
1216 typedef enum {
1217     URLIS_URL,
1218     URLIS_OPAQUE,
1219     URLIS_NOHISTORY,
1220     URLIS_FILEURL,
1221     URLIS_APPLIABLE,
1222     URLIS_DIRECTORY,
1223     URLIS_HASQUERY
1224 } URLIS;
1225 
1226 /* This is used by the UrlApplyScheme... routines */
1227 #define URL_APPLY_FORCEAPPLY         0x00000008
1228 #define URL_APPLY_GUESSFILE          0x00000004
1229 #define URL_APPLY_GUESSSCHEME        0x00000002
1230 #define URL_APPLY_DEFAULT            0x00000001
1231 
1232 /* The following are used by UrlEscape..., UrlUnEscape...,
1233  * UrlCanonicalize..., and UrlCombine... routines
1234  */
1235 #define URL_WININET_COMPATIBILITY    0x80000000
1236 #define URL_PLUGGABLE_PROTOCOL       0x40000000
1237 #define URL_ESCAPE_UNSAFE            0x20000000
1238 #define URL_UNESCAPE                 0x10000000
1239 
1240 #define URL_DONT_SIMPLIFY            0x08000000
1241 #define URL_NO_META                  URL_DONT_SIMPLIFY
1242 #define URL_ESCAPE_SPACES_ONLY       0x04000000
1243 #define URL_DONT_ESCAPE_EXTRA_INFO   0x02000000
1244 #define URL_DONT_UNESCAPE_EXTRA_INFO URL_DONT_ESCAPE_EXTRA_INFO
1245 #define URL_BROWSER_MODE             URL_DONT_ESCAPE_EXTRA_INFO
1246 
1247 #define URL_INTERNAL_PATH            0x00800000  /* Will escape #'s in paths */
1248 #define URL_UNESCAPE_HIGH_ANSI_ONLY  0x00400000
1249 #define URL_CONVERT_IF_DOSPATH       0x00200000
1250 #define URL_UNESCAPE_INPLACE         0x00100000
1251 
1252 #define URL_FILE_USE_PATHURL         0x00010000
1253 #define URL_ESCAPE_AS_UTF8           0x00040000
1254 
1255 #define URL_ESCAPE_SEGMENT_ONLY      0x00002000
1256 #define URL_ESCAPE_PERCENT           0x00001000
1257 
1258 HRESULT
1259 WINAPI
1260 UrlApplySchemeA(
1261   _In_ LPCSTR,
1262   _Out_writes_(*pcchOut) LPSTR,
1263   _Inout_ LPDWORD pcchOut,
1264   DWORD);
1265 
1266 HRESULT
1267 WINAPI
1268 UrlApplySchemeW(
1269   _In_ LPCWSTR,
1270   _Out_writes_(*pcchOut) LPWSTR,
1271   _Inout_ LPDWORD pcchOut,
1272   DWORD);
1273 
1274 #define UrlApplyScheme WINELIB_NAME_AW(UrlApplyScheme)
1275 
1276 HRESULT
1277 WINAPI
1278 UrlCanonicalizeA(
1279   _In_ LPCSTR,
1280   _Out_writes_to_(*pcchCanonicalized, *pcchCanonicalized) LPSTR,
1281   _Inout_ LPDWORD pcchCanonicalized,
1282   DWORD);
1283 
1284 HRESULT
1285 WINAPI
1286 UrlCanonicalizeW(
1287   _In_ LPCWSTR,
1288   _Out_writes_to_(*pcchCanonicalized, *pcchCanonicalized) LPWSTR,
1289   _Inout_ LPDWORD pcchCanonicalized,
1290   DWORD);
1291 
1292 #define UrlCanonicalize WINELIB_NAME_AW(UrlCanonicalize)
1293 
1294 HRESULT
1295 WINAPI
1296 UrlCombineA(
1297   _In_ LPCSTR,
1298   _In_ LPCSTR,
1299   _Out_writes_to_opt_(*pcchCombined, *pcchCombined) LPSTR,
1300   _Inout_ LPDWORD pcchCombined,
1301   DWORD);
1302 
1303 HRESULT
1304 WINAPI
1305 UrlCombineW(
1306   _In_ LPCWSTR,
1307   _In_ LPCWSTR,
1308   _Out_writes_to_opt_(*pcchCombined, *pcchCombined) LPWSTR,
1309   _Inout_ LPDWORD pcchCombined,
1310   DWORD);
1311 
1312 #define UrlCombine WINELIB_NAME_AW(UrlCombine)
1313 
1314 INT WINAPI UrlCompareA(_In_ LPCSTR, _In_ LPCSTR, BOOL);
1315 INT WINAPI UrlCompareW(_In_ LPCWSTR, _In_ LPCWSTR, BOOL);
1316 #define UrlCompare WINELIB_NAME_AW(UrlCompare)
1317 
1318 HRESULT
1319 WINAPI
1320 UrlEscapeA(
1321   _In_ LPCSTR,
1322   _Out_writes_to_(*pcchEscaped, *pcchEscaped) LPSTR,
1323   _Inout_ LPDWORD pcchEscaped,
1324   DWORD);
1325 
1326 HRESULT
1327 WINAPI
1328 UrlEscapeW(
1329   _In_ LPCWSTR,
1330   _Out_writes_to_(*pcchEscaped, *pcchEscaped) LPWSTR,
1331   _Inout_ LPDWORD pcchEscaped,
1332   DWORD);
1333 
1334 #define UrlEscape WINELIB_NAME_AW(UrlEscape)
1335 
1336 #define UrlEscapeSpacesA(x,y,z) UrlCanonicalizeA(x, y, z, \
1337                          URL_DONT_ESCAPE_EXTRA_INFO|URL_ESCAPE_SPACES_ONLY)
1338 #define UrlEscapeSpacesW(x,y,z) UrlCanonicalizeW(x, y, z, \
1339                          URL_DONT_ESCAPE_EXTRA_INFO|URL_ESCAPE_SPACES_ONLY)
1340 #define UrlEscapeSpaces WINELIB_NAME_AW(UrlEscapeSpaces)
1341 
1342 LPCSTR  WINAPI UrlGetLocationA(_In_ LPCSTR);
1343 LPCWSTR WINAPI UrlGetLocationW(_In_ LPCWSTR);
1344 #define UrlGetLocation WINELIB_NAME_AW(UrlGetLocation)
1345 
1346 HRESULT
1347 WINAPI
1348 UrlGetPartA(
1349   _In_ LPCSTR,
1350   _Out_writes_(*pcchOut) LPSTR,
1351   _Inout_ LPDWORD pcchOut,
1352   DWORD,
1353   DWORD);
1354 
1355 HRESULT
1356 WINAPI
1357 UrlGetPartW(
1358   _In_ LPCWSTR,
1359   _Out_writes_(*pcchOut) LPWSTR,
1360   _Inout_ LPDWORD pcchOut,
1361   DWORD,
1362   DWORD);
1363 
1364 #define UrlGetPart WINELIB_NAME_AW(UrlGetPart)
1365 
1366 HRESULT
1367 WINAPI
1368 HashData(
1369   _In_reads_bytes_(cbData) const unsigned char *,
1370   DWORD cbData,
1371   _Out_writes_bytes_(cbHash) unsigned char *lpDest,
1372   DWORD cbHash);
1373 
1374 HRESULT
1375 WINAPI
1376 UrlHashA(
1377   _In_ LPCSTR,
1378   _Out_writes_bytes_(cbHash) unsigned char *,
1379   DWORD cbHash);
1380 
1381 HRESULT
1382 WINAPI
1383 UrlHashW(
1384   _In_ LPCWSTR,
1385   _Out_writes_bytes_(cbHash) unsigned char *,
1386   DWORD cbHash);
1387 
1388 #define UrlHash WINELIB_NAME_AW(UrlHash)
1389 
1390 BOOL    WINAPI UrlIsA(_In_ LPCSTR, URLIS);
1391 BOOL    WINAPI UrlIsW(_In_ LPCWSTR, URLIS);
1392 #define UrlIs WINELIB_NAME_AW(UrlIs)
1393 
1394 BOOL    WINAPI UrlIsNoHistoryA(_In_ LPCSTR);
1395 BOOL    WINAPI UrlIsNoHistoryW(_In_ LPCWSTR);
1396 #define UrlIsNoHistory WINELIB_NAME_AW(UrlIsNoHistory)
1397 
1398 BOOL    WINAPI UrlIsOpaqueA(_In_ LPCSTR);
1399 BOOL    WINAPI UrlIsOpaqueW(_In_ LPCWSTR);
1400 #define UrlIsOpaque WINELIB_NAME_AW(UrlIsOpaque)
1401 
1402 #define UrlIsFileUrlA(x) UrlIsA(x, URLIS_FILEURL)
1403 #define UrlIsFileUrlW(x) UrlIsW(x, URLIS_FILEURL)
1404 #define UrlIsFileUrl WINELIB_NAME_AW(UrlIsFileUrl)
1405 
1406 HRESULT
1407 WINAPI
1408 UrlUnescapeA(
1409   _Inout_ LPSTR,
1410   _Out_writes_to_opt_(*pcchUnescaped, *pcchUnescaped) LPSTR,
1411   _Inout_opt_ LPDWORD pcchUnescaped,
1412   DWORD);
1413 
1414 HRESULT
1415 WINAPI
1416 UrlUnescapeW(
1417   _Inout_ LPWSTR,
1418   _Out_writes_to_opt_(*pcchUnescaped, *pcchUnescaped) LPWSTR,
1419   _Inout_opt_ LPDWORD pcchUnescaped,
1420   DWORD);
1421 
1422 #define UrlUnescape WINELIB_NAME_AW(UrlUnescape)
1423 
1424 #define UrlUnescapeInPlaceA(x,y) UrlUnescapeA(x, NULL, NULL, \
1425                                               y | URL_UNESCAPE_INPLACE)
1426 #define UrlUnescapeInPlaceW(x,y) UrlUnescapeW(x, NULL, NULL, \
1427                                               y | URL_UNESCAPE_INPLACE)
1428 #define UrlUnescapeInPlace WINELIB_NAME_AW(UrlUnescapeInPlace)
1429 
1430 HRESULT
1431 WINAPI
1432 UrlCreateFromPathA(
1433   _In_ LPCSTR,
1434   _Out_writes_to_(*pcchUrl, *pcchUrl) LPSTR,
1435   _Inout_ LPDWORD pcchUrl,
1436   DWORD);
1437 
1438 HRESULT
1439 WINAPI
1440 UrlCreateFromPathW(
1441   _In_ LPCWSTR,
1442   _Out_writes_to_(*pcchUrl, *pcchUrl) LPWSTR,
1443   _Inout_ LPDWORD pcchUrl,
1444   DWORD);
1445 
1446 #define UrlCreateFromPath WINELIB_NAME_AW(UrlCreateFromPath)
1447 
1448 typedef struct tagPARSEDURLA {
1449     DWORD cbSize;
1450     LPCSTR pszProtocol;
1451     UINT cchProtocol;
1452     LPCSTR pszSuffix;
1453     UINT cchSuffix;
1454     UINT nScheme;
1455 } PARSEDURLA, *PPARSEDURLA;
1456 
1457 typedef struct tagPARSEDURLW {
1458     DWORD cbSize;
1459     LPCWSTR pszProtocol;
1460     UINT cchProtocol;
1461     LPCWSTR pszSuffix;
1462     UINT cchSuffix;
1463     UINT nScheme;
1464 } PARSEDURLW, *PPARSEDURLW;
1465 
1466 HRESULT WINAPI ParseURLA(_In_ LPCSTR pszUrl, _Inout_ PARSEDURLA *ppu);
1467 HRESULT WINAPI ParseURLW(_In_ LPCWSTR pszUrl, _Inout_ PARSEDURLW *ppu);
1468 #define ParseURL WINELIB_NAME_AW(ParseUrl)
1469 
1470 #endif /* NO_SHLWAPI_PATH */
1471 
1472 
1473 /* String functions */
1474 #ifndef NO_SHLWAPI_STRFCNS
1475 
1476 /* StrToIntEx flags */
1477 #define STIF_DEFAULT     0x0L
1478 #define STIF_SUPPORT_HEX 0x1L
1479 
1480 BOOL WINAPI ChrCmpIA (WORD,WORD);
1481 BOOL WINAPI ChrCmpIW (WCHAR,WCHAR);
1482 #define ChrCmpI WINELIB_NAME_AW(ChrCmpI)
1483 
1484 INT WINAPI StrCSpnA(_In_ LPCSTR, _In_ LPCSTR);
1485 INT WINAPI StrCSpnW(_In_ LPCWSTR, _In_ LPCWSTR);
1486 #define StrCSpn WINELIB_NAME_AW(StrCSpn)
1487 
1488 INT WINAPI StrCSpnIA(_In_ LPCSTR, _In_ LPCSTR);
1489 INT WINAPI StrCSpnIW(_In_ LPCWSTR, _In_ LPCWSTR);
1490 #define StrCSpnI WINELIB_NAME_AW(StrCSpnI)
1491 
1492 #define StrCatA lstrcatA
1493 LPWSTR WINAPI StrCatW(_Inout_ LPWSTR, _In_ LPCWSTR);
1494 #define StrCat WINELIB_NAME_AW(StrCat)
1495 
1496 LPSTR
1497 WINAPI
1498 StrCatBuffA(
1499   _Inout_updates_(cchDestBuffSize) LPSTR,
1500   _In_ LPCSTR,
1501   INT cchDestBuffSize);
1502 
1503 LPWSTR
1504 WINAPI
1505 StrCatBuffW(
1506   _Inout_updates_(cchDestBuffSize) LPWSTR,
1507   _In_ LPCWSTR,
1508   INT cchDestBuffSize);
1509 
1510 #define StrCatBuff WINELIB_NAME_AW(StrCatBuff)
1511 
1512 DWORD
1513 WINAPI
1514 StrCatChainW(
1515   _Out_writes_(cchDst) LPWSTR,
1516   DWORD cchDst,
1517   DWORD,
1518   _In_ LPCWSTR);
1519 
1520 LPSTR WINAPI StrChrA(_In_ LPCSTR, WORD);
1521 LPWSTR WINAPI StrChrW(_In_ LPCWSTR, WCHAR);
1522 #define StrChr WINELIB_NAME_AW(StrChr)
1523 
1524 LPSTR WINAPI StrChrIA(_In_ LPCSTR, WORD);
1525 LPWSTR WINAPI StrChrIW(_In_ LPCWSTR, WCHAR);
1526 #define StrChrI WINELIB_NAME_AW(StrChrI)
1527 
1528 #define StrCmpA lstrcmpA
1529 int WINAPI StrCmpW(_In_ LPCWSTR, _In_ LPCWSTR);
1530 #define StrCmp WINELIB_NAME_AW(StrCmp)
1531 
1532 #define StrCmpIA lstrcmpiA
1533 int WINAPI StrCmpIW(_In_ LPCWSTR, _In_ LPCWSTR);
1534 #define StrCmpI WINELIB_NAME_AW(StrCmpI)
1535 
1536 #define StrCpyA lstrcpyA
1537 LPWSTR WINAPI StrCpyW(_Out_ LPWSTR, _In_ LPCWSTR);
1538 #define StrCpy WINELIB_NAME_AW(StrCpy)
1539 
1540 #define StrCpyNA lstrcpynA
1541 LPWSTR WINAPI StrCpyNW(_Out_writes_(cchMax) LPWSTR, _In_ LPCWSTR, int cchMax);
1542 #define StrCpyN WINELIB_NAME_AW(StrCpyN)
1543 #define StrNCpy WINELIB_NAME_AW(StrCpyN)
1544 
1545 INT WINAPI StrCmpLogicalW(_In_ LPCWSTR, _In_ LPCWSTR);
1546 
1547 INT WINAPI StrCmpNA(_In_ LPCSTR, _In_ LPCSTR, INT);
1548 INT WINAPI StrCmpNW(_In_ LPCWSTR, _In_ LPCWSTR, INT);
1549 #define StrCmpN WINELIB_NAME_AW(StrCmpN)
1550 #define StrNCmp WINELIB_NAME_AW(StrCmpN)
1551 
1552 INT WINAPI StrCmpNIA(_In_ LPCSTR, _In_ LPCSTR, INT);
1553 INT WINAPI StrCmpNIW(_In_ LPCWSTR, _In_ LPCWSTR, INT);
1554 #define StrCmpNI WINELIB_NAME_AW(StrCmpNI)
1555 #define StrNCmpI WINELIB_NAME_AW(StrCmpNI)
1556 
1557 LPSTR WINAPI StrDupA(_In_ LPCSTR);
1558 LPWSTR WINAPI StrDupW(_In_ LPCWSTR);
1559 #define StrDup WINELIB_NAME_AW(StrDup)
1560 
1561 HRESULT WINAPI SHStrDupA(_In_ LPCSTR, _Outptr_ WCHAR**);
1562 HRESULT WINAPI SHStrDupW(_In_ LPCWSTR, _Outptr_ WCHAR**);
1563 #define SHStrDup WINELIB_NAME_AW(SHStrDup)
1564 
1565 LPSTR
1566 WINAPI
1567 StrFormatByteSizeA(
1568   DWORD,
1569   _Out_writes_(cchBuf) LPSTR,
1570   UINT cchBuf);
1571 
1572 /* A/W Pairing is broken for this function */
1573 
1574 LPSTR
1575 WINAPI
1576 StrFormatByteSize64A(
1577   LONGLONG,
1578   _Out_writes_(cchBuf) LPSTR,
1579   UINT cchBuf);
1580 
1581 LPWSTR
1582 WINAPI
1583 StrFormatByteSizeW(
1584   LONGLONG,
1585   _Out_writes_(cchBuf) LPWSTR,
1586   UINT cchBuf);
1587 
1588 #ifndef WINE_NO_UNICODE_MACROS
1589 #ifdef UNICODE
1590 #define StrFormatByteSize StrFormatByteSizeW
1591 #else
1592 #define StrFormatByteSize StrFormatByteSize64A
1593 #endif
1594 #endif
1595 
1596 LPSTR
1597 WINAPI
1598 StrFormatKBSizeA(
1599   LONGLONG,
1600   _Out_writes_(cchBuf) LPSTR,
1601   UINT cchBuf);
1602 
1603 LPWSTR
1604 WINAPI
1605 StrFormatKBSizeW(
1606   LONGLONG,
1607   _Out_writes_(cchBuf) LPWSTR,
1608   UINT cchBuf);
1609 
1610 #define StrFormatKBSize WINELIB_NAME_AW(StrFormatKBSize)
1611 
1612 int
1613 WINAPI
1614 StrFromTimeIntervalA(
1615   _Out_writes_(cchMax) LPSTR,
1616   UINT cchMax,
1617   DWORD,
1618   int);
1619 
1620 int
1621 WINAPI
1622 StrFromTimeIntervalW(
1623   _Out_writes_(cchMax) LPWSTR,
1624   UINT cchMax,
1625   DWORD,
1626   int);
1627 
1628 #define StrFromTimeInterval WINELIB_NAME_AW(StrFromTimeInterval)
1629 
1630 BOOL WINAPI StrIsIntlEqualA(BOOL, _In_ LPCSTR, _In_ LPCSTR, int);
1631 BOOL WINAPI StrIsIntlEqualW(BOOL, _In_ LPCWSTR, _In_ LPCWSTR, int);
1632 #define StrIsIntlEqual WINELIB_NAME_AW(StrIsIntlEqual)
1633 
1634 #define StrIntlEqNA(a,b,c) StrIsIntlEqualA(TRUE,a,b,c)
1635 #define StrIntlEqNW(a,b,c) StrIsIntlEqualW(TRUE,a,b,c)
1636 
1637 #define StrIntlEqNIA(a,b,c) StrIsIntlEqualA(FALSE,a,b,c)
1638 #define StrIntlEqNIW(a,b,c) StrIsIntlEqualW(FALSE,a,b,c)
1639 
1640 LPSTR  WINAPI StrNCatA(_Inout_updates_(cchMax) LPSTR, LPCSTR, int cchMax);
1641 LPWSTR WINAPI StrNCatW(_Inout_updates_(cchMax) LPWSTR, LPCWSTR, int cchMax);
1642 #define StrNCat WINELIB_NAME_AW(StrNCat)
1643 #define StrCatN WINELIB_NAME_AW(StrNCat)
1644 
1645 LPSTR  WINAPI StrPBrkA(_In_ LPCSTR, _In_ LPCSTR);
1646 LPWSTR WINAPI StrPBrkW(_In_ LPCWSTR, _In_ LPCWSTR);
1647 #define StrPBrk WINELIB_NAME_AW(StrPBrk)
1648 
1649 LPSTR  WINAPI StrRChrA(_In_ LPCSTR, _In_opt_ LPCSTR, WORD);
1650 LPWSTR WINAPI StrRChrW(_In_ LPCWSTR, _In_opt_ LPCWSTR, WCHAR);
1651 #define StrRChr WINELIB_NAME_AW(StrRChr)
1652 
1653 LPSTR  WINAPI StrRChrIA(_In_ LPCSTR, _In_opt_ LPCSTR, WORD);
1654 LPWSTR WINAPI StrRChrIW(_In_ LPCWSTR, _In_opt_ LPCWSTR, WCHAR);
1655 #define StrRChrI WINELIB_NAME_AW(StrRChrI)
1656 
1657 LPSTR  WINAPI StrRStrIA(_In_ LPCSTR, _In_opt_ LPCSTR, _In_ LPCSTR);
1658 LPWSTR WINAPI StrRStrIW(_In_ LPCWSTR, _In_opt_ LPCWSTR, _In_ LPCWSTR);
1659 #define StrRStrI WINELIB_NAME_AW(StrRStrI)
1660 
1661 int WINAPI StrSpnA(_In_ LPCSTR psz, _In_ LPCSTR pszSet);
1662 int WINAPI StrSpnW(_In_ LPCWSTR psz, _In_ LPCWSTR pszSet);
1663 #define StrSpn WINELIB_NAME_AW(StrSpn)
1664 
1665 LPSTR  WINAPI StrStrA(_In_ LPCSTR pszFirst, _In_ LPCSTR pszSrch);
1666 LPWSTR WINAPI StrStrW(_In_ LPCWSTR pszFirst, _In_ LPCWSTR pszSrch);
1667 #define StrStr WINELIB_NAME_AW(StrStr)
1668 
1669 LPSTR  WINAPI StrStrIA(_In_ LPCSTR pszFirst, _In_ LPCSTR pszSrch);
1670 LPWSTR WINAPI StrStrIW(_In_ LPCWSTR pszFirst, _In_ LPCWSTR pszSrch);
1671 #define StrStrI WINELIB_NAME_AW(StrStrI)
1672 
1673 LPWSTR WINAPI StrStrNW(_In_ LPCWSTR, _In_ LPCWSTR, UINT);
1674 LPWSTR WINAPI StrStrNIW(_In_ LPCWSTR, _In_ LPCWSTR, UINT);
1675 
1676 int WINAPI StrToIntA(_In_ LPCSTR);
1677 int WINAPI StrToIntW(_In_ LPCWSTR);
1678 #define StrToInt WINELIB_NAME_AW(StrToInt)
1679 #define StrToLong WINELIB_NAME_AW(StrToInt)
1680 
1681 BOOL WINAPI StrToIntExA(_In_ LPCSTR, DWORD, _Out_ int*);
1682 BOOL WINAPI StrToIntExW(_In_ LPCWSTR, DWORD, _Out_ int*);
1683 #define StrToIntEx WINELIB_NAME_AW(StrToIntEx)
1684 
1685 BOOL WINAPI StrToInt64ExA(_In_ LPCSTR, DWORD, _Out_ LONGLONG*);
1686 BOOL WINAPI StrToInt64ExW(_In_ LPCWSTR, DWORD, _Out_ LONGLONG*);
1687 #define StrToIntEx64 WINELIB_NAME_AW(StrToIntEx64)
1688 
1689 BOOL WINAPI StrTrimA(_Inout_ LPSTR, _In_ LPCSTR);
1690 BOOL WINAPI StrTrimW(_Inout_ LPWSTR, _In_ LPCWSTR);
1691 #define StrTrim WINELIB_NAME_AW(StrTrim)
1692 
1693 INT
1694 WINAPI
1695 wvnsprintfA(
1696   _Out_writes_(cchDest) LPSTR,
1697   _In_ INT cchDest,
1698   _In_ _Printf_format_string_ LPCSTR,
1699   _In_ __ms_va_list);
1700 
1701 INT
1702 WINAPI
1703 wvnsprintfW(
1704   _Out_writes_(cchDest) LPWSTR,
1705   _In_ INT cchDest,
1706   _In_ _Printf_format_string_ LPCWSTR,
1707   _In_ __ms_va_list);
1708 
1709 #define wvnsprintf WINELIB_NAME_AW(wvnsprintf)
1710 
1711 INT
1712 WINAPIV
1713 wnsprintfA(
1714   _Out_writes_(cchDest) LPSTR,
1715   _In_ INT cchDest,
1716   _In_ _Printf_format_string_ LPCSTR,
1717   ...);
1718 
1719 INT
1720 WINAPIV
1721 wnsprintfW(
1722   _Out_writes_(cchDest) LPWSTR,
1723   _In_ INT cchDest,
1724   _In_ _Printf_format_string_ LPCWSTR,
1725   ...);
1726 
1727 #define wnsprintf WINELIB_NAME_AW(wnsprintf)
1728 
1729 HRESULT
1730 WINAPI
1731 SHLoadIndirectString(
1732   _In_ LPCWSTR,
1733   _Out_writes_(cchOutBuf) LPWSTR,
1734   _In_ UINT cchOutBuf,
1735   _Reserved_ PVOID*);
1736 
1737 BOOL
1738 WINAPI
1739 IntlStrEqWorkerA(
1740   BOOL,
1741   _In_reads_(nChar) LPCSTR,
1742   _In_reads_(nChar) LPCSTR,
1743   int nChar);
1744 
1745 BOOL
1746 WINAPI
1747 IntlStrEqWorkerW(
1748   BOOL,
1749   _In_reads_(nChar) LPCWSTR,
1750   _In_reads_(nChar) LPCWSTR,
1751   int nChar);
1752 
1753 #define IntlStrEqWorker WINELIB_NAME_AW(IntlStrEqWorker)
1754 
1755 #define IntlStrEqNA(s1,s2,n) IntlStrEqWorkerA(TRUE,s1,s2,n)
1756 #define IntlStrEqNW(s1,s2,n) IntlStrEqWorkerW(TRUE,s1,s2,n)
1757 #define IntlStrEqN WINELIB_NAME_AW(IntlStrEqN)
1758 
1759 #define IntlStrEqNIA(s1,s2,n) IntlStrEqWorkerA(FALSE,s1,s2,n)
1760 #define IntlStrEqNIW(s1,s2,n) IntlStrEqWorkerW(FALSE,s1,s2,n)
1761 #define IntlStrEqNI WINELIB_NAME_AW(IntlStrEqNI)
1762 
1763 HRESULT
1764 WINAPI
1765 StrRetToStrA(
1766   _Inout_ STRRET*,
1767   _In_opt_ PCUITEMID_CHILD,
1768   _Outptr_ LPSTR*);
1769 
1770 HRESULT
1771 WINAPI
1772 StrRetToStrW(
1773   _Inout_ STRRET*,
1774   _In_opt_ PCUITEMID_CHILD,
1775   _Outptr_ LPWSTR*);
1776 
1777 #define StrRetToStr WINELIB_NAME_AW(StrRetToStr)
1778 
1779 HRESULT
1780 WINAPI
1781 StrRetToBufA(
1782   _Inout_ STRRET*,
1783   _In_opt_ PCUITEMID_CHILD,
1784   _Out_writes_(cchBuf) LPSTR,
1785   UINT cchBuf);
1786 
1787 HRESULT
1788 WINAPI
1789 StrRetToBufW(
1790   _Inout_ STRRET*,
1791   _In_opt_ PCUITEMID_CHILD,
1792   _Out_writes_(cchBuf) LPWSTR,
1793   UINT cchBuf);
1794 
1795 #define StrRetToBuf WINELIB_NAME_AW(StrRetToBuf)
1796 
1797 HRESULT
1798 WINAPI
1799 StrRetToBSTR(
1800   _Inout_ STRRET*,
1801   _In_opt_ PCUITEMID_CHILD,
1802   _Outptr_ BSTR*);
1803 
1804 BOOL WINAPI IsCharSpaceA(CHAR);
1805 BOOL WINAPI IsCharSpaceW(WCHAR);
1806 #define IsCharSpace WINELIB_NAME_AW(IsCharSpace)
1807 
1808 #endif /* NO_SHLWAPI_STRFCNS */
1809 
1810 
1811 /* GDI functions */
1812 #ifndef NO_SHLWAPI_GDI
1813 
1814 HPALETTE WINAPI SHCreateShellPalette(_In_opt_ HDC);
1815 
1816 COLORREF WINAPI ColorHLSToRGB(WORD,WORD,WORD);
1817 
1818 COLORREF WINAPI ColorAdjustLuma(COLORREF,int,BOOL);
1819 
1820 VOID WINAPI ColorRGBToHLS(COLORREF, _Out_ LPWORD, _Out_ LPWORD, _Out_ LPWORD);
1821 
1822 #endif /* NO_SHLWAPI_GDI */
1823 
1824 /* Security functions */
1825 BOOL WINAPI IsInternetESCEnabled(void);
1826 
1827 /* Stream functions */
1828 #ifndef NO_SHLWAPI_STREAM
1829 
1830 struct IStream *
1831 WINAPI
1832 SHOpenRegStreamA(
1833   _In_ HKEY,
1834   _In_opt_ LPCSTR,
1835   _In_opt_ LPCSTR,
1836   _In_ DWORD);
1837 
1838 struct IStream *
1839 WINAPI
1840 SHOpenRegStreamW(
1841   _In_ HKEY,
1842   _In_opt_ LPCWSTR,
1843   _In_opt_ LPCWSTR,
1844   _In_ DWORD);
1845 
1846 #define SHOpenRegStream WINELIB_NAME_AW(SHOpenRegStream2) /* Uses version 2 */
1847 
1848 struct IStream *
1849 WINAPI
1850 SHOpenRegStream2A(
1851   _In_ HKEY,
1852   _In_opt_ LPCSTR,
1853   _In_opt_ LPCSTR,
1854   _In_ DWORD);
1855 
1856 struct IStream *
1857 WINAPI
1858 SHOpenRegStream2W(
1859   _In_ HKEY,
1860   _In_opt_ LPCWSTR,
1861   _In_opt_ LPCWSTR,
1862   _In_ DWORD);
1863 
1864 #define SHOpenRegStream2 WINELIB_NAME_AW(SHOpenRegStream2)
1865 
1866 HRESULT
1867 WINAPI
1868 SHCreateStreamOnFileA(
1869   _In_ LPCSTR,
1870   _In_ DWORD,
1871   _Outptr_ struct IStream**);
1872 
1873 HRESULT
1874 WINAPI
1875 SHCreateStreamOnFileW(
1876   _In_ LPCWSTR,
1877   _In_ DWORD,
1878   _Outptr_ struct IStream**);
1879 
1880 #define SHCreateStreamOnFile WINELIB_NAME_AW(SHCreateStreamOnFile)
1881 
1882 struct IStream*
1883 WINAPI
1884 SHCreateMemStream(
1885   _In_reads_bytes_opt_(cbInit) const BYTE *pInit,
1886   _In_ UINT cbInit);
1887 
1888 HRESULT
1889 WINAPI
1890 SHCreateStreamOnFileEx(
1891   _In_ LPCWSTR,
1892   _In_ DWORD,
1893   _In_ DWORD,
1894   _In_ BOOL,
1895   _In_opt_ struct IStream*,
1896   _Outptr_ struct IStream**);
1897 
1898 HRESULT WINAPI SHCreateStreamWrapper(LPBYTE,DWORD,DWORD,struct IStream**);
1899 
1900 #endif /* NO_SHLWAPI_STREAM */
1901 
1902 #ifndef NO_SHLWAPI_SHARED
1903 
1904 // These functions are only included in this file starting with the Windows 7 platform SDK
1905 
1906 HANDLE
1907 WINAPI
1908 SHAllocShared(
1909     _In_opt_  const void *pvData,
1910     _In_      DWORD dwSize,
1911     _In_      DWORD dwDestinationProcessId
1912     );
1913 
1914 PVOID
1915 WINAPI
1916 SHLockShared(
1917     _In_  HANDLE hData,
1918     _In_  DWORD dwProcessId
1919     );
1920 
1921 BOOL
1922 WINAPI
1923 SHUnlockShared(
1924     _In_  void *pvData
1925     );
1926 
1927 BOOL
1928 WINAPI
1929 SHFreeShared(
1930     _In_  HANDLE hData,
1931     _In_  DWORD dwProcessId
1932     );
1933 
1934 #endif /* NO_SHLWAPI_SHARED */
1935 
1936 INT WINAPI GetMenuPosFromID(_In_ HMENU hMenu, _In_ UINT uID);
1937 
1938 /* SHAutoComplete flags */
1939 #define SHACF_DEFAULT               0x00000000
1940 #define SHACF_FILESYSTEM            0x00000001
1941 #define SHACF_URLHISTORY            0x00000002
1942 #define SHACF_URLMRU                0x00000004
1943 #define SHACF_URLALL                (SHACF_URLHISTORY|SHACF_URLMRU)
1944 #define SHACF_USETAB                0x00000008
1945 #define SHACF_FILESYS_ONLY          0x00000010
1946 #define SHACF_FILESYS_DIRS          0x00000020
1947 #define SHACF_AUTOSUGGEST_FORCE_ON  0x10000000
1948 #define SHACF_AUTOSUGGEST_FORCE_OFF 0x20000000
1949 #define SHACF_AUTOAPPEND_FORCE_ON   0x40000000
1950 #define SHACF_AUTOAPPEND_FORCE_OFF  0x80000000
1951 
1952 HRESULT WINAPI SHAutoComplete(_In_ HWND, DWORD);
1953 
1954 /* Threads */
1955 HRESULT WINAPI SHCreateThreadRef(_Inout_ LONG*, _Outptr_ IUnknown**);
1956 HRESULT WINAPI SHGetThreadRef(_Outptr_ IUnknown**);
1957 HRESULT WINAPI SHSetThreadRef(_In_opt_ IUnknown*);
1958 HRESULT WINAPI SHReleaseThreadRef(void);
1959 
1960 /* SHCreateThread flags */
1961 #define CTF_INSIST          0x01 /* Always call */
1962 #define CTF_THREAD_REF      0x02 /* Hold thread ref */
1963 #define CTF_PROCESS_REF     0x04 /* Hold process ref */
1964 #define CTF_COINIT          0x08 /* Startup COM first */
1965 #define CTF_FREELIBANDEXIT  0x10 /* Hold DLL ref */
1966 #define CTF_REF_COUNTED     0x20 /* Thread is ref counted */
1967 #define CTF_WAIT_ALLOWCOM   0x40 /* Allow marshalling */
1968 
1969 BOOL
1970 WINAPI
1971 SHCreateThread(
1972   _In_ LPTHREAD_START_ROUTINE pfnThreadProc,
1973   _In_opt_ void* pData,
1974   _In_ DWORD flags,
1975   _In_opt_ LPTHREAD_START_ROUTINE pfnCallback);
1976 
1977 BOOL WINAPI SHSkipJunction(_In_opt_ struct IBindCtx*, _In_ const CLSID*);
1978 
1979 /* Version Information */
1980 
1981 typedef struct _DllVersionInfo {
1982     DWORD cbSize;
1983     DWORD dwMajorVersion;
1984     DWORD dwMinorVersion;
1985     DWORD dwBuildNumber;
1986     DWORD dwPlatformID;
1987 } DLLVERSIONINFO;
1988 
1989 #define DLLVER_PLATFORM_WINDOWS 0x01 /* Win9x */
1990 #define DLLVER_PLATFORM_NT      0x02 /* WinNT */
1991 
1992 typedef HRESULT (CALLBACK *DLLGETVERSIONPROC)(DLLVERSIONINFO *);
1993 
1994 #ifdef __WINESRC__
1995 /* shouldn't be here, but is nice for type checking */
1996 HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *) DECLSPEC_HIDDEN;
1997 #endif
1998 
1999 typedef struct _DLLVERSIONINFO2 {
2000     DLLVERSIONINFO info1;
2001     DWORD          dwFlags;    /* Reserved */
2002     ULONGLONG DECLSPEC_ALIGN(8) ullVersion; /* 16 bits each for Major, Minor, Build, QFE */
2003 } DLLVERSIONINFO2;
2004 
2005 #define DLLVER_MAJOR_MASK 0xFFFF000000000000
2006 #define DLLVER_MINOR_MASK 0x0000FFFF00000000
2007 #define DLLVER_BUILD_MASK 0x00000000FFFF0000
2008 #define DLLVER_QFE_MASK   0x000000000000FFFF
2009 
2010 #define MAKEDLLVERULL(mjr, mnr, bld, qfe) (((ULONGLONG)(mjr)<< 48)| \
2011   ((ULONGLONG)(mnr)<< 32) | ((ULONGLONG)(bld)<< 16) | (ULONGLONG)(qfe))
2012 
2013 HRESULT WINAPI DllInstall(BOOL, _In_opt_ LPCWSTR) DECLSPEC_HIDDEN;
2014 
2015 
2016 #if (_WIN32_IE >= 0x0600)
2017 #define SHGVSPB_PERUSER        0x00000001
2018 #define SHGVSPB_ALLUSERS       0x00000002
2019 #define SHGVSPB_PERFOLDER      0x00000004
2020 #define SHGVSPB_ALLFOLDERS     0x00000008
2021 #define SHGVSPB_INHERIT        0x00000010
2022 #define SHGVSPB_ROAM           0x00000020
2023 #define SHGVSPB_NOAUTODEFAULTS 0x80000000
2024 
2025 #define SHGVSPB_FOLDER           (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER)
2026 #define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER | SHGVSPB_NOAUTODEFAULTS)
2027 #define SHGVSPB_USERDEFAULTS     (SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS)
2028 #define SHGVSPB_GLOBALDEAFAULTS  (SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS)
2029 
2030 HRESULT
2031 WINAPI
2032 SHGetViewStatePropertyBag(
2033   _In_opt_ PCIDLIST_ABSOLUTE pidl,
2034   _In_opt_ LPCWSTR bag_name,
2035   _In_ DWORD flags,
2036   _In_ REFIID riid,
2037   _Outptr_ void **ppv);
2038 
2039 #endif  /* (_WIN32_IE >= 0x0600) */
2040 
2041 
2042 /* IsOS definitions */
2043 
2044 #define OS_WIN32SORGREATER        0x00
2045 #define OS_NT                     0x01
2046 #define OS_WIN95ORGREATER         0x02
2047 #define OS_NT4ORGREATER           0x03
2048 #define OS_WIN2000ORGREATER_ALT   0x04
2049 #define OS_WIN98ORGREATER         0x05
2050 #define OS_WIN98_GOLD             0x06
2051 #define OS_WIN2000ORGREATER       0x07
2052 #define OS_WIN2000PRO             0x08
2053 #define OS_WIN2000SERVER          0x09
2054 #define OS_WIN2000ADVSERVER       0x0A
2055 #define OS_WIN2000DATACENTER      0x0B
2056 #define OS_WIN2000TERMINAL        0x0C
2057 #define OS_EMBEDDED               0x0D
2058 #define OS_TERMINALCLIENT         0x0E
2059 #define OS_TERMINALREMOTEADMIN    0x0F
2060 #define OS_WIN95_GOLD             0x10
2061 #define OS_MEORGREATER            0x11
2062 #define OS_XPORGREATER            0x12
2063 #define OS_HOME                   0x13
2064 #define OS_PROFESSIONAL           0x14
2065 #define OS_DATACENTER             0x15
2066 #define OS_ADVSERVER              0x16
2067 #define OS_SERVER                 0x17
2068 #define OS_TERMINALSERVER         0x18
2069 #define OS_PERSONALTERMINALSERVER 0x19
2070 #define OS_FASTUSERSWITCHING      0x1A
2071 #define OS_WELCOMELOGONUI         0x1B
2072 #define OS_DOMAINMEMBER           0x1C
2073 #define OS_ANYSERVER              0x1D
2074 #define OS_WOW6432                0x1E
2075 #define OS_WEBSERVER              0x1F
2076 #define OS_SMALLBUSINESSSERVER    0x20
2077 #define OS_TABLETPC               0x21
2078 #define OS_SERVERADMINUI          0x22
2079 #define OS_MEDIACENTER            0x23
2080 #define OS_APPLIANCE              0x24
2081 
2082 BOOL WINAPI IsOS(DWORD);
2083 
2084 /* SHSetTimerQueueTimer definitions */
2085 #define TPS_EXECUTEIO    0x00000001
2086 #define TPS_LONGEXECTIME 0x00000008
2087 
2088 /* SHFormatDateTimeA/SHFormatDateTimeW flags */
2089 #define FDTF_SHORTTIME          0x00000001
2090 #define FDTF_SHORTDATE          0x00000002
2091 #define FDTF_DEFAULT            (FDTF_SHORTDATE | FDTF_SHORTTIME)
2092 #define FDTF_LONGDATE           0x00000004
2093 #define FDTF_LONGTIME           0x00000008
2094 #define FDTF_RELATIVE           0x00000010
2095 #define FDTF_LTRDATE            0x00000100
2096 #define FDTF_RTLDATE            0x00000200
2097 #define FDTF_NOAUTOREADINGORDER 0x00000400
2098 
2099 
2100 typedef struct
2101 {
2102     const IID *piid;
2103 #if defined(__REACTOS__) || (WINVER >= _WIN32_WINNT_WIN10)
2104     DWORD dwOffset;
2105 #else
2106     int dwOffset;
2107 #endif
2108 } QITAB, *LPQITAB;
2109 
2110 HRESULT
2111 WINAPI
2112 QISearch(
2113   _Inout_ void* base,
2114   _In_ const QITAB *pqit,
2115   _In_ REFIID riid,
2116   _Outptr_ void **ppv);
2117 
2118 #define OFFSETOFCLASS(base, derived) \
2119     ((DWORD)(DWORD_PTR)(static_cast<base*>((derived*)8))-8)
2120 
2121 #define QITABENTMULTI(Cthis, Ifoo, Iimpl) { &IID_##Ifoo, OFFSETOFCLASS(Iimpl, Cthis) }
2122 #define QITABENT(Cthis, Ifoo) QITABENTMULTI(Cthis, Ifoo, Ifoo)
2123 
2124 #include <poppack.h>
2125 
2126 #ifdef __cplusplus
2127 } /* extern "C" */
2128 #endif /* defined(__cplusplus) */
2129 
2130 #endif /* __WINE_SHLWAPI_H */
2131