diff --git a/reactos/dll/win32/itss/CMakeLists.txt b/reactos/dll/win32/itss/CMakeLists.txt index ad719e6e7f6..eb5ca6a20a0 100644 --- a/reactos/dll/win32/itss/CMakeLists.txt +++ b/reactos/dll/win32/itss/CMakeLists.txt @@ -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) diff --git a/reactos/dll/win32/itss/chm_lib.c b/reactos/dll/win32/itss/chm_lib.c index 22ba6e8a6a8..1c14442e6b6 100644 --- a/reactos/dll/win32/itss/chm_lib.c +++ b/reactos/dll/win32/itss/chm_lib.c @@ -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, diff --git a/reactos/dll/win32/itss/itss.c b/reactos/dll/win32/itss/itss.c index de76cdc2171..49658ef189f 100644 --- a/reactos/dll/win32/itss/itss.c +++ b/reactos/dll/win32/itss/itss.c @@ -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; } diff --git a/reactos/dll/win32/itss/moniker.c b/reactos/dll/win32/itss/moniker.c index f45e9385df1..a9e33d33de5 100644 --- a/reactos/dll/win32/itss/moniker.c +++ b/reactos/dll/win32/itss/moniker.c @@ -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; } diff --git a/reactos/dll/win32/itss/protocol.c b/reactos/dll/win32/itss/protocol.c index dca3858c457..6426b4c727e 100644 --- a/reactos/dll/win32/itss/protocol.c +++ b/reactos/dll/win32/itss/protocol.c @@ -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; diff --git a/reactos/dll/win32/itss/storage.c b/reactos/dll/win32/itss/storage.c index be72428a4dd..08aeeb0d24c 100644 --- a/reactos/dll/win32/itss/storage.c +++ b/reactos/dll/win32/itss/storage.c @@ -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; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 3ea1ceaf909..985c1b7a3f7 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -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