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
5e7fa021
Commit
5e7fa021
authored
Aug 29, 2000
by
Andreas Mohr
Committed by
Alexandre Julliard
Aug 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix one locking ignorant return 0; in MSG_SendMessageInterThread()
- fix a crash in QUEUE_RemoveSMSG() - convert some queue WARN() to ERR() - spaileng fikses
parent
2b5d9c6e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
input.c
windows/input.c
+1
-1
message.c
windows/message.c
+5
-1
queue.c
windows/queue.c
+16
-16
No files found.
windows/input.c
View file @
5e7fa021
...
@@ -463,7 +463,7 @@ HWND WINAPI GetCapture(void)
...
@@ -463,7 +463,7 @@ HWND WINAPI GetCapture(void)
/* Get the messageQ for the current thread */
/* Get the messageQ for the current thread */
if
(
!
(
pCurMsgQ
=
(
MESSAGEQUEUE
*
)
QUEUE_Lock
(
GetFastQueue16
()
)))
if
(
!
(
pCurMsgQ
=
(
MESSAGEQUEUE
*
)
QUEUE_Lock
(
GetFastQueue16
()
)))
{
{
TRACE_
(
win
)(
"GetCapture
32:
Current message queue not found. Exiting!
\n
"
);
TRACE_
(
win
)(
"GetCapture
:
Current message queue not found. Exiting!
\n
"
);
return
0
;
return
0
;
}
}
...
...
windows/message.c
View file @
5e7fa021
...
@@ -837,7 +837,10 @@ static LRESULT MSG_SendMessageInterThread( HQUEUE16 hDestQueue,
...
@@ -837,7 +837,10 @@ static LRESULT MSG_SendMessageInterThread( HQUEUE16 hDestQueue,
/* add smsg struct in the pending list of the destination queue */
/* add smsg struct in the pending list of the destination queue */
if
(
QUEUE_AddSMSG
(
destQ
,
SM_PENDING_LIST
,
smsg
)
==
FALSE
)
if
(
QUEUE_AddSMSG
(
destQ
,
SM_PENDING_LIST
,
smsg
)
==
FALSE
)
return
0
;
{
retVal
=
0
;
goto
CLEANUP
;
}
iWndsLocks
=
WIN_SuspendWndsLock
();
iWndsLocks
=
WIN_SuspendWndsLock
();
...
@@ -905,6 +908,7 @@ got:
...
@@ -905,6 +908,7 @@ got:
LeaveCriticalSection
(
&
queue
->
cSection
);
LeaveCriticalSection
(
&
queue
->
cSection
);
CLEANUP:
QUEUE_Unlock
(
queue
);
QUEUE_Unlock
(
queue
);
QUEUE_Unlock
(
destQ
);
QUEUE_Unlock
(
destQ
);
...
...
windows/queue.c
View file @
5e7fa021
...
@@ -304,7 +304,7 @@ INT16 PERQDATA_SetCaptureInfo( PERQUEUEDATA *pQData, INT16 nCaptureHT )
...
@@ -304,7 +304,7 @@ INT16 PERQDATA_SetCaptureInfo( PERQUEUEDATA *pQData, INT16 nCaptureHT )
/***********************************************************************
/***********************************************************************
* QUEUE_Lock
* QUEUE_Lock
*
*
* Function for getting a 32 bit pointer on queue strcture. For thread
* Function for getting a 32 bit pointer on queue str
u
cture. For thread
* safeness programmers should use this function instead of GlobalLock to
* safeness programmers should use this function instead of GlobalLock to
* retrieve a pointer on the structure. QUEUE_Unlock should also be called
* retrieve a pointer on the structure. QUEUE_Unlock should also be called
* when access to the queue structure is not required anymore.
* when access to the queue structure is not required anymore.
...
@@ -536,7 +536,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
...
@@ -536,7 +536,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
if
(
!
hQueue
||
!
msgQueue
)
if
(
!
hQueue
||
!
msgQueue
)
{
{
WARN
_
(
msg
)(
"invalid argument.
\n
"
);
ERR
_
(
msg
)(
"invalid argument.
\n
"
);
return
0
;
return
0
;
}
}
...
@@ -567,7 +567,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
...
@@ -567,7 +567,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
if
(
!
msgQ
||
(
msgQ
->
magic
!=
QUEUE_MAGIC
)
)
if
(
!
msgQ
||
(
msgQ
->
magic
!=
QUEUE_MAGIC
)
)
{
{
/* HQUEUE link list is corrupted, try to exit gracefully */
/* HQUEUE link list is corrupted, try to exit gracefully */
WARN
_
(
msg
)(
"HQUEUE link list corrupted!
\n
"
);
ERR
_
(
msg
)(
"HQUEUE link list corrupted!
\n
"
);
pPrev
=
0
;
pPrev
=
0
;
break
;
break
;
}
}
...
@@ -578,7 +578,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
...
@@ -578,7 +578,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
HeapUnlock
(
SystemHeap
);
HeapUnlock
(
SystemHeap
);
/* free up resource used by MESSAGEQUEUE strcture */
/* free up resource used by MESSAGEQUEUE str
u
cture */
msgQueue
->
lockCount
--
;
msgQueue
->
lockCount
--
;
QUEUE_Unlock
(
msgQueue
);
QUEUE_Unlock
(
msgQueue
);
...
@@ -791,7 +791,7 @@ BOOL QUEUE_AddSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
...
@@ -791,7 +791,7 @@ BOOL QUEUE_AddSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
}
}
default:
default:
WARN
_
(
sendmsg
)(
"Invalid list: %d"
,
list
);
ERR
_
(
sendmsg
)(
"Invalid list: %d"
,
list
);
break
;
break
;
}
}
...
@@ -802,8 +802,8 @@ BOOL QUEUE_AddSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
...
@@ -802,8 +802,8 @@ BOOL QUEUE_AddSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
/***********************************************************************
/***********************************************************************
* QUEUE_RemoveSMSG
* QUEUE_RemoveSMSG
*
*
* This routine is called when a SMSG need
to be remove
from one of the three
* This routine is called when a SMSG need
s to be removed
from one of the three
* SM list
. (SM_PROCESSING_LIST, SM_PENDING_LIST, SM_WAITING_LIST)
* SM list
s (SM_PROCESSING_LIST, SM_PENDING_LIST, SM_WAITING_LIST).
* If smsg == 0, remove the first smsg from the specified list
* If smsg == 0, remove the first smsg from the specified list
*/
*/
SMSG
*
QUEUE_RemoveSMSG
(
MESSAGEQUEUE
*
queue
,
int
list
,
SMSG
*
smsg
)
SMSG
*
QUEUE_RemoveSMSG
(
MESSAGEQUEUE
*
queue
,
int
list
,
SMSG
*
smsg
)
...
@@ -864,12 +864,12 @@ SMSG *QUEUE_RemoveSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
...
@@ -864,12 +864,12 @@ SMSG *QUEUE_RemoveSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
receiver thread */
receiver thread */
EnterCriticalSection
(
&
queue
->
cSection
);
EnterCriticalSection
(
&
queue
->
cSection
);
if
(
!
smsg
||
!
queue
->
smPending
)
if
(
!
smsg
)
smsg
=
queue
->
smPending
;
smsg
=
queue
->
smPending
;
else
if
(
(
smsg
!=
queue
->
smPending
)
||
!
queue
->
smPending
)
{
{
ERR_
(
sendmsg
)(
"should always remove the top one in Pending list, smsg=0x%p queue=0x%p"
,
smsg
,
queue
);
ERR_
(
sendmsg
)(
"should always remove the top one in Pending list, smsg=0x%p queue=0x%p"
,
smsg
,
queue
);
LeaveCriticalSection
(
&
queue
->
cSection
);
LeaveCriticalSection
(
&
queue
->
cSection
);
return
0
;
return
0
;
}
}
...
@@ -887,7 +887,7 @@ SMSG *QUEUE_RemoveSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
...
@@ -887,7 +887,7 @@ SMSG *QUEUE_RemoveSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
return
smsg
;
return
smsg
;
default:
default:
WARN
_
(
sendmsg
)(
"Invalid list: %d"
,
list
);
ERR
_
(
sendmsg
)(
"Invalid list: %d"
,
list
);
break
;
break
;
}
}
...
@@ -966,7 +966,7 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue )
...
@@ -966,7 +966,7 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue )
smsg
->
flags
|=
SMSG_SENDING_REPLY
;
smsg
->
flags
|=
SMSG_SENDING_REPLY
;
ReplyMessage
(
result
);
ReplyMessage
(
result
);
TRACE_
(
sendmsg
)(
"done!
\n
"
);
TRACE_
(
sendmsg
)(
"done!
\n
"
);
}
}
...
@@ -1196,7 +1196,7 @@ void hardware_event( UINT message, WPARAM wParam, LPARAM lParam,
...
@@ -1196,7 +1196,7 @@ void hardware_event( UINT message, WPARAM wParam, LPARAM lParam,
if
(
!
mergeMsg
)
if
(
!
mergeMsg
)
{
{
/* Should I limit the number of message in
/* Should I limit the number of message
s
in
the system message queue??? */
the system message queue??? */
/* Don't merge allocate a new msg in the global heap */
/* Don't merge allocate a new msg in the global heap */
...
@@ -1250,10 +1250,10 @@ HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue )
...
@@ -1250,10 +1250,10 @@ HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue )
MESSAGEQUEUE
*
queue
=
QUEUE_Lock
(
hQueue
);
MESSAGEQUEUE
*
queue
=
QUEUE_Lock
(
hQueue
);
if
(
queue
)
if
(
queue
)
{
{
hTask
=
queue
->
teb
->
htask16
;
hTask
=
queue
->
teb
->
htask16
;
QUEUE_Unlock
(
queue
);
QUEUE_Unlock
(
queue
);
}
}
return
hTask
;
return
hTask
;
}
}
...
@@ -1431,7 +1431,7 @@ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags )
...
@@ -1431,7 +1431,7 @@ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags )
/* Create thread message queue */
/* Create thread message queue */
if
(
!
(
hQueue
=
QUEUE_CreateMsgQueue
(
TRUE
)))
if
(
!
(
hQueue
=
QUEUE_CreateMsgQueue
(
TRUE
)))
{
{
WARN
_
(
msg
)(
"failed!
\n
"
);
ERR
_
(
msg
)(
"failed!
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
...
...
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