Skip to content

Commit 974a390

Browse files
committed
Windows: remove dependency towards Mount/Format when building setup to fix Win32 build issue (#1487)
MainCom_i.c and FormatCom_i.c are needed only for mount/format type libraries GUIDs. Since they don't change, we just define them directly.
1 parent a2f11e1 commit 974a390

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/Setup/ComSetup.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
#include "ComSetup.h"
2424
#include "Dlgcode.h"
2525
#include "Resource.h"
26-
#include "../Mount/MainCom_i.c"
27-
#include "../Format/FormatCom_i.c"
26+
27+
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
28+
EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
29+
30+
// Define GUIDs of "VeraCrypt.exe and" "VeraCrypt Format.exe" type libraries
31+
MIDL_DEFINE_GUID(GUID, LIBID_TrueCryptMainCom, 0x9ACF6176, 0x5FC4, 0x4690, 0xA0, 0x25, 0xB3, 0x30, 0x6A, 0x50, 0xEB, 0x6A);
32+
MIDL_DEFINE_GUID(GUID, LIBID_TrueCryptFormatCom, 0x56327DDA, 0xF1A7, 0x4e13, 0xB1, 0x28, 0x52, 0x0D, 0x12, 0x9B, 0xDE, 0xF6);
2833

2934

3035
extern "C" BOOL RegisterComServers (wchar_t *modulePath)

src/SetupDLL/ComSetup.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
#include "ComSetup.h"
2424
#include "Dlgcode.h"
2525
#include "Resource.h"
26-
#include "../Mount/MainCom_i.c"
27-
#include "../Format/FormatCom_i.c"
26+
27+
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
28+
EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
29+
30+
// Define GUIDs of "VeraCrypt.exe and" "VeraCrypt Format.exe" type libraries
31+
MIDL_DEFINE_GUID(GUID, LIBID_TrueCryptMainCom, 0x9ACF6176, 0x5FC4, 0x4690, 0xA0, 0x25, 0xB3, 0x30, 0x6A, 0x50, 0xEB, 0x6A);
32+
MIDL_DEFINE_GUID(GUID, LIBID_TrueCryptFormatCom, 0x56327DDA, 0xF1A7, 0x4e13, 0xB1, 0x28, 0x52, 0x0D, 0x12, 0x9B, 0xDE, 0xF6);
2833

2934
/*
3035
* Same as RegisterComServers() in Setup project, but

0 commit comments

Comments
 (0)