From 4ae6586df57ca04d17774b7bf9b2c83922b0e0e9 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 31 Jul 2008 08:51:02 -0700 Subject: [PATCH] Implement MsiSIPIsMyTypeOfFile --- dlls/msisip/Makefile.in | 2 +- dlls/msisip/main.c | 34 ++++++++++++++++++++++++++++++++++ dlls/msisip/msisip.spec | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/dlls/msisip/Makefile.in b/dlls/msisip/Makefile.in index 4baaafb..59c8158 100644 --- a/dlls/msisip/Makefile.in +++ b/dlls/msisip/Makefile.in @@ -4,7 +4,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = msisip.dll -IMPORTS = crypt32 kernel32 +IMPORTS = crypt32 ole32 kernel32 C_SRCS = \ main.c diff --git a/dlls/msisip/main.c b/dlls/msisip/main.c index 04ba033..e47c297 100644 --- a/dlls/msisip/main.c +++ b/dlls/msisip/main.c @@ -22,6 +22,8 @@ #include "windef.h" #include "winbase.h" #include "wincrypt.h" #include "mssip.h" +#define COBJMACROS +#include "objbase.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msisip); @@ -93,3 +95,35 @@ HRESULT WINAPI DllUnregisterServer(void) CryptSIPRemoveProvider(&mySubject); return S_OK; } + +/*********************************************************************** + * MsiSIPIsMyTypeOfFile (MSISIP.@) + */ +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; + + TRACE("(%s, %p)\n", debugstr_w(name), subject); + + if (lstrlenW(name) < lstrlenW(msi)) + return FALSE; + else if (lstrcmpiW(name + lstrlenW(name) - lstrlenW(msi), msi) && + lstrcmpiW(name + lstrlenW(name) - lstrlenW(msp), msp)) + return FALSE; + else + { + IStorage *stg = NULL; + HRESULT r = StgOpenStorage(name, NULL, + STGM_DIRECT|STGM_READ|STGM_SHARE_DENY_WRITE, NULL, 0, &stg); + + if (SUCCEEDED(r)) + { + IStorage_Release(stg); + *subject = mySubject; + ret = TRUE; + } + } + return ret; +} diff --git a/dlls/msisip/msisip.spec b/dlls/msisip/msisip.spec index cfe1799..1e1f444 100644 --- a/dlls/msisip/msisip.spec +++ b/dlls/msisip/msisip.spec @@ -1,4 +1,4 @@ -5 stub MsiSIPIsMyTypeOfFile +5 stdcall MsiSIPIsMyTypeOfFile(wstr ptr) 6 stub MsiSIPGetSignedDataMsg 7 stub MsiSIPPutSignedDataMsg 8 stub MsiSIPRemoveSignedDataMsg -- 1.4.1