diff --git a/reactos/lib/kernel32/file/dir.c b/reactos/lib/kernel32/file/dir.c index 964ae8497ed..46334882f42 100644 --- a/reactos/lib/kernel32/file/dir.c +++ b/reactos/lib/kernel32/file/dir.c @@ -1,4 +1,4 @@ -/* $Id: dir.c,v 1.38 2003/10/19 16:17:50 navaraf Exp $ +/* $Id: dir.c,v 1.39 2003/10/19 19:51:48 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -339,6 +339,7 @@ GetFullPathNameA ( UNICODE_STRING nameW; WCHAR bufferW[MAX_PATH]; DWORD ret, retW; + LPWSTR FilePart = NULL; DPRINT("GetFullPathNameA(lpFileName %s, nBufferLength %d, lpBuffer %p, " "lpFilePart %p)\n",lpFileName,nBufferLength,lpBuffer,lpFilePart); @@ -355,7 +356,12 @@ GetFullPathNameA ( return 0; } - retW = GetFullPathNameW(nameW.Buffer, MAX_PATH, bufferW, NULL); + if (lpFilePart) + { + *lpFilePart = NULL; + } + + retW = GetFullPathNameW(nameW.Buffer, MAX_PATH, bufferW, &FilePart); if (!retW) { @@ -368,25 +374,22 @@ GetFullPathNameA ( } else { - ret = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL); - if (ret <= nBufferLength) + ANSI_STRING AnsiBuffer; + UNICODE_STRING UnicodeBuffer; + + UnicodeBuffer.Length = wcslen(bufferW) * sizeof(WCHAR); + ret = nameW.Length; + if (nameW.Length <= nBufferLength) { - WideCharToMultiByte(CP_ACP, 0, bufferW, -1, lpBuffer, nBufferLength, NULL, NULL); - ret--; /* length without 0 */ + UnicodeBuffer.Buffer = bufferW; + AnsiBuffer.MaximumLength = nBufferLength; + AnsiBuffer.Length = 0; + AnsiBuffer.Buffer = lpBuffer; + RtlUnicodeStringToAnsiString(&AnsiBuffer, &UnicodeBuffer, FALSE); - if (lpFilePart) + if (lpFilePart && FilePart != NULL) { - LPSTR p = lpBuffer + strlen(lpBuffer); - - if (*p != '\\') - { - while ((p > lpBuffer + 2) && (*p != '\\')) p--; - *lpFilePart = p + 1; - } - else - { - *lpFilePart = NULL; - } + *lpFilePart = (FilePart - bufferW) + lpBuffer; } } } @@ -394,7 +397,7 @@ GetFullPathNameA ( RtlFreeUnicodeString(&nameW); DPRINT("lpBuffer %s lpFilePart %s Length %ld\n", - lpBuffer, lpFilePart, nameW.Length); + lpBuffer, (lpFilePart == NULL) ? "NULL" : *lpFilePart, nameW.Length); return ret; } @@ -423,7 +426,7 @@ GetFullPathNameW ( lpFilePart); DPRINT("lpBuffer %S lpFilePart %S Length %ld\n", - lpBuffer, lpFilePart, Length / sizeof(WCHAR)); + lpBuffer, (lpFilePart == NULL) ? L"NULL" : *lpFilePart, Length / sizeof(WCHAR)); return (Length / sizeof(WCHAR)); } diff --git a/reactos/lib/ntdll/rtl/path.c b/reactos/lib/ntdll/rtl/path.c index 114b503003f..854bf40ed73 100644 --- a/reactos/lib/ntdll/rtl/path.c +++ b/reactos/lib/ntdll/rtl/path.c @@ -1,4 +1,4 @@ -/* $Id: path.c,v 1.23 2003/10/19 16:17:50 navaraf Exp $ +/* $Id: path.c,v 1.24 2003/10/19 19:51:48 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -711,6 +711,7 @@ CHECKPOINT; /* find file part */ if (FilePart) { +#if 0 *FilePart = wcsrchr(buf, L'\\'); if (*FilePart) { @@ -720,6 +721,13 @@ CHECKPOINT; { *FilePart = buf; } +#else + *FilePart = buf + len; + while (*FilePart != buf && **FilePart != L'\\') + --(*FilePart); + if (**FilePart == L'\\') + ++(*FilePart); +#endif } } diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index e46fc50dd86..7ce7aaabd5f 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.99 2003/10/17 20:31:56 weiden Exp $ +/* $Id: defwnd.c,v 1.100 2003/10/19 19:51:48 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -710,6 +710,9 @@ DefWndDoPaintNC(HWND hWnd, HRGN clip) DbgPrint("3. rect.top == %d\n", rect.top); } + if (ExStyle & WS_EX_CLIENTEDGE) + DrawEdge(hDC, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); + /* Draw scrollbars */ if((Style & WS_VSCROLL) && (clientrect.right < rect.right - (2 * FrameSize.cx))) SCROLL_DrawScrollBar(hWnd, hDC, SB_VERT, TRUE, TRUE); @@ -1968,21 +1971,15 @@ User32DefWindowProc(HWND hWnd, if (GetWindowLongW(hWnd, GWL_STYLE) & WS_MINIMIZE && (hIcon = (HICON)GetClassLongW(hWnd, GCL_HICON)) != NULL) { - RECT WindowRect; + RECT ClientRect; INT x, y; - GetWindowRect(hWnd, &WindowRect); - x = (WindowRect.right - WindowRect.left - + GetClientRect(hWnd, &ClientRect); + x = (ClientRect.right - ClientRect.left - GetSystemMetrics(SM_CXICON)) / 2; - y = (WindowRect.bottom - WindowRect.top - + y = (ClientRect.bottom - ClientRect.top - GetSystemMetrics(SM_CYICON)) / 2; DrawIcon(hDC, x, y, hIcon); } - if (GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_CLIENTEDGE) - { - RECT WindowRect; - GetClientRect(hWnd, &WindowRect); - DrawEdge(hDC, &WindowRect, EDGE_SUNKEN, BF_RECT); - } EndPaint(hWnd, &Ps); } return (0); @@ -2076,11 +2073,16 @@ User32DefWindowProc(HWND hWnd, { return 0; } - if (0 == (((DWORD) hBrush) & 0xffff0000)) + if (GetClassLongW(hWnd, GCL_STYLE) & CS_PARENTDC) { - hBrush = GetSysColorBrush((DWORD) hBrush - 1); + /* can't use GetClipBox with a parent DC or we fill the whole parent */ + GetClientRect(hWnd, &Rect); + DPtoLP((HDC)wParam, (LPPOINT)&Rect, 2); + } + else + { + GetClipBox((HDC)wParam, &Rect); } - GetClipBox((HDC)wParam, &Rect); FillRect((HDC)wParam, &Rect, hBrush); return (1); } diff --git a/reactos/lib/user32/windows/window.c b/reactos/lib/user32/windows/window.c index 2e9c47e0dbd..05689f41281 100644 --- a/reactos/lib/user32/windows/window.c +++ b/reactos/lib/user32/windows/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.73 2003/09/20 19:52:23 gvg Exp $ +/* $Id: window.c,v 1.74 2003/10/19 19:51:48 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -392,8 +392,12 @@ ArrangeIconicWindows(HWND hWnd) HDWP STDCALL BeginDeferWindowPos(int nNumWindows) { +#if 0 UNIMPLEMENTED; return (HDWP)0; +#else + return (HDWP)1; +#endif } @@ -737,7 +741,12 @@ DeferWindowPos(HDWP hWinPosInfo, int cy, UINT uFlags) { +#if 0 return NtUserDeferWindowPos(hWinPosInfo, hWnd, hWndInsertAfter, x, y, cx, cy, uFlags); +#else + SetWindowPos(hWnd, hWndInsertAfter, x, y, cx, cy, uFlags); + return hWinPosInfo; +#endif } @@ -757,8 +766,12 @@ DestroyWindow(HWND hWnd) WINBOOL STDCALL EndDeferWindowPos(HDWP hWinPosInfo) { +#if 0 UNIMPLEMENTED; return FALSE; +#else + return TRUE; +#endif } diff --git a/reactos/subsys/win32k/include/color.h b/reactos/subsys/win32k/include/color.h index 9ed64a4b214..8e756637f60 100644 --- a/reactos/subsys/win32k/include/color.h +++ b/reactos/subsys/win32k/include/color.h @@ -2,4 +2,5 @@ const PALETTEENTRY* FASTCALL COLOR_GetSystemPaletteTemplate (VOID); COLORREF STDCALL COLOR_LookupNearestColor (PALETTEENTRY* palPalEntry, INT size, COLORREF color); INT STDCALL COLOR_PaletteLookupExactIndex (PALETTEENTRY* palPalEntry, INT size, COLORREF col); INT STDCALL COLOR_PaletteLookupPixel(PALETTEENTRY *palPalEntry, INT size, PXLATEOBJ XlateObj, COLORREF col, BOOL skipReserved); +ULONG FASTCALL NtGdiGetSysColor(int nIndex); HBRUSH STDCALL NtGdiGetSysColorBrush(int nIndex); diff --git a/reactos/subsys/win32k/ntuser/winsta.c b/reactos/subsys/win32k/ntuser/winsta.c index b666cafb142..f897bdc87de 100644 --- a/reactos/subsys/win32k/ntuser/winsta.c +++ b/reactos/subsys/win32k/ntuser/winsta.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: winsta.c,v 1.38 2003/10/12 09:46:51 gvg Exp $ +/* $Id: winsta.c,v 1.39 2003/10/19 19:51:48 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -47,6 +47,7 @@ #include #include #include +#include #define NDEBUG #include @@ -898,9 +899,28 @@ NtUserOpenInputDesktop( BOOL STDCALL NtUserPaintDesktop(HDC hDC) { - UNIMPLEMENTED + HWND hwnd = IntGetDesktopWindow(); - return FALSE; + /* + * Check for an owning thread, otherwise don't paint anything + * (non-desktop mode) + */ + if (NtUserGetWindowThreadProcessId(hwnd, NULL)) + { + RECT Rect; + HBRUSH PreviousBrush; + + NtUserGetClientRect(hwnd, &Rect); + + /* + * Paint desktop background + */ + PreviousBrush = NtGdiSelectObject(hDC, NtGdiGetSysColorBrush(COLOR_BACKGROUND)); + NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY); + NtGdiSelectObject(hDC, PreviousBrush); + } + + return TRUE; } DWORD STDCALL