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