Changeset 6709 for trunk/src/shell32/shelllink.c
- Timestamp:
- Sep 15, 2001, 11:26:26 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/shelllink.c
r6650 r6709 1 /* $Id: shelllink.c,v 1.8 2001-09-05 13:46:57 bird Exp $ */2 1 /* 3 2 * 4 * Copyright 1997Marcus Meissner5 * Copyright 1998Juergen Schmied3 * Copyright 1997 Marcus Meissner 4 * Copyright 1998 Juergen Schmied 6 5 * 7 6 */ … … 58 57 59 58 /* flag1: lnk elements: simple link has 0x0B */ 60 #define WORKDIR0x1061 #define ARGUMENT0x2062 #define ICON0x4063 #define UNC 59 #define WORKDIR 0x10 60 #define ARGUMENT 0x20 61 #define ICON 0x40 62 #define UNC 0x80 64 63 65 64 /* fStartup */ 66 #define NORMAL0x0167 #define MAXIMIZED0x0368 #define MINIMIZED0x0769 70 typedef struct _LINK_HEADER 71 { DWORD MagicStr;/* 0x00 'L','\0','\0','\0' */72 GUID MagicGuid;/* 0x04 is CLSID_ShellLink */73 DWORD Flag1;/* 0x14 describes elements following */74 DWORD Flag2;/* 0x18 */75 FILETIME Time1;/* 0x1c */76 FILETIME Time2;/* 0x24 */77 FILETIME Time3;/* 0x2c */78 DWORD Unknown1;/* 0x34 */79 DWORD Unknown2;/* 0x38 icon number */80 DWORD fStartup;/* 0x3c startup type */81 DWORD wHotKey;/* 0x40 hotkey */82 DWORD Unknown5;/* 0x44 */83 DWORD Unknown6;/* 0x48 */84 USHORT PidlSize;/* 0x4c */85 ITEMIDLIST Pidl;/* 0x4e */65 #define NORMAL 0x01 66 #define MAXIMIZED 0x03 67 #define MINIMIZED 0x07 68 69 typedef struct _LINK_HEADER 70 { DWORD MagicStr; /* 0x00 'L','\0','\0','\0' */ 71 GUID MagicGuid; /* 0x04 is CLSID_ShellLink */ 72 DWORD Flag1; /* 0x14 describes elements following */ 73 DWORD Flag2; /* 0x18 */ 74 FILETIME Time1; /* 0x1c */ 75 FILETIME Time2; /* 0x24 */ 76 FILETIME Time3; /* 0x2c */ 77 DWORD Unknown1; /* 0x34 */ 78 DWORD Unknown2; /* 0x38 icon number */ 79 DWORD fStartup; /* 0x3c startup type */ 80 DWORD wHotKey; /* 0x40 hotkey */ 81 DWORD Unknown5; /* 0x44 */ 82 DWORD Unknown6; /* 0x48 */ 83 USHORT PidlSize; /* 0x4c */ 84 ITEMIDLIST Pidl; /* 0x4e */ 86 85 } LINK_HEADER, * PLINK_HEADER; 87 86 … … 90 89 typedef struct 91 90 { 92 93 94 95 96 97 98 99 91 BYTE bWidth; 92 BYTE bHeight; 93 BYTE bColorCount; 94 BYTE bReserved; 95 WORD wPlanes; 96 WORD wBitCount; 97 DWORD dwBytesInRes; 98 WORD nID; 100 99 } GRPICONDIRENTRY; 101 100 102 101 typedef struct 103 102 { 104 105 106 107 103 WORD idReserved; 104 WORD idType; 105 WORD idCount; 106 GRPICONDIRENTRY idEntries[1]; 108 107 } GRPICONDIR; 109 108 110 109 typedef struct 111 110 { 112 113 114 115 116 117 118 119 111 BYTE bWidth; 112 BYTE bHeight; 113 BYTE bColorCount; 114 BYTE bReserved; 115 WORD wPlanes; 116 WORD wBitCount; 117 DWORD dwBytesInRes; 118 DWORD dwImageOffset; 120 119 } ICONDIRENTRY; 121 120 122 121 typedef struct 123 122 { 124 125 126 123 WORD idReserved; 124 WORD idType; 125 WORD idCount; 127 126 } ICONDIR; 128 127 … … 131 130 132 131 133 static ICOM_VTABLE(IShellLinkA) 134 static ICOM_VTABLE(IShellLinkW) 135 static ICOM_VTABLE(IPersistFile) 136 static ICOM_VTABLE(IPersistStream) 132 static ICOM_VTABLE(IShellLinkA) slvt; 133 static ICOM_VTABLE(IShellLinkW) slvtw; 134 static ICOM_VTABLE(IPersistFile) pfvt; 135 static ICOM_VTABLE(IPersistStream) psvt; 137 136 138 137 /* IShellLink Implementation */ … … 140 139 typedef struct 141 140 { 142 143 DWORDref;144 145 ICOM_VTABLE(IShellLinkW)*lpvtblw;146 ICOM_VTABLE(IPersistFile)*lpvtblPersistFile;147 ICOM_VTABLE(IPersistStream)*lpvtblPersistStream;148 149 150 IStream*lpFileStream;151 152 153 LPSTRsPath;154 LPITEMIDLISTpPidl;155 WORDwHotKey;156 SYSTEMTIMEtime1;157 SYSTEMTIMEtime2;158 SYSTEMTIMEtime3;159 160 LPSTRsIcoPath;161 INTiIcoNdx;162 LPSTRsArgs;163 LPSTRsWorkDir;164 LPSTRsDescription;141 ICOM_VFIELD(IShellLinkA); 142 DWORD ref; 143 144 ICOM_VTABLE(IShellLinkW)* lpvtblw; 145 ICOM_VTABLE(IPersistFile)* lpvtblPersistFile; 146 ICOM_VTABLE(IPersistStream)* lpvtblPersistStream; 147 148 /* internal stream of the IPersistFile interface */ 149 IStream* lpFileStream; 150 151 /* data structures according to the informations in the lnk */ 152 LPSTR sPath; 153 LPITEMIDLIST pPidl; 154 WORD wHotKey; 155 SYSTEMTIME time1; 156 SYSTEMTIME time2; 157 SYSTEMTIME time3; 158 159 LPSTR sIcoPath; 160 INT iIcoNdx; 161 LPSTR sArgs; 162 LPSTR sWorkDir; 163 LPSTR sDescription; 165 164 } IShellLinkImpl; 166 165 … … 179 178 */ 180 179 static HRESULT WINAPI IPersistFile_fnQueryInterface( 181 182 183 184 { 185 186 187 188 189 180 IPersistFile* iface, 181 REFIID riid, 182 LPVOID *ppvObj) 183 { 184 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 185 186 TRACE("(%p)\n",This); 187 188 return IShellLinkA_QueryInterface((IShellLinkA*)This, riid, ppvObj); 190 189 } 191 190 … … 195 194 static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile* iface) 196 195 { 197 198 199 200 201 196 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 197 198 TRACE("(%p)->(count=%lu)\n",This,This->ref); 199 200 return IShellLinkA_AddRef((IShellLinkA*)This); 202 201 } 203 202 /****************************************************************************** … … 206 205 static ULONG WINAPI IPersistFile_fnRelease(IPersistFile* iface) 207 206 { 208 209 210 211 212 207 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 208 209 TRACE("(%p)->(count=%lu)\n",This,This->ref); 210 211 return IShellLinkA_Release((IShellLinkA*)This); 213 212 } 214 213 215 214 static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile* iface, CLSID *pClassID) 216 215 { 217 218 219 216 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 217 FIXME("(%p)\n",This); 218 return NOERROR; 220 219 } 221 220 static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile* iface) 222 221 { 223 224 225 222 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 223 FIXME("(%p)\n",This); 224 return NOERROR; 226 225 } 227 226 static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode) 228 227 { 229 230 231 232 LPSTRsFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName);233 HRESULThRet = E_FAIL;234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 228 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface) 229 _IPersistStream_From_ICOM_THIS(IPersistStream, This) 230 231 LPSTR sFile = HEAP_strdupWtoA ( GetProcessHeap(), 0, pszFileName); 232 HRESULT hRet = E_FAIL; 233 234 TRACE("(%p, %s)\n",This, sFile); 235 236 237 if (This->lpFileStream) 238 IStream_Release(This->lpFileStream); 239 240 if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream))) 241 { 242 if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream)) 243 { 244 return NOERROR; 245 } 246 } 247 248 return hRet; 250 249 } 251 250 252 251 253 252 #ifdef __WIN32OS2__ 254 static BOOL SaveIconResAsOS2ICO(GRPICONDIR *pIconDir, HINSTANCE hInstance, 253 static BOOL SaveIconResAsOS2ICO(GRPICONDIR *pIconDir, HINSTANCE hInstance, 255 254 const char *szXPMFileName) 256 255 { … … 395 394 #ifdef __WIN32OS2__ 396 395 if(!hResInfo) { 397 hResInfo = FindResourceA(hModule, MAKEINTRESOURCEA(nIndex), RT_ICONA); 396 hResInfo = FindResourceA(hModule, MAKEINTRESOURCEA(nIndex), RT_ICONA); 398 397 if(hResInfo) { 399 398 GRPICONDIR icondir = {0}; 400 399 BITMAPINFO *bmi; 401 400 402 401 bmi = (BITMAPINFO *)LockResource(LoadResource(hModule, hResInfo)); 403 402 404 403 icondir.idReserved = 0; … … 685 684 tmp[3] = 'O'; 686 685 /* extract the icon */ 687 if (!extract_icon( This->sIcoPath && strlen(This->sIcoPath) ? 686 if (!extract_icon( This->sIcoPath && strlen(This->sIcoPath) ? 688 687 This->sIcoPath : This->sPath, 689 688 icon_name, This->iIcoNdx)) goto done; … … 691 690 if(OSLibWinCreateObject(This->sPath, This->sArgs, This->sWorkDir, filename, 692 691 This->sDescription, icon_name, 693 This->iIcoNdx, bDesktop) == FALSE) 692 This->iIcoNdx, bDesktop) == FALSE) 694 693 { 695 694 ret = E_ACCESSDENIED; 696 695 } 697 696 698 697 done: 699 698 if(shell_link_app) HeapFree( GetProcessHeap(), 0, shell_link_app ); … … 761 760 762 761 /* extract the icon */ 763 if (!(icon_name = extract_icon( This->sIcoPath && strlen(This->sIcoPath) ? 762 if (!(icon_name = extract_icon( This->sIcoPath && strlen(This->sIcoPath) ? 764 763 This->sIcoPath : This->sPath, 765 764 This->iIcoNdx ))) goto done; … … 830 829 static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName) 831 830 { 832 833 834 831 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); 832 FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName)); 833 return NOERROR; 835 834 } 836 835 static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *ppszFileName) 837 836 { 838 839 840 841 } 842 843 static ICOM_VTABLE(IPersistFile) pfvt = 844 { 845 846 847 848 849 850 851 852 853 854 837 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); 838 FIXME("(%p)\n",This); 839 return NOERROR; 840 } 841 842 static ICOM_VTABLE(IPersistFile) pfvt = 843 { 844 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 845 IPersistFile_fnQueryInterface, 846 IPersistFile_fnAddRef, 847 IPersistFile_fnRelease, 848 IPersistFile_fnGetClassID, 849 IPersistFile_fnIsDirty, 850 IPersistFile_fnLoad, 851 IPersistFile_fnSave, 852 IPersistFile_fnSaveCompleted, 853 IPersistFile_fnGetCurFile 855 854 }; 856 855 … … 859 858 */ 860 859 static HRESULT WINAPI IPersistStream_fnQueryInterface( 861 862 863 864 { 865 866 867 868 869 860 IPersistStream* iface, 861 REFIID riid, 862 VOID** ppvoid) 863 { 864 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 865 866 TRACE("(%p)\n",This); 867 868 return IShellLinkA_QueryInterface((IShellLinkA*)This, riid, ppvoid); 870 869 } 871 870 … … 874 873 */ 875 874 static ULONG WINAPI IPersistStream_fnRelease( 876 877 { 878 879 880 881 882 875 IPersistStream* iface) 876 { 877 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 878 879 TRACE("(%p)\n",This); 880 881 return IShellLinkA_Release((IShellLinkA*)This); 883 882 } 884 883 … … 887 886 */ 888 887 static ULONG WINAPI IPersistStream_fnAddRef( 889 890 { 891 892 893 894 895 896 } 888 IPersistStream* iface) 889 { 890 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 891 892 TRACE("(%p)\n",This); 893 894 return IShellLinkA_AddRef((IShellLinkA*)This); 895 } 897 896 898 897 /************************************************************************ … … 901 900 */ 902 901 static HRESULT WINAPI IPersistStream_fnGetClassID( 903 904 905 { 906 907 908 909 910 911 912 913 /* 914 915 902 IPersistStream* iface, 903 CLSID* pClassID) 904 { 905 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 906 907 TRACE("(%p)\n", This); 908 909 if (pClassID==0) 910 return E_POINTER; 911 912 /* memcpy(pClassID, &CLSID_???, sizeof(CLSID_???)); */ 913 914 return S_OK; 916 915 } 917 916 … … 920 919 */ 921 920 static HRESULT WINAPI IPersistStream_fnIsDirty( 922 923 { 924 925 926 927 928 921 IPersistStream* iface) 922 { 923 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 924 925 TRACE("(%p)\n", This); 926 927 return S_OK; 929 928 } 930 929 /************************************************************************ … … 933 932 934 933 static HRESULT WINAPI IPersistStream_fnLoad( 935 936 937 { 938 939 ULONGdwBytesRead;940 DWORDret = E_FAIL;941 charsTemp[MAX_PATH];942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 { 966 967 968 969 970 971 972 973 974 934 IPersistStream* iface, 935 IStream* pLoadStream) 936 { 937 PLINK_HEADER lpLinkHeader = HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE); 938 ULONG dwBytesRead; 939 DWORD ret = E_FAIL; 940 char sTemp[MAX_PATH]; 941 942 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 943 944 TRACE("(%p)(%p)\n", This, pLoadStream); 945 946 if ( ! pLoadStream) 947 { 948 return STG_E_INVALIDPOINTER; 949 } 950 951 IStream_AddRef (pLoadStream); 952 if(lpLinkHeader) 953 { 954 if (SUCCEEDED(IStream_Read(pLoadStream, lpLinkHeader, LINK_HEADER_SIZE, &dwBytesRead))) 955 { 956 if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink)) 957 { 958 lpLinkHeader = HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize); 959 if (lpLinkHeader) 960 { 961 if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead))) 962 { 963 if (pcheck (&lpLinkHeader->Pidl)) 964 { 965 This->pPidl = ILClone (&lpLinkHeader->Pidl); 966 967 SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp); 968 This->sPath = HEAP_strdupA ( GetProcessHeap(), 0, sTemp); 969 } 970 This->wHotKey = lpLinkHeader->wHotKey; 971 FileTimeToSystemTime (&lpLinkHeader->Time1, &This->time1); 972 FileTimeToSystemTime (&lpLinkHeader->Time2, &This->time2); 973 FileTimeToSystemTime (&lpLinkHeader->Time3, &This->time3); 975 974 #if 1 976 977 978 979 980 981 982 983 #endif 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 975 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time1, NULL, sTemp, 256); 976 TRACE("-- time1: %s\n", sTemp); 977 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time2, NULL, sTemp, 256); 978 TRACE("-- time1: %s\n", sTemp); 979 GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256); 980 TRACE("-- time1: %s\n", sTemp); 981 pdump (This->pPidl); 982 #endif 983 ret = S_OK; 984 } 985 } 986 } 987 else 988 { 989 WARN("stream contains no link!\n"); 990 } 991 } 992 } 993 994 IStream_Release (pLoadStream); 995 996 pdump(This->pPidl); 997 998 HeapFree(GetProcessHeap(), 0, lpLinkHeader); 999 1000 return ret; 1002 1001 } 1003 1002 … … 1006 1005 */ 1007 1006 static HRESULT WINAPI IPersistStream_fnSave( 1008 1009 1010 1011 { 1012 1013 1014 1015 1016 1007 IPersistStream* iface, 1008 IStream* pOutStream, 1009 BOOL fClearDirty) 1010 { 1011 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 1012 1013 TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty); 1014 1015 return E_NOTIMPL; 1017 1016 } 1018 1017 … … 1021 1020 */ 1022 1021 static HRESULT WINAPI IPersistStream_fnGetSizeMax( 1023 1024 1025 { 1026 1027 1028 1029 1030 1022 IPersistStream* iface, 1023 ULARGE_INTEGER* pcbSize) 1024 { 1025 _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); 1026 1027 TRACE("(%p)\n", This); 1028 1029 return E_NOTIMPL; 1031 1030 } 1032 1031 1033 1032 static ICOM_VTABLE(IPersistStream) psvt = 1034 1033 { 1035 1036 1037 1038 1039 1040 1041 1042 1043 1034 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 1035 IPersistStream_fnQueryInterface, 1036 IPersistStream_fnAddRef, 1037 IPersistStream_fnRelease, 1038 IPersistStream_fnGetClassID, 1039 IPersistStream_fnIsDirty, 1040 IPersistStream_fnLoad, 1041 IPersistStream_fnSave, 1042 IPersistStream_fnGetSizeMax 1044 1043 }; 1045 1044 1046 1045 /************************************************************************** 1047 * 1048 */ 1049 IShellLinkA * IShellLink_Constructor(BOOL bUnicode) 1050 { 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1046 * IShellLink_Constructor 1047 */ 1048 IShellLinkA * IShellLink_Constructor(BOOL bUnicode) 1049 { IShellLinkImpl * sl; 1050 1051 sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl)); 1052 sl->ref = 1; 1053 ICOM_VTBL(sl) = &slvt; 1054 sl->lpvtblw = &slvtw; 1055 sl->lpvtblPersistFile = &pfvt; 1056 sl->lpvtblPersistStream = &psvt; 1057 1058 TRACE("(%p)->()\n",sl); 1059 shell32_ObjCount++; 1060 return bUnicode ? (IShellLinkA *) &(sl->lpvtblw) : (IShellLinkA *)sl; 1062 1061 } 1063 1062 … … 1067 1066 static HRESULT WINAPI IShellLinkA_fnQueryInterface( IShellLinkA * iface, REFIID riid, LPVOID *ppvObj) 1068 1067 { 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 } 1080 1081 1082 1083 } 1084 1085 1086 1087 1088 1089 1090 1091 } 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 } 1068 ICOM_THIS(IShellLinkImpl, iface); 1069 1070 TRACE("(%p)->(\n\tIID:\t%s)\n",This,debugstr_guid(riid)); 1071 1072 *ppvObj = NULL; 1073 1074 if(IsEqualIID(riid, &IID_IUnknown) || 1075 IsEqualIID(riid, &IID_IShellLinkA)) 1076 { 1077 *ppvObj = This; 1078 } 1079 else if(IsEqualIID(riid, &IID_IShellLinkW)) 1080 { 1081 *ppvObj = (IShellLinkW *)&(This->lpvtblw); 1082 } 1083 else if(IsEqualIID(riid, &IID_IPersistFile)) 1084 { 1085 *ppvObj = (IPersistFile *)&(This->lpvtblPersistFile); 1086 } 1087 else if(IsEqualIID(riid, &IID_IPersistStream)) 1088 { 1089 *ppvObj = (IPersistStream *)&(This->lpvtblPersistStream); 1090 } 1091 1092 if(*ppvObj) 1093 { 1094 IUnknown_AddRef((IUnknown*)(*ppvObj)); 1095 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); 1096 return S_OK; 1097 } 1098 TRACE("-- Interface: E_NOINTERFACE\n"); 1099 return E_NOINTERFACE; 1100 } 1102 1101 /****************************************************************************** 1103 1102 * IShellLinkA_AddRef … … 1105 1104 static ULONG WINAPI IShellLinkA_fnAddRef(IShellLinkA * iface) 1106 1105 { 1107 1108 1109 1110 1111 1112 1106 ICOM_THIS(IShellLinkImpl, iface); 1107 1108 TRACE("(%p)->(count=%lu)\n",This,This->ref); 1109 1110 shell32_ObjCount++; 1111 return ++(This->ref); 1113 1112 } 1114 1113 /****************************************************************************** 1115 * 1114 * IShellLinkA_Release 1116 1115 */ 1117 1116 static ULONG WINAPI IShellLinkA_fnRelease(IShellLinkA * iface) 1118 1117 { 1119 1120 1121 1122 1123 1124 if (!--(This->ref)) 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1118 ICOM_THIS(IShellLinkImpl, iface); 1119 1120 TRACE("(%p)->(count=%lu)\n",This,This->ref); 1121 1122 shell32_ObjCount--; 1123 if (!--(This->ref)) 1124 { TRACE("-- destroying IShellLink(%p)\n",This); 1125 1126 if (This->sIcoPath) 1127 HeapFree(GetProcessHeap(), 0, This->sIcoPath); 1128 1129 if (This->sArgs) 1130 HeapFree(GetProcessHeap(), 0, This->sArgs); 1131 1132 if (This->sWorkDir) 1133 HeapFree(GetProcessHeap(), 0, This->sWorkDir); 1134 1135 if (This->sDescription) 1136 HeapFree(GetProcessHeap(), 0, This->sDescription); 1137 1138 if (This->sPath) 1139 HeapFree(GetProcessHeap(),0,This->sPath); 1140 1141 if (This->pPidl) 1142 SHFree(This->pPidl); 1143 1144 if (This->lpFileStream) 1145 IStream_Release(This->lpFileStream); 1146 1147 This->iIcoNdx = 0; 1148 1149 HeapFree(GetProcessHeap(),0,This); 1150 return 0; 1151 } 1152 return This->ref; 1154 1153 } 1155 1154 1156 1155 static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA * iface, LPSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) 1157 1156 { 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1157 ICOM_THIS(IShellLinkImpl, iface); 1158 1159 TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath)); 1160 1161 if (This->sPath) 1162 lstrcpynA(pszFile,This->sPath, cchMaxPath); 1163 else 1164 return E_FAIL; 1165 1166 return NOERROR; 1168 1167 } 1169 1168 static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST * ppidl) 1170 1169 { 1171 1172 1173 1174 1175 1176 1170 ICOM_THIS(IShellLinkImpl, iface); 1171 1172 TRACE("(%p)->(ppidl=%p)\n",This, ppidl); 1173 1174 *ppidl = ILClone(This->pPidl); 1175 return NOERROR; 1177 1176 } 1178 1177 static HRESULT WINAPI IShellLinkA_fnSetIDList(IShellLinkA * iface, LPCITEMIDLIST pidl) 1179 1178 { 1180 1181 1182 1183 1184 1185 1186 1187 1179 ICOM_THIS(IShellLinkImpl, iface); 1180 1181 TRACE("(%p)->(pidl=%p)\n",This, pidl); 1182 1183 if (This->pPidl) 1184 SHFree(This->pPidl); 1185 This->pPidl = ILClone (pidl); 1186 return NOERROR; 1188 1187 } 1189 1188 static HRESULT WINAPI IShellLinkA_fnGetDescription(IShellLinkA * iface, LPSTR pszName,INT cchMaxName) 1190 1189 { 1191 1192 1193 1194 1195 1190 ICOM_THIS(IShellLinkImpl, iface); 1191 1192 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); 1193 lstrcpynA(pszName,"Description, FIXME",cchMaxName); 1194 return NOERROR; 1196 1195 } 1197 1196 static HRESULT WINAPI IShellLinkA_fnSetDescription(IShellLinkA * iface, LPCSTR pszName) 1198 1197 { 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1198 ICOM_THIS(IShellLinkImpl, iface); 1199 1200 TRACE("(%p)->(pName=%s)\n", This, pszName); 1201 1202 if (This->sDescription) 1203 HeapFree(GetProcessHeap(), 0, This->sDescription); 1204 if (!(This->sDescription = HEAP_strdupA(GetProcessHeap(), 0, pszName))) 1205 return E_OUTOFMEMORY; 1206 1207 return NOERROR; 1209 1208 } 1210 1209 static HRESULT WINAPI IShellLinkA_fnGetWorkingDirectory(IShellLinkA * iface, LPSTR pszDir,INT cchMaxPath) 1211 1210 { 1212 1213 1214 1215 1216 1217 1218 1211 ICOM_THIS(IShellLinkImpl, iface); 1212 1213 TRACE("(%p)->(%p len=%u)\n", This, pszDir, cchMaxPath); 1214 1215 lstrcpynA( pszDir, This->sWorkDir ? This->sWorkDir : "", cchMaxPath ); 1216 1217 return NOERROR; 1219 1218 } 1220 1219 static HRESULT WINAPI IShellLinkA_fnSetWorkingDirectory(IShellLinkA * iface, LPCSTR pszDir) 1221 1220 { 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1221 ICOM_THIS(IShellLinkImpl, iface); 1222 1223 TRACE("(%p)->(dir=%s)\n",This, pszDir); 1224 1225 if (This->sWorkDir) 1226 HeapFree(GetProcessHeap(), 0, This->sWorkDir); 1227 if (!(This->sWorkDir = HEAP_strdupA(GetProcessHeap(), 0, pszDir))) 1228 return E_OUTOFMEMORY; 1229 1230 return NOERROR; 1232 1231 } 1233 1232 static HRESULT WINAPI IShellLinkA_fnGetArguments(IShellLinkA * iface, LPSTR pszArgs,INT cchMaxPath) 1234 1233 { 1235 1236 1237 1238 1239 1240 1241 1234 ICOM_THIS(IShellLinkImpl, iface); 1235 1236 TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath); 1237 1238 lstrcpynA( pszArgs, This->sArgs ? This->sArgs : "", cchMaxPath ); 1239 1240 return NOERROR; 1242 1241 } 1243 1242 static HRESULT WINAPI IShellLinkA_fnSetArguments(IShellLinkA * iface, LPCSTR pszArgs) 1244 1243 { 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1244 ICOM_THIS(IShellLinkImpl, iface); 1245 1246 TRACE("(%p)->(args=%s)\n",This, pszArgs); 1247 1248 if (This->sArgs) 1249 HeapFree(GetProcessHeap(), 0, This->sArgs); 1250 if (!(This->sArgs = HEAP_strdupA(GetProcessHeap(), 0, pszArgs))) 1251 return E_OUTOFMEMORY; 1252 1253 return NOERROR; 1255 1254 } 1256 1255 static HRESULT WINAPI IShellLinkA_fnGetHotkey(IShellLinkA * iface, WORD *pwHotkey) 1257 1256 { 1258 1259 1260 1261 1262 1263 1264 1257 ICOM_THIS(IShellLinkImpl, iface); 1258 1259 TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey); 1260 1261 *pwHotkey = This->wHotKey; 1262 1263 return NOERROR; 1265 1264 } 1266 1265 static HRESULT WINAPI IShellLinkA_fnSetHotkey(IShellLinkA * iface, WORD wHotkey) 1267 1266 { 1268 1269 1270 1271 1272 1273 1274 1267 ICOM_THIS(IShellLinkImpl, iface); 1268 1269 TRACE("(%p)->(hotkey=%x)\n",This, wHotkey); 1270 1271 This->wHotKey = wHotkey; 1272 1273 return NOERROR; 1275 1274 } 1276 1275 static HRESULT WINAPI IShellLinkA_fnGetShowCmd(IShellLinkA * iface, INT *piShowCmd) 1277 1276 { 1278 1279 1280 1281 1282 1277 ICOM_THIS(IShellLinkImpl, iface); 1278 1279 FIXME("(%p)->(%p)\n",This, piShowCmd); 1280 *piShowCmd=0; 1281 return NOERROR; 1283 1282 } 1284 1283 static HRESULT WINAPI IShellLinkA_fnSetShowCmd(IShellLinkA * iface, INT iShowCmd) 1285 1284 { 1286 1287 1288 1289 1285 ICOM_THIS(IShellLinkImpl, iface); 1286 1287 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd); 1288 return NOERROR; 1290 1289 } 1291 1290 static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR pszIconPath,INT cchIconPath,INT *piIcon) 1292 1291 { 1293 1294 1295 1296 1297 1298 1299 1300 1292 ICOM_THIS(IShellLinkImpl, iface); 1293 1294 TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); 1295 1296 lstrcpynA( pszIconPath, This->sIcoPath ? This->sIcoPath : "", cchIconPath ); 1297 *piIcon = This->iIcoNdx; 1298 1299 return NOERROR; 1301 1300 } 1302 1301 static HRESULT WINAPI IShellLinkA_fnSetIconLocation(IShellLinkA * iface, LPCSTR pszIconPath,INT iIcon) 1303 1302 { 1304 1305 1306 1307 1308 1309 1310 1311 return E_OUTOFMEMORY; 1312 1313 1314 1303 ICOM_THIS(IShellLinkImpl, iface); 1304 1305 TRACE("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon); 1306 1307 if (This->sIcoPath) 1308 HeapFree(GetProcessHeap(), 0, This->sIcoPath); 1309 if (!(This->sIcoPath = HEAP_strdupA(GetProcessHeap(), 0, pszIconPath))) 1310 return E_OUTOFMEMORY; 1311 This->iIcoNdx = iIcon; 1312 1313 return NOERROR; 1315 1314 } 1316 1315 static HRESULT WINAPI IShellLinkA_fnSetRelativePath(IShellLinkA * iface, LPCSTR pszPathRel, DWORD dwReserved) 1317 1316 { 1318 1319 1320 1321 1317 ICOM_THIS(IShellLinkImpl, iface); 1318 1319 FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved); 1320 return NOERROR; 1322 1321 } 1323 1322 static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWORD fFlags) 1324 1323 { 1325 1326 1327 1328 1324 ICOM_THIS(IShellLinkImpl, iface); 1325 1326 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags); 1327 return NOERROR; 1329 1328 } 1330 1329 static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile) 1331 1330 { 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1331 ICOM_THIS(IShellLinkImpl, iface); 1332 1333 TRACE("(%p)->(path=%s)\n",This, pszFile); 1334 1335 if (This->sPath) 1336 HeapFree(GetProcessHeap(), 0, This->sPath); 1337 if (!(This->sPath = HEAP_strdupA(GetProcessHeap(), 0, pszFile))) 1338 return E_OUTOFMEMORY; 1339 1340 return NOERROR; 1342 1341 } 1343 1342 … … 1346 1345 */ 1347 1346 1348 static ICOM_VTABLE(IShellLinkA) slvt = 1349 { 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1347 static ICOM_VTABLE(IShellLinkA) slvt = 1348 { 1349 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 1350 IShellLinkA_fnQueryInterface, 1351 IShellLinkA_fnAddRef, 1352 IShellLinkA_fnRelease, 1353 IShellLinkA_fnGetPath, 1354 IShellLinkA_fnGetIDList, 1355 IShellLinkA_fnSetIDList, 1356 IShellLinkA_fnGetDescription, 1357 IShellLinkA_fnSetDescription, 1358 IShellLinkA_fnGetWorkingDirectory, 1359 IShellLinkA_fnSetWorkingDirectory, 1360 IShellLinkA_fnGetArguments, 1361 IShellLinkA_fnSetArguments, 1362 IShellLinkA_fnGetHotkey, 1363 IShellLinkA_fnSetHotkey, 1364 IShellLinkA_fnGetShowCmd, 1365 IShellLinkA_fnSetShowCmd, 1366 IShellLinkA_fnGetIconLocation, 1367 IShellLinkA_fnSetIconLocation, 1368 IShellLinkA_fnSetRelativePath, 1369 IShellLinkA_fnResolve, 1370 IShellLinkA_fnSetPath 1372 1371 }; 1373 1372 … … 1379 1378 IShellLinkW * iface, REFIID riid, LPVOID *ppvObj) 1380 1379 { 1381 1382 1383 1380 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1381 1382 return IShellLinkA_QueryInterface((IShellLinkA*)This, riid, ppvObj); 1384 1383 } 1385 1384 … … 1389 1388 static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface) 1390 1389 { 1391 1392 1393 1394 1395 1390 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1391 1392 TRACE("(%p)->(count=%lu)\n",This,This->ref); 1393 1394 return IShellLinkA_AddRef((IShellLinkA*)This); 1396 1395 } 1397 1396 /****************************************************************************** … … 1401 1400 static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface) 1402 1401 { 1403 1404 1405 1406 1407 1402 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1403 1404 TRACE("(%p)->(count=%lu)\n",This,This->ref); 1405 1406 return IShellLinkA_Release((IShellLinkA*)This); 1408 1407 } 1409 1408 1410 1409 static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) 1411 1410 { 1412 1413 1414 1411 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1412 1413 FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags); 1415 1414 MultiByteToWideChar( CP_ACP, 0, "c:\\foo.bar", -1, pszFile, cchMaxPath ); 1416 1415 return NOERROR; 1417 1416 } 1418 1417 1419 1418 static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl) 1420 1419 { 1421 1422 1423 1424 1425 1420 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1421 1422 FIXME("(%p)->(ppidl=%p)\n",This, ppidl); 1423 *ppidl = _ILCreateDesktop(); 1424 return NOERROR; 1426 1425 } 1427 1426 1428 1427 static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST pidl) 1429 1428 { 1430 1431 1432 1433 1429 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1430 1431 FIXME("(%p)->(pidl=%p)\n",This, pidl); 1432 return NOERROR; 1434 1433 } 1435 1434 1436 1435 static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR pszName,INT cchMaxName) 1437 1436 { 1438 1439 1440 1437 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1438 1439 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); 1441 1440 MultiByteToWideChar( CP_ACP, 0, "Description, FIXME", -1, pszName, cchMaxName ); 1442 1441 return NOERROR; 1443 1442 } 1444 1443 1445 1444 static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR pszName) 1446 1445 { 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1446 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1447 1448 TRACE("(%p)->(desc=%s)\n",This, debugstr_w(pszName)); 1449 1450 if (This->sDescription) 1451 HeapFree(GetProcessHeap(), 0, This->sDescription); 1452 if (!(This->sDescription = HEAP_strdupWtoA(GetProcessHeap(), 0, pszName))) 1453 return E_OUTOFMEMORY; 1454 1455 return NOERROR; 1457 1456 } 1458 1457 1459 1458 static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPWSTR pszDir,INT cchMaxPath) 1460 1459 { 1461 1462 1463 1464 1465 1466 1467 1460 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1461 1462 TRACE("(%p)->(%p len %u)\n", This, pszDir, cchMaxPath); 1463 1464 MultiByteToWideChar( CP_ACP, 0, This->sWorkDir ? This->sWorkDir : "", -1, pszDir, cchMaxPath ); 1465 1466 return NOERROR; 1468 1467 } 1469 1468 1470 1469 static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPCWSTR pszDir) 1471 1470 { 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1471 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1472 1473 TRACE("(%p)->(dir=%s)\n",This, debugstr_w(pszDir)); 1474 1475 if (This->sWorkDir) 1476 HeapFree(GetProcessHeap(), 0, This->sWorkDir); 1477 if (!(This->sWorkDir = HEAP_strdupWtoA(GetProcessHeap(), 0, pszDir))) 1478 return E_OUTOFMEMORY; 1479 1480 return NOERROR; 1482 1481 } 1483 1482 1484 1483 static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR pszArgs,INT cchMaxPath) 1485 1484 { 1486 1487 1488 1489 1490 1491 1492 1485 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1486 1487 TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath); 1488 1489 MultiByteToWideChar( CP_ACP, 0, This->sArgs ? This->sArgs : "", -1, pszArgs, cchMaxPath ); 1490 1491 return NOERROR; 1493 1492 } 1494 1493 1495 1494 static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR pszArgs) 1496 1495 { 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1496 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1497 1498 TRACE("(%p)->(args=%s)\n",This, debugstr_w(pszArgs)); 1499 1500 if (This->sArgs) 1501 HeapFree(GetProcessHeap(), 0, This->sArgs); 1502 if (!(This->sArgs = HEAP_strdupWtoA(GetProcessHeap(), 0, pszArgs))) 1503 return E_OUTOFMEMORY; 1504 1505 return NOERROR; 1507 1506 } 1508 1507 1509 1508 static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotkey) 1510 1509 { 1511 1512 1513 1514 1515 1510 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1511 1512 FIXME("(%p)->(%p)\n",This, pwHotkey); 1513 *pwHotkey=0x0; 1514 return NOERROR; 1516 1515 } 1517 1516 1518 1517 static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey) 1519 1518 { 1520 1521 1522 1523 1519 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1520 1521 FIXME("(%p)->(hotkey=%x)\n",This, wHotkey); 1522 return NOERROR; 1524 1523 } 1525 1524 1526 1525 static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowCmd) 1527 1526 { 1528 1529 1530 1531 1532 1527 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1528 1529 FIXME("(%p)->(%p)\n",This, piShowCmd); 1530 *piShowCmd=0; 1531 return NOERROR; 1533 1532 } 1534 1533 1535 1534 static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd) 1536 1535 { 1537 1538 1539 1540 1536 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1537 1538 FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd); 1539 return NOERROR; 1541 1540 } 1542 1541 1543 1542 static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR pszIconPath,INT cchIconPath,INT *piIcon) 1544 1543 { 1545 1546 1547 1544 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1545 1546 TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); 1548 1547 1549 1548 MultiByteToWideChar( CP_ACP, 0, This->sIcoPath ? This->sIcoPath : "", -1, pszIconPath, cchIconPath ); 1550 1551 1552 1549 *piIcon = This->iIcoNdx; 1550 1551 return NOERROR; 1553 1552 } 1554 1553 1555 1554 static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon) 1556 1555 { 1557 1558 1559 1560 1561 1562 1563 1564 return E_OUTOFMEMORY; 1565 1566 1567 1556 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1557 1558 TRACE("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon); 1559 1560 if (This->sIcoPath) 1561 HeapFree(GetProcessHeap(), 0, This->sIcoPath); 1562 if (!(This->sIcoPath = HEAP_strdupWtoA(GetProcessHeap(), 0, pszIconPath))) 1563 return E_OUTOFMEMORY; 1564 This->iIcoNdx = iIcon; 1565 1566 return NOERROR; 1568 1567 } 1569 1568 1570 1569 static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR pszPathRel, DWORD dwReserved) 1571 1570 { 1572 1573 1574 1575 1571 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1572 1573 FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved); 1574 return NOERROR; 1576 1575 } 1577 1576 1578 1577 static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags) 1579 1578 { 1580 1581 1582 1583 1579 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1580 1581 FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags); 1582 return NOERROR; 1584 1583 } 1585 1584 1586 1585 static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile) 1587 1586 { 1588 1589 1590 1591 1592 1593 1594 1595 return E_OUTOFMEMORY; 1596 1597 1587 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1588 1589 TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile)); 1590 1591 if (This->sPath) 1592 HeapFree(GetProcessHeap(), 0, This->sPath); 1593 if (!(This->sPath = HEAP_strdupWtoA(GetProcessHeap(), 0, pszFile))) 1594 return E_OUTOFMEMORY; 1595 1596 return NOERROR; 1598 1597 } 1599 1598 … … 1602 1601 */ 1603 1602 1604 static ICOM_VTABLE(IShellLinkW) slvtw = 1605 { 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1603 static ICOM_VTABLE(IShellLinkW) slvtw = 1604 { 1605 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 1606 IShellLinkW_fnQueryInterface, 1607 IShellLinkW_fnAddRef, 1608 IShellLinkW_fnRelease, 1609 IShellLinkW_fnGetPath, 1610 IShellLinkW_fnGetIDList, 1611 IShellLinkW_fnSetIDList, 1612 IShellLinkW_fnGetDescription, 1613 IShellLinkW_fnSetDescription, 1614 IShellLinkW_fnGetWorkingDirectory, 1615 IShellLinkW_fnSetWorkingDirectory, 1616 IShellLinkW_fnGetArguments, 1617 IShellLinkW_fnSetArguments, 1618 IShellLinkW_fnGetHotkey, 1619 IShellLinkW_fnSetHotkey, 1620 IShellLinkW_fnGetShowCmd, 1621 IShellLinkW_fnSetShowCmd, 1622 IShellLinkW_fnGetIconLocation, 1623 IShellLinkW_fnSetIconLocation, 1624 IShellLinkW_fnSetRelativePath, 1625 IShellLinkW_fnResolve, 1626 IShellLinkW_fnSetPath 1628 1627 }; 1629 1628
Note:
See TracChangeset
for help on using the changeset viewer.