ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
377 discussions
Start a n
N
ew thread
[hpoussin] 22126: Fix BSOD in IntPrepareDriver (bug 1321)
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed May 31 18:26:56 2006 New Revision: 22126 URL:
http://svn.reactos.ru/svn/reactos?rev=22126&view=rev
Log: Fix BSOD in IntPrepareDriver (bug 1321) Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/main/dllmain.c trunk/reactos/subsystems/win32/win32k/objects/dc.c Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h Wed May 31 18:26:56 2006 @@ -170,6 +170,7 @@ #define DC_UnlockDc(pDC) \ GDIOBJ_UnlockObjByPtr (GdiHandleTable, pDC) +NTSTATUS FASTCALL InitDcImpl(VOID); HDC FASTCALL RetrieveDisplayHDC(VOID); HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver); VOID FASTCALL DC_InitDC(HDC DCToInit); Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/mai…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/main/dllmain.c (original) +++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c Wed May 31 18:26:56 2006 @@ -500,6 +500,13 @@ return STATUS_UNSUCCESSFUL; } + Status = InitDcImpl(); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to initialize Device context implementation!\n"); + return STATUS_UNSUCCESSFUL; + } + /* Initialize FreeType library */ if (! InitFontSupport()) { Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Wed May 31 18:26:56 2006 @@ -41,6 +41,17 @@ #endif static GDIDEVICE PrimarySurface; +static KEVENT VideoDriverNeedsPreparation; +static KEVENT VideoDriverPrepared; + + +NTSTATUS FASTCALL +InitDcImpl(VOID) +{ + KeInitializeEvent(&VideoDriverNeedsPreparation, SynchronizationEvent, TRUE); + KeInitializeEvent(&VideoDriverPrepared, NotificationEvent, FALSE); + return STATUS_SUCCESS; +} /* FIXME: DCs should probably be thread safe */ @@ -489,6 +500,17 @@ BOOL GotDriver; BOOL DoDefault; ULONG DisplayNumber; + LARGE_INTEGER Zero; + BOOLEAN ret = FALSE; + + Zero.QuadPart = 0; + if (STATUS_SUCCESS != KeWaitForSingleObject(&VideoDriverNeedsPreparation, Executive, KernelMode, TRUE, &Zero)) + { + /* Concurrent access. Wait for VideoDriverPrepared event */ + if (STATUS_SUCCESS == KeWaitForSingleObject(&VideoDriverPrepared, Executive, KernelMode, TRUE, NULL)) + ret = PrimarySurface.PreparedDriver; + goto cleanup; + } for (DisplayNumber = 0; ; DisplayNumber++) { @@ -502,7 +524,7 @@ if (PrimarySurface.VideoFileObject == NULL) { DPRINT1("FindMPDriver failed\n"); - return FALSE; + goto cleanup; } /* Retrieve DDI driver names from registry */ @@ -576,7 +598,7 @@ { ObDereferenceObject(PrimarySurface.VideoFileObject); DPRINT1("BuildDDIFunctions failed\n"); - return FALSE; + goto cleanup; } /* Allocate a phyical device handle from the driver */ @@ -659,10 +681,13 @@ PrimarySurface.PreparedDriver = TRUE; PrimarySurface.DisplayNumber = DisplayNumber; - return TRUE; + ret = TRUE; + goto cleanup; } - return FALSE; +cleanup: + KeSetEvent(&VideoDriverPrepared, 1, FALSE); + return ret; } static BOOL FASTCALL
18 years, 6 months
1
0
0
0
[cwittich] 22125: show Cancel button
by cwittich@svn.reactos.org
Author: cwittich Date: Wed May 31 18:26:46 2006 New Revision: 22125 URL:
http://svn.reactos.ru/svn/reactos?rev=22125&view=rev
Log: show Cancel button Modified: trunk/reactos/dll/win32/newdev/wizard.c Modified: trunk/reactos/dll/win32/newdev/wizard.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/wizard.c (original) +++ trunk/reactos/dll/win32/newdev/wizard.c Wed May 31 18:26:46 2006 @@ -958,6 +958,7 @@ IN LPARAM lParam) { PDEVINSTDATA DevInstData; + HWND hwndControl; /* Get pointer to the global setup data */ DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWL_USERDATA); @@ -966,7 +967,6 @@ { case WM_INITDIALOG: { - HWND hwndControl; BOOL DisableableDevice = FALSE; DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; @@ -1009,6 +1009,9 @@ case PSN_WIZBACK: /* Handle a Back button click, if necessary */ + hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); + ShowWindow(hwndControl, SW_SHOW); + EnableWindow(hwndControl, TRUE); PropSheet_SetCurSelByID(GetParent(hwndDlg), IDD_CHSOURCE); return TRUE;
18 years, 6 months
1
0
0
0
[hpoussin] 22124: Remove useless cast
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed May 31 16:28:30 2006 New Revision: 22124 URL:
http://svn.reactos.ru/svn/reactos?rev=22124&view=rev
Log: Remove useless cast Modified: trunk/reactos/subsystems/win32/win32k/misc/driver.c Modified: trunk/reactos/subsystems/win32/win32k/misc/driver.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/mis…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/misc/driver.c (original) +++ trunk/reactos/subsystems/win32/win32k/misc/driver.c Wed May 31 16:28:30 2006 @@ -84,7 +84,7 @@ SYSTEM_GDI_DRIVER_INFORMATION GdiDriverInfo; GRAPHICS_DRIVER *Driver = DriverList; NTSTATUS Status; - WCHAR *FullName; + LPWSTR FullName; LPCWSTR p; BOOL PathSeparatorFound; BOOL DotFound; @@ -147,7 +147,7 @@ } /* If not, then load it */ - RtlInitUnicodeString (&GdiDriverInfo.DriverName, (LPWSTR)FullName); + RtlInitUnicodeString (&GdiDriverInfo.DriverName, FullName); Status = ZwSetSystemInformation (SystemLoadGdiDriverInformation, &GdiDriverInfo, sizeof(SYSTEM_GDI_DRIVER_INFORMATION)); ExFreePool(FullName); if (!NT_SUCCESS(Status)) return NULL;
18 years, 6 months
1
0
0
0
[greatlrd] 22123: start implement WSHGetSockaddrType, it missing error code at return, and handling other struct and sockeradr_in. Code was done by me and irc : Elrond (from TNG), Arty please check this, Other people test see if it works for u.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Wed May 31 11:56:39 2006 New Revision: 22123 URL:
http://svn.reactos.ru/svn/reactos?rev=22123&view=rev
Log: start implement WSHGetSockaddrType, it missing error code at return, and handling other struct and sockeradr_in. Code was done by me and irc : Elrond (from TNG), Arty please check this, Other people test see if it works for u. Modified: trunk/reactos/drivers/network/wshtcpip/wshtcpip.c Modified: trunk/reactos/drivers/network/wshtcpip/wshtcpip.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/network/wshtcpip/ws…
============================================================================== --- trunk/reactos/drivers/network/wshtcpip/wshtcpip.c (original) +++ trunk/reactos/drivers/network/wshtcpip/wshtcpip.c Wed May 31 11:56:39 2006 @@ -93,6 +93,11 @@ } +/* +Document from OSR how WSHGetSockaddrType works +http://www.osronline.com/ddkx/network/37wshfun_5lyq.htm +*/ + INT EXPORT WSHGetSockaddrType( @@ -100,10 +105,57 @@ IN DWORD SockaddrLength, OUT PSOCKADDR_INFO SockaddrInfo) { - UNIMPLEMENTED - - return 0; -} + PSOCKADDR_IN ipv4 = (PSOCKADDR_IN)Sockaddr; + + if ((ipv4 != NULL) + && (SockaddrLength == sizeof(SOCKADDR_IN)) + && (ipv4->sin_family == AF_INET) + && (SockaddrInfo != NULL)) + { + + switch (ntohl(ipv4->sin_addr.s_addr)) + { + case INADDR_ANY: + SockaddrInfo->AddressInfo = SockaddrAddressInfoWildcard; + break; + + case INADDR_BROADCAST: + SockaddrInfo->AddressInfo = SockaddrAddressInfoBroadcast; + break; + + case INADDR_LOOPBACK: + SockaddrInfo->AddressInfo = SockaddrAddressInfoLoopback; + break; + + default: + SockaddrInfo->AddressInfo = SockaddrAddressInfoNormal; + break; + } + + SockaddrInfo->EndpointInfo = SockaddrEndpointInfoNormal; + if (ntohs(ipv4->sin_port) == 0) + SockaddrInfo->EndpointInfo = SockaddrEndpointInfoWildcard; + if (ntohs(ipv4->sin_port) < IPPORT_RESERVED) + SockaddrInfo->EndpointInfo = SockaddrEndpointInfoReserved; + + return 0; + } + + DPRINT1("FIXME WSHGetSockaddrType Unsupported Address Family or bad parameters\n"); + if (SockaddrInfo != NULL) + { + SockaddrInfo->AddressInfo = SockaddrAddressInfoNormal; + SockaddrInfo->EndpointInfo = SockaddrEndpointInfoNormal; + } + + DPRINT1("Size of Address Family %d \n",SockaddrLength); + + DPRINT1("FIXME WSHGetSockaddrType return Winsock error, but we do not return any error\n"); + return 0; +} + + + INT
18 years, 6 months
1
0
0
0
[gedmurphy] 22122: add screenshot app to bootcd
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed May 31 01:12:31 2006 New Revision: 22122 URL:
http://svn.reactos.ru/svn/reactos?rev=22122&view=rev
Log: add screenshot app to bootcd Modified: trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/boot/bootdata/packages/reac…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff Wed May 31 01:12:31 2006 @@ -56,6 +56,7 @@ base\applications\regedit\clb\clb.dll 1 ;base\applications\reporterror\reporterror.exe 1 base\applications\sc\sc.exe 1 +base\applications\screenshot\screenshot.exe 1 base\applications\servman\servman.exe 1 base\applications\shutdown\shutdown.exe 1 ;base\applications\sm\sm.exe 1
18 years, 6 months
1
0
0
0
[gedmurphy] 22121: add a temp screenshot app in case I don't get time to stick it in win32k before 0.3.0 FF.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed May 31 01:11:41 2006 New Revision: 22121 URL:
http://svn.reactos.ru/svn/reactos?rev=22121&view=rev
Log: add a temp screenshot app in case I don't get time to stick it in win32k before 0.3.0 FF. Added: trunk/reactos/base/applications/screenshot/ trunk/reactos/base/applications/screenshot/screenshot.c trunk/reactos/base/applications/screenshot/screenshot.h trunk/reactos/base/applications/screenshot/screenshot.rbuild trunk/reactos/base/applications/screenshot/screenshot.rc trunk/reactos/base/applications/screenshot/snap.ico (with props) Modified: trunk/reactos/base/applications/applications.rbuild Modified: trunk/reactos/base/applications/applications.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/applicati…
============================================================================== --- trunk/reactos/base/applications/applications.rbuild (original) +++ trunk/reactos/base/applications/applications.rbuild Wed May 31 01:11:41 2006 @@ -46,11 +46,17 @@ <directory name="screensavers"> <xi:include href="screensavers/screensavers.rbuild" /> </directory> +<directory name="screenshot"> + <xi:include href="screenshot/screenshot.rbuild" /> +</directory> <directory name="servman"> <xi:include href="servman/servman.rbuild" /> </directory> <directory name="shutdown"> <xi:include href="shutdown/shutdown.rbuild" /> +</directory> +<directory name="sndvol32"> + <xi:include href="sndvol32/sndvol32.rbuild" /> </directory> <directory name="taskmgr"> <xi:include href="taskmgr/taskmgr.rbuild" /> Added: trunk/reactos/base/applications/screenshot/screenshot.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/screensho…
============================================================================== --- trunk/reactos/base/applications/screenshot/screenshot.c (added) +++ trunk/reactos/base/applications/screenshot/screenshot.c Wed May 31 01:11:41 2006 @@ -1,0 +1,396 @@ +#include "screenshot.h" + +/* + * Save a screenshot to file until the clipboard + * is ready to accept images. + */ + + +static VOID +GetError(VOID) +{ + LPVOID lpMsgBuf; + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, + NULL ); + + MessageBox(NULL, + lpMsgBuf, + _T("Error!"), + MB_OK | MB_ICONERROR); + + LocalFree(lpMsgBuf); +} + + +static BOOL +DoWriteFile(PSCREENSHOT pScrSht, + LPTSTR pstrFileName) +{ + BITMAPFILEHEADER bmfh; + BOOL bSuccess; + DWORD dwBytesWritten; + HANDLE hFile; + //INT PalEntries; + + hFile = CreateFile(pstrFileName, + GENERIC_WRITE, + 0, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + + if (hFile == INVALID_HANDLE_VALUE) + return FALSE; + + /* write the BITMAPFILEHEADER to file */ + bmfh.bfType = *(WORD *)"BM"; // 0x4D 0x42 + bmfh.bfReserved1 = 0; + bmfh.bfReserved2 = 0; + bSuccess = WriteFile(hFile, + &bmfh, + sizeof(bmfh), + &dwBytesWritten, + NULL); + if ((!bSuccess) || (dwBytesWritten < sizeof(bmfh))) + goto fail; + + /* write the BITMAPINFOHEADER to file */ + bSuccess = WriteFile(hFile, + &pScrSht->lpbi->bmiHeader, + sizeof(BITMAPINFOHEADER), + &dwBytesWritten, + NULL); + if ((!bSuccess) || (dwBytesWritten < sizeof(BITMAPINFOHEADER))) + goto fail; + + /* calculate the size of the pallete * / + if (pScrSht->lpbi->bmiHeader.biCompression == BI_BITFIELDS) + PalEntries = 3; + else + { + if (pScrSht->lpbi->bmiHeader.biBitCount <= 8) + PalEntries = (INT)(1 << pScrSht->lpbi->bmiHeader.biBitCount); + else + PalEntries = 0; + } + if (pScrSht->lpbi->bmiHeader.biClrUsed) + PalEntries = pScrSht->lpbi->bmiHeader.biClrUsed; + + / * write pallete to file * / + if (PalEntries != 0) + { + bSuccess = WriteFile(hFile, + &pScrSht->lpbi->bmiColors, + PalEntries * sizeof(RGBQUAD), + &dwBytesWritten, + NULL); + if ((!bSuccess) || (dwBytesWritten < PalEntries * sizeof(RGBQUAD))) + goto fail; + } +*/ + /* save the current file position at the bginning of the bitmap bits */ + bmfh.bfOffBits = SetFilePointer(hFile, 0, 0, FILE_CURRENT); + + /* write the bitmap bits to file */ + bSuccess = WriteFile(hFile, + pScrSht->lpvBits, + pScrSht->lpbi->bmiHeader.biSizeImage, + &dwBytesWritten, + NULL); + if ((!bSuccess) || (dwBytesWritten < pScrSht->lpbi->bmiHeader.biSizeImage)) + goto fail; + + /* save the current file position at the final file size */ + bmfh.bfSize = SetFilePointer(hFile, 0, 0, FILE_CURRENT); + + /* rewrite the updated file headers */ + SetFilePointer(hFile, 0, 0, FILE_BEGIN); + bSuccess = WriteFile(hFile, + &bmfh, + sizeof(bmfh), + &dwBytesWritten, + NULL); + if ((!bSuccess) || (dwBytesWritten < sizeof(bmfh))) + goto fail; + + return TRUE; + +fail: + GetError(); + if (hFile) CloseHandle(hFile); + DeleteFile(pstrFileName); + return FALSE; + +} + + +static BOOL +DoSaveFile(HWND hwnd, LPTSTR szFileName) +{ + OPENFILENAME ofn; + + static TCHAR Filter[] = _T("24 bit Bitmap (*.bmp,*.dib)\0*.bmp\0"); + + ZeroMemory(&ofn, sizeof(ofn)); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hwnd; + ofn.nMaxFile = MAX_PATH; + ofn.nMaxFileTitle = MAX_PATH; + ofn.lpstrDefExt = _T("bmp"); + ofn.lpstrFilter = Filter; + ofn.lpstrFile = szFileName; + ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; + + if (GetSaveFileName(&ofn)) + return TRUE; + + if (CommDlgExtendedError() != CDERR_GENERALCODES) + MessageBox(NULL, _T("Save to file failed"), NULL, 0); + + return FALSE; +} + + +static BOOL +CaptureScreen(PSCREENSHOT pScrSht) +{ + HDC ScreenDC; + RECT rect; + + /* get window resolution */ + //pScrSht->Width = GetSystemMetrics(SM_CXSCREEN); + //pScrSht->Height = GetSystemMetrics(SM_CYSCREEN); + + GetWindowRect(pScrSht->hSelf, &rect); + pScrSht->Width = rect.right - rect.left; + pScrSht->Height = rect.bottom - rect.top; + + /* get a DC for the screen */ + if (!(ScreenDC = GetDC(pScrSht->hSelf))) + return FALSE; + + /* get a bitmap handle for the screen + * needed to convert to a DIB */ + pScrSht->hBitmap = CreateCompatibleBitmap(ScreenDC, + pScrSht->Width, + pScrSht->Height); + if (pScrSht->hBitmap == NULL) + { + GetError(); + ReleaseDC(pScrSht->hSelf, ScreenDC); + return FALSE; + } + + /* get a DC compatable with the screen DC */ + if (!(pScrSht->hDC = CreateCompatibleDC(ScreenDC))) + { + GetError(); + ReleaseDC(pScrSht->hSelf, ScreenDC); + return FALSE; + } + + /* select the bitmap into the DC */ + SelectObject(pScrSht->hDC, + pScrSht->hBitmap); + + /* copy the screen DC to the bitmap */ + BitBlt(pScrSht->hDC, + 0, + 0, + pScrSht->Width, + pScrSht->Height, + ScreenDC, + 0, + 0, + SRCCOPY); + + /* we're finished with the screen DC */ + ReleaseDC(pScrSht->hSelf, ScreenDC); + + return TRUE; +} + + +static BOOL +ConvertDDBtoDIB(PSCREENSHOT pScrSht) +{ + INT Ret; + BITMAP bitmap; + WORD cClrBits; + + +/* + / * can't call GetDIBits with hBitmap selected * / + //SelectObject(hDC, hOldBitmap); + + / * let GetDIBits fill the lpbi structure by passing NULL pointer * / + Ret = GetDIBits(hDC, + hBitmap, + 0, + Height, + NULL, + lpbi, + DIB_RGB_COLORS); + if (Ret == 0) + { + GetError(); + ReleaseDC(hwnd, hDC); + HeapFree(GetProcessHeap(), 0, lpbi); + return -1; + } +*/ + +//////////////////////////////////////////////////// + + if (!GetObjectW(pScrSht->hBitmap, + sizeof(BITMAP), + (LPTSTR)&bitmap)) + { + GetError(); + return FALSE; + } + + cClrBits = (WORD)(bitmap.bmPlanes * bitmap.bmBitsPixel); + if (cClrBits == 1) + cClrBits = 1; + else if (cClrBits <= 4) + cClrBits = 4; + else if (cClrBits <= 8) + cClrBits = 8; + else if (cClrBits <= 16) + cClrBits = 16; + else if (cClrBits <= 24) + cClrBits = 24; + else cClrBits = 32; + + if (cClrBits != 24) + pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(), + 0, + sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1 << cClrBits)); + else + pScrSht->lpbi = (PBITMAPINFO) HeapAlloc(GetProcessHeap(), + 0, + sizeof(BITMAPINFOHEADER)); + + if (!pScrSht->lpbi) + { + GetError(); + return FALSE; + } + + pScrSht->lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pScrSht->lpbi->bmiHeader.biWidth = bitmap.bmWidth; + pScrSht->lpbi->bmiHeader.biHeight = bitmap.bmHeight; + pScrSht->lpbi->bmiHeader.biPlanes = bitmap.bmPlanes; + pScrSht->lpbi->bmiHeader.biBitCount = bitmap.bmBitsPixel; + + if (cClrBits < 24) + pScrSht->lpbi->bmiHeader.biClrUsed = (1 << cClrBits); + + pScrSht->lpbi->bmiHeader.biCompression = BI_RGB; + pScrSht->lpbi->bmiHeader.biSizeImage = ((pScrSht->lpbi->bmiHeader.biWidth * cClrBits +31) & ~31) /8 + * pScrSht->lpbi->bmiHeader.biHeight; + + pScrSht->lpbi->bmiHeader.biClrImportant = 0; + +////////////////////////////////////////////////////// + + /* reserve memory to hold the screen bitmap */ + pScrSht->lpvBits = HeapAlloc(GetProcessHeap(), + 0, + pScrSht->lpbi->bmiHeader.biSizeImage); + if (pScrSht->lpvBits == NULL) + { + GetError(); + return FALSE; + } + + /* convert the DDB to a DIB */ + Ret = GetDIBits(pScrSht->hDC, + pScrSht->hBitmap, + 0, + pScrSht->Height, + pScrSht->lpvBits, + pScrSht->lpbi, + DIB_RGB_COLORS); + if (Ret == 0) + { + GetError(); + return FALSE; + } + + return TRUE; + +} + + +// INT WINAPI GetScreenshot(BOOL bFullScreen) +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + PSTR szCmdLine, + int iCmdShow) +{ + PSCREENSHOT pScrSht; + TCHAR szFileName[MAX_PATH] = _T(""); + + BOOL bFullScreen = TRUE; + + pScrSht = HeapAlloc(GetProcessHeap(), + 0, + sizeof(SCREENSHOT)); + + if (bFullScreen) + { + pScrSht->hSelf = GetDesktopWindow(); + } + else + { + pScrSht->hSelf = GetForegroundWindow(); + } + + if (pScrSht->hSelf == NULL) + return -1; + + if (CaptureScreen(pScrSht)) + { + /* convert the DDB image to DIB */ + if(ConvertDDBtoDIB(pScrSht)) + { + /* Get filename from user */ + if(DoSaveFile(pScrSht->hSelf, szFileName)) + { + /* build the headers and write to file */ + DoWriteFile(pScrSht, szFileName); + } + } + } + + /* cleanup */ + if (pScrSht->hSelf != NULL) + ReleaseDC(pScrSht->hSelf, pScrSht->hDC); + if (pScrSht->hBitmap != NULL) + DeleteObject(pScrSht->hBitmap); + if (pScrSht->lpbi != NULL) + HeapFree(GetProcessHeap(), + 0, + pScrSht->lpbi); + if (pScrSht->lpvBits != NULL) + HeapFree(GetProcessHeap(), + 0, + pScrSht->lpvBits); + if (pScrSht != NULL) + HeapFree(GetProcessHeap(), + 0, + pScrSht); + + return 0; +} Added: trunk/reactos/base/applications/screenshot/screenshot.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/screensho…
============================================================================== --- trunk/reactos/base/applications/screenshot/screenshot.h (added) +++ trunk/reactos/base/applications/screenshot/screenshot.h Wed May 31 01:11:41 2006 @@ -1,0 +1,15 @@ +#include <windows.h> +#include <tchar.h> + +typedef struct _SCREENSHOT +{ + HWND hSelf; + HDC hDC; + HBITMAP hBitmap; + LPBITMAPINFO lpbi; + LPVOID lpvBits; + INT Width; + INT Height; +} SCREENSHOT, *PSCREENSHOT; + +//INT WINAPI GetScreenshot(VOID); Added: trunk/reactos/base/applications/screenshot/screenshot.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/screensho…
============================================================================== --- trunk/reactos/base/applications/screenshot/screenshot.rbuild (added) +++ trunk/reactos/base/applications/screenshot/screenshot.rbuild Wed May 31 01:11:41 2006 @@ -1,0 +1,14 @@ +<module name="screenshot" type="win32gui" installbase="system32" installname="screenshot.exe"> + <include base="screenshot">.</include> + <define name="__USE_W32API" /> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="_WIN32_IE">0x501</define> + <define name="_WIN32_WINNT">0x0501</define> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <library>comdlg32</library> + <file>screenshot.c</file> + <file>screenshot.rc</file> +</module> Added: trunk/reactos/base/applications/screenshot/screenshot.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/screensho…
============================================================================== --- trunk/reactos/base/applications/screenshot/screenshot.rc (added) +++ trunk/reactos/base/applications/screenshot/screenshot.rc Wed May 31 01:11:41 2006 @@ -1,0 +1,10 @@ +#include <windows.h> + +#define REACTOS_STR_FILE_DESCRIPTION "desktop screenshot app\0" +#define REACTOS_STR_INTERNAL_NAME "screenshot\0" +#define REACTOS_STR_ORIGINAL_FILENAME "screenshot.exe\0" +#include <reactos/version.rc> + +#define IDI_ICON 1 + +IDI_ICON ICON "snap.ico" Added: trunk/reactos/base/applications/screenshot/snap.ico URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/screensho…
============================================================================== Binary file - no diff available. Propchange: trunk/reactos/base/applications/screenshot/snap.ico ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
18 years, 6 months
1
0
0
0
[fireball] 22120: - Unlock *.def file (it doesn't need to be audited) - Patch by Andrey Korotaev: Fix wgl* function definitions
by fireball@svn.reactos.org
Author: fireball Date: Wed May 31 01:01:24 2006 New Revision: 22120 URL:
http://svn.reactos.ru/svn/reactos?rev=22120&view=rev
Log: - Unlock *.def file (it doesn't need to be audited) - Patch by Andrey Korotaev: Fix wgl* function definitions Modified: trunk/reactos/dll/win32/opengl32/opengl32.def (contents, props changed) Modified: trunk/reactos/dll/win32/opengl32/opengl32.def URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl32…
============================================================================== --- trunk/reactos/dll/win32/opengl32/opengl32.def (original) +++ trunk/reactos/dll/win32/opengl32/opengl32.def Wed May 31 01:01:24 2006 @@ -374,28 +374,28 @@ glVertexPointer@16 glViewport@16 -wglChoosePixelFormat=rosglChoosePixelFormat@8 -wglCopyContext=rosglCopyContext@12 -wglCreateContext=rosglCreateContext@4 -wglCreateLayerContext=rosglCreateLayerContext@8 -wglDeleteContext=rosglDeleteContext@4 -wglDescribeLayerPlane=rosglDescribeLayerPlane@20 -wglDescribePixelFormat=rosglDescribePixelFormat@16 -wglGetCurrentContext=rosglGetCurrentContext@0 -wglGetCurrentDC=rosglGetCurrentDC@0 +wglChoosePixelFormat@8=rosglChoosePixelFormat@8 +wglCopyContext@12=rosglCopyContext@12 +wglCreateContext@4=rosglCreateContext@4 +wglCreateLayerContext@8=rosglCreateLayerContext@8 +wglDeleteContext@4=rosglDeleteContext@4 +wglDescribeLayerPlane@20=rosglDescribeLayerPlane@20 +wglDescribePixelFormat@16=rosglDescribePixelFormat@16 +wglGetCurrentContext@0=rosglGetCurrentContext@0 +wglGetCurrentDC@0=rosglGetCurrentDC@0 ;wglGetDefaultProcAddress=rosglGetDefaultProcAddress@ -wglGetLayerPaletteEntries=rosglGetLayerPaletteEntries@20 -wglGetPixelFormat=rosglGetPixelFormat@4 -wglGetProcAddress=rosglGetProcAddress@4 -wglMakeCurrent=rosglMakeCurrent@8 -wglRealizeLayerPalette=rosglRealizeLayerPalette@12 -wglSetLayerPaletteEntries=rosglSetLayerPaletteEntries@20 -wglSetPixelFormat=rosglSetPixelFormat@12 -wglShareLists=rosglShareLists@8 -wglSwapBuffers=rosglSwapBuffers@4 -wglSwapLayerBuffers=rosglSwapLayerBuffers@8 +wglGetLayerPaletteEntries@20=rosglGetLayerPaletteEntries@20 +wglGetPixelFormat@4=rosglGetPixelFormat@4 +wglGetProcAddress@4=rosglGetProcAddress@4 +wglMakeCurrent@8=rosglMakeCurrent@8 +wglRealizeLayerPalette@12=rosglRealizeLayerPalette@12 +wglSetLayerPaletteEntries@20=rosglSetLayerPaletteEntries@20 +wglSetPixelFormat@12=rosglSetPixelFormat@12 +wglShareLists@8=rosglShareLists@8 +wglSwapBuffers@4=rosglSwapBuffers@4 +wglSwapLayerBuffers@8=rosglSwapLayerBuffers@8 ;wglSwapMultipleBuffers=rosglSwapMultipleBuffers@ -wglUseFontBitmapsA=rosglUseFontBitmapsA@16 -wglUseFontBitmapsW=rosglUseFontBitmapsW@16 -wglUseFontOutlinesA=rosglUseFontOutlinesA@32 -wglUseFontOutlinesW=rosglUseFontOutlinesW@32 +wglUseFontBitmapsA@16=rosglUseFontBitmapsA@16 +wglUseFontBitmapsW@16=rosglUseFontBitmapsW@16 +wglUseFontOutlinesA@32=rosglUseFontOutlinesA@32 +wglUseFontOutlinesW@32=rosglUseFontOutlinesW@32 Propchange: trunk/reactos/dll/win32/opengl32/opengl32.def ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 6 months
1
0
0
0
[hpoussin] 22119: Fix indentation by replacing tabs by spaces. No code change
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue May 30 23:40:52 2006 New Revision: 22119 URL:
http://svn.reactos.ru/svn/reactos?rev=22119&view=rev
Log: Fix indentation by replacing tabs by spaces. No code change Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Tue May 30 23:40:52 2006 @@ -53,14 +53,14 @@ func_type STDCALL func_name( HDC hdc ) \ { \ func_type ft; \ - PDC dc = DC_LockDc( hdc ); \ + PDC dc = DC_LockDc( hdc ); \ if (!dc) \ { \ SetLastWin32Error(ERROR_INVALID_HANDLE); \ return 0; \ } \ ft = dc->dc_field; \ - DC_UnlockDc(dc); \ + DC_UnlockDc(dc); \ return ft; \ } @@ -650,7 +650,7 @@ /* Complete initialization of the physical device */ PrimarySurface.DriverFunctions.CompletePDEV( PrimarySurface.PDev, - (HDEV)&PrimarySurface); + (HDEV)&PrimarySurface); DPRINT("calling DRIVER_ReferenceDriver\n"); @@ -733,7 +733,7 @@ RECTL SurfaceRect; SURFOBJ *SurfObj; BOOL calledFromUser; - + if (! IntPrepareDriverIfNeeded()) { return FALSE; @@ -793,8 +793,8 @@ VOID FASTCALL IntDestroyPrimarySurface() { - BOOL calledFromUser; - + BOOL calledFromUser; + DRIVER_UnreferenceDriver(L"DISPLAY"); calledFromUser = UserIsEntered(); @@ -838,7 +838,7 @@ HRGN hVisRgn; UNICODE_STRING StdDriver; BOOL calledFromUser; - + RtlInitUnicodeString(&StdDriver, L"DISPLAY"); if (NULL == Driver || 0 == RtlCompareUnicodeString(Driver, &StdDriver, TRUE)) @@ -857,20 +857,20 @@ if (!calledFromUser){ UserEnterExclusive(); } - + if (! co_IntGraphicsCheck(TRUE)) { if (!calledFromUser){ UserLeave(); - } + } DPRINT1("Unable to initialize graphics, returning NULL dc\n"); return NULL; } - + if (!calledFromUser){ UserLeave(); - } - + } + } } @@ -904,7 +904,7 @@ NewDC->DevInfo = &PrimarySurface.DevInfo; NewDC->GDIInfo = &PrimarySurface.GDIInfo; memcpy(NewDC->FillPatternSurfaces, PrimarySurface.FillPatterns, - sizeof(NewDC->FillPatternSurfaces)); + sizeof(NewDC->FillPatternSurfaces)); NewDC->PDev = PrimarySurface.PDev; NewDC->GDIDevice = (HDEV)&PrimarySurface; NewDC->DriverFunctions = PrimarySurface.DriverFunctions; @@ -1078,7 +1078,7 @@ SetLastWin32Error(ERROR_INVALID_HANDLE); return FALSE; } - + DCToDelete = DC_LockDc(DCHandle); if (DCToDelete == NULL) { @@ -1411,104 +1411,104 @@ { if ( dcs->w.flags & DC_SAVED ) { - dc->w.flags = dcs->w.flags & ~DC_SAVED; - - dc->w.hFirstBitmap = dcs->w.hFirstBitmap; + dc->w.flags = dcs->w.flags & ~DC_SAVED; + + dc->w.hFirstBitmap = dcs->w.hFirstBitmap; #if 0 - dc->w.hDevice = dcs->w.hDevice; + dc->w.hDevice = dcs->w.hDevice; #endif - dc->w.totalExtent = dcs->w.totalExtent; - dc->w.ROPmode = dcs->w.ROPmode; - dc->w.polyFillMode = dcs->w.polyFillMode; - dc->w.stretchBltMode = dcs->w.stretchBltMode; - dc->w.relAbsMode = dcs->w.relAbsMode; - dc->w.backgroundMode = dcs->w.backgroundMode; - dc->w.backgroundColor = dcs->w.backgroundColor; - dc->w.textColor = dcs->w.textColor; - dc->w.brushOrgX = dcs->w.brushOrgX; - dc->w.brushOrgY = dcs->w.brushOrgY; - dc->w.textAlign = dcs->w.textAlign; - dc->w.charExtra = dcs->w.charExtra; - dc->w.breakTotalExtra = dcs->w.breakTotalExtra; - dc->w.breakCount = dcs->w.breakCount; - dc->w.breakExtra = dcs->w.breakExtra; - dc->w.breakRem = dcs->w.breakRem; - dc->w.MapMode = dcs->w.MapMode; - dc->w.GraphicsMode = dcs->w.GraphicsMode; + dc->w.totalExtent = dcs->w.totalExtent; + dc->w.ROPmode = dcs->w.ROPmode; + dc->w.polyFillMode = dcs->w.polyFillMode; + dc->w.stretchBltMode = dcs->w.stretchBltMode; + dc->w.relAbsMode = dcs->w.relAbsMode; + dc->w.backgroundMode = dcs->w.backgroundMode; + dc->w.backgroundColor = dcs->w.backgroundColor; + dc->w.textColor = dcs->w.textColor; + dc->w.brushOrgX = dcs->w.brushOrgX; + dc->w.brushOrgY = dcs->w.brushOrgY; + dc->w.textAlign = dcs->w.textAlign; + dc->w.charExtra = dcs->w.charExtra; + dc->w.breakTotalExtra = dcs->w.breakTotalExtra; + dc->w.breakCount = dcs->w.breakCount; + dc->w.breakExtra = dcs->w.breakExtra; + dc->w.breakRem = dcs->w.breakRem; + dc->w.MapMode = dcs->w.MapMode; + dc->w.GraphicsMode = dcs->w.GraphicsMode; #if 0 - /* Apparently, the DC origin is not changed by [GS]etDCState */ - dc->w.DCOrgX = dcs->w.DCOrgX; - dc->w.DCOrgY = dcs->w.DCOrgY; + /* Apparently, the DC origin is not changed by [GS]etDCState */ + dc->w.DCOrgX = dcs->w.DCOrgX; + dc->w.DCOrgY = dcs->w.DCOrgY; #endif - dc->w.CursPosX = dcs->w.CursPosX; - dc->w.CursPosY = dcs->w.CursPosY; - dc->w.ArcDirection = dcs->w.ArcDirection; - - dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd; - dc->w.xformWorld2Vport = dcs->w.xformWorld2Vport; - dc->w.xformVport2World = dcs->w.xformVport2World; - dc->w.vport2WorldValid = dcs->w.vport2WorldValid; - - dc->wndOrgX = dcs->wndOrgX; - dc->wndOrgY = dcs->wndOrgY; - dc->wndExtX = dcs->wndExtX; - dc->wndExtY = dcs->wndExtY; - dc->vportOrgX = dcs->vportOrgX; - dc->vportOrgY = dcs->vportOrgY; - dc->vportExtX = dcs->vportExtX; - dc->vportExtY = dcs->vportExtY; + dc->w.CursPosX = dcs->w.CursPosX; + dc->w.CursPosY = dcs->w.CursPosY; + dc->w.ArcDirection = dcs->w.ArcDirection; + + dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd; + dc->w.xformWorld2Vport = dcs->w.xformWorld2Vport; + dc->w.xformVport2World = dcs->w.xformVport2World; + dc->w.vport2WorldValid = dcs->w.vport2WorldValid; + + dc->wndOrgX = dcs->wndOrgX; + dc->wndOrgY = dcs->wndOrgY; + dc->wndExtX = dcs->wndExtX; + dc->wndExtY = dcs->wndExtY; + dc->vportOrgX = dcs->vportOrgX; + dc->vportOrgY = dcs->vportOrgY; + dc->vportExtX = dcs->vportExtX; + dc->vportExtY = dcs->vportExtY; dc->PalIndexed = dcs->PalIndexed; - if (!(dc->w.flags & DC_MEMORY)) - { - dc->w.bitsPerPixel = dcs->w.bitsPerPixel; - } + if (!(dc->w.flags & DC_MEMORY)) + { + dc->w.bitsPerPixel = dcs->w.bitsPerPixel; + } #if 0 - if (dcs->w.hClipRgn) - { - if (!dc->w.hClipRgn) - { - dc->w.hClipRgn = NtGdiCreateRectRgn( 0, 0, 0, 0 ); - } - NtGdiCombineRgn( dc->w.hClipRgn, dcs->w.hClipRgn, 0, RGN_COPY ); - } - else - { - if (dc->w.hClipRgn) - { - NtGdiDeleteObject( dc->w.hClipRgn ); - } - - dc->w.hClipRgn = 0; - } - { - int res; - res = CLIPPING_UpdateGCRegion( dc ); - ASSERT ( res != ERROR ); - } - DC_UnlockDc ( dc ); + if (dcs->w.hClipRgn) + { + if (!dc->w.hClipRgn) + { + dc->w.hClipRgn = NtGdiCreateRectRgn( 0, 0, 0, 0 ); + } + NtGdiCombineRgn( dc->w.hClipRgn, dcs->w.hClipRgn, 0, RGN_COPY ); + } + else + { + if (dc->w.hClipRgn) + { + NtGdiDeleteObject( dc->w.hClipRgn ); + } + + dc->w.hClipRgn = 0; + } + { + int res; + res = CLIPPING_UpdateGCRegion( dc ); + ASSERT ( res != ERROR ); + } + DC_UnlockDc ( dc ); #else - DC_UnlockDc ( dc ); - NtGdiSelectClipRgn(hDC, dcs->w.hClipRgn); + DC_UnlockDc ( dc ); + NtGdiSelectClipRgn(hDC, dcs->w.hClipRgn); #endif - NtGdiSelectObject( hDC, dcs->w.hBitmap ); - NtGdiSelectObject( hDC, dcs->w.hBrush ); - NtGdiSelectObject( hDC, dcs->w.hFont ); - NtGdiSelectObject( hDC, dcs->w.hPen ); - NtGdiSetBkColor( hDC, dcs->w.backgroundColor); - NtGdiSetTextColor( hDC, dcs->w.textColor); - - NtGdiSelectPalette( hDC, dcs->w.hPalette, FALSE ); + NtGdiSelectObject( hDC, dcs->w.hBitmap ); + NtGdiSelectObject( hDC, dcs->w.hBrush ); + NtGdiSelectObject( hDC, dcs->w.hFont ); + NtGdiSelectObject( hDC, dcs->w.hPen ); + NtGdiSetBkColor( hDC, dcs->w.backgroundColor); + NtGdiSetTextColor( hDC, dcs->w.textColor); + + NtGdiSelectPalette( hDC, dcs->w.hPalette, FALSE ); #if 0 - GDISelectPalette16( hDC, dcs->w.hPalette, FALSE ); + GDISelectPalette16( hDC, dcs->w.hPalette, FALSE ); #endif } else { - DC_UnlockDc(dc); + DC_UnlockDc(dc); } DC_UnlockDc ( dcs ); } else { @@ -1624,7 +1624,7 @@ } else { - ret = 0; + ret = 0; } break; @@ -1635,7 +1635,7 @@ } else { - ret = 0; + ret = 0; } break; @@ -1646,7 +1646,7 @@ } else { - ret = 0; + ret = 0; } break; @@ -1657,7 +1657,7 @@ } else { - ret = 0; + ret = 0; } break; @@ -1672,7 +1672,7 @@ } else { - ret = 0; + ret = 0; } break; @@ -1683,7 +1683,7 @@ } else { - ret = 0; + ret = 0; } break; @@ -1802,12 +1802,12 @@ /* From Wine: GetObject does not SetLastError() on a null object */ if (!handle) return 0; - + if (count <= 0) { return 0; } - + _SEH_TRY { ProbeForWrite(buffer, @@ -1819,7 +1819,7 @@ Status = _SEH_GetExceptionCode(); } _SEH_END; - + if(!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -1985,7 +1985,7 @@ DC_SetNextDC (dcs, DC_GetNextDC (dcs)); if (--dc->saveLevel < SaveLevel) { - DC_UnlockDc( dc ); + DC_UnlockDc( dc ); DC_UnlockDc( dcs ); NtGdiSetDCState(hDC, hdcs); #if 0 @@ -1996,11 +1996,11 @@ success = FALSE; } #endif - dc = DC_LockDc(hDC); - if(!dc) - { - return FALSE; - } + dc = DC_LockDc(hDC); + if(!dc) + { + return FALSE; + } } else { @@ -2077,17 +2077,17 @@ HRGN hVisRgn; BOOLEAN Failed; - if (!hDC || !hGDIObj) + if (!hDC || !hGDIObj) { /* From Wine: * SelectObject() with a NULL DC returns 0 and sets ERROR_INVALID_HANDLE. * Note: Under XP at least invalid ptrs can also be passed, not just NULL; * Don't test that here in case it crashes earlier win versions. */ - if (!hDC) SetLastWin32Error(ERROR_INVALID_HANDLE); + if (!hDC) SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } - + dc = DC_LockDc(hDC); if (NULL == dc) { @@ -2162,11 +2162,11 @@ } pb = BITMAPOBJ_LockBitmap(hGDIObj); if (NULL == pb) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); + { + SetLastWin32Error(ERROR_INVALID_HANDLE); DC_UnlockDc(dc); - return NULL; - } + return NULL; + } objOrg = (HGDIOBJ)dc->w.hBitmap; /* Release the old bitmap, lock the new one and convert it to a SURF */ @@ -2758,7 +2758,7 @@ DPRINT1("flag CDS_TEST UNIMPLEMENT"); Ret = DISP_CHANGE_FAILED; } - + if ((dwflags & CDS_FULLSCREEN) == CDS_FULLSCREEN) { DEVMODE lpDevMode; @@ -2783,143 +2783,142 @@ if ((lpDevMode.dmBitsPerPel == DevMode->dmBitsPerPel) && (lpDevMode.dmPelsWidth == DevMode->dmPelsWidth) && (lpDevMode.dmPelsHeight == DevMode->dmPelsHeight)) - Ret = DISP_CHANGE_SUCCESSFUL; + Ret = DISP_CHANGE_SUCCESSFUL; } if ((dwflags & CDS_VIDEOPARAMETERS) == CDS_VIDEOPARAMETERS) - { + { dwflags &= ~CDS_VIDEOPARAMETERS; - if (lParam == NULL) Ret=DISP_CHANGE_BADPARAM; - else - { - DPRINT1("flag CDS_VIDEOPARAMETERS UNIMPLEMENT"); - Ret = DISP_CHANGE_FAILED; - } - - } + if (lParam == NULL) + Ret=DISP_CHANGE_BADPARAM; + else + { + DPRINT1("flag CDS_VIDEOPARAMETERS UNIMPLEMENT"); + Ret = DISP_CHANGE_FAILED; + } + + } if ((dwflags & CDS_UPDATEREGISTRY) == CDS_UPDATEREGISTRY) - { - - UNICODE_STRING ObjectName; - UNICODE_STRING KernelModeName; - WCHAR KernelModeNameBuffer[256]; - UNICODE_STRING RegistryKey; - WCHAR RegistryKeyBuffer[512]; - PDEVICE_OBJECT DeviceObject; - ULONG LastSlash; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE DevInstRegKey; - ULONG NewValue; - - - DPRINT1("set CDS_UPDATEREGISTRY \n"); - - dwflags &= ~CDS_UPDATEREGISTRY; - - /* Get device name (pDeviceName is "\.\xxx") */ - for (LastSlash = pDeviceName->Length / sizeof(WCHAR); LastSlash > 0; LastSlash--) - { - if (pDeviceName->Buffer[LastSlash - 1] == L'\\') - break; - } - - if (LastSlash == 0) return DISP_CHANGE_RESTART; - ObjectName = *pDeviceName; - ObjectName.Length -= LastSlash * sizeof(WCHAR); - ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR); - ObjectName.Buffer += LastSlash; - - KernelModeName.Length = 0; - KernelModeName.MaximumLength = sizeof(KernelModeNameBuffer); - KernelModeName.Buffer = KernelModeNameBuffer; - - /* Open \??\xxx (ex: "\??\DISPLAY1") */ - Status = RtlAppendUnicodeToString(&KernelModeName, L"\\??\\"); - - if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; - Status = RtlAppendUnicodeStringToString(&KernelModeName, &ObjectName); - - if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; - Status = ObReferenceObjectByName( - &KernelModeName, - OBJ_CASE_INSENSITIVE, - NULL, - 0, - IoDeviceObjectType, - KernelMode, - NULL, - (PVOID*)&DeviceObject); - - if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; - /* Get associated driver name (ex: "VBE") */ - for (LastSlash = DeviceObject->DriverObject->DriverName.Length / sizeof(WCHAR); LastSlash > 0; LastSlash--) - { - if (DeviceObject->DriverObject->DriverName.Buffer[LastSlash - 1] == L'\\') - break; - } - - if (LastSlash == 0) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } - ObjectName = DeviceObject->DriverObject->DriverName; - ObjectName.Length -= LastSlash * sizeof(WCHAR); - ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR); - ObjectName.Buffer += LastSlash; - - RegistryKey.Length = 0; - RegistryKey.MaximumLength = sizeof(RegistryKeyBuffer); - RegistryKey.Buffer = RegistryKeyBuffer; - - /* Open registry key */ - Status = RtlAppendUnicodeToString(&RegistryKey, - L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\"); - - if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } - Status = RtlAppendUnicodeStringToString(&RegistryKey, &ObjectName); - - if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } - Status = RtlAppendUnicodeToString(&RegistryKey, - L"\\Device0"); - - if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } - - InitializeObjectAttributes(&ObjectAttributes, &RegistryKey, - OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = ZwOpenKey(&DevInstRegKey, GENERIC_READ | GENERIC_WRITE, &ObjectAttributes); - ObDereferenceObject(DeviceObject); - if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; - - /* Update needed fields */ - if (NT_SUCCESS(Status) && DevMode->dmFields & DM_BITSPERPEL) - { - RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.BitsPerPel"); - NewValue = DevMode->dmBitsPerPel; - Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue)); - } - - if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSWIDTH) - { - RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.XResolution"); - NewValue = DevMode->dmPelsWidth; - Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue)); - } - - if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSHEIGHT) - { - RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.YResolution"); - NewValue = DevMode->dmPelsHeight; - Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue)); - } - - ZwClose(DevInstRegKey); - if (NT_SUCCESS(Status)) - Ret = DISP_CHANGE_RESTART; - else - /* return DISP_CHANGE_NOTUPDATED when we can save to reg only vaild for NT */ - Ret = DISP_CHANGE_NOTUPDATED; - - } - - if (dwflags != 0) + { + + UNICODE_STRING ObjectName; + UNICODE_STRING KernelModeName; + WCHAR KernelModeNameBuffer[256]; + UNICODE_STRING RegistryKey; + WCHAR RegistryKeyBuffer[512]; + PDEVICE_OBJECT DeviceObject; + ULONG LastSlash; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE DevInstRegKey; + ULONG NewValue; + + DPRINT1("set CDS_UPDATEREGISTRY \n"); + + dwflags &= ~CDS_UPDATEREGISTRY; + + /* Get device name (pDeviceName is "\.\xxx") */ + for (LastSlash = pDeviceName->Length / sizeof(WCHAR); LastSlash > 0; LastSlash--) + { + if (pDeviceName->Buffer[LastSlash - 1] == L'\\') + break; + } + + if (LastSlash == 0) return DISP_CHANGE_RESTART; + ObjectName = *pDeviceName; + ObjectName.Length -= LastSlash * sizeof(WCHAR); + ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR); + ObjectName.Buffer += LastSlash; + + KernelModeName.Length = 0; + KernelModeName.MaximumLength = sizeof(KernelModeNameBuffer); + KernelModeName.Buffer = KernelModeNameBuffer; + + /* Open \??\xxx (ex: "\??\DISPLAY1") */ + Status = RtlAppendUnicodeToString(&KernelModeName, L"\\??\\"); + + if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; + Status = RtlAppendUnicodeStringToString(&KernelModeName, &ObjectName); + + if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; + Status = ObReferenceObjectByName( + &KernelModeName, + OBJ_CASE_INSENSITIVE, + NULL, + 0, + IoDeviceObjectType, + KernelMode, + NULL, + (PVOID*)&DeviceObject); + + if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; + /* Get associated driver name (ex: "VBE") */ + for (LastSlash = DeviceObject->DriverObject->DriverName.Length / sizeof(WCHAR); LastSlash > 0; LastSlash--) + { + if (DeviceObject->DriverObject->DriverName.Buffer[LastSlash - 1] == L'\\') + break; + } + + if (LastSlash == 0) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } + ObjectName = DeviceObject->DriverObject->DriverName; + ObjectName.Length -= LastSlash * sizeof(WCHAR); + ObjectName.MaximumLength -= LastSlash * sizeof(WCHAR); + ObjectName.Buffer += LastSlash; + + RegistryKey.Length = 0; + RegistryKey.MaximumLength = sizeof(RegistryKeyBuffer); + RegistryKey.Buffer = RegistryKeyBuffer; + + /* Open registry key */ + Status = RtlAppendUnicodeToString(&RegistryKey, + L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\"); + + if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } + Status = RtlAppendUnicodeStringToString(&RegistryKey, &ObjectName); + + if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } + Status = RtlAppendUnicodeToString(&RegistryKey, + L"\\Device0"); + + if (!NT_SUCCESS(Status)) { ObDereferenceObject(DeviceObject); return DISP_CHANGE_FAILED; } + + InitializeObjectAttributes(&ObjectAttributes, &RegistryKey, + OBJ_CASE_INSENSITIVE, NULL, NULL); + Status = ZwOpenKey(&DevInstRegKey, GENERIC_READ | GENERIC_WRITE, &ObjectAttributes); + ObDereferenceObject(DeviceObject); + if (!NT_SUCCESS(Status)) return DISP_CHANGE_FAILED; + + /* Update needed fields */ + if (NT_SUCCESS(Status) && DevMode->dmFields & DM_BITSPERPEL) + { + RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.BitsPerPel"); + NewValue = DevMode->dmBitsPerPel; + Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue)); + } + + if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSWIDTH) + { + RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.XResolution"); + NewValue = DevMode->dmPelsWidth; + Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue)); + } + + if (NT_SUCCESS(Status) && DevMode->dmFields & DM_PELSHEIGHT) + { + RtlInitUnicodeString(&RegistryKey, L"DefaultSettings.YResolution"); + NewValue = DevMode->dmPelsHeight; + Status = ZwSetValueKey(DevInstRegKey, &RegistryKey, 0, REG_DWORD, &NewValue, sizeof(NewValue)); + } + + ZwClose(DevInstRegKey); + if (NT_SUCCESS(Status)) + Ret = DISP_CHANGE_RESTART; + else + /* return DISP_CHANGE_NOTUPDATED when we can save to reg only valid for NT */ + Ret = DISP_CHANGE_NOTUPDATED; + } + + if (dwflags != 0) Ret = DISP_CHANGE_BADFLAGS; return Ret;
18 years, 6 months
1
0
0
0
[hpoussin] 22118: Fix installation from default directory (%SYSTEMROOT%\Inf). Thanks WaxDragon for reporting.
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue May 30 20:05:27 2006 New Revision: 22118 URL:
http://svn.reactos.ru/svn/reactos?rev=22118&view=rev
Log: Fix installation from default directory (%SYSTEMROOT%\Inf). Thanks WaxDragon for reporting. Modified: trunk/reactos/dll/win32/setupapi/devinst.c trunk/reactos/dll/win32/setupapi/parser.c trunk/reactos/dll/win32/setupapi/setupapi_private.h Modified: trunk/reactos/dll/win32/setupapi/devinst.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/devinst.c (original) +++ trunk/reactos/dll/win32/setupapi/devinst.c Tue May 30 20:05:27 2006 @@ -25,6 +25,7 @@ /* Unicode constants */ static const WCHAR AddInterface[] = {'A','d','d','I','n','t','e','r','f','a','c','e',0}; +static const WCHAR BackSlash[] = {'\\',0}; static const WCHAR ClassGUID[] = {'C','l','a','s','s','G','U','I','D',0}; static const WCHAR Class[] = {'C','l','a','s','s',0}; static const WCHAR ClassInstall32[] = {'C','l','a','s','s','I','n','s','t','a','l','l','3','2',0}; @@ -34,6 +35,7 @@ static const WCHAR DotHW[] = {'.','H','W',0}; static const WCHAR DotInterfaces[] = {'.','I','n','t','e','r','f','a','c','e','s',0}; static const WCHAR DotServices[] = {'.','S','e','r','v','i','c','e','s',0}; +static const WCHAR InfDirectory[] = {'i','n','f','\\',0}; static const WCHAR InterfaceInstall32[] = {'I','n','t','e','r','f','a','c','e','I','n','s','t','a','l','l','3','2',0}; static const WCHAR Linked[] = {'L','i','n','k','e','d',0}; static const WCHAR SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k',0}; @@ -1693,9 +1695,9 @@ if (rc != ERROR_SUCCESS) goto cleanup; strcpyW(InstancePath, Enumerator); - strcatW(InstancePath, L"\\"); + strcatW(InstancePath, BackSlash); strcatW(InstancePath, KeyBuffer); - strcatW(InstancePath, L"\\"); + strcatW(InstancePath, BackSlash); pEndOfInstancePath = &InstancePath[strlenW(InstancePath)]; /* Enumerate instance IDs (subkeys of hDeviceIdKey) */ @@ -6021,8 +6023,17 @@ LPCWSTR filename; LPWSTR pFullFilename; - if (!(InstallParams.Flags & DI_ENUMSINGLEINF) && *InstallParams.DriverPath) - { + if (InstallParams.Flags & DI_ENUMSINGLEINF) + { + /* Only a filename */ + FullInfFileName = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR)); + if (!FullInfFileName) + goto done; + pFullFilename = &FullInfFileName[0]; + } + else if (*InstallParams.DriverPath) + { + /* Directory name specified */ DWORD len; len = GetFullPathNameW(InstallParams.DriverPath, 0, NULL, NULL); if (len == 0) @@ -6034,15 +6045,26 @@ if (len == 0) goto done; if (*FullInfFileName && FullInfFileName[strlenW(FullInfFileName) - 1] != '\\') - strcatW(FullInfFileName, L"\\"); + strcatW(FullInfFileName, BackSlash); pFullFilename = &FullInfFileName[strlenW(FullInfFileName)]; } else { - FullInfFileName = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR)); + /* Nothing specified ; need to get the %SYSTEMROOT%\ directory */ + DWORD len; + len = GetSystemWindowsDirectoryW(NULL, 0); + if (len == 0) + goto done; + FullInfFileName = HeapAlloc(GetProcessHeap(), 0, (len + 1 + strlenW(InfDirectory) + MAX_PATH) * sizeof(WCHAR)); if (!FullInfFileName) goto done; - pFullFilename = &FullInfFileName[0]; + len = GetSystemWindowsDirectoryW(FullInfFileName, len); + if (len == 0) + goto done; + if (*FullInfFileName && FullInfFileName[strlenW(FullInfFileName) - 1] != '\\') + strcatW(FullInfFileName, BackSlash); + strcatW(FullInfFileName, InfDirectory); + pFullFilename = &FullInfFileName[strlenW(FullInfFileName)]; } for (filename = (LPCWSTR)Buffer; *filename; filename += strlenW(filename) + 1) @@ -7911,19 +7933,23 @@ } else { - WCHAR Windir[MAX_PATH]; + WCHAR Windir[MAX_PATH + 1 + strlenW(InfDirectory)]; UINT ret; - ret = GetWindowsDirectory(Windir, MAX_PATH); - if (ret == 0 || ret >= MAX_PATH) + ret = GetSystemWindowsDirectoryW(Windir, MAX_PATH); + if (ret == 0 || ret > MAX_PATH) { SetLastError(ERROR_GEN_FAILURE); return FALSE; } - - if (strncmpW(FullName, Windir, last - FullName) == 0) - { - /* The path is %WINDIR%\Inf */ + if (*Windir && Windir[strlenW(Windir) - 1] != '\\') + strcatW(Windir, BackSlash); + strcatW(Windir, InfDirectory); + + DPRINT1("Comparing %S and %S\n", FullName, Windir); + if (strncmpiW(FullName, Windir, last - FullName) == 0) + { + /* The path is %SYSTEMROOT%\Inf */ *IsOEMLocation = FALSE; } else Modified: trunk/reactos/dll/win32/setupapi/parser.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/parser.c…
============================================================================== --- trunk/reactos/dll/win32/setupapi/parser.c (original) +++ trunk/reactos/dll/win32/setupapi/parser.c Tue May 30 20:05:27 2006 @@ -2019,7 +2019,7 @@ /* "DirectoryPath\" form */ len = strlenW(DirectoryPath) + 1 + 1; else - /* "%WINDIR%\Inf\" form */ + /* "%SYSTEMROOT%\Inf\" form */ len = MAX_PATH + 1 + strlenW(InfDirectory) + 1; len += MAX_PATH; /* To contain file name or "*.inf" string */ pFullFileName = MyMalloc(len * sizeof(WCHAR)); Modified: trunk/reactos/dll/win32/setupapi/setupapi_private.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/setupapi…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi_private.h (original) +++ trunk/reactos/dll/win32/setupapi/setupapi_private.h Tue May 30 20:05:27 2006 @@ -74,8 +74,7 @@ HINF hInf; LONG References; - /* Contains the directory name of the .inf file. This field may - * be NULL if the file is already in %SYSTEMROOT%\Inf. + /* Contains the directory name of the .inf file. * Points into szData at then end of the structure */ PCWSTR DirectoryName; /* Contains the .inf file name (without directory name).
18 years, 6 months
1
0
0
0
[hpoussin] 22117: Implement the Browse button, but it is not working well :(
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue May 30 17:39:21 2006 New Revision: 22117 URL:
http://svn.reactos.ru/svn/reactos?rev=22117&view=rev
Log: Implement the Browse button, but it is not working well :( Modified: trunk/reactos/dll/win32/newdev/newdev_private.h trunk/reactos/dll/win32/newdev/wizard.c Modified: trunk/reactos/dll/win32/newdev/newdev_private.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev_pri…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev_private.h (original) +++ trunk/reactos/dll/win32/newdev/newdev_private.h Tue May 30 17:39:21 2006 @@ -8,6 +8,7 @@ #include <regstr.h> #include <setupapi.h> #include <cfgmgr32.h> +#include <shlobj.h> #include <tchar.h> #include <wine/debug.h> Modified: trunk/reactos/dll/win32/newdev/wizard.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/wizard.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/wizard.c (original) +++ trunk/reactos/dll/win32/newdev/wizard.c Tue May 30 17:39:21 2006 @@ -620,7 +620,7 @@ IncludePath(HWND Dlg, BOOL Enabled) { EnableWindow(GetDlgItem(Dlg, IDC_COMBO_PATH), Enabled); - EnableWindow(GetDlgItem(Dlg, IDC_BROWSE), /*FIXME: Enabled*/ FALSE); + EnableWindow(GetDlgItem(Dlg, IDC_BROWSE), Enabled); } static void @@ -697,9 +697,35 @@ return TRUE; case IDC_BROWSE: - /* FIXME: set the IDC_COMBO_PATH text */ - FIXME("Should display browse folder dialog\n"); - return FALSE; + { + BROWSEINFO bi = { 0, }; + LPITEMIDLIST pidl; + + bi.hwndOwner = hwndDlg; + bi.ulFlags = BIF_RETURNONLYFSDIRS; + pidl = SHBrowseForFolder(&bi); + if (pidl) + { + TCHAR Directory[MAX_PATH]; + IMalloc* malloc; + + if (SHGetPathFromIDList(pidl, Directory)) + { + /* Set the IDC_COMBO_PATH text */ + ComboBox_SetText(GetDlgItem(hwndDlg, IDC_COMBO_PATH), Directory); + } + + /* Free memory, if possible */ + if (SUCCEEDED(SHGetMalloc(&malloc))) + { + FIXME("Memory leak!\n"); + //malloc->Free(pidl); + //malloc->Release(); + } + return TRUE; + } + break; + } } break; }
18 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
...
38
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Results per page:
10
25
50
100
200