Commit 20074ac8 authored by Alexandre Julliard's avatar Alexandre Julliard

mshtml: Avoid using a global display DC.

parent aaf4e1d9
......@@ -123,10 +123,12 @@ static HRESULT WINAPI HTMLScreen_Invoke(IHTMLScreen *iface, DISPID dispIdMember,
static HRESULT WINAPI HTMLScreen_get_colorDepth(IHTMLScreen *iface, LONG *p)
{
HTMLScreen *This = impl_from_IHTMLScreen(iface);
HDC hdc = GetDC(0);
TRACE("(%p)->(%p)\n", This, p);
*p = GetDeviceCaps(get_display_dc(), BITSPIXEL);
*p = GetDeviceCaps(hdc, BITSPIXEL);
ReleaseDC(0, hdc);
return S_OK;
}
......@@ -150,7 +152,7 @@ static HRESULT WINAPI HTMLScreen_get_width(IHTMLScreen *iface, LONG *p)
TRACE("(%p)->(%p)\n", This, p);
*p = GetDeviceCaps(get_display_dc(), HORZRES);
*p = GetSystemMetrics(SM_CXSCREEN);
return S_OK;
}
......@@ -160,7 +162,7 @@ static HRESULT WINAPI HTMLScreen_get_height(IHTMLScreen *iface, LONG *p)
TRACE("(%p)->(%p)\n", This, p);
*p = GetDeviceCaps(get_display_dc(), VERTRES);
*p = GetSystemMetrics(SM_CYSCREEN);
return S_OK;
}
......
......@@ -51,7 +51,6 @@ HINSTANCE hInst;
DWORD mshtml_tls = TLS_OUT_OF_INDEXES;
static HINSTANCE shdoclc = NULL;
static HDC display_dc;
static WCHAR *status_strings[IDS_STATUS_LAST-IDS_STATUS_FIRST+1];
static IMultiLanguage2 *mlang;
......@@ -140,8 +139,6 @@ static void process_detach(void)
FreeLibrary(shdoclc);
if(mshtml_tls != TLS_OUT_OF_INDEXES)
TlsFree(mshtml_tls);
if(display_dc)
DeleteObject(display_dc);
if(mlang)
IMultiLanguage2_Release(mlang);
......@@ -210,21 +207,6 @@ HINSTANCE get_shdoclc(void)
return shdoclc = LoadLibraryExW(wszShdoclc, NULL, LOAD_LIBRARY_AS_DATAFILE);
}
HDC get_display_dc(void)
{
static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0};
if(!display_dc) {
HDC hdc;
hdc = CreateICW(displayW, NULL, NULL, NULL);
if(InterlockedCompareExchangePointer((void**)&display_dc, hdc, NULL))
DeleteObject(hdc);
}
return display_dc;
}
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved)
{
switch(fdwReason) {
......
......@@ -1348,7 +1348,6 @@ extern void *call_thiscall_func;
UINT cp_from_charset_string(BSTR) DECLSPEC_HIDDEN;
BSTR charset_string_from_cp(UINT) DECLSPEC_HIDDEN;
HDC get_display_dc(void) DECLSPEC_HIDDEN;
HINSTANCE get_shdoclc(void) DECLSPEC_HIDDEN;
void set_statustext(HTMLDocumentObj*,INT,LPCWSTR) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment