diff --git a/GNUmakefile b/GNUmakefile index 673074e..a6805fe 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -190,6 +190,7 @@ help: @echo " -DNO_EXTENDED_PRODUCT_LIST Don't compile the detailed product list." @echo " -DNO_BASIC_PRODUCT_LIST Don't compile the basic product list." @echo " -DNO_STRICT_MODES Don't support enhanced emulator detection prevention." + @echo " -DNO_CLIENT_LIST Don't support maintaining a client list (CMIDs)." @echo " -DNO_VERBOSE_LOG Don't support verbose logging. Removes -v option." @echo " -DNO_LOG Don't add support for logging. Implies -DNO_VERBOSE_LOG -DNO_EXTENDED_PRODUCT_LIST and -DNO_BASIC_PRODUCT_LIST." @echo " -DNO_RANDOM_EPID Don't support random ePIDs." diff --git a/VisualStudio/msvcrt.lib b/VisualStudio/msvcrt.lib old mode 100755 new mode 100644 diff --git a/VisualStudio/msvcrt64.lib b/VisualStudio/msvcrt64.lib old mode 100755 new mode 100644 diff --git a/VisualStudio/vlmcs/vlmcs.vcxproj b/VisualStudio/vlmcs/vlmcs.vcxproj index 7c510f0..ae4ac7c 100644 --- a/VisualStudio/vlmcs/vlmcs.vcxproj +++ b/VisualStudio/vlmcs/vlmcs.vcxproj @@ -152,6 +152,7 @@ true true true + WinStartUp @@ -191,6 +192,7 @@ true true 5.02 + WinStartUp diff --git a/VisualStudio/vlmcsd.sln b/VisualStudio/vlmcsd.sln old mode 100755 new mode 100644 diff --git a/VisualStudio/vlmcsd/vlmcsd.vcxproj b/VisualStudio/vlmcsd/vlmcsd.vcxproj index 5cae674..3ce31bb 100755 --- a/VisualStudio/vlmcsd/vlmcsd.vcxproj +++ b/VisualStudio/vlmcsd/vlmcsd.vcxproj @@ -155,6 +155,7 @@ true UseLinkTimeCodeGeneration true + WinStartUp @@ -195,6 +196,7 @@ true true true + WinStartUp diff --git a/VisualStudio/vlmcsdmulti/vlmcsdmulti.vcxproj b/VisualStudio/vlmcsdmulti/vlmcsdmulti.vcxproj index 0e654ae..1e8febe 100755 --- a/VisualStudio/vlmcsdmulti/vlmcsdmulti.vcxproj +++ b/VisualStudio/vlmcsdmulti/vlmcsdmulti.vcxproj @@ -152,6 +152,7 @@ true true true + WinStartUp @@ -190,6 +191,7 @@ true true 5.02 + WinStartUp diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/floppy/floppy144.vfd b/floppy/floppy144.vfd index 81790e8..7d3c5ca 100644 Binary files a/floppy/floppy144.vfd and b/floppy/floppy144.vfd differ diff --git a/hotbird64-mass-build/make_dragonfly b/hotbird64-mass-build/make_dragonfly index 5ca86e1..91ba2c8 100755 --- a/hotbird64-mass-build/make_dragonfly +++ b/hotbird64-mass-build/make_dragonfly @@ -1,6 +1,6 @@ #!/usr/local/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) cd "$( dirname "$0" )" gmake -C .. clean diff --git a/hotbird64-mass-build/make_freebsd b/hotbird64-mass-build/make_freebsd index 5aa0a01..d09af1a 100755 --- a/hotbird64-mass-build/make_freebsd +++ b/hotbird64-mass-build/make_freebsd @@ -1,6 +1,6 @@ #!/usr/local/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export DNS_PARSER=OS diff --git a/hotbird64-mass-build/make_hurd b/hotbird64-mass-build/make_hurd index 2dc9165..b80910c 100755 --- a/hotbird64-mass-build/make_hurd +++ b/hotbird64-mass-build/make_hurd @@ -1,6 +1,6 @@ #!/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export DNS_PARSER=OS diff --git a/hotbird64-mass-build/make_kfreebsd b/hotbird64-mass-build/make_kfreebsd index ebef262..413a32a 100755 --- a/hotbird64-mass-build/make_kfreebsd +++ b/hotbird64-mass-build/make_kfreebsd @@ -1,6 +1,6 @@ #!/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export DNS_PARSER=OS diff --git a/hotbird64-mass-build/make_linux b/hotbird64-mass-build/make_linux index 65be5a8..5fd9494 100755 --- a/hotbird64-mass-build/make_linux +++ b/hotbird64-mass-build/make_linux @@ -2,7 +2,7 @@ cd "$( dirname "$0" )" -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export DNS_PARSER=internal @@ -400,7 +400,7 @@ fi export CLIENT_NAME=../binaries/Linux/ppc/big-endian/glibc/vlmcs-ppc-glibc export PROGRAM_NAME=../binaries/Linux/ppc/big-endian/glibc/vlmcsd-ppc-glibc export MULTI_NAME=../binaries/Linux/ppc/big-endian/glibc/vlmcsdmulti-ppc-glibc -export CC=~/openwrt/staging_dir/toolchain-powerpc_405_gcc-4.8-linaro_eglibc-2.19/bin/powerpc-openwrt-linux-gcc +export CC=/opt/toolchains/ppc-openwrt-eglibc-2.19-gcc-4.8/bin/powerpc-openwrt-linux-gcc export CFLAGS="$SMALLCC" export PLATFORMFLAGS="-flto=16 -fwhole-program --sysroot=/opt/simplebuild/toolchains/powerpc -L/opt/simplebuild/toolchains/powerpc/lib -L/opt/simplebuild/toolchains/powerpc/usr/lib" export LDFLAGS="$SMALLLD" @@ -484,6 +484,60 @@ fi +# armv7 glibc 2.22 gcc 5.3 OpenWRT toolchain + +export CC=/opt/toolchains/armelv7-OpenWRT-BCM47xx_53xx-gcc-5.3.0-glibc-2.22/bin/arm-openwrt-linux-gcc +export CLIENT_NAME=../binaries/Linux/arm/little-endian/glibc/vlmcs-armelv7-bcm47xx_53xx-openwrt-glibc +export PROGRAM_NAME=../binaries/Linux/arm/little-endian/glibc/vlmcsd-armelv7-bcm47xx_53xx-openwrt-glibc +export MULTI_NAME=../binaries/Linux/arm/little-endian/glibc/vlmcsdmulti-armelv7-bcm47xx_53xx-openwrt-glibc +export CFLAGS="$SMALLCC" +export PLATFORMFLAGS="-flto=16 -fwhole-program -march=armv7-a -mthumb -mtune=cortex-a9" +export LDFLAGS="$SMALLLD -static-libgcc" +export THREADS=0 +export DNS_PARSER=internal + +make $MAKEFLAGS allmulti + +if [ $? != 0 ]; then + echo Error creating $MULTI_NAME, $CLIENT_NAME and/or $PROGRAM_NAME + exit $? +fi + + + + +# armv7 glibc 2.22 gcc 5.3 OpenWRT toolchain + +export CC=/opt/toolchains/armelv7-OpenWRT-BCM47xx_53xx-gcc-5.3.0-musl-1.14/bin/arm-openwrt-linux-gcc +export CLIENT_NAME=../binaries/Linux/arm/little-endian/musl/vlmcs-armelv7-bcm47xx_53xx-openwrt-musl +export PROGRAM_NAME=../binaries/Linux/arm/little-endian/musl/vlmcsd-armelv7-bcm47xx_53xx-openwrt-musl +export MULTI_NAME=../binaries/Linux/arm/little-endian/musl/vlmcsdmulti-armelv7-bcm47xx_53xx-openwrt-musl +export CFLAGS="$SMALLCC" +export PLATFORMFLAGS="-flto=16 -fwhole-program -march=armv7-a -mthumb -mtune=cortex-a9" +export LDFLAGS="$SMALLLD -static-libgcc" +export THREADS=0 + +make DNS_PARSER=OS $MAKEFLAGS allmulti + +if [ $? != 0 ]; then + echo Error creating $MULTI_NAME, $CLIENT_NAME and/or $PROGRAM_NAME + exit $? +fi + +export CLIENT_NAME=../binaries/Linux/arm/little-endian/static/vlmcs-armelv7-bcm47xx_53xx-openwrt-musl-static +export PROGRAM_NAME=../binaries/Linux/arm/little-endian/static/vlmcsd-armelv7-bcm47xx_53xx-openwrt-musl-static +export MULTI_NAME=../binaries/Linux/arm/little-endian/static/vlmcsdmulti-armelv7-bcm47xx_53xx-openwrt-musl-static +export LDFLAGS="$SMALLLD -static" + +make DNS_PARSER=OS $REUSEOBJFLAGS allmulti + +if [ $? != 0 ]; then + echo Error creating $MULTI_NAME, $CLIENT_NAME and/or $PROGRAM_NAME + exit $? +fi + + + #Android gcc 4.8 with API Level 3 (Android 1.5 cupcake) armv7 @@ -1233,7 +1287,7 @@ fi export MULTI_NAME=../binaries/Linux/intel/glibc/vlmcsdmulti-x86-glibc export CLIENT_NAME=../binaries/Linux/intel/glibc/vlmcs-x86-glibc export PROGRAM_NAME=../binaries/Linux/intel/glibc/vlmcsd-x86-glibc -export CC=~/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_eglibc-2.19/bin/i486-openwrt-linux-gcc +export CC=/opt/toolchains/toolchain-i386_i486_gcc-4.8-linaro_eglibc-2.19/bin/i486-openwrt-linux-gcc export CFLAGS="$SMALLCC" export PLATFORMFLAGS="-flto=16 -fwhole-program -m32 -march=i686 -mtune=generic" export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu" @@ -1252,7 +1306,7 @@ fi # Linux x86 glibc minimum standalone version export PROGRAM_NAME=../binaries/Linux/intel/glibc/vlmcsd-x86-glibc-minimum -export CC=~/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_eglibc-2.19/bin/i486-openwrt-linux-gcc +export CC=/opt/toolchains/toolchain-i386_i486_gcc-4.8-linaro_eglibc-2.19/bin/i486-openwrt-linux-gcc export CFLAGS="$SMALLCC" export PLATFORMFLAGS="-flto=16 -fwhole-program -m32 -march=i686 -mtune=generic" export LDFLAGS="$SMALLLD -Wl,--hash-style=gnu" @@ -1503,7 +1557,7 @@ fi export PROGRAM_NAME=../binaries/Linux/arm/little-endian/glibc/vlmcsd-armv4el-openwrt-glibc export CLIENT_NAME=../binaries/Linux/arm/little-endian/glibc/vlmcs-armv4el-openwrt-glibc export MULTI_NAME=../binaries/Linux/arm/little-endian/glibc/vlmcsdmulti-armv4el-openwrt-glibc -export CC=~/openwrt/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_eglibc-2.19_eabi/bin/arm-openwrt-linux-gcc +export CC=/opt/toolchains/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_eglibc-2.19_eabi/bin/arm-openwrt-linux-gcc export PLATFORMFLAGS="-flto=16 -fwhole-program -march=armv4" export FEATURES=full export CFLAGS="$SMALLCC" @@ -1528,7 +1582,7 @@ SUFFIX=-armv7el-openwrt-glibc export PROGRAM_NAME=${INSTALLDIR}vlmcsd${SUFFIX} export CLIENT_NAME=${INSTALLDIR}vlmcs${SUFFIX} export MULTI_NAME=${INSTALLDIR}vlmcsdmulti${SUFFIX} -export CC=~/openwrt/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_eglibc-2.19_eabi/bin/arm-openwrt-linux-gcc +export CC=/opt/toolchains/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_eglibc-2.19_eabi/bin/arm-openwrt-linux-gcc export PLATFORMFLAGS="-flto=16 -fwhole-program -march=armv7 -mthumb" export FEATURES=full export CFLAGS="$SMALLCC" @@ -1656,7 +1710,7 @@ SUFFIX=-armv4el-openwrt-uclibc export PROGRAM_NAME=${INSTALLDIR}vlmcsd${SUFFIX} export CLIENT_NAME=${INSTALLDIR}vlmcs${SUFFIX} export MULTI_NAME=${INSTALLDIR}vlmcsdmulti${SUFFIX} -export CC=~/openwrt/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-gcc +export CC=/opt/toolchains/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-gcc export PLATFORMFLAGS="-flto=16 -fwhole-program -march=armv4 -marm" export FEATURES=full export CFLAGS="$SMALLCC" @@ -1712,7 +1766,7 @@ SUFFIX=-armv7el-openwrt-uclibc export PROGRAM_NAME=${INSTALLDIR}vlmcsd${SUFFIX} export CLIENT_NAME=${INSTALLDIR}vlmcs${SUFFIX} export MULTI_NAME=${INSTALLDIR}vlmcsdmulti${SUFFIX} -export CC=~/openwrt/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-gcc +export CC=/opt/toolchains/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-gcc export PLATFORMFLAGS="-flto=16 -fwhole-program -march=armv7 -mthumb" export FEATURES=full export CFLAGS="$SMALLCC" diff --git a/hotbird64-mass-build/make_minix b/hotbird64-mass-build/make_minix index c376a8b..dc31a0e 100755 --- a/hotbird64-mass-build/make_minix +++ b/hotbird64-mass-build/make_minix @@ -2,9 +2,7 @@ cd ~/vlmcsd/hotbird64-mass-build -export VLMCSD_VERSION=svn$(ssh root@ubuntu64.internal "cd x; svnversion") -scp -p make_minix root@ubuntu64.internal:x/hotbird64-mass-build -scp -pr root@ubuntu64.internal:x/* .. +export VLMCSD_VERSION=$(git describe) BINDIR="bin" cd .. diff --git a/hotbird64-mass-build/make_multilib_linux b/hotbird64-mass-build/make_multilib_linux index 3259b18..bdeb828 100755 --- a/hotbird64-mass-build/make_multilib_linux +++ b/hotbird64-mass-build/make_multilib_linux @@ -1,6 +1,6 @@ #!/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) SMALLCC="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants" SMALLLD="-pipe -Wl,--hash-style=sysv -Wl,-z,norelro -Wl,--build-id=none" SMALL="$SMALLCC $SMALLLD" diff --git a/hotbird64-mass-build/make_netbsd b/hotbird64-mass-build/make_netbsd index 0584bfe..47b83c1 100755 --- a/hotbird64-mass-build/make_netbsd +++ b/hotbird64-mass-build/make_netbsd @@ -1,6 +1,6 @@ #!/usr/pkg/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export DNS_PARSER=OS diff --git a/hotbird64-mass-build/make_openbsd b/hotbird64-mass-build/make_openbsd index bef512f..6143389 100755 --- a/hotbird64-mass-build/make_openbsd +++ b/hotbird64-mass-build/make_openbsd @@ -1,6 +1,6 @@ #!/usr/local/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export DNS_PARSER=OS diff --git a/hotbird64-mass-build/make_osx b/hotbird64-mass-build/make_osx index 360dc24..53cb13e 100755 --- a/hotbird64-mass-build/make_osx +++ b/hotbird64-mass-build/make_osx @@ -1,6 +1,6 @@ #!/bin/bash -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export DNS_PARSER=OS diff --git a/hotbird64-mass-build/make_solaris b/hotbird64-mass-build/make_solaris index bb4c246..76c1185 100755 --- a/hotbird64-mass-build/make_solaris +++ b/hotbird64-mass-build/make_solaris @@ -1,6 +1,6 @@ #!/bin/sh -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) export VERBOSE=3 export CAT=2 diff --git a/hotbird64-mass-build/make_windows b/hotbird64-mass-build/make_windows index 8e33d90..84f4c77 100755 --- a/hotbird64-mass-build/make_windows +++ b/hotbird64-mass-build/make_windows @@ -2,7 +2,7 @@ cd "$( dirname "$0" )" -export VLMCSD_VERSION="svn`svnversion`" +export VLMCSD_VERSION=$(git describe) msbuild='/cygdrive/c/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe' version="$VLMCSD_VERSION, built $(date -u '+%Y-%m-%d %H:%M:%S') UTC" diff --git a/lib/.gitignore b/lib/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/lib/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/man/vlmcs.1.html b/man/vlmcs.1.html index 192db3f..e489064 100644 --- a/man/vlmcs.1.html +++ b/man/vlmcs.1.html @@ -1,5 +1,5 @@ - + diff --git a/man/vlmcs.1.pdf b/man/vlmcs.1.pdf index 97b8f13..f8eaf61 100644 Binary files a/man/vlmcs.1.pdf and b/man/vlmcs.1.pdf differ diff --git a/man/vlmcsd-floppy.7.html b/man/vlmcsd-floppy.7.html index 40d1f3e..bf6661e 100644 --- a/man/vlmcsd-floppy.7.html +++ b/man/vlmcsd-floppy.7.html @@ -1,5 +1,5 @@ - + diff --git a/man/vlmcsd-floppy.7.pdf b/man/vlmcsd-floppy.7.pdf index 9680faf..30e2e50 100644 Binary files a/man/vlmcsd-floppy.7.pdf and b/man/vlmcsd-floppy.7.pdf differ diff --git a/man/vlmcsd.7.html b/man/vlmcsd.7.html index 46eac18..0cabbaa 100644 --- a/man/vlmcsd.7.html +++ b/man/vlmcsd.7.html @@ -1,5 +1,5 @@ - + diff --git a/man/vlmcsd.7.pdf b/man/vlmcsd.7.pdf index 520cafd..b02989d 100644 Binary files a/man/vlmcsd.7.pdf and b/man/vlmcsd.7.pdf differ diff --git a/man/vlmcsd.8.html b/man/vlmcsd.8.html index a5b40bb..6163ddf 100644 --- a/man/vlmcsd.8.html +++ b/man/vlmcsd.8.html @@ -1,5 +1,5 @@ - + diff --git a/man/vlmcsd.8.pdf b/man/vlmcsd.8.pdf index 93b2aaf..c6fe99e 100644 Binary files a/man/vlmcsd.8.pdf and b/man/vlmcsd.8.pdf differ diff --git a/man/vlmcsd.ini.5.html b/man/vlmcsd.ini.5.html index 15c7407..1f6e216 100644 --- a/man/vlmcsd.ini.5.html +++ b/man/vlmcsd.ini.5.html @@ -1,5 +1,5 @@ - + diff --git a/man/vlmcsd.ini.5.pdf b/man/vlmcsd.ini.5.pdf index 0ac20f4..416bb3b 100644 Binary files a/man/vlmcsd.ini.5.pdf and b/man/vlmcsd.ini.5.pdf differ diff --git a/man/vlmcsdmulti.1.html b/man/vlmcsdmulti.1.html index 28697ce..f703f3c 100644 --- a/man/vlmcsdmulti.1.html +++ b/man/vlmcsdmulti.1.html @@ -1,5 +1,5 @@ - + diff --git a/man/vlmcsdmulti.1.pdf b/man/vlmcsdmulti.1.pdf index 5bcd0e0..ff2a372 100644 Binary files a/man/vlmcsdmulti.1.pdf and b/man/vlmcsdmulti.1.pdf differ diff --git a/src/GNUmakefile b/src/GNUmakefile index dc9bc49..5b414e6 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -62,7 +62,7 @@ DNS_PARSER ?= OS # You should supply your own version string here -VLMCSD_VERSION ?= $(shell test -d ../.svn && echo svn`svnversion`) +VLMCSD_VERSION ?= $(shell test -d ../.git && git describe) FEATURES ?= full VERBOSE ?= NO diff --git a/src/kms.c b/src/kms.c index 44224b8..008d169 100644 --- a/src/kms.c +++ b/src/kms.c @@ -3,6 +3,10 @@ #endif // CONFIG #include CONFIG +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif diff --git a/src/vlmcs.c b/src/vlmcs.c index 963a02a..ba66fce 100644 --- a/src/vlmcs.c +++ b/src/vlmcs.c @@ -1432,4 +1432,26 @@ static void CreateRequestBase(REQUEST *Request) # endif // NO_VERBOSE_LOG } +#if _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY +int __stdcall WinStartUp(void) +{ + WCHAR **szArgList; + int argc; + szArgList = CommandLineToArgvW(GetCommandLineW(), &argc); + + int i; + char **argv = (char**)vlmcsd_malloc(sizeof(char*)*argc); + + for (i = 0; i < argc; i++) + { + int size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL); + argv[i] = (char*)vlmcsd_malloc(size); + WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], size, NULL, NULL); + } + + exit(client_main(argc, argv)); +} +#endif // _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY + + #endif // IS_LIBRARY diff --git a/src/vlmcsd.c b/src/vlmcsd.c index 4032dab..1f1f290 100644 --- a/src/vlmcsd.c +++ b/src/vlmcsd.c @@ -1867,3 +1867,25 @@ int newmain() return rc; } + + +#if _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY +int __stdcall WinStartUp(void) +{ + WCHAR **szArgList; + int argc; + szArgList = CommandLineToArgvW(GetCommandLineW(), &argc); + + int i; + char **argv = (char**)vlmcsd_malloc(sizeof(char*)*argc); + + for (i = 0; i < argc; i++) + { + int size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL); + argv[i] = (char*)vlmcsd_malloc(size); + WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], size, NULL, NULL); + } + + exit(server_main(argc, argv)); +} +#endif // _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY diff --git a/src/vlmcsdmulti.c b/src/vlmcsdmulti.c index 9b26f18..8f02373 100644 --- a/src/vlmcsdmulti.c +++ b/src/vlmcsdmulti.c @@ -97,3 +97,25 @@ int main(int argc, CARGV argv) return VLMCSD_EINVAL; } + + +#if _MSC_VER && !defined(_DEBUG) +int __stdcall WinStartUp(void) +{ + WCHAR **szArgList; + int argc; + szArgList = CommandLineToArgvW(GetCommandLineW(), &argc); + + int i; + char **argv = (char**)vlmcsd_malloc(sizeof(char*)*argc); + + for (i = 0; i < argc; i++) + { + int size = WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], 0, NULL, NULL); + argv[i] = (char*)vlmcsd_malloc(size); + WideCharToMultiByte(CP_UTF8, 0, szArgList[i], -1, argv[i], size, NULL, NULL); + } + + exit(main(argc, argv)); +} +#endif // _MSC_VER && !defined(_DEBUG)&& !MULTI_CALL_BINARY