winapi - GetAddressByName and Windows 7 -
i've taken on maintenance of windows service written many years ago. first task service running on windows 7. windbg shows service erroring out on call getaddressbyname. (getaddressbyname returns 0 , service shuts down.)
according msdn (https://msdn.microsoft.com/en-us/library/windows/desktop/ms738517%28v=vs.85%29.aspx), getaddressbyname not available use winsock v. 2.
does above mean getaddressbyname not work windows 7? (does winsock 1.x work on windows 7?) (any recommendations function use instead of getaddressbyname? )
i'm looking see if else has done before.
alternatively (getaddressbyname supported on win 7), suggestions debugging call getaddressbyname that's returning 0?
best regards, mitch
getaddressbyname()
legacy function winsock 1.x. removed in winsock 2.0. apps using winsock 2.x should use getaddrinfo()
, if not gethostbyname()
(which still available).
in case, documentation getaddressbyname()
says:
if function succeeds, the return value number of csaddr_info data structures written buffer pointed lpcsaddrbuffer.
if function fails, return value socket_error( –1). extended error information, call getlasterror
since getaddressbyname()
returning 0, succeeding no addresses being returned. make sure service code handling fact , not trying access invalid buffer data.
Comments
Post a Comment