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,
UINT
rc
;
media_info
source_struct
;
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
),
dwContext
,
dwOptions
,
debugstr_w
(
szSource
),
dwIndex
);
...
...
@@ -633,8 +639,19 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
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
;
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
);
/* found the source */
...
...
@@ -646,7 +663,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
{
DWORD
current_index
=
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
])
current_index
=
atoiW
(
source_struct
.
szIndex
);
...
...
@@ -657,9 +674,10 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
current_index
++
;
sprintfW
(
source_struct
.
szIndex
,
fmt
,
current_index
);
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
(
sourcekey
);
return
rc
;
...
...
dlls/msi/tests/source.c
View file @
dde89244
...
...
@@ -419,11 +419,8 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
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 */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
...
...
@@ -434,20 +431,14 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
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
;
res
=
RegQueryValueExA
(
url
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
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 */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
...
...
@@ -533,11 +524,8 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
net
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
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 */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
...
...
@@ -581,11 +569,8 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"5"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
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 */
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
NULL
,
...
...
@@ -596,20 +581,14 @@ static void test_MsiSourceListAddSourceEx(void)
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
net
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
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
;
res
=
RegQueryValueExA
(
net
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
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 */
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