[ros-dev] CommConfigDialog() and serialui.dll

Saveliy Tretiakov saveliyt at mail.ru
Sat Apr 9 16:42:51 CEST 2005


Ok, thank you.
These patches correct return values.

Thomas Weidenmueller wrote:

> Saveliy Tretiakov wrote:
>
>> Maybe this is because you pressed cancel button and 
>> ERROR_CALL_NOT_IMPLEMENTED
>> was set somewhere else? It returns FALSE when cancel button is pressed.
>
>
> no, in my copy of win XP calling drvCommConfigDialogA always returns 
> ERROR_CALL_NOT_IMPLEMENTED. Calling the unicode version works, it 
> returns FALSE/0/ERROR_SUCCESS or ERROR_CANCELLED when correct 
> parameters are passed to it.
>
>> From CommConfig dialog description:
>> If the function succeeds, the return value is nonzero.
>> If the function fails, the return value is zero. To get extended 
>> error information, call *GetLastError*.
>
>
> I'm talking about drvCommConfigDialog, not CommConfig. However 
> CommConfig calls drvCommConfigDialog, which appears to return 
> ERROR_SUCCESS, ERROR_CANCELLED or another win32 error code, which is 
> not a BOOL.
>
>> I think drvCommConfigDialog should return the same.
>
>
> As i mentioned above, it appears to return a win32 error code, not a 
> BOOL in windows XP, which leads to the conclusion that 
> drvCommConfigDialog doesn't have the exact same prototype as CommConfig.
>
>> Maybe adding SetLastError(ERROR_CANCELLED) and 
>> SetLastError(ERROR_SUCCESS) will solve the problem?
>
>
> I propose only CommConfig should set the last error, if 
> drvCommConfigDialog didn't return ERROR_SUCCESS or ERROR_CANCELLED. 
> Then returning TRUE from CommConfig when drvCommConfigDialog returned 
> ERROR_SUCCESS and returning FALSE in all other cases should implement 
> it correctly. Instead of setting the last error code in 
> drvCommConfigDialog, the function should return it directly.
>
> Best Regards,
> Thomas
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.com
> http://reactos.com:8080/mailman/listinfo/ros-dev
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: code2.zip
Type: application/zip
Size: 1848 bytes
Desc: not available
Url : http://reactos.com:8080/pipermail/ros-dev/attachments/20050409/197ebf22/code2.zip


More information about the Ros-dev mailing list