2 * Header includes for shdocvw.dll
4 * Copyright 2011 Jacek Caban for CodeWeavers
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.
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.
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
24 #define NONAMELESSUNION
33 #include "wine/unicode.h"
35 HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**);
37 extern LONG module_ref DECLSPEC_HIDDEN;
39 static inline void lock_module(void) {
40 InterlockedIncrement(&module_ref);
43 static inline void unlock_module(void) {
44 InterlockedDecrement(&module_ref);
47 static inline void *heap_alloc(size_t len)
49 return HeapAlloc(GetProcessHeap(), 0, len);
52 static inline void *heap_alloc_zero(size_t len)
54 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
57 static inline BOOL heap_free(void *mem)
59 return HeapFree(GetProcessHeap(), 0, mem);
62 static inline LPWSTR co_strdupW(LPCWSTR str)
64 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
70 static inline LPWSTR co_strdupAtoW(LPCSTR str)
74 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
75 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
77 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
81 static inline LPSTR co_strdupWtoA(LPCWSTR str)
85 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
86 ret = CoTaskMemAlloc(len);
88 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);