mirror of
https://github.com/reactos/reactos.git
synced 2024-07-07 21:25:05 +00:00
Autosyncing with Wine HEAD
svn path=/trunk/; revision=23976
This commit is contained in:
parent
335e03625a
commit
527fb9fa9b
|
@ -621,7 +621,7 @@ static const cab_UWORD Zipmask[17] = {
|
||||||
struct ExtractFileList {
|
struct ExtractFileList {
|
||||||
LPSTR filename;
|
LPSTR filename;
|
||||||
struct ExtractFileList *next;
|
struct ExtractFileList *next;
|
||||||
BOOL unknown; /* always 1L */
|
BOOL flag;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
/* the first parameter of the function extract */
|
/* the first parameter of the function extract */
|
||||||
|
@ -631,8 +631,10 @@ typedef struct {
|
||||||
struct ExtractFileList *filelist; /* 0x010 */
|
struct ExtractFileList *filelist; /* 0x010 */
|
||||||
long filecount; /* 0x014 */
|
long filecount; /* 0x014 */
|
||||||
DWORD flags; /* 0x018 */
|
DWORD flags; /* 0x018 */
|
||||||
char directory[0x104]; /* 0x01c */
|
char directory[MAX_PATH]; /* 0x01c */
|
||||||
char lastfile[0x20c]; /* 0x120 */
|
char lastfile[MAX_PATH]; /* 0x120 */
|
||||||
|
char unknown2[MAX_PATH]; /* 0x224 */
|
||||||
|
struct ExtractFileList *filterlist; /* 0x328 */
|
||||||
} EXTRACTdest;
|
} EXTRACTdest;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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)
|
static void fill_file_node(struct ExtractFileList *pNode, LPSTR szFilename)
|
||||||
{
|
{
|
||||||
pNode->next = NULL;
|
pNode->next = NULL;
|
||||||
pNode->unknown = TRUE;
|
pNode->flag = FALSE;
|
||||||
|
|
||||||
pNode->filename = HeapAlloc(GetProcessHeap(), 0, strlen(szFilename) + 1);
|
pNode->filename = HeapAlloc(GetProcessHeap(), 0, strlen(szFilename) + 1);
|
||||||
lstrcpyA(pNode->filename, szFilename);
|
lstrcpyA(pNode->filename, szFilename);
|
||||||
|
@ -216,7 +216,8 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf
|
||||||
pDestination->filecount++;
|
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 */
|
/* skip this file it it's not in the file list */
|
||||||
if (!file_in_list(pDestination->filelist, pfdin->psz1))
|
if (!file_in_list(pDestination->filelist, pfdin->psz1))
|
||||||
|
@ -303,6 +304,7 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName)
|
||||||
HRESULT res = S_OK;
|
HRESULT res = S_OK;
|
||||||
HFDI hfdi;
|
HFDI hfdi;
|
||||||
ERF erf;
|
ERF erf;
|
||||||
|
char *str, *path, *name;
|
||||||
|
|
||||||
TRACE("(%p, %s)\n", dest, szCabName);
|
TRACE("(%p, %s)\n", dest, szCabName);
|
||||||
|
|
||||||
|
@ -322,10 +324,32 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName)
|
||||||
if (GetFileAttributesA(dest->directory) == INVALID_FILE_ATTRIBUTES)
|
if (GetFileAttributesA(dest->directory) == INVALID_FILE_ATTRIBUTES)
|
||||||
return S_OK;
|
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))
|
fdi_notify_extract, NULL, dest))
|
||||||
res = E_FAIL;
|
res = E_FAIL;
|
||||||
|
|
||||||
|
HeapFree(GetProcessHeap(), 0, str);
|
||||||
|
end:
|
||||||
|
|
||||||
FDIDestroy(hfdi);
|
FDIDestroy(hfdi);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue