[ros-diffs] [cwittich] 45979: [ITSS] sync itss to wine 1.1.40

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Mar 7 10:32:58 CET 2010


Author: cwittich
Date: Sun Mar  7 10:32:58 2010
New Revision: 45979

URL: http://svn.reactos.org/svn/reactos?rev=45979&view=rev
Log:
[ITSS]
sync itss to wine 1.1.40

Modified:
    trunk/reactos/dll/win32/itss/chm_lib.c
    trunk/reactos/dll/win32/itss/chm_lib.h
    trunk/reactos/dll/win32/itss/itss.inf
    trunk/reactos/dll/win32/itss/storage.c

Modified: trunk/reactos/dll/win32/itss/chm_lib.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/chm_lib.c?rev=45979&r1=45978&r2=45979&view=diff
==============================================================================
--- trunk/reactos/dll/win32/itss/chm_lib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/itss/chm_lib.c [iso-8859-1] Sun Mar  7 10:32:58 2010
@@ -829,6 +829,38 @@
     return newHandle;
 }
 
+/* Duplicate an ITS archive handle */
+struct chmFile *chm_dup(struct chmFile *oldHandle)
+{
+    struct chmFile *newHandle=NULL;
+
+    newHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(struct chmFile));
+    memcpy(newHandle, oldHandle, sizeof(struct chmFile));
+
+    /* duplicate fd handle */
+    DuplicateHandle(GetCurrentProcess(), oldHandle->fd,
+                    GetCurrentProcess(), &(newHandle->fd),
+                    0, FALSE, DUPLICATE_SAME_ACCESS);
+    newHandle->lzx_state = NULL;
+    newHandle->cache_blocks = NULL;
+    newHandle->cache_block_indices = NULL;
+    newHandle->cache_num_blocks = 0;
+
+    /* initialize mutexes, if needed */
+    InitializeCriticalSection(&newHandle->mutex);
+    newHandle->mutex.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": chmFile.mutex");
+    InitializeCriticalSection(&newHandle->lzx_mutex);
+    newHandle->lzx_mutex.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": chmFile.lzx_mutex");
+    InitializeCriticalSection(&newHandle->cache_mutex);
+    newHandle->cache_mutex.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": chmFile.cache_mutex");
+
+    /* initialize cache */
+    chm_set_param(newHandle, CHM_PARAM_MAX_BLOCKS_CACHED,
+                  CHM_MAX_BLOCKS_CACHED);
+
+    return newHandle;
+}
+
 /* close an ITS archive */
 void chm_close(struct chmFile *h)
 {

Modified: trunk/reactos/dll/win32/itss/chm_lib.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/chm_lib.h?rev=45979&r1=45978&r2=45979&view=diff
==============================================================================
--- trunk/reactos/dll/win32/itss/chm_lib.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/itss/chm_lib.h [iso-8859-1] Sun Mar  7 10:32:58 2010
@@ -73,6 +73,7 @@
 };
 
 struct chmFile* chm_openW(const WCHAR *filename);
+struct chmFile *chm_dup(struct chmFile *oldHandle);
 
 /* close an ITS archive */
 void chm_close(struct chmFile *h);

Modified: trunk/reactos/dll/win32/itss/itss.inf
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itss.inf?rev=45979&r1=45978&r2=45979&view=diff
==============================================================================
--- trunk/reactos/dll/win32/itss/itss.inf [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/itss/itss.inf [iso-8859-1] Sun Mar  7 10:32:58 2010
@@ -16,7 +16,7 @@
 HKCR,"CLSID\%CLSID_ITStorage%",,,"Microsoft InfoTech IStorage System"
 HKCR,"CLSID\%CLSID_ITStorage%\InProcServer32",,,"itss.dll"
 HKCR,"CLSID\%CLSID_ITStorage%\InProcServer32","ThreadingModel",,"Both"
-HKCR,"CLSID\%CLSID_ITStorage%\NotInsertable",,,""
+HKCR,"CLSID\%CLSID_ITStorage%\NotInsertable",,16
 HKCR,"CLSID\%CLSID_ITStorage%\ProgID",,,"MSITFS1.0"
 HKCR,"CLSID\%CLSID_ITStorage%\VersionIndependentProgID",,,"MSITFS"
 
@@ -28,7 +28,7 @@
 HKCR,"CLSID\%CLSID_MSITStore%",,,"Microsoft InfoTech Protocol for IE 3.0"
 HKCR,"CLSID\%CLSID_MSITStore%\InProcServer32",,,"itss.dll"
 HKCR,"CLSID\%CLSID_MSITStore%\InProcServer32","ThreadingModel",,"Both"
-HKCR,"CLSID\%CLSID_MSITStore%\NotInsertable",,,""
+HKCR,"CLSID\%CLSID_MSITStore%\NotInsertable",,16
 HKCR,"CLSID\%CLSID_MSITStore%\ProgID",,,"MSITFS1.0"
 HKCR,"CLSID\%CLSID_MSITStore%\VersionIndependentProgID",,,"MSITFS"
 
@@ -41,9 +41,9 @@
 HKCR,"CLSID\%CLSID_ITSProtocol%",,,"Microsoft InfoTech Protocol for IE 4.0"
 HKCR,"CLSID\%CLSID_ITSProtocol%\InProcServer32",,,"itss.dll"
 HKCR,"CLSID\%CLSID_ITSProtocol%\InProcServer32","ThreadingModel",,"Both"
-HKCR,"CLSID\%CLSID_ITSProtocol%\NotInsertable",,,""
+HKCR,"CLSID\%CLSID_ITSProtocol%\NotInsertable",,16
 HKCR,"CLSID\%CLSID_ITSProtocol%\ProgID",,,"MSITFS1.0"
-HKCR,"CLSID\%CLSID_ITSProtocol%%\VersionIndependentProgID",,,"MSITFS"
+HKCR,"CLSID\%CLSID_ITSProtocol%\VersionIndependentProgID",,,"MSITFS"
 
 HKCR,"ITSProtocol","Microsoft InfoTech Protocols for IE 4.0"
 HKCR,"ITSProtocol\CLSID",,,"%CLSID_ITSProtocol%"
@@ -54,7 +54,7 @@
 HKCR,"CLSID\%CLSID_MSFSStore%",,,"Microsoft InfoTech IStorage for Win32 Files"
 HKCR,"CLSID\%CLSID_MSFSStore%\InProcServer32",,,"itss.dll"
 HKCR,"CLSID\%CLSID_MSFSStore%\InProcServer32","ThreadingModel",,"Both"
-HKCR,"CLSID\%CLSID_MSFSStore%\NotInsertable",,,""
+HKCR,"CLSID\%CLSID_MSFSStore%\NotInsertable",,16
 HKCR,"CLSID\%CLSID_MSFSStore%\ProgID",,,"MSITFS1.0"
 HKCR,"CLSID\%CLSID_MSFSStore%\VersionIndependentProgID",,,"MSITFS"
 

Modified: trunk/reactos/dll/win32/itss/storage.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/storage.c?rev=45979&r1=45978&r2=45979&view=diff
==============================================================================
--- trunk/reactos/dll/win32/itss/storage.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/itss/storage.c [iso-8859-1] Sun Mar  7 10:32:58 2010
@@ -391,10 +391,43 @@
     IStorage** ppstg)
 {
     ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface;
-
-    FIXME("%p %s %p %u %p %u %p\n", This, debugstr_w(pwcsName),
+    static const WCHAR szRoot[] = { '/', 0 };
+    struct chmFile *chmfile;
+    WCHAR *path, *p;
+    DWORD len;
+
+    TRACE("%p %s %p %u %p %u %p\n", This, debugstr_w(pwcsName),
           pstgPriority, grfMode, snbExclude, reserved, ppstg);
-    return E_NOTIMPL;
+
+    chmfile = chm_dup( This->chmfile );
+    if( !chmfile )
+        return E_FAIL;
+
+    len = strlenW( This->dir ) + strlenW( pwcsName ) + 1;
+    path = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+    strcpyW( path, This->dir );
+
+    if( pwcsName[0] == '/' || pwcsName[0] == '\\' )
+    {
+        p = &path[strlenW( path ) - 1];
+        while( ( path <= p ) && ( *p == '/' ) )
+            *p-- = 0;
+    }
+    strcatW( path, pwcsName );
+
+    for(p=path; *p; p++) {
+        if(*p == '\\')
+            *p = '/';
+    }
+
+    if(*--p == '/')
+        *p = 0;
+
+    strcatW( path, szRoot );
+
+    TRACE("Resolving %s\n", debugstr_w(path));
+
+    return ITSS_create_chm_storage(chmfile, path, ppstg);
 }
 
 static HRESULT WINAPI ITSS_IStorageImpl_CopyTo(




More information about the Ros-diffs mailing list