Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ba491991
Commit
ba491991
authored
Jul 05, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Jul 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Forward MsiFormatRecordA to MsiFormatRecordW.
parent
cba1b1e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
64 deletions
+30
-64
format.c
dlls/msi/format.c
+30
-63
msipriv.h
dlls/msi/msipriv.h
+0
-1
No files found.
dlls/msi/format.c
View file @
ba491991
...
@@ -657,57 +657,6 @@ UINT MSI_FormatRecordW( MSIPACKAGE* package, MSIRECORD* record, LPWSTR buffer,
...
@@ -657,57 +657,6 @@ UINT MSI_FormatRecordW( MSIPACKAGE* package, MSIRECORD* record, LPWSTR buffer,
return
rc
;
return
rc
;
}
}
UINT
MSI_FormatRecordA
(
MSIPACKAGE
*
package
,
MSIRECORD
*
record
,
LPSTR
buffer
,
DWORD
*
size
)
{
LPWSTR
deformated
;
LPWSTR
rec
;
DWORD
len
,
lenA
;
UINT
rc
=
ERROR_INVALID_PARAMETER
;
TRACE
(
"%p %p %p %i
\n
"
,
package
,
record
,
buffer
,
*
size
);
rec
=
msi_dup_record_field
(
record
,
0
);
if
(
!
rec
)
rec
=
build_default_format
(
record
);
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
rec
));
len
=
deformat_string_internal
(
package
,
rec
,
&
deformated
,
strlenW
(
rec
),
record
,
NULL
);
/* If len is zero then WideCharToMultiByte will return 0 indicating
* failure, but that will do just as well since we are ignoring
* possible errors.
*/
lenA
=
WideCharToMultiByte
(
CP_ACP
,
0
,
deformated
,
len
,
NULL
,
0
,
NULL
,
NULL
);
if
(
buffer
)
{
/* Ditto above */
WideCharToMultiByte
(
CP_ACP
,
0
,
deformated
,
len
,
buffer
,
*
size
,
NULL
,
NULL
);
if
(
*
size
>
lenA
)
{
rc
=
ERROR_SUCCESS
;
buffer
[
lenA
]
=
0
;
}
else
{
rc
=
ERROR_MORE_DATA
;
if
(
*
size
)
buffer
[(
*
size
)
-
1
]
=
0
;
}
}
else
rc
=
ERROR_SUCCESS
;
*
size
=
lenA
;
msi_free
(
rec
);
msi_free
(
deformated
);
return
rc
;
}
UINT
WINAPI
MsiFormatRecordW
(
MSIHANDLE
hInstall
,
MSIHANDLE
hRecord
,
UINT
WINAPI
MsiFormatRecordW
(
MSIHANDLE
hInstall
,
MSIHANDLE
hRecord
,
LPWSTR
szResult
,
DWORD
*
sz
)
LPWSTR
szResult
,
DWORD
*
sz
)
{
{
...
@@ -791,30 +740,48 @@ done:
...
@@ -791,30 +740,48 @@ done:
UINT
WINAPI
MsiFormatRecordA
(
MSIHANDLE
hInstall
,
MSIHANDLE
hRecord
,
UINT
WINAPI
MsiFormatRecordA
(
MSIHANDLE
hInstall
,
MSIHANDLE
hRecord
,
LPSTR
szResult
,
DWORD
*
sz
)
LPSTR
szResult
,
DWORD
*
sz
)
{
{
UINT
r
=
ERROR_INVALID_HANDLE
;
UINT
r
;
MSIPACKAGE
*
package
=
NULL
;
DWORD
len
,
save
;
MSIRECORD
*
record
=
NULL
;
LPWSTR
value
;
TRACE
(
"%ld %ld %p %p
\n
"
,
hInstall
,
hRecord
,
szResult
,
sz
);
TRACE
(
"%ld %ld %p %p
\n
"
,
hInstall
,
hRecord
,
szResult
,
sz
);
record
=
msihandle2msiinfo
(
hRecord
,
MSIHANDLETYPE_RECORD
);
if
(
!
hRecord
)
if
(
!
record
)
return
ERROR_INVALID_HANDLE
;
return
ERROR_INVALID_HANDLE
;
if
(
!
sz
)
if
(
!
sz
)
{
{
msiobj_release
(
&
record
->
hdr
);
if
(
szResult
)
if
(
szResult
)
return
ERROR_INVALID_PARAMETER
;
return
ERROR_INVALID_PARAMETER
;
else
else
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
r
=
MsiFormatRecordW
(
hInstall
,
hRecord
,
NULL
,
&
len
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
r
=
MSI_FormatRecordA
(
package
,
record
,
szResult
,
sz
);
value
=
msi_alloc
(
++
len
*
sizeof
(
WCHAR
));
msiobj_release
(
&
record
->
hdr
);
if
(
!
value
)
if
(
package
)
return
ERROR_OUTOFMEMORY
;
msiobj_release
(
&
package
->
hdr
);
r
=
MsiFormatRecordW
(
hInstall
,
hRecord
,
value
,
&
len
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
save
=
len
+
1
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
value
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
value
,
-
1
,
szResult
,
*
sz
,
NULL
,
NULL
);
if
(
szResult
&&
len
>
*
sz
)
{
if
(
*
sz
)
szResult
[
*
sz
-
1
]
=
'\0'
;
r
=
ERROR_MORE_DATA
;
}
*
sz
=
save
-
1
;
done:
msi_free
(
value
);
return
r
;
return
r
;
}
}
dlls/msi/msipriv.h
View file @
ba491991
...
@@ -691,7 +691,6 @@ extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR
...
@@ -691,7 +691,6 @@ extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR
/* for deformating */
/* for deformating */
extern
UINT
MSI_FormatRecordW
(
MSIPACKAGE
*
,
MSIRECORD
*
,
LPWSTR
,
DWORD
*
);
extern
UINT
MSI_FormatRecordW
(
MSIPACKAGE
*
,
MSIRECORD
*
,
LPWSTR
,
DWORD
*
);
extern
UINT
MSI_FormatRecordA
(
MSIPACKAGE
*
,
MSIRECORD
*
,
LPSTR
,
DWORD
*
);
/* registry data encoding/decoding functions */
/* registry data encoding/decoding functions */
extern
BOOL
unsquash_guid
(
LPCWSTR
in
,
LPWSTR
out
);
extern
BOOL
unsquash_guid
(
LPCWSTR
in
,
LPWSTR
out
);
...
...
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