Commit 60e0b44c authored by Ghislain MARY's avatar Ghislain MARY

Fix OutputDebugString in unicode on Windows Phone.

parent 890e2306
......@@ -67,7 +67,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
......@@ -90,7 +90,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
......@@ -117,7 +117,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;_DEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
......@@ -141,7 +141,7 @@
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_WIN32;_WINDLL;_USRDLL;NDEBUG;_CRT_SECURE_NO_WARNINGS;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
......
......@@ -50,7 +50,11 @@ BOOL WINAPI DllMain(
{
case DLL_PROCESS_ATTACH:
OutputDebugString("--> dll_entry.c - oRTP.dll - DLL_PROCESS_ATTACH()\n");
#ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - DLL_PROCESS_ATTACH()\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - DLL_PROCESS_ATTACH()\n");
#endif
wVersionRequested = MAKEWORD( 1, 0 );
......@@ -92,7 +96,11 @@ BOOL WINAPI DllMain(
if (fInit)
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Initializing module\n");
#ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Initializing module\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Initializing module\n");
#endif
#ifdef WINAPI_FAMILY_PHONE_APP
lpSharedData->m_ullStartTime = GetTickCount64();
......@@ -107,7 +115,11 @@ BOOL WINAPI DllMain(
}
else
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Binding\n");
#ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Binding\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Binding\n");
#endif
lpSharedData->m_nReference++;
}
break;
......@@ -135,13 +147,21 @@ BOOL WINAPI DllMain(
case DLL_PROCESS_DETACH:
if (lpSharedData != NULL)
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Binding\n");
{
#ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Binding\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Binding\n");
#endif
lpSharedData->m_nReference--;
if (lpSharedData->m_nReference == 0)
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Detaching\n");
#ifndef _UNICODE
OutputDebugStringA("--> dll_entry.c - oRTP.dll - Detaching\n");
#else
OutputDebugStringW(L"--> dll_entry.c - oRTP.dll - Detaching\n");
#endif
ortp_exit();
UnregisterLog(&dwoRTPLogLevel, "LOG_ORTP");
......
......@@ -152,8 +152,19 @@ static void __ortp_logv_out(OrtpLogLevel lev, const char *fmt, va_list args){
}
msg=ortp_strdup_vprintf(fmt,args);
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
OutputDebugString(msg);
OutputDebugString("\r\n");
#ifndef _UNICODE
OutputDebugStringA(msg);
OutputDebugStringA("\r\n");
#else
{
int len=strlen(msg);
wchar_t *tmp=(wchar_t*)ortp_malloc0((len+1)*sizeof(wchar_t));
mbstowcs(tmp,msg,len);
OutputDebugStringW(tmp);
OutputDebugStringW(L"\r\n");
ortp_free(tmp);
}
#endif
#endif
fprintf(__log_file,"ortp-%s-%s" ENDLINE,lname,msg);
fflush(__log_file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment