Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6627b902
Commit
6627b902
authored
Feb 07, 2010
by
Erich Hoover
Committed by
Alexandre Julliard
Feb 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
itss: Implement IStorageImpl_OpenStorage.
parent
796c4dec
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
2 deletions
+67
-2
chm_lib.c
dlls/itss/chm_lib.c
+32
-0
chm_lib.h
dlls/itss/chm_lib.h
+1
-0
storage.c
dlls/itss/storage.c
+34
-2
No files found.
dlls/itss/chm_lib.c
View file @
6627b902
...
...
@@ -829,6 +829,38 @@ struct chmFile *chm_openW(const WCHAR *filename)
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
)
{
...
...
dlls/itss/chm_lib.h
View file @
6627b902
...
...
@@ -73,6 +73,7 @@ struct chmUnitInfo
};
struct
chmFile
*
chm_openW
(
const
WCHAR
*
filename
);
struct
chmFile
*
chm_dup
(
struct
chmFile
*
oldHandle
);
/* close an ITS archive */
void
chm_close
(
struct
chmFile
*
h
);
...
...
dlls/itss/storage.c
View file @
6627b902
...
...
@@ -391,10 +391,42 @@ static HRESULT WINAPI ITSS_IStorageImpl_OpenStorage(
IStorage
**
ppstg
)
{
ITSS_IStorageImpl
*
This
=
(
ITSS_IStorageImpl
*
)
iface
;
static
const
WCHAR
szRoot
[]
=
{
'/'
,
0
};
struct
chmFile
*
chmfile
;
WCHAR
*
path
,
*
p
;
DWORD
len
;
FIXM
E
(
"%p %s %p %u %p %u %p
\n
"
,
This
,
debugstr_w
(
pwcsName
),
TRAC
E
(
"%p %s %p %u %p %u %p
\n
"
,
This
,
debugstr_w
(
pwcsName
),
pstgPriority
,
grfMode
,
snbExclude
,
reserved
,
ppstg
);
return
E_NOTIMPL
;
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
));
chmfile
=
chm_dup
(
This
->
chmfile
);
if
(
!
chmfile
)
return
E_FAIL
;
return
ITSS_create_chm_storage
(
chmfile
,
path
,
ppstg
);
}
static
HRESULT
WINAPI
ITSS_IStorageImpl_CopyTo
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment