Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenhlink_private.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2007 Jacek Caban for CodeWeavers 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 00019 #include <stdarg.h> 00020 00021 #define COBJMACROS 00022 00023 #include "winerror.h" 00024 #include "windef.h" 00025 #include "winbase.h" 00026 #include "winuser.h" 00027 #include "ole2.h" 00028 #include "hlink.h" 00029 00030 #include "wine/unicode.h" 00031 00032 extern HRESULT HLink_Constructor(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; 00033 extern HRESULT HLinkBrowseContext_Constructor(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; 00034 00035 static inline void *heap_alloc(size_t len) 00036 { 00037 return HeapAlloc(GetProcessHeap(), 0, len); 00038 } 00039 00040 static inline void *heap_alloc_zero(size_t len) 00041 { 00042 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); 00043 } 00044 00045 static inline BOOL heap_free(void *mem) 00046 { 00047 return HeapFree(GetProcessHeap(), 0, mem); 00048 } 00049 00050 static inline LPWSTR hlink_strdupW(LPCWSTR str) 00051 { 00052 LPWSTR ret = NULL; 00053 00054 if(str) { 00055 DWORD size; 00056 00057 size = (strlenW(str)+1)*sizeof(WCHAR); 00058 ret = heap_alloc(size); 00059 memcpy(ret, str, size); 00060 } 00061 00062 return ret; 00063 } 00064 00065 static inline LPWSTR hlink_co_strdupW(LPCWSTR str) 00066 { 00067 LPWSTR ret = NULL; 00068 00069 if(str) { 00070 DWORD size; 00071 00072 size = (strlenW(str)+1)*sizeof(WCHAR); 00073 ret = CoTaskMemAlloc(size); 00074 memcpy(ret, str, size); 00075 } 00076 00077 return ret; 00078 } Generated on Sun May 27 2012 04:23:52 for ReactOS by
1.7.6.1
|