ReactOS 0.4.15-dev-7834-g00c4b3d
stringtable.c File Reference
#include "setupapi_private.h"
Include dependency graph for stringtable.c:

Go to the source code of this file.

Classes

struct  _TABLE_SLOT
 
struct  _STRING_TABLE
 

Macros

#define TABLE_DEFAULT_SIZE   256
 

Typedefs

typedef struct _TABLE_SLOT TABLE_SLOT
 
typedef struct _TABLE_SLOTPTABLE_SLOT
 
typedef struct _STRING_TABLE STRING_TABLE
 
typedef struct _STRING_TABLEPSTRING_TABLE
 

Functions

HSTRING_TABLE WINAPI pSetupStringTableInitialize (VOID)
 
HSTRING_TABLE WINAPI pSetupStringTableInitializeEx (DWORD dwMaxExtraDataSize, DWORD dwReserved)
 
VOID WINAPI pSetupStringTableDestroy (HSTRING_TABLE hStringTable)
 
DWORD WINAPI pSetupStringTableAddString (HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
 
DWORD WINAPI pSetupStringTableAddStringEx (HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags, LPVOID lpExtraData, DWORD dwExtraDataSize)
 
HSTRING_TABLE WINAPI pSetupStringTableDuplicate (HSTRING_TABLE hStringTable)
 
BOOL WINAPI pSetupStringTableGetExtraData (HSTRING_TABLE hStringTable, DWORD dwId, LPVOID lpExtraData, DWORD dwExtraDataSize)
 
DWORD WINAPI pSetupStringTableLookUpString (HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
 
DWORD WINAPI pSetupStringTableLookUpStringEx (HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags, LPVOID lpExtraData, DWORD dwReserved)
 
BOOL WINAPI pSetupStringTableSetExtraData (HSTRING_TABLE hStringTable, DWORD dwId, LPVOID lpExtraData, DWORD dwExtraDataSize)
 
LPWSTR WINAPI pSetupStringTableStringFromId (HSTRING_TABLE hStringTable, DWORD dwId)
 
BOOL WINAPI pSetupStringTableStringFromIdEx (HSTRING_TABLE hStringTable, DWORD dwId, LPWSTR lpBuffer, LPDWORD lpBufferLength)
 

Macro Definition Documentation

◆ TABLE_DEFAULT_SIZE

#define TABLE_DEFAULT_SIZE   256

Definition at line 23 of file stringtable.c.

Typedef Documentation

◆ PSTRING_TABLE

◆ PTABLE_SLOT

◆ STRING_TABLE

◆ TABLE_SLOT

Function Documentation

◆ pSetupStringTableAddString()

DWORD WINAPI pSetupStringTableAddString ( HSTRING_TABLE  hStringTable,
LPWSTR  lpString,
DWORD  dwFlags 
)

Definition at line 196 of file stringtable.c.

199{
200 PSTRING_TABLE pStringTable;
201 DWORD i;
202
203 TRACE("%p %s %x\n", hStringTable, debugstr_w(lpString), dwFlags);
204
205 pStringTable = (PSTRING_TABLE)hStringTable;
206 if (pStringTable == NULL)
207 {
208 ERR("Invalid hStringTable!\n");
209 return (DWORD)-1;
210 }
211
212 /* Search for existing string in the string table */
213 for (i = 0; i < pStringTable->dwMaxSlots; i++)
214 {
215 if (pStringTable->pSlots[i].pString != NULL)
216 {
217 if (dwFlags & 1)
218 {
219 if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
220 {
221 return i + 1;
222 }
223 }
224 else
225 {
226 if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
227 {
228 return i + 1;
229 }
230 }
231 }
232 }
233
234 /* Check for filled slot table */
235 if (pStringTable->dwUsedSlots == pStringTable->dwMaxSlots)
236 {
237 PTABLE_SLOT pNewSlots;
238 DWORD dwNewMaxSlots;
239
240 /* FIXME: not thread safe */
241 dwNewMaxSlots = pStringTable->dwMaxSlots * 2;
242 pNewSlots = MyMalloc(sizeof(TABLE_SLOT) * dwNewMaxSlots);
243 if (pNewSlots == NULL)
244 return (DWORD)-1;
245 memset(&pNewSlots[pStringTable->dwMaxSlots], 0, sizeof(TABLE_SLOT) * (dwNewMaxSlots - pStringTable->dwMaxSlots));
246 memcpy(pNewSlots, pStringTable->pSlots, sizeof(TABLE_SLOT) * pStringTable->dwMaxSlots);
247 pNewSlots = InterlockedExchangePointer((PVOID*)&pStringTable->pSlots, pNewSlots);
248 MyFree(pNewSlots);
249 pStringTable->dwMaxSlots = dwNewMaxSlots;
250
251 return pSetupStringTableAddString(hStringTable, lpString, dwFlags);
252 }
253
254 /* Search for an empty slot */
255 for (i = 0; i < pStringTable->dwMaxSlots; i++)
256 {
257 if (pStringTable->pSlots[i].pString == NULL)
258 {
259 pStringTable->pSlots[i].pString = MyMalloc((lstrlenW(lpString) + 1) * sizeof(WCHAR));
260 if (pStringTable->pSlots[i].pString == NULL)
261 {
262 TRACE("Couldn't allocate memory for a new string!\n");
263 return (DWORD)-1;
264 }
265
266 lstrcpyW(pStringTable->pSlots[i].pString, lpString);
267
268 pStringTable->dwUsedSlots++;
269
270 return i + 1;
271 }
272 }
273
274 TRACE("Couldn't find an empty slot!\n");
275
276 return (DWORD)-1;
277}
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
LPVOID WINAPI MyMalloc(DWORD dwSize)
Definition: misc.c:147
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128
struct _STRING_TABLE * PSTRING_TABLE
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
unsigned long DWORD
Definition: ntddk_ex.h:95
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
Definition: glfuncs.h:248
#define debugstr_w
Definition: kernel32.h:32
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwUsedSlots
Definition: stringtable.c:35
PTABLE_SLOT pSlots
Definition: stringtable.c:34
DWORD dwMaxSlots
Definition: stringtable.c:36
LPWSTR pString
Definition: stringtable.c:27
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CM_Connect_MachineW(), CM_Create_DevNode_ExW(), CM_Get_Child_Ex(), CM_Get_Parent_Ex(), CM_Get_Sibling_Ex(), CM_Locate_DevNode_ExW(), PnpGetLocalHandles(), and pSetupStringTableAddString().

◆ pSetupStringTableAddStringEx()

DWORD WINAPI pSetupStringTableAddStringEx ( HSTRING_TABLE  hStringTable,
LPWSTR  lpString,
DWORD  dwFlags,
LPVOID  lpExtraData,
DWORD  dwExtraDataSize 
)

Definition at line 303 of file stringtable.c.

308{
309 PSTRING_TABLE pStringTable;
310 DWORD i;
311
312 TRACE("%p %s %lx\n", (PVOID)hStringTable, debugstr_w(lpString), dwFlags);
313
314 pStringTable = (PSTRING_TABLE)hStringTable;
315 if (pStringTable == NULL)
316 {
317 ERR("Invalid hStringTable!\n");
318 return (DWORD)-1;
319 }
320
321 /* Search for existing string in the string table */
322 for (i = 0; i < pStringTable->dwMaxSlots; i++)
323 {
324 if (pStringTable->pSlots[i].pString != NULL)
325 {
326 if (dwFlags & 1)
327 {
328 if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
329 {
330 return i + 1;
331 }
332 }
333 else
334 {
335 if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
336 {
337 return i + 1;
338 }
339 }
340 }
341 }
342
343 /* Check for filled slot table */
344 if (pStringTable->dwUsedSlots == pStringTable->dwMaxSlots)
345 {
346 FIXME("Resize the string table!\n");
347 return (DWORD)-1;
348 }
349
350 /* Search for an empty slot */
351 for (i = 0; i < pStringTable->dwMaxSlots; i++)
352 {
353 if (pStringTable->pSlots[i].pString == NULL)
354 {
355 pStringTable->pSlots[i].pString = MyMalloc((lstrlenW(lpString) + 1) * sizeof(WCHAR));
356 if (pStringTable->pSlots[i].pString == NULL)
357 {
358 TRACE("Couldn't allocate memory for a new string!\n");
359 return (DWORD)-1;
360 }
361
362 lstrcpyW(pStringTable->pSlots[i].pString, lpString);
363
364 pStringTable->pSlots[i].pData = MyMalloc(dwExtraDataSize);
365 if (pStringTable->pSlots[i].pData == NULL)
366 {
367 TRACE("Couldn't allocate memory for a new extra data!\n");
368 MyFree(pStringTable->pSlots[i].pString);
369 pStringTable->pSlots[i].pString = NULL;
370 return (DWORD)-1;
371 }
372
373 memcpy(pStringTable->pSlots[i].pData,
374 lpExtraData,
375 dwExtraDataSize);
376 pStringTable->pSlots[i].dwSize = dwExtraDataSize;
377
378 pStringTable->dwUsedSlots++;
379
380 return i + 1;
381 }
382 }
383
384 TRACE("Couldn't find an empty slot!\n");
385
386 return (DWORD)-1;
387}
#define FIXME(fmt,...)
Definition: debug.h:111
DWORD dwSize
Definition: stringtable.c:29
LPVOID pData
Definition: stringtable.c:28

◆ pSetupStringTableDestroy()

VOID WINAPI pSetupStringTableDestroy ( HSTRING_TABLE  hStringTable)

Definition at line 145 of file stringtable.c.

146{
147 PSTRING_TABLE pStringTable;
148 DWORD i;
149
150 TRACE("%p\n", hStringTable);
151
152 pStringTable = (PSTRING_TABLE)hStringTable;
153 if (pStringTable == NULL)
154 return;
155
156 if (pStringTable->pSlots != NULL)
157 {
158 for (i = 0; i < pStringTable->dwMaxSlots; i++)
159 {
160 MyFree(pStringTable->pSlots[i].pString);
161 pStringTable->pSlots[i].pString = NULL;
162
163 MyFree(pStringTable->pSlots[i].pData);
164 pStringTable->pSlots[i].pData = NULL;
165 pStringTable->pSlots[i].dwSize = 0;
166 }
167
168 MyFree(pStringTable->pSlots);
169 }
170
171 MyFree(pStringTable);
172}

Referenced by CM_Connect_MachineW(), CM_Disconnect_Machine(), PnpGetLocalHandles(), and PnpUnbindLocalBindingHandle().

◆ pSetupStringTableDuplicate()

HSTRING_TABLE WINAPI pSetupStringTableDuplicate ( HSTRING_TABLE  hStringTable)

Definition at line 404 of file stringtable.c.

405{
406 PSTRING_TABLE pSourceTable;
407 PSTRING_TABLE pDestinationTable;
408 DWORD i;
410
411 TRACE("%p\n", hStringTable);
412
413 pSourceTable = (PSTRING_TABLE)hStringTable;
414 if (pSourceTable == NULL)
415 {
416 ERR("Invalid hStringTable!\n");
417 return (HSTRING_TABLE)NULL;
418 }
419
420 pDestinationTable = MyMalloc(sizeof(STRING_TABLE));
421 if (pDestinationTable == NULL)
422 {
423 ERR("Could not allocate a new string table!\n");
424 return (HSTRING_TABLE)NULL;
425 }
426
427 memset(pDestinationTable, 0, sizeof(STRING_TABLE));
428
429 pDestinationTable->pSlots = MyMalloc(sizeof(TABLE_SLOT) * pSourceTable->dwMaxSlots);
430 if (pDestinationTable->pSlots == NULL)
431 {
432 MyFree(pDestinationTable);
433 return (HSTRING_TABLE)NULL;
434 }
435
436 memset(pDestinationTable->pSlots, 0, sizeof(TABLE_SLOT) * pSourceTable->dwMaxSlots);
437
438 pDestinationTable->dwUsedSlots = 0;
439 pDestinationTable->dwMaxSlots = pSourceTable->dwMaxSlots;
440
441 for (i = 0; i < pSourceTable->dwMaxSlots; i++)
442 {
443 if (pSourceTable->pSlots[i].pString != NULL)
444 {
445 length = (lstrlenW(pSourceTable->pSlots[i].pString) + 1) * sizeof(WCHAR);
446 pDestinationTable->pSlots[i].pString = MyMalloc(length);
447 if (pDestinationTable->pSlots[i].pString != NULL)
448 {
449 memcpy(pDestinationTable->pSlots[i].pString,
450 pSourceTable->pSlots[i].pString,
451 length);
452 pDestinationTable->dwUsedSlots++;
453 }
454
455 if (pSourceTable->pSlots[i].pData != NULL)
456 {
457 length = pSourceTable->pSlots[i].dwSize;
458 pDestinationTable->pSlots[i].pData = MyMalloc(length);
459 if (pDestinationTable->pSlots[i].pData)
460 {
461 memcpy(pDestinationTable->pSlots[i].pData,
462 pSourceTable->pSlots[i].pData,
463 length);
464 pDestinationTable->pSlots[i].dwSize = length;
465 }
466 }
467 }
468 }
469
470 return (HSTRING_TABLE)pDestinationTable;
471}
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

◆ pSetupStringTableGetExtraData()

BOOL WINAPI pSetupStringTableGetExtraData ( HSTRING_TABLE  hStringTable,
DWORD  dwId,
LPVOID  lpExtraData,
DWORD  dwExtraDataSize 
)

Definition at line 490 of file stringtable.c.

494{
495 PSTRING_TABLE pStringTable;
496
497 TRACE("%p %x %p %u\n",
498 hStringTable, dwId, lpExtraData, dwExtraDataSize);
499
500 pStringTable = (PSTRING_TABLE)hStringTable;
501 if (pStringTable == NULL)
502 {
503 ERR("Invalid hStringTable!\n");
504 return FALSE;
505 }
506
507 if (dwId == 0 || dwId > pStringTable->dwMaxSlots)
508 {
509 ERR("Invalid Slot id!\n");
510 return FALSE;
511 }
512
513 if (pStringTable->pSlots[dwId - 1].dwSize < dwExtraDataSize)
514 {
515 ERR("Data size is too large!\n");
516 return FALSE;
517 }
518
519 memcpy(lpExtraData,
520 pStringTable->pSlots[dwId - 1].pData,
521 dwExtraDataSize);
522
523 return TRUE;
524}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

◆ pSetupStringTableInitialize()

HSTRING_TABLE WINAPI pSetupStringTableInitialize ( VOID  )

Definition at line 54 of file stringtable.c.

55{
56 PSTRING_TABLE pStringTable;
57
58 TRACE("\n");
59
60 pStringTable = MyMalloc(sizeof(STRING_TABLE));
61 if (pStringTable == NULL)
62 {
63 ERR("Invalid hStringTable!\n");
64 return NULL;
65 }
66
67 memset(pStringTable, 0, sizeof(STRING_TABLE));
68
69 pStringTable->pSlots = MyMalloc(sizeof(TABLE_SLOT) * TABLE_DEFAULT_SIZE);
70 if (pStringTable->pSlots == NULL)
71 {
72 MyFree(pStringTable);
73 return NULL;
74 }
75
76 memset(pStringTable->pSlots, 0, sizeof(TABLE_SLOT) * TABLE_DEFAULT_SIZE);
77
78 pStringTable->dwUsedSlots = 0;
79 pStringTable->dwMaxSlots = TABLE_DEFAULT_SIZE;
80 pStringTable->dwMaxDataSize = 0;
81
82 TRACE("Done\n");
83
84 return (HSTRING_TABLE)pStringTable;
85}
#define TABLE_DEFAULT_SIZE
Definition: stringtable.c:23
DWORD dwMaxDataSize
Definition: stringtable.c:37

Referenced by CM_Connect_MachineW(), and PnpGetLocalHandles().

◆ pSetupStringTableInitializeEx()

HSTRING_TABLE WINAPI pSetupStringTableInitializeEx ( DWORD  dwMaxExtraDataSize,
DWORD  dwReserved 
)

Definition at line 102 of file stringtable.c.

104{
105 PSTRING_TABLE pStringTable;
106
107 TRACE("\n");
108
109 pStringTable = MyMalloc(sizeof(STRING_TABLE));
110 if (pStringTable == NULL) return NULL;
111
112 memset(pStringTable, 0, sizeof(STRING_TABLE));
113
114 pStringTable->pSlots = MyMalloc(sizeof(TABLE_SLOT) * TABLE_DEFAULT_SIZE);
115 if (pStringTable->pSlots == NULL)
116 {
117 MyFree(pStringTable);
118 return NULL;
119 }
120
121 memset(pStringTable->pSlots, 0, sizeof(TABLE_SLOT) * TABLE_DEFAULT_SIZE);
122
123 pStringTable->dwUsedSlots = 0;
124 pStringTable->dwMaxSlots = TABLE_DEFAULT_SIZE;
125 pStringTable->dwMaxDataSize = dwMaxExtraDataSize;
126
127 TRACE("Done\n");
128
129 return (HSTRING_TABLE)pStringTable;
130}

◆ pSetupStringTableLookUpString()

DWORD WINAPI pSetupStringTableLookUpString ( HSTRING_TABLE  hStringTable,
LPWSTR  lpString,
DWORD  dwFlags 
)

Definition at line 543 of file stringtable.c.

546{
547 PSTRING_TABLE pStringTable;
548 DWORD i;
549
550 TRACE("%p %s %x\n", hStringTable, debugstr_w(lpString), dwFlags);
551
552 pStringTable = (PSTRING_TABLE)hStringTable;
553 if (pStringTable == NULL)
554 {
555 ERR("Invalid hStringTable!\n");
556 return (DWORD)-1;
557 }
558
559 /* Search for existing string in the string table */
560 for (i = 0; i < pStringTable->dwMaxSlots; i++)
561 {
562 if (pStringTable->pSlots[i].pString != NULL)
563 {
564 if (dwFlags & 1)
565 {
566 if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
567 return i + 1;
568 }
569 else
570 {
571 if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
572 return i + 1;
573 }
574 }
575 }
576
577 return (DWORD)-1;
578}

◆ pSetupStringTableLookUpStringEx()

DWORD WINAPI pSetupStringTableLookUpStringEx ( HSTRING_TABLE  hStringTable,
LPWSTR  lpString,
DWORD  dwFlags,
LPVOID  lpExtraData,
DWORD  dwReserved 
)

Definition at line 599 of file stringtable.c.

604{
605 PSTRING_TABLE pStringTable;
606 DWORD i;
607
608 TRACE("%p %s %x %p, %x\n", hStringTable, debugstr_w(lpString), dwFlags,
609 lpExtraData, dwReserved);
610
611 pStringTable = (PSTRING_TABLE)hStringTable;
612 if (pStringTable == NULL)
613 {
614 ERR("Invalid hStringTable!\n");
615 return ~0u;
616 }
617
618 /* Search for existing string in the string table */
619 for (i = 0; i < pStringTable->dwMaxSlots; i++)
620 {
621 if (pStringTable->pSlots[i].pString != NULL)
622 {
623 if (dwFlags & 1)
624 {
625 if (!lstrcmpW(pStringTable->pSlots[i].pString, lpString))
626 {
627 if (lpExtraData)
628 memcpy(lpExtraData, pStringTable->pSlots[i].pData, dwReserved);
629 return i + 1;
630 }
631 }
632 else
633 {
634 if (!lstrcmpiW(pStringTable->pSlots[i].pString, lpString))
635 {
636 if (lpExtraData)
637 memcpy(lpExtraData, pStringTable->pSlots[i].pData, dwReserved);
638 return i + 1;
639 }
640 }
641 }
642 }
643 return ~0u;
644}
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 * u
Definition: glfuncs.h:240
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ pSetupStringTableSetExtraData()

BOOL WINAPI pSetupStringTableSetExtraData ( HSTRING_TABLE  hStringTable,
DWORD  dwId,
LPVOID  lpExtraData,
DWORD  dwExtraDataSize 
)

Definition at line 663 of file stringtable.c.

667{
668 PSTRING_TABLE pStringTable;
669
670 TRACE("%p %x %p %u\n",
671 hStringTable, dwId, lpExtraData, dwExtraDataSize);
672
673 pStringTable = (PSTRING_TABLE)hStringTable;
674 if (pStringTable == NULL)
675 {
676 ERR("Invalid hStringTable!\n");
677 return FALSE;
678 }
679
680 if (dwId == 0 || dwId > pStringTable->dwMaxSlots)
681 {
682 ERR("Invalid Slot id!\n");
683 return FALSE;
684 }
685
686 if (pStringTable->dwMaxDataSize < dwExtraDataSize)
687 {
688 ERR("Data size is too large!\n");
689 return FALSE;
690 }
691
692 pStringTable->pSlots[dwId - 1].pData = MyMalloc(dwExtraDataSize);
693 if (pStringTable->pSlots[dwId - 1].pData == NULL)
694 {
695 ERR("\n");
696 return FALSE;
697 }
698
699 memcpy(pStringTable->pSlots[dwId - 1].pData,
700 lpExtraData,
701 dwExtraDataSize);
702 pStringTable->pSlots[dwId - 1].dwSize = dwExtraDataSize;
703
704 return TRUE;
705}

◆ pSetupStringTableStringFromId()

LPWSTR WINAPI pSetupStringTableStringFromId ( HSTRING_TABLE  hStringTable,
DWORD  dwId 
)

◆ pSetupStringTableStringFromIdEx()

BOOL WINAPI pSetupStringTableStringFromIdEx ( HSTRING_TABLE  hStringTable,
DWORD  dwId,
LPWSTR  lpBuffer,
LPDWORD  lpBufferLength 
)

Definition at line 760 of file stringtable.c.

764{
765 PSTRING_TABLE pStringTable;
767 BOOL bResult = FALSE;
768
769 TRACE("%p %x %p %p\n", hStringTable, dwId, lpBuffer, lpBufferLength);
770
771 pStringTable = (PSTRING_TABLE)hStringTable;
772 if (pStringTable == NULL)
773 {
774 ERR("Invalid hStringTable!\n");
775 *lpBufferLength = 0;
776 return FALSE;
777 }
778
779 if (dwId == 0 || dwId > pStringTable->dwMaxSlots ||
780 pStringTable->pSlots[dwId - 1].pString == NULL)
781 {
782 WARN("Invalid string ID!\n");
783 *lpBufferLength = 0;
784 return FALSE;
785 }
786
787 dwLength = (lstrlenW(pStringTable->pSlots[dwId - 1].pString) + 1);
788 if (dwLength <= *lpBufferLength)
789 {
790 lstrcpyW(lpBuffer, pStringTable->pSlots[dwId - 1].pString);
791 bResult = TRUE;
792 }
793
794 *lpBufferLength = dwLength;
795
796 return bResult;
797}
#define WARN(fmt,...)
Definition: debug.h:112
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
static DWORD DWORD * dwLength
Definition: fusion.c:86
unsigned int BOOL
Definition: ntddk_ex.h:94

Referenced by CM_Get_Device_ID_ExW().