Merge DDE patch from Wine:

Dmitry Timoshkov <dmitry@codeweavers.com>
    Fix a bug in ShellExecute which called DdeCreateStringHandleW
    with a wrong parameter. Revert previous erroneous fix.

(Fixes return value of DdeQueryString[AW] and error codes)

svn path=/trunk/; revision=9573
This commit is contained in:
Filip Navara 2004-05-31 19:52:47 +00:00
parent 381799ee02
commit 48da820991

View file

@ -512,7 +512,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
if (WDML_InstanceList == NULL)
{
ret = DMLERR_DLL_USAGE;
ret = DMLERR_INVALIDPARAMETER;
goto theError;
}
HeapFree(GetProcessHeap(), 0, pInstance); /* finished - release heap space used as work store */
@ -533,11 +533,11 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
{
if ((reference_inst->CBFflags & CBF_FAIL_ALLSVRXACTIONS) != CBF_FAIL_ALLSVRXACTIONS)
{
/* i.e. Was set to Client-only and through APPCMD_CLIENTONLY */
/* i.e. Was set to Client-only and through APPCMD_CLIENTONLY */
if (!(afCmd & APPCMD_CLIENTONLY))
{
ret = DMLERR_DLL_USAGE;
ret = DMLERR_INVALIDPARAMETER;
goto theError;
}
}
@ -546,7 +546,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
if (pInstance->monitor != reference_inst->monitor)
{
ret = DMLERR_DLL_USAGE;
ret = DMLERR_INVALIDPARAMETER;
goto theError;
}
@ -554,7 +554,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
if ((afCmd&APPCMD_CLIENTONLY) && !reference_inst->clientOnly)
{
ret = DMLERR_DLL_USAGE;
ret = DMLERR_INVALIDPARAMETER;
goto theError;
}
break;
@ -563,10 +563,6 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
}
if (reference_inst->next == NULL)
{
/* Crazy situation - trying to re-initialize something that has not beeen initialized !!
*
* Manual does not say what we do, cannot return DMLERR_NOT_INITIALIZED so what ?
*/
ret = DMLERR_INVALIDPARAMETER;
goto theError;
}
@ -787,8 +783,6 @@ UINT WINAPI DdeGetLastError(DWORD idInst)
DWORD error_code;
WDML_INSTANCE* pInstance;
FIXME("(%ld): error reporting is weakly implemented\n", idInst);
EnterCriticalSection(&WDML_CritSect);
/* First check instance
@ -796,7 +790,7 @@ UINT WINAPI DdeGetLastError(DWORD idInst)
pInstance = WDML_GetInstance(idInst);
if (pInstance == NULL)
{
error_code = DMLERR_DLL_NOT_INITIALIZED;
error_code = DMLERR_INVALIDPARAMETER;
}
else
{
@ -997,6 +991,7 @@ static int WDML_QueryString(WDML_INSTANCE* pInstance, HSZ hsz, LPVOID ptr, DWORD
break;
case CP_WINUNICODE:
ret = GetAtomNameW(HSZ2ATOM(hsz), ptr, cchMax);
break;
default:
ERR("Unknown code page %d\n", codepage);
ret = 0;