shell32/autocomplete: Autocompletion should be case insensitive for string comparison.
[wine] / dlls / ieframe / ieframe.h
1 /*
2  * Header includes for shdocvw.dll
3  *
4  * Copyright 2011 Jacek Caban for CodeWeavers
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 #include <stdarg.h>
22
23 #define COBJMACROS
24 #define NONAMELESSUNION
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30
31 #include "ole2.h"
32
33 #include "wine/unicode.h"
34
35 HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**);
36
37 extern LONG module_ref DECLSPEC_HIDDEN;
38
39 static inline void lock_module(void) {
40     InterlockedIncrement(&module_ref);
41 }
42
43 static inline void unlock_module(void) {
44     InterlockedDecrement(&module_ref);
45 }
46
47 static inline void *heap_alloc(size_t len)
48 {
49     return HeapAlloc(GetProcessHeap(), 0, len);
50 }
51
52 static inline void *heap_alloc_zero(size_t len)
53 {
54     return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
55 }
56
57 static inline BOOL heap_free(void *mem)
58 {
59     return HeapFree(GetProcessHeap(), 0, mem);
60 }
61
62 static inline LPWSTR co_strdupW(LPCWSTR str)
63 {
64     WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
65     if (ret)
66         lstrcpyW(ret, str);
67     return ret;
68 }
69
70 static inline LPWSTR co_strdupAtoW(LPCSTR str)
71 {
72     INT len;
73     WCHAR *ret;
74     len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
75     ret = CoTaskMemAlloc(len*sizeof(WCHAR));
76     if (ret)
77         MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
78     return ret;
79 }
80
81 static inline LPSTR co_strdupWtoA(LPCWSTR str)
82 {
83     INT len;
84     CHAR *ret;
85     len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
86     ret = CoTaskMemAlloc(len);
87     if (ret)
88         WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
89     return ret;
90 }