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
9aa23c6c
Commit
9aa23c6c
authored
Oct 29, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Store string length in the record structure.
parent
6950ac1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
msipriv.h
dlls/msi/msipriv.h
+2
-0
record.c
dlls/msi/record.c
+27
-12
No files found.
dlls/msi/msipriv.h
View file @
9aa23c6c
...
...
@@ -118,6 +118,7 @@ typedef struct tagMSIFIELD
LPWSTR
szwVal
;
IStream
*
stream
;
}
u
;
int
len
;
}
MSIFIELD
;
typedef
struct
tagMSIRECORD
...
...
@@ -821,6 +822,7 @@ extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT ) DECLSPEC
extern
MSIRECORD
*
MSI_CloneRecord
(
MSIRECORD
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
MSI_RecordsAreEqual
(
MSIRECORD
*
,
MSIRECORD
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
MSI_RecordsAreFieldsEqual
(
MSIRECORD
*
a
,
MSIRECORD
*
b
,
UINT
field
)
DECLSPEC_HIDDEN
;
extern
UINT
msi_record_set_string
(
MSIRECORD
*
,
UINT
,
const
WCHAR
*
,
int
)
DECLSPEC_HIDDEN
;
/* stream internals */
extern
void
enum_stream_names
(
IStorage
*
stg
)
DECLSPEC_HIDDEN
;
...
...
dlls/msi/record.c
View file @
9aa23c6c
...
...
@@ -616,32 +616,47 @@ UINT WINAPI MsiRecordSetStringA( MSIHANDLE handle, UINT iField, LPCSTR szValue )
return
ret
;
}
UINT
MSI_RecordSetStringW
(
MSIRECORD
*
rec
,
UINT
iField
,
LPCWSTR
szValue
)
static
WCHAR
*
msi_strdupW
(
const
WCHAR
*
value
,
int
len
)
{
LPWSTR
str
;
WCHAR
*
ret
;
TRACE
(
"%p %d %s
\n
"
,
rec
,
iField
,
debugstr_w
(
szValue
));
if
(
!
(
ret
=
msi_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
memcpy
(
ret
,
value
,
len
*
sizeof
(
WCHAR
)
);
ret
[
len
]
=
0
;
return
ret
;
}
if
(
iField
>
rec
->
count
)
UINT
msi_record_set_string
(
MSIRECORD
*
rec
,
UINT
field
,
const
WCHAR
*
value
,
int
len
)
{
if
(
field
>
rec
->
count
)
return
ERROR_INVALID_FIELD
;
MSI_FreeField
(
&
rec
->
fields
[
iF
ield
]
);
MSI_FreeField
(
&
rec
->
fields
[
f
ield
]
);
if
(
szValue
&&
szValue
[
0
]
)
if
(
value
&&
len
<
0
)
len
=
strlenW
(
value
);
if
(
value
&&
len
)
{
str
=
strdupW
(
szValue
)
;
rec
->
fields
[
iField
].
type
=
MSIFIELD_WSTR
;
rec
->
fields
[
iField
].
u
.
szwVal
=
str
;
rec
->
fields
[
field
].
type
=
MSIFIELD_WSTR
;
rec
->
fields
[
field
].
u
.
szwVal
=
msi_strdupW
(
value
,
len
)
;
rec
->
fields
[
field
].
len
=
len
;
}
else
{
rec
->
fields
[
iField
].
type
=
MSIFIELD_NULL
;
rec
->
fields
[
iField
].
u
.
szwVal
=
NULL
;
rec
->
fields
[
field
].
type
=
MSIFIELD_NULL
;
rec
->
fields
[
field
].
u
.
szwVal
=
NULL
;
rec
->
fields
[
field
].
len
=
0
;
}
return
0
;
}
UINT
MSI_RecordSetStringW
(
MSIRECORD
*
rec
,
UINT
iField
,
LPCWSTR
szValue
)
{
TRACE
(
"%p %d %s
\n
"
,
rec
,
iField
,
debugstr_w
(
szValue
));
return
msi_record_set_string
(
rec
,
iField
,
szValue
,
-
1
);
}
UINT
WINAPI
MsiRecordSetStringW
(
MSIHANDLE
handle
,
UINT
iField
,
LPCWSTR
szValue
)
{
MSIRECORD
*
rec
;
...
...
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