* Sync with Wine 1.7.1.
CORE-7469

svn path=/trunk/; revision=60244
This commit is contained in:
Amine Khaldi 2013-09-20 10:53:58 +00:00
parent 2e5e8612dd
commit cd25e9d5e9
7 changed files with 67 additions and 37 deletions

View File

@ -11,30 +11,11 @@ list(APPEND SOURCE
moniker.c
protocol.c
storage.c
#${REACTOS_BINARY_DIR}/include/reactos/wine/itss_i.c
${CMAKE_CURRENT_BINARY_DIR}/itss_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/itss.def)
add_library(itss SHARED
${SOURCE}
rsrc.rc)
add_library(itss SHARED ${SOURCE} rsrc.rc)
set_module_type(itss win32dll)
target_link_libraries(itss uuid wine)
if(NOT MSVC)
# FIXME: http://www.cmake.org/Bug/view.php?id=12998
#allow_warnings(itss)
set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error")
endif()
add_importlibs(itss
urlmon
shlwapi
ole32
msvcrt
kernel32
ntdll)
add_dependencies(itss wineheaders)
add_importlibs(itss urlmon shlwapi ole32 msvcrt kernel32 ntdll)
add_cd_file(TARGET itss DESTINATION reactos/system32 FOR all)

View File

@ -835,7 +835,7 @@ struct chmFile *chm_dup(struct chmFile *oldHandle)
struct chmFile *newHandle=NULL;
newHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(struct chmFile));
memcpy(newHandle, oldHandle, sizeof(struct chmFile));
*newHandle = *oldHandle;
/* duplicate fd handle */
DuplicateHandle(GetCurrentProcess(), oldHandle->fd,

View File

@ -62,8 +62,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
DisableThreadLibraryCalls(hInstDLL);
hInst = hInstDLL;
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
@ -200,8 +198,8 @@ static HRESULT WINAPI ITStorageImpl_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IITStorage))
{
IClassFactory_AddRef(iface);
*ppvObject = This;
IITStorage_AddRef(iface);
*ppvObject = iface;
return S_OK;
}

View File

@ -69,8 +69,8 @@ static HRESULT WINAPI ITS_IMonikerImpl_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IParseDisplayName))
{
IClassFactory_AddRef(iface);
*ppvObject = This;
IMoniker_AddRef(iface);
*ppvObject = iface;
return S_OK;
}
@ -358,7 +358,7 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n )
DWORD sz;
/* szFile[1] has space for one character already */
sz = sizeof(ITS_IMonikerImpl) + strlenW( name )*sizeof(WCHAR);
sz = FIELD_OFFSET( ITS_IMonikerImpl, szFile[strlenW( name ) + 1] );
itsmon = HeapAlloc( GetProcessHeap(), 0, sz );
itsmon->IMoniker_iface.lpVtbl = &ITS_IMonikerImpl_Vtbl;
@ -399,8 +399,8 @@ static HRESULT WINAPI ITS_IParseDisplayNameImpl_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IParseDisplayName))
{
IClassFactory_AddRef(iface);
*ppvObject = This;
IParseDisplayName_AddRef(iface);
*ppvObject = iface;
return S_OK;
}

View File

@ -138,6 +138,55 @@ static LPCWSTR skip_schema(LPCWSTR url)
return NULL;
}
/* Adopted from urlmon */
static void remove_dot_segments(WCHAR *path) {
const WCHAR *in = path;
WCHAR *out = path;
while(1) {
/* Move the first path segment in the input buffer to the end of
* the output buffer, and any subsequent characters up to, including
* the next "/" character (if any) or the end of the input buffer.
*/
while(*in != '/') {
if(!(*out++ = *in++))
return;
}
*out++ = *in++;
while(*in) {
if(*in != '.')
break;
/* Handle ending "/." */
if(!in[1]) {
++in;
break;
}
/* Handle "/./" */
if(in[1] == '/') {
in += 2;
continue;
}
/* If we don't have "/../" or ending "/.." */
if(in[1] != '.' || (in[2] && in[2] != '/'))
break;
in += *in ? 3 : 2;
/* Find the slash preceding out pointer and move out pointer to it */
if(out > path+1 && *--out == '/')
--out;
while(out > path && *(--out) != '/');
if(*out == '/')
++out;
}
}
}
static HRESULT report_result(IInternetProtocolSink *sink, HRESULT hres)
{
IInternetProtocolSink_ReportResult(sink, hres, 0, NULL);
@ -219,6 +268,8 @@ static HRESULT WINAPI ITSProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
*p = '/';
}
remove_dot_segments(object_name);
TRACE("Resolving %s\n", debugstr_w(object_name));
memset(&chm_object, 0, sizeof(chm_object));
@ -422,7 +473,9 @@ static HRESULT WINAPI ITSProtocolInfo_CombineUrl(IInternetProtocolInfo *iface,
if(strchrW(pwzRelativeUrl, ':'))
return STG_E_INVALIDNAME;
if(pwzRelativeUrl[0] != '/') {
if(pwzRelativeUrl[0] == '#') {
base_end += strlenW(base_end);
}else if(pwzRelativeUrl[0] != '/') {
ptr = strrchrW(base_end, '/');
if(ptr)
base_end = ptr+1;

View File

@ -620,13 +620,11 @@ static HRESULT ITSS_create_chm_storage(
struct chmFile *chmfile, const WCHAR *dir, IStorage** ppstgOpen )
{
ITSS_IStorageImpl *stg;
DWORD len;
TRACE("%p %s\n", chmfile, debugstr_w( dir ) );
len = strlenW( dir ) + 1;
stg = HeapAlloc( GetProcessHeap(), 0,
sizeof (ITSS_IStorageImpl) + len*sizeof(WCHAR) );
stg = HeapAlloc( GetProcessHeap(), 0,
FIELD_OFFSET( ITSS_IStorageImpl, dir[strlenW( dir ) + 1] ));
stg->IStorage_iface.lpVtbl = &ITSS_IStorageImpl_Vtbl;
stg->ref = 1;
stg->chmfile = chmfile;

View File

@ -90,7 +90,7 @@ reactos/dll/win32/initpki # Synced to Wine-1.7.1
reactos/dll/win32/inseng # Synced to Wine-1.7.1
reactos/dll/win32/iphlpapi # Out of sync
reactos/dll/win32/itircl # Synced to Wine-1.7.1
reactos/dll/win32/itss # Synced to Wine-1.5.4
reactos/dll/win32/itss # Synced to Wine-1.7.1
reactos/dll/win32/jscript # Synced to Wine-1.5.26
reactos/dll/win32/loadperf # Synced to Wine-1.5.19
reactos/dll/win32/localspl # Synced to Wine-1.5.26