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
February 2005
----- 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
23 participants
411 discussions
Start a n
N
ew thread
[arty] 13415: Fixed some signalling problems.
by arty@svn.reactos.com
Fixed some signalling problems. 1) Always OR the current state bits into the socket for the handler to see 2) Remove special case for SEL_CONNECT | SEL_FIN in the signalled handler. Now it's much cleaner. Modified: trunk/reactos/drivers/lib/ip/transport/tcp/event.c Modified: trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c _____ Modified: trunk/reactos/drivers/lib/ip/transport/tcp/event.c --- trunk/reactos/drivers/lib/ip/transport/tcp/event.c 2005-02-05 01:44:05 UTC (rev 13414) +++ trunk/reactos/drivers/lib/ip/transport/tcp/event.c 2005-02-05 04:56:04 UTC (rev 13415) @@ -41,9 +41,10 @@ TI_DbgPrint(MID_TRACE,("Connection signalled: %d\n", Connection->Signalled)); + + Connection->SignalState |= NewState; if( !Connection->Signalled ) { Connection->Signalled = TRUE; - Connection->SignalState = NewState; InsertTailList( &SignalledConnections, &Connection->SignalList ); } _____ Modified: trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c --- trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c 2005-02-05 01:44:05 UTC (rev 13414) +++ trunk/reactos/drivers/lib/ip/transport/tcp/tcp.c 2005-02-05 04:56:04 UTC (rev 13415) @@ -34,24 +34,31 @@ Connection, Connection->SocketContext)); /* Things that can happen when we try the initial connection */ - if( ((NewState & SEL_CONNECT) || (NewState & SEL_FIN)) && - !(Connection->State & (SEL_CONNECT | SEL_FIN)) ) { - + if( NewState & SEL_CONNECT ) { while( !IsListEmpty( &Connection->ConnectRequest ) ) { - Connection->State |= NewState & (SEL_CONNECT | SEL_FIN); - Entry = RemoveHeadList( &Connection->ConnectRequest ); - Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry ); - Complete = Bucket->Request.RequestNotifyObject; - TI_DbgPrint(DEBUG_TCP, - ("Completing Connect Request %x\n", Bucket->Request)); - if( NewState & SEL_FIN ) Status = STATUS_CONNECTION_REFUSED; - Complete( Bucket->Request.RequestContext, Status, 0 ); - /* Frees the bucket allocated in TCPConnect */ - PoolFreeBuffer( Bucket ); - } + Connection->State |= NewState; + Entry = RemoveHeadList( &Connection->ConnectRequest ); + TI_DbgPrint(DEBUG_TCP, ("Connect Event\n")); + + Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry ); + Complete = Bucket->Request.RequestNotifyObject; + TI_DbgPrint(DEBUG_TCP, + ("Completing Request %x\n", Bucket->Request)); + + if( (NewState & (SEL_CONNECT | SEL_FIN)) == + (SEL_CONNECT | SEL_FIN) ) + Status = STATUS_CONNECTION_REFUSED; + else + Status = STATUS_SUCCESS; + + Complete( Bucket->Request.RequestContext, Status, 0 ); + + /* Frees the bucket allocated in TCPConnect */ + PoolFreeBuffer( Bucket ); + } } - if( (NewState & SEL_ACCEPT) ) { + if( NewState & SEL_ACCEPT ) { /* Handle readable on a listening socket -- * TODO: Implement filtering */ @@ -88,7 +95,7 @@ } /* Things that happen after we're connected */ - if( (NewState & SEL_READ) ) { + if( NewState & SEL_READ ) { TI_DbgPrint(DEBUG_TCP,("Readable: irp list %s\n", IsListEmpty(&Connection->ReceiveRequest) ? "empty" : "nonempty")); @@ -146,6 +153,7 @@ } } } + if( NewState & SEL_FIN ) { TI_DbgPrint(DEBUG_TCP, ("EOF From socket\n"));
19 years, 10 months
1
0
0
0
[weiden] 13414: implemented GetConsoleProcessList()
by weiden@svn.reactos.com
implemented GetConsoleProcessList() Modified: trunk/reactos/include/csrss/csrss.h Modified: trunk/reactos/lib/kernel32/misc/console.c Modified: trunk/reactos/lib/ntdll/csr/lpc.c Modified: trunk/reactos/subsys/csrss/include/conio.h Modified: trunk/reactos/subsys/csrss/win32csr/conio.c Modified: trunk/reactos/subsys/csrss/win32csr/dllmain.c _____ Modified: trunk/reactos/include/csrss/csrss.h --- trunk/reactos/include/csrss/csrss.h 2005-02-05 00:20:14 UTC (rev 13413) +++ trunk/reactos/include/csrss/csrss.h 2005-02-05 01:44:05 UTC (rev 13414) @@ -11,11 +11,11 @@ typedef struct { -} CSRSS_CONNECT_PROCESS_REQUEST, PCSRSS_CONNECT_PROCESS_REQUEST; +} CSRSS_CONNECT_PROCESS_REQUEST, *PCSRSS_CONNECT_PROCESS_REQUEST; typedef struct { -} CSRSS_CONNECT_PROCESS_REPLY, PCSRSS_CONNECT_PROCESS_REPLY; +} CSRSS_CONNECT_PROCESS_REPLY, *PCSRSS_CONNECT_PROCESS_REPLY; typedef struct { @@ -33,14 +33,26 @@ typedef struct { -} CSRSS_TERMINATE_PROCESS_REQUEST, PCSRSS_TERMINATE_PROCESS_REQUEST; +} CSRSS_TERMINATE_PROCESS_REQUEST, *PCSRSS_TERMINATE_PROCESS_REQUEST; typedef struct { -} CSRSS_TERMINATE_PROCESS_REPLY, PCSRSS_TERMINATE_PROCESS_REPLY; +} CSRSS_TERMINATE_PROCESS_REPLY, *PCSRSS_TERMINATE_PROCESS_REPLY; typedef struct { + ULONG nMaxIds; +} CSRSS_GET_PROCESS_LIST_REQUEST, *PCSRSS_GET_PROCESS_LIST_REQUEST; + +typedef struct +{ + ULONG nProcessIdsCopied; + ULONG nProcessIdsTotal; + HANDLE ProcessId[1]; +} CSRSS_GET_PROCESS_LIST_REPLY, *PCSRSS_GET_PROCESS_LIST_REPLY; + +typedef struct +{ HANDLE ConsoleHandle; BOOL Unicode; ULONG NrCharactersToWrite; @@ -250,12 +262,12 @@ typedef struct { HANDLE UniqueThread; -} CSRSS_IDENTIFY_ALERTABLE_THREAD_REQUEST, * PCSRSS_IDENTIFY_ALERTABLE_THREAD_REQUEST; +} CSRSS_IDENTIFY_ALERTABLE_THREAD_REQUEST, *PCSRSS_IDENTIFY_ALERTABLE_THREAD_REQUEST; typedef struct { CLIENT_ID Cid; -} CSRSS_IDENTIFY_ALERTABLE_THREAD_REPLY, * PCSRSS_IDENTIFY_ALERTABLE_THREAD_REPLY; +} CSRSS_IDENTIFY_ALERTABLE_THREAD_REPLY, *PCSRSS_IDENTIFY_ALERTABLE_THREAD_REPLY; typedef struct { @@ -687,6 +699,7 @@ #define CSRSS_GET_CONSOLE_OUTPUT_CP (0x33) #define CSRSS_SET_CONSOLE_OUTPUT_CP (0x34) #define CSRSS_GET_INPUT_WAIT_HANDLE (0x35) +#define CSRSS_GET_PROCESS_LIST (0x36) /* Keep in sync with definition below. */ #define CSRSS_REQUEST_HEADER_SIZE (LPC_MESSAGE_BASE_SIZE + sizeof(ULONG)) @@ -752,6 +765,7 @@ CSRSS_GET_CONSOLE_OUTPUT_CP_REQUEST GetConsoleOutputCodePage; CSRSS_SET_CONSOLE_OUTPUT_CP_REQUEST SetConsoleOutputCodePage; CSRSS_GET_INPUT_WAIT_HANDLE_REQUEST GetConsoleInputWaitHandle; + CSRSS_GET_PROCESS_LIST_REQUEST GetProcessListRequest; } Data; }; }; @@ -807,6 +821,7 @@ CSRSS_GET_CONSOLE_OUTPUT_CP_REPLY GetConsoleOutputCodePage; CSRSS_SET_CONSOLE_OUTPUT_CP_REPLY SetConsoleOutputCodePage; CSRSS_GET_INPUT_WAIT_HANDLE_REPLY GetConsoleInputWaitHandle; + CSRSS_GET_PROCESS_LIST_REPLY GetProcessListReply; } Data; }; }; _____ Modified: trunk/reactos/lib/kernel32/misc/console.c --- trunk/reactos/lib/kernel32/misc/console.c 2005-02-05 00:20:14 UTC (rev 13413) +++ trunk/reactos/lib/kernel32/misc/console.c 2005-02-05 01:44:05 UTC (rev 13414) @@ -1569,7 +1569,7 @@ Size = nLength * sizeof(INPUT_RECORD); - Status = CsrCaptureParameterBuffer((PVOID)lpBuffer, Size, &BufferBase, &BufferTargetBase); + Status = CsrCaptureParameterBuffer(NULL, Size, &BufferBase, &BufferTargetBase); if(!NT_SUCCESS(Status)) { SetLastErrorByStatus(Status); @@ -1884,7 +1884,7 @@ Size = dwBufferSize.X * dwBufferSize.Y * sizeof(CHAR_INFO); - Status = CsrCaptureParameterBuffer((PVOID)lpBuffer, Size, &BufferBase, &BufferTargetBase); + Status = CsrCaptureParameterBuffer(NULL, Size, &BufferBase, &BufferTargetBase); if(!NT_SUCCESS(Status)) { SetLastErrorByStatus(Status); @@ -3327,15 +3327,63 @@ /*-------------------------------------------------------------- * GetConsoleProcessList * - * @unimplemented + * @implemented */ DWORD STDCALL GetConsoleProcessList(LPDWORD lpdwProcessList, - DWORD dwProcessCount) + DWORD dwProcessCount) { - DPRINT1("GetConsoleProcessList(0x%x, 0x%x) UNIMPLEMENTED!\n", lpdwProcessList, dwProcessCount); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + CSRSS_API_REQUEST Request; + PCSRSS_API_REPLY Reply; + ULONG BufferSize, nProcesses; + NTSTATUS Status; + + if(lpdwProcessList == NULL || dwProcessCount == 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + BufferSize = sizeof(CSRSS_API_REQUEST) + + (dwProcessCount * sizeof(Reply->Data.GetProcessListReply.ProcessId[0])); + + Reply = RtlAllocateHeap(GetProcessHeap(), 0, BufferSize); + if(Reply == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } + + Reply->Status = STATUS_SUCCESS; + + Request.Type = CSRSS_GET_PROCESS_LIST; + Request.Data.GetProcessListRequest.nMaxIds = dwProcessCount; + + Status = CsrClientCallServer(&Request, Reply, sizeof(CSRSS_API_REQUEST), + BufferSize); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Reply->Status)) + { + SetLastErrorByStatus (Status); + nProcesses = 0; + } + else + { + if(dwProcessCount >= Reply->Data.GetProcessListReply.nProcessIdsTotal) + { + nProcesses = Reply->Data.GetProcessListReply.nProcessIdsCopied; + for(nProcesses = 0; nProcesses < Reply->Data.GetProcessListReply.nProcessIdsCopied; nProcesses++) + { + *(lpdwProcessList++) = (DWORD)Reply->Data.GetProcessListReply.ProcessId[nProcesses]; + } + } + else + { + nProcesses = Reply->Data.GetProcessListReply.nProcessIdsTotal; + } + } + + RtlFreeHeap(GetProcessHeap(), 0, Reply); + return nProcesses; } _____ Modified: trunk/reactos/lib/ntdll/csr/lpc.c --- trunk/reactos/lib/ntdll/csr/lpc.c 2005-02-05 00:20:14 UTC (rev 13413) +++ trunk/reactos/lib/ntdll/csr/lpc.c 2005-02-05 01:44:05 UTC (rev 13414) @@ -71,7 +71,10 @@ { return(STATUS_NO_MEMORY); } - memcpy(Block, ParameterBuffer, ParameterBufferSize); + if(ParameterBuffer != NULL) + { + memcpy(Block, ParameterBuffer, ParameterBufferSize); + } *ClientAddress = Block; *ServerAddress = Block - CsrSectionMapBase + CsrSectionMapServerBase; return(STATUS_SUCCESS); _____ Modified: trunk/reactos/subsys/csrss/include/conio.h --- trunk/reactos/subsys/csrss/include/conio.h 2005-02-05 00:20:14 UTC (rev 13413) +++ trunk/reactos/subsys/csrss/include/conio.h 2005-02-05 01:44:05 UTC (rev 13414) @@ -139,6 +139,7 @@ CSR_API(CsrSetConsoleCodePage); CSR_API(CsrGetConsoleOutputCodePage); CSR_API(CsrSetConsoleOutputCodePage); +CSR_API(CsrGetProcessList); #define ConioInitScreenBuffer(Console, Buff) (Console)->Vtbl->InitScreenBuffer((Console), (Buff)) #define ConioDrawRegion(Console, Region) (Console)->Vtbl->DrawRegion((Console), (Region)) _____ Modified: trunk/reactos/subsys/csrss/win32csr/conio.c --- trunk/reactos/subsys/csrss/win32csr/conio.c 2005-02-05 00:20:14 UTC (rev 13413) +++ trunk/reactos/subsys/csrss/win32csr/conio.c 2005-02-05 01:44:05 UTC (rev 13414) @@ -3163,4 +3163,51 @@ return Reply->Status = STATUS_UNSUCCESSFUL; } +CSR_API(CsrGetProcessList) +{ + PHANDLE Buffer; + PCSRSS_CONSOLE Console; + PCSRSS_PROCESS_DATA current; + PLIST_ENTRY current_entry; + ULONG nItems, nCopied; + NTSTATUS Status; + + DPRINT("CsrGetProcessList\n"); + + Buffer = Reply->Data.GetProcessListReply.ProcessId; + Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY); + Reply->Header.DataSize = Reply->Header.MessageSize - LPC_MESSAGE_BASE_SIZE; + + nItems = nCopied = 0; + Reply->Data.GetProcessListReply.nProcessIdsCopied = 0; + Reply->Data.GetProcessListReply.nProcessIdsTotal = 0; + + Status = ConioConsoleFromProcessData(ProcessData, &Console); + if (! NT_SUCCESS(Status)) + { + return Reply->Status = Status; + } + + DPRINT1("Console_Api Ctrl-C\n"); + + for(current_entry = Console->ProcessList.Flink; + current_entry != &Console->ProcessList; + current_entry = current_entry->Flink) + { + current = CONTAINING_RECORD(current_entry, CSRSS_PROCESS_DATA, ProcessEntry); + if(nItems++ < Request->Data.GetProcessListRequest.nMaxIds) + { + *(Buffer++) = current->ProcessId; + nCopied++; + } + } + + ConioUnlockConsole(Console); + + Reply->Data.GetProcessListReply.nProcessIdsCopied = nCopied; + Reply->Data.GetProcessListReply.nProcessIdsTotal = nItems; + + return Reply->Status = STATUS_SUCCESS; +} + /* EOF */ _____ Modified: trunk/reactos/subsys/csrss/win32csr/dllmain.c --- trunk/reactos/subsys/csrss/win32csr/dllmain.c 2005-02-05 00:20:14 UTC (rev 13413) +++ trunk/reactos/subsys/csrss/win32csr/dllmain.c 2005-02-05 01:44:05 UTC (rev 13414) @@ -71,6 +71,7 @@ CSRSS_DEFINE_API(CSRSS_SET_CONSOLE_CP, CsrSetConsoleCodePage), CSRSS_DEFINE_API(CSRSS_GET_CONSOLE_OUTPUT_CP, CsrGetConsoleOutputCodePage), CSRSS_DEFINE_API(CSRSS_SET_CONSOLE_OUTPUT_CP, CsrSetConsoleOutputCodePage), + CSRSS_DEFINE_API(CSRSS_GET_PROCESS_LIST, CsrGetProcessList), { 0, 0, 0, NULL } };
19 years, 10 months
1
0
0
0
[ekohl] 13413:
by ekohl@svn.reactos.com
Modified: trunk/reactos/Makefile Modified: trunk/reactos/bootdata/hivesys.inf Modified: trunk/reactos/bootdata/packages/reactos.dff Added: trunk/reactos/services/umpnpmgr/ Added: trunk/reactos/services/umpnpmgr/makefile Added: trunk/reactos/services/umpnpmgr/umpnpmgr.c Added: trunk/reactos/services/umpnpmgr/umpnpmgr.rc _____ Modified: trunk/reactos/Makefile --- trunk/reactos/Makefile 2005-02-05 00:17:49 UTC (rev 13412) +++ trunk/reactos/Makefile 2005-02-05 00:20:14 UTC (rev 13413) @@ -105,8 +105,7 @@ winlogon regedit winefile notepad reactos # System services -# rpcss eventlog -SYS_SVC = rpcss eventlog +SYS_SVC = rpcss eventlog umpnpmgr APPS = testsets utils _____ Modified: trunk/reactos/bootdata/hivesys.inf --- trunk/reactos/bootdata/hivesys.inf 2005-02-05 00:17:49 UTC (rev 13412) +++ trunk/reactos/bootdata/hivesys.inf 2005-02-05 00:20:14 UTC (rev 13413) @@ -201,6 +201,7 @@ "NDIS", \ "PNP_TDI", \ "TDI", \ + "PlugPlay", \ "Extended Base" ; Group order, the first DWORD is the count of entries, @@ -676,6 +677,13 @@ ;HKLM,"SYSTEM\CurrentControlSet\Services\ntice","Start",0x00010001,0x000 00000 ;HKLM,"SYSTEM\CurrentControlSet\Services\ntice","Type",0x00010001,0x0000 0001 +; Plug and Play manager +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","ErrorControl",0x0001 0001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Group",0x00000000,"P lugPlay" +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","ImagePath",0x0002000 0,"%SystemRoot%\system32\umpnpmgr.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Start",0x00010001,0x 00000002 +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Type",0x00010001,0x0 0000010 + ; PS/2 mouse port driver HKLM,"SYSTEM\CurrentControlSet\Services\Psaux","ErrorControl",0x00010001 ,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\Psaux","Group",0x00000000,"Point er Port" _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-02-05 00:17:49 UTC (rev 13412) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-02-05 00:20:14 UTC (rev 13413) @@ -161,8 +161,9 @@ subsys\system\winefile\winefile.exe 1 services\eventlog\eventlog.exe 1 services\rpcss\rpcss.exe 1 +services\umpnpmgr\umpnpmgr.exe 1 apps\utils\net\arp\arp.exe 1 -apps\utils\net\route\route.exe 1 +apps\utils\net\route\route.exe 1 apps\utils\net\finger\finger.exe 1 apps\utils\net\ftp\ftp.exe 1 apps\utils\net\ipconfig\ipconfig.exe 1 _____ Added: trunk/reactos/services/umpnpmgr/makefile --- trunk/reactos/services/umpnpmgr/makefile 2005-02-05 00:17:49 UTC (rev 13412) +++ trunk/reactos/services/umpnpmgr/makefile 2005-02-05 00:20:14 UTC (rev 13413) @@ -0,0 +1,23 @@ +# $Id$ + +PATH_TO_TOP = ../.. + +TARGET_TYPE = program + +TARGET_APPTYPE = console + +TARGET_NAME = umpnpmgr + +TARGET_INSTALLDIR = system32 + +TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a rpcrt4.a + +TARGET_OBJECTS = umpnpmgr.o + +TARGET_CFLAGS = -Wall -Werror -D__USE_W32API + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +# EOF _____ Added: trunk/reactos/services/umpnpmgr/umpnpmgr.c --- trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-02-05 00:17:49 UTC (rev 13412) +++ trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-02-05 00:20:14 UTC (rev 13413) @@ -0,0 +1,147 @@ +/* + * ReactOS kernel + * Copyright (C) 2005 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: services/umpnpmgr/umpnpmgr.c + * PURPOSE: User-mode Plug and Play manager + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#define UNICODE +#define _UNICODE + +#define NTOS_MODE_USER +#include <ntos.h> +#include <ntos/ntpnp.h> +#include <ddk/wdmguid.h> +#include <windows.h> +#include <tchar.h> +#include <stdio.h> + +#include <rpc.h> +#include <rpcdce.h> + +#define DBG +#define NDEBUG +#include <debug.h> + + + +/* GLOBALS ******************************************************************/ + +static VOID CALLBACK +ServiceMain(DWORD argc, LPTSTR *argv); + +static SERVICE_TABLE_ENTRY ServiceTable[2] = +{ + {_T("PlugPlay"), ServiceMain}, + {NULL, NULL} +}; + + +/* FUNCTIONS *****************************************************************/ + +static DWORD WINAPI +PnpEventThread(LPVOID lpParameter) +{ + PPLUGPLAY_EVENT_BLOCK PnpEvent; + NTSTATUS Status; + RPC_STATUS RpcStatus; + + PnpEvent = HeapAlloc(GetProcessHeap(), 0, 1024); + if (PnpEvent == NULL) + return ERROR_OUTOFMEMORY; + + for (;;) + { + DPRINT("Calling NtGetPlugPlayEvent()\n"); + + ZeroMemory(PnpEvent, 1024); + + /* Wait for the next pnp event */ + Status = NtGetPlugPlayEvent(0, 0, PnpEvent, 1024); + if (!NT_SUCCESS(Status)) + { + DPRINT("NtPlugPlayEvent() failed (Status %lx)\n", Status); + break; + } + + DPRINT("Received PnP Event\n"); + if (UuidEqual((UUID*)&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_ARRIVAL, &RpcStatus)) + { + DPRINT1("Device arrival event: %S\n", PnpEvent->TargetDevice.DeviceIds); + } + else + { + DPRINT1("Unknown event\n"); + } + + /* FIXME: Process the pnp event */ + + + /* Dequeue the current pnp event and signal the next one */ + NtPlugPlayControl(PLUGPLAY_USER_RESPONSE, NULL, 0); + } + + HeapFree(GetProcessHeap(), 0, PnpEvent); + + return ERROR_SUCCESS; +} + + +static VOID CALLBACK +ServiceMain(DWORD argc, LPTSTR *argv) +{ + HANDLE hThread; + DWORD dwThreadId; + + DPRINT("ServiceMain() called\n"); + + hThread = CreateThread(NULL, + 0, + PnpEventThread, + NULL, + 0, + &dwThreadId); + if (hThread != NULL) + CloseHandle(hThread); + + DPRINT("ServiceMain() done\n"); +} + + +int +main(int argc, char *argv[]) +{ + DPRINT("Umpnpmgr: main() started\n"); + + StartServiceCtrlDispatcher(ServiceTable); + + DPRINT("Umpnpmgr: main() done\n"); + + ExitThread(0); + + return 0; +} + +/* EOF */ _____ Added: trunk/reactos/services/umpnpmgr/umpnpmgr.rc --- trunk/reactos/services/umpnpmgr/umpnpmgr.rc 2005-02-05 00:17:49 UTC (rev 13412) +++ trunk/reactos/services/umpnpmgr/umpnpmgr.rc 2005-02-05 00:20:14 UTC (rev 13413) @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "User-Mode Plug and Play manager\0" +#define REACTOS_STR_INTERNAL_NAME "Umpnpmgr\0" +#define REACTOS_STR_ORIGINAL_FILENAME "Umpnpmgr.exe\0" +#include <reactos/version.rc>
19 years, 10 months
1
0
0
0
[blight] 13412: Change WNDOBJ implementation a bit to make the NVIDIA driver happy.
by blight@svn.reactos.com
Change WNDOBJ implementation a bit to make the NVIDIA driver happy. Modified: trunk/reactos/subsys/win32k/eng/window.c Modified: trunk/reactos/subsys/win32k/objects/dc.c _____ Modified: trunk/reactos/subsys/win32k/eng/window.c --- trunk/reactos/subsys/win32k/eng/window.c 2005-02-05 00:09:56 UTC (rev 13411) +++ trunk/reactos/subsys/win32k/eng/window.c 2005-02-05 00:17:49 UTC (rev 13412) @@ -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: window.c,v 1.11 2004/05/10 17:07:17 blight Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -57,8 +57,8 @@ pwo = NULL; } - DPRINT1("Calling WNDOBJCHANGEPROC (0x%x), Changed = 0x%x\n", - WndObjInt->ChangeProc, flChanged); + DPRINT("Calling WNDOBJCHANGEPROC (0x%x), Changed = 0x%x\n", + WndObjInt->ChangeProc, flChanged); WndObjInt->ChangeProc(pwo, flChanged); } @@ -80,7 +80,8 @@ PWINDOW_OBJECT Window; CLIPOBJ *ClientClipObj; - DPRINT("EngCreateWnd: WNDOBJCHANGEPROC = 0x%x, Flags = 0x%x\n", pfn, fl); + DPRINT("EngCreateWnd: pso = 0x%x, hwnd = 0x%x, pfn = 0x%x, fl = 0x%x, pixfmt = %d\n", + pso, hwnd, pfn, fl, iPixelFormat); /* Get window object */ Window = IntGetWindowObject(hwnd); @@ -123,10 +124,8 @@ /* release resources */ IntReleaseWindowObject(Window); - /* HACKHACKHACK */ - IntEngWndChanged(WndObjUser, WOC_RGN_CLIENT); - DPRINT("EngCreateWnd: SUCCESS!\n"); + return WndObjUser; } @@ -140,7 +139,7 @@ { WNDGDI *WndObjInt = ObjToGDI(pwo, WND); - DPRINT("EngDeleteWnd\n"); + DPRINT("EngDeleteWnd: pwo = 0x%x\n", pwo); IntEngDeleteClipRegion(WndObjInt->ClientClipObj); EngFreeMem(WndObjInt); @@ -159,8 +158,13 @@ ) { WNDGDI *WndObjInt = ObjToGDI(pwo, WND); - DPRINT("WNDOBJ_bEnum\n"); - return CLIPOBJ_bEnum(WndObjInt->ClientClipObj, cj, pul); + BOOL Ret; + + DPRINT("WNDOBJ_bEnum: pwo = 0x%x, cj = %d, pul = 0x%x\n", pwo, cj, pul); + Ret = CLIPOBJ_bEnum(WndObjInt->ClientClipObj, cj, pul); + + DPRINT("WNDOBJ_bEnum: Returning %s\n", Ret ? "True" : "False"); + return Ret; } @@ -177,9 +181,16 @@ ) { WNDGDI *WndObjInt = ObjToGDI(pwo, WND); - DPRINT("WNDOBJ_cEnumStart\n"); + ULONG Ret; + + DPRINT("WNDOBJ_cEnumStart: pwo = 0x%x, iType = %d, iDirection = %d, cLimit = %d\n", + pwo, iType, iDirection, cLimit); + /* FIXME: Should we enumerate all rectangles or not? */ - return CLIPOBJ_cEnumStart(WndObjInt->ClientClipObj, FALSE, iType, iDirection, cLimit); + Ret = CLIPOBJ_cEnumStart(WndObjInt->ClientClipObj, FALSE, iType, iDirection, cLimit); + + DPRINT("WNDOBJ_cEnumStart: Returning 0x%x\n", Ret); + return Ret; } @@ -193,7 +204,20 @@ IN PVOID pvConsumer ) { + BOOL Hack; + + DPRINT("WNDOBJ_vSetConsumer: pwo = 0x%x, pvConsumer = 0x%x\n", pwo, pvConsumer); + + Hack = (pwo->pvConsumer == NULL); pwo->pvConsumer = pvConsumer; + + /* HACKHACKHACK */ + if (Hack) + { + IntEngWndChanged(pwo, WOC_RGN_CLIENT); + IntEngWndChanged(pwo, WOC_CHANGED); + IntEngWndChanged(pwo, WOC_DRAWN); + } } /* EOF */ _____ Modified: trunk/reactos/subsys/win32k/objects/dc.c --- trunk/reactos/subsys/win32k/objects/dc.c 2005-02-05 00:09:56 UTC (rev 13411) +++ trunk/reactos/subsys/win32k/objects/dc.c 2005-02-05 00:17:49 UTC (rev 13412) @@ -727,7 +727,7 @@ if (Driver != NULL && Driver->Buffer != NULL) { - DPRINT("NAME: %S\n", Driver->Buffer); // FIXME: Should not crash if NULL + DPRINT("NAME: %ws\n", Driver); // FIXME: Should not crash if NULL } /* Allocate a DC object */
19 years, 10 months
1
0
0
0
[blight] 13411: Fix VideoPortMapMemory.
by blight@svn.reactos.com
Fix VideoPortMapMemory. Modified: trunk/reactos/drivers/video/videoprt/resource.c _____ Modified: trunk/reactos/drivers/video/videoprt/resource.c --- trunk/reactos/drivers/video/videoprt/resource.c 2005-02-05 00:07:57 UTC (rev 13410) +++ trunk/reactos/drivers/video/videoprt/resource.c 2005-02-05 00:09:56 UTC (rev 13411) @@ -82,6 +82,7 @@ IN PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfUchars, IN UCHAR InIoSpace, + IN HANDLE ProcessHandle, OUT VP_STATUS *Status) { PHYSICAL_ADDRESS TranslatedAddress; @@ -101,6 +102,23 @@ InIoSpace &= ~VIDEO_MEMORY_SPACE_P6CACHE; } + if (ProcessHandle != NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0) + { + DPRINT("ProcessHandle is not NULL (0x%x) but InIoSpace does not have " + "VIDEO_MEMORY_SPACE_USER_MODE set! Setting " + "VIDEO_MEMORY_SPACE_USER_MODE.\n", + ProcessHandle); + InIoSpace |= VIDEO_MEMORY_SPACE_USER_MODE; + } + else if (ProcessHandle == NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0) + { + DPRINT("ProcessHandle is NULL (0x%x) but InIoSpace does have " + "VIDEO_MEMORY_SPACE_USER_MODE set! Setting ProcessHandle " + "to NtCurrentProcess()\n", + ProcessHandle); + ProcessHandle = NtCurrentProcess(); + } + if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0 && !IsListEmpty(&DeviceExtension->AddressMappingListHead)) { @@ -155,7 +173,7 @@ { NTSTATUS NtStatus; MappedAddress = NULL; - NtStatus = IntVideoPortMapPhysicalMemory(NtCurrentProcess(), + NtStatus = IntVideoPortMapPhysicalMemory(ProcessHandle, TranslatedAddress, NumberOfUchars, PAGE_READWRITE/* | PAGE_WRITECOMBINE*/, @@ -249,6 +267,8 @@ /* If there was no kernelmode mapping for the given address found we assume * that the given address is a usermode mapping and try to unmap it. + * + * FIXME: Is it ok to use NtCurrentProcess? */ Status = ZwUnmapViewOfSection(NtCurrentProcess(), MappedAddress); if (!NT_SUCCESS(Status)) @@ -276,6 +296,7 @@ IoAddress, NumberOfUchars, InIoSpace, + NULL, NULL); } @@ -332,6 +353,7 @@ NTSTATUS Status; DPRINT("VideoPortMapMemory\n"); + DPRINT("- *VirtualAddress: 0x%x\n", *VirtualAddress); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); *VirtualAddress = IntVideoPortMapMemory( @@ -339,6 +361,7 @@ PhysicalAddress, *Length, *InIoSpace, + (HANDLE)*VirtualAddress, &Status); return Status;
19 years, 10 months
1
0
0
0
[blight] 13410: Small update of opengl32.
by blight@svn.reactos.com
Small update of opengl32. Modified: trunk/reactos/lib/opengl32/gl.c Modified: trunk/reactos/lib/opengl32/wgl.c _____ Modified: trunk/reactos/lib/opengl32/gl.c --- trunk/reactos/lib/opengl32/gl.c 2005-02-05 00:04:52 UTC (rev 13409) +++ trunk/reactos/lib/opengl32/gl.c 2005-02-05 00:07:57 UTC (rev 13410) @@ -61,11 +61,12 @@ #if defined(_M_IX86) # define FOO(x) #x # define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ -__asm__(".globl _"#func"@"#stack "\n\t" \ +__asm__(".align 4" "\n\t" \ + ".globl _"#func"@"#stack "\n\t" \ "_"#func"@"#stack":" "\n\t" \ - " movl %fs:0x18, %eax" "\n\t" \ - " movl 0xbe8(%eax), %eax" "\n\t" \ - " jmp *"FOO((icdidx*4))"(%eax)" "\n\t"); + " movl %fs:0x18, %eax" "\n\t" \ + " movl 0xbe8(%eax), %eax" "\n\t" \ + " jmp *"FOO((icdidx*4))"(%eax)" "\n\t"); GLFUNCS_MACRO # undef FOO @@ -74,19 +75,19 @@ # define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ ret STDCALL func typeargs \ { \ - PROC *table; \ - PROC fn; \ - if (tebidx >= 0 && 0) \ - { \ - table = (PROC *)NtCurrentTeb()->glDispatchTable; \ - fn = table[tebidx]; \ - } \ - else \ - { \ - table = (PROC *)NtCurrentTeb()->glTable; \ - fn = table[icdidx]; \ - } \ - return (ret)((ret(*)typeargs)fn)args; \ + PROC *table; \ + PROC fn; \ + if (tebidx >= 0 && 0) \ + { \ + table = (PROC *)NtCurrentTeb()->glDispatchTable; \ + fn = table[tebidx]; \ + } \ + else \ + { \ + table = (PROC *)NtCurrentTeb()->glTable; \ + fn = table[icdidx]; \ + } \ + return (ret)((ret(*)typeargs)fn)args; \ } GLFUNCS_MACRO _____ Modified: trunk/reactos/lib/opengl32/wgl.c --- trunk/reactos/lib/opengl32/wgl.c 2005-02-05 00:04:52 UTC (rev 13409) +++ trunk/reactos/lib/opengl32/wgl.c 2005-02-05 00:07:57 UTC (rev 13410) @@ -10,6 +10,7 @@ #define WIN32_LEAN_AND_MEAN #include <windows.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include "teb.h" @@ -334,6 +335,15 @@ } /* load driver (or get a reference) */ dcdata->icd = OPENGL32_LoadICD( info.driver_name ); + if (dcdata->icd == NULL) + { + WCHAR Buffer[256]; + snwprintf(Buffer, sizeof(Buffer)/sizeof(WCHAR), + L"Couldn't load driver \"%s\".", driverName); + MessageBox(WindowFromDC( hdc ), Buffer, + L"OPENGL32.dll: Warning", + MB_OK | MB_ICONWARNING); + } } return dcdata->icd; @@ -398,7 +408,6 @@ #undef X DBGPRINT( "Done." ); -/* DBGBREAK();*/ return ERROR_SUCCESS; } @@ -894,7 +903,6 @@ if (glrc->hglrc != NULL) { DBGPRINT( "Info: Calling DrvSetContext!" ); - DBGBREAK(); icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc, ROSGL_SetContextCallBack ); if (icdTable == NULL)
19 years, 10 months
1
0
0
0
[ekohl] 13409: - Link ntoskrnl against libwdmguid.a.
by ekohl@svn.reactos.com
- Link ntoskrnl against libwdmguid.a. - Report device arrival events to the user-mode pnp manager. Modified: trunk/reactos/include/ntos/ntpnp.h Modified: trunk/reactos/ntoskrnl/Makefile Modified: trunk/reactos/ntoskrnl/include/internal/io.h Modified: trunk/reactos/ntoskrnl/io/plugplay.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c _____ Modified: trunk/reactos/include/ntos/ntpnp.h --- trunk/reactos/include/ntos/ntpnp.h 2005-02-04 23:24:32 UTC (rev 13408) +++ trunk/reactos/include/ntos/ntpnp.h 2005-02-05 00:04:52 UTC (rev 13409) @@ -244,6 +244,8 @@ * ... */ +#define PLUGPLAY_USER_RESPONSE 0x07 + NTSTATUS STDCALL NtPlugPlayControl( ULONG ControlCode, _____ Modified: trunk/reactos/ntoskrnl/Makefile --- trunk/reactos/ntoskrnl/Makefile 2005-02-04 23:24:32 UTC (rev 13408) +++ trunk/reactos/ntoskrnl/Makefile 2005-02-05 00:04:52 UTC (rev 13409) @@ -185,9 +185,9 @@ io/parttab.o \ io/plugplay.o \ io/process.o \ - io/pnpnotify.o \ io/pnpdma.o \ io/pnpmgr.o \ + io/pnpnotify.o \ io/pnpreport.o \ io/pnproot.o \ io/queue.o \ @@ -516,6 +516,7 @@ $(SDK_PATH_LIB)/libstring.a \ $(SDK_PATH_LIB)/librosrtl.a \ $(SDK_PATH_LIB)/libpseh.a \ + $(SDK_PATH_LIB)/libwdmguid.a \ $(PATH_TO_TOP)/drivers/lib/csq/csq.o TARGET_LFLAGS = \ @@ -542,7 +543,7 @@ TARGET_CLEAN = \ $(PATH_TO_TOP)/include/reactos/bugcodes.h \ - $(DEP_OBJECTS) $(DEP_FILES) MSG00409.bin bugcodes.rc + $(DEP_OBJECTS) $(DEP_FILES) MSG00409.bin bugcodes.rc ex/napi.o: ex/zw.S $(PATH_TO_TOP)/include/ntdll/napi.h _____ Modified: trunk/reactos/ntoskrnl/include/internal/io.h --- trunk/reactos/ntoskrnl/include/internal/io.h 2005-02-04 23:24:32 UTC (rev 13408) +++ trunk/reactos/ntoskrnl/include/internal/io.h 2005-02-05 00:04:52 UTC (rev 13409) @@ -501,12 +501,16 @@ IopReinitializeDrivers(VOID); -/* pnpevent.c */ +/* plugplay.c */ NTSTATUS INIT_FUNCTION IopInitPlugPlayEvents(VOID); +NTSTATUS +IopQueueTargetDeviceEvent(const GUID *Guid, + PUNICODE_STRING DeviceIds); + /* pnpmgr.c */ NTSTATUS _____ Modified: trunk/reactos/ntoskrnl/io/plugplay.c --- trunk/reactos/ntoskrnl/io/plugplay.c 2005-02-04 23:24:32 UTC (rev 13408) +++ trunk/reactos/ntoskrnl/io/plugplay.c 2005-02-05 00:04:52 UTC (rev 13409) @@ -15,9 +15,17 @@ #define NDEBUG #include <internal/debug.h> + +typedef struct _PNP_EVENT_ENTRY +{ + LIST_ENTRY ListEntry; + PLUGPLAY_EVENT_BLOCK Event; +} PNP_EVENT_ENTRY, *PPNP_EVENT_ENTRY; + + /* GLOBALS *******************************************************************/ -static LIST_ENTRY IopPnpEventListHead; +static LIST_ENTRY IopPnpEventQueueHead; static KEVENT IopPnpNotifyEvent; /* FUNCTIONS *****************************************************************/ @@ -26,41 +34,77 @@ IopInitPlugPlayEvents(VOID) { - InitializeListHead(&IopPnpEventListHead); + InitializeListHead(&IopPnpEventQueueHead); KeInitializeEvent(&IopPnpNotifyEvent, - NotificationEvent, + SynchronizationEvent, FALSE); return STATUS_SUCCESS; } -#if 0 -/* Insert a new pnp event at the head of the event queue */ -VOID -IopEnqueuePlugPlayEvent(VOID) +NTSTATUS +IopQueueTargetDeviceEvent(const GUID *Guid, + PUNICODE_STRING DeviceIds) { + PPNP_EVENT_ENTRY EventEntry; + DWORD TotalSize; + TotalSize = + FIELD_OFFSET(PLUGPLAY_EVENT_BLOCK, TargetDevice.DeviceIds) + + DeviceIds->MaximumLength; + + EventEntry = ExAllocatePool(NonPagedPool, + TotalSize + FIELD_OFFSET(PNP_EVENT_ENTRY, Event)); + if (EventEntry == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + memcpy(&EventEntry->Event.EventGuid, + Guid, + sizeof(GUID)); + EventEntry->Event.EventCategory = TargetDeviceChangeEvent; + EventEntry->Event.TotalSize = TotalSize; + + memcpy(&EventEntry->Event.TargetDevice.DeviceIds, + DeviceIds->Buffer, + DeviceIds->MaximumLength); + + InsertHeadList(&IopPnpEventQueueHead, + &EventEntry->ListEntry); + KeSetEvent(&IopPnpNotifyEvent, + 0, + FALSE); + + return STATUS_SUCCESS; } -#endif -#if 0 /* * Remove the current PnP event from the tail of the event queue * and signal IopPnpNotifyEvent if there is yet another event in the queue. */ -VOID -IopDequeuePlugPlayEvent(VOID) +static VOID +IopRemovePlugPlayEvent(VOID) { + /* Remove a pnp event entry from the tail of the queue */ + if (!IsListEmpty(&IopPnpEventQueueHead)) + { + ExFreePool(RemoveTailList(&IopPnpEventQueueHead)); + } + /* Signal the next pnp event in the queue */ + if (!IsListEmpty(&IopPnpEventQueueHead)) + { + KeSetEvent(&IopPnpNotifyEvent, + 0, + FALSE); + } } -#endif /* - * @unimplemented + * @implemented */ NTSTATUS STDCALL NtGetPlugPlayEvent(IN ULONG Reserved1, @@ -68,6 +112,7 @@ OUT PPLUGPLAY_EVENT_BLOCK Buffer, IN ULONG BufferLength) { + PPNP_EVENT_ENTRY Entry; NTSTATUS Status; DPRINT("NtGetPlugPlayEvent() called\n"); @@ -83,7 +128,7 @@ if (!SeSinglePrivilegeCheck(SeTcbPrivilege, UserMode)) { - DPRINT1("NtGetPlugPlayEvent: Caller requires the SeTcbPrivilege privilege!\n"); + DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege privilege!\n"); return STATUS_PRIVILEGE_NOT_HELD; } @@ -94,31 +139,30 @@ KernelMode, FALSE, NULL); - if (NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { - DPRINT("Waiting done\n"); + DPRINT1("KeWaitForSingleObject() failed (Status %lx)\n", Status); + return Status; + } -#if 0 - /* Get entry from the tail of the list */ - Entry = IopPnpEventListHead.Blink; + /* Get entry from the tail of the queue */ + Entry = (PPNP_EVENT_ENTRY)IopPnpEventQueueHead.Blink; - /* Check the buffer size */ - if (BufferLength < Entry->Event.Size) - { - DPRINT1("Buffer is too small for the pnp-event\n"); - return STATUS_BUFFER_TOO_SMALL; - } - - /* Copy event data to user buffer */ - memcpy(Buffer, - &Entry->Event, - &Entry->Event.Size); -#endif + /* Check the buffer size */ + if (BufferLength < Entry->Event.TotalSize) + { + DPRINT1("Buffer is too small for the pnp-event\n"); + return STATUS_BUFFER_TOO_SMALL; } + /* Copy event data to the user buffer */ + memcpy(Buffer, + &Entry->Event, + Entry->Event.TotalSize); + DPRINT("NtGetPlugPlayEvent() done\n"); - return Status; + return STATUS_SUCCESS; } @@ -130,7 +174,16 @@ IN OUT PVOID Buffer, IN ULONG BufferLength) { - UNIMPLEMENTED; + DPRINT("NtPlugPlayControl(%lu %p %lu) called\n", + ControlCode, Buffer, BufferLength); + + switch (ControlCode) + { + case PLUGPLAY_USER_RESPONSE: + IopRemovePlugPlayEvent(); + return STATUS_SUCCESS; + } + return STATUS_NOT_IMPLEMENTED; } _____ Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c --- trunk/reactos/ntoskrnl/io/pnpmgr.c 2005-02-04 23:24:32 UTC (rev 13408) +++ trunk/reactos/ntoskrnl/io/pnpmgr.c 2005-02-05 00:04:52 UTC (rev 13409) @@ -11,6 +11,7 @@ /* INCLUDES ******************************************************************/ #include <ntoskrnl.h> +#include <ddk/wdmguid.h> #define NDEBUG #include <internal/debug.h> @@ -434,7 +435,7 @@ BOOLEAN IopCreateUnicodeString( - PUNICODE_STRING Destination, + PUNICODE_STRING Destination, PWSTR Source, POOL_TYPE PoolType) { @@ -1318,6 +1319,10 @@ DeviceNode->Flags |= DNF_PROCESSED; + /* Report the device to the user-mode pnp manager */ + IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL, + &DeviceNode->InstancePath); + return STATUS_SUCCESS; }
19 years, 10 months
1
0
0
0
[ekohl] 13408: - Fix WDM-GUIDs. Patch by Filip Navara.
by ekohl@svn.reactos.com
- Fix WDM-GUIDs. Patch by Filip Navara. - Implement libwdmguid.a. Modified: trunk/reactos/Makefile Modified: trunk/reactos/include/ntos/ntpnp.h Added: trunk/reactos/lib/wdmguid/ Added: trunk/reactos/lib/wdmguid/makefile Added: trunk/reactos/lib/wdmguid/wdmguid.c _____ Modified: trunk/reactos/Makefile --- trunk/reactos/Makefile 2005-02-04 20:46:46 UTC (rev 13407) +++ trunk/reactos/Makefile 2005-02-04 23:24:32 UTC (rev 13408) @@ -42,7 +42,7 @@ LIB_FSLIB = vfatlib # Static libraries -LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh adns dxguid strmiids crt rossym +LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh adns dxguid strmiids crt rossym wdmguid # Keyboard layout libraries DLLS_KBD = kbdda kbddv kbdes kbdfr kbdgr kbdse kbduk kbdus _____ Modified: trunk/reactos/include/ntos/ntpnp.h --- trunk/reactos/include/ntos/ntpnp.h 2005-02-04 20:46:46 UTC (rev 13407) +++ trunk/reactos/include/ntos/ntpnp.h 2005-02-04 23:24:32 UTC (rev 13408) @@ -30,29 +30,32 @@ * Undocumented GUIDs used by NtGetPlugPlayEvent. */ -DEFINE_GUID(GUID_DEVICE_STANDBY_VETOED, 0x03B21C13, 0x11D3, 0x18D6, 0xA0, 0x00, 0xDB, 0x97, 0x2E, 0x52, 0x40, 0xC9); -DEFINE_GUID(GUID_DEVICE_KERNEL_INITIATED_EJECT, 0x14689B54, 0x11D3, 0x0703, 0xA0, 0x00, 0xD2, 0x97, 0x2E, 0x52, 0x40, 0xC9); -DEFINE_GUID(GUID_DEVICE_THERMAL_ZONE, 0x4AFA3D51, 0x11D0, 0x74A7, 0xA0, 0x00, 0x5E, 0xBE, 0x57, 0x28, 0x06, 0xC9); -DEFINE_GUID(GUID_DEVICE_SYS_BUTTON, 0x4AFA3D53, 0x11D0, 0x74A7, 0xA0, 0x00, 0x5E, 0xBE, 0x57, 0x28, 0x06, 0xC9); -DEFINE_GUID(GUID_DEVICE_REMOVAL_VETOED, 0x60DBD5FA, 0x11D2, 0xDDD2, 0xA0, 0x00, 0xB8, 0x97, 0x2E, 0x52, 0x40, 0xC9); -DEFINE_GUID(GUID_DEVICE_HIBERNATE_VETOED, 0x61173AD9, 0x11D3, 0x194F, 0xA0, 0x00, 0xDC, 0x97, 0x2E, 0x52, 0x40, 0xC9); -DEFINE_GUID(GUID_DEVICE_BATTERY, 0x72631E54, 0x11D0, 0x78A4, 0xAA, 0x00, 0xF7, 0xBC, 0x2A, 0xB3, 0xB7, 0x00); -DEFINE_GUID(GUID_DEVICE_SAFE_REMOVAL, 0x8FBEF967, 0x11D2, 0xD6C5, 0xA0, 0x00, 0xB5, 0x97, 0x2E, 0x52, 0x40, 0xC9); -/* DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, 0xCB3A4004, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); */ -/* DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, 0xCB3A4005, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); */ -DEFINE_GUID(GUID_DEVICE_ARRIVAL, 0xCB3A4009, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_ENUMERATED, 0xCB3A400A, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_ENUMERATE_REQUEST, 0xCB3A400B, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_START_REQUEST, 0xCB3A400C, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_REMOVE_PENDING, 0xCB3A400D, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_QUERY_AND_REMOVE, 0xCB3A400E, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_EJECT, 0xCB3A400F, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_NOOP, 0xCB3A4010, 0x11D0, 0x46F0, 0x60, 0x00, 0x8F, 0xB0, 0x3F, 0x05, 0x13, 0x97); -DEFINE_GUID(GUID_DEVICE_WARM_EJECT_VETOED, 0xCBF4C1F9, 0x11D3, 0x18D5, 0xA0, 0x00, 0xDB, 0x97, 0x2E, 0x52, 0x40, 0xC9); -DEFINE_GUID(GUID_DEVICE_SURPRISE_REMOVAL, 0xCE5AF000, 0x11D2, 0x80DD, 0xA0, 0x00, 0x8D, 0xA8, 0x4B, 0x6B, 0x69, 0xC9); -DEFINE_GUID(GUID_DEVICE_EJECT_VETOED, 0xCF7B71E8, 0x11D2, 0xD8FD, 0xA0, 0x00, 0xB5, 0x97, 0x2E, 0x52, 0x40, 0xC9); -DEFINE_GUID(GUID_DEVICE_EVENT_RBC, 0xD0744792, 0x11D2, 0xA98E, 0xA0, 0x00, 0x7A, 0x91, 0xF3, 0x8F, 0x06, 0xC9); +DEFINE_GUID(GUID_DEVICE_STANDBY_VETOED, 0x03B21C13, 0x18D6, 0x11D3, 0x97, 0xDB, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_KERNEL_INITIATED_EJECT, 0x14689B54, 0x0703, 0x11D3, 0x97, 0xD2, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_THERMAL_ZONE, 0x4AFA3D51, 0x74A7, 0x11D0, 0xBE, 0x5E, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); +DEFINE_GUID(GUID_DEVICE_SYS_BUTTON, 0x4AFA3D53, 0x74A7, 0x11D0, 0xBE, 0x5E, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57); +DEFINE_GUID(GUID_DEVICE_REMOVAL_VETOED, 0x60DBD5FA, 0xDDD2, 0x11D2, 0x97, 0xB8, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_HIBERNATE_VETOED, 0x61173AD9, 0x194F, 0x11D3, 0x97, 0xDC, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_BATTERY, 0x72631E54, 0x78A4, 0x11D0, 0xBC, 0xF7, 0x00, 0xAA, 0x00, 0xB7, 0xB3, 0x2A); +DEFINE_GUID(GUID_DEVICE_SAFE_REMOVAL, 0x8FBEF967, 0xD6C5, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +/* DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, 0xCB3A4004, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); */ +/* DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, 0xCB3A4005, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); */ +DEFINE_GUID(GUID_DEVICE_ARRIVAL, 0xCB3A4009, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_ENUMERATED, 0xCB3A400A, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_ENUMERATE_REQUEST, 0xCB3A400B, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_START_REQUEST, 0xCB3A400C, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_REMOVE_PENDING, 0xCB3A400D, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_QUERY_AND_REMOVE, 0xCB3A400E, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_EJECT, 0xCB3A400F, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_NOOP, 0xCB3A4010, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_WARM_EJECT_VETOED, 0xCBF4C1F9, 0x18D5, 0x11D3, 0x97, 0xDB, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_SURPRISE_REMOVAL, 0xCE5AF000, 0x80DD, 0x11D2, 0xA8, 0x8D, 0x00, 0xA0, 0xC9, 0x69, 0x6B, 0x4B); +DEFINE_GUID(GUID_DEVICE_EJECT_VETOED, 0xCF7B71E8, 0xD8FD, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); +DEFINE_GUID(GUID_DEVICE_EVENT_RBC, 0xD0744792, 0xA98E, 0x11D2, 0x91, 0x7A, 0x00, 0xA0, 0xC9, 0x06, 0x8F, 0xF3); + +#ifndef __GUIDS_ONLY__ /* This is defined to build libwdmguid.a */ + typedef enum _PLUGPLAY_EVENT_CATEGORY { HardwareProfileChangeEvent, TargetDeviceChangeEvent, @@ -149,7 +152,7 @@ } BlockedDriverNotification; }; } PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK; - + /* * NtGetPlugPlayEvent * @@ -247,4 +250,6 @@ PVOID Buffer, ULONG BufferSize); +#endif /* __GUIDS_ONLY__ */ + #endif /* __NTPNP_H */ _____ Added: trunk/reactos/lib/wdmguid/makefile --- trunk/reactos/lib/wdmguid/makefile 2005-02-04 20:46:46 UTC (rev 13407) +++ trunk/reactos/lib/wdmguid/makefile 2005-02-04 23:24:32 UTC (rev 13408) @@ -0,0 +1,24 @@ +# $Id$ + +PATH_TO_TOP = ../.. + +TARGET_TYPE = library + +TARGET_NAME = wdmguid + +TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -I$(PATH_TO_TOP)/include/wine + +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + +TARGET_OBJECTS = wdmguid.o + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +DEP_OBJECTS := $(TARGET_OBJECTS) + +TARGET_CLEAN = $(DEP_FILES) + +include $(PATH_TO_TOP)/tools/depend.mk _____ Added: trunk/reactos/lib/wdmguid/wdmguid.c --- trunk/reactos/lib/wdmguid/wdmguid.c 2005-02-04 20:46:46 UTC (rev 13407) +++ trunk/reactos/lib/wdmguid/wdmguid.c 2005-02-04 23:24:32 UTC (rev 13408) @@ -0,0 +1,11 @@ + +#include <stdarg.h> + +#define COM_NO_WINDOWS_H +#include "initguid.h" + +#include <ddk/wdmguid.h> +#define __GUIDS_ONLY__ +#include <ntos/ntpnp.h> + +/* EOF */
19 years, 10 months
1
0
0
0
[chorns] 13407: Build twain_32, ws2help, opengl32, syssetup, urlmon, shdocvw, wininet, userenv, wsock32, and wshirda
by chorns@svn.reactos.com
Build twain_32, ws2help, opengl32, syssetup, urlmon, shdocvw, wininet, userenv, wsock32, and wshirda Modified: branches/xmlbuildsystem/reactos/lib/directory.xml Added: branches/xmlbuildsystem/reactos/lib/opengl32/opengl32.xml Added: branches/xmlbuildsystem/reactos/lib/shdocvw/shdocvw.xml Added: branches/xmlbuildsystem/reactos/lib/syssetup/syssetup.xml Added: branches/xmlbuildsystem/reactos/lib/twain/twain_32.xml Added: branches/xmlbuildsystem/reactos/lib/urlmon/urlmon.xml Added: branches/xmlbuildsystem/reactos/lib/userenv/userenv.xml Added: branches/xmlbuildsystem/reactos/lib/wininet/wininet.xml Added: branches/xmlbuildsystem/reactos/lib/ws2help/ws2help.xml Added: branches/xmlbuildsystem/reactos/lib/wshirda/wshirda.xml Added: branches/xmlbuildsystem/reactos/lib/wsock32/wsock32.xml _____ Modified: branches/xmlbuildsystem/reactos/lib/directory.xml --- branches/xmlbuildsystem/reactos/lib/directory.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/directory.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -164,6 +164,9 @@ <directory name="olepro32"> <xi:include href="olepro32/olepro32.xml" /> </directory> +<directory name="opengl32"> + <xi:include href="opengl32/opengl32.xml" /> +</directory> <directory name="psapi"> <xi:include href="psapi/psapi.xml" /> </directory> @@ -191,6 +194,9 @@ <directory name="setupapi"> <xi:include href="setupapi/setupapi.xml" /> </directory> +<directory name="shdocvw"> + <xi:include href="shdocvw/shdocvw.xml" /> +</directory> <directory name="shell32"> <xi:include href="shell32/shell32.xml" /> </directory> @@ -203,18 +209,33 @@ <directory name="strmiids"> <xi:include href="strmiids/strmiids.xml" /> </directory> +<directory name="syssetup"> + <xi:include href="syssetup/syssetup.xml" /> +</directory> +<directory name="twain"> + <xi:include href="twain/twain_32.xml" /> +</directory> <directory name="unicode"> <xi:include href="unicode/unicode.xml" /> </directory> +<directory name="urlmon"> + <xi:include href="urlmon/urlmon.xml" /> +</directory> <directory name="user32"> <xi:include href="user32/user32.xml" /> </directory> +<directory name="userenv"> + <xi:include href="userenv/userenv.xml" /> +</directory> <directory name="uuid"> <xi:include href="uuid/uuid.xml" /> </directory> <directory name="version"> <xi:include href="version/version.xml" /> </directory> +<directory name="wininet"> + <xi:include href="wininet/wininet.xml" /> +</directory> <directory name="winmm"> <xi:include href="winmm/winmm.xml" /> </directory> @@ -224,6 +245,15 @@ <directory name="ws2_32"> <xi:include href="ws2_32/ws2_32.xml" /> </directory> +<directory name="ws2help"> + <xi:include href="ws2help/ws2help.xml" /> +</directory> +<directory name="wshirda"> + <xi:include href="wshirda/wshirda.xml" /> +</directory> +<directory name="wsock32"> + <xi:include href="wsock32/wsock32.xml" /> +</directory> <directory name="zlib"> <xi:include href="zlib/zlib.xml" /> </directory> _____ Added: branches/xmlbuildsystem/reactos/lib/opengl32/opengl32.xml --- branches/xmlbuildsystem/reactos/lib/opengl32/opengl32.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/opengl32/opengl32.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,13 @@ +<module name="opengl32" type="win32dll"> + <importlibrary definition="opengl32.def" /> + <include base="wsock32">.</include> + <define name="UNICODE" /> + <define name="__USE_W32API" /> + <define name="_DISABLE_TIDENTS" /> + <library>ntdll</library> + <library>kernel32</library> + <library>gdi32</library> + <file>gl.c</file> + <file>opengl32.c</file> + <file>wgl.c</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/shdocvw/shdocvw.xml --- branches/xmlbuildsystem/reactos/lib/shdocvw/shdocvw.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/shdocvw/shdocvw.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,33 @@ +<module name="shdocvw" type="win32dll"> + <dependency>winebuild</dependency> + <importlibrary definition="shdocvw.spec.def" /> + <include base="shdocvw">.</include> + <include base="ReactOS">include/wine</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__REACTOS__" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <define name="WINVER">0x501</define> + <define name="_SHDOCVW_" /> + <library>wine</library> + <library>uuid</library> + <library>ntdll</library> + <library>kernel32</library> + <library>advapi32</library> + <library>user32</library> + <library>ole32</library> + <library>urlmon</library> + <file>classinfo.c</file> + <file>events.c</file> + <file>factory.c</file> + <file>misc.c</file> + <file>oleobject.c</file> + <file>persist.c</file> + <file>regsvr.c</file> + <file>shdocvw_main.c</file> + <file>webbrowser.c</file> + <file>shdocvw.rc</file> + <file>shdocvw.spec</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/syssetup/syssetup.xml --- branches/xmlbuildsystem/reactos/lib/syssetup/syssetup.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/syssetup/syssetup.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,27 @@ +<module name="syssetup" type="win32dll"> + <importlibrary definition="syssetup.def" /> + <include base="syssetup">.</include> + <define name="__USE_W32API" /> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="_WIN32_IE">0x0600</define> + <define name="_WIN32_WINNT">0x0501</define> + <library>uuid</library> + <library>ntdll</library> + <library>kernel32</library> + <library>advapi32</library> + <library>gdi32</library> + <library>user32</library> + <library>samlib</library> + <library>userenv</library> + <library>comctl32</library> + <library>setupapi</library> + <library>ole32</library> + <library>shell32</library> + <library>shlwapi</library> + <file>dllmain.c</file> + <file>install.c</file> + <file>logfile.c</file> + <file>wizard.c</file> + <file>syssetup.rc</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/twain/twain_32.xml --- branches/xmlbuildsystem/reactos/lib/twain/twain_32.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/twain/twain_32.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,15 @@ +<module name="twain_32" type="win32dll"> + <importlibrary definition="twain_32.def" /> + <include base="twain_32">.</include> + <define name="_DISABLE_TIDENTS" /> + <library>wine</library> + <library>ntdll</library> + <library>kernel32</library> + <file>capability.c</file> + <file>ds_audio.c</file> + <file>ds_ctrl.c</file> + <file>ds_image.c</file> + <file>dsm_ctrl.c</file> + <file>twain32_main.c</file> + <file>twain_32.rc</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/urlmon/urlmon.xml --- branches/xmlbuildsystem/reactos/lib/urlmon/urlmon.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/urlmon/urlmon.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,29 @@ +<module name="urlmon" type="win32dll"> + <dependency>winebuild</dependency> + <importlibrary definition="urlmon.spec.def" /> + <include base="urlmon">.</include> + <include base="ReactOS">include/wine</include> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <define name="__REACTOS__" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <define name="WINVER">0x501</define> + <define name="_STDDEF_H" /> + <library>wine</library> + <library>uuid</library> + <library>ntdll</library> + <library>kernel32</library> + <library>advapi32</library> + <library>user32</library> + <library>ole32</library> + <library>shlwapi</library> + <library>cabinet</library> + <library>wininet</library> + <file>regsvr.c</file> + <file>sec_mgr.c</file> + <file>umon.c</file> + <file>urlmon_main.c</file> + <file>urlmon.spec</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/userenv/userenv.xml --- branches/xmlbuildsystem/reactos/lib/userenv/userenv.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/userenv/userenv.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,21 @@ +<module name="userenv" type="win32dll"> + <importlibrary definition="userenv.def" /> + <include base="userenv">.</include> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x0400</define> + <define name="_WIN32_WINNT">0x0501</define> + <library>uuid</library> + <library>ntdll</library> + <library>kernel32</library> + <library>advapi32</library> + <library>user32</library> + <file>desktop.c</file> + <file>directory.c</file> + <file>environment.c</file> + <file>misc.c</file> + <file>profile.c</file> + <file>registry.c</file> + <file>setup.c</file> + <file>userenv.c</file> + <file>userenv.rc</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/wininet/wininet.xml --- branches/xmlbuildsystem/reactos/lib/wininet/wininet.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/wininet/wininet.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,8 @@ +<module name="wininet" type="win32dll"> + <importlibrary definition="wininet.def" /> + <include base="wininet">.</include> + <library>ntdll</library> + <library>kernel32</library> + <file>stubs.c</file> + <file>wininet.rc</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/ws2help/ws2help.xml --- branches/xmlbuildsystem/reactos/lib/ws2help/ws2help.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/ws2help/ws2help.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,12 @@ +<module name="ws2help" type="win32dll"> + <importlibrary definition="ws2help.def" /> + <include base="ws2help">.</include> + <define name="UNICODE" /> + <define name="__USE_W32API" /> + <define name="_DISABLE_TIDENTS" /> + <library>ntdll</library> + <library>kernel32</library> + <library>ws2_32</library> + <file>ws2help.c</file> + <file>ws2help.rc</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/wshirda/wshirda.xml --- branches/xmlbuildsystem/reactos/lib/wshirda/wshirda.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/wshirda/wshirda.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,12 @@ +<module name="wshirda" type="win32dll"> + <importlibrary definition="wshirda.def" /> + <include base="wshirda">.</include> + <define name="UNICODE" /> + <define name="__USE_W32API" /> + <define name="_DISABLE_TIDENTS" /> + <library>ntdll</library> + <library>kernel32</library> + <library>ws2_32</library> + <file>wshirda.c</file> + <file>wshirda.rc</file> +</module> _____ Added: branches/xmlbuildsystem/reactos/lib/wsock32/wsock32.xml --- branches/xmlbuildsystem/reactos/lib/wsock32/wsock32.xml 2005-02-04 20:39:10 UTC (rev 13406) +++ branches/xmlbuildsystem/reactos/lib/wsock32/wsock32.xml 2005-02-04 20:46:46 UTC (rev 13407) @@ -0,0 +1,11 @@ +<module name="wsock32" type="win32dll"> + <importlibrary definition="wsock32.def" /> + <include base="wsock32">.</include> + <define name="UNICODE" /> + <define name="__USE_W32API" /> + <library>ntdll</library> + <library>kernel32</library> + <library>ws2_32</library> + <file>stubs.c</file> + <file>wsock32.rc</file> +</module>
19 years, 10 months
1
0
0
0
[weiden] 13406: Trevor McCort implemented desktop wallpaper changing
by weiden@svn.reactos.com
Trevor McCort implemented desktop wallpaper changing Modified: trunk/reactos/include/defines.h Modified: trunk/reactos/lib/cpl/desk/Makefile Added: trunk/reactos/lib/cpl/desk/appearance.c Added: trunk/reactos/lib/cpl/desk/background.c Modified: trunk/reactos/lib/cpl/desk/desk.c Deleted: trunk/reactos/lib/cpl/desk/desk.dsp Deleted: trunk/reactos/lib/cpl/desk/desk.dsw Modified: trunk/reactos/lib/cpl/desk/desk.h Modified: trunk/reactos/lib/cpl/desk/desk.rc Added: trunk/reactos/lib/cpl/desk/dibitmap.c Added: trunk/reactos/lib/cpl/desk/dibitmap.h Added: trunk/reactos/lib/cpl/desk/en.rc Modified: trunk/reactos/lib/cpl/desk/resource.h Added: trunk/reactos/lib/cpl/desk/screensaver.c Added: trunk/reactos/lib/cpl/desk/settings.c _____ Modified: trunk/reactos/include/defines.h --- trunk/reactos/include/defines.h 2005-02-04 16:51:11 UTC (rev 13405) +++ trunk/reactos/include/defines.h 2005-02-04 20:39:10 UTC (rev 13406) @@ -771,6 +771,7 @@ #define DS_SETFONT (0x40L) #define DS_SETFOREGROUND (0x200L) #define DS_SYSMODAL (0x2L) +#define DS_SHELLFONT (DS_SETFONT | DS_FIXEDSYS) /* CreateWindowEx */ #define WS_EX_ACCEPTFILES (0x10L) _____ Modified: trunk/reactos/lib/cpl/desk/Makefile --- trunk/reactos/lib/cpl/desk/Makefile 2005-02-04 16:51:11 UTC (rev 13405) +++ trunk/reactos/lib/cpl/desk/Makefile 2005-02-04 20:39:10 UTC (rev 13406) @@ -13,20 +13,20 @@ TARGET_BASE = $(TARGET_BASE_LIB_CPL_DESK) TARGET_CFLAGS = \ - -I./include \ + -I./include \ -D_WIN32_IE=0x0600 \ -D_WIN32_WINNT=0x0501 \ -D__USE_W32API \ -DUNICODE \ -D_UNICODE \ - -D__REACTOS__ \ + -D__USE_W32API \ -Wall \ -Werror \ -fno-builtin TARGET_LFLAGS = -nostartfiles -TARGET_SDKLIBS = kernel32.a user32.a comctl32.a +TARGET_SDKLIBS = kernel32.a user32.a comctl32.a comdlg32.a advapi32.a gdi32.a TARGET_GCCLIBS = gcc @@ -34,7 +34,12 @@ TARGET_CLEAN = -TARGET_OBJECTS = desk.o +TARGET_OBJECTS = desk.o \ + background.o \ + screensaver.o \ + appearance.o \ + settings.o \ + dibitmap.o DEP_OBJECTS = $(TARGET_OBJECTS) _____ Added: trunk/reactos/lib/cpl/desk/appearance.c --- trunk/reactos/lib/cpl/desk/appearance.c 2005-02-04 16:51:11 UTC (rev 13405) +++ trunk/reactos/lib/cpl/desk/appearance.c 2005-02-04 20:39:10 UTC (rev 13406) @@ -0,0 +1,34 @@ +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Display Control Panel + * FILE: lib/cpl/desk/appearance.c + * PURPOSE: Appearance property page + * + * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) + */ + +#include <windows.h> +#include <commctrl.h> + +#include "resource.h" + +INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + { + } break; + + case WM_COMMAND: + { + } break; + } + + return FALSE; +} + Property changes on: trunk/reactos/lib/cpl/desk/appearance.c ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Added: trunk/reactos/lib/cpl/desk/background.c --- trunk/reactos/lib/cpl/desk/background.c 2005-02-04 16:51:11 UTC (rev 13405) +++ trunk/reactos/lib/cpl/desk/background.c 2005-02-04 20:39:10 UTC (rev 13406) @@ -0,0 +1,597 @@ +/* $Id$ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Display Control Panel + * FILE: lib/cpl/desk/background.c + * PURPOSE: Background property page + * + * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) + */ + +#include <windows.h> +#include <commctrl.h> +#include <commdlg.h> +#include <cpl.h> +#include <tchar.h> + +#include "resource.h" + +#include "desk.h" +#include "dibitmap.h" + +#define MAX_WALLPAPERS 100 + +#define PLACEMENT_CENTER 0 +#define PLACEMENT_STRETCH 1 +#define PLACEMENT_TILE 2 + +DIBitmap *g_pWallpaperBitmap = NULL; + +int g_placementSelection = 0; +int g_wallpaperSelection = -1; + +int g_wallpaperCount = 0; +int g_listViewItemCount = 0; + +int g_currentWallpaperItemId = 0; + +HWND g_hBackgroundTab = NULL; + +HWND g_hWallpaperList = NULL; +HWND g_hWallpaperPreview = NULL; +HIMAGELIST g_hShellImageList = NULL; + +HWND g_hPlacementCombo = NULL; + +TCHAR g_wallpapers[MAX_WALLPAPERS][MAX_PATH]; + +/* Add the bitmaps in the C:\ReactOS directory and the current wallpaper if any */ +void AddListViewItems() +{ + WIN32_FIND_DATA fd; + HANDLE hFind; + TCHAR szBuffer[256]; + TCHAR szSearchPath[MAX_PATH]; + LV_ITEM listItem; + LV_COLUMN dummy; + RECT clientRect; + HKEY regKey; + SHFILEINFO sfi; + HIMAGELIST himl; + TCHAR wallpaperFilename[MAX_PATH]; + DWORD bufferSize = sizeof(wallpaperFilename); + DWORD varType = REG_SZ; + LONG result; + UINT i = 0; + + GetClientRect(g_hWallpaperList, &clientRect); + + ZeroMemory(&dummy, sizeof(LV_COLUMN)); + dummy.mask = LVCF_SUBITEM | LVCF_WIDTH; + dummy.iSubItem = 0; + dummy.cx = (clientRect.right - clientRect.left) - GetSystemMetrics(SM_CXVSCROLL); + + ListView_InsertColumn(g_hWallpaperList, 0, &dummy); + + /* Add the "None" item */ + + LoadString(hApplet, IDS_NONE, szBuffer, sizeof(szBuffer) / sizeof(TCHAR)); + + ZeroMemory(&listItem, sizeof(LV_ITEM)); + listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; + listItem.pszText = szBuffer; + listItem.iItem = g_listViewItemCount; + listItem.iImage = -1; + listItem.state = LVIS_SELECTED; + listItem.lParam = -1; + + ListView_InsertItem(g_hWallpaperList, &listItem); + ListView_SetItemState(g_hWallpaperList, g_listViewItemCount, LVIS_SELECTED, LVIS_SELECTED); + + g_listViewItemCount++; + + /* Add current wallpaper if any */ + + RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, KEY_ALL_ACCESS, ®Key); + + result = RegQueryValueEx(regKey, TEXT("Wallpaper"), 0, &varType, (LPBYTE)wallpaperFilename, &bufferSize); + + if((result == ERROR_SUCCESS) && (_tcslen(wallpaperFilename) > 0)) + { + himl = (HIMAGELIST)SHGetFileInfo(wallpaperFilename, + 0, + &sfi, + sizeof(sfi), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON | + SHGFI_DISPLAYNAME); + + if(himl != NULL) + { + if(i++ == 0) + { + g_hShellImageList = himl; + ListView_SetImageList(g_hWallpaperList, himl, LVSIL_SMALL); + } + + ZeroMemory(&listItem, sizeof(LV_ITEM)); + listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; + listItem.pszText = sfi.szDisplayName; + listItem.state = LVIS_SELECTED; + listItem.iItem = g_listViewItemCount; + listItem.iImage = sfi.iIcon; + listItem.lParam = g_wallpaperCount; + + ListView_InsertItem(g_hWallpaperList, &listItem); + _tcscpy(g_wallpapers[g_wallpaperCount], wallpaperFilename); + + ListView_SetItemState(g_hWallpaperList, g_listViewItemCount, LVIS_SELECTED, LVIS_SELECTED); + + g_currentWallpaperItemId = g_listViewItemCount; + + g_listViewItemCount++; + g_wallpaperCount++; + } + } + + RegCloseKey(regKey); + + /* Add all the bitmaps in the C:\ReactOS directory. */ + + GetWindowsDirectory(szSearchPath, MAX_PATH); + _tcscat(szSearchPath, TEXT("\\*.bmp")); + + hFind = FindFirstFile(szSearchPath, &fd); + while(hFind != INVALID_HANDLE_VALUE) + { + /* Don't add any hidden bitmaps */ + if((fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) == 0) + { + TCHAR filename[MAX_PATH]; + + GetWindowsDirectory(filename, MAX_PATH); + + _tcscat(filename, TEXT("\\")); + _tcscat(filename, fd.cFileName); + + himl = (HIMAGELIST)SHGetFileInfo(filename, + 0, + &sfi, + sizeof(sfi), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON | + SHGFI_DISPLAYNAME); + + if(himl == NULL) + { + break; + } + + if(i++ == 0) + { + g_hShellImageList = himl; + ListView_SetImageList(g_hWallpaperList, himl, LVSIL_SMALL); + } + + ZeroMemory(&listItem, sizeof(LV_ITEM)); + listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; + listItem.pszText = sfi.szDisplayName; + listItem.state = 0; + listItem.iItem = g_listViewItemCount++; + listItem.iImage = sfi.iIcon; + listItem.lParam = g_wallpaperCount; + + ListView_InsertItem(g_hWallpaperList, &listItem); + + _tcscpy(g_wallpapers[g_wallpaperCount], filename); + + g_wallpaperCount++; + } + + if(!FindNextFile(hFind, &fd)) + hFind = INVALID_HANDLE_VALUE; + } +} + +void InitBackgroundDialog() +{ + g_hWallpaperList = GetDlgItem(g_hBackgroundTab, IDC_WALLPAPER_LIST); + g_hWallpaperPreview = GetDlgItem(g_hBackgroundTab, IDC_WALLPAPER_PREVIEW); + g_hPlacementCombo = GetDlgItem(g_hBackgroundTab, IDC_PLACEMENT_COMBO); + + AddListViewItems(); + + TCHAR szString[256]; + + LoadString(hApplet, IDS_CENTER, szString, sizeof(szString) / sizeof(TCHAR)); + SendMessage(g_hPlacementCombo, CB_INSERTSTRING, PLACEMENT_CENTER, (LPARAM)szString); + + LoadString(hApplet, IDS_STRETCH, szString, sizeof(szString) / sizeof(TCHAR)); + SendMessage(g_hPlacementCombo, CB_INSERTSTRING, PLACEMENT_STRETCH, (LPARAM)szString); + + LoadString(hApplet, IDS_TILE, szString, sizeof(szString) / sizeof(TCHAR)); + SendMessage(g_hPlacementCombo, CB_INSERTSTRING, PLACEMENT_TILE, (LPARAM)szString); + + /* Load the default settings from the registry */ + HKEY regKey; + + TCHAR szBuffer[2]; + DWORD bufferSize = sizeof(szBuffer); + DWORD varType = REG_SZ; + LONG result; + + RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, KEY_ALL_ACCESS, ®Key); + + result = RegQueryValueEx(regKey, TEXT("WallpaperStyle"), 0, &varType, (LPBYTE)szBuffer, &bufferSize); + + if(result == ERROR_SUCCESS) + { + if(_ttoi(szBuffer) == 0) + { + SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_CENTER, 0); + g_placementSelection = PLACEMENT_CENTER; + } + + if(_ttoi(szBuffer) == 2) + { + SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_STRETCH, 0); + g_placementSelection = PLACEMENT_STRETCH; + } + } + else + { + SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_CENTER, 0); + g_placementSelection = PLACEMENT_CENTER; + } + + result = RegQueryValueEx(regKey, TEXT("TileWallpaper"), 0, &varType, (LPBYTE)szBuffer, &bufferSize); + + if(result == ERROR_SUCCESS) + { + if(_ttoi(szBuffer) == 1) + { + SendMessage(g_hPlacementCombo, CB_SETCURSEL, PLACEMENT_TILE, 0); + g_placementSelection = PLACEMENT_TILE; + } + } + + RegCloseKey(regKey); +} + +void OnPatternButton() +{ + MessageBox(NULL, TEXT("That button doesn't do anything yet"), TEXT("Whoops"), MB_OK); +} + +BOOL CheckListBoxFilename(HWND list, TCHAR *filename) +{ + return FALSE; +} + +void OnBrowseButton() +{ + OPENFILENAME ofn; + TCHAR filename[MAX_PATH]; + TCHAR fileTitle[256]; + + ZeroMemory(&ofn, sizeof(OPENFILENAME)); + + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = g_hBackgroundTab; + ofn.lpstrFile = filename; + + /* Set lpstrFile[0] to '\0' so that GetOpenFileName does not + * use the contents of szFile to initialize itself */ + ofn.lpstrFile[0] = TEXT('\0'); + ofn.nMaxFile = MAX_PATH; + ofn.lpstrFilter = TEXT("Bitmap Files (*.bmp)\0*.bmp\0"); + ofn.nFilterIndex = 0; + ofn.lpstrFileTitle = fileTitle; + ofn.nMaxFileTitle = 256; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + if(GetOpenFileName(&ofn) == TRUE) + { + /* Check if there is already a entry that holds this filename */ + if(CheckListBoxFilename(g_hWallpaperList, filename) == FALSE) + { + SHFILEINFO sfi; + LV_ITEM listItem; + + if(g_wallpaperCount > (MAX_WALLPAPERS - 1)) + return; + + _tcscpy(g_wallpapers[g_wallpaperCount], filename); + + SHGetFileInfo(filename, + 0, + &sfi, + sizeof(sfi), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_DISPLAYNAME); + + ZeroMemory(&listItem, sizeof(LV_ITEM)); + listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; + listItem.pszText = sfi.szDisplayName; + listItem.state = 0; + listItem.iItem = g_listViewItemCount++; + listItem.iImage = sfi.iIcon; + listItem.lParam = g_wallpaperCount; + + ListView_InsertItem(g_hWallpaperList, &listItem); + + g_wallpaperCount++; + } + } +} + +void ListViewItemChanged(int itemIndex) +{ + if(g_pWallpaperBitmap != NULL) + { + DibFreeImage(g_pWallpaperBitmap); + g_pWallpaperBitmap = NULL; + } + + LV_ITEM listItem; + + listItem.iItem = itemIndex; + listItem.mask = LVIF_PARAM; + ListView_GetItem(g_hWallpaperList, &listItem); + + if(listItem.lParam == -1) + { + g_wallpaperSelection = -1; + InvalidateRect(g_hWallpaperPreview, NULL, TRUE); + } + else + { + g_wallpaperSelection = listItem.lParam; + + g_pWallpaperBitmap = DibLoadImage(g_wallpapers[g_wallpaperSelection]); + + if(g_pWallpaperBitmap == NULL) + { + } + + InvalidateRect(g_hWallpaperPreview, NULL, TRUE); + } + + EnableWindow(g_hPlacementCombo, (listItem.lParam != -1 ? TRUE : FALSE)); + + PropSheet_Changed(GetParent(g_hBackgroundTab), g_hBackgroundTab); +} + +void DrawWallpaperPreview(LPDRAWITEMSTRUCT draw) +{ + if(g_wallpaperSelection == -1) + { + FillRect(draw->hDC, &draw->rcItem, GetSysColorBrush(COLOR_BACKGROUND)); + return; + } + + if(g_pWallpaperBitmap == NULL) + return; + + float scaleX = ((float)GetSystemMetrics(SM_CXSCREEN) - 1) / (float)draw->rcItem.right; + float scaleY = ((float)GetSystemMetrics(SM_CYSCREEN) - 1) / (float)draw->rcItem.bottom; + + int scaledWidth = g_pWallpaperBitmap->width / scaleX; + int scaledHeight = g_pWallpaperBitmap->height / scaleY; + + int posX = (draw->rcItem.right / 2) - (scaledWidth / 2); + int posY = (draw->rcItem.bottom / 2) - (scaledHeight / 2); + + FillRect(draw->hDC, &draw->rcItem, GetSysColorBrush(COLOR_BACKGROUND)); + + SetStretchBltMode(draw->hDC, COLORONCOLOR); + + if(g_placementSelection == PLACEMENT_CENTER) + { + StretchDIBits(draw->hDC, + posX, + posY, + scaledWidth, + scaledHeight, + 0, + 0, + g_pWallpaperBitmap->width, + g_pWallpaperBitmap->height, + g_pWallpaperBitmap->bits, + g_pWallpaperBitmap->info, + DIB_RGB_COLORS, + SRCCOPY); + } + + if(g_placementSelection == PLACEMENT_STRETCH) + { + StretchDIBits(draw->hDC, + 0, + 0, + draw->rcItem.right, + draw->rcItem.bottom, + 0, + 0, + g_pWallpaperBitmap->width, + g_pWallpaperBitmap->height, + g_pWallpaperBitmap->bits, + g_pWallpaperBitmap->info, + DIB_RGB_COLORS, + SRCCOPY); + } + + if(g_placementSelection == PLACEMENT_TILE) + { + int x; + int y; + + for(y = 0; y < draw->rcItem.bottom; y += scaledHeight) + { + for(x = 0; x < draw->rcItem.right; x += scaledWidth) + { + StretchDIBits(draw->hDC, + x, + y, + scaledWidth, + scaledHeight, + 0, + 0, + g_pWallpaperBitmap->width, + g_pWallpaperBitmap->height, + g_pWallpaperBitmap->bits, + g_pWallpaperBitmap->info, + DIB_RGB_COLORS, + SRCCOPY); + } + } + } +} + +void SetWallpaper() +{ + HKEY regKey; + + RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), 0, KEY_ALL_ACCESS, ®Key); + + if(g_placementSelection == PLACEMENT_TILE) + { + RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE *)TEXT("1"), sizeof(TCHAR) * 2); + RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2); + } + + if(g_placementSelection == PLACEMENT_CENTER) + { + RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2); + RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2); + } + + if(g_placementSelection == PLACEMENT_STRETCH) + { + RegSetValueEx(regKey, TEXT("TileWallpaper"), 0, REG_SZ, (BYTE *)TEXT("0"), sizeof(TCHAR) * 2); + RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (BYTE *)TEXT("2"), sizeof(TCHAR) * 2); + } + + RegCloseKey(regKey); + + if(g_wallpaperSelection == -1) + { + SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, TEXT(""), SPIF_UPDATEINIFILE); + } + else + { + SystemParametersInfo(SPI_SETDESKWALLPAPER, + 0, + g_wallpapers[g_wallpaperSelection], + SPIF_UPDATEINIFILE); + } +} + +INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + g_hBackgroundTab = hwndDlg; + + switch(uMsg) + { + case WM_INITDIALOG: + { + InitBackgroundDialog(); + } break; + + case WM_COMMAND: + { + DWORD controlId = LOWORD(wParam); + DWORD command = HIWORD(wParam); + + switch(controlId) + { + case IDC_PATTERN: + { + if(command == BN_CLICKED) + OnPatternButton(); + } break; + + case IDC_BROWSE: + { + if(command == BN_CLICKED) + OnBrowseButton(); + } break; + + case IDC_PLACEMENT_COMBO: + { + if(command == CBN_SELCHANGE) + { + g_placementSelection = SendMessage(g_hPlacementCombo, CB_GETCURSEL, 0, 0); + + InvalidateRect(g_hWallpaperPreview, NULL, TRUE); + + PropSheet_Changed(GetParent(g_hBackgroundTab), g_hBackgroundTab); + } + + } break; + } + } break; + + case WM_DRAWITEM: + { + LPDRAWITEMSTRUCT drawItem; + drawItem = (LPDRAWITEMSTRUCT)lParam; + + if(drawItem->CtlID == IDC_WALLPAPER_PREVIEW) + { + DrawWallpaperPreview(drawItem); + } + + } break; + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch(lpnm->code) + { + case PSN_APPLY: + { + SetWallpaper(); + + /* Update the current wallapaper list item to the + * currently selected wallpaper */ + LV_ITEM listItem; + listItem.mask = LVIF_PARAM; + listItem.iSubItem = 0; + listItem.iItem = g_currentWallpaperItemId; + listItem.lParam = g_wallpaperSelection; + + ListView_SetItem(g_hWallpaperList, &listItem); + + return TRUE; + } break; + + case LVN_ITEMCHANGED: + { + LPNMLISTVIEW nm = (LPNMLISTVIEW)lParam; + + if((nm->uNewState & LVIS_SELECTED) == 0) + return FALSE; + + ListViewItemChanged(nm->iItem); + + } break; + + default: + break; + } + + } break; + + case WM_DESTROY: + { + if(g_pWallpaperBitmap != NULL) + DibFreeImage(g_pWallpaperBitmap); + + } break; + } + + return FALSE; +} + Property changes on: trunk/reactos/lib/cpl/desk/background.c ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Modified: trunk/reactos/lib/cpl/desk/desk.c --- trunk/reactos/lib/cpl/desk/desk.c 2005-02-04 16:51:11 UTC (rev 13405) +++ trunk/reactos/lib/cpl/desk/desk.c 2005-02-04 20:39:10 UTC (rev 13406) @@ -1,214 +1,128 @@ -/* - * ReactOS - * Copyright (C) 2004 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ /* $Id$ * + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Display Control Panel * FILE: lib/cpl/desk/desk.c * PURPOSE: ReactOS Display Control Panel - * PROGRAMMER: Gero Kuehn (reactos.filter(a)gkware.com) - * UPDATE HISTORY: - * 06-17-2004 Created - * 08-07-2004 Initial Checkin + * + * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) */ -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <tchar.h> #include <windows.h> - #include <commctrl.h> #include <cpl.h> -#include <process.h> - #include "resource.h" #include "desk.h" #define NUM_APPLETS (1) -LONG CALLBACK DisplayApplet(VOID); -INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +LONG APIENTRY DisplayApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam); +extern INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); HINSTANCE hApplet = 0; /* Applets */ APPLET Applets[NUM_APPLETS] = { - {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, DisplayApplet} + { + IDC_DESK_ICON, + IDS_CPLNAME, + IDS_CPLDESCRIPTION, + DisplayApplet + } }; - - -/* Property page dialog callback */ -INT_PTR CALLBACK -BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +static VOID InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc) { - switch(uMsg) - { - case WM_INITDIALOG: - break; - case WM_COMMAND: - break; - } - return FALSE; + ZeroMemory(psp, sizeof(PROPSHEETPAGE)); + psp->dwSize = sizeof(PROPSHEETPAGE); + psp->dwFlags = PSP_DEFAULT; + psp->hInstance = hApplet; + psp->pszTemplate = MAKEINTRESOURCE(idDlg); + psp->pfnDlgProc = DlgProc; } - -/* Property page dialog callback */ -INT_PTR CALLBACK -ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +/* Display Applet */ +LONG APIENTRY DisplayApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam) { - switch(uMsg) - { - case WM_INITDIALOG: - break; - case WM_COMMAND: - break; - } - return FALSE; + PROPSHEETPAGE psp[4]; + PROPSHEETHEADER psh; + TCHAR Caption[1024]; + + LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); + + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USECALLBACK | PSH_PROPTITLE; + psh.hwndParent = NULL; + psh.hInstance = hApplet; + psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_DESK_ICON)); + psh.pszCaption = Caption; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = psp; + + InitPropSheetPage(&psp[0], IDD_BACKGROUND, BackgroundPageProc); + InitPropSheetPage(&psp[1], IDD_SCREENSAVER, ScreenSaverPageProc); + InitPropSheetPage(&psp[2], IDD_APPEARANCE, AppearancePageProc); + InitPropSheetPage(&psp[3], IDD_SETTINGS, SettingsPageProc); + + return (LONG)(PropertySheet(&psh) != -1); } -/* Property page dialog callback */ -INT_PTR CALLBACK -AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch(uMsg) - { - case WM_INITDIALOG: - break; - case WM_COMMAND: - break; - } - return FALSE; -} - - -/* Property page dialog callback */ -INT_PTR CALLBACK -SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch(uMsg) - { - case WM_INITDIALOG: - break; - case WM_COMMAND: - break; - } - return FALSE; -} - - -static VOID -InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc) -{ - ZeroMemory(psp, sizeof(PROPSHEETPAGE)); - psp->dwSize = sizeof(PROPSHEETPAGE); - psp->dwFlags = PSP_DEFAULT; - psp->hInstance = hApplet; - psp->pszTemplate = MAKEINTRESOURCE(idDlg); - psp->pfnDlgProc = DlgProc; -} - - -/* First Applet */ - -LONG CALLBACK -DisplayApplet(VOID) -{ - PROPSHEETPAGE psp[4]; - PROPSHEETHEADER psh; - TCHAR Caption[1024]; - - LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); - - ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; - psh.hwndParent = NULL; - psh.hInstance = hApplet; - psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); - psh.pszCaption = Caption; - psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); - psh.nStartPage = 0; - psh.ppsp = psp; - psh.pfnCallback = NULL; - - InitPropSheetPage(&psp[0], IDD_PROPPAGEBACKGROUND, BackgroundPageProc); - InitPropSheetPage(&psp[1], IDD_PROPPAGESCREENSAVER, ScreenSaverPageProc); - InitPropSheetPage(&psp[2], IDD_PROPPAGEAPPEARANCE, AppearancePageProc); - InitPropSheetPage(&psp[3], IDD_PROPPAGESETTINGS, SettingsPageProc); - - return (LONG)(PropertySheet(&psh) != -1); -} - - /* Control Panel Callback */ -LONG CALLBACK -CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2) +LONG CALLBACK CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2) { - int i = (int)lParam1; - - switch(uMsg) - { - case CPL_INIT: - { - return TRUE; - } - case CPL_GETCOUNT: - { - return NUM_APPLETS; - } - case CPL_INQUIRE: - { - CPLINFO *CPlInfo = (CPLINFO*)lParam2; - CPlInfo->lData = 0; - CPlInfo->idIcon = Applets[i].idIcon; - CPlInfo->idName = Applets[i].idName; - CPlInfo->idInfo = Applets[i].idDescription; - break; - } - case CPL_DBLCLK: - { - Applets[i].AppletProc(); - break; - } - } - return FALSE; + int i = (int)lParam1; + + switch(uMsg) + { + case CPL_INIT: + { + return TRUE; + } + + case CPL_GETCOUNT: + { + return NUM_APPLETS; + } + + case CPL_INQUIRE: + { + CPLINFO *CPlInfo = (CPLINFO*)lParam2; + CPlInfo->lData = 0; + CPlInfo->idIcon = Applets[i].idIcon; + CPlInfo->idName = Applets[i].idName; + CPlInfo->idInfo = Applets[i].idDescription; + } break; + + case CPL_DBLCLK: + { + Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2); + } break; + } + + return FALSE; } -BOOL WINAPI -DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved) { - switch(dwReason) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - hApplet = hinstDLL; - break; [truncated at 1000 lines; 704 more skipped]
19 years, 10 months
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
42
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
39
40
41
42
Results per page:
10
25
50
100
200