aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-18 08:26:44 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-18 08:27:29 +0100
commita568db73a69a934c09ad5c95f5a218fb6b869298 (patch)
tree301b9b7c78e132bad0955c8c9cb9ccc49999abae
parent7ca5ab5ef2eb8bb0f65aedf11eb74ad2ada78a19 (diff)
downloadwix-on-linux-a568db73a69a934c09ad5c95f5a218fb6b869298.tar.gz
wix-on-linux-a568db73a69a934c09ad5c95f5a218fb6b869298.tar.bz2
wix-on-linux-a568db73a69a934c09ad5c95f5a218fb6b869298.zip
Rename fake-msi.c to makemsi.c.
It's now a sensible source flie containing a set of routines that do something coherently connected to each other, so it doesn't deserve that 'fake-' prefix that I used for the previous monolithic files full of tangled-together stuff. While I'm here, I've also made up nicer (i.e. more distinguishable) random magic numbers for the structure-type disambiguation.
-rw-r--r--Makefile.am2
-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
7libwinterop_so_la_SOURCES = fake-winterop.c makecab.c memory.c \ 7libwinterop_so_la_SOURCES = fake-winterop.c makecab.c memory.c \
8memory.h dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h 8memory.h dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h
9 9
10libmsi_so_la_SOURCES = fake-msi.c md5.c memory.c memory.h version.c \ 10libmsi_so_la_SOURCES = makemsi.c md5.c memory.c memory.h version.c \
11dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h 11dupstr.c dupstr.h subproc.c subproc.h uchars.c uchars.h
12 12
13libpreload_la_SOURCES = preload.c 13libpreload_la_SOURCES = preload.c
diff --git a/fake-msi.c b/makemsi.c
index 7bdcdc6..8b78448 100644
--- a/fake-msi.c
+++ b/makemsi.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 */
22typedef struct MsiTypePrefix { 26typedef 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
26typedef struct MsiMainCtx { 34typedef struct MsiMainCtx {