*** ./shmem.c.orig	Sun Aug 29 07:06:46 2004
--- ./shmem.c	Mon Oct 18 16:35:32 2004
***************
*** 87,95 ****
  	HANDLE		hmap;
  	char		szShareMem[32];
  	DWORD		dwRet;
  
  	s_segsize = size;
! 	sprintf(szShareMem, "sharemem.%d", memKey);
  
  	if (flag & IPC_CREAT)
  	{
--- 87,105 ----
  	HANDLE		hmap;
  	char		szShareMem[32];
  	DWORD		dwRet;
+ 	OSVERSIONINFO	osvi;
  
+ 	osvi.dwOSVersionInfoSize = sizeof(osvi);
+ 	osvi.dwPlatformId = VER_PLATFORM_WIN32_NT;
+ 	osvi.dwMajorVersion = 5;
+ 
+ 	GetVersionEx(&osvi);
+ 
  	s_segsize = size;
! 	if (osvi.dwPlatformId >= VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5) 
! 		sprintf(szShareMem, "Global\\sharemem.%d", memKey);
! 	else
! 		sprintf(szShareMem, "sharemem.%d", memKey);
  
  	if (flag & IPC_CREAT)
  	{
