Commit 55b2bf1d authored by Greg Turner's avatar Greg Turner Committed by Alexandre Julliard

- port cabextract to wine

- implement cabinet.dll.Extract, urlmon.dll.Extract - add SP6a registry key to winedefault.reg
parent ea2b6df7
......@@ -9,6 +9,8 @@ LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
cabextract.c \
cabinet_main.c \
fci.c \
fdi.c
......
1 stub GetDllVersion
2 stub DllGetVersion
3 stub Extract
2 stdcall DllGetVersion (ptr) CABINET_DllGetVersion
3 stdcall Extract(long ptr) Extract
4 stub DeleteExtractedFiles
10 cdecl FCICreate(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) FCICreate
11 cdecl FCIAddFile(long ptr ptr long ptr ptr ptr long) FCIAddFile
......
/*
* cabinet.dll main
*
* Copyright 2002 Patrik Stridvall
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include <assert.h>
#define NO_SHLWAPI_REG
#include "shlwapi.h"
#undef NO_SHLWAPI_REG
#include <string.h>
#include "cabinet.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(cabinet);
/***********************************************************************
* DllGetVersion (CABINET.2)
*
* Retrieves version information of the 'CABINET.DLL'
*
* PARAMS
* pdvi [O] pointer to version information structure.
*
* RETURNS
* Success: S_OK
* Failure: E_INVALIDARG
*
* NOTES
* Supposedly returns version from IE6SP1RP1
*/
HRESULT WINAPI CABINET_DllGetVersion (DLLVERSIONINFO *pdvi)
{
WARN("hmmm... not right version number \"5.1.1106.1\"?\n");
if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) return E_INVALIDARG;
pdvi->dwMajorVersion = 5;
pdvi->dwMinorVersion = 1;
pdvi->dwBuildNumber = 1106;
pdvi->dwPlatformID = 1;
return S_OK;
}
/***********************************************************************
* Extract (CABINET.3)
*
* Apparently an undocumented function, presumably to extract a CAB file
* to somewhere...
*
* PARAMS
* unknown [IO] unknown pointer
* what [I] char* describing what to uncompress, I guess.
*
* RETURNS
* Success: S_OK
* Failure: E_OUTOFMEMORY (?)
*/
HRESULT WINAPI Extract(DWORD unknown, LPCSTR what)
{
LPCSTR whatx;
LPSTR dir, dirx, lastoption, x;
BOOL updatelastoption;
TRACE("(unknown == %0lx, what == %s)\n", unknown, debugstr_a(what));
dir = LocalAlloc(LPTR, strlen(what));
if (!dir) return E_OUTOFMEMORY;
/* copy the filename up to the last pathsep to construct the dirname */
whatx = what;
dirx = dir;
lastoption = NULL;
while (*whatx) {
if ((*whatx == '\\') || (*whatx == '/')) {
/* unless all chars between *dirx and lastoption are pathsep's, we
remember our location in dir as lastoption */
if (lastoption) {
updatelastoption = FALSE;
for (x = lastoption; x < dirx; x++)
if ((*dirx != '\\') && (*dirx != '/')) {
updatelastoption = TRUE;
break;
}
if (updatelastoption) lastoption = dirx;
} else
lastoption = dirx;
}
*dirx++ = *whatx++;
}
if (!lastoption) {
/* FIXME: I guess use the cwd or something? */
assert(FALSE);
} else {
*lastoption = '\0';
}
TRACE("extracting to dir: %s\n", debugstr_a(dir));
/* FIXME: what to do on failure? */
if (!process_cabinet(what, dir, FALSE, FALSE))
return E_OUTOFMEMORY;
LocalFree(dir);
return S_OK;
}
......@@ -43,7 +43,8 @@ HFDI __cdecl FDICreate(
int cpuType,
PERF perf)
{
FIXME("(%p, %p, %p, %p, %p, %p, %p, %d, %p): stub\n",
FIXME("(pfnalloc == ^%p, pfnfree == ^%p, pfnopen == ^%p, pfnread == ^%p, pfnwrite == ^%p, \
pfnclose == ^%p, pfnseek == ^%p, cpuType == %d, perf == ^%p): stub\n",
pfnalloc, pfnfree, pfnopen, pfnread, pfnwrite, pfnclose, pfnseek,
cpuType, perf);
......@@ -52,7 +53,6 @@ HFDI __cdecl FDICreate(
perf->fError = TRUE;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return NULL;
}
......@@ -65,10 +65,9 @@ BOOL __cdecl FDIIsCabinet(
INT_PTR hf,
PFDICABINETINFO pfdici)
{
FIXME("(%p, %d, %p): stub\n", hfdi, hf, pfdici);
FIXME("(hfdi == ^%p, hf == ^%d, pfdici == ^%p): stub\n", hfdi, hf, pfdici);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
......@@ -84,11 +83,11 @@ BOOL __cdecl FDICopy(
PFNFDIDECRYPT pfnfdid,
void *pvUser)
{
FIXME("(%p, %p, %p, %d, %p, %p, %p): stub\n",
FIXME("(hfdi == ^%p, pszCabinet == ^%p, pszCabPath == ^%p, flags == %0d, \
pfnfdin == ^%p, pfnfdid == ^%p, pvUser == ^%p): stub\n",
hfdi, pszCabinet, pszCabPath, flags, pfnfdin, pfnfdid, pvUser);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
......@@ -97,10 +96,9 @@ BOOL __cdecl FDICopy(
*/
BOOL __cdecl FDIDestroy(HFDI hfdi)
{
FIXME("(%p): stub\n", hfdi);
FIXME("(hfdi == ^%p): stub\n", hfdi);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
......@@ -112,7 +110,8 @@ BOOL __cdecl FDITruncateCabinet(
char *pszCabinetName,
USHORT iFolderToDelete)
{
FIXME("(%p, %p, %hu): stub\n", hfdi, pszCabinetName, iFolderToDelete);
FIXME("(hfdi == ^%p, pszCabinetName == %s, iFolderToDelete == %hu): stub\n",
hfdi, debugstr_a(pszCabinetName), iFolderToDelete);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
......
......@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = urlmon.dll
IMPORTS = ole32 wininet user32 kernel32
IMPORTS = cabinet ole32 wininet user32 kernel32
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......
......@@ -972,31 +972,3 @@ void WINAPI ReleaseBindInfo(BINDINFO* pbindinfo)
{
FIXME("stub\n");
}
/***********************************************************************
* Extract (URLMON.@)
*
*/
HRESULT WINAPI Extract(DWORD Param1, LPCSTR Param2)
{
/*
* This is a TOTAL hack to make use of the external cabextract
* utility. This will need to be replaces with actual cab processing
* before the 'day is done'
*/
char cmd[MAX_PATH];
char unixname[MAX_PATH];
char targetpath[MAX_PATH];
FIXME(" STUB: %lx %s\n", Param1, Param2);
wine_get_unix_file_name(Param2,unixname,MAX_PATH);
strcpy(targetpath,unixname);
*strrchr(targetpath,'/')=0;
sprintf(cmd,"cabextract -q -d %s %s",targetpath,unixname);
system(cmd);
return S_OK;
}
......@@ -26,7 +26,7 @@
@ stdcall DllRegisterServer() URLMON_DllRegisterServer
@ stdcall DllRegisterServerEx() URLMON_DllRegisterServerEx
@ stdcall DllUnregisterServer() URLMON_DllUnregisterServer
@ stdcall Extract(long str) Extract
@ forward Extract cabinet.Extract
@ stub FaultInIEFeature
@ stub FindMediaType
@ stub FindMediaTypeClass
......
......@@ -93,6 +93,9 @@
# to 0 if a message box has to be presented before running the debugger
"Auto"="1"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Hotfix\Q246009]
"Installed"="1"
#
# This identifies the files for available code pages
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment