43static inline size_t compat_wcsnlen(
const WCHAR *
str,
size_t size)
49#define wcsnlen compat_wcsnlen
92 lpCache->bNsIsLocal =
TRUE;
113 TRACE(
"%p, %p, %p\n", lpcNSAddrHdr, lpcMsg, lpNSInfo );
119 nameLength =
wcsnlen( (
WCHAR *) (lpcMsg + 1), maxNameLength );
120 if ( nameLength == maxNameLength )
127 if( lpCacheNode !=
NULL )
129 TRACE(
"Duplicate session entry for %s removed - updated version kept\n",
131 cbReleaseNSNode( lpCacheNode );
135 lpCacheNode =
calloc( 1,
sizeof( *lpCacheNode ) );
137 if( lpCacheNode ==
NULL )
139 ERR(
"no memory for NS node\n" );
143 lpCacheNode->lpNSAddrHdr =
malloc( dwHdrSize );
144 CopyMemory( lpCacheNode->lpNSAddrHdr, lpcNSAddrHdr, dwHdrSize );
152 if( lpCacheNode->data ==
NULL )
154 ERR(
"no memory for SESSIONDESC2\n" );
161 if( lpCacheNode->dataA ==
NULL )
163 ERR(
"no memory for SESSIONDESC2\n" );
164 free( lpCacheNode->data );
169 lpCacheNode->ref = 1;
184 lpCache->lpLocalAddrHdr =
malloc( dwHdrSize );
186 CopyMemory( lpCache->lpLocalAddrHdr, lpHdr, dwHdrSize );
200 DWORD passwordSize = 0;
249 if( lpCache ==
NULL )
251 ERR(
": invalidate nonexistent cache\n" );
257 lpCache->bNsIsLocal =
FALSE;
266 *lplpNSInfo = lpCache;
268 if( lpCache ==
NULL )
277 lpCache->bNsIsLocal =
FALSE;
319 if( spMessageHeader )
320 *spMessageHeader = lpCache->
present->lpNSAddrHdr;
325 return lpSessionDesc;
357 if( (dwPresentTime - (
DPQ_FIRST(lpCache->first)->dwTime)) < dwPrunePeriod )
365 cbReleaseNSNode( lpFirstData );
375 DWORD dwVariableSize;
380 FIXME(
": few fixed + need to check request for response, might need UNICODE input ability.\n" );
385 dwVariableSize = dwVariableLen *
sizeof(
WCHAR );
388 sizeof( *rmsg ) + dwVariableSize;
389 *lplpReplyData =
calloc( 1, *lpdwReplySize );
402 (
LPWSTR)(rmsg+1), dwVariableLen );
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define MultiByteToWideChar
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP size_t __cdecl wcsnlen(const wchar_t *, size_t)
DWORD WINAPI timeGetTime(void)
DPSESSIONDESC2 * DP_DuplicateSessionDesc(const DPSESSIONDESC2 *src, BOOL dstAnsi, BOOL srcAnsi)
#define DPENUMSESSIONS_RETURNSTATUS
struct tagDPMSG_ENUMSESSIONSREQUEST * LPDPMSG_ENUMSESSIONSREQUEST
#define DPMSGCMD_ENUMSESSIONSREQUEST
struct tagDPMSG_ENUMSESSIONSREPLY DPMSG_ENUMSESSIONSREPLY
struct tagDPMSG_ENUMSESSIONSREPLY * LPDPMSG_ENUMSESSIONSREPLY
#define DPMSGCMD_ENUMSESSIONSREPLY
#define DPMSG_WAIT_60_SECS
struct tagDPMSG_ENUMSESSIONSREQUEST DPMSG_ENUMSESSIONSREQUEST
#define DPMSGMAGIC_DPLAYMSG
#define DPQ_INSERT(a, b, c)
#define DPQ_DECL_COMPARECB(name, type)
#define DPQ_REMOVE_ENTRY_CB(head, elm, field, compare_cb, fieldToCompare, rc)
#define DPQ_DELETEQ(head, field, type, df)
#define DPQ_IS_EMPTY(head)
#define DPQ_REMOVE(head, elm, field)
#define DPQ_DECL_DELETECB(name, type)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
HRESULT NS_SendSessionRequestBroadcast(LPCGUID lpcGuid, DWORD dwFlags, WCHAR *password, const SPINITDATA *lpSpData)
void NS_SetLocalComputerAsNameServer(LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo)
BOOL NS_InitializeSessionCache(LPVOID *lplpNSInfo)
void NS_InvalidateSessionCache(LPVOID lpNSInfo)
void NS_ReplyToEnumSessionsRequest(const void *lpcMsg, void **lplpReplyData, DWORD *lpdwReplySize, IDirectPlayImpl *lpDP)
void NS_AddRemoteComputerAsNameServer(LPCVOID lpcNSAddrHdr, DWORD dwHdrSize, LPCDPMSG_ENUMSESSIONSREPLY lpcMsg, DWORD msgSize, LPVOID lpNSInfo)
void NS_ResetSessionEnumeration(LPVOID lpNSInfo)
void NS_PruneSessionCache(LPVOID lpNSInfo)
struct NSCache * lpNSCache
LPDPSESSIONDESC2 NS_WalkSessions(LPVOID lpNSInfo, void **spMessageHeader, BOOL ansi)
struct NSCacheData * lpNSCacheData
void NS_SetLocalAddr(LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize)
void NS_DeleteSessionCache(LPVOID lpNSInfo)
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
#define IsEqualGUID(rguid1, rguid2)
static unsigned __int64 next
DPMSG_SENDENVELOPE envelope
DPMSG_SENDENVELOPE envelope
LPDPSP_ENUMSESSIONS EnumSessions
LPDPSESSIONDESC2 lpSessionDesc
static UINT WPARAM LPARAM BOOL ansi