cmd: use dockerfile to generate win event messages

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
Kevin Alvarez
2025-06-26 15:46:41 +02:00
committed by CrazyMax
parent 0ea20c9f72
commit 44623fb856
4 changed files with 61 additions and 8 deletions

View File

@@ -1,8 +0,0 @@
## Generate `event_messages.bin`
```console
$ docker run --rm -it -v "$(pwd):/winresources" debian:bookworm-slim bash
root@9ad2260f6ebc:/# apt-get update -y && apt-get install -y binutils-mingw-w64-x86-64
root@9ad2260f6ebc:/# x86_64-w64-mingw32-windmc -v /winresources/event_messages.mc
root@9ad2260f6ebc:/# mv MSG00001.bin /winresources/event_messages.bin
```

View File

@@ -0,0 +1,19 @@
# syntax=docker/dockerfile:1
ARG DEBIAN_VERSION=bookworm
ARG XX_VERSION=1.6.1
# xx is a helper for cross-compilation
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
FROM --platform=$BUILDPLATFORM debian:${DEBIAN_VERSION}-slim AS build
COPY --link --from=xx / /
ARG TARGETPLATFORM
RUN apt-get update && xx-apt-get --no-install-recommends install -y binutils
WORKDIR /out
RUN --mount=type=bind,target=/winresources \
x86_64-w64-mingw32-windmc -v /winresources/event_messages.mc \
&& mv MSG00001.bin event_messages.bin
FROM scratch
COPY --from=build /out /

View File

@@ -0,0 +1,33 @@
/* Do not edit this file manually.
This file is autogenerated by windmc. */
//
// The values are 32 bit layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Code - is the facility's status code
//
// Sev - is the severity code
//
// Success - 00
// Informational - 01
// Warning - 02
// Error - 03
//
// Facility - is the facility code
//
// System - 00ff
// Application - 0fff
//

View File

@@ -0,0 +1,9 @@
/* Do not edit this file manually.
This file is autogenerated by windmc. */
// Country: United States
// Language: English
#pragma code_page(1252)
LANGUAGE 0x9, 0x1
1 MESSAGETABLE "MSG00001.bin"