mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:33:10 +00:00
fix some of the mess Lentin created here
-don't use TCHAR in ANSI functions -add a DllMain otherwise a random memory address is called when loading the dll -add DPRINT1 to all stubs svn path=/trunk/; revision=36305
This commit is contained in:
parent
d65eb0ae05
commit
e5131cbe38
1 changed files with 30 additions and 10 deletions
|
@ -21,21 +21,37 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <tchar.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
|
||||||
#define MAX_ERROR_TEXT_LEN 160
|
#define MAX_ERROR_TEXT_LEN 160
|
||||||
|
|
||||||
|
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
||||||
|
{
|
||||||
|
switch(fdwReason) {
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
DisableThreadLibraryCalls(hInstDLL);
|
||||||
|
break;
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
DWORD WINAPI
|
DWORD WINAPI
|
||||||
AMGetErrorTextA(HRESULT hr, LPTSTR buffer, DWORD maxlen)
|
AMGetErrorTextA(HRESULT hr, LPTSTR buffer, DWORD maxlen)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
static const TCHAR format[] = {'E','r','r','o','r',':',' ','0','x','%','l','x',0};
|
static const char format[] = "Error: 0x%lx";
|
||||||
TCHAR error[MAX_ERROR_TEXT_LEN];
|
char error[MAX_ERROR_TEXT_LEN];
|
||||||
|
|
||||||
|
DPRINT1("FIXME (%x,%p,%d) stub\n", hr, buffer, maxlen);
|
||||||
|
|
||||||
if (!buffer) return 0;
|
if (!buffer) return 0;
|
||||||
_stprintf(error, format, hr);
|
sprintf(error, format, hr);
|
||||||
if ((len = _tcslen(error)) >= maxlen) return 0;
|
if ((len = strlen(error)) >= maxlen) return 0;
|
||||||
_tcscpy(buffer, error);
|
strcpy(buffer, error);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +62,8 @@ AMGetErrorTextW(HRESULT hr, LPWSTR buffer, DWORD maxlen)
|
||||||
static const WCHAR format[] = {'E','r','r','o','r',':',' ','0','x','%','l','x',0};
|
static const WCHAR format[] = {'E','r','r','o','r',':',' ','0','x','%','l','x',0};
|
||||||
WCHAR error[MAX_ERROR_TEXT_LEN];
|
WCHAR error[MAX_ERROR_TEXT_LEN];
|
||||||
|
|
||||||
|
DPRINT1("FIXME (%x,%p,%d) stub\n", hr, buffer, maxlen);
|
||||||
|
|
||||||
if (!buffer) return 0;
|
if (!buffer) return 0;
|
||||||
swprintf(error, format, hr);
|
swprintf(error, format, hr);
|
||||||
if ((len = wcslen(error)) >= maxlen) return 0;
|
if ((len = wcslen(error)) >= maxlen) return 0;
|
||||||
|
@ -56,22 +74,24 @@ AMGetErrorTextW(HRESULT hr, LPWSTR buffer, DWORD maxlen)
|
||||||
LONG WINAPI
|
LONG WINAPI
|
||||||
AmpFactorToDB(LONG ampfactor)
|
AmpFactorToDB(LONG ampfactor)
|
||||||
{
|
{
|
||||||
|
DPRINT1("FIXME (%d) Stub!\n", ampfactor);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LONG WINAPI
|
LONG WINAPI
|
||||||
DBToAmpFactor(LONG db)
|
DBToAmpFactor(LONG db)
|
||||||
{
|
{
|
||||||
|
DPRINT1("FIXME (%d) Stub!\n", db);
|
||||||
/* Avoid divide by zero (probably during range computation) in Windows Media Player 6.4 */
|
/* Avoid divide by zero (probably during range computation) in Windows Media Player 6.4 */
|
||||||
if (db < -1000)
|
if (db < -1000)
|
||||||
return 0;
|
return 0;
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
DllCanUnloadNow(void)
|
DllCanUnloadNow(void)
|
||||||
{
|
{
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
|
@ -83,11 +103,11 @@ DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
DllRegisterServer(void)
|
DllRegisterServer(void)
|
||||||
{
|
{
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
DllUnregisterServer(void)
|
DllUnregisterServer(void)
|
||||||
{
|
{
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue