Ignore:
Timestamp:
Nov 6, 2000, 11:20:56 AM (25 years ago)
Author:
sandervl
Message:

merged with latest Wine (11-05-2000)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/shelllink.c

    r4121 r4561  
    1 /* $Id: shelllink.c,v 1.1 2000-08-30 13:52:55 sandervl Exp $ */
     1/* $Id: shelllink.c,v 1.2 2000-11-06 10:20:56 sandervl Exp $ */
    22/*
    33 *
     
    1212
    1313#include <string.h>
     14#include <sys/stat.h>
     15#include <stdio.h>
     16#ifndef __WIN32OS2__
     17#include <unistd.h>
     18#endif
     19#include <errno.h>
     20#ifndef __WIN32OS2__
     21#include <sys/wait.h>
     22#endif
     23
    1424#include "debugtools.h"
    1525#include "winerror.h"
    16 
    17 #include "wine/obj_base.h"
    18 #include "wine/obj_storage.h"
    19 #include "wine/obj_shelllink.h"
     26#include "winbase.h"
     27#include "winnls.h"
     28
     29#include "shlobj.h"
     30#include "wine/winestring.h"
    2031#include "wine/undocshell.h"
     32#ifndef __WIN32OS2__
     33#include "bitmaps/wine.xpm"
     34#endif
    2135
    2236#include "heap.h"
    23 #include "winnls.h"
    2437#include "pidl.h"
    2538#include "shell32_main.h"
    2639#include "shlguid.h"
     40#include "file.h"
     41#include "options.h"
    2742
    2843DEFAULT_DEBUG_CHANNEL(shell);
     
    6378#define LINK_HEADER_SIZE (sizeof(LINK_HEADER)-sizeof(ITEMIDLIST))
    6479
     80typedef struct
     81{
     82        BYTE bWidth;
     83        BYTE bHeight;
     84        BYTE bColorCount;
     85        BYTE bReserved;
     86        WORD wPlanes;
     87        WORD wBitCount;
     88        DWORD dwBytesInRes;
     89        WORD nID;
     90} GRPICONDIRENTRY;
     91
     92typedef struct
     93{
     94        WORD idReserved;
     95        WORD idType;
     96        WORD idCount;
     97        GRPICONDIRENTRY idEntries[1];
     98} GRPICONDIR;
     99
     100typedef struct
     101{
     102        BYTE bWidth;
     103        BYTE bHeight;
     104        BYTE bColorCount;
     105        BYTE bReserved;
     106        WORD wPlanes;
     107        WORD wBitCount;
     108        DWORD dwBytesInRes;
     109        DWORD dwImageOffset;
     110} ICONDIRENTRY;
     111
     112typedef struct
     113{
     114        WORD idReserved;
     115        WORD idType;
     116        WORD idCount;
     117} ICONDIR;
     118
     119
    65120#include "poppack.h"
     121
    66122
    67123static ICOM_VTABLE(IShellLinkA)         slvt;
     
    92148        SYSTEMTIME      time3;
    93149
     150        LPSTR           sIcoPath;
     151        INT             iIcoNdx;
     152        LPSTR           sArgs;
     153        LPSTR           sWorkDir;
     154        LPSTR           sDescription;
    94155} IShellLinkImpl;
    95156
     
    179240}
    180241
     242
     243#ifndef __WIN32OS2__
     244/* Icon extraction routines
     245 *
     246 * FIXME: should use PrivateExtractIcons and friends
     247 * FIXME: should not use stdio
     248 */
     249
     250static BOOL SaveIconResAsXPM(const BITMAPINFO *pIcon, const char *szXPMFileName)
     251{
     252    FILE *fXPMFile;
     253    int nHeight;
     254    int nXORWidthBytes;
     255    int nANDWidthBytes;
     256    BOOL b8BitColors;
     257    int nColors;
     258    BYTE *pXOR;
     259    BYTE *pAND;
     260    BOOL aColorUsed[256] = {0};
     261    int nColorsUsed = 0;
     262    int i,j;
     263
     264    if (!((pIcon->bmiHeader.biBitCount == 4) || (pIcon->bmiHeader.biBitCount == 8)))
     265        return 0;
     266
     267    if (!(fXPMFile = fopen(szXPMFileName, "w")))
     268        return 0;
     269
     270    nHeight = pIcon->bmiHeader.biHeight / 2;
     271    nXORWidthBytes = 4 * ((pIcon->bmiHeader.biWidth * pIcon->bmiHeader.biBitCount / 32)
     272                          + ((pIcon->bmiHeader.biWidth * pIcon->bmiHeader.biBitCount % 32) > 0));
     273    nANDWidthBytes = 4 * ((pIcon->bmiHeader.biWidth / 32)
     274                          + ((pIcon->bmiHeader.biWidth % 32) > 0));
     275    b8BitColors = pIcon->bmiHeader.biBitCount == 8;
     276    nColors = pIcon->bmiHeader.biClrUsed ? pIcon->bmiHeader.biClrUsed
     277        : 1 << pIcon->bmiHeader.biBitCount;
     278    pXOR = (BYTE*) pIcon + sizeof (BITMAPINFOHEADER) + (nColors * sizeof (RGBQUAD));
     279    pAND = pXOR + nHeight * nXORWidthBytes;
     280
     281#define MASK(x,y) (pAND[(x) / 8 + (nHeight - (y) - 1) * nANDWidthBytes] & (1 << (7 - (x) % 8)))
     282#define COLOR(x,y) (b8BitColors ? pXOR[(x) + (nHeight - (y) - 1) * nXORWidthBytes] : (x) % 2 ? pXOR[(x) / 2 + (nHeight - (y) - 1) * nXORWidthBytes] & 0xF : (pXOR[(x) / 2 + (nHeight - (y) - 1) * nXORWidthBytes] & 0xF0) >> 4)
     283
     284    for (i = 0; i < nHeight; i++)
     285        for (j = 0; j < pIcon->bmiHeader.biWidth; j++)
     286            if (!aColorUsed[COLOR(j,i)] && !MASK(j,i))
     287            {
     288                aColorUsed[COLOR(j,i)] = TRUE;
     289                nColorsUsed++;
     290            }
     291
     292    if (fprintf(fXPMFile, "/* XPM */\nstatic char *icon[] = {\n") <= 0)
     293        goto error;
     294    if (fprintf(fXPMFile, "\"%d %d %d %d\",\n",
     295                (int) pIcon->bmiHeader.biWidth, nHeight, nColorsUsed + 1, 2) <=0)
     296        goto error;
     297
     298    for (i = 0; i < nColors; i++)
     299        if (aColorUsed[i])
     300            if (fprintf(fXPMFile, "\"%.2X c #%.2X%.2X%.2X\",\n", i, pIcon->bmiColors[i].rgbRed,
     301                        pIcon->bmiColors[i].rgbGreen, pIcon->bmiColors[i].rgbBlue) <= 0)
     302                goto error;
     303    if (fprintf(fXPMFile, "\"   c None\"") <= 0)
     304        goto error;
     305
     306    for (i = 0; i < nHeight; i++)
     307    {
     308        if (fprintf(fXPMFile, ",\n\"") <= 0)
     309            goto error;
     310        for (j = 0; j < pIcon->bmiHeader.biWidth; j++)
     311        {
     312            if MASK(j,i)
     313                {
     314                    if (fprintf(fXPMFile, "  ") <= 0)
     315                        goto error;
     316                }
     317            else
     318                if (fprintf(fXPMFile, "%.2X", COLOR(j,i)) <= 0)
     319                    goto error;
     320        }
     321        if (fprintf(fXPMFile, "\"") <= 0)
     322            goto error;
     323    }
     324    if (fprintf(fXPMFile, "};\n") <= 0)
     325        goto error;
     326
     327#undef MASK
     328#undef COLOR
     329
     330    fclose(fXPMFile);
     331    return 1;
     332
     333 error:
     334    fclose(fXPMFile);
     335    unlink( szXPMFileName );
     336    return 0;
     337}
     338
     339static BOOL CALLBACK EnumResNameProc(HANDLE hModule, const char *lpszType, char *lpszName, LONG lParam)
     340{
     341    *(HRSRC *) lParam = FindResourceA(hModule, lpszName, RT_GROUP_ICONA);
     342    return FALSE;
     343}
     344
     345static int ExtractFromEXEDLL(const char *szFileName, int nIndex, const char *szXPMFileName)
     346{
     347    HMODULE hModule;
     348    HRSRC hResInfo;
     349    char *lpName = NULL;
     350    HGLOBAL hResData;
     351    GRPICONDIR *pIconDir;
     352    BITMAPINFO *pIcon;
     353    int nMax = 0;
     354    int i;
     355
     356    if (!(hModule = LoadLibraryExA(szFileName, 0, LOAD_LIBRARY_AS_DATAFILE)))
     357        goto error1;
     358
     359    if (nIndex)
     360        hResInfo = FindResourceA(hModule, MAKEINTRESOURCEA(nIndex), RT_GROUP_ICONA);
     361    else
     362        if (EnumResourceNamesA(hModule, RT_GROUP_ICONA, &EnumResNameProc, (LONG) &hResInfo))
     363            goto error2;
     364
     365    if (!hResInfo)
     366        goto error2;
     367
     368    if (!(hResData = LoadResource(hModule, hResInfo)))
     369        goto error2;
     370    if (!(pIconDir = LockResource(hResData)))
     371        goto error3;
     372
     373    for (i = 0; i < pIconDir->idCount; i++)
     374        if ((pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth) > nMax)
     375        {
     376            lpName = MAKEINTRESOURCEA(pIconDir->idEntries[i].nID);
     377            nMax = pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth;
     378        }
     379
     380    FreeResource(hResData);
     381
     382    if (!(hResInfo = FindResourceA(hModule, lpName, RT_ICONA)))
     383        goto error2;
     384    if (!(hResData = LoadResource(hModule, hResInfo)))
     385        goto error2;
     386    if (!(pIcon = LockResource(hResData)))
     387        goto error3;
     388
     389    if(!SaveIconResAsXPM(pIcon, szXPMFileName))
     390        goto error3;
     391
     392    FreeResource(hResData);
     393    FreeLibrary(hModule);
     394
     395    return 1;
     396
     397 error3:
     398    FreeResource(hResData);
     399 error2:
     400    FreeLibrary(hModule);
     401 error1:
     402    return 0;
     403}
     404
     405static int ExtractFromICO(const char *szFileName, const char *szXPMFileName)
     406{
     407    FILE *fICOFile;
     408    ICONDIR iconDir;
     409    ICONDIRENTRY *pIconDirEntry;
     410    int nMax = 0;
     411    int nIndex = 0;
     412    void *pIcon;
     413    int i;
     414
     415    if (!(fICOFile = fopen(szFileName, "r")))
     416        goto error1;
     417
     418    if (fread(&iconDir, sizeof (ICONDIR), 1, fICOFile) != 1)
     419        goto error2;
     420    if ((iconDir.idReserved != 0) || (iconDir.idType != 1))
     421        goto error2;
     422
     423    if ((pIconDirEntry = malloc(iconDir.idCount * sizeof (ICONDIRENTRY))) == NULL)
     424        goto error2;
     425    if (fread(pIconDirEntry, sizeof (ICONDIRENTRY), iconDir.idCount, fICOFile) != iconDir.idCount)
     426        goto error3;
     427
     428    for (i = 0; i < iconDir.idCount; i++)
     429        if ((pIconDirEntry[i].bHeight * pIconDirEntry[i].bWidth) > nMax)
     430        {
     431            nIndex = i;
     432            nMax = pIconDirEntry[i].bHeight * pIconDirEntry[i].bWidth;
     433        }
     434    if ((pIcon = malloc(pIconDirEntry[nIndex].dwBytesInRes)) == NULL)
     435        goto error3;
     436    if (fseek(fICOFile, pIconDirEntry[nIndex].dwImageOffset, SEEK_SET))
     437        goto error4;
     438    if (fread(pIcon, pIconDirEntry[nIndex].dwBytesInRes, 1, fICOFile) != 1)
     439        goto error4;
     440
     441    if(!SaveIconResAsXPM(pIcon, szXPMFileName))
     442        goto error4;
     443
     444    free(pIcon);
     445    free(pIconDirEntry);
     446    fclose(fICOFile);
     447
     448    return 1;
     449
     450 error4:
     451    free(pIcon);
     452 error3:
     453    free(pIconDirEntry);
     454 error2:
     455    fclose(fICOFile);
     456 error1:
     457    return 0;
     458}
     459
     460/* get the Unix file name for a given path, allocating the string */
     461inline static char *get_unix_file_name( const char *dos )
     462{
     463    DOS_FULL_NAME path;
     464
     465    if (!DOSFS_GetFullName( dos, FALSE, &path )) return NULL;
     466    return HEAP_strdupA( GetProcessHeap(), 0, path.long_name );
     467}
     468
     469static BOOL create_default_icon( const char *filename )
     470{
     471    FILE *fXPM;
     472    int i;
     473
     474    if (!(fXPM = fopen(filename, "w"))) return FALSE;
     475    fprintf(fXPM, "/* XPM */\nstatic char * icon[] = {");
     476    for (i = 0; i < sizeof(wine_xpm)/sizeof(wine_xpm[0]); i++)
     477        fprintf( fXPM, "\n\"%s\",", wine_xpm[i]);
     478    fprintf( fXPM, "};\n" );
     479    fclose( fXPM );
     480    return TRUE;
     481}
     482
     483/* extract an icon from an exe or icon file; helper for IPersistFile_fnSave */
     484static char *extract_icon( const char *path, int index )
     485{
     486    char *filename = HEAP_strdupA( GetProcessHeap(), 0, tmpnam(NULL) );
     487    if (ExtractFromEXEDLL( path, index, filename )) return filename;
     488    if (ExtractFromICO( path, filename )) return filename;
     489    if (create_default_icon( filename )) return filename;
     490    HeapFree( GetProcessHeap(), 0, filename );
     491    return NULL;
     492}
     493#endif //#ifndef __WIN32OS2__
     494
     495
    181496static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
    182497{
    183         _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
    184         FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName));
    185         return NOERROR;
    186 }
     498    HRESULT ret = NOERROR;
     499    int pid, status;
     500    char buffer[MAX_PATH], buff2[MAX_PATH];
     501    char *filename, *link_name, *p;
     502    char *shell_link_app = NULL;
     503    char *icon_name = NULL;
     504    char *path_name = NULL;
     505    char *work_dir = NULL;
     506    BOOL bDesktop;
     507
     508    _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
     509
     510    TRACE("(%p)->(%s)\n",This,debugstr_w(pszFileName));
     511
     512    if (!pszFileName || !This->sPath)
     513        return ERROR_UNKNOWN;
     514
     515    /* check for .exe extension */
     516    if (!(p = strrchr( This->sPath, '.' ))) return NOERROR;
     517    if (strchr( p, '\\' ) || strchr( p, '/' )) return NOERROR;
     518    if (strcasecmp( p, ".exe" )) return NOERROR;
     519
     520    /* check if ShellLinker configured */
     521#ifdef __WIN32OS2__
     522    return NOERROR;
     523#else
     524    PROFILE_GetWineIniString( "wine", "ShellLinker", "", buffer, sizeof(buffer) );
     525    if (!*buffer) return NOERROR;
     526    shell_link_app = HEAP_strdupA( GetProcessHeap(), 0, buffer );
     527
     528    if (!WideCharToMultiByte( CP_ACP, 0, pszFileName, -1, buffer, sizeof(buffer), NULL, NULL))
     529        return ERROR_UNKNOWN;
     530    GetFullPathNameA( buffer, sizeof(buff2), buff2, NULL );
     531    filename = HEAP_strdupA( GetProcessHeap(), 0, buff2 );
     532
     533    if (SHGetSpecialFolderPathA( 0, buffer, CSIDL_STARTUP, FALSE ))
     534    {
     535        /* ignore startup for now */
     536        if (!strncasecmp( filename, buffer, strlen(buffer) )) goto done;
     537    }
     538    if (SHGetSpecialFolderPathA( 0, buffer, CSIDL_DESKTOPDIRECTORY, FALSE ))
     539    {
     540        if (!strncasecmp( filename, buffer, strlen(buffer) ))
     541        {
     542            link_name = filename + strlen(buffer);
     543            bDesktop = TRUE;
     544            goto found;
     545        }
     546    }
     547    if (SHGetSpecialFolderPathA( 0, buffer, CSIDL_STARTMENU, FALSE ))
     548    {
     549        if (!strncasecmp( filename, buffer, strlen(buffer) ))
     550        {
     551            link_name = filename + strlen(buffer);
     552            bDesktop = FALSE;
     553            goto found;
     554        }
     555    }
     556    goto done;
     557
     558 found:
     559    /* make link name a Unix name */
     560    for (p = link_name; *p; p++) if (*p == '\\') *p = '/';
     561    /* strip leading slashes */
     562    while (*link_name == '/') link_name++;
     563    /* remove extension */
     564    if ((p = strrchr( link_name, '.' ))) *p = 0;
     565
     566    /* convert app path name */
     567    path_name = get_unix_file_name( This->sPath );
     568
     569    /* convert app working dir */
     570    if (This->sWorkDir) work_dir = get_unix_file_name( This->sWorkDir );
     571
     572    /* extract the icon */
     573    if (!(icon_name = extract_icon( This->sIcoPath ? This->sIcoPath : This->sPath,
     574                                    This->iIcoNdx ))) goto done;
     575
     576    TRACE("linker app='%s' link='%s' mode=%s path='%s' args='%s' icon='%s' workdir='%s' descr='%s'\n",
     577        shell_link_app, link_name, bDesktop ? "desktop" : "menu", path_name,
     578        This->sArgs ? This->sArgs : "", icon_name, work_dir ? work_dir : "",
     579        This->sDescription ? This->sDescription : "" );
     580
     581    if ((pid = fork()) == -1) goto done;
     582    if (!pid)
     583    {
     584        int pos = 0;
     585        char *argv[20];
     586        argv[pos++] = shell_link_app;
     587        argv[pos++] = "--link";
     588        argv[pos++] = link_name;
     589        argv[pos++] = "--path";
     590        argv[pos++] = path_name;
     591        argv[pos++] = bDesktop ? "--desktop" : "--menu";
     592        if (This->sArgs)
     593        {
     594            argv[pos++] = "--args";
     595            argv[pos++] = This->sArgs;
     596        }
     597        if (icon_name)
     598        {
     599            argv[pos++] = "--icon";
     600            argv[pos++] = icon_name;
     601        }
     602        if (This->sWorkDir)
     603        {
     604            argv[pos++] = "--workdir";
     605            argv[pos++] = This->sWorkDir;
     606        }
     607        if (This->sDescription)
     608        {
     609            argv[pos++] = "--descr";
     610            argv[pos++] = This->sDescription;
     611        }
     612        argv[pos] = NULL;
     613        execvp( shell_link_app, argv );
     614        _exit(1);
     615    }
     616
     617    while (waitpid( pid, &status, 0 ) == -1)
     618    {
     619        if (errno != EINTR)
     620        {
     621            ret = ERROR_UNKNOWN;
     622            goto done;
     623        }
     624    }
     625    if (status) ret = E_ACCESSDENIED;
     626
     627 done:
     628    if (icon_name) unlink( icon_name );
     629    HeapFree( GetProcessHeap(), 0, shell_link_app );
     630    HeapFree( GetProcessHeap(), 0, filename );
     631    HeapFree( GetProcessHeap(), 0, icon_name );
     632    HeapFree( GetProcessHeap(), 0, path_name );
     633    HeapFree( GetProcessHeap(), 0, work_dir );
     634    return ret;
     635#endif //__WIN32OS2__
     636}
     637
    187638static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName)
    188639{
     
    481932        if (!--(This->ref))
    482933        { TRACE("-- destroying IShellLink(%p)\n",This);
     934       
     935          if (This->sIcoPath)
     936            HeapFree(GetProcessHeap(), 0, This->sIcoPath);
     937           
     938          if (This->sArgs)
     939            HeapFree(GetProcessHeap(), 0, This->sArgs);
     940
     941          if (This->sWorkDir)
     942            HeapFree(GetProcessHeap(), 0, This->sWorkDir);
     943           
     944          if (This->sDescription)
     945            HeapFree(GetProcessHeap(), 0, This->sDescription);
    483946
    484947          if (This->sPath)
     
    490953          if (This->lpFileStream)
    491954            IStream_Release(This->lpFileStream);
     955       
     956          This->iIcoNdx = 0;
    492957
    493958          HeapFree(GetProcessHeap(),0,This);
     
    5421007        ICOM_THIS(IShellLinkImpl, iface);
    5431008       
    544         FIXME("(%p)->(desc=%s)\n",This, pszName);
     1009        TRACE("(%p)->(pName=%s)\n", This, pszName);
     1010
     1011        if (This->sDescription)
     1012            HeapFree(GetProcessHeap(), 0, This->sDescription);
     1013        if (!(This->sDescription = HEAP_strdupA(GetProcessHeap(), 0, pszName)))
     1014            return E_OUTOFMEMORY;
     1015
    5451016        return NOERROR;
    5461017}
     
    5571028        ICOM_THIS(IShellLinkImpl, iface);
    5581029       
    559         FIXME("(%p)->(dir=%s)\n",This, pszDir);
     1030        TRACE("(%p)->(dir=%s)\n",This, pszDir);
     1031
     1032        if (This->sWorkDir)
     1033            HeapFree(GetProcessHeap(), 0, This->sWorkDir);
     1034        if (!(This->sWorkDir = HEAP_strdupA(GetProcessHeap(), 0, pszDir)))
     1035            return E_OUTOFMEMORY;
     1036
    5601037        return NOERROR;
    5611038}
     
    5721049        ICOM_THIS(IShellLinkImpl, iface);
    5731050       
    574         FIXME("(%p)->(args=%s)\n",This, pszArgs);
     1051        TRACE("(%p)->(args=%s)\n",This, pszArgs);
     1052
     1053        if (This->sArgs)
     1054            HeapFree(GetProcessHeap(), 0, This->sArgs);
     1055        if (!(This->sArgs = HEAP_strdupA(GetProcessHeap(), 0, pszArgs)))
     1056            return E_OUTOFMEMORY;
    5751057
    5761058        return NOERROR;
     
    6241106        ICOM_THIS(IShellLinkImpl, iface);
    6251107       
    626         FIXME("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon);
     1108        TRACE("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon);
     1109       
     1110        if (This->sIcoPath)
     1111            HeapFree(GetProcessHeap(), 0, This->sIcoPath);
     1112        if (!(This->sIcoPath = HEAP_strdupA(GetProcessHeap(), 0, pszIconPath)))
     1113            return E_OUTOFMEMORY;       
     1114        This->iIcoNdx = iIcon;
     1115       
    6271116        return NOERROR;
    6281117}
     
    6451134        ICOM_THIS(IShellLinkImpl, iface);
    6461135       
    647         FIXME("(%p)->(path=%s)\n",This, pszFile);
     1136        TRACE("(%p)->(path=%s)\n",This, pszFile);
     1137
     1138        if (This->sPath)
     1139            HeapFree(GetProcessHeap(), 0, This->sPath);
     1140        if (!(This->sPath = HEAP_strdupA(GetProcessHeap(), 0, pszFile)))
     1141            return E_OUTOFMEMORY;
     1142       
    6481143        return NOERROR;
    6491144}
     
    7541249        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    7551250       
    756         FIXME("(%p)->(desc=%s)\n",This, debugstr_w(pszName));
     1251        TRACE("(%p)->(desc=%s)\n",This, debugstr_w(pszName));
     1252
     1253        if (This->sDescription)
     1254            HeapFree(GetProcessHeap(), 0, This->sDescription);
     1255        if (!(This->sDescription = HEAP_strdupWtoA(GetProcessHeap(), 0, pszName)))
     1256            return E_OUTOFMEMORY;
     1257               
    7571258        return NOERROR;
    7581259}
     
    7711272        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    7721273       
    773         FIXME("(%p)->(dir=%s)\n",This, debugstr_w(pszDir));
     1274        TRACE("(%p)->(dir=%s)\n",This, debugstr_w(pszDir));
     1275
     1276        if (This->sWorkDir)
     1277            HeapFree(GetProcessHeap(), 0, This->sWorkDir);
     1278        if (!(This->sWorkDir = HEAP_strdupWtoA(GetProcessHeap(), 0, pszDir)))
     1279            return E_OUTOFMEMORY;
     1280
    7741281        return NOERROR;
    7751282}
     
    7881295        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    7891296       
    790         FIXME("(%p)->(args=%s)\n",This, debugstr_w(pszArgs));
     1297        TRACE("(%p)->(args=%s)\n",This, debugstr_w(pszArgs));
     1298       
     1299        if (This->sArgs)
     1300            HeapFree(GetProcessHeap(), 0, This->sArgs);
     1301        if (!(This->sArgs = HEAP_strdupWtoA(GetProcessHeap(), 0, pszArgs)))
     1302            return E_OUTOFMEMORY;
     1303       
    7911304        return NOERROR;
    7921305}
     
    8401353        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    8411354       
    842         FIXME("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon);
     1355        TRACE("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon);
     1356
     1357        if (This->sIcoPath)
     1358            HeapFree(GetProcessHeap(), 0, This->sIcoPath);
     1359        if (!(This->sIcoPath = HEAP_strdupWtoA(GetProcessHeap(), 0, pszIconPath)))
     1360            return E_OUTOFMEMORY;       
     1361        This->iIcoNdx = iIcon;
     1362
    8431363        return NOERROR;
    8441364}
     
    8641384        _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
    8651385       
    866         FIXME("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
     1386        TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile));
     1387       
     1388        if (This->sPath)
     1389            HeapFree(GetProcessHeap(), 0, This->sPath);
     1390        if (!(This->sPath = HEAP_strdupWtoA(GetProcessHeap(), 0, pszFile)))
     1391            return E_OUTOFMEMORY;       
     1392       
    8671393        return NOERROR;
    8681394}
Note: See TracChangeset for help on using the changeset viewer.