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
1bd49bcf
Commit
1bd49bcf
authored
Feb 25, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement MsiSourceListEnumMediaDisks.
parent
45d7d6a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
196 additions
and
2 deletions
+196
-2
msi.spec
dlls/msi/msi.spec
+2
-2
source.c
dlls/msi/source.c
+188
-0
msi.h
include/msi.h
+6
-0
No files found.
dlls/msi/msi.spec
View file @
1bd49bcf
...
...
@@ -264,8 +264,8 @@
268 stdcall MsiSourceListSetInfoW(wstr wstr long long wstr wstr)
269 stub MsiEnumPatchesExA
270 stub MsiEnumPatchesExW
271 st
ub MsiSourceListEnumMediaDisksA
272 st
ub MsiSourceListEnumMediaDisksW
271 st
dcall MsiSourceListEnumMediaDisksA(str str long long long ptr ptr ptr ptr ptr)
272 st
dcall MsiSourceListEnumMediaDisksW(wstr wstr long long long ptr ptr ptr ptr ptr)
273 stdcall MsiSourceListAddMediaDiskA(str str long long long str str)
274 stdcall MsiSourceListAddMediaDiskW(wstr wstr long long long wstr wstr)
275 stub MsiSourceListClearMediaDiskA
...
...
dlls/msi/source.c
View file @
1bd49bcf
...
...
@@ -141,6 +141,194 @@ static UINT OpenURLSubkey(HKEY rootkey, HKEY *key, BOOL create)
}
/******************************************************************
* MsiSourceListEnumMediaDisksA (MSI.@)
*/
UINT
WINAPI
MsiSourceListEnumMediaDisksA
(
LPCSTR
szProductCodeOrPatchCode
,
LPCSTR
szUserSid
,
MSIINSTALLCONTEXT
dwContext
,
DWORD
dwOptions
,
DWORD
dwIndex
,
LPWORD
pdwDiskId
,
LPSTR
szVolumeLabel
,
LPDWORD
pcchVolumeLabel
,
LPSTR
szDiskPrompt
,
LPDWORD
pcchDiskPrompt
)
{
LPWSTR
product
=
NULL
;
LPWSTR
usersid
=
NULL
;
LPWSTR
volume
=
NULL
;
LPWSTR
prompt
=
NULL
;
DWORD
volumesz
,
promptsz
;
UINT
r
=
ERROR_INVALID_PARAMETER
;
TRACE
(
"(%s, %s, %d, %d, %d, %p, %p, %p, %p, %p)
\n
"
,
debugstr_a
(
szProductCodeOrPatchCode
),
debugstr_a
(
szUserSid
),
dwContext
,
dwOptions
,
dwIndex
,
pdwDiskId
,
szVolumeLabel
,
pcchVolumeLabel
,
szDiskPrompt
,
pcchDiskPrompt
);
if
(
szDiskPrompt
&&
!
pcchDiskPrompt
)
return
ERROR_INVALID_PARAMETER
;
if
(
szProductCodeOrPatchCode
)
product
=
strdupAtoW
(
szProductCodeOrPatchCode
);
if
(
szUserSid
)
usersid
=
strdupAtoW
(
szUserSid
);
/* FIXME: add tests for an invalid format */
if
(
pcchVolumeLabel
)
volume
=
msi_alloc
(
*
pcchVolumeLabel
*
sizeof
(
WCHAR
));
if
(
pcchDiskPrompt
)
prompt
=
msi_alloc
(
*
pcchDiskPrompt
*
sizeof
(
WCHAR
));
if
(
volume
)
*
volume
=
'\0'
;
if
(
prompt
)
*
prompt
=
'\0'
;
r
=
MsiSourceListEnumMediaDisksW
(
product
,
usersid
,
dwContext
,
dwOptions
,
dwIndex
,
pdwDiskId
,
volume
,
pcchVolumeLabel
,
prompt
,
pcchDiskPrompt
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
if
(
szVolumeLabel
&&
pcchVolumeLabel
)
volumesz
=
WideCharToMultiByte
(
CP_ACP
,
0
,
volume
,
-
1
,
szVolumeLabel
,
*
pcchVolumeLabel
+
1
,
NULL
,
NULL
);
if
(
szDiskPrompt
)
promptsz
=
WideCharToMultiByte
(
CP_ACP
,
0
,
prompt
,
-
1
,
szDiskPrompt
,
*
pcchDiskPrompt
+
1
,
NULL
,
NULL
);
done:
msi_free
(
product
);
msi_free
(
usersid
);
msi_free
(
volume
);
msi_free
(
prompt
);
return
r
;
}
/******************************************************************
* MsiSourceListEnumMediaDisksW (MSI.@)
*/
UINT
WINAPI
MsiSourceListEnumMediaDisksW
(
LPCWSTR
szProductCodeOrPatchCode
,
LPCWSTR
szUserSid
,
MSIINSTALLCONTEXT
dwContext
,
DWORD
dwOptions
,
DWORD
dwIndex
,
LPWORD
pdwDiskId
,
LPWSTR
szVolumeLabel
,
LPDWORD
pcchVolumeLabel
,
LPWSTR
szDiskPrompt
,
LPDWORD
pcchDiskPrompt
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
LPWSTR
value
=
NULL
;
LPWSTR
data
=
NULL
;
LPWSTR
ptr
;
HKEY
source
,
media
;
DWORD
valuesz
,
datasz
=
0
;
DWORD
type
;
DWORD
numvals
,
size
;
LONG
res
;
UINT
r
;
static
int
index
=
0
;
TRACE
(
"(%s, %s, %d, %d, %d, %p, %p, %p, %p)
\n
"
,
debugstr_w
(
szProductCodeOrPatchCode
),
debugstr_w
(
szUserSid
),
dwContext
,
dwOptions
,
dwIndex
,
szVolumeLabel
,
pcchVolumeLabel
,
szDiskPrompt
,
pcchDiskPrompt
);
if
(
!
szProductCodeOrPatchCode
||
!
squash_guid
(
szProductCodeOrPatchCode
,
squished_pc
))
return
ERROR_INVALID_PARAMETER
;
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
&&
szUserSid
)
return
ERROR_INVALID_PARAMETER
;
if
(
dwOptions
!=
MSICODE_PRODUCT
&&
dwOptions
!=
MSICODE_PATCH
)
return
ERROR_INVALID_PARAMETER
;
if
(
szDiskPrompt
&&
!
pcchDiskPrompt
)
return
ERROR_INVALID_PARAMETER
;
if
(
dwIndex
==
0
)
index
=
0
;
if
(
dwIndex
!=
index
)
return
ERROR_INVALID_PARAMETER
;
r
=
OpenSourceKey
(
szProductCodeOrPatchCode
,
&
source
,
dwOptions
,
dwContext
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
r
=
OpenMediaSubkey
(
source
,
&
media
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
{
RegCloseKey
(
source
);
return
ERROR_NO_MORE_ITEMS
;
}
if
(
!
pcchVolumeLabel
&&
!
pcchDiskPrompt
)
{
r
=
RegEnumValueW
(
media
,
dwIndex
,
NULL
,
NULL
,
NULL
,
&
type
,
NULL
,
NULL
);
goto
done
;
}
res
=
RegQueryInfoKeyW
(
media
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
numvals
,
&
valuesz
,
&
datasz
,
NULL
,
NULL
);
if
(
res
!=
ERROR_SUCCESS
)
{
r
=
ERROR_BAD_CONFIGURATION
;
goto
done
;
}
value
=
msi_alloc
(
++
valuesz
*
sizeof
(
WCHAR
));
data
=
msi_alloc
(
++
datasz
*
sizeof
(
WCHAR
));
if
(
!
value
||
!
data
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
r
=
RegEnumValueW
(
media
,
dwIndex
,
value
,
&
valuesz
,
NULL
,
&
type
,
(
LPBYTE
)
data
,
&
datasz
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
if
(
pdwDiskId
)
*
pdwDiskId
=
atolW
(
value
);
ptr
=
strchrW
(
data
,
';'
);
if
(
!
ptr
)
ptr
=
data
;
else
*
ptr
=
'\0'
;
if
(
pcchVolumeLabel
)
{
size
=
lstrlenW
(
data
);
if
(
size
>=
*
pcchVolumeLabel
)
r
=
ERROR_MORE_DATA
;
else
if
(
szVolumeLabel
)
lstrcpyW
(
szVolumeLabel
,
data
);
*
pcchVolumeLabel
=
size
;
}
if
(
pcchDiskPrompt
)
{
data
=
ptr
;
if
(
!*
data
)
data
++
;
size
=
lstrlenW
(
data
);
if
(
size
>=
*
pcchDiskPrompt
)
r
=
ERROR_MORE_DATA
;
else
if
(
szDiskPrompt
)
lstrcpyW
(
szDiskPrompt
,
data
);
*
pcchDiskPrompt
=
size
;
}
index
++
;
done:
msi_free
(
value
);
msi_free
(
data
);
RegCloseKey
(
source
);
return
r
;
}
/******************************************************************
* MsiSourceListEnumSourcesA (MSI.@)
*/
UINT
WINAPI
MsiSourceListEnumSourcesA
(
LPCSTR
szProductCodeOrPatch
,
LPCSTR
szUserSid
,
...
...
include/msi.h
View file @
1bd49bcf
...
...
@@ -537,6 +537,12 @@ UINT WINAPI MsiSourceListAddSourceA(LPCSTR, LPCSTR, DWORD, LPCSTR);
UINT
WINAPI
MsiSourceListAddSourceW
(
LPCWSTR
,
LPCWSTR
,
DWORD
,
LPCWSTR
);
#define MsiSourceListAddSource WINELIB_NAME_AW(MsiSourceListAddSource)
UINT
WINAPI
MsiSourceListEnumMediaDisksA
(
LPCSTR
,
LPCSTR
,
MSIINSTALLCONTEXT
,
DWORD
,
DWORD
,
LPWORD
,
LPSTR
,
LPDWORD
,
LPSTR
,
LPDWORD
);
UINT
WINAPI
MsiSourceListEnumMediaDisksW
(
LPCWSTR
,
LPCWSTR
,
MSIINSTALLCONTEXT
,
DWORD
,
DWORD
,
LPWORD
,
LPWSTR
,
LPDWORD
,
LPWSTR
,
LPDWORD
);
#define MsiSourceListEnumMediaDisks WINELIB_NAME_AW(MsiSourceListEnumMediaDisks)
UINT
WINAPI
MsiSourceListEnumSourcesA
(
LPCSTR
,
LPCSTR
,
MSIINSTALLCONTEXT
,
DWORD
,
DWORD
,
LPSTR
,
LPDWORD
);
UINT
WINAPI
MsiSourceListEnumSourcesW
(
LPCWSTR
,
LPCWSTR
,
MSIINSTALLCONTEXT
,
DWORD
,
DWORD
,
LPWSTR
,
LPDWORD
);
#define MsiSourceListEnumSources WINELIB_NAME_AW(MsiSourceListEnumSources)
...
...
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