From 39ce4dd0889c8fd0b0f9c464a68d38435de348da Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 18 Feb 2010 10:26:39 +0000 Subject: Add header #include for print_wave_header() instead of a forward declaration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30636 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/dmo/DMO_AudioDecoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'loader') diff --git a/loader/dmo/DMO_AudioDecoder.c b/loader/dmo/DMO_AudioDecoder.c index 55a597b2d7..37a32f2923 100644 --- a/loader/dmo/DMO_AudioDecoder.c +++ b/loader/dmo/DMO_AudioDecoder.c @@ -29,9 +29,9 @@ struct DMO_AudioDecoder #include #include "mp_msg.h" +#include "libmpdemux/aviprint.h" typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**); -void print_wave_header(WAVEFORMATEX *h, int verbose_level); DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf,int out_channels) //DMO_AudioDecoder * DMO_AudioDecoder_Create(const CodecInfo * info, const WAVEFORMATEX* wf) -- cgit v1.2.3 From 2903a8583f568508236f74d522d2f3a6676e3479 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Feb 2010 20:20:23 +0000 Subject: Use snprintf to ensure we do not write outside the buffer bounds when recording stub names into export_names. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30638 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'loader') diff --git a/loader/win32.c b/loader/win32.c index 812815e699..8e314d5935 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -5516,7 +5516,7 @@ void* LookupExternal(const char* library, int ordinal) no_dll: if(pos>150)return 0; - sprintf(export_names[pos], "%s:%d", library, ordinal); + snprintf(export_names[pos], sizeof(export_names[pos]), "%s:%d", library, ordinal); return add_stub(); } @@ -5583,7 +5583,7 @@ void* LookupExternalByName(const char* library, const char* name) no_dll_byname: if(pos>150)return 0;// to many symbols - strcpy(export_names[pos], name); + snprintf(export_names[pos], sizeof(export_names[pos]), "%s", name); return add_stub(); } -- cgit v1.2.3 From 87edb382c68161f5f23bf2061a93bf684690e870 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Feb 2010 20:23:05 +0000 Subject: Add a GetModuleHandleW implementation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30639 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'loader') diff --git a/loader/win32.c b/loader/win32.c index 8e314d5935..100c1f3c89 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -596,6 +596,19 @@ static HMODULE WINAPI expGetModuleHandleA(const char* name) return result; } +static HMODULE WINAPI expGetModuleHandleW(const uint16_t* name) +{ + char aname[256]; + int pos = 0; + while (*name) { + if (*name > 256 || pos >= sizeof(aname) - 1) + return NULL; + aname[pos++] = *name++; + } + aname[pos] = 0; + return expGetModuleHandleA(aname); +} + static void* WINAPI expCreateThread(void* pSecAttr, long dwStackSize, void* lpStartAddress, void* lpParameter, long dwFlags, long* dwThreadId) @@ -5030,6 +5043,7 @@ struct exports exp_kernel32[]= FF(UnmapViewOfFile, -1) FF(Sleep, -1) FF(GetModuleHandleA, -1) + FF(GetModuleHandleW, -1) FF(GetProfileIntA, -1) FF(GetPrivateProfileIntA, -1) FF(GetPrivateProfileStringA, -1) -- cgit v1.2.3 From 134bbb8cd880698e08e13e1159c9c1cba6908ce4 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 18 Feb 2010 20:24:52 +0000 Subject: Add a InitializeCriticalSectionAndSpinCount function. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30640 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'loader') diff --git a/loader/win32.c b/loader/win32.c index 100c1f3c89..39c9d65b05 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -1348,6 +1348,11 @@ static void WINAPI expInitializeCriticalSection(CRITICAL_SECTION* c) return; } +static void WINAPI expInitializeCriticalSectionAndSpinCount(CRITICAL_SECTION* c, DWORD spin) +{ + expInitializeCriticalSection(c); +} + static void WINAPI expEnterCriticalSection(CRITICAL_SECTION* c) { #ifdef CRITSECS_NEWTYPE @@ -4984,6 +4989,7 @@ struct exports exp_kernel32[]= FF(VirtualAlloc, -1) FF(VirtualFree, -1) FF(InitializeCriticalSection, -1) + FF(InitializeCriticalSectionAndSpinCount, -1) FF(EnterCriticalSection, -1) FF(LeaveCriticalSection, -1) FF(DeleteCriticalSection, -1) -- cgit v1.2.3