1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

Use get_main_config() to load correct log level from registry in stub DLLs.

This commit is contained in:
Daniel Collins 2012-12-01 14:34:14 +00:00
parent 8cf1f4eaa4
commit fab32bf974
4 changed files with 7 additions and 13 deletions

View File

@ -85,8 +85,8 @@ ipxwrapper.dll: $(IPXWRAPPER_DEPS)
ipxconfig.exe: src/ipxconfig.cpp icons/ipxconfig.o src/addr.o src/interface.o src/common.o src/config.o
$(CXX) $(CXXFLAGS) -static-libgcc -static-libstdc++ -D_WIN32_IE=0x0400 -mwindows -o ipxconfig.exe $^ -liphlpapi -lcomctl32 -lws2_32
dpwsockx.dll: src/directplay.o src/log.o src/dpwsockx_stubs.o src/common.o
$(CC) $(CFLAGS) -Wl,--enable-stdcall-fixup -shared -o dpwsockx.dll src/directplay.o src/log.o src/common.o src/dpwsockx_stubs.o src/dpwsockx.def -lwsock32
dpwsockx.dll: src/directplay.o src/log.o src/dpwsockx_stubs.o src/common.o src/config.o src/addr.o src/dpwsockx.def
$(CC) $(CFLAGS) -Wl,--enable-stdcall-fixup -shared -o $@ $^ -lwsock32
src/ipxwrapper_stubs.s: src/ipxwrapper_stubs.txt
perl mkstubs.pl src/ipxwrapper_stubs.txt src/ipxwrapper_stubs.s 0
@ -103,7 +103,7 @@ src/dpwsockx_stubs.s: src/dpwsockx_stubs.txt
icons/%.o: icons/%.rc icons/%.ico
windres $< -O coff -o $@
%.dll: src/stubdll.o src/%_stubs.o src/log.o src/common.o src/%.def
%.dll: src/stubdll.o src/%_stubs.o src/log.o src/common.o src/config.o src/addr.o src/%.def
$(CC) $(CFLAGS) -Wl,--enable-stdcall-fixup -shared -o $@ $^
src/%_stubs.o: src/%_stubs.s

View File

@ -582,11 +582,7 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) {
{
log_open("ipxwrapper.log");
HKEY reg = reg_open_main(false);
min_log_level = reg_get_dword(reg, "min_log_level", LOG_INFO);
reg_close(reg);
min_log_level = get_main_config().log_level;
}
else if(why == DLL_PROCESS_DETACH)
{

View File

@ -32,3 +32,4 @@ s_perror
sethostname
inet_addr
WSHEnumProtocols:0
ntohs:1

View File

@ -20,17 +20,14 @@
#include <stdlib.h>
#include "common.h"
#include "config.h"
BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) {
if(why == DLL_PROCESS_ATTACH)
{
log_open("ipxwrapper.log");
HKEY reg = reg_open_main(false);
min_log_level = reg_get_dword(reg, "min_log_level", LOG_INFO);
reg_close(reg);
min_log_level = get_main_config().log_level;
}
else if(why == DLL_PROCESS_DETACH)
{