HMODULE ret = LoadLibrary(dll);\r
if (! ret) {\r
*error = GetLastError();\r
- log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_LOADLIBRARY_FAILED, dll, error_string(*error), 0);\r
+ if (*error != ERROR_PROC_NOT_FOUND) log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_LOADLIBRARY_FAILED, dll, error_string(*error), 0);\r
}\r
\r
return ret;\r
FARPROC ret = GetProcAddress(library, function);\r
if (! ret) {\r
*error = GetLastError();\r
- TCHAR *function_name;\r
+ if (*error != ERROR_PROC_NOT_FOUND) {\r
+ TCHAR *function_name;\r
#ifdef UNICODE\r
- size_t buflen;\r
- mbstowcs_s(&buflen, NULL, 0, function, _TRUNCATE);\r
- function_name = (TCHAR *) HeapAlloc(GetProcessHeap(), 0, buflen * sizeof(TCHAR));\r
- if (function_name) mbstowcs_s(&buflen, function_name, buflen * sizeof(TCHAR), function, _TRUNCATE);\r
+ size_t buflen;\r
+ mbstowcs_s(&buflen, NULL, 0, function, _TRUNCATE);\r
+ function_name = (TCHAR *) HeapAlloc(GetProcessHeap(), 0, buflen * sizeof(TCHAR));\r
+ if (function_name) mbstowcs_s(&buflen, function_name, buflen * sizeof(TCHAR), function, _TRUNCATE);\r
#else\r
- function_name = (TCHAR *) function;\r
+ function_name = (TCHAR *) function;\r
#endif\r
- if (*error != ERROR_PROC_NOT_FOUND) log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_GETPROCADDRESS_FAILED, function_name, error_string(*error), 0);\r
+ log_event(EVENTLOG_WARNING_TYPE, NSSM_EVENT_GETPROCADDRESS_FAILED, function_name, error_string(*error), 0);\r
#ifdef UNICODE\r
- if (function_name) HeapFree(GetProcessHeap(), 0, function_name);\r
+ if (function_name) HeapFree(GetProcessHeap(), 0, function_name);\r
#endif\r
+ }\r
}\r
\r
return ret;\r