Set the ownership before locking the bitmap in EngCreateDeviceSurface,
because GDIOBJ_SetOwnership runs in a dead lock if the object is already
locked by the same process.
This may fix bug 747.
Modified: trunk/reactos/subsys/win32k/eng/surface.c
_____
Modified: trunk/reactos/subsys/win32k/eng/surface.c
--- trunk/reactos/subsys/win32k/eng/surface.c 2005-09-03 11:51:22 UTC
(rev 17620)
+++ trunk/reactos/subsys/win32k/eng/surface.c 2005-09-03 17:40:33 UTC
(rev 17621)
@@ -394,6 +394,8 @@
if (NewSurface == NULL)
return 0;
+ GDIOBJ_SetOwnership(NewSurface, NULL);
+
BitmapObj = BITMAPOBJ_LockBitmap(NewSurface);
if (! BITMAPOBJ_InitBitsLock(BitmapObj))
{
@@ -403,8 +405,6 @@
}
SurfObj = &BitmapObj->SurfObj;
- GDIOBJ_SetOwnership(NewSurface, NULL);
-
SurfObj->dhsurf = dhsurf;
SurfObj->hsurf = NewSurface;
SurfObj->sizlBitmap = Size;
Setting my changes back for prompt.c. Greatlord and I agreed about
this. These was a miscommication about these changes and the way
different MS version handle it.
Modified: trunk/reactos/subsys/system/cmd/prompt.c
_____
Modified: trunk/reactos/subsys/system/cmd/prompt.c
--- trunk/reactos/subsys/system/cmd/prompt.c 2005-09-03 11:50:23 UTC
(rev 17619)
+++ trunk/reactos/subsys/system/cmd/prompt.c 2005-09-03 11:51:22 UTC
(rev 17620)
@@ -204,12 +204,20 @@
return 0;
}
+ /* if it is null, then it needs to set to default,
+ because that means the user entered "prompt" only.
+ so even if param is null you _must_ still set prompt
+ to the default. There seems to be some kinda difference
+ between winxp and 2k in this matter and this way will
+ cover both. */
+ if (param[0] != _T('\0'))
+ _tcscpy(szParam,param);
+ else
+ _tcscpy(szParam,_T("$P$G"));
+
/* set PROMPT environment variable */
- if (param[0] != _T('\0'))
- {
- if (!SetEnvironmentVariable (_T("PROMPT"), param))
- return 1;
- }
+ if (!SetEnvironmentVariable (_T("PROMPT"), szParam))
+ return 1;
return 0;
}
revers brandon change to prompt.c they are incorrect. Add a check if
prompt env are set or not. if it is not set cmd set the prompt value. in
cmd.c brandon forget that.
Modified: trunk/reactos/subsys/system/cmd/cmd.c
Modified: trunk/reactos/subsys/system/cmd/prompt.c
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c 2005-09-03 01:34:40 UTC
(rev 17613)
+++ trunk/reactos/subsys/system/cmd/cmd.c 2005-09-03 09:46:46 UTC
(rev 17614)
@@ -1311,6 +1311,7 @@
TCHAR commandline[CMDLINE_LENGTH];
TCHAR ModuleName[_MAX_PATH + 1];
INT i;
+ TCHAR lpBuffer[2];
//INT len;
//TCHAR *ptr, *cmdLine;
@@ -1358,7 +1359,12 @@
hOut = GetStdHandle (STD_OUTPUT_HANDLE);
hIn = GetStdHandle (STD_INPUT_HANDLE);
- SetEnvironmentVariable (_T("PROMPT"), _T("$P$G"));
+ /* Set EnvironmentVariable PROMPT if it does not exists any env
value.
+ for you can change the EnvirommentVariable for prompt before
cmd start
+ this patch are not 100% right, if it does not exists a PROMPT
value cmd should use
+ $P$G as defualt not set EnvirommentVariable PROMPT to $P$G if
it does not exists */
+ if (GetEnvironmentVariable(_T("PROMPT"),lpBuffer, 2 *
sizeof(TCHAR)) == 0)
+ SetEnvironmentVariable (_T("PROMPT"), _T("$P$G"));
if (argc >= 2 && !_tcsncmp (argv[1], _T("/?"), 2))
_____
Modified: trunk/reactos/subsys/system/cmd/prompt.c
--- trunk/reactos/subsys/system/cmd/prompt.c 2005-09-03 01:34:40 UTC
(rev 17613)
+++ trunk/reactos/subsys/system/cmd/prompt.c 2005-09-03 09:46:46 UTC
(rev 17614)
@@ -192,8 +192,7 @@
#ifdef INCLUDE_CMD_PROMPT
INT cmd_prompt (LPTSTR cmd, LPTSTR param)
-{
- TCHAR szParam[512];
+{
if (!_tcsncmp (param, _T("/?"), 2))
{
ConOutResPaging(TRUE,STRING_PROMPT_HELP1);
@@ -204,15 +203,14 @@
ConOutResPaging(FALSE,STRING_PROMPT_HELP3);
return 0;
}
- if (param[0] != _T('\0'))
- _tcscpy(szParam,param);
- else
- _tcscpy(szParam,_T("$P$G"));
/* set PROMPT environment variable */
- if (!SetEnvironmentVariable (_T("PROMPT"), szParam))
- return 1;
-
+ if (param[0] != _T('\0'))
+ {
+ if (!SetEnvironmentVariable (_T("PROMPT"), param))
+ return 1;
+ }
+
return 0;
}
#endif