diff options
Diffstat (limited to '')
-rw-r--r-- | makemsi.c (renamed from fake-msi.c) | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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 { |