wineboot: Basic RunOnceEx support

Johan Dahlin jdahlin at gmail.com
Thu Sep 4 05:17:28 CDT 2008


Dmitry Timoshkov wrote:
> "Johan Dahlin" <jdahlin at gmail.com> wrote:
> 
>> +typedef HRESULT (*DLLREGISTER)          (void);
>> +typedef HRESULT (*DLLINSTALL)           (BOOL,LPCWSTR);
> 
> Wrong calling convention.

I'm not sure I follow here. (This is all quite of new to me)
Are you telling me that I should add WINAPI after HRESULT?

>> +    hr = pfRegister();
>> +
>> +    if(DllHandle)
>> +        FreeLibrary(DllHandle);
> 
> 'if(DllHandle)' check above is redundant.

Will fix.

>> +
>> +    return hr;
>> +}
> 
> If you are returning an HRESULT then use an appropriate return type for
> the function.

I wanted to propagate the return value from the called function, but perhaps 
I should just refactor a bit and do the logging in there instead.

>> +static BOOL ProcessRunOnceExKey(HKEY hkRunEntry)
>> +{
[..]
> 
> Why not 'return' isntead of 'goto'?

To avoid duplicating a couple of HeapFree() calls.
Besides, I'm conforming to the style of the file, the same construct is used 
at other places in the same file.

> You are returning 'res' while using 'retval' in some code paths.

Well, they are used for different things. But sure, I'll try to avoid it and 
thus make it a bit clearer.

Johan



More information about the wine-devel mailing list