Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9a0f38e2
Commit
9a0f38e2
authored
Dec 08, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Use an iface instead of a vtbl pointer in SystemClockImpl.
parent
e86dff72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
systemclock.c
dlls/quartz/systemclock.c
+16
-11
No files found.
dlls/quartz/systemclock.c
View file @
9a0f38e2
...
...
@@ -37,7 +37,7 @@ struct SystemClockAdviseEntry {
};
typedef
struct
SystemClockImpl
{
const
IReferenceClockVtbl
*
lpVtbl
;
IReferenceClock
IReferenceClock_iface
;
LONG
ref
;
/** IReferenceClock */
...
...
@@ -52,6 +52,11 @@ typedef struct SystemClockImpl {
SystemClockAdviseEntry
*
pPeriodicAdvise
;
}
SystemClockImpl
;
static
inline
SystemClockImpl
*
impl_from_IReferenceClock
(
IReferenceClock
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
SystemClockImpl
,
IReferenceClock_iface
);
}
static
void
QUARTZ_RemoveAviseEntryFromQueue
(
SystemClockImpl
*
This
,
SystemClockAdviseEntry
*
pEntry
)
{
if
(
pEntry
->
prev
)
pEntry
->
prev
->
next
=
pEntry
->
next
;
...
...
@@ -104,7 +109,7 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) {
EnterCriticalSection
(
&
This
->
safe
);
/*timeOut = IReferenceClock_OnTimerUpdated(This); */
hr
=
IReferenceClock_GetTime
(
(
IReferenceClock
*
)
This
,
&
curTime
);
hr
=
IReferenceClock_GetTime
(
&
This
->
IReferenceClock_iface
,
&
curTime
);
if
(
FAILED
(
hr
))
{
timeOut
=
INFINITE
;
goto
outrefresh
;
...
...
@@ -191,7 +196,7 @@ static BOOL SystemClockPostMessageToAdviseThread(SystemClockImpl* This, UINT iMs
}
static
ULONG
WINAPI
SystemClockImpl_AddRef
(
IReferenceClock
*
iface
)
{
SystemClockImpl
*
This
=
(
SystemClockImpl
*
)
iface
;
SystemClockImpl
*
This
=
impl_from_IReferenceClock
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p): AddRef from %d
\n
"
,
This
,
ref
-
1
);
...
...
@@ -200,7 +205,7 @@ static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock* iface) {
}
static
HRESULT
WINAPI
SystemClockImpl_QueryInterface
(
IReferenceClock
*
iface
,
REFIID
riid
,
void
**
ppobj
)
{
SystemClockImpl
*
This
=
(
SystemClockImpl
*
)
iface
;
SystemClockImpl
*
This
=
impl_from_IReferenceClock
(
iface
)
;
TRACE
(
"(%p, %s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
...
...
@@ -216,7 +221,7 @@ static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock* iface, REF
}
static
ULONG
WINAPI
SystemClockImpl_Release
(
IReferenceClock
*
iface
)
{
SystemClockImpl
*
This
=
(
SystemClockImpl
*
)
iface
;
SystemClockImpl
*
This
=
impl_from_IReferenceClock
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p): ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
...
...
@@ -232,7 +237,7 @@ static ULONG WINAPI SystemClockImpl_Release(IReferenceClock* iface) {
}
static
HRESULT
WINAPI
SystemClockImpl_GetTime
(
IReferenceClock
*
iface
,
REFERENCE_TIME
*
pTime
)
{
SystemClockImpl
*
This
=
(
SystemClockImpl
*
)
iface
;
SystemClockImpl
*
This
=
impl_from_IReferenceClock
(
iface
)
;
DWORD
curTimeTickCount
;
HRESULT
hr
=
S_OK
;
...
...
@@ -254,7 +259,7 @@ static HRESULT WINAPI SystemClockImpl_GetTime(IReferenceClock* iface, REFERENCE_
}
static
HRESULT
WINAPI
SystemClockImpl_AdviseTime
(
IReferenceClock
*
iface
,
REFERENCE_TIME
rtBaseTime
,
REFERENCE_TIME
rtStreamTime
,
HEVENT
hEvent
,
DWORD_PTR
*
pdwAdviseCookie
)
{
SystemClockImpl
*
This
=
(
SystemClockImpl
*
)
iface
;
SystemClockImpl
*
This
=
impl_from_IReferenceClock
(
iface
)
;
SystemClockAdviseEntry
*
pEntry
=
NULL
;
TRACE
(
"(%p, 0x%s, 0x%s, %ld, %p)
\n
"
,
This
,
wine_dbgstr_longlong
(
rtBaseTime
),
...
...
@@ -290,7 +295,7 @@ static HRESULT WINAPI SystemClockImpl_AdviseTime(IReferenceClock* iface, REFEREN
}
static
HRESULT
WINAPI
SystemClockImpl_AdvisePeriodic
(
IReferenceClock
*
iface
,
REFERENCE_TIME
rtStartTime
,
REFERENCE_TIME
rtPeriodTime
,
HSEMAPHORE
hSemaphore
,
DWORD_PTR
*
pdwAdviseCookie
)
{
SystemClockImpl
*
This
=
(
SystemClockImpl
*
)
iface
;
SystemClockImpl
*
This
=
impl_from_IReferenceClock
(
iface
)
;
SystemClockAdviseEntry
*
pEntry
=
NULL
;
TRACE
(
"(%p, 0x%s, 0x%s, %ld, %p)
\n
"
,
This
,
wine_dbgstr_longlong
(
rtStartTime
),
...
...
@@ -326,7 +331,7 @@ static HRESULT WINAPI SystemClockImpl_AdvisePeriodic(IReferenceClock* iface, REF
}
static
HRESULT
WINAPI
SystemClockImpl_Unadvise
(
IReferenceClock
*
iface
,
DWORD_PTR
dwAdviseCookie
)
{
SystemClockImpl
*
This
=
(
SystemClockImpl
*
)
iface
;
SystemClockImpl
*
This
=
impl_from_IReferenceClock
(
iface
)
;
SystemClockAdviseEntry
*
pEntry
=
NULL
;
SystemClockAdviseEntry
*
it
=
NULL
;
HRESULT
ret
=
S_OK
;
...
...
@@ -377,12 +382,12 @@ HRESULT QUARTZ_CreateSystemClock(IUnknown * pUnkOuter, LPVOID * ppv) {
}
ZeroMemory
(
obj
,
sizeof
(
SystemClockImpl
));
obj
->
lpVtbl
=
&
SystemClock_Vtbl
;
obj
->
IReferenceClock_iface
.
lpVtbl
=
&
SystemClock_Vtbl
;
obj
->
ref
=
0
;
/* will be inited by QueryInterface */
obj
->
lastTimeTickCount
=
GetTickCount
();
InitializeCriticalSection
(
&
obj
->
safe
);
obj
->
safe
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": SystemClockImpl.safe"
);
return
SystemClockImpl_QueryInterface
(
(
IReferenceClock
*
)
obj
,
&
IID_IReferenceClock
,
ppv
);
return
SystemClockImpl_QueryInterface
(
&
obj
->
IReferenceClock_iface
,
&
IID_IReferenceClock
,
ppv
);
}
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