regsvr32: Call OleInitialize before registering a DLL.
This commit is contained in:
parent
e0eef69a21
commit
2c59936fee
|
@ -4,7 +4,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = regsvr32.exe
|
||||
APPMODE = -mconsole
|
||||
IMPORTS = kernel32
|
||||
IMPORTS = ole32 kernel32
|
||||
|
||||
C_SRCS = \
|
||||
regsvr32.c
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <ole2.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue