11#define MSW_BUFSIZE 512
12#define MAX_ARRAY_SIZE 5
23 mswBuf->bufendptr =
buffer;
31 if (mswBuf->bytesUsed + count <= mswBuf->bytesMax)
34 mswBuf->bufok =
FALSE;
45 mswBuf->bytesUsed +=
count;
46 mswBuf->bufendptr +=
count;
53 return mswBuf->bufendptr;
58 _In_ void *dataToAppend,
124 lstByteSize = ((lstItemCount + 1) *
sizeof(
UINT_PTR)) +
125 (lstItemCount * itemByteLength);
127 if (mswBuf->bytesUsed + lstByteSize > mswBuf->bytesMax)
131 lstDataPos = ((lstItemCount + 1) *
sizeof(
UINT_PTR)) +
134 lstDataPos += ptrofs;
137 for (i1 = 0; i1 < lstItemCount; i1++)
151 for (i1 = 0; i1 < lstItemCount; i1++)
156 return mswBuf->bufok;
182 i1 =
strlen((
char*)*ptrSrcLstPos) +
sizeof(
char);
183 lstItemLen[lstItemCount] = i1;
189 lstByteSize = ((lstItemCount + 1) *
sizeof(
UINT_PTR)) +
192 if (mswBuf->bytesUsed + lstByteSize > mswBuf->bytesMax)
196 lstDataPos = ((lstItemCount + 1) *
sizeof(
UINT_PTR)) +
200 lstDataPos += ptrofs;
202 for (i1 = 0; i1 < lstItemCount; i1++)
207 lstDataPos += lstItemLen[i1];
216 for (i1 = 0; i1 < lstItemCount; i1++)
223 return mswBuf->bufok;
229 _In_ char** hostAliasesA,
230 _In_ char* hostnameA,
244 lpRes->lpBlob->cbSize = 0;
248 phe = (
PHOSTENT)lpRes->lpBlob->pBlobData;
263 (
void**)hostAliasesA,
276 lst[0] = (
void*)&ip4addr;
290 return mswBuf->bufok;
296 _In_ char* serviceNameA,
297 _In_ char** serviceAliasesA,
298 _In_ char* protocolNameA,
310 lpRes->lpBlob->cbSize = 0;
314 pse = (
LPSERVENT)lpRes->lpBlob->pBlobData;
325 (
void**)serviceAliasesA,
348 return mswBuf->bufok;
359 lpRes->dwNumberOfCsAddrs = 1;
362 paddrinfo = lpRes->lpcsaBuffer;
384 psa->sin_addr.s_addr = 0;
391 psa->sin_addr.s_addr = ip4addr;
411 charLen =
strlen(aStr) + 1;
413 aStrByteLen = (charLen *
sizeof(
char));
414 wStrByteLen = (charLen *
sizeof(
WCHAR));
453 charLen =
wcslen(wStr) + 1;
455 aStrByteLen = (charLen *
sizeof(
char));
475 if (
ret != aStrByteLen)
499 bLen = (chLen + 1) *
sizeof(
WCHAR);
522 bLen = (chLen + 1) *
sizeof(
char);
551 while (*aSrcPtr !=
NULL)
556 bItmLen =
strlen(*aSrcPtr) + 1;
557 aStrByteLen[aCount] = bItmLen;
559 bLen +=
sizeof(*aSrcPtr) + bItmLen;
566 bLen +=
sizeof(*aSrcPtr);
576 aDstNextStr = (
char*)(resA + aCount + 1);
577 for (i1 = 0; i1 < aCount; i1++)
579 bItmLen = aStrByteLen[i1];
581 *aDstPtr = aDstNextStr;
619 while (*wSrcPtr !=
NULL)
624 bItmLen =
wcslen(*wSrcPtr) + 1;
625 aStrByteLen[aCount] = bItmLen;
627 bLen +=
sizeof(*wSrcPtr) + bItmLen;
634 bLen +=
sizeof(*wSrcPtr);
644 aDstNextStr = (
char*)(resA + aCount + 1);
645 for (i1 = 0; i1 < aCount; i1++)
647 bItmLen = aStrByteLen[i1];
649 *aDstPtr = aDstNextStr;
ACPI_SIZE strlen(const char *String)
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
GLuint GLuint GLsizei count
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
unsigned __int3264 UINT_PTR
BOOL mswBufferIncUsed(_Inout_ PMSW_BUFFER mswBuf, _In_ DWORD count)
WCHAR * StrA2WHeapAlloc(_In_opt_ HANDLE hHeap, _In_ char *aStr)
char * StrW2AHeapAlloc(_In_opt_ HANDLE hHeap, _In_ WCHAR *wStr)
BOOL mswBufferCheck(_Inout_ PMSW_BUFFER mswBuf, _In_ DWORD count)
BOOL mswBufferAppendAddr_AddrInfoW(_Inout_ PMSW_BUFFER mswBuf, _Inout_ LPWSAQUERYSETW lpRes, _In_ DWORD ip4addr)
BOOL mswBufferAppendStrW(_Inout_ PMSW_BUFFER mswBuf, _In_ WCHAR *str)
BOOL mswBufferAppendBlob_Hostent(_Inout_ PMSW_BUFFER mswBuf, _Inout_ LPWSAQUERYSETW lpRes, _In_ char **hostAliasesA, _In_ char *hostnameA, _In_ DWORD ip4addr)
BOOL mswBufferAppendLst(_Inout_ PMSW_BUFFER mswBuf, _In_ void **lst, _In_ DWORD itemByteLength, _In_opt_ int ptrofs)
BOOL mswBufferAppendStrA(_Inout_ PMSW_BUFFER mswBuf, _In_ char *str)
BOOL mswBufferAppendPtr(_Inout_ PMSW_BUFFER mswBuf, _In_ void *ptr)
char ** StrAryCpyHeapAllocA(_In_opt_ HANDLE hHeap, _In_ char **aStrAry)
void mswBufferInit(_Inout_ PMSW_BUFFER mswBuf, _In_ BYTE *buffer, _In_ DWORD bufferSize)
BOOL mswBufferAppendStrLstA(_Inout_ PMSW_BUFFER mswBuf, _In_ void **lst, _In_opt_ int ptrofs)
BYTE * mswBufferEndPtr(_Inout_ PMSW_BUFFER mswBuf)
char ** StrAryCpyHeapAllocWToA(_In_opt_ HANDLE hHeap, _In_ WCHAR **wStrAry)
WCHAR * StrCpyHeapAllocW(_In_opt_ HANDLE hHeap, _In_ WCHAR *wStr)
char * StrCpyHeapAllocA(_In_opt_ HANDLE hHeap, _In_ char *aStr)
BOOL mswBufferAppendBlob_Servent(_Inout_ PMSW_BUFFER mswBuf, _Inout_ LPWSAQUERYSETW lpRes, _In_ char *serviceNameA, _In_ char **serviceAliasesA, _In_ char *protocolNameA, _In_ WORD port)
BOOL mswBufferAppend(_Inout_ PMSW_BUFFER mswBuf, _In_ void *dataToAppend, _In_ DWORD dataSize)
SOCKET_ADDRESS RemoteAddr
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
struct sockaddr_in * LPSOCKADDR_IN
struct hostent * PHOSTENT
struct servent * LPSERVENT
struct sockaddr * LPSOCKADDR
struct _CSADDR_INFO * LPCSADDR_INFO