mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 16:54:09 +00:00
Removed a number of global handle allocations and critical section
initializations.
This commit is contained in:
parent
11342151c9
commit
227a0894d4
|
@ -13,9 +13,9 @@
|
||||||
#include "winversion.h"
|
#include "winversion.h"
|
||||||
#include "wine/undocshell.h"
|
#include "wine/undocshell.h"
|
||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(shell)
|
DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
|
|
||||||
static CRITICAL_SECTION SHELL32_ChangenotifyCS;
|
static CRITICAL_SECTION SHELL32_ChangenotifyCS = CRITICAL_SECTION_INIT;
|
||||||
|
|
||||||
/* internal list of notification clients (internal) */
|
/* internal list of notification clients (internal) */
|
||||||
typedef struct _NOTIFICATIONLIST
|
typedef struct _NOTIFICATIONLIST
|
||||||
|
@ -30,17 +30,12 @@ typedef struct _NOTIFICATIONLIST
|
||||||
DWORD dwFlags; /* client flags */
|
DWORD dwFlags; /* client flags */
|
||||||
} NOTIFICATIONLIST, *LPNOTIFICATIONLIST;
|
} NOTIFICATIONLIST, *LPNOTIFICATIONLIST;
|
||||||
|
|
||||||
NOTIFICATIONLIST head;
|
static NOTIFICATIONLIST head;
|
||||||
NOTIFICATIONLIST tail;
|
static NOTIFICATIONLIST tail;
|
||||||
|
|
||||||
void InitChangeNotifications()
|
void InitChangeNotifications()
|
||||||
{
|
{
|
||||||
TRACE("head=%p tail=%p\n", &head, &tail);
|
TRACE("head=%p tail=%p\n", &head, &tail);
|
||||||
|
|
||||||
InitializeCriticalSection(&SHELL32_ChangenotifyCS);
|
|
||||||
MakeCriticalSectionGlobal(&SHELL32_ChangenotifyCS);
|
|
||||||
ZeroMemory(&head, sizeof(NOTIFICATIONLIST));
|
|
||||||
ZeroMemory(&tail, sizeof(NOTIFICATIONLIST));
|
|
||||||
head.next = &tail;
|
head.next = &tail;
|
||||||
tail.prev = &head;
|
tail.prev = &head;
|
||||||
}
|
}
|
||||||
|
|
|
@ -451,7 +451,7 @@ typedef struct
|
||||||
} SIC_ENTRY, * LPSIC_ENTRY;
|
} SIC_ENTRY, * LPSIC_ENTRY;
|
||||||
|
|
||||||
static HDPA sic_hdpa = 0;
|
static HDPA sic_hdpa = 0;
|
||||||
static CRITICAL_SECTION SHELL32_SicCS;
|
static CRITICAL_SECTION SHELL32_SicCS = CRITICAL_SECTION_INIT;
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* SIC_CompareEntrys [called by comctl32.dll]
|
* SIC_CompareEntrys [called by comctl32.dll]
|
||||||
|
@ -612,9 +612,6 @@ BOOL SIC_Initialize(void)
|
||||||
if (sic_hdpa) /* already initialized?*/
|
if (sic_hdpa) /* already initialized?*/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
InitializeCriticalSection(&SHELL32_SicCS);
|
|
||||||
MakeCriticalSectionGlobal(&SHELL32_SicCS);
|
|
||||||
|
|
||||||
sic_hdpa = pDPA_Create(16);
|
sic_hdpa = pDPA_Create(16);
|
||||||
|
|
||||||
if (!sic_hdpa)
|
if (!sic_hdpa)
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "wine/winbase16.h"
|
#include "wine/winbase16.h"
|
||||||
|
|
||||||
#include "cursoricon.h"
|
|
||||||
#include "dce.h"
|
#include "dce.h"
|
||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
@ -61,15 +60,9 @@ BOOL WINAPI USER_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
/* Create the DCEs */
|
/* Create the DCEs */
|
||||||
DCE_Init();
|
DCE_Init();
|
||||||
|
|
||||||
/* Initialize timers */
|
|
||||||
if (!TIMER_Init()) return FALSE;
|
|
||||||
|
|
||||||
/* Initialize window procedures */
|
/* Initialize window procedures */
|
||||||
if (!WINPROC_Init()) return FALSE;
|
if (!WINPROC_Init()) return FALSE;
|
||||||
|
|
||||||
/* Initialize cursor/icons */
|
|
||||||
CURSORICON_Init();
|
|
||||||
|
|
||||||
/* Initialize built-in window classes */
|
/* Initialize built-in window classes */
|
||||||
if (!WIDGETS_Init()) return FALSE;
|
if (!WIDGETS_Init()) return FALSE;
|
||||||
|
|
||||||
|
|
|
@ -156,10 +156,6 @@ static void process_attach(void)
|
||||||
CLIPBOARD_Driver = &X11DRV_CLIPBOARD_Driver;
|
CLIPBOARD_Driver = &X11DRV_CLIPBOARD_Driver;
|
||||||
WND_Driver = &X11DRV_WND_Driver;
|
WND_Driver = &X11DRV_WND_Driver;
|
||||||
|
|
||||||
/* We need this before calling any Xlib function */
|
|
||||||
InitializeCriticalSection( &X11DRV_CritSection );
|
|
||||||
MakeCriticalSectionGlobal( &X11DRV_CritSection );
|
|
||||||
|
|
||||||
putenv("XKB_DISABLE="); /* Disable XKB extension if present. */
|
putenv("XKB_DISABLE="); /* Disable XKB extension if present. */
|
||||||
|
|
||||||
/* Open display */
|
/* Open display */
|
||||||
|
|
|
@ -81,7 +81,7 @@ static char PROFILE_WineIniUsed[MAX_PATHNAME_LEN] = "";
|
||||||
|
|
||||||
static const WCHAR wininiW[] = { 'w','i','n','.','i','n','i',0 };
|
static const WCHAR wininiW[] = { 'w','i','n','.','i','n','i',0 };
|
||||||
|
|
||||||
static CRITICAL_SECTION PROFILE_CritSect;
|
static CRITICAL_SECTION PROFILE_CritSect = CRITICAL_SECTION_INIT;
|
||||||
|
|
||||||
static const char hex[16] = "0123456789ABCDEF";
|
static const char hex[16] = "0123456789ABCDEF";
|
||||||
|
|
||||||
|
@ -944,10 +944,6 @@ int PROFILE_LoadWineIni(void)
|
||||||
ERR("Cannot create config registry key\n" );
|
ERR("Cannot create config registry key\n" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
wine_profile_key = ConvertToGlobalHandle( wine_profile_key );
|
|
||||||
|
|
||||||
InitializeCriticalSection( &PROFILE_CritSect );
|
|
||||||
MakeCriticalSectionGlobal( &PROFILE_CritSect );
|
|
||||||
|
|
||||||
if (!CLIENT_IsBootThread()) return 1; /* already loaded */
|
if (!CLIENT_IsBootThread()) return 1; /* already loaded */
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ static fontEncodingTemplate* fETTable = __fETTable;
|
||||||
|
|
||||||
static int DefResolution = 0;
|
static int DefResolution = 0;
|
||||||
|
|
||||||
static CRITICAL_SECTION crtsc_fonts_X11;
|
static CRITICAL_SECTION crtsc_fonts_X11 = CRITICAL_SECTION_INIT;
|
||||||
|
|
||||||
static fontResource* fontList = NULL;
|
static fontResource* fontList = NULL;
|
||||||
static fontObject* fontCache = NULL; /* array */
|
static fontObject* fontCache = NULL; /* array */
|
||||||
|
@ -2628,9 +2628,6 @@ BOOL X11DRV_FONT_Init( DeviceCaps* pDevCaps )
|
||||||
XFONT_LoadDefaults();
|
XFONT_LoadDefaults();
|
||||||
XFONT_LoadIgnores();
|
XFONT_LoadIgnores();
|
||||||
|
|
||||||
InitializeCriticalSection( &crtsc_fonts_X11 );
|
|
||||||
MakeCriticalSectionGlobal( &crtsc_fonts_X11 );
|
|
||||||
|
|
||||||
/* fontList initialization is over, allocate X font cache */
|
/* fontList initialization is over, allocate X font cache */
|
||||||
|
|
||||||
fontCache = (fontObject*) HeapAlloc(GetProcessHeap(), 0, fontCacheSize * sizeof(fontObject));
|
fontCache = (fontObject*) HeapAlloc(GetProcessHeap(), 0, fontCacheSize * sizeof(fontObject));
|
||||||
|
|
|
@ -70,8 +70,6 @@ typedef struct
|
||||||
#define CID_WIN32 0x0004
|
#define CID_WIN32 0x0004
|
||||||
#define CID_NONSHARED 0x0008
|
#define CID_NONSHARED 0x0008
|
||||||
|
|
||||||
extern void CURSORICON_Init( void );
|
|
||||||
|
|
||||||
extern HCURSOR16 CURSORICON_IconToCursor( HICON16 hIcon,
|
extern HCURSOR16 CURSORICON_IconToCursor( HICON16 hIcon,
|
||||||
BOOL bSemiTransparent );
|
BOOL bSemiTransparent );
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ extern BOOL MSG_InternalGetMessage( int type, struct tagMSG *msg, HWND hwnd,
|
||||||
WORD flags, BOOL sendIdle, BOOL* idleSent );
|
WORD flags, BOOL sendIdle, BOOL* idleSent );
|
||||||
|
|
||||||
/* timer.c */
|
/* timer.c */
|
||||||
extern BOOL TIMER_Init( void );
|
|
||||||
extern void TIMER_RemoveWindowTimers( HWND hwnd );
|
extern void TIMER_RemoveWindowTimers( HWND hwnd );
|
||||||
extern void TIMER_RemoveQueueTimers( HQUEUE16 hqueue );
|
extern void TIMER_RemoveQueueTimers( HQUEUE16 hqueue );
|
||||||
extern BOOL TIMER_GetTimerMsg( struct tagMSG *msg, HWND hwnd,
|
extern BOOL TIMER_GetTimerMsg( struct tagMSG *msg, HWND hwnd,
|
||||||
|
|
|
@ -384,9 +384,6 @@ HANDLE NE_OpenFile( NE_MODULE *pModule )
|
||||||
if ((cachedfd = CreateFileA( name, GENERIC_READ, FILE_SHARE_READ,
|
if ((cachedfd = CreateFileA( name, GENERIC_READ, FILE_SHARE_READ,
|
||||||
NULL, OPEN_EXISTING, 0, -1 )) == -1)
|
NULL, OPEN_EXISTING, 0, -1 )) == -1)
|
||||||
MESSAGE( "Can't open file '%s' for module %04x\n", name, pModule->self );
|
MESSAGE( "Can't open file '%s' for module %04x\n", name, pModule->self );
|
||||||
else
|
|
||||||
/* FIXME: should not be necessary */
|
|
||||||
cachedfd = ConvertToGlobalHandle(cachedfd);
|
|
||||||
TRACE("opened '%s' -> %d\n",
|
TRACE("opened '%s' -> %d\n",
|
||||||
name, cachedfd );
|
name, cachedfd );
|
||||||
return cachedfd;
|
return cachedfd;
|
||||||
|
|
|
@ -535,10 +535,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
|
||||||
/* Initialize critical section */
|
/* Initialize critical section */
|
||||||
|
|
||||||
InitializeCriticalSection( &heap->critSection );
|
InitializeCriticalSection( &heap->critSection );
|
||||||
/* FIXME: once separate address spaces are implemented, only */
|
if (!SystemHeap) MakeCriticalSectionGlobal( &heap->critSection );
|
||||||
/* the SystemHeap critical section should be global */
|
|
||||||
/* if (!SystemHeap) */
|
|
||||||
MakeCriticalSectionGlobal( &heap->critSection );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the first free block */
|
/* Create the first free block */
|
||||||
|
|
|
@ -36,7 +36,7 @@ static int *ph_errno = &h_errno;
|
||||||
DEFAULT_DEBUG_CHANNEL(thread)
|
DEFAULT_DEBUG_CHANNEL(thread)
|
||||||
|
|
||||||
/* Xlib critical section (FIXME: does not belong here) */
|
/* Xlib critical section (FIXME: does not belong here) */
|
||||||
CRITICAL_SECTION X11DRV_CritSection = { 0, };
|
CRITICAL_SECTION X11DRV_CritSection = CRITICAL_SECTION_INIT;
|
||||||
|
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
# ifdef HAVE_SCHED_H
|
# ifdef HAVE_SCHED_H
|
||||||
|
|
|
@ -59,7 +59,6 @@ SEGPTR WINAPI GetpWin16Lock16(void)
|
||||||
VOID WINAPI _CreateSysLevel(SYSLEVEL *lock, INT level)
|
VOID WINAPI _CreateSysLevel(SYSLEVEL *lock, INT level)
|
||||||
{
|
{
|
||||||
InitializeCriticalSection( &lock->crst );
|
InitializeCriticalSection( &lock->crst );
|
||||||
MakeCriticalSectionGlobal( &lock->crst );
|
|
||||||
lock->level = level;
|
lock->level = level;
|
||||||
|
|
||||||
TRACE("(%p, %d): handle is %d\n",
|
TRACE("(%p, %d): handle is %d\n",
|
||||||
|
|
|
@ -82,18 +82,9 @@ typedef struct tagICONCACHE
|
||||||
} ICONCACHE;
|
} ICONCACHE;
|
||||||
|
|
||||||
static ICONCACHE *IconAnchor = NULL;
|
static ICONCACHE *IconAnchor = NULL;
|
||||||
static CRITICAL_SECTION IconCrst;
|
static CRITICAL_SECTION IconCrst = CRITICAL_SECTION_INIT;
|
||||||
static DWORD ICON_HOTSPOT = 0x42424242;
|
static DWORD ICON_HOTSPOT = 0x42424242;
|
||||||
|
|
||||||
/**********************************************************************
|
|
||||||
* CURSORICON_Init
|
|
||||||
*/
|
|
||||||
void CURSORICON_Init( void )
|
|
||||||
{
|
|
||||||
InitializeCriticalSection( &IconCrst );
|
|
||||||
MakeCriticalSectionGlobal( &IconCrst );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* CURSORICON_FindSharedIcon
|
* CURSORICON_FindSharedIcon
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,21 +37,7 @@ typedef struct tagTIMER
|
||||||
|
|
||||||
static TIMER TimersArray[NB_TIMERS];
|
static TIMER TimersArray[NB_TIMERS];
|
||||||
|
|
||||||
static CRITICAL_SECTION csTimer;
|
static CRITICAL_SECTION csTimer = CRITICAL_SECTION_INIT;
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* TIMER_Init
|
|
||||||
*
|
|
||||||
* Initialize critical section for the timer.
|
|
||||||
*/
|
|
||||||
BOOL TIMER_Init( void )
|
|
||||||
{
|
|
||||||
InitializeCriticalSection( &csTimer );
|
|
||||||
MakeCriticalSectionGlobal( &csTimer );
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -2041,7 +2041,7 @@ int X11DRV_EVENT_PrepareShmCompletion( Drawable dw )
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (!shm_read)
|
if (!shm_read)
|
||||||
shm_read = ConvertToGlobalHandle( FILE_DupUnixHandle( ConnectionNumber(display), GENERIC_READ | SYNCHRONIZE ) );
|
shm_read = FILE_DupUnixHandle( ConnectionNumber(display), GENERIC_READ | SYNCHRONIZE );
|
||||||
|
|
||||||
for (n=0; n<SHM_MAX_Q; n++)
|
for (n=0; n<SHM_MAX_Q; n++)
|
||||||
if (!shm_q[n].draw)
|
if (!shm_q[n].draw)
|
||||||
|
@ -2055,7 +2055,7 @@ int X11DRV_EVENT_PrepareShmCompletion( Drawable dw )
|
||||||
|
|
||||||
shm_q[n].state = 0;
|
shm_q[n].state = 0;
|
||||||
if (!shm_q[n].sema) {
|
if (!shm_q[n].sema) {
|
||||||
shm_q[n].sema = ConvertToGlobalHandle( CreateSemaphoreA( NULL, 0, 256, NULL ) );
|
shm_q[n].sema = CreateSemaphoreA( NULL, 0, 256, NULL );
|
||||||
TRACE("Allocated ShmCompletion slots have been increased to %d, new semaphore is %x\n", n+1, shm_q[n].sema);
|
TRACE("Allocated ShmCompletion slots have been increased to %d, new semaphore is %x\n", n+1, shm_q[n].sema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue