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
0b7a17d2
Commit
0b7a17d2
authored
Nov 13, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 13, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Clean upstore_binary_to_temp.
parent
1ccf9449
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
41 deletions
+36
-41
custom.c
dlls/msi/custom.c
+36
-41
No files found.
dlls/msi/custom.c
View file @
0b7a17d2
...
...
@@ -284,62 +284,57 @@ end:
}
static
UINT
store_binary_to_temp
(
MSIPACKAGE
*
package
,
LPCWSTR
source
,
static
UINT
store_binary_to_temp
(
MSIPACKAGE
*
package
,
LPCWSTR
source
,
LPWSTR
tmp_file
)
{
DWORD
sz
=
MAX_PATH
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'B'
,
'i'
,
'n'
,
'a'
,
'r'
,
'y'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'N'
,
'a'
,
'm'
,
'e'
,
'`'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
UINT
rc
;
MSIRECORD
*
row
=
0
;
HANDLE
file
;
CHAR
buffer
[
1024
];
static
const
WCHAR
f1
[]
=
{
'm'
,
's'
,
'i'
,
0
};
WCHAR
fmt
[
MAX_PATH
];
DWORD
sz
=
MAX_PATH
;
if
(
MSI_GetPropertyW
(
package
,
cszTempFolder
,
fmt
,
&
sz
)
!=
ERROR_SUCCESS
)
GetTempPathW
(
MAX_PATH
,
fmt
);
GetTempPathW
(
MAX_PATH
,
fmt
);
if
(
GetTempFileNameW
(
fmt
,
f1
,
0
,
tmp_file
)
==
0
)
if
(
GetTempFileNameW
(
fmt
,
f1
,
0
,
tmp_file
)
==
0
)
{
TRACE
(
"Unable to create file
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
else
{
/* write out the file */
UINT
rc
;
MSIRECORD
*
row
=
0
;
static
const
WCHAR
fmt
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'B'
,
'i'
,
'n'
,
'a'
,
'r'
,
'y'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'N'
,
'a'
,
'm'
,
'e'
,
'`'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
HANDLE
the_file
;
CHAR
buffer
[
1024
];
the_file
=
CreateFileW
(
tmp_file
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
the_file
==
INVALID_HANDLE_VALUE
)
return
ERROR_FUNCTION_FAILED
;
row
=
MSI_QueryGetRecord
(
package
->
db
,
fmt
,
source
);
if
(
!
row
)
return
ERROR_FUNCTION_FAILED
;
/* write out the file */
file
=
CreateFileW
(
tmp_file
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
return
ERROR_FUNCTION_FAILED
;
do
{
DWORD
write
;
sz
=
1024
;
rc
=
MSI_RecordReadStream
(
row
,
2
,
buffer
,
&
sz
);
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to get stream
\n
"
);
CloseHandle
(
the_file
);
DeleteFileW
(
tmp_file
);
break
;
}
WriteFile
(
the_file
,
buffer
,
sz
,
&
write
,
NULL
);
}
while
(
sz
==
1024
);
row
=
MSI_QueryGetRecord
(
package
->
db
,
query
,
source
);
if
(
!
row
)
return
ERROR_FUNCTION_FAILED
;
CloseHandle
(
the_file
);
do
{
DWORD
write
;
sz
=
sizeof
buffer
;
rc
=
MSI_RecordReadStream
(
row
,
2
,
buffer
,
&
sz
);
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to get stream
\n
"
);
CloseHandle
(
file
);
DeleteFileW
(
tmp_file
);
break
;
}
WriteFile
(
file
,
buffer
,
sz
,
&
write
,
NULL
);
}
while
(
sz
==
sizeof
buffer
);
msiobj_release
(
&
row
->
hdr
);
}
CloseHandle
(
file
);
msiobj_release
(
&
row
->
hdr
);
return
ERROR_SUCCESS
;
}
...
...
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