Home   Index   About
Ultimate Pack


Custom Search
WSALookupServiceNext

The Windows Sockets WSALookupServiceNext function is called after obtaining a handle from a previous call to WSALookupServiceBegin in order to retrieve the requested service information.

The provider will pass back a WSAQUERYSET structure in the lpqsResults buffer. The client should continue to call this function until it returns WSA_E_NOMORE, indicating that all of WSAQUERYSET has been returned.

INT WSALookupServiceNext (

HANDLE hLookup,

DWORD dwControlFlags,

LPDWORD lpdwBufferLength,

LPWSAQUERYSET lpqsResults

);

Parameters

hLookup

[in] Handle returned from the previous call to WSALookupServiceBegin.

dwControlFlags

[in] Flags to control the next operation. This is currently used to indicate to the provider what to do if the result set is too big for the buffer. If on the previous call to WSALookupServiceNext the result set was too large for the buffer, the application can choose to do one of two things on this call. First, it can choose to pass a bigger buffer and try again. Second, if it cannot or is unwilling to allocate a larger buffer, it can pass LUP_FLUSHPREVIOUS to tell the provider to throw away the last result set, which was too large, and move on to the next set for this call.

lpdwBufferLength

[in/out] On input, the number of bytes contained in the buffer pointed to by lpresResults. On output, if the function fails and the error is WSAEFAULT, then it contains the minimum number of bytes to pass for the lpqsResults to retrieve the record.

lpqsResults

[out] A pointer to a block of memory, which will contain one result set in a WSAQUERYSET structure on return.

Query Results

The following table describes how the query results are represented in the WSAQUERYSET structure.

WSAQUERYSET Field Name
Result Interpretation
dwSize
Will be set to sizeof(WSAQUERYSET). This is used as a versioning mechanism.
dwOuputFlags
RESULT_IS_ALIAS flag indicates this is an alias result.
lpszServiceInstanceName
Referenced string contains service name.
lpServiceClassId
The GUID corresponding to the service class.
lpVersion
References version number of the particular service instance.
lpszComment
Optional comment string supplied by service instance.
dwNameSpace
Name space in which the service instance was found.
lpNSProviderId
Identifies the specific name space provider that supplied this query result.
lpszContext
Specifies the context point in a hierarchical name space at which the service is located.
dwNumberOfProtocols
Undefined for results.
lpafpProtocols
Undefined for results, all needed protocol information is in the CSADDR_INFO structures.
lpszQueryString
Undefined for results.
dwNumberOfCsAddrs
Indicates the number of elements in the array of CSADDR_INFO structures.
lpcsaBuffer
A pointer to an array of CSADDR_INFO structures, with one complete transport address contained within each element.
lpBlob
(Optional) This is a pointer to a provider-specific entity.

Return Values

The return value is zero if the operation was successful. Otherwise, the value SOCKET_ERROR is returned, and a specific error number may be retrieved by calling WSAGetLastError.

Error Codes

WSA_E_NO_MORE
There is no more data available.
WSA_E_CANCELLED
A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. The data in the lpqsResults buffer is undefined.
WSAEFAULT
The lpqsResults buffer was too small to contain a WSAQUERYSET set.
WSA_INVALID_HANDLE
The specified Lookup handle is invalid.
WSANOTINITIALIZED
The Windows Sockets 2 DLL has not been initialized. The application must first call WSAStartup before calling any Windows Sockets functions.
WSANO_DATA
The name was ound in the database, but no data matching the given restrictions was located.
WSASERVICE_NOT_FOUND
No such service is known. The service cannot be found in the specified name space.

See Also

WSALookupServiceBegin
and WSALookupServiceEnd


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun