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
5871bee8
Commit
5871bee8
authored
Mar 10, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Mar 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Optimize MsiSourceListAddSourceEx for adding to the end of the list.
parent
0118e0d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
source.c
dlls/msi/source.c
+13
-8
No files found.
dlls/msi/source.c
View file @
5871bee8
...
...
@@ -934,12 +934,15 @@ static void free_source_list(struct list *sourcelist)
}
}
static
void
add_source_to_list
(
struct
list
*
sourcelist
,
media_info
*
info
)
static
void
add_source_to_list
(
struct
list
*
sourcelist
,
media_info
*
info
,
DWORD
*
index
)
{
media_info
*
iter
;
BOOL
found
=
FALSE
;
static
const
WCHAR
fmt
[]
=
{
'%'
,
'i'
,
0
};
if
(
index
)
*
index
=
0
;
if
(
list_empty
(
sourcelist
))
{
list_add_head
(
sourcelist
,
&
info
->
entry
);
...
...
@@ -957,6 +960,8 @@ static void add_source_to_list(struct list *sourcelist, media_info *info)
/* update the rest of the list */
if
(
found
)
sprintfW
(
iter
->
szIndex
,
fmt
,
++
iter
->
index
);
else
if
(
index
)
(
*
index
)
++
;
}
if
(
!
found
)
...
...
@@ -1005,7 +1010,7 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
}
index
=
++
(
*
count
);
add_source_to_list
(
sourcelist
,
entry
);
add_source_to_list
(
sourcelist
,
entry
,
NULL
);
}
error:
...
...
@@ -1031,6 +1036,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
LPWSTR
source
;
LPCWSTR
postfix
;
DWORD
size
,
count
;
DWORD
index
;
static
const
WCHAR
fmt
[]
=
{
'%'
,
'i'
,
0
};
static
const
WCHAR
one
[]
=
{
'1'
,
0
};
...
...
@@ -1098,7 +1104,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
rc
=
RegSetValueExW
(
typekey
,
one
,
0
,
REG_EXPAND_SZ
,
(
LPBYTE
)
source
,
size
);
goto
done
;
}
else
if
(
dwIndex
>
count
)
else
if
(
dwIndex
>
count
||
dwIndex
==
0
)
{
sprintfW
(
name
,
fmt
,
count
+
1
);
rc
=
RegSetValueExW
(
typekey
,
name
,
0
,
REG_EXPAND_SZ
,
(
LPBYTE
)
source
,
size
);
...
...
@@ -1106,10 +1112,6 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
}
else
{
/* add to the end of the list */
if
(
dwIndex
==
0
)
dwIndex
=
count
+
1
;
sprintfW
(
name
,
fmt
,
dwIndex
);
info
=
msi_alloc
(
sizeof
(
media_info
));
if
(
!
info
)
...
...
@@ -1121,10 +1123,13 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
info
->
path
=
strdupW
(
source
);
lstrcpyW
(
info
->
szIndex
,
name
);
info
->
index
=
dwIndex
;
add_source_to_list
(
&
sourcelist
,
info
);
add_source_to_list
(
&
sourcelist
,
info
,
&
index
);
LIST_FOR_EACH_ENTRY
(
info
,
&
sourcelist
,
media_info
,
entry
)
{
if
(
info
->
index
<
index
)
continue
;
size
=
(
lstrlenW
(
info
->
path
)
+
1
)
*
sizeof
(
WCHAR
);
rc
=
RegSetValueExW
(
typekey
,
info
->
szIndex
,
0
,
REG_EXPAND_SZ
,
(
LPBYTE
)
info
->
path
,
size
);
...
...
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