Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c2f99f30
Commit
c2f99f30
authored
Dec 08, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement StringTableAddStringEx.
parent
1058561e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
45 deletions
+38
-45
stringtable.c
dlls/setupapi/stringtable.c
+38
-45
No files found.
dlls/setupapi/stringtable.c
View file @
c2f99f30
...
@@ -190,19 +190,21 @@ StringTableDestroy(HSTRING_TABLE hStringTable)
...
@@ -190,19 +190,21 @@ StringTableDestroy(HSTRING_TABLE hStringTable)
/**************************************************************************
/**************************************************************************
* StringTableAddString [SETUPAPI.@]
* StringTableAddString
Ex
[SETUPAPI.@]
*
*
* Adds a new string to the string table.
* Adds a new string
plus extra data
to the string table.
*
*
* PARAMS
* PARAMS
* hStringTable [I] Handle to the string table
* hStringTable [I] Handle to the string table
* lpString [I] String to be added to the string table
* lpString [I] String to be added to the string table
* dwFlags [I] Flags
* dwFlags [I] Flags
* 1: case sensitive compare
* 1: case sensitive compare
* lpExtraData [I] Pointer to the extra data
* dwExtraDataSize [I] Size of the extra data
*
*
* RETURNS
* RETURNS
* Success: String ID
* Success: String ID
* Failure:
-1
* Failure:
~0u
*
*
* NOTES
* NOTES
* If the given string already exists in the string table it will not
* If the given string already exists in the string table it will not
...
@@ -210,40 +212,36 @@ StringTableDestroy(HSTRING_TABLE hStringTable)
...
@@ -210,40 +212,36 @@ StringTableDestroy(HSTRING_TABLE hStringTable)
* this case.
* this case.
*/
*/
DWORD
WINAPI
DWORD
WINAPI
StringTableAddString
(
HSTRING_TABLE
hStringTable
,
StringTableAddStringEx
(
HSTRING_TABLE
hStringTable
,
LPWSTR
lpString
,
LPWSTR
lpString
,
DWORD
dwFlags
,
LPVOID
lpExtraData
,
DWORD
dwExtraDataSize
)
DWORD
dwFlags
)
{
{
PSTRING_TABLE
pStringTable
;
PSTRING_TABLE
pStringTable
;
DWORD
i
;
DWORD
i
;
TRACE
(
"%p %s %x
\n
"
,
hStringTable
,
debugstr_w
(
lpString
),
dwFlags
);
TRACE
(
"%p %s %x %p, %u
\n
"
,
hStringTable
,
debugstr_w
(
lpString
),
dwFlags
,
lpExtraData
,
dwExtraDataSize
);
pStringTable
=
(
PSTRING_TABLE
)
hStringTable
;
pStringTable
=
(
PSTRING_TABLE
)
hStringTable
;
if
(
pStringTable
==
NULL
)
if
(
!
pStringTable
)
{
{
ERR
(
"Invalid hStringTable!
\n
"
);
ERR
(
"Invalid hStringTable!
\n
"
);
return
(
DWORD
)
-
1
;
return
~
0u
;
}
}
/* Search for existing string in the string table */
/* Search for existing string in the string table */
for
(
i
=
0
;
i
<
pStringTable
->
dwMaxSlots
;
i
++
)
for
(
i
=
0
;
i
<
pStringTable
->
dwMaxSlots
;
i
++
)
{
{
if
(
pStringTable
->
pSlots
[
i
].
pString
!=
NULL
)
if
(
pStringTable
->
pSlots
[
i
].
pString
)
{
{
if
(
dwFlags
&
1
)
if
(
dwFlags
&
1
)
{
{
if
(
!
lstrcmpW
(
pStringTable
->
pSlots
[
i
].
pString
,
lpString
))
if
(
!
lstrcmpW
(
pStringTable
->
pSlots
[
i
].
pString
,
lpString
))
{
return
i
+
1
;
return
i
+
1
;
}
}
}
else
else
{
{
if
(
!
lstrcmpiW
(
pStringTable
->
pSlots
[
i
].
pString
,
lpString
))
if
(
!
lstrcmpiW
(
pStringTable
->
pSlots
[
i
].
pString
,
lpString
))
{
return
i
+
1
;
return
i
+
1
;
}
}
}
}
}
}
}
...
@@ -252,51 +250,51 @@ StringTableAddString(HSTRING_TABLE hStringTable,
...
@@ -252,51 +250,51 @@ StringTableAddString(HSTRING_TABLE hStringTable,
if
(
pStringTable
->
dwUsedSlots
==
pStringTable
->
dwMaxSlots
)
if
(
pStringTable
->
dwUsedSlots
==
pStringTable
->
dwMaxSlots
)
{
{
FIXME
(
"Resize the string table!
\n
"
);
FIXME
(
"Resize the string table!
\n
"
);
return
(
DWORD
)
-
1
;
return
~
0u
;
}
}
/* Search for an empty slot */
/* Search for an empty slot */
for
(
i
=
0
;
i
<
pStringTable
->
dwMaxSlots
;
i
++
)
for
(
i
=
0
;
i
<
pStringTable
->
dwMaxSlots
;
i
++
)
{
{
if
(
pStringTable
->
pSlots
[
i
].
pString
==
NULL
)
if
(
!
pStringTable
->
pSlots
[
i
].
pString
)
{
{
pStringTable
->
pSlots
[
i
].
pString
=
MyMalloc
((
lstrlenW
(
lpString
)
+
1
)
*
sizeof
(
WCHAR
));
pStringTable
->
pSlots
[
i
].
pString
=
MyMalloc
((
lstrlenW
(
lpString
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
pStringTable
->
pSlots
[
i
].
pString
==
NULL
)
if
(
!
pStringTable
->
pSlots
[
i
].
pString
)
{
{
TRACE
(
"Couldn't allocate memory for a new string!
\n
"
);
WARN
(
"Couldn't allocate memory for a new string!
\n
"
);
return
(
DWORD
)
-
1
;
return
~
0u
;
}
}
lstrcpyW
(
pStringTable
->
pSlots
[
i
].
pString
,
lpString
);
lstrcpyW
(
pStringTable
->
pSlots
[
i
].
pString
,
lpString
);
pStringTable
->
pSlots
[
i
].
pData
=
MyMalloc
(
dwExtraDataSize
);
if
(
!
pStringTable
->
pSlots
[
i
].
pData
)
{
TRACE
(
"Couldn't allocate memory for data!
\n
"
);
return
~
0u
;
}
memcpy
(
pStringTable
->
pSlots
[
i
].
pData
,
lpExtraData
,
dwExtraDataSize
);
pStringTable
->
dwUsedSlots
++
;
pStringTable
->
dwUsedSlots
++
;
return
i
+
1
;
return
i
+
1
;
}
}
}
}
TRACE
(
"Couldn't find an empty slot!
\n
"
);
TRACE
(
"Couldn't find an empty slot!
\n
"
);
return
~
0u
;
return
(
DWORD
)
-
1
;
}
}
/**************************************************************************
/**************************************************************************
* StringTableAddString
Ex
[SETUPAPI.@]
* StringTableAddString [SETUPAPI.@]
*
*
* Adds a new string
plus extra data
to the string table.
* Adds a new string to the string table.
*
*
* PARAMS
* PARAMS
* hStringTable [I] Handle to the string table
* hStringTable [I] Handle to the string table
* lpString [I] String to be added to the string table
* lpString [I] String to be added to the string table
* dwFlags [I] Flags
* dwFlags [I] Flags
* 1: case sensitive compare
* 1: case sensitive compare
* lpExtraData [I] Pointer to the extra data
* dwExtraDataSize [I] Size of the extra data
*
*
* RETURNS
* RETURNS
* Success: String ID
* Success: String ID
* Failure:
-1
* Failure:
~0u
*
*
* NOTES
* NOTES
* If the given string already exists in the string table it will not
* If the given string already exists in the string table it will not
...
@@ -304,14 +302,9 @@ StringTableAddString(HSTRING_TABLE hStringTable,
...
@@ -304,14 +302,9 @@ StringTableAddString(HSTRING_TABLE hStringTable,
* this case.
* this case.
*/
*/
DWORD
WINAPI
DWORD
WINAPI
StringTableAddStringEx
(
HSTRING_TABLE
hStringTable
,
StringTableAddString
(
HSTRING_TABLE
hStringTable
,
LPWSTR
lpString
,
DWORD
dwFlags
)
LPWSTR
lpString
,
DWORD
dwFlags
,
LPVOID
lpExtraData
,
DWORD
dwExtraDataSize
)
{
{
FIXME
(
"
\n
"
);
return
StringTableAddStringEx
(
hStringTable
,
lpString
,
dwFlags
,
NULL
,
0
);
return
(
DWORD
)
-
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment