msi: Encode the stream name before trying to open it.
This commit is contained in:
parent
b833ae0263
commit
dcbe0fdff2
|
@ -135,7 +135,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
|
||||||
STREAM *stream;
|
STREAM *stream;
|
||||||
IStream *stm;
|
IStream *stm;
|
||||||
STATSTG stat;
|
STATSTG stat;
|
||||||
LPWSTR name = NULL;
|
LPWSTR encname = NULL, name = NULL;
|
||||||
USHORT *data = NULL;
|
USHORT *data = NULL;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
ULONG count;
|
ULONG count;
|
||||||
|
@ -181,6 +181,8 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
encname = encode_streamname(FALSE, name);
|
||||||
|
|
||||||
r = write_stream_data(sv->db->storage, name, data, count, FALSE);
|
r = write_stream_data(sv->db->storage, name, data, count, FALSE);
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@ -192,7 +194,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
|
||||||
if (!stream)
|
if (!stream)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
hr = IStorage_OpenStream(sv->db->storage, name, 0,
|
hr = IStorage_OpenStream(sv->db->storage, encname, 0,
|
||||||
STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream->stream);
|
STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream->stream);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
|
@ -205,6 +207,7 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
|
||||||
done:
|
done:
|
||||||
msi_free(name);
|
msi_free(name);
|
||||||
msi_free(data);
|
msi_free(data);
|
||||||
|
msi_free(encname);
|
||||||
|
|
||||||
IStream_Release(stm);
|
IStream_Release(stm);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue