[2/4] qmgr: Add infrastructure for background file transferring. [take 4]

Alexandre Julliard julliard at winehq.org
Thu Mar 13 05:31:21 CDT 2008


Dan Hipschman <dsh at linux.ucla.edu> writes:

> @@ -129,6 +131,21 @@ ServiceMain(DWORD dwArgc, LPWSTR *lpszArgv)
>          return;
>      }
>  
> +    globalMgr.jobEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
> +    if (!globalMgr.jobEvent) {
> +        ERR("Couldn't create event: error %d\n", GetLastError());
> +        UpdateStatus(SERVICE_STOPPED, NO_ERROR, 0);
> +        return;
> +    }
> +
> +    fileTxThread = CreateThread(NULL, 0, fileTransfer, NULL, 0, &threadId);
> +    if (!fileTxThread)
> +    {
> +        ERR("Failed starting file transfer thread\n");
> +        UpdateStatus(SERVICE_STOPPED, NO_ERROR, 0);
> +        return;
> +    }
> +
>      UpdateStatus(SERVICE_RUNNING, NO_ERROR, 0);

You also need to shutdown the thread properly when the service
terminates.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list