Autosyncing with Wine HEAD

svn path=/trunk/; revision=23976
This commit is contained in:
The Wine Synchronizer 2006-09-08 19:33:33 +00:00
parent 335e03625a
commit 527fb9fa9b
2 changed files with 32 additions and 6 deletions

View file

@ -621,7 +621,7 @@ static const cab_UWORD Zipmask[17] = {
struct ExtractFileList {
LPSTR filename;
struct ExtractFileList *next;
BOOL unknown; /* always 1L */
BOOL flag;
} ;
/* the first parameter of the function extract */
@ -631,8 +631,10 @@ typedef struct {
struct ExtractFileList *filelist; /* 0x010 */
long filecount; /* 0x014 */
DWORD flags; /* 0x018 */
char directory[0x104]; /* 0x01c */
char lastfile[0x20c]; /* 0x120 */
char directory[MAX_PATH]; /* 0x01c */
char lastfile[MAX_PATH]; /* 0x120 */
char unknown2[MAX_PATH]; /* 0x224 */
struct ExtractFileList *filterlist; /* 0x328 */
} EXTRACTdest;

View file

@ -157,7 +157,7 @@ static long fdi_seek(INT_PTR hf, long dist, int seektype)
static void fill_file_node(struct ExtractFileList *pNode, LPSTR szFilename)
{
pNode->next = NULL;
pNode->unknown = TRUE;
pNode->flag = FALSE;
pNode->filename = HeapAlloc(GetProcessHeap(), 0, strlen(szFilename) + 1);
lstrcpyA(pNode->filename, szFilename);
@ -216,7 +216,8 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf
pDestination->filecount++;
}
if (pDestination->flags & EXTRACT_EXTRACTFILES)
if ((pDestination->flags & EXTRACT_EXTRACTFILES) ||
file_in_list(pDestination->filterlist, pfdin->psz1))
{
/* skip this file it it's not in the file list */
if (!file_in_list(pDestination->filelist, pfdin->psz1))
@ -303,6 +304,7 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName)
HRESULT res = S_OK;
HFDI hfdi;
ERF erf;
char *str, *path, *name;
TRACE("(%p, %s)\n", dest, szCabName);
@ -322,10 +324,32 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName)
if (GetFileAttributesA(dest->directory) == INVALID_FILE_ATTRIBUTES)
return S_OK;
if (!FDICopy(hfdi, (LPSTR)szCabName, "", 0,
/* split the cabinet name into path + name */
str = HeapAlloc(GetProcessHeap(), 0, lstrlenA(szCabName)+1);
if (!str)
{
res = E_OUTOFMEMORY;
goto end;
}
lstrcpyA(str, szCabName);
path = str;
name = strrchr(path, '\\');
if (name)
*name++ = 0;
else
{
name = path;
path = NULL;
}
if (!FDICopy(hfdi, name, path, 0,
fdi_notify_extract, NULL, dest))
res = E_FAIL;
HeapFree(GetProcessHeap(), 0, str);
end:
FDIDestroy(hfdi);
return res;