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
7478f15f
Commit
7478f15f
authored
Dec 03, 2023
by
Fabian Maurer
Committed by
Alexandre Julliard
Dec 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coml2: Move StgIsStorageFile from ole32.
parent
eab7899e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
50 deletions
+43
-50
coml2.spec
dlls/coml2/coml2.spec
+1
-1
storage32.c
dlls/coml2/storage32.c
+42
-0
storage32.c
dlls/ole32/storage32.c
+0
-49
No files found.
dlls/coml2/coml2.spec
View file @
7478f15f
...
...
@@ -22,7 +22,7 @@
@ stub StgCreatePropSetStg
@ stub StgCreatePropStg
@ stub StgCreateStorageEx
@ st
ub StgIsStorageFile
@ st
dcall StgIsStorageFile(wstr)
@ stdcall StgIsStorageILockBytes(ptr)
@ stub StgOpenPropStg
@ stub StgOpenStorage
...
...
dlls/coml2/storage32.c
View file @
7478f15f
...
...
@@ -184,3 +184,45 @@ HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt)
return
S_FALSE
;
}
/******************************************************************************
* StgIsStorageFile [coml2.@]
*/
HRESULT
WINAPI
StgIsStorageFile
(
LPCOLESTR
fn
)
{
HANDLE
hf
;
BYTE
magic
[
8
];
DWORD
bytes_read
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
fn
));
hf
=
CreateFileW
(
fn
,
GENERIC_READ
,
FILE_SHARE_DELETE
|
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
0
);
if
(
hf
==
INVALID_HANDLE_VALUE
)
return
STG_E_FILENOTFOUND
;
if
(
!
ReadFile
(
hf
,
magic
,
8
,
&
bytes_read
,
NULL
))
{
WARN
(
" unable to read file
\n
"
);
CloseHandle
(
hf
);
return
S_FALSE
;
}
CloseHandle
(
hf
);
if
(
bytes_read
!=
8
)
{
TRACE
(
" too short
\n
"
);
return
S_FALSE
;
}
if
(
!
memcmp
(
magic
,
STORAGE_magic
,
8
))
{
TRACE
(
" -> YES
\n
"
);
return
S_OK
;
}
TRACE
(
" -> Invalid header.
\n
"
);
return
S_FALSE
;
}
dlls/ole32/storage32.c
View file @
7478f15f
...
...
@@ -9339,55 +9339,6 @@ end:
return
r
;
}
/******************************************************************************
* StgIsStorageFile [OLE32.@]
* Verify if the file contains a storage object
*
* PARAMS
* fn [ I] Filename
*
* RETURNS
* S_OK if file has magic bytes as a storage object
* S_FALSE if file is not storage
*/
HRESULT
WINAPI
StgIsStorageFile
(
LPCOLESTR
fn
)
{
HANDLE
hf
;
BYTE
magic
[
8
];
DWORD
bytes_read
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
fn
));
hf
=
CreateFileW
(
fn
,
GENERIC_READ
,
FILE_SHARE_DELETE
|
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
0
);
if
(
hf
==
INVALID_HANDLE_VALUE
)
return
STG_E_FILENOTFOUND
;
if
(
!
ReadFile
(
hf
,
magic
,
8
,
&
bytes_read
,
NULL
))
{
WARN
(
" unable to read file
\n
"
);
CloseHandle
(
hf
);
return
S_FALSE
;
}
CloseHandle
(
hf
);
if
(
bytes_read
!=
8
)
{
TRACE
(
" too short
\n
"
);
return
S_FALSE
;
}
if
(
!
memcmp
(
magic
,
STORAGE_magic
,
8
))
{
TRACE
(
" -> YES
\n
"
);
return
S_OK
;
}
TRACE
(
" -> Invalid header.
\n
"
);
return
S_FALSE
;
}
/************************************************************************
* OleConvert Functions
***********************************************************************/
...
...
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