Dmitry Timoshkov wrote:
"Johan Dahlin" jdahlin@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