Compare commits

...

22 Commits

Author SHA1 Message Date
Robert Kopferl
cab21f1645 version info 0.2.6
svn path=/branches/ros-branch-0_2_6/; revision=14531
2005-04-06 20:05:23 +00:00
Robert Kopferl
e71045efa1 changed target arc for the release to i586 for better optimization
svn path=/branches/ros-branch-0_2_6/; revision=14391
2005-03-31 17:11:43 +00:00
Robert Kopferl
da20aaac90 potential revision for RC2
svn path=/branches/ros-branch-0_2_6/; revision=14390
2005-03-31 17:09:15 +00:00
Magnus Olsen
8561239392 svn path=/branches/ros-branch-0_2_6/; revision=14347 2005-03-27 12:47:43 +00:00
Filip Navara
a7319af3dd Merge from HEAD: r14249
Specify correct access rights in NtOpenProcess when sending control events.

svn path=/branches/ros-branch-0_2_6/; revision=14291
2005-03-23 17:23:36 +00:00
Filip Navara
a19892ea08 Merge from HEAD: r14248
Correctly draw the titlebar as active or inactive during the processing of WM_NCACTIVATE message.

svn path=/branches/ros-branch-0_2_6/; revision=14290
2005-03-23 17:23:02 +00:00
Filip Navara
f66ca04807 Merge from HEAD: r14247
- Cleanup DefWndDoButton function.
- Fix some loops where GetMessage was inadvertently used.

svn path=/branches/ros-branch-0_2_6/; revision=14289
2005-03-23 17:22:41 +00:00
Filip Navara
60593571fd Merge from HEAD: r14246
- Move WINDOWOBJECT_NEED_INTERNALPAINT flag handling to NtGdiBeginPaint.
- Fix IntGetPaintMessage to not return TRUE when no message was returned.
- IntIsWindowDirty shouldn't check for the WINDOWOBJECT_NEED_NCPAINT flag (at least not now).

svn path=/branches/ros-branch-0_2_6/; revision=14288
2005-03-23 17:21:36 +00:00
Filip Navara
5503685d2d Merge from HEAD: r14234
There's no need to call PropertySheet twice.

svn path=/branches/ros-branch-0_2_6/; revision=14287
2005-03-23 17:20:48 +00:00
Filip Navara
9cad93ac31 Merge from HEAD: r14232
Initialize the "toc" field in the pdb_lookup structure in order
to prevent pdb_free_lookup from trying to delete invalid pointers.

svn path=/branches/ros-branch-0_2_6/; revision=14286
2005-03-23 17:19:52 +00:00
Filip Navara
3a64b132cf Merge from HEAD: r14230
Don't use uninitialized variable in _SHExpandEnvironmentStrings.

svn path=/branches/ros-branch-0_2_6/; revision=14285
2005-03-23 17:19:36 +00:00
Filip Navara
791f54a818 Merge from HEAD: r14219, r14220
Allow the lpTemplateDirectory parameter to be NULL in CreateDirectoryExA.

svn path=/branches/ros-branch-0_2_6/; revision=14284
2005-03-23 17:19:12 +00:00
Filip Navara
9f3de03641 Merge from HEAD: r14209
Minor correction to NtAdjustPrivilegesToken to keep it from returning total junk.

svn path=/branches/ros-branch-0_2_6/; revision=14283
2005-03-23 17:12:58 +00:00
Filip Navara
0a3129deb1 Merge from HEAD: r14202
Specify correct buffer size in GetPrivateProfileStringW calls.

svn path=/branches/ros-branch-0_2_6/; revision=14282
2005-03-23 17:12:03 +00:00
Filip Navara
45724d8de2 Merge from HEAD: r14193
Export the HOST variable even on Windows.

svn path=/branches/ros-branch-0_2_6/; revision=14281
2005-03-23 17:11:18 +00:00
Filip Navara
3223773dbc Merge from HEAD: r14186
- Fix acpi_os_get_thread_id to return 1-based thread ids (instead of zero-based ones).
- Zero the owner_id field while initializing acpi_gbl_acpi_mutex_info.

svn path=/branches/ros-branch-0_2_6/; revision=14280
2005-03-23 17:10:54 +00:00
Filip Navara
15445b6ebc Merge from HEAD: r14171
- Correctly initialize the standard handles for console-less applications.
- Simplify _isatty and fix it to not set the errno for "invalid" handles.

svn path=/branches/ros-branch-0_2_6/; revision=14279
2005-03-23 17:10:03 +00:00
Filip Navara
0fa542f1e0 Merge from HEAD: r14166
(GDIOBJ_SetOwnership): Don't try to decrease the GDI object counter for global handles since they're not associated with process.

svn path=/branches/ros-branch-0_2_6/; revision=14278
2005-03-23 17:08:24 +00:00
Filip Navara
4bbcb97553 Merge from HEAD: r14160
- Don't try to kill non-existing timers.
- Close dialog using EndDialog instead of DestroyWindow.

svn path=/branches/ros-branch-0_2_6/; revision=14277
2005-03-23 17:07:48 +00:00
Filip Navara
aca728a62f Merge from HEAD: r14159
Now that CSRSS is getting unloaded we must unregister the primitive message queue when it's about to be destroyed.

svn path=/branches/ros-branch-0_2_6/; revision=14276
2005-03-23 17:06:29 +00:00
Gunnar Dalsnes
ded6fcca88 scanf: fix handling of %n token
svn path=/branches/ros-branch-0_2_6/; revision=14158
2005-03-17 02:11:04 +00:00
Robert Kopferl
6d66d4da2c version info 0.2.6-RC1
svn path=/branches/ros-branch-0_2_6/; revision=14156
2005-03-17 00:30:09 +00:00
27 changed files with 3264 additions and 3217 deletions

View File

@@ -14,7 +14,7 @@ ARCH := i386
# be optimized for. # be optimized for.
# #
OARCH := i486 OARCH := i586
# #
# Whether to compile in the kernel debugger # Whether to compile in the kernel debugger

View File

@@ -601,5 +601,5 @@ acpi_os_writable(void *ptr, u32 len)
u32 u32
acpi_os_get_thread_id (void) acpi_os_get_thread_id (void)
{ {
return (ULONG)PsGetCurrentThreadId(); return (ULONG)PsGetCurrentThreadId() + 1;
} }

View File

@@ -389,6 +389,7 @@ acpi_cm_init_globals (
acpi_gbl_acpi_mutex_info[i].mutex = NULL; acpi_gbl_acpi_mutex_info[i].mutex = NULL;
acpi_gbl_acpi_mutex_info[i].locked = FALSE; acpi_gbl_acpi_mutex_info[i].locked = FALSE;
acpi_gbl_acpi_mutex_info[i].use_count = 0; acpi_gbl_acpi_mutex_info[i].use_count = 0;
acpi_gbl_acpi_mutex_info[i].owner_id = 0;
} }
/* Global notify handlers */ /* Global notify handlers */

View File

@@ -18,11 +18,11 @@
#define __VERSION_H #define __VERSION_H
#define KERNEL_VERSION_MAJOR 0 #define KERNEL_VERSION_MAJOR 0
#define KERNEL_VERSION_MINOR 3 #define KERNEL_VERSION_MINOR 2
#define KERNEL_VERSION_PATCH_LEVEL 0 #define KERNEL_VERSION_PATCH_LEVEL 6
/* KERNEL_VERSION_BUILD_TYPE is L"SVN", L"RC1", L"RC2" or L"RELEASE" */ /* KERNEL_VERSION_BUILD_TYPE is L"SVN", L"RC1", L"RC2" or L"RELEASE" */
#define KERNEL_VERSION_BUILD_TYPE L"SVN" #define KERNEL_VERSION_BUILD_TYPE L"RELEASE"
#endif #endif

View File

@@ -1,5 +1,4 @@
#include <io.h> #include <internal/file.h>
#include <sys/stat.h>
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
@@ -7,13 +6,10 @@
/* /*
* @implemented * @implemented
*/ */
int _isatty( int fd ) int _isatty(int fd)
{ {
struct _stat buf; HANDLE hFile = fdinfo(fd)->hFile;
DPRINT("_isatty(fd %d)\n", fd); if (hFile == INVALID_HANDLE_VALUE)
if (_fstat (fd, &buf) < 0)
return 0; return 0;
if (S_ISCHR (buf.st_mode)) return GetFileType(hFile) == FILE_TYPE_CHAR ? 1 : 0;
return 1;
return 0;
} }

View File

@@ -608,14 +608,20 @@ BOOL __fileno_init(void)
if (fdinfo(0)->hFile == INVALID_HANDLE_VALUE || !(fdinfo(0)->fdflags & FOPEN)) { if (fdinfo(0)->hFile == INVALID_HANDLE_VALUE || !(fdinfo(0)->fdflags & FOPEN)) {
fdinfo(0)->hFile = GetStdHandle(STD_INPUT_HANDLE); fdinfo(0)->hFile = GetStdHandle(STD_INPUT_HANDLE);
if (fdinfo(0)->hFile == NULL)
fdinfo(0)->hFile = INVALID_HANDLE_VALUE;
fdinfo(0)->fdflags = FOPEN|FTEXT; fdinfo(0)->fdflags = FOPEN|FTEXT;
} }
if (fdinfo(1)->hFile == INVALID_HANDLE_VALUE || !(fdinfo(1)->fdflags & FOPEN)) { if (fdinfo(1)->hFile == INVALID_HANDLE_VALUE || !(fdinfo(1)->fdflags & FOPEN)) {
fdinfo(1)->hFile = GetStdHandle(STD_OUTPUT_HANDLE); fdinfo(1)->hFile = GetStdHandle(STD_OUTPUT_HANDLE);
if (fdinfo(1)->hFile == NULL)
fdinfo(1)->hFile = INVALID_HANDLE_VALUE;
fdinfo(1)->fdflags = FOPEN|FTEXT; fdinfo(1)->fdflags = FOPEN|FTEXT;
} }
if (fdinfo(2)->hFile == INVALID_HANDLE_VALUE || !(fdinfo(2)->fdflags & FOPEN)) { if (fdinfo(2)->hFile == INVALID_HANDLE_VALUE || !(fdinfo(2)->fdflags & FOPEN)) {
fdinfo(2)->hFile = GetStdHandle(STD_ERROR_HANDLE); fdinfo(2)->hFile = GetStdHandle(STD_ERROR_HANDLE);
if (fdinfo(2)->hFile == NULL)
fdinfo(2)->hFile = INVALID_HANDLE_VALUE;
fdinfo(2)->fdflags = FOPEN|FTEXT; fdinfo(2)->fdflags = FOPEN|FTEXT;
} }

View File

@@ -2215,6 +2215,7 @@ static BOOL codeview_process_info(const struct process* pcs,
pdb_lookup.filename = pdb->name; pdb_lookup.filename = pdb->name;
pdb_lookup.kind = PDB_JG; pdb_lookup.kind = PDB_JG;
pdb_lookup.u.jg.timestamp = pdb->timestamp; pdb_lookup.u.jg.timestamp = pdb->timestamp;
pdb_lookup.u.jg.toc = NULL;
ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup); ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup);
break; break;
} }
@@ -2227,6 +2228,7 @@ static BOOL codeview_process_info(const struct process* pcs,
pdb_lookup.filename = rsds->name; pdb_lookup.filename = rsds->name;
pdb_lookup.kind = PDB_DS; pdb_lookup.kind = PDB_DS;
pdb_lookup.u.ds.guid = rsds->guid; pdb_lookup.u.ds.guid = rsds->guid;
pdb_lookup.u.ds.toc = NULL;
ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup); ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup);
break; break;
} }

View File

@@ -871,6 +871,7 @@ static int b[5];
static POINT point; static POINT point;
int calc; int calc;
int count_button; int count_button;
int add = 0;
#endif #endif
@@ -880,7 +881,6 @@ int count_button;
if (flags != DIGDD_PEEK) if (flags != DIGDD_PEEK)
{ {
getmousesvalue(iface);
b[0] = ((GetKeyState(VK_LBUTTON) & 0x80) ? 0xFF : 0x00); b[0] = ((GetKeyState(VK_LBUTTON) & 0x80) ? 0xFF : 0x00);
b[1] = ((GetKeyState(VK_RBUTTON) & 0x80) ? 0xFF : 0x00); b[1] = ((GetKeyState(VK_RBUTTON) & 0x80) ? 0xFF : 0x00);
b[2] = ((GetKeyState(VK_MBUTTON) & 0x80) ? 0xFF : 0x00); b[2] = ((GetKeyState(VK_MBUTTON) & 0x80) ? 0xFF : 0x00);
@@ -899,14 +899,13 @@ GetCursorPos( &point );
if (This->acquired == 0) { if (This->acquired == 0) {
WARN(" application tries to get data from an unacquired device !\n"); WARN(" application tries to get data from an unacquired device !\n");
//return DIERR_NOTACQUIRED; return DIERR_NOTACQUIRED;
// windows does not get any data if // windows does not get any data if
// we do not call manual to mouse Acquire // we do not call manual to mouse Acquire
// this is only need if some apps calling on getdevice data direcly // this is only need if some apps calling on getdevice data direcly
// in windows GetdeviceData does always update first the data // in windows GetdeviceData does always update first the data
// then return it. // then return it.
SysMouseAImpl_Acquire(iface);
} }
@@ -915,6 +914,7 @@ GetCursorPos( &point );
#ifdef __REACTOS__ #ifdef __REACTOS__
if (*entries == 0) return DIERR_INVALIDPARAM; if (*entries == 0) return DIERR_INVALIDPARAM;
if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3)) { if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3)) {
@@ -924,48 +924,58 @@ GetCursorPos( &point );
if (This->data_queue==NULL) { if (This->data_queue==NULL) {
WARN("No buffer have been set up !\n"); WARN("No buffer have been set up !\n");
return DIERR_NOTINITIALIZED; return DIERR_NOTINITIALIZED;
} }
FIXME("This is broken in Tribes ??, need right implant of the buffer!!!!!!!!\n");
/* this code are not need it but if we want 100% compatible
with ms we should keep it. but the mouse will be choppy
in Unreal 2004 Demo
if (GetTickCount()-time <50) { if (GetTickCount()-time <50) {
*entries=0; *entries=0;
return DI_OK; return DI_OK;
} }
time = GetTickCount(); time = GetTickCount();
*/
if (GetTickCount()-time <50)
{
add=0;
}
else
{
add=1;
time = GetTickCount();
}
for (count=0;count<*entries;count++) { for (count=0;count<*entries;count++) {
if (save_point.x != point.x) {
dod[count_ent].dwOfs = DIMOFS_X; if (save_point.x != point.x) {
dod[count_ent].dwOfs = DIMOFS_X;
dod[count_ent].dwData = point.x - save_point.x; dod[count_ent].dwData = point.x - save_point.x;
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event++; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_point.x = point.x; save_point.x = point.x;
} }
else if (save_point.y != point.y) { else if (save_point.y != point.y) {
dod[count_ent].dwOfs = DIMOFS_Y; dod[count_ent].dwOfs = DIMOFS_Y;
dod[count_ent].dwData = point.y - save_point.y; dod[count_ent].dwData = point.y - save_point.y;
dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event+=add;
count_ent++;
save_point.y = point.y;
}
dod[count_ent].dwTimeStamp = time +1;
dod[count_ent].dwSequence = last_event++;
count_ent++;
save_point.y = point.y;
}
else if (save_b[0] != b[0]) { else if (save_b[0] != b[0]) {
dod[count_ent].dwOfs = DIMOFS_BUTTON0; dod[count_ent].dwOfs = DIMOFS_BUTTON0;
dod[count_ent].dwData = b[0]; dod[count_ent].dwData = b[0];
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event++; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[0] = b[0]; save_b[0] = b[0];
} }
@@ -974,8 +984,8 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_BUTTON1; dod[count_ent].dwOfs = DIMOFS_BUTTON1;
dod[count_ent].dwData = b[1]; dod[count_ent].dwData = b[1];
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event++; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[1] = b[1]; save_b[1] = b[1];
} }
@@ -984,8 +994,8 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_BUTTON2; dod[count_ent].dwOfs = DIMOFS_BUTTON2;
dod[count_ent].dwData = b[2]; dod[count_ent].dwData = b[2];
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event++; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[2] = b[2]; save_b[2] = b[2];
} }
@@ -994,26 +1004,17 @@ GetCursorPos( &point );
dod[count_ent].dwOfs = DIMOFS_BUTTON3; dod[count_ent].dwOfs = DIMOFS_BUTTON3;
dod[count_ent].dwData = b[3]; dod[count_ent].dwData = b[3];
dod[count_ent].dwTimeStamp = time +1; dod[count_ent].dwTimeStamp = GetTickCount();
dod[count_ent].dwSequence = last_event++; dod[count_ent].dwSequence = last_event+=add;
count_ent++; count_ent++;
save_b[3] = b[3]; save_b[3] = b[3];
} }
else if (save_b[4] != b[4]) {
dod[count_ent].dwOfs = DIMOFS_BUTTON4;
dod[count_ent].dwData = b[4];
dod[count_ent].dwTimeStamp = time +1;
dod[count_ent].dwSequence = last_event++;
count_ent++;
save_b[4] = b[4];
}
} // end for } // end for
SetCursorPos(point.x, point.y);
*entries = count_ent; *entries = count_ent;
#endif #endif

View File

@@ -50,11 +50,12 @@ CreateDirectoryExA (
LPCSTR lpNewDirectory, LPCSTR lpNewDirectory,
LPSECURITY_ATTRIBUTES lpSecurityAttributes) LPSECURITY_ATTRIBUTES lpSecurityAttributes)
{ {
PWCHAR TemplateDirectoryW; PWCHAR TemplateDirectoryW = NULL;
PWCHAR NewDirectoryW; PWCHAR NewDirectoryW = NULL;
BOOL ret; BOOL ret;
if (!(TemplateDirectoryW = FilenameA2W(lpTemplateDirectory, FALSE))) if (lpTemplateDirectory != NULL &&
!(TemplateDirectoryW = FilenameA2W(lpTemplateDirectory, FALSE)))
return FALSE; return FALSE;
if (!(NewDirectoryW = FilenameA2W(lpNewDirectory, TRUE))) if (!(NewDirectoryW = FilenameA2W(lpNewDirectory, TRUE)))

View File

@@ -422,13 +422,36 @@ _FUNCTION_ {
} }
} }
break; break;
case 'n': { case 'n': {
if (!suppress) { if (!suppress) {
int*n = va_arg(ap, int*); int*n = va_arg(ap, int*);
*n = consumed - (nch!=_EOF_);
} /*
} *n = consumed - (nch!=_EOF_);
break;
FIXME: The above is the Wine version and it doesnt work in ros
when %n is at end of input string (return one too many).
But does it fail in Wine too?? If so wine also needs fixin.
-Gunnar
*/
*n = consumed - 1;
}
/* This is an odd one: according to the standard,
* "Execution of a %n directive does not increment the
* assignment count returned at the completion of
* execution" even if it wasn't suppressed with the
* '*' flag. The Corrigendum to the standard seems
* to contradict this (comment out the assignment to
* suppress below if you want to implement these
* alternate semantics) but the windows program I'm
* looking at expects the behavior I've coded here
* (which happens to be what glibc does as well).
*/
suppress = 1;
st = 1;
}
break;
case '[': { case '[': {
_CHAR_ *str = suppress ? NULL : va_arg(ap, _CHAR_*); _CHAR_ *str = suppress ? NULL : va_arg(ap, _CHAR_*);
_CHAR_ *sptr = str; _CHAR_ *sptr = str;

View File

@@ -1522,7 +1522,7 @@ static HRESULT _SHGetProfilesValue(HKEY profilesKey, LPCWSTR szValueName,
*/ */
static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
{ {
HRESULT hr; HRESULT hr = S_OK;
WCHAR szTemp[MAX_PATH], szProfilesPrefix[MAX_PATH] = { 0 }; WCHAR szTemp[MAX_PATH], szProfilesPrefix[MAX_PATH] = { 0 };
TRACE("%s, %p\n", debugstr_w(szSrc), szDest); TRACE("%s, %p\n", debugstr_w(szSrc), szDest);

View File

@@ -31,7 +31,7 @@
#define WM_QUERYDROPOBJECT 0x022B #define WM_QUERYDROPOBJECT 0x022B
#endif #endif
LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn); LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active);
LRESULT DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect); LRESULT DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect);
LRESULT DefWndNCActivate(HWND hWnd, WPARAM wParam); LRESULT DefWndNCActivate(HWND hWnd, WPARAM wParam);
LRESULT DefWndNCHitTest(HWND hWnd, POINT Point); LRESULT DefWndNCHitTest(HWND hWnd, POINT Point);
@@ -317,7 +317,8 @@ DefWndStartSizeMove(HWND hWnd, WPARAM wParam, POINT *capturePoint)
{ {
while(!hittest) while(!hittest)
{ {
GetMessageW(&msg, NULL, 0, 0); if (GetMessageW(&msg, NULL, 0, 0) <= 0)
break;
switch(msg.message) switch(msg.message)
{ {
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
@@ -572,7 +573,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
{ {
int dx = 0, dy = 0; int dx = 0, dy = 0;
GetMessageW(&msg, 0, 0, 0); if (GetMessageW(&msg, 0, 0, 0) <= 0)
break;
/* Exit on button-up, Return, or Esc */ /* Exit on button-up, Return, or Esc */
if ((msg.message == WM_LBUTTONUP) || if ((msg.message == WM_LBUTTONUP) ||
@@ -947,7 +949,7 @@ User32DefWindowProc(HWND hWnd,
{ {
case WM_NCPAINT: case WM_NCPAINT:
{ {
return DefWndNCPaint(hWnd, (HRGN)wParam); return DefWndNCPaint(hWnd, (HRGN)wParam, -1);
} }
case WM_NCCALCSIZE: case WM_NCCALCSIZE:
@@ -1470,7 +1472,7 @@ DefWindowProcA(HWND hWnd,
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
{ {
DefWndNCPaint(hWnd, (HRGN)1); DefWndNCPaint(hWnd, (HRGN)1, -1);
} }
return TRUE; return TRUE;
} }
@@ -1530,7 +1532,7 @@ DefWindowProcW(HWND hWnd,
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
{ {
DefWndNCPaint(hWnd, (HRGN)1); DefWndNCPaint(hWnd, (HRGN)1, -1);
} }
return (1); return (1);
} }

View File

@@ -288,10 +288,9 @@ UserDrawCaptionButtonWnd(HWND hWnd, HDC hDC, BOOL bDown, ULONG Type)
* - Correct drawing of size-box * - Correct drawing of size-box
*/ */
LRESULT LRESULT
DefWndNCPaint(HWND hWnd, HRGN hRgn) DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
{ {
HDC hDC; HDC hDC;
BOOL Active;
DWORD Style, ExStyle; DWORD Style, ExStyle;
HWND Parent; HWND Parent;
RECT ClientRect, WindowRect, CurrentRect, TempRect; RECT ClientRect, WindowRect, CurrentRect, TempRect;
@@ -309,15 +308,18 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn)
Parent = GetParent(hWnd); Parent = GetParent(hWnd);
ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE); ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
if (ExStyle & WS_EX_MDICHILD) if (Active == -1)
{ {
Active = IsChild(GetForegroundWindow(), hWnd); if (ExStyle & WS_EX_MDICHILD)
if (Active) {
Active = (hWnd == (HWND)SendMessageW(Parent, WM_MDIGETACTIVE, 0, 0)); Active = IsChild(GetForegroundWindow(), hWnd);
} if (Active)
else Active = (hWnd == (HWND)SendMessageW(Parent, WM_MDIGETACTIVE, 0, 0));
{ }
Active = (GetForegroundWindow() == hWnd); else
{
Active = (GetForegroundWindow() == hWnd);
}
} }
GetWindowRect(hWnd, &WindowRect); GetWindowRect(hWnd, &WindowRect);
GetClientRect(hWnd, &ClientRect); GetClientRect(hWnd, &ClientRect);
@@ -660,7 +662,7 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect)
LRESULT LRESULT
DefWndNCActivate(HWND hWnd, WPARAM wParam) DefWndNCActivate(HWND hWnd, WPARAM wParam)
{ {
DefWndNCPaint(hWnd, (HRGN)1); DefWndNCPaint(hWnd, (HRGN)1, wParam);
return TRUE; return TRUE;
} }
@@ -882,79 +884,75 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
VOID VOID
DefWndDoButton(HWND hWnd, WPARAM wParam) DefWndDoButton(HWND hWnd, WPARAM wParam)
{ {
MSG Msg; MSG Msg;
BOOL InBtn, HasBtn = FALSE; HDC WindowDC;
ULONG Btn, Style; BOOL Pressed = TRUE, OldState;
WPARAM SCMsg, CurBtn = wParam, OrigBtn = wParam; WPARAM SCMsg;
HDC WindowDC = NULL; ULONG ButtonType, Style;
Style = GetWindowLongW(hWnd, GWL_STYLE); Style = GetWindowLongW(hWnd, GWL_STYLE);
switch(wParam) switch (wParam)
{ {
case HTCLOSE: case HTCLOSE:
Btn = DFCS_CAPTIONCLOSE; if (!(Style & WS_SYSMENU))
SCMsg = SC_CLOSE; return;
HasBtn = (Style & WS_SYSMENU); ButtonType = DFCS_CAPTIONCLOSE;
break; SCMsg = SC_CLOSE;
case HTMINBUTTON: break;
Btn = DFCS_CAPTIONMIN; case HTMINBUTTON:
SCMsg = ((Style & WS_MINIMIZE) ? SC_RESTORE : SC_MINIMIZE); if (!(Style & WS_MINIMIZEBOX))
HasBtn = (Style & WS_MINIMIZEBOX); return;
break; ButtonType = DFCS_CAPTIONMIN;
case HTMAXBUTTON: SCMsg = ((Style & WS_MINIMIZE) ? SC_RESTORE : SC_MINIMIZE);
Btn = DFCS_CAPTIONMAX; break;
SCMsg = ((Style & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE); case HTMAXBUTTON:
HasBtn = (Style & WS_MAXIMIZEBOX); if (!(Style & WS_MAXIMIZEBOX))
break; return;
default: ButtonType = DFCS_CAPTIONMAX;
return; SCMsg = ((Style & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE);
} break;
default:
ASSERT(FALSE);
return;
}
InBtn = HasBtn; /*
* FIXME: Not sure where to do this, but we must flush the pending
* window updates when someone clicks on the close button and at
* the same time the window is overlapped with another one. This
* looks like a good place for now...
*/
UpdateWindow(hWnd);
WindowDC = GetWindowDC(hWnd);
UserDrawCaptionButtonWnd(hWnd, WindowDC, TRUE, ButtonType);
SetCapture(hWnd);
SetCapture(hWnd); for (;;)
{
if (GetMessageW(&Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST) <= 0)
break;
if (Msg.message == WM_LBUTTONUP)
break;
if (Msg.message != WM_MOUSEMOVE)
continue;
OldState = Pressed;
Pressed = (DefWndNCHitTest(hWnd, Msg.pt) == wParam);
if (Pressed != OldState)
UserDrawCaptionButtonWnd(hWnd, WindowDC, Pressed, ButtonType);
}
if(HasBtn) if (Pressed)
{ UserDrawCaptionButtonWnd(hWnd, WindowDC, FALSE, ButtonType);
WindowDC = GetWindowDC(hWnd); ReleaseCapture();
UserDrawCaptionButtonWnd(hWnd, WindowDC, HasBtn , Btn); ReleaseDC(hWnd, WindowDC);
} if (Pressed)
SendMessageW(hWnd, WM_SYSCOMMAND, SCMsg, 0);
for(;;)
{
GetMessageW(&Msg, 0, 0, 0);
switch(Msg.message)
{
case WM_LBUTTONUP:
if(InBtn)
goto done;
else
{
ReleaseCapture();
if (HasBtn)
ReleaseDC(hWnd, WindowDC);
return;
}
case WM_MOUSEMOVE:
if(HasBtn)
{
CurBtn = DefWndNCHitTest(hWnd, Msg.pt);
if(InBtn != (CurBtn == OrigBtn))
{
UserDrawCaptionButtonWnd( hWnd, WindowDC, (CurBtn == OrigBtn) , Btn);
}
InBtn = CurBtn == OrigBtn;
}
break;
}
}
done:
UserDrawCaptionButtonWnd( hWnd, WindowDC, FALSE , Btn);
ReleaseDC(hWnd, WindowDC);
ReleaseCapture();
SendMessageW(hWnd, WM_SYSCOMMAND, SCMsg, 0);
return;
} }

View File

@@ -22,7 +22,7 @@
BOOL ControlsInitialized = FALSE; BOOL ControlsInitialized = FALSE;
LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn); LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active);
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
@@ -1236,7 +1236,7 @@ SetWindowTextA(HWND hWnd,
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
{ {
DefWndNCPaint(hWnd, (HRGN)1); DefWndNCPaint(hWnd, (HRGN)1, -1);
} }
return TRUE; return TRUE;
} }
@@ -1270,7 +1270,7 @@ SetWindowTextW(HWND hWnd,
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
{ {
DefWndNCPaint(hWnd, (HRGN)1); DefWndNCPaint(hWnd, (HRGN)1, -1);
} }
return TRUE; return TRUE;
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -491,7 +491,8 @@ MmFindGapBottomUp(
/* Check if there is enough space after the last memory area. */ /* Check if there is enough space after the last memory area. */
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity); AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
if ((ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length) if ((ULONG_PTR)HighestAddress > (ULONG_PTR)AlignedAddress &&
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
{ {
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress); DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
return AlignedAddress; return AlignedAddress;

View File

@@ -1632,7 +1632,7 @@ NtAdjustPrivilegesToken (IN HANDLE TokenHandle,
{ {
// PLUID_AND_ATTRIBUTES Privileges; // PLUID_AND_ATTRIBUTES Privileges;
KPROCESSOR_MODE PreviousMode; KPROCESSOR_MODE PreviousMode;
// ULONG PrivilegeCount; ULONG PrivilegeCount;
PTOKEN Token; PTOKEN Token;
// ULONG Length; // ULONG Length;
ULONG i; ULONG i;
@@ -1690,6 +1690,12 @@ NtAdjustPrivilegesToken (IN HANDLE TokenHandle,
&c); &c);
#endif #endif
PrivilegeCount = (BufferLength - FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges)) /
sizeof(LUID_AND_ATTRIBUTES);
if (PreviousState != NULL)
PreviousState->PrivilegeCount = 0;
k = 0; k = 0;
if (DisableAllPrivileges == TRUE) if (DisableAllPrivileges == TRUE)
{ {
@@ -1700,11 +1706,22 @@ NtAdjustPrivilegesToken (IN HANDLE TokenHandle,
DPRINT ("Attributes differ\n"); DPRINT ("Attributes differ\n");
/* Save current privilege */ /* Save current privilege */
if (PreviousState != NULL && k < PreviousState->PrivilegeCount) if (PreviousState != NULL)
{ {
PreviousState->Privileges[k].Luid = Token->Privileges[i].Luid; if (k < PrivilegeCount)
PreviousState->Privileges[k].Attributes = Token->Privileges[i].Attributes; {
k++; PreviousState->PrivilegeCount++;
PreviousState->Privileges[k].Luid = Token->Privileges[i].Luid;
PreviousState->Privileges[k].Attributes = Token->Privileges[i].Attributes;
}
else
{
/* FIXME: Should revert all the changes, calculate how
* much space would be needed, set ResultLength
* accordingly and fail.
*/
}
k++;
} }
/* Update current privlege */ /* Update current privlege */
@@ -1734,11 +1751,22 @@ NtAdjustPrivilegesToken (IN HANDLE TokenHandle,
NewState->Privileges[j].Attributes); NewState->Privileges[j].Attributes);
/* Save current privilege */ /* Save current privilege */
if (PreviousState != NULL && k < PreviousState->PrivilegeCount) if (PreviousState != NULL)
{ {
PreviousState->Privileges[k].Luid = Token->Privileges[i].Luid; if (k < PrivilegeCount)
PreviousState->Privileges[k].Attributes = Token->Privileges[i].Attributes; {
k++; PreviousState->PrivilegeCount++;
PreviousState->Privileges[k].Luid = Token->Privileges[i].Luid;
PreviousState->Privileges[k].Attributes = Token->Privileges[i].Attributes;
}
else
{
/* FIXME: Should revert all the changes, calculate how
* much space would be needed, set ResultLength
* accordingly and fail.
*/
}
k++;
} }
/* Update current privlege */ /* Update current privlege */

View File

@@ -38,7 +38,7 @@ endif
# detect Windows host environment # detect Windows host environment
ifeq ($(HOST),) ifeq ($(HOST),)
ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32) ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32)
HOST=mingw32-windows export HOST=mingw32-windows
else else
export HOST=mingw32-linux export HOST=mingw32-linux
endif endif

View File

@@ -94,7 +94,8 @@ ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData)
/* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */ /* using OpenProcess is not optimal due to HANDLE vs. DWORD PIDs... */
Status = NtOpenProcess(&Process, Status = NtOpenProcess(&Process,
PROCESS_DUP_HANDLE, PROCESS_DUP_HANDLE | PROCESS_VM_OPERATION |
PROCESS_VM_WRITE | PROCESS_CREATE_THREAD,
&ObjectAttributes, &ObjectAttributes,
&ClientId); &ClientId);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@@ -110,7 +111,7 @@ ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData)
(PVOID) Event, 0, NULL); (PVOID) Event, 0, NULL);
if (NULL == Thread) if (NULL == Thread)
{ {
DPRINT1("Failed thread creation\n"); DPRINT1("Failed thread creation (Error: 0x%x)\n", GetLastError());
CloseHandle(Process); CloseHandle(Process);
return; return;
} }

View File

@@ -257,7 +257,7 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
OnAbout(); OnAbout();
break; break;
case ID_FILE_EXIT: case ID_FILE_EXIT:
DestroyWindow(hDlg); EndDialog(hDlg, IDOK);
break; break;
} }
break; break;
@@ -590,23 +590,12 @@ BOOL OnCreate(HWND hWnd)
TabCtrl_SetCurFocus/*Sel*/(hTabWnd, 2); TabCtrl_SetCurFocus/*Sel*/(hTabWnd, 2);
TabCtrl_SetCurFocus/*Sel*/(hTabWnd, nActivePage); TabCtrl_SetCurFocus/*Sel*/(hTabWnd, nActivePage);
if (TaskManagerSettings.UpdateSpeed == 0) if (TaskManagerSettings.UpdateSpeed == 1)
KillTimer(hWnd, 1);
else if (TaskManagerSettings.UpdateSpeed == 1)
{
KillTimer(hWnd, 1);
SetTimer(hWnd, 1, 1000, NULL); SetTimer(hWnd, 1, 1000, NULL);
}
else if (TaskManagerSettings.UpdateSpeed == 2) else if (TaskManagerSettings.UpdateSpeed == 2)
{
KillTimer(hWnd, 1);
SetTimer(hWnd, 1, 2000, NULL); SetTimer(hWnd, 1, 2000, NULL);
}
else if (TaskManagerSettings.UpdateSpeed == 4) else if (TaskManagerSettings.UpdateSpeed == 4)
{
KillTimer(hWnd, 1);
SetTimer(hWnd, 1, 4000, NULL); SetTimer(hWnd, 1, 4000, NULL);
}
/* /*
* Refresh the performance data * Refresh the performance data

View File

@@ -1091,9 +1091,6 @@ CreateWizard(VOID)
psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER); psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
/* Display the wizard */ /* Display the wizard */
PropertySheet(&psh);
return (LONG)(PropertySheet(&psh) != -1); return (LONG)(PropertySheet(&psh) != -1);
} }

View File

@@ -8,6 +8,7 @@ InitInputImpl(VOID);
NTSTATUS FASTCALL NTSTATUS FASTCALL
InitKeyboardImpl(VOID); InitKeyboardImpl(VOID);
PUSER_MESSAGE_QUEUE W32kGetPrimitiveMessageQueue(VOID); PUSER_MESSAGE_QUEUE W32kGetPrimitiveMessageQueue(VOID);
VOID W32kUnregisterPrimitiveMessageQueue(VOID);
PKBDTABLES W32kGetDefaultKeyLayout(VOID); PKBDTABLES W32kGetDefaultKeyLayout(VOID);
VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyLayout); VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyLayout);
BOOL FASTCALL IntBlockInput(PW32THREAD W32Thread, BOOL BlockIt); BOOL FASTCALL IntBlockInput(PW32THREAD W32Thread, BOOL BlockIt);

View File

@@ -17,13 +17,15 @@
/* registered Logon process */ /* registered Logon process */
PW32PROCESS LogonProcess = NULL; PW32PROCESS LogonProcess = NULL;
void W32kRegisterPrimitiveMessageQueue() { VOID W32kRegisterPrimitiveMessageQueue(VOID)
{
extern PUSER_MESSAGE_QUEUE pmPrimitiveMessageQueue; extern PUSER_MESSAGE_QUEUE pmPrimitiveMessageQueue;
if( !pmPrimitiveMessageQueue ) { if( !pmPrimitiveMessageQueue ) {
PW32THREAD pThread; PW32THREAD pThread;
pThread = PsGetWin32Thread(); pThread = PsGetWin32Thread();
if( pThread && pThread->MessageQueue ) { if( pThread && pThread->MessageQueue ) {
pmPrimitiveMessageQueue = pThread->MessageQueue; pmPrimitiveMessageQueue = pThread->MessageQueue;
IntReferenceMessageQueue(pmPrimitiveMessageQueue);
DPRINT( "Installed primitive input queue.\n" ); DPRINT( "Installed primitive input queue.\n" );
} }
} else { } else {
@@ -31,7 +33,15 @@ void W32kRegisterPrimitiveMessageQueue() {
} }
} }
PUSER_MESSAGE_QUEUE W32kGetPrimitiveMessageQueue() { VOID W32kUnregisterPrimitiveMessageQueue(VOID)
{
extern PUSER_MESSAGE_QUEUE pmPrimitiveMessageQueue;
IntDereferenceMessageQueue(pmPrimitiveMessageQueue);
pmPrimitiveMessageQueue = NULL;
}
PUSER_MESSAGE_QUEUE W32kGetPrimitiveMessageQueue()
{
extern PUSER_MESSAGE_QUEUE pmPrimitiveMessageQueue; extern PUSER_MESSAGE_QUEUE pmPrimitiveMessageQueue;
return pmPrimitiveMessageQueue; return pmPrimitiveMessageQueue;
} }

View File

@@ -1413,15 +1413,21 @@ VOID FASTCALL
MsqDestroyMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) MsqDestroyMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue)
{ {
PDESKTOP_OBJECT desk; PDESKTOP_OBJECT desk;
/* remove the message queue from any desktops */ /* remove the message queue from any desktops */
if((desk = (PDESKTOP_OBJECT)InterlockedExchange((LONG*)&MessageQueue->Desktop, 0))) if ((desk = (PDESKTOP_OBJECT)InterlockedExchange((LONG*)&MessageQueue->Desktop, 0)))
{ {
InterlockedExchange((LONG*)&desk->ActiveMessageQueue, 0); InterlockedExchange((LONG*)&desk->ActiveMessageQueue, 0);
IntDereferenceMessageQueue(MessageQueue); IntDereferenceMessageQueue(MessageQueue);
} }
/* if this is the primitive message queue, deregister it */
if (MessageQueue == W32kGetPrimitiveMessageQueue())
W32kUnregisterPrimitiveMessageQueue();
/* clean it up */ /* clean it up */
MsqCleanupMessageQueue(MessageQueue); MsqCleanupMessageQueue(MessageQueue);
/* decrease the reference counter, if it hits zero, the queue will be freed */ /* decrease the reference counter, if it hits zero, the queue will be freed */
IntDereferenceMessageQueue(MessageQueue); IntDereferenceMessageQueue(MessageQueue);
} }

View File

@@ -144,16 +144,6 @@ IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
{ {
IntSendMessage(hWnd, WM_PAINT, 0, 0); IntSendMessage(hWnd, WM_PAINT, 0, 0);
IntLockWindowUpdate(Window);
if (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
{
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
if (Window->UpdateRegion == NULL)
{
MsqDecPaintCountQueue(Window->MessageQueue);
}
}
IntUnLockWindowUpdate(Window);
} }
} }
} }
@@ -547,8 +537,7 @@ IntIsWindowDirty(PWINDOW_OBJECT Window)
{ {
return (Window->Style & WS_VISIBLE) && return (Window->Style & WS_VISIBLE) &&
((Window->UpdateRegion != NULL) || ((Window->UpdateRegion != NULL) ||
(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) || (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT));
(Window->Flags & WINDOWOBJECT_NEED_NCPAINT));
} }
HWND STDCALL HWND STDCALL
@@ -614,6 +603,10 @@ IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax,
if (!MessageQueue->PaintPosted) if (!MessageQueue->PaintPosted)
return FALSE; return FALSE;
if ((MsgFilterMin != 0 || MsgFilterMax != 0) &&
(MsgFilterMin > WM_PAINT || MsgFilterMax < WM_PAINT))
return FALSE;
if (hWnd) if (hWnd)
Message->hwnd = IntFindWindowToRepaint(hWnd, PsGetWin32Thread()); Message->hwnd = IntFindWindowToRepaint(hWnd, PsGetWin32Thread());
else else
@@ -635,25 +628,10 @@ IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax,
Window = IntGetWindowObject(Message->hwnd); Window = IntGetWindowObject(Message->hwnd);
if (Window != NULL) if (Window != NULL)
{ {
IntLockWindowUpdate(Window); Message->message = WM_PAINT;
Message->wParam = Message->lParam = 0;
if ((MsgFilterMin == 0 && MsgFilterMax == 0) ||
(MsgFilterMin <= WM_PAINT && WM_PAINT <= MsgFilterMax))
{
Message->message = WM_PAINT;
Message->wParam = Message->lParam = 0;
if (Remove && Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
{
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
if (Window->UpdateRegion == NULL)
{
MsqDecPaintCountQueue(Window->MessageQueue);
}
}
}
IntUnLockWindowUpdate(Window);
IntReleaseWindowObject(Window); IntReleaseWindowObject(Window);
return TRUE; return TRUE;
} }
@@ -779,8 +757,11 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
} }
else else
{ {
if (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
MsqDecPaintCountQueue(Window->MessageQueue);
IntGetClientRect(Window, &Ps.rcPaint); IntGetClientRect(Window, &Ps.rcPaint);
} }
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
IntUnLockWindowUpdate(Window); IntUnLockWindowUpdate(Window);
if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND) if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND)

View File

@@ -1216,15 +1216,18 @@ LockHandle:
/* dereference the process' object counter */ /* dereference the process' object counter */
/* FIXME */ /* FIXME */
Status = PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)PrevProcId & ~0x1), &OldProcess); if((ULONG_PTR)PrevProcId & ~0x1)
if(NT_SUCCESS(Status))
{ {
W32Process = OldProcess->Win32Process; Status = PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)PrevProcId & ~0x1), &OldProcess);
if(W32Process != NULL) if(NT_SUCCESS(Status))
{ {
InterlockedDecrement(&W32Process->GDIObjects); W32Process = OldProcess->Win32Process;
if(W32Process != NULL)
{
InterlockedDecrement(&W32Process->GDIObjects);
}
ObDereferenceObject(OldProcess);
} }
ObDereferenceObject(OldProcess);
} }
if(NewOwner != NULL) if(NewOwner != NULL)