设为首页 加入收藏

TOP

C标准库源码解读(VC9.0版本)――assert.h(四)
2014-11-23 23:18:09 】 浏览:4596
Tags:标准 源码 解读 VC9.0 版本 assert.h
;
pfnGetLastActivePopup = (PFNGetLastActivePopup)
_encode_pointer(GetProcAddress(hlib, "GetLastActivePopup"));
pfn =
#ifdef _UNICODE
GetProcAddress(hlib, "GetUserObjectInformationW");
#else /* _UNICODE */
GetProcAddress(hlib, "GetUserObjectInformationA");
#endif /* _UNICODE */
pfnGetUserObjectInformation = (PFNGetUserObjectInformation) _encode_pointer(pfn);
if (pfnGetUserObjectInformation != NULL)
pfnGetProcessWindowStation = (PFNGetProcessWindowStation)
_encode_pointer(GetProcAddress(hlib, "GetProcessWindowStation"));
}
/*
* If the current process isn't attached to a visible WindowStation,
* (e.g. a non-interactive service), then we need to set the
* MB_SERVICE_NOTIFICATION flag, else the message box will be
* invisible, hanging the program.
*
* This check only applies to Windows NT-based systems (for which we
* retrieved the address of GetProcessWindowStation above).
*/
if (pfnGetProcessWindowStation != enull && pfnGetUserObjectInformation != enull)
{
/* check for NULL expliticly to pacify prefix */
PFNGetProcessWindowStation dpfnGetProcessWindowStation=(PFNGetProcessWindowStation) _decode_pointer(pfnGetProcessWindowStation);
PFNGetUserObjectInformation dpfnGetUserObjectInformation=(PFNGetUserObjectInformation) _decode_pointer(pfnGetUserObjectInformation);
if(dpfnGetProcessWindowStation && dpfnGetUserObjectInformation)
{
if (NULL == (hwinsta = (dpfnGetProcessWindowStation)()) ||
!(dpfnGetUserObjectInformation)
(hwinsta, UOI_FLAGS, &uof, sizeof(uof), &nDummy) ||
(uof.dwFlags & WSF_VISIBLE) == 0)
{
fNonInteractive = TRUE;
}
}
}
if (fNonInteractive)
{
uType |= MB_SERVICE_NOTIFICATION;
}
else
{
if (pfnGetActiveWindow != enull)
{
PFNGetActiveWindow dpfnGetActiveWindow=(PFNGetActiveWindow) _decode_pointer(pfnGetActiveWindow);
if(dpfnGetActiveWindow)
{
hWndParent = (dpfnGetActiveWindow)();
}
}
if (hWndParent != NULL && pfnGetLastActivePopup != enull)
{
PFNGetLastActivePopup dpfnGetLastActivePopup=(PFNGetLastActivePopup) _decode_pointer(pfnGetLastActivePopup);
if(dpfnGetLastActivePopup)
{
hWndParent = (dpfnGetLastActivePopup)(hWndParent);
}
}
}
/* scope */
{
PFNMessageBox dpfnMessageBox=(PFNMessageBox) _decode_pointer(pfnMessageBox);
if(dpfnMessageBox)
{
return (dpfnMessageBox)(hWndParent, lpText, lpCaption, uType);
}
else
{
/* should never happen */
return 0;
}
}
}
首页 上一页 1 2 3 4 下一页 尾页 4/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇[C和指针]不定参数 下一篇[Slackware]Build Broadcom 802.1..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目