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
ef4560e5
Commit
ef4560e5
authored
Nov 24, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Nov 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msisip: Determine whether a file is an MSI file based on its CLSID rather than its extension.
parent
50e2f2f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
main.c
dlls/msisip/main.c
+20
-14
No files found.
dlls/msisip/main.c
View file @
ef4560e5
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "mssip.h"
#include "mssip.h"
#define COBJMACROS
#define COBJMACROS
#include "objbase.h"
#include "objbase.h"
#include "initguid.h"
#include "wine/debug.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msisip
);
WINE_DEFAULT_DEBUG_CHANNEL
(
msisip
);
...
@@ -217,34 +218,39 @@ end:
...
@@ -217,34 +218,39 @@ end:
return
ret
;
return
ret
;
}
}
DEFINE_GUID
(
CLSID_MsiTransform
,
0x000c1082
,
0x0000
,
0x0000
,
0xc0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
);
DEFINE_GUID
(
CLSID_MsiDatabase
,
0x000c1084
,
0x0000
,
0x0000
,
0xc0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
);
DEFINE_GUID
(
CLSID_MsiPatch
,
0x000c1086
,
0x0000
,
0x0000
,
0xc0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
);
/***********************************************************************
/***********************************************************************
* MsiSIPIsMyTypeOfFile (MSISIP.@)
* MsiSIPIsMyTypeOfFile (MSISIP.@)
*/
*/
BOOL
WINAPI
MsiSIPIsMyTypeOfFile
(
WCHAR
*
name
,
GUID
*
subject
)
BOOL
WINAPI
MsiSIPIsMyTypeOfFile
(
WCHAR
*
name
,
GUID
*
subject
)
{
{
static
const
WCHAR
msi
[]
=
{
'.'
,
'm'
,
's'
,
'i'
,
0
};
static
const
WCHAR
msp
[]
=
{
'.'
,
'm'
,
's'
,
'p'
,
0
};
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
IStorage
*
stg
=
NULL
;
HRESULT
r
;
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
name
),
subject
);
TRACE
(
"(%s, %p)
\n
"
,
debugstr_w
(
name
),
subject
);
if
(
lstrlenW
(
name
)
<
lstrlenW
(
msi
))
r
=
StgOpenStorage
(
name
,
NULL
,
STGM_DIRECT
|
STGM_READ
|
STGM_SHARE_DENY_WRITE
,
return
FALSE
;
NULL
,
0
,
&
stg
);
else
if
(
lstrcmpiW
(
name
+
lstrlenW
(
name
)
-
lstrlenW
(
msi
),
msi
)
&&
if
(
SUCCEEDED
(
r
))
lstrcmpiW
(
name
+
lstrlenW
(
name
)
-
lstrlenW
(
msp
),
msp
))
return
FALSE
;
else
{
{
IStorage
*
stg
=
NULL
;
STATSTG
stat
;
HRESULT
r
=
StgOpenStorage
(
name
,
NULL
,
STGM_DIRECT
|
STGM_READ
|
STGM_SHARE_DENY_WRITE
,
NULL
,
0
,
&
stg
);
r
=
IStorage_Stat
(
stg
,
&
stat
,
STATFLAG_NONAME
);
if
(
SUCCEEDED
(
r
))
if
(
SUCCEEDED
(
r
))
{
{
IStorage_Release
(
stg
);
if
(
IsEqualGUID
(
&
stat
.
clsid
,
&
CLSID_MsiDatabase
)
||
*
subject
=
mySubject
;
IsEqualGUID
(
&
stat
.
clsid
,
&
CLSID_MsiPatch
)
||
ret
=
TRUE
;
IsEqualGUID
(
&
stat
.
clsid
,
&
CLSID_MsiTransform
))
{
ret
=
TRUE
;
*
subject
=
mySubject
;
}
}
}
IStorage_Release
(
stg
);
}
}
return
ret
;
return
ret
;
}
}
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