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
19764fcf
Commit
19764fcf
authored
Nov 28, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupInstallFile{A, W}.
parent
d2a9bcd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
2 deletions
+109
-2
queue.c
dlls/setupapi/queue.c
+107
-0
setupapi.spec
dlls/setupapi/setupapi.spec
+2
-2
No files found.
dlls/setupapi/queue.c
View file @
19764fcf
...
@@ -1063,6 +1063,113 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
...
@@ -1063,6 +1063,113 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
}
}
/***********************************************************************
/***********************************************************************
* SetupInstallFileA (SETUPAPI.@)
*/
BOOL
WINAPI
SetupInstallFileA
(
HINF
hinf
,
PINFCONTEXT
inf_context
,
PCSTR
source
,
PCSTR
root
,
PCSTR
dest
,
DWORD
style
,
PSP_FILE_CALLBACK_A
handler
,
PVOID
context
)
{
BOOL
ret
=
FALSE
;
struct
callback_WtoA_context
ctx
;
UNICODE_STRING
sourceW
,
rootW
,
destW
;
TRACE
(
"%p %p %s %s %s %x %p %p
\n
"
,
hinf
,
inf_context
,
debugstr_a
(
source
),
debugstr_a
(
root
),
debugstr_a
(
dest
),
style
,
handler
,
context
);
sourceW
.
Buffer
=
rootW
.
Buffer
=
destW
.
Buffer
=
NULL
;
if
(
source
&&
!
RtlCreateUnicodeStringFromAsciiz
(
&
sourceW
,
source
))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
if
(
root
&&
!
RtlCreateUnicodeStringFromAsciiz
(
&
rootW
,
root
))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
goto
exit
;
}
if
(
dest
&&
!
RtlCreateUnicodeStringFromAsciiz
(
&
destW
,
dest
))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
goto
exit
;
}
ctx
.
orig_context
=
context
;
ctx
.
orig_handler
=
handler
;
ret
=
SetupInstallFileW
(
hinf
,
inf_context
,
sourceW
.
Buffer
,
rootW
.
Buffer
,
destW
.
Buffer
,
style
,
QUEUE_callback_WtoA
,
&
ctx
);
exit:
RtlFreeUnicodeString
(
&
sourceW
);
RtlFreeUnicodeString
(
&
rootW
);
RtlFreeUnicodeString
(
&
destW
);
return
ret
;
}
/***********************************************************************
* SetupInstallFileW (SETUPAPI.@)
*/
BOOL
WINAPI
SetupInstallFileW
(
HINF
hinf
,
PINFCONTEXT
inf_context
,
PCWSTR
source
,
PCWSTR
root
,
PCWSTR
dest
,
DWORD
style
,
PSP_FILE_CALLBACK_W
handler
,
PVOID
context
)
{
static
const
WCHAR
CopyFiles
[]
=
{
'C'
,
'o'
,
'p'
,
'y'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
0
};
BOOL
ret
,
absolute
=
(
root
&&
*
root
&&
!
(
style
&
SP_COPY_SOURCE_ABSOLUTE
));
WCHAR
*
buffer
,
*
p
,
*
inf_source
=
NULL
;
unsigned
int
len
;
TRACE
(
"%p %p %s %s %s %x %p %p
\n
"
,
hinf
,
inf_context
,
debugstr_w
(
source
),
debugstr_w
(
root
),
debugstr_w
(
dest
),
style
,
handler
,
context
);
if
(
hinf
)
{
INFCONTEXT
ctx
;
if
(
!
inf_context
)
{
inf_context
=
&
ctx
;
if
(
!
SetupFindFirstLineW
(
hinf
,
CopyFiles
,
NULL
,
inf_context
))
return
FALSE
;
}
if
(
!
SetupGetStringFieldW
(
inf_context
,
1
,
NULL
,
0
,
&
len
))
return
FALSE
;
if
(
!
(
inf_source
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
if
(
!
SetupGetStringFieldW
(
inf_context
,
1
,
inf_source
,
len
,
NULL
))
return
FALSE
;
source
=
inf_source
;
}
else
if
(
!
source
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
len
=
strlenW
(
source
)
+
1
;
if
(
absolute
)
len
+=
strlenW
(
root
)
+
1
;
if
(
!
(
p
=
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
inf_source
);
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
if
(
absolute
)
{
strcpyW
(
buffer
,
root
);
p
+=
strlenW
(
buffer
);
if
(
p
[
-
1
]
!=
'\\'
)
*
p
++
=
'\\'
;
}
while
(
*
source
==
'\\'
)
source
++
;
strcpyW
(
p
,
source
);
ret
=
do_file_copyW
(
buffer
,
dest
,
style
,
handler
,
context
);
HeapFree
(
GetProcessHeap
(),
0
,
inf_source
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
ret
;
}
/***********************************************************************
* SetupCommitFileQueueW (SETUPAPI.@)
* SetupCommitFileQueueW (SETUPAPI.@)
*/
*/
BOOL
WINAPI
SetupCommitFileQueueW
(
HWND
owner
,
HSPFILEQ
handle
,
PSP_FILE_CALLBACK_W
handler
,
BOOL
WINAPI
SetupCommitFileQueueW
(
HWND
owner
,
HSPFILEQ
handle
,
PSP_FILE_CALLBACK_W
handler
,
...
...
dlls/setupapi/setupapi.spec
View file @
19764fcf
...
@@ -434,10 +434,10 @@
...
@@ -434,10 +434,10 @@
@ stdcall SetupInitDefaultQueueCallbackEx(long long long long ptr)
@ stdcall SetupInitDefaultQueueCallbackEx(long long long long ptr)
@ stdcall SetupInitializeFileLogA (str long)
@ stdcall SetupInitializeFileLogA (str long)
@ stdcall SetupInitializeFileLogW (wstr long)
@ stdcall SetupInitializeFileLogW (wstr long)
@ st
ub SetupInstallFileA
@ st
dcall SetupInstallFileA(ptr ptr str str str long ptr ptr)
@ stub SetupInstallFileExA
@ stub SetupInstallFileExA
@ stub SetupInstallFileExW
@ stub SetupInstallFileExW
@ st
ub SetupInstallFileW
@ st
dcall SetupInstallFileW(ptr ptr wstr wstr wstr long ptr ptr)
@ stdcall SetupInstallFilesFromInfSectionA(long long long str str long)
@ stdcall SetupInstallFilesFromInfSectionA(long long long str str long)
@ stdcall SetupInstallFilesFromInfSectionW(long long long wstr wstr long)
@ stdcall SetupInstallFilesFromInfSectionW(long long long wstr wstr long)
@ stdcall SetupInstallFromInfSectionA(long long str long long str long ptr ptr long ptr)
@ stdcall SetupInstallFromInfSectionA(long long str long long str long ptr ptr long ptr)
...
...
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