Try to avoid clobbering SysLink GWLP_USERDATA
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6949 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
dda1998421
commit
bcef923727
6 changed files with 18 additions and 6 deletions
|
@ -268,7 +268,7 @@ static bool GetTLBVersionInterop(const TCHAR *filepath, DWORD &high, DWORD &low)
|
|||
{
|
||||
if (!result && !resonly) result = MSTLB_GetVersion(pFileData, size, high, low); // A raw TLB file?
|
||||
if (!result) result = GetTLBVersionUsingRE(pFileData, size, resid, high, low); // A resource in a PE file?
|
||||
// TODO: if (!result) result = GetTLBVersion16(pFileData, size, resid, high, low); // A resouce in a 16-bit executable?
|
||||
// TODO: if (!result) result = GetTLBVersion16(pFileData, size, resid, high, low); // A resource in a 16-bit executable?
|
||||
free(pFileData);
|
||||
}
|
||||
// Not supported: if (!result) result = GetTLBVersionFromMoniker(filepath, high, low);
|
||||
|
|
|
@ -126,6 +126,13 @@ static void NSISCALL NotifyCurWnd(UINT uNotifyCode)
|
|||
#define GetUIItem(it) GetDlgItem(hwndDlg,it)
|
||||
|
||||
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
// "Link Window"/"SysLink" stores a pointer in GWLP_USERDATA on 2000/XP/2003 and it crashes if we clobber it (forums.winamp.com/showthread.php?t=333379).
|
||||
// Checking for ROLE_SYSTEM_LINK is probably more reliable but requires more code.
|
||||
#define IsNSISCtlColor(p) ( ( ((p)->lbStyle) <= 1 ) /* BS_SOLID||BS_HOLLOW */ \
|
||||
&& ( (UINT)((p)->bkmode) <= 2 ) /* TRANSPARENT||OPAQUE */ \
|
||||
&& ( ((p)->flags >> CC_FLAGSSHIFTFORZERO) == 0 ) /* CC_* flags */ \
|
||||
)
|
||||
|
||||
#define HandleStaticBkColor() _HandleStaticBkColor(uMsg, wParam, lParam)
|
||||
static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -133,7 +140,7 @@ static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
{
|
||||
ctlcolors *c = (ctlcolors *)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
|
||||
|
||||
if (c) {
|
||||
if (c && IsNSISCtlColor(c)) {
|
||||
COLORREF text;
|
||||
LOGBRUSH lh;
|
||||
|
||||
|
@ -156,7 +163,7 @@ static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
lh.lbStyle = c->lbStyle;
|
||||
if (c->bkb)
|
||||
DeleteObject(c->bkb);
|
||||
c->bkb = CreateBrushIndirect(&lh);
|
||||
c->bkb = CreateBrushIndirect(&lh); // LOGBRUSH::lbHatch is ignored by BS_SOLID and BS_HOLLOW
|
||||
}
|
||||
|
||||
return (INT_PTR)c->bkb;
|
||||
|
@ -166,7 +173,7 @@ static INT_PTR NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
}
|
||||
#else
|
||||
#define HandleStaticBkColor() 0
|
||||
#endif//!NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
#endif//~ NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
|
||||
#ifdef NSIS_CONFIG_LOG
|
||||
#if !defined(NSIS_CONFIG_LOG_ODS) && !defined(NSIS_CONFIG_LOG_STDOUT)
|
||||
|
|
|
@ -467,12 +467,14 @@ typedef struct
|
|||
int parms[5];
|
||||
} page;
|
||||
|
||||
// text/bg color
|
||||
// ctlcolors text/bg color flags
|
||||
#define CC_TEXT 1
|
||||
#define CC_TEXT_SYS 2
|
||||
#define CC_BK 4
|
||||
#define CC_BK_SYS 8
|
||||
#define CC_BKB 16
|
||||
#define CC_FLAGSMASK 0x1f
|
||||
#define CC_FLAGSSHIFTFORZERO 5
|
||||
|
||||
typedef struct {
|
||||
COLORREF text;
|
||||
|
|
|
@ -149,6 +149,7 @@ void page_writer::write(const page *data)
|
|||
|
||||
void ctlcolors_writer::write(const ctlcolors *data, const writer_target_info&ti)
|
||||
{
|
||||
assert(CC_FLAGSMASK >> CC_FLAGSSHIFTFORZERO == 0);
|
||||
assert(sizeof(int) == 4 && sizeof(ctlcolors64) > sizeof(ctlcolors32));
|
||||
const ctlcolors *p = data;
|
||||
m_sink->write_int(p->text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue