From 2c59936fee254cfae4c646fccb3a6cc3f3c92f27 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 9 Feb 2006 17:48:12 +0100 Subject: [PATCH] regsvr32: Call OleInitialize before registering a DLL. --- programs/regsvr32/Makefile.in | 2 +- programs/regsvr32/regsvr32.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/programs/regsvr32/Makefile.in b/programs/regsvr32/Makefile.in index 472916b90c6..916e2dfa553 100644 --- a/programs/regsvr32/Makefile.in +++ b/programs/regsvr32/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = regsvr32.exe APPMODE = -mconsole -IMPORTS = kernel32 +IMPORTS = ole32 kernel32 C_SRCS = \ regsvr32.c diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c index 866c285e30a..d284fb7f378 100644 --- a/programs/regsvr32/regsvr32.c +++ b/programs/regsvr32/regsvr32.c @@ -53,6 +53,7 @@ #include #include #include +#include typedef HRESULT (*DLLREGISTER) (void); typedef HRESULT (*DLLUNREGISTER) (void); @@ -184,6 +185,7 @@ int main(int argc, char* argv[]) WCHAR* wsCommandLine = NULL; WCHAR EmptyLine[1] = {0}; + OleInitialize(NULL); /* Strictly, the Microsoft version processes all the flags before * the files (e.g. regsvr32 file1 /s file2 is silent even for file1. @@ -278,5 +280,7 @@ int main(int argc, char* argv[]) return -1; } + OleUninitialize(); + return 0; }