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
dde89244
Commit
dde89244
authored
Nov 05, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Nov 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Append a slash to network and url sources.
parent
798429f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
38 deletions
+35
-38
source.c
dlls/msi/source.c
+21
-3
source.c
dlls/msi/tests/source.c
+14
-35
No files found.
dlls/msi/source.c
View file @
dde89244
...
@@ -590,6 +590,12 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -590,6 +590,12 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
UINT
rc
;
UINT
rc
;
media_info
source_struct
;
media_info
source_struct
;
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
squished_pc
[
GUID_SIZE
];
LPWSTR
source
;
LPCWSTR
postfix
;
DWORD
size
;
static
const
WCHAR
backslash
[]
=
{
'\\'
,
0
};
static
const
WCHAR
forwardslash
[]
=
{
'/'
,
0
};
TRACE
(
"%s %s %x %x %s %i
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szUserSid
),
TRACE
(
"%s %s %x %x %s %i
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szUserSid
),
dwContext
,
dwOptions
,
debugstr_w
(
szSource
),
dwIndex
);
dwContext
,
dwOptions
,
debugstr_w
(
szSource
),
dwIndex
);
...
@@ -633,8 +639,19 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -633,8 +639,19 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
return
ERROR_FUNCTION_FAILED
;
return
ERROR_FUNCTION_FAILED
;
}
}
postfix
=
(
dwOptions
&
MSISOURCETYPE_NETWORK
)
?
backslash
:
forwardslash
;
if
(
szSource
[
lstrlenW
(
szSource
)
-
1
]
==
*
postfix
)
source
=
strdupW
(
szSource
);
else
{
size
=
lstrlenW
(
szSource
)
+
2
;
source
=
msi_alloc
(
size
*
sizeof
(
WCHAR
));
lstrcpyW
(
source
,
szSource
);
lstrcatW
(
source
,
postfix
);
}
source_struct
.
szIndex
[
0
]
=
0
;
source_struct
.
szIndex
[
0
]
=
0
;
if
(
find_given_source
(
typekey
,
s
zSource
,
&
source_struct
)
==
ERROR_SUCCESS
)
if
(
find_given_source
(
typekey
,
s
ource
,
&
source_struct
)
==
ERROR_SUCCESS
)
{
{
DWORD
current_index
=
atoiW
(
source_struct
.
szIndex
);
DWORD
current_index
=
atoiW
(
source_struct
.
szIndex
);
/* found the source */
/* found the source */
...
@@ -646,7 +663,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -646,7 +663,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
{
{
DWORD
current_index
=
0
;
DWORD
current_index
=
0
;
static
const
WCHAR
fmt
[]
=
{
'%'
,
'i'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
'i'
,
0
};
DWORD
size
=
lstrlenW
(
s
zSource
)
*
sizeof
(
WCHAR
);
DWORD
size
=
lstrlenW
(
s
ource
)
*
sizeof
(
WCHAR
);
if
(
source_struct
.
szIndex
[
0
])
if
(
source_struct
.
szIndex
[
0
])
current_index
=
atoiW
(
source_struct
.
szIndex
);
current_index
=
atoiW
(
source_struct
.
szIndex
);
...
@@ -657,9 +674,10 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -657,9 +674,10 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
current_index
++
;
current_index
++
;
sprintfW
(
source_struct
.
szIndex
,
fmt
,
current_index
);
sprintfW
(
source_struct
.
szIndex
,
fmt
,
current_index
);
rc
=
RegSetValueExW
(
typekey
,
source_struct
.
szIndex
,
0
,
REG_EXPAND_SZ
,
rc
=
RegSetValueExW
(
typekey
,
source_struct
.
szIndex
,
0
,
REG_EXPAND_SZ
,
(
const
BYTE
*
)
s
zS
ource
,
size
);
(
const
BYTE
*
)
source
,
size
);
}
}
msi_free
(
source
);
RegCloseKey
(
typekey
);
RegCloseKey
(
typekey
);
RegCloseKey
(
sourcekey
);
RegCloseKey
(
sourcekey
);
return
rc
;
return
rc
;
...
...
dlls/msi/tests/source.c
View file @
dde89244
...
@@ -419,11 +419,8 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -419,11 +419,8 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
{
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
}
/* add another source, index 0 */
/* add another source, index 0 */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
...
@@ -434,20 +431,14 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -434,20 +431,14 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
{
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
}
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
url
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"another/"
),
"Expected 'another/', got %s
\n
"
,
value
);
{
ok
(
size
==
9
,
"Expected 9, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"another/"
),
"Expected 'another/', got %s
\n
"
,
value
);
ok
(
size
==
9
,
"Expected 9, got %d
\n
"
,
size
);
}
/* add another source, index 1 */
/* add another source, index 1 */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
...
@@ -533,11 +524,8 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -533,11 +524,8 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
net
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
net
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"source
\\
"
),
"Expected 'source
\\
', got %s
\n
"
,
value
);
{
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"source
\\
"
),
"Expected 'source
\\
', got %s
\n
"
,
value
);
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
}
/* just MSISOURCETYPE_URL */
/* just MSISOURCETYPE_URL */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
...
@@ -581,11 +569,8 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -581,11 +569,8 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"5"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
url
,
"5"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"source/"
),
"Expected 'source/', got %s
\n
"
,
value
);
{
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"source/"
),
"Expected 'source/', got %s
\n
"
,
value
);
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
}
/* NULL szUserSid */
/* NULL szUserSid */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
NULL
,
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
NULL
,
...
@@ -596,20 +581,14 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -596,20 +581,14 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
net
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
net
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"source
\\
"
),
"Expected 'source
\\
', got %s
\n
"
,
value
);
{
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"source
\\
"
),
"Expected 'source
\\
', got %s
\n
"
,
value
);
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
}
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
net
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
net
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"nousersid
\\
"
),
"Expected 'nousersid
\\
', got %s
\n
"
,
value
);
{
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"nousersid
\\
"
),
"Expected 'nousersid
\\
', got %s
\n
"
,
value
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
}
/* invalid options, must have source type */
/* invalid options, must have source type */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
...
...
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