Skip to content

Commit

Permalink
More define and Win64 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonUnch authored Jan 1, 2023
1 parent 4ec39b7 commit 46b1cd0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kilib/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,10 @@ LRESULT CALLBACK WndImpl::StartProc(
ThisAndParam* pz = static_cast<ThisAndParam*>(cs->lpCreateParams);
WndImpl* pThis = pz->pThis;
cs->lpCreateParams = pz->pParam;
#ifdef NO_ASM
// Store the this pointer in GWLP_USERDATA when not using ASM thunking
::SetWindowLongPtr(wnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pThis));

#endif
// サンク
pThis->SetUpThunk( wnd );

Expand Down Expand Up @@ -717,10 +719,10 @@ void WndImpl::SetUpThunk( HWND wnd )
}

#ifdef NO_ASM
// To avoid ASM thunking we can use GWL_USERDATA in the window structure
// To avoid ASM thunking we can use GWLP_USERDATA in the window structure
LRESULT CALLBACK WndImpl::TrunkMainProc( HWND wnd, UINT msg, WPARAM wp, LPARAM lp )
{
WndImpl* pThis = reinterpret_cast<WndImpl*>(GetWindowLong(wnd, GWL_USERDATA));
WndImpl* pThis = reinterpret_cast<WndImpl*>(GetWindowLong(wnd, GWLP_USERDATA));
if(pThis) {
return WndImpl::MainProc(pThis, msg, wp, lp);
} else {
Expand Down

0 comments on commit 46b1cd0

Please sign in to comment.