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
e340cafe
Commit
e340cafe
authored
Jun 27, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
Jun 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemenubuilder: Create/release semaphore only around call to wineshelllink.
parent
c03125a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
winemenubuilder.c
programs/winemenubuilder/winemenubuilder.c
+13
-12
No files found.
programs/winemenubuilder/winemenubuilder.c
View file @
e340cafe
...
...
@@ -907,6 +907,7 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bAgain )
WCHAR
szArgs
[
INFOTIPSIZE
],
szIconPath
[
MAX_PATH
];
int
iIconId
=
0
,
r
=
-
1
;
DWORD
csidl
=
-
1
;
HANDLE
hsem
=
NULL
;
if
(
!
link
)
{
...
...
@@ -1015,11 +1016,23 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bAgain )
escaped_args
=
escape
(
szArgs
);
escaped_description
=
escape
(
szDescription
);
/* running multiple instances of wineshelllink
at the same time may be dangerous */
hsem
=
CreateSemaphoreA
(
NULL
,
1
,
1
,
"winemenubuilder_semaphore"
);
if
(
WAIT_OBJECT_0
!=
WaitForSingleObject
(
hsem
,
INFINITE
)
)
{
WINE_ERR
(
"failed wait for semaphore
\n
"
);
goto
cleanup
;
}
r
=
fork_and_wait
(
"wineshelllink"
,
link_name
,
escaped_path
,
in_desktop_dir
(
csidl
),
escaped_args
,
icon_name
,
work_dir
?
work_dir
:
""
,
escaped_description
);
ReleaseSemaphore
(
hsem
,
1
,
NULL
);
cleanup:
if
(
hsem
)
CloseHandle
(
hsem
);
HeapFree
(
GetProcessHeap
(),
0
,
icon_name
);
HeapFree
(
GetProcessHeap
(),
0
,
work_dir
);
HeapFree
(
GetProcessHeap
(),
0
,
link_name
);
...
...
@@ -1147,17 +1160,8 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
{
LPSTR
token
=
NULL
,
p
;
BOOL
bAgain
=
FALSE
;
HANDLE
hsem
=
CreateSemaphoreA
(
NULL
,
1
,
1
,
"winemenubuilder_semaphore"
);
int
ret
=
0
;
/* running multiple instances of wineshelllink
at the same time may be dangerous */
if
(
WAIT_OBJECT_0
!=
WaitForSingleObject
(
hsem
,
INFINITE
)
)
{
CloseHandle
(
hsem
);
return
FALSE
;
}
for
(
p
=
cmdline
;
p
&&
*
p
;
)
{
token
=
next_token
(
&
p
);
...
...
@@ -1182,8 +1186,5 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
}
}
ReleaseSemaphore
(
hsem
,
1
,
NULL
);
CloseHandle
(
hsem
);
return
ret
;
}
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