[ros-dev] [ros-diffs] [cfinck] 68080: [LOCALSPL_APITEST] Write an API-Test for localspl.dll. As the original localspl.dll from Windows Server 2003 relies on proper initialization inside spoolsv.exe, we cannot test it st...

Thomas Faber thomas.faber at reactos.org
Sun Jun 14 16:57:33 UTC 2015


This looks great, but I hope you're aware of the limitations of DllMain.
If the test gets more complex, it might be better to do a separate
CreateRemoteThread call on an exported function after the dll has been
loaded.
Although I guess as long as things work, this is fine ;)

(maybe this is related to the SEH issue you mention in the next commit,
 not sure)

On 2015-06-08 19:15, cfinck at svn.reactos.org wrote:
> [LOCALSPL_APITEST]
> Write an API-Test for localspl.dll. As the original localspl.dll from Windows Server 2003 relies on proper initialization inside spoolsv.exe, we cannot test it standalone as usual.

> +// Running the tests from the injected DLL and redirecting their output to the pipe.
> +BOOL WINAPI
> +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
> +{
> +    char szTestName[150];
> +    DWORD cbRead;
> +    FILE* fpStdout;
> +    HANDLE hCommandPipe;
> +    int iOldStdout;
> +
> +    // We only want to run our test once when the DLL is injected to the process.
> +    if (fdwReason != DLL_PROCESS_ATTACH)
> +        return TRUE;




More information about the Ros-dev mailing list