diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | makemsi.c (renamed from fake-msi.c) | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am index a113320..1e25726 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -7,7 +7,7 @@ lib_LTLIBRARIES = libwinterop.so.la libmsi.so.la libpreload.la | |||
7 | libwinterop_so_la_SOURCES = fake-winterop.c makecab.c memory.c \ | 7 | libwinterop_so_la_SOURCES = fake-winterop.c makecab.c memory.c \ |
8 | memory.h dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h | 8 | memory.h dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h |
9 | 9 | ||
10 | libmsi_so_la_SOURCES = fake-msi.c md5.c memory.c memory.h version.c \ | 10 | libmsi_so_la_SOURCES = makemsi.c md5.c memory.c memory.h version.c \ |
11 | dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h | 11 | dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h |
12 | 12 | ||
13 | libpreload_la_SOURCES = preload.c | 13 | libpreload_la_SOURCES = preload.c |
@@ -1,15 +1,13 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | ||
4 | #include <stdint.h> | 3 | #include <stdint.h> |
5 | #include <stdbool.h> | ||
6 | #include <stdarg.h> | ||
7 | #include <string.h> | 4 | #include <string.h> |
5 | #include <limits.h> | ||
8 | #include <uchar.h> | 6 | #include <uchar.h> |
7 | |||
9 | #include <err.h> | 8 | #include <err.h> |
10 | 9 | ||
11 | #include <fcntl.h> | 10 | #include <fcntl.h> |
12 | #include <sys/mman.h> | ||
13 | #include <sys/types.h> | 11 | #include <sys/types.h> |
14 | #include <sys/stat.h> | 12 | #include <sys/stat.h> |
15 | #include <unistd.h> | 13 | #include <unistd.h> |
@@ -19,8 +17,18 @@ | |||
19 | #include "subproc.h" | 17 | #include "subproc.h" |
20 | #include "uchars.h" | 18 | #include "uchars.h" |
21 | 19 | ||
20 | /* | ||
21 | * The same routine MsiCloseHandle is used by our client to dispose of | ||
22 | * three kinds of structure that _we_ think of as completely different | ||
23 | * types. So we must ensure all three start with distinct magic number | ||
24 | * fields, so as to know what kind we're being asked to close. | ||
25 | */ | ||
22 | typedef struct MsiTypePrefix { | 26 | typedef struct MsiTypePrefix { |
23 | enum { MAIN, VIEW, RECORD } type; | 27 | enum { |
28 | MAIN = 0x2B7FB8B8, | ||
29 | VIEW = 0x1570B0E3, | ||
30 | RECORD = 0x62365065 | ||
31 | } type; | ||
24 | } MsiTypePrefix; | 32 | } MsiTypePrefix; |
25 | 33 | ||
26 | typedef struct MsiMainCtx { | 34 | typedef struct MsiMainCtx { |