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
January 2012
----- 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
559 discussions
Start a n
N
ew thread
[cgutman] 54917: - Merge 54895, 54896, 54899, 54912, 54913, 54915, and 54916 from wlan-bringup
by cgutman@svn.reactos.org
Author: cgutman Date: Thu Jan 12 03:12:49 2012 New Revision: 54917 URL:
http://svn.reactos.org/svn/reactos?rev=54917&view=rev
Log: - Merge 54895, 54896, 54899, 54912, 54913, 54915, and 54916 from wlan-bringup Modified: trunk/reactos/ (props changed) trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c trunk/reactos/dll/win32/dhcpcsvc/dhcp/api.c trunk/reactos/dll/win32/dhcpcsvc/dhcp/dispatch.c trunk/reactos/drivers/network/dd/pcnet/requests.c trunk/reactos/drivers/network/ndis/ndis/time.c trunk/reactos/drivers/network/tcpip/datalink/lan.c trunk/reactos/lib/drivers/ip/network/interface.c Propchange: trunk/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Jan 12 03:12:49 2012 @@ -10,3 +10,4 @@ /branches/ros-amd64-bringup/reactos:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882 /branches/shell32_new-bringup:51893-53652,53661,53700 /branches/tcp-rewrite-branch:48720,48840-48841,49424-49426,49454 +/branches/wlan-bringup:54895-54896,54899,54912-54913,54915-54916 Modified: trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dhcpcsvc/dhcp/ad…
============================================================================== --- trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] Thu Jan 12 03:12:49 2012 @@ -1,6 +1,6 @@ #include "rosdhcp.h" -static SOCKET DhcpSocket = INVALID_SOCKET; +SOCKET DhcpSocket = INVALID_SOCKET; static LIST_ENTRY AdapterList; static WSADATA wsd; @@ -209,6 +209,7 @@ PDHCP_ADAPTER Adapter = NULL; HANDLE AdapterStateChangedEvent = (HANDLE)Context; struct interface_info *ifi = NULL; + struct protocol *proto; int i, AdapterCount = 0, Broadcast; /* FIXME: Kill this thread when the service is stopped */ @@ -245,6 +246,10 @@ /* We're still active so we stay in the list */ ifi = &Adapter->DhclientInfo; } else { + proto = find_protocol_by_adapter(&Adapter->DhclientInfo); + if (proto) + remove_protocol(proto); + /* We've lost our link so out we go */ RemoveEntryList(&Adapter->ListEntry); free(Adapter); @@ -330,7 +335,7 @@ Adapter->DhclientInfo.rfdesc, got_one, &Adapter->DhclientInfo); - state_init(&Adapter->DhclientInfo); + state_init(&Adapter->DhclientInfo); } ApiLock(); @@ -345,15 +350,12 @@ DH_DbgPrint(MID_TRACE,("Adapter %d was rejected\n", Table->table[i].dwIndex)); } +#if 0 Error = NotifyAddrChange(NULL, NULL); -#if 0 if (Error != NO_ERROR) break; #else - if (AdapterCount) - break; - else - Sleep(3000); + Sleep(3000); #endif } while (TRUE); @@ -364,14 +366,13 @@ } HANDLE StartAdapterDiscovery(VOID) { - HANDLE /* ThreadHandle, */ EventHandle; + HANDLE ThreadHandle, EventHandle; EventHandle = CreateEvent(NULL, FALSE, FALSE, NULL); -#if 0 ThreadHandle = CreateThread(NULL, 0, AdapterDiscoveryThread, @@ -383,9 +384,6 @@ return NULL; CloseHandle(ThreadHandle); -#else - AdapterDiscoveryThread((LPVOID)EventHandle); -#endif return EventHandle; } Modified: trunk/reactos/dll/win32/dhcpcsvc/dhcp/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dhcpcsvc/dhcp/ap…
============================================================================== --- trunk/reactos/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] Thu Jan 12 03:12:49 2012 @@ -14,6 +14,8 @@ static CRITICAL_SECTION ApiCriticalSection; +extern HANDLE AdapterStateChangedEvent; + VOID ApiInit() { InitializeCriticalSection( &ApiCriticalSection ); } @@ -35,19 +37,28 @@ DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req ) { COMM_DHCP_REPLY Reply; PDHCP_ADAPTER Adapter; - - ApiLock(); - - Adapter = AdapterFindIndex( Req->AdapterIndex ); - - Reply.Reply = Adapter ? 1 : 0; - - if( Adapter ) { + struct protocol* proto; + + ApiLock(); + + Adapter = AdapterFindIndex( Req->AdapterIndex ); + + Reply.Reply = Adapter ? 1 : 0; + + if( Adapter ) { + proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); + if (proto) + remove_protocol(proto); + add_protocol( Adapter->DhclientInfo.name, Adapter->DhclientInfo.rfdesc, got_one, &Adapter->DhclientInfo ); - Adapter->DhclientInfo.client->state = S_INIT; - state_reboot(&Adapter->DhclientInfo); + + Adapter->DhclientInfo.client->state = S_INIT; + state_reboot(&Adapter->DhclientInfo); + + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); } ApiUnlock(); @@ -91,10 +102,18 @@ if( Adapter ) { if (Adapter->NteContext) DeleteIPAddress( Adapter->NteContext ); + if (Adapter->RouterMib.dwForwardNextHop) + DeleteIpForwardEntry( &Adapter->RouterMib ); proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); if (proto) remove_protocol(proto); + + Adapter->DhclientInfo.client->active = NULL; + Adapter->DhclientInfo.client->state = S_INIT; + + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); } ApiUnlock(); @@ -105,6 +124,7 @@ DWORD DSRenewIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req ) { COMM_DHCP_REPLY Reply; PDHCP_ADAPTER Adapter; + struct protocol* proto; ApiLock(); @@ -118,12 +138,20 @@ Reply.Reply = 1; + proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); + if (proto) + remove_protocol(proto); + add_protocol( Adapter->DhclientInfo.name, Adapter->DhclientInfo.rfdesc, got_one, &Adapter->DhclientInfo ); + Adapter->DhclientInfo.client->state = S_INIT; state_reboot(&Adapter->DhclientInfo); + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); + ApiUnlock(); return Send( &Reply ); @@ -144,6 +172,9 @@ if( Adapter ) { if (Adapter->NteContext) DeleteIPAddress( Adapter->NteContext ); + if (Adapter->RouterMib.dwForwardNextHop) + DeleteIpForwardEntry( &Adapter->RouterMib ); + Adapter->DhclientState.state = S_STATIC; proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); if (proto) @@ -154,6 +185,9 @@ &Adapter->NteContext, &Adapter->NteInstance ); Reply.Reply = NT_SUCCESS(Status); + + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); } ApiUnlock(); Modified: trunk/reactos/dll/win32/dhcpcsvc/dhcp/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dhcpcsvc/dhcp/di…
============================================================================== --- trunk/reactos/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] Thu Jan 12 03:12:49 2012 @@ -47,6 +47,8 @@ //#include <ifaddrs.h> //#include <poll.h> +extern SOCKET DhcpSocket; +HANDLE AdapterStateChangedEvent = NULL; struct protocol *protocols = NULL; struct timeout *timeouts = NULL; static struct timeout *free_timeouts = NULL; @@ -63,17 +65,19 @@ void dispatch(void) { - int count, to_msec, err; + int count, to_msec; struct protocol *l; - fd_set fds; time_t howlong, cur_time; - struct timeval timeval; - HANDLE AdapterStateChangedEvent; - - AdapterStateChangedEvent = StartAdapterDiscovery(); - if (!AdapterStateChangedEvent) + HANDLE Events[2]; + int EventCount = 1; + + Events[0] = StartAdapterDiscovery(); + if (!Events[0]) return; - + AdapterStateChangedEvent = Events[0]; + + Events[1] = WSA_INVALID_EVENT; + ApiLock(); do { @@ -83,7 +87,8 @@ */ time(&cur_time); - if (timeouts) { + if (timeouts) + { struct timeout *t; if (timeouts->when <= cur_time) { @@ -105,55 +110,75 @@ if (howlong > INT_MAX / 1000) howlong = INT_MAX / 1000; to_msec = howlong * 1000; - - /* Set up the descriptors to be polled. */ - FD_ZERO(&fds); - - for (l = protocols; l; l = l->next) - FD_SET(l->fd, &fds); - - /* Wait for a packet or a timeout... XXX */ - timeval.tv_sec = to_msec / 1000; - timeval.tv_usec = to_msec % 1000; - - ApiUnlock(); - - count = select(0, &fds, NULL, NULL, &timeval); - - ApiLock(); } else { - ApiUnlock(); - WaitForSingleObject(AdapterStateChangedEvent, INFINITE); - ApiLock(); - + to_msec = INFINITE; + } + + if (Events[1] == WSA_INVALID_EVENT && DhcpSocket != INVALID_SOCKET) + { + Events[1] = WSACreateEvent(); + if (Events[1] != WSA_INVALID_EVENT) + { + count = WSAEventSelect(DhcpSocket, Events[1], FD_READ | FD_CLOSE); + if (count != NO_ERROR) + { + WSACloseEvent(Events[1]); + Events[1] = WSA_INVALID_EVENT; + } + else + { + EventCount = 2; + } + } + } + else if (Events[1] != WSA_INVALID_EVENT && DhcpSocket == INVALID_SOCKET) + { + WSACloseEvent(Events[1]); + Events[1] = WSA_INVALID_EVENT; + + EventCount = 1; + } + + ApiUnlock(); + count = WaitForMultipleObjects(EventCount, + Events, + FALSE, + to_msec); + ApiLock(); + if (count == WAIT_OBJECT_0) + { + /* Adapter state change */ continue; } - - DH_DbgPrint(MID_TRACE,("Select: %d\n", count)); - - /* Not likely to be transitory... */ - if (count == SOCKET_ERROR) { - err = WSAGetLastError(); - error("poll: %d", err); - break; + else if (count == WAIT_OBJECT_0 + 1) + { + /* Packet received */ + + /* WSA events are manual reset events */ + WSAResetEvent(Events[1]); + } + else + { + /* Timeout */ + continue; } for (l = protocols; l; l = l->next) { struct interface_info *ip; ip = l->local; - if (FD_ISSET(l->fd, &fds)) { - if (ip && (l->handler != got_one || - !ip->dead)) { - DH_DbgPrint(MID_TRACE,("Handling %x\n", l)); - (*(l->handler))(l); - } + if (ip && (l->handler != got_one || + !ip->dead)) { + DH_DbgPrint(MID_TRACE,("Handling %x\n", l)); + (*(l->handler))(l); } } } while (1); - CloseHandle(AdapterStateChangedEvent); + AdapterStateChangedEvent = NULL; + CloseHandle(Events[0]); + WSACloseEvent(Events[1]); ApiUnlock(); } @@ -327,6 +352,41 @@ remove_protocol(struct protocol *proto) { struct protocol *p, *next, *prev; + struct interface_info *ip = proto->local; + struct timeout *t, *q, *u; + + t = NULL; + q = timeouts; + while (q != NULL) + { + /* Remove all timeouts for this protocol */ + if (q->what == ip) + { + /* Unlink the timeout from previous */ + if (t) + t->next = q->next; + else + timeouts = q->next; + + /* Advance to the next timeout */ + u = q->next; + + /* Add it to the free list */ + q->next = free_timeouts; + free_timeouts = q; + } + else + { + /* Advance to the next timeout */ + u = q->next; + + /* Update the previous pointer */ + t = q; + } + + /* Advance */ + q = u; + } prev = NULL; for (p = protocols; p; p = next) { Modified: trunk/reactos/drivers/network/dd/pcnet/requests.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/pcnet/r…
============================================================================== --- trunk/reactos/drivers/network/dd/pcnet/requests.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/dd/pcnet/requests.c [iso-8859-1] Thu Jan 12 03:12:49 2012 @@ -266,7 +266,7 @@ case OID_GEN_MEDIA_CONNECT_STATUS: { - GenericULONG = Adapter->MediaState; + GenericULONG = (ULONG)NdisMediaStateConnected; /* Adapter->MediaState */ break; } Modified: trunk/reactos/drivers/network/ndis/ndis/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/time.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/time.c [iso-8859-1] Thu Jan 12 03:12:49 2012 @@ -57,10 +57,9 @@ * ARGUMENTS: * pSystemTime: pointer to the returned system time * NOTES: - * - call at IRQL <= DISPATCH_LEVEL - */ -{ - ASSERT_IRQL(DISPATCH_LEVEL); + * - call at any IRQL + */ +{ ASSERT(pSystemTime); KeQuerySystemTime (pSystemTime); Modified: trunk/reactos/drivers/network/tcpip/datalink/lan.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/data…
============================================================================== --- trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Thu Jan 12 03:12:49 2012 @@ -185,7 +185,9 @@ case OID_GEN_HARDWARE_STATUS: *Result = NdisHardwareStatusReady; return STATUS_SUCCESS; - + case OID_GEN_MEDIA_CONNECT_STATUS: + *Result = NdisMediaStateConnected; + return STATUS_SUCCESS; default: return STATUS_INVALID_PARAMETER; } Modified: trunk/reactos/lib/drivers/ip/network/interface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/int…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/interface.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/interface.c [iso-8859-1] Thu Jan 12 03:12:49 2012 @@ -196,27 +196,26 @@ return NULL; } -NTSTATUS GetInterfaceConnectionStatus -( PIP_INTERFACE Interface, PULONG Result ) { - NTSTATUS Status = TcpipLanGetDwordOid - ( Interface, OID_GEN_HARDWARE_STATUS, Result ); - if( NT_SUCCESS(Status) ) switch( *Result ) { - case NdisHardwareStatusReady: +NTSTATUS GetInterfaceConnectionStatus(PIP_INTERFACE Interface, PULONG Result) +{ + NTSTATUS Status; + + /* Query OID_GEN_MEDIA_CONNECT_STATUS for connection status information */ + Status = TcpipLanGetDwordOid(Interface, OID_GEN_MEDIA_CONNECT_STATUS, Result); + if (!NT_SUCCESS(Status)) + return Status; + + /* Translate the result into MIB_IF_OPER_STATUS_XXX */ + if (*Result == NdisMediaStateConnected) + { + /* Up and running */ *Result = MIB_IF_OPER_STATUS_OPERATIONAL; - break; - case NdisHardwareStatusInitializing: - *Result = MIB_IF_OPER_STATUS_CONNECTING; - break; - case NdisHardwareStatusReset: + } + else + { + /* Down */ *Result = MIB_IF_OPER_STATUS_DISCONNECTED; - break; - case NdisHardwareStatusNotReady: - *Result = MIB_IF_OPER_STATUS_DISCONNECTED; - break; - case NdisHardwareStatusClosing: - default: - *Result = MIB_IF_OPER_STATUS_NON_OPERATIONAL; - break; - } - return Status; -} + } + + return STATUS_SUCCESS; +}
12 years, 11 months
1
0
0
0
[cgutman] 54916: - Remove a forgotten debug print
by cgutman@svn.reactos.org
Author: cgutman Date: Thu Jan 12 02:25:56 2012 New Revision: 54916 URL:
http://svn.reactos.org/svn/reactos?rev=54916&view=rev
Log: - Remove a forgotten debug print Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] Thu Jan 12 02:25:56 2012 @@ -367,9 +367,7 @@ t->next = q->next; else timeouts = q->next; - - DbgPrint("Disposing timeout 0x%x\n", q); - + /* Advance to the next timeout */ u = q->next;
12 years, 11 months
1
0
0
0
[cgutman] 54915: [DHCPCSVC] - Remove timeouts associated with the protocol in remove_protocol()
by cgutman@svn.reactos.org
Author: cgutman Date: Thu Jan 12 02:11:02 2012 New Revision: 54915 URL:
http://svn.reactos.org/svn/reactos?rev=54915&view=rev
Log: [DHCPCSVC] - Remove timeouts associated with the protocol in remove_protocol() Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] Thu Jan 12 02:11:02 2012 @@ -352,6 +352,43 @@ remove_protocol(struct protocol *proto) { struct protocol *p, *next, *prev; + struct interface_info *ip = proto->local; + struct timeout *t, *q, *u; + + t = NULL; + q = timeouts; + while (q != NULL) + { + /* Remove all timeouts for this protocol */ + if (q->what == ip) + { + /* Unlink the timeout from previous */ + if (t) + t->next = q->next; + else + timeouts = q->next; + + DbgPrint("Disposing timeout 0x%x\n", q); + + /* Advance to the next timeout */ + u = q->next; + + /* Add it to the free list */ + q->next = free_timeouts; + free_timeouts = q; + } + else + { + /* Advance to the next timeout */ + u = q->next; + + /* Update the previous pointer */ + t = q; + } + + /* Advance */ + q = u; + } prev = NULL; for (p = protocols; p; p = next) {
12 years, 11 months
1
0
0
0
[cgutman] 54914: [WLANCONF] - Release the current IP address before disconnecting from an AP - Refresh the IP information after connecting to an AP
by cgutman@svn.reactos.org
Author: cgutman Date: Thu Jan 12 01:46:15 2012 New Revision: 54914 URL:
http://svn.reactos.org/svn/reactos?rev=54914&view=rev
Log: [WLANCONF] - Release the current IP address before disconnecting from an AP - Refresh the IP information after connecting to an AP Modified: branches/wlan-bringup/base/applications/network/wlanconf/CMakeLists.txt branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.rbuild Modified: branches/wlan-bringup/base/applications/network/wlanconf/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/base/applications/…
============================================================================== --- branches/wlan-bringup/base/applications/network/wlanconf/CMakeLists.txt [iso-8859-1] (original) +++ branches/wlan-bringup/base/applications/network/wlanconf/CMakeLists.txt [iso-8859-1] Thu Jan 12 01:46:15 2012 @@ -4,5 +4,5 @@ ${REACTOS_SOURCE_DIR}/include/reactos/drivers/ndisuio) add_executable(wlanconf wlanconf.c wlanconf.rc) set_module_type(wlanconf win32cui) -add_importlibs(wlanconf msvcrt kernel32) +add_importlibs(wlanconf msvcrt iphlpapi kernel32) add_cd_file(TARGET wlanconf DESTINATION reactos/system32 FOR all) Modified: branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/base/applications/…
============================================================================== --- branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c [iso-8859-1] (original) +++ branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.c [iso-8859-1] Thu Jan 12 01:46:15 2012 @@ -12,6 +12,7 @@ #include <stdlib.h> #include <ntddndis.h> #include <nuiouser.h> +#include <iphlpapi.h> BOOL bScan = FALSE; @@ -110,26 +111,28 @@ return TRUE; } -HANDLE -OpenAdapterHandle(DWORD Index) +BOOL +OpenAdapterHandle(DWORD Index, HANDLE *hAdapter, IP_ADAPTER_INDEX_MAP *IpInfo) { HANDLE hDriver; BOOL bSuccess; DWORD dwBytesReturned; DWORD QueryBindingSize = sizeof(NDISUIO_QUERY_BINDING) + (1024 * sizeof(WCHAR)); PNDISUIO_QUERY_BINDING QueryBinding; + DWORD dwStatus, dwSize, i; + PIP_INTERFACE_INFO InterfaceInfo = NULL; /* Open the driver handle */ hDriver = OpenDriverHandle(); if (hDriver == INVALID_HANDLE_VALUE) - return INVALID_HANDLE_VALUE; + return FALSE; /* Allocate the binding struct */ QueryBinding = HeapAlloc(GetProcessHeap(), 0, QueryBindingSize); if (!QueryBinding) { CloseHandle(hDriver); - return INVALID_HANDLE_VALUE; + return FALSE; } /* Query the adapter binding information */ @@ -147,7 +150,7 @@ { HeapFree(GetProcessHeap(), 0, QueryBinding); CloseHandle(hDriver); - return INVALID_HANDLE_VALUE; + return FALSE; } /* Bind to the adapter */ @@ -159,48 +162,89 @@ 0, &dwBytesReturned, NULL); + + if (!bSuccess) + { + HeapFree(GetProcessHeap(), 0, QueryBinding); + CloseHandle(hDriver); + return FALSE; + } + + /* Get interface info from the IP helper */ + dwSize = sizeof(IP_INTERFACE_INFO); + do { + if (InterfaceInfo) HeapFree(GetProcessHeap(), 0, InterfaceInfo); + InterfaceInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(IP_INTERFACE_INFO)); + if (!InterfaceInfo) + { + HeapFree(GetProcessHeap(), 0, QueryBinding); + CloseHandle(hDriver); + return FALSE; + } + dwStatus = GetInterfaceInfo(InterfaceInfo, &dwSize); + } while (dwStatus == ERROR_INSUFFICIENT_BUFFER); + + if (dwStatus != NO_ERROR) + { + HeapFree(GetProcessHeap(), 0, QueryBinding); + HeapFree(GetProcessHeap(), 0, InterfaceInfo); + return FALSE; + } + + for (i = 0; i < InterfaceInfo->NumAdapters; i++) + { + if (wcsstr((PWCHAR)((PUCHAR)QueryBinding + QueryBinding->DeviceNameOffset), + InterfaceInfo->Adapter[i].Name)) + { + *IpInfo = InterfaceInfo->Adapter[i]; + *hAdapter = hDriver; + + HeapFree(GetProcessHeap(), 0, QueryBinding); + HeapFree(GetProcessHeap(), 0, InterfaceInfo); + + return TRUE; + } + } + HeapFree(GetProcessHeap(), 0, QueryBinding); - - if (!bSuccess) - { - CloseHandle(hDriver); - return INVALID_HANDLE_VALUE; - } - - return hDriver; + HeapFree(GetProcessHeap(), 0, InterfaceInfo); + CloseHandle(hDriver); + + return FALSE; } /* Only works with the first adapter for now */ -HANDLE -OpenWlanAdapter(VOID) +BOOL +OpenWlanAdapter(HANDLE *hAdapter, IP_ADAPTER_INDEX_MAP *IpInfo) { DWORD dwCurrentIndex; - HANDLE hCurrentAdapter; for (dwCurrentIndex = 0; ; dwCurrentIndex++) { - hCurrentAdapter = OpenAdapterHandle(dwCurrentIndex); - if (hCurrentAdapter == INVALID_HANDLE_VALUE) + if (!OpenAdapterHandle(dwCurrentIndex, hAdapter, IpInfo)) break; - if (IsWlanAdapter(hCurrentAdapter)) - return hCurrentAdapter; + if (IsWlanAdapter(*hAdapter)) + return TRUE; else - CloseHandle(hCurrentAdapter); - } - - return INVALID_HANDLE_VALUE; + CloseHandle(*hAdapter); + } + + return FALSE; } BOOL -WlanDisconnect(HANDLE hAdapter) +WlanDisconnect(HANDLE hAdapter, PIP_ADAPTER_INDEX_MAP IpInfo) { BOOL bSuccess; DWORD dwBytesReturned; NDISUIO_SET_OID SetOid; + /* Release this IP address */ + IpReleaseAddress(IpInfo); + + /* Disassociate from the AP */ SetOid.Oid = OID_802_11_DISASSOCIATE; - bSuccess = DeviceIoControl(hAdapter, IOCTL_NDISUIO_SET_OID_VALUE, &SetOid, @@ -519,7 +563,7 @@ } BOOL -WlanConnect(HANDLE hAdapter) +WlanConnect(HANDLE hAdapter, PIP_ADAPTER_INDEX_MAP IpInfo) { BOOL bSuccess; DWORD dwBytesReturned, SetOidSize; @@ -681,6 +725,10 @@ if (!bSuccess) return FALSE; + + /* Update our IP address */ + IpReleaseAddress(IpInfo); + IpRenewAddress(IpInfo); _tprintf(_T("The operation completed successfully.\n")); return TRUE; @@ -864,12 +912,12 @@ int main(int argc, char* argv[]) { HANDLE hAdapter; + IP_ADAPTER_INDEX_MAP IpInfo; if (!ParseCmdline(argc, argv)) return -1; - hAdapter = OpenWlanAdapter(); - if (hAdapter == INVALID_HANDLE_VALUE) + if (!OpenWlanAdapter(&hAdapter, &IpInfo)) { DoFormatMessage(GetLastError()); return -1; @@ -886,7 +934,7 @@ } else if (bDisconnect) { - if (!WlanDisconnect(hAdapter)) + if (!WlanDisconnect(hAdapter, &IpInfo)) { DoFormatMessage(GetLastError()); CloseHandle(hAdapter); @@ -895,7 +943,7 @@ } else if (bConnect) { - if (!WlanConnect(hAdapter)) + if (!WlanConnect(hAdapter, &IpInfo)) { DoFormatMessage(GetLastError()); CloseHandle(hAdapter); Modified: branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/base/applications/…
============================================================================== --- branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.rbuild [iso-8859-1] (original) +++ branches/wlan-bringup/base/applications/network/wlanconf/wlanconf.rbuild [iso-8859-1] Thu Jan 12 01:46:15 2012 @@ -3,6 +3,7 @@ <module name="wlanconf" type="win32cui" installbase="system32" installname="wlanconf.exe"> <include base="wlanconf">.</include> <include base="ReactOS">include/reactos/drivers/ndisuio</include> + <library>iphlpapi</library> <file>wlanconf.c</file> <file>wlanconf.rc</file> </module>
12 years, 11 months
1
0
0
0
[cgutman] 54913: [DHCPCSVC] - Delete the existing default gateway when releasing DHCP IP or transitioning to static IP - Fixes bug #6205
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Jan 11 23:38:48 2012 New Revision: 54913 URL:
http://svn.reactos.org/svn/reactos?rev=54913&view=rev
Log: [DHCPCSVC] - Delete the existing default gateway when releasing DHCP IP or transitioning to static IP - Fixes bug #6205 Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] Wed Jan 11 23:38:48 2012 @@ -102,6 +102,8 @@ if( Adapter ) { if (Adapter->NteContext) DeleteIPAddress( Adapter->NteContext ); + if (Adapter->RouterMib.dwForwardNextHop) + DeleteIpForwardEntry( &Adapter->RouterMib ); proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); if (proto) @@ -170,6 +172,9 @@ if( Adapter ) { if (Adapter->NteContext) DeleteIPAddress( Adapter->NteContext ); + if (Adapter->RouterMib.dwForwardNextHop) + DeleteIpForwardEntry( &Adapter->RouterMib ); + Adapter->DhclientState.state = S_STATIC; proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); if (proto)
12 years, 11 months
1
0
0
0
[cgutman] 54912: [DHCPCSVC] - Fix ipconfig hang with ipconfig /renew and ipconfig /release - Fix duplicate protocol entries being added for the same adapter - Use WSAEventSelect and WaitForMultiple...
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Jan 11 22:24:49 2012 New Revision: 54912 URL:
http://svn.reactos.org/svn/reactos?rev=54912&view=rev
Log: [DHCPCSVC] - Fix ipconfig hang with ipconfig /renew and ipconfig /release - Fix duplicate protocol entries being added for the same adapter - Use WSAEventSelect and WaitForMultipleObjects to manage waiting between timeouts, adapter state changes, and incoming packets Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] Wed Jan 11 22:24:49 2012 @@ -1,6 +1,6 @@ #include "rosdhcp.h" -static SOCKET DhcpSocket = INVALID_SOCKET; +SOCKET DhcpSocket = INVALID_SOCKET; static LIST_ENTRY AdapterList; static WSADATA wsd; @@ -209,6 +209,7 @@ PDHCP_ADAPTER Adapter = NULL; HANDLE AdapterStateChangedEvent = (HANDLE)Context; struct interface_info *ifi = NULL; + struct protocol *proto; int i, AdapterCount = 0, Broadcast; /* FIXME: Kill this thread when the service is stopped */ @@ -245,6 +246,10 @@ /* We're still active so we stay in the list */ ifi = &Adapter->DhclientInfo; } else { + proto = find_protocol_by_adapter(&Adapter->DhclientInfo); + if (proto) + remove_protocol(proto); + /* We've lost our link so out we go */ RemoveEntryList(&Adapter->ListEntry); free(Adapter); @@ -330,7 +335,7 @@ Adapter->DhclientInfo.rfdesc, got_one, &Adapter->DhclientInfo); - state_init(&Adapter->DhclientInfo); + state_init(&Adapter->DhclientInfo); } ApiLock(); Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/api.c [iso-8859-1] Wed Jan 11 22:24:49 2012 @@ -14,6 +14,8 @@ static CRITICAL_SECTION ApiCriticalSection; +extern HANDLE AdapterStateChangedEvent; + VOID ApiInit() { InitializeCriticalSection( &ApiCriticalSection ); } @@ -35,19 +37,28 @@ DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req ) { COMM_DHCP_REPLY Reply; PDHCP_ADAPTER Adapter; - - ApiLock(); - - Adapter = AdapterFindIndex( Req->AdapterIndex ); - - Reply.Reply = Adapter ? 1 : 0; - - if( Adapter ) { + struct protocol* proto; + + ApiLock(); + + Adapter = AdapterFindIndex( Req->AdapterIndex ); + + Reply.Reply = Adapter ? 1 : 0; + + if( Adapter ) { + proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); + if (proto) + remove_protocol(proto); + add_protocol( Adapter->DhclientInfo.name, Adapter->DhclientInfo.rfdesc, got_one, &Adapter->DhclientInfo ); - Adapter->DhclientInfo.client->state = S_INIT; - state_reboot(&Adapter->DhclientInfo); + + Adapter->DhclientInfo.client->state = S_INIT; + state_reboot(&Adapter->DhclientInfo); + + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); } ApiUnlock(); @@ -95,6 +106,12 @@ proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); if (proto) remove_protocol(proto); + + Adapter->DhclientInfo.client->active = NULL; + Adapter->DhclientInfo.client->state = S_INIT; + + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); } ApiUnlock(); @@ -105,6 +122,7 @@ DWORD DSRenewIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req ) { COMM_DHCP_REPLY Reply; PDHCP_ADAPTER Adapter; + struct protocol* proto; ApiLock(); @@ -118,11 +136,19 @@ Reply.Reply = 1; + proto = find_protocol_by_adapter( &Adapter->DhclientInfo ); + if (proto) + remove_protocol(proto); + add_protocol( Adapter->DhclientInfo.name, Adapter->DhclientInfo.rfdesc, got_one, &Adapter->DhclientInfo ); + Adapter->DhclientInfo.client->state = S_INIT; state_reboot(&Adapter->DhclientInfo); + + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); ApiUnlock(); @@ -154,6 +180,9 @@ &Adapter->NteContext, &Adapter->NteInstance ); Reply.Reply = NT_SUCCESS(Status); + + if (AdapterStateChangedEvent != NULL) + SetEvent(AdapterStateChangedEvent); } ApiUnlock(); Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] Wed Jan 11 22:24:49 2012 @@ -47,6 +47,8 @@ //#include <ifaddrs.h> //#include <poll.h> +extern SOCKET DhcpSocket; +HANDLE AdapterStateChangedEvent = NULL; struct protocol *protocols = NULL; struct timeout *timeouts = NULL; static struct timeout *free_timeouts = NULL; @@ -63,17 +65,19 @@ void dispatch(void) { - int count, to_msec, err; + int count, to_msec; struct protocol *l; - fd_set fds; time_t howlong, cur_time; - struct timeval timeval; - HANDLE AdapterStateChangedEvent; - - AdapterStateChangedEvent = StartAdapterDiscovery(); - if (!AdapterStateChangedEvent) + HANDLE Events[2]; + int EventCount = 1; + + Events[0] = StartAdapterDiscovery(); + if (!Events[0]) return; - + AdapterStateChangedEvent = Events[0]; + + Events[1] = WSA_INVALID_EVENT; + ApiLock(); do { @@ -83,7 +87,8 @@ */ time(&cur_time); - if (timeouts) { + if (timeouts) + { struct timeout *t; if (timeouts->when <= cur_time) { @@ -105,55 +110,75 @@ if (howlong > INT_MAX / 1000) howlong = INT_MAX / 1000; to_msec = howlong * 1000; - - /* Set up the descriptors to be polled. */ - FD_ZERO(&fds); - - for (l = protocols; l; l = l->next) - FD_SET(l->fd, &fds); - - /* Wait for a packet or a timeout... XXX */ - timeval.tv_sec = to_msec / 1000; - timeval.tv_usec = to_msec % 1000; - - ApiUnlock(); - - count = select(0, &fds, NULL, NULL, &timeval); - - ApiLock(); } else { - ApiUnlock(); - WaitForSingleObject(AdapterStateChangedEvent, INFINITE); - ApiLock(); - + to_msec = INFINITE; + } + + if (Events[1] == WSA_INVALID_EVENT && DhcpSocket != INVALID_SOCKET) + { + Events[1] = WSACreateEvent(); + if (Events[1] != WSA_INVALID_EVENT) + { + count = WSAEventSelect(DhcpSocket, Events[1], FD_READ | FD_CLOSE); + if (count != NO_ERROR) + { + WSACloseEvent(Events[1]); + Events[1] = WSA_INVALID_EVENT; + } + else + { + EventCount = 2; + } + } + } + else if (Events[1] != WSA_INVALID_EVENT && DhcpSocket == INVALID_SOCKET) + { + WSACloseEvent(Events[1]); + Events[1] = WSA_INVALID_EVENT; + + EventCount = 1; + } + + ApiUnlock(); + count = WaitForMultipleObjects(EventCount, + Events, + FALSE, + to_msec); + ApiLock(); + if (count == WAIT_OBJECT_0) + { + /* Adapter state change */ continue; } - - DH_DbgPrint(MID_TRACE,("Select: %d\n", count)); - - /* Not likely to be transitory... */ - if (count == SOCKET_ERROR) { - err = WSAGetLastError(); - error("poll: %d", err); - break; + else if (count == WAIT_OBJECT_0 + 1) + { + /* Packet received */ + + /* WSA events are manual reset events */ + WSAResetEvent(Events[1]); + } + else + { + /* Timeout */ + continue; } for (l = protocols; l; l = l->next) { struct interface_info *ip; ip = l->local; - if (FD_ISSET(l->fd, &fds)) { - if (ip && (l->handler != got_one || - !ip->dead)) { - DH_DbgPrint(MID_TRACE,("Handling %x\n", l)); - (*(l->handler))(l); - } + if (ip && (l->handler != got_one || + !ip->dead)) { + DH_DbgPrint(MID_TRACE,("Handling %x\n", l)); + (*(l->handler))(l); } } } while (1); - CloseHandle(AdapterStateChangedEvent); + AdapterStateChangedEvent = NULL; + CloseHandle(Events[0]); + WSACloseEvent(Events[1]); ApiUnlock(); }
12 years, 11 months
1
0
0
0
[rharabien] 54911: [SHELL32] - Register CDrvDefExt - Add application icon and "Change..." button to file properties dialog. Patch by EDIJS (#6817)
by rharabien@svn.reactos.org
Author: rharabien Date: Wed Jan 11 22:08:04 2012 New Revision: 54911 URL:
http://svn.reactos.org/svn/reactos?rev=54911&view=rev
Log: [SHELL32] - Register CDrvDefExt - Add application icon and "Change..." button to file properties dialog. Patch by EDIJS (#6817) Added: trunk/reactos/dll/win32/shell32/res/rgs/shelldrvdefext.rgs Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc trunk/reactos/dll/win32/shell32/lang/ca-ES.rc trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc trunk/reactos/dll/win32/shell32/lang/da-DK.rc trunk/reactos/dll/win32/shell32/lang/de-DE.rc trunk/reactos/dll/win32/shell32/lang/el-GR.rc trunk/reactos/dll/win32/shell32/lang/en-GB.rc trunk/reactos/dll/win32/shell32/lang/en-US.rc trunk/reactos/dll/win32/shell32/lang/es-ES.rc trunk/reactos/dll/win32/shell32/lang/fi-FI.rc trunk/reactos/dll/win32/shell32/lang/fr-FR.rc trunk/reactos/dll/win32/shell32/lang/hu-HU.rc trunk/reactos/dll/win32/shell32/lang/it-IT.rc trunk/reactos/dll/win32/shell32/lang/ja-JP.rc trunk/reactos/dll/win32/shell32/lang/ko-KR.rc trunk/reactos/dll/win32/shell32/lang/nl-NL.rc trunk/reactos/dll/win32/shell32/lang/no-NO.rc trunk/reactos/dll/win32/shell32/lang/pl-PL.rc trunk/reactos/dll/win32/shell32/lang/pt-BR.rc trunk/reactos/dll/win32/shell32/lang/pt-PT.rc trunk/reactos/dll/win32/shell32/lang/ro-RO.rc trunk/reactos/dll/win32/shell32/lang/ru-RU.rc trunk/reactos/dll/win32/shell32/lang/sk-SK.rc trunk/reactos/dll/win32/shell32/lang/sl-SI.rc trunk/reactos/dll/win32/shell32/lang/sv-SE.rc trunk/reactos/dll/win32/shell32/lang/tr-TR.rc trunk/reactos/dll/win32/shell32/lang/uk-UA.rc trunk/reactos/dll/win32/shell32/lang/zh-CN.rc trunk/reactos/dll/win32/shell32/lang/zh-TW.rc trunk/reactos/dll/win32/shell32/rgs_res.rc Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/bg-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/bg-BG.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Ðид Ñайл:", 14004, 8, 35, 50, 10 LTEXT "Файл", 14005, 68, 35, 160, 10 LTEXT "ÐÑваÑÑне Ñ:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "ÐеÑÑоположение:", 14008, 8, 72, 61, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "РазмеÑ:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/ca-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ca-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ca-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ca-ES.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/cs-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -224,7 +224,9 @@ LTEXT "Typ souboru:", 14004, 8, 35, 50, 10 LTEXT "Soubor", 14005, 68, 35, 160, 10 LTEXT "OtevÃrat v:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "UmÃstÄnÃ:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Velikost:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/da-DK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/da-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/da-DK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/da-DK.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -225,7 +225,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/de-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/de-DE.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -239,7 +239,9 @@ LTEXT "Dateityp:", 14004, 8, 35, 50, 10 LTEXT "Datei", 14005, 68, 35, 160, 10 LTEXT "Ãffnen mit:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Pfad:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "GröÃe:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/el-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/el-GR.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "ΤÏÏÎ¿Ï Î±ÏÏÎµÎ¯Î¿Ï :", 14004, 10, 30, 50, 10 LTEXT "ÎÏÏείο", 14005, 70, 30, 150, 10 LTEXT "Îνοίγει με:", 14006, 10, 40, 50, 10 - EDITTEXT 14007, 70, 40, 150, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "ÎÎÏη:", 14008, 10, 55, 45, 10 EDITTEXT 14009, 70, 55, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "ÎÎγεθοÏ:",14010, 10, 65, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/en-GB.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/en-GB.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/en-GB.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/en-US.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,9 +236,14 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + + //ID, left, top, width, height + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL + LTEXT "Location:", 14008, 8, 72, 45, 10 - EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL + EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY| NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 EDITTEXT 14011, 68, 93, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER LTEXT "Created:", 14014, 8, 118, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/es-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/es-ES.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -239,7 +239,9 @@ LTEXT "Tipo de archivo:", 14004, 8, 35, 55, 10 LTEXT "Archivo", 14005, 68, 35, 160, 10 LTEXT "Se abre con:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Ubicación:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Tamaño:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/fi-FI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fi-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/fi-FI.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/fi-FI.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fr-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/fr-FR.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -240,7 +240,9 @@ LTEXT "Type de fichier :", 14004, 8, 35, 50, 10 LTEXT "Fichier", 14005, 68, 35, 160, 10 LTEXT "Ouvrir avec :", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Localisation :", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Taille :", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/hu-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/hu-HU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/hu-HU.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -239,7 +239,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/it-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/it-IT.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -237,7 +237,9 @@ LTEXT "Tipo di file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Apri con:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Posizione:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Dimensione:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ja-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ja-JP.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "ãã¡ã¤ã«ã®ç¨®é¡:", 14004, 8, 35, 50, 10 LTEXT "ãã¡ã»Cã«", 14005, 68, 35, 160, 10 LTEXT "å®è¡ããã°ã©ã :", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "å ´æ:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "ãµã¤ãº:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ko-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ko-KR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ko-KR.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/nl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/nl-NL.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/no-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/no-NO.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -237,7 +237,9 @@ LTEXT "Filtype:", 14004, 8, 35, 50, 10 LTEXT "Fil", 14005, 68, 35, 160, 10 LTEXT "à pne med:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Lokalisjon:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Størrelse:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -244,7 +244,9 @@ LTEXT "Typ pliku:", 14004, 8, 35, 50, 10 LTEXT "Plik", 14005, 68, 35, 160, 10 LTEXT "Otwierany za pomocÄ :", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "ZmieÅ...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Lokalizacja:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Rozmiar:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pt-BR.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -238,7 +238,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/pt-PT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pt-PT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pt-PT.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -239,7 +239,9 @@ LTEXT "Tipo de Ficheiro:", 14004, 8, 35, 50, 10 LTEXT "Ficheiro", 14005, 68, 35, 160, 10 LTEXT "Abre com::", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Localização:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Tamanho:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ro-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ro-RO.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -239,7 +239,9 @@ LTEXT "Tip fiÈier:", 14004, 8, 35, 50, 10 LTEXT "FiÈier", 14005, 68, 35, 160, 10 LTEXT "Se deschide cu:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "LocaÈie:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "MÄrime:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ru-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ru-RU.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Тип Ñайла:", 14004, 8, 35, 50, 10 LTEXT "Ñайл", 14005, 68, 35, 160, 10 LTEXT "ÐÑиложение:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "РазмеÑение:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "РазмеÑ:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sk-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sk-SK.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -242,7 +242,9 @@ LTEXT "Typ súboru:", 14004, 8, 35, 50, 10 LTEXT "Súbor", 14005, 68, 35, 160, 10 LTEXT "Otvoriť programom:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Umiestnenie:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Veľkosť:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/sl-SI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sl-SI.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sl-SI.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sv-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sv-SE.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/tr-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/tr-TR.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/uk-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/uk-UA.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -238,7 +238,9 @@ LTEXT "Тип ÑайлÑ:", 14004, 8, 35, 50, 10 LTEXT "Файл", 14005, 68, 35, 160, 10 LTEXT "ÐодаÑок:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "РозÑаÑÑваннÑ:", 14008, 8, 72, 50, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "РозмÑÑ:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/zh-CN.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -225,7 +225,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Modified: trunk/reactos/dll/win32/shell32/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/zh-TW.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -236,7 +236,9 @@ LTEXT "Type of file:", 14004, 8, 35, 50, 10 LTEXT "File", 14005, 68, 35, 160, 10 LTEXT "Opens with:", 14006, 8, 53, 50, 10 - EDITTEXT 14007, 68, 53, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER + ICON "", 140061, 63, 52, 11, 10, WS_VISIBLE + PUSHBUTTON "Change...", 140062, 158, 50, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + EDITTEXT 14007, 77, 53, 77, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Location:", 14008, 8, 72, 45, 10 EDITTEXT 14009, 68, 72, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | ES_AUTOHSCROLL LTEXT "Size:", 14010, 8, 93, 45, 10 Added: trunk/reactos/dll/win32/shell32/res/rgs/shelldrvdefext.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/res/rgs/shelldrvdefext.rgs (added) +++ trunk/reactos/dll/win32/shell32/res/rgs/shelldrvdefext.rgs [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -1,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {5F5295E0-429F-1069-A2E2-08002B30309D} = s 'Drive Default Extension' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} Modified: trunk/reactos/dll/win32/shell32/rgs_res.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/rgs_res.…
============================================================================== --- trunk/reactos/dll/win32/shell32/rgs_res.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/rgs_res.rc [iso-8859-1] Wed Jan 11 22:08:04 2012 @@ -22,3 +22,4 @@ IDR_STARTMENU REGISTRY "res\\rgs\\startmenu.rgs" IDR_OPENWITHMENU REGISTRY "res\\rgs\\openwithmenu.rgs" IDR_FILEDEFEXT REGISTRY "res\\rgs\\shellfiledefext.rgs" +IDR_DRVDEFEXT REGISTRY "res\\rgs\\shelldrvdefext.rgs"
12 years, 11 months
1
0
0
0
[rharabien] 54910: [SHELL32] - Move drive default property sheet pages to CDrvDefExt shell extension - Read cleanup mgr path from registry - Fix default extension being released in wrong moment
by rharabien@svn.reactos.org
Author: rharabien Date: Wed Jan 11 21:58:47 2012 New Revision: 54910 URL:
http://svn.reactos.org/svn/reactos?rev=54910&view=rev
Log: [SHELL32] - Move drive default property sheet pages to CDrvDefExt shell extension - Read cleanup mgr path from registry - Fix default extension being released in wrong moment Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt trunk/reactos/dll/win32/shell32/drive.cpp trunk/reactos/dll/win32/shell32/drvdefext.cpp trunk/reactos/dll/win32/shell32/drvdefext.h trunk/reactos/dll/win32/shell32/filedefext.cpp trunk/reactos/dll/win32/shell32/fprop.cpp trunk/reactos/dll/win32/shell32/shell32.rbuild Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Wed Jan 11 21:58:47 2012 @@ -85,7 +85,7 @@ uuid recyclebin) -add_delay_importlibs(shell32 ole32 version) +add_delay_importlibs(shell32 ole32 version fmifs) add_importlibs(shell32 advapi32 Modified: trunk/reactos/dll/win32/shell32/drive.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drive.cp…
============================================================================== --- trunk/reactos/dll/win32/shell32/drive.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/drive.cpp [iso-8859-1] Wed Jan 11 21:58:47 2012 @@ -25,156 +25,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -typedef enum -{ - HWPD_STANDARDLIST = 0, - HWPD_LARGELIST, - HWPD_MAX = HWPD_LARGELIST -} HWPAGE_DISPLAYMODE, *PHWPAGE_DISPLAYMODE; - -typedef -BOOLEAN -(NTAPI *INITIALIZE_FMIFS)( - IN PVOID hinstDll, - IN DWORD dwReason, - IN PVOID reserved -); -typedef -BOOLEAN -(NTAPI *QUERY_AVAILABLEFSFORMAT)( - IN DWORD Index, - IN OUT PWCHAR FileSystem, - OUT UCHAR* Major, - OUT UCHAR* Minor, - OUT BOOLEAN* LastestVersion -); -typedef -BOOLEAN -(NTAPI *ENABLEVOLUMECOMPRESSION)( - IN PWCHAR DriveRoot, - IN USHORT Compression -); - -typedef -VOID -(NTAPI *FORMAT_EX)( - IN PWCHAR DriveRoot, - IN FMIFS_MEDIA_FLAG MediaFlag, - IN PWCHAR Format, - IN PWCHAR Label, - IN BOOLEAN QuickFormat, - IN ULONG ClusterSize, - IN PFMIFSCALLBACK Callback -); - -typedef -VOID -(NTAPI *CHKDSK)( - IN PWCHAR DriveRoot, - IN PWCHAR Format, - IN BOOLEAN CorrectErrors, - IN BOOLEAN Verbose, - IN BOOLEAN CheckOnlyIfDirty, - IN BOOLEAN ScanDrive, - IN PVOID Unused2, - IN PVOID Unused3, - IN PFMIFSCALLBACK Callback -); - - typedef struct { WCHAR Drive; UINT Options; - HMODULE hLibrary; - QUERY_AVAILABLEFSFORMAT QueryAvailableFileSystemFormat; - FORMAT_EX FormatEx; - ENABLEVOLUMECOMPRESSION EnableVolumeCompression; - CHKDSK Chkdsk; UINT Result; } FORMAT_DRIVE_CONTEXT, *PFORMAT_DRIVE_CONTEXT; EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj); -EXTERN_C HWND WINAPI -DeviceCreateHardwarePageEx(HWND hWndParent, - LPGUID lpGuids, - UINT uNumberOfGuids, - HWPAGE_DISPLAYMODE DisplayMode); - HPROPSHEETPAGE SH_CreatePropertySheetPage(LPCSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle); - -static const GUID GUID_DEVCLASS_DISKDRIVE = {0x4d36e967L, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}; - - -static VOID -GetDriveNameWithLetter(LPWSTR szText, UINT cchTextMax, WCHAR wchDrive) -{ - WCHAR szDrive[] = L"C:\\"; - DWORD dwMaxComp, dwFileSys, cchText = 0; - - szDrive[0] = wchDrive; - if (GetVolumeInformationW(szDrive, szText, cchTextMax, NULL, &dwMaxComp, &dwFileSys, NULL, 0)) - { - cchText = wcslen(szText); - if (cchText == 0) - { - /* load default volume label */ - cchText = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szText, cchTextMax); - } - } - - StringCchPrintfW(szText + cchText, cchTextMax - cchText, L" (%c)", wchDrive); -} - -static VOID -InitializeChkDskDialog(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) -{ - WCHAR szText[100]; - UINT Length; - SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pContext); - - Length = GetWindowTextW(hwndDlg, szText, sizeof(szText) / sizeof(WCHAR)); - szText[Length] = L' '; - GetDriveNameWithLetter(&szText[Length + 1], (sizeof(szText) / sizeof(WCHAR)) - Length - 1, pContext->Drive); - SetWindowText(hwndDlg, szText); -} - -static HWND ChkdskDrvDialog = NULL; -static BOOLEAN bChkdskSuccess = FALSE; - -static BOOLEAN NTAPI -ChkdskCallback( - IN CALLBACKCOMMAND Command, - IN ULONG SubAction, - IN PVOID ActionInfo) -{ - PDWORD Progress; - PBOOLEAN pSuccess; - switch(Command) - { - case PROGRESS: - Progress = (PDWORD)ActionInfo; - SendDlgItemMessageW(ChkdskDrvDialog, 14002, PBM_SETPOS, (WPARAM)*Progress, 0); - break; - case DONE: - pSuccess = (PBOOLEAN)ActionInfo; - bChkdskSuccess = (*pSuccess); - break; - - case VOLUMEINUSE: - case INSUFFICIENTRIGHTS: - case FSNOTSUPPORTED: - case CLUSTERSIZETOOSMALL: - bChkdskSuccess = FALSE; - FIXME("\n"); - break; - - default: - break; - } - - return TRUE; -} static BOOL GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes) @@ -240,507 +99,13 @@ return TRUE; } -static VOID -ChkDskNow(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) -{ - DWORD ClusterSize = 0; - WCHAR szFs[30]; - WCHAR szDrive[] = L"C:\\"; - ULARGE_INTEGER TotalNumberOfFreeBytes, FreeBytesAvailableUser; - BOOLEAN bCorrectErrors = FALSE, bScanDrive = FALSE; - - szDrive[0] = pContext->Drive; - if(!GetVolumeInformationW(szDrive, NULL, 0, NULL, NULL, NULL, szFs, sizeof(szFs) / sizeof(WCHAR))) - { - FIXME("failed to get drive fs type\n"); - return; - } - - if (!GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfFreeBytes, NULL)) - { - FIXME("failed to get drive space type\n"); - return; - } - - if (!GetDefaultClusterSize(szFs, &ClusterSize, &TotalNumberOfFreeBytes)) - { - FIXME("invalid cluster size\n"); - return; - } - - if (SendDlgItemMessageW(hwndDlg, 14000, BM_GETCHECK, 0, 0) == BST_CHECKED) - bCorrectErrors = TRUE; - - if (SendDlgItemMessageW(hwndDlg, 14001, BM_GETCHECK, 0, 0) == BST_CHECKED) - bScanDrive = TRUE; - - ChkdskDrvDialog = hwndDlg; - bChkdskSuccess = FALSE; - SendDlgItemMessageW(hwndDlg, 14002, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); - pContext->Chkdsk(szDrive, szFs, bCorrectErrors, TRUE, FALSE, bScanDrive, NULL, NULL, ChkdskCallback); - - ChkdskDrvDialog = NULL; - pContext->Result = bChkdskSuccess; - bChkdskSuccess = FALSE; -} - -static INT_PTR CALLBACK -ChkDskDlg( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - PFORMAT_DRIVE_CONTEXT pContext; - switch(uMsg) - { - case WM_INITDIALOG: - SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam); - InitializeChkDskDialog(hwndDlg, (PFORMAT_DRIVE_CONTEXT)lParam); - return TRUE; - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDCANCEL: - EndDialog(hwndDlg, 0); - break; - case IDOK: - pContext = (PFORMAT_DRIVE_CONTEXT) GetWindowLongPtr(hwndDlg, DWLP_USER); - ChkDskNow(hwndDlg, pContext); - break; - } - break; - } - - return FALSE; -} - -static -ULONG -GetFreeBytesShare(ULONGLONG TotalNumberOfFreeBytes, ULONGLONG TotalNumberOfBytes) -{ - ULONGLONG Temp; - - if (TotalNumberOfFreeBytes == 0LL) - { - return 0; - } - - Temp = TotalNumberOfBytes / 100; - if (Temp >= TotalNumberOfFreeBytes) - { - return 1; - } - else - { - return (ULONG)(TotalNumberOfFreeBytes / Temp); - } -} - -static -VOID -PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT drawItem) -{ - HBRUSH hBrush; - - if (drawItem->CtlID == 14013) - { - hBrush = CreateSolidBrush(RGB(0, 0, 255)); - if (hBrush) - { - FillRect(drawItem->hDC, &drawItem->rcItem, hBrush); - DeleteObject((HGDIOBJ)hBrush); - } - } - else if (drawItem->CtlID == 14014) - { - hBrush = CreateSolidBrush(RGB(255, 0, 255)); - if (hBrush) - { - FillRect(drawItem->hDC, &drawItem->rcItem, hBrush); - DeleteObject((HGDIOBJ)hBrush); - } - } - else if (drawItem->CtlID == 14015) - { - HBRUSH hBlueBrush; - HBRUSH hMagBrush; - RECT rect; - LONG horzsize; - LONGLONG Result; - WCHAR szBuffer[20]; - - hBlueBrush = CreateSolidBrush(RGB(0, 0, 255)); - hMagBrush = CreateSolidBrush(RGB(255, 0, 255)); - - GetDlgItemTextW(hwndDlg, 14006, szBuffer, 20); - Result = _wtoi(szBuffer); - - CopyRect(&rect, &drawItem->rcItem); - horzsize = rect.right - rect.left; - Result = (Result * horzsize) / 100; - - rect.right = drawItem->rcItem.right - Result; - FillRect(drawItem->hDC, &rect, hBlueBrush); - rect.left = rect.right; - rect.right = drawItem->rcItem.right; - FillRect(drawItem->hDC, &rect, hMagBrush); - DeleteObject(hBlueBrush); - DeleteObject(hMagBrush); - } -} - -static -VOID -InitializeGeneralDriveDialog(HWND hwndDlg, WCHAR *szDrive) -{ - WCHAR wszVolumeName[MAX_PATH+1] = {0}; - WCHAR wszFileSystem[MAX_PATH+1] = {0}; - WCHAR wszFormat[50]; - WCHAR wszBuf[128]; - BOOL bRet; - UINT DriveType; - ULARGE_INTEGER FreeBytesAvailable; - ULARGE_INTEGER TotalNumberOfFreeBytes; - ULARGE_INTEGER TotalNumberOfBytes; - - bRet = GetVolumeInformationW(szDrive, wszVolumeName, _countof(wszVolumeName), NULL, NULL, NULL, wszFileSystem, _countof(wszFileSystem)); - if (bRet) - { - /* set volume label */ - SetDlgItemTextW(hwndDlg, 14000, wszVolumeName); - - /* set filesystem type */ - SetDlgItemTextW(hwndDlg, 14002, wszFileSystem); - } - - DriveType = GetDriveTypeW(szDrive); - if (DriveType == DRIVE_FIXED || DriveType == DRIVE_CDROM) - { - if(GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) - { - ULONG SpacePercent; - HANDLE hVolume; - DWORD BytesReturned = 0; - - swprintf(wszBuf, L"\\\\.\\%c:", towupper(szDrive[0])); - hVolume = CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); - if (hVolume != INVALID_HANDLE_VALUE) - { - bRet = DeviceIoControl(hVolume, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (LPVOID)&TotalNumberOfBytes, sizeof(ULARGE_INTEGER), &BytesReturned, NULL); - if (bRet && StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14007, wszBuf); - - CloseHandle(hVolume); - } - - TRACE("wszBuf %s hVolume %p bRet %d LengthInformation %ul BytesReturned %d\n", debugstr_w(wszBuf), hVolume, bRet, TotalNumberOfBytes.QuadPart, BytesReturned); - - if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14003, wszBuf); - - if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14005, wszBuf); - - SpacePercent = GetFreeBytesShare(TotalNumberOfFreeBytes.QuadPart, TotalNumberOfBytes.QuadPart); - /* set free bytes percentage */ - swprintf(wszBuf, L"%u%%", SpacePercent); - SetDlgItemTextW(hwndDlg, 14006, wszBuf); - /* store used share amount */ - SpacePercent = 100 - SpacePercent; - swprintf(wszBuf, L"%u%%", SpacePercent); - SetDlgItemTextW(hwndDlg, 14004, wszBuf); - if (DriveType == DRIVE_FIXED) - { - if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14001, wszBuf); - } - else /* DriveType == DRIVE_CDROM) */ - { - if (LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetDlgItemTextW(hwndDlg, 14001, wszBuf); - } - } - } - /* set drive description */ - GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat)); - swprintf(wszBuf, wszFormat, szDrive); - SetDlgItemTextW(hwndDlg, 14009, wszBuf); -} - -static INT_PTR CALLBACK -DriveGeneralDlg( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - switch(uMsg) - { - case WM_INITDIALOG: - { - LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam; - if (ppsp == NULL) - break; - - SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam); - InitializeGeneralDriveDialog(hwndDlg, (LPWSTR)ppsp->lParam); - return TRUE; - } - case WM_DRAWITEM: - { - LPDRAWITEMSTRUCT drawItem = (LPDRAWITEMSTRUCT)lParam; - - if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015) - { - PaintStaticControls(hwndDlg, drawItem); - return TRUE; - } - break; - } - - case WM_COMMAND: - if (LOWORD(wParam) == 14010) /* Disk Cleanup */ - { - UINT cchSysPath; - STARTUPINFOW si; - PROCESS_INFORMATION pi; - WCHAR wszPath[MAX_PATH]; - LPWSTR pwszDrive = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER); - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - cchSysPath = GetSystemDirectoryW(wszPath, MAX_PATH); - if (!cchSysPath) - break; - StringCchPrintfW(wszPath + cchSysPath, _countof(wszPath) - cchSysPath, L"\\cleanmgr.exe /D %s", pwszDrive); - if (CreateProcessW(NULL, wszPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - } - break; - case WM_NOTIFY: - if (LOWORD(wParam) == 14000) // Label - { - if (HIWORD(wParam) == EN_CHANGE) - { - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - else if (((LPNMHDR)lParam)->hwndFrom == GetParent(hwndDlg)) - { - /* Property Sheet */ - LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; - - if (lppsn->hdr.code == PSN_APPLY) - { - LPWSTR pwszDrive = (LPWSTR)GetWindowLongPtr(hwndDlg, DWLP_USER); - WCHAR wszBuf[256]; - - if (pwszDrive && GetDlgItemTextW(hwndDlg, 14000, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) - SetVolumeLabelW(pwszDrive, wszBuf); - SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); - return TRUE; - } - } - break; - - default: - break; - } - - return FALSE; -} - -static BOOL -InitializeFmifsLibrary(PFORMAT_DRIVE_CONTEXT pContext) -{ - INITIALIZE_FMIFS InitFmifs; - BOOLEAN ret; - HMODULE hLibrary; - - hLibrary = pContext->hLibrary = LoadLibraryW(L"fmifs.dll"); - if(!hLibrary) - { - ERR("failed to load fmifs.dll\n"); - return FALSE; - } - - InitFmifs = (INITIALIZE_FMIFS)GetProcAddress(hLibrary, "InitializeFmIfs"); - if (!InitFmifs) - { - ERR("InitializeFmIfs export is missing\n"); - FreeLibrary(hLibrary); - return FALSE; - } - - ret = (*InitFmifs)(NULL, DLL_PROCESS_ATTACH, NULL); - if (!ret) - { - ERR("fmifs failed to initialize\n"); - FreeLibrary(hLibrary); - return FALSE; - } - - pContext->QueryAvailableFileSystemFormat = (QUERY_AVAILABLEFSFORMAT)GetProcAddress(hLibrary, "QueryAvailableFileSystemFormat"); - if (!pContext->QueryAvailableFileSystemFormat) - { - ERR("QueryAvailableFileSystemFormat export is missing\n"); - FreeLibrary(hLibrary); - return FALSE; - } - - pContext->FormatEx = (FORMAT_EX) GetProcAddress(hLibrary, "FormatEx"); - if (!pContext->FormatEx) - { - ERR("FormatEx export is missing\n"); - FreeLibrary(hLibrary); - return FALSE; - } - - pContext->EnableVolumeCompression = (ENABLEVOLUMECOMPRESSION) GetProcAddress(hLibrary, "EnableVolumeCompression"); - if (!pContext->FormatEx) - { - ERR("EnableVolumeCompression export is missing\n"); - FreeLibrary(hLibrary); - return FALSE; - } - - pContext->Chkdsk = (CHKDSK) GetProcAddress(hLibrary, "Chkdsk"); - if (!pContext->Chkdsk) - { - ERR("Chkdsk export is missing\n"); - FreeLibrary(hLibrary); - return FALSE; - } - - return TRUE; -} - -static INT_PTR CALLBACK -DriveExtraDlg( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - { - LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam; - SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam); - return TRUE; - } - case WM_COMMAND: - { - STARTUPINFOW si; - PROCESS_INFORMATION pi; - WCHAR szPath[MAX_PATH + 10]; - WCHAR szArg[MAX_PATH]; - WCHAR *szDrive; - DWORD dwSize; - FORMAT_DRIVE_CONTEXT Context; - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - - szDrive = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER); - switch(LOWORD(wParam)) - { - case 14000: - if (InitializeFmifsLibrary(&Context)) - { - Context.Drive = szDrive[0]; - DialogBoxParamW(shell32_hInstance, L"CHKDSK_DLG", hwndDlg, ChkDskDlg, (LPARAM)&Context); - FreeLibrary(Context.hLibrary); - } - break; - case 14001: - dwSize = sizeof(szPath); - if (RegGetValueW(HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\DefragPath", - NULL, - RRF_RT_REG_EXPAND_SZ, - NULL, - (PVOID)szPath, - &dwSize) == ERROR_SUCCESS) - { - swprintf(szArg, szPath, szDrive[0]); - if (!GetSystemDirectoryW(szPath, MAX_PATH)) - break; - szDrive = PathAddBackslashW(szPath); - if (!szDrive) - break; - - wcscat(szDrive, L"mmc.exe"); - if (CreateProcessW(szPath, szArg, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - } - break; - case 14002: - dwSize = sizeof(szPath); - if (RegGetValueW(HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\BackupPath", - NULL, - RRF_RT_REG_EXPAND_SZ, - NULL, - (PVOID)szPath, - &dwSize) == ERROR_SUCCESS) - { - if (CreateProcessW(szPath, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - } - } - break; - } - } - return FALSE; -} - -static INT_PTR CALLBACK -DriveHardwareDlg( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(wParam); - - switch(uMsg) - { - case WM_INITDIALOG: - { - GUID Guid = GUID_DEVCLASS_DISKDRIVE; - - /* create the hardware page */ - DeviceCreateHardwarePageEx(hwndDlg, &Guid, 1, HWPD_STANDARDLIST); - break; - } - } - - return FALSE; -} - -static HRESULT CALLBACK -AddPropSheetPageProc(HPROPSHEETPAGE hpage, LPARAM lParam) +static BOOL CALLBACK +AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam) { PROPSHEETHEADER *ppsh = (PROPSHEETHEADER *)lParam; - if (ppsh != NULL && ppsh->nPages < MAX_PROPERTY_SHEET_PAGE) - { - ppsh->phpage[ppsh->nPages++] = hpage; + if (ppsh->nPages < MAX_PROPERTY_SHEET_PAGE) + { + ppsh->phpage[ppsh->nPages++] = hPage; return TRUE; } return FALSE; @@ -758,18 +123,10 @@ { HPSXA hpsx = NULL; HPROPSHEETPAGE hpsp[MAX_PROPERTY_SHEET_PAGE]; + WCHAR wszName[256]; PROPSHEETHEADERW psh; - HWND hwnd; - UINT i, DriveType; - WCHAR wszName[256]; - CComPtr<IDataObject> pDataObj; - - static const DRIVE_PROP_PAGE PropPages[] = - { - { "DRIVE_GENERAL_DLG", DriveGeneralDlg, -1}, - { "DRIVE_EXTRA_DLG", DriveExtraDlg, DRIVE_FIXED}, - { "DRIVE_HARDWARE_DLG", DriveHardwareDlg, -1} - }; + HRESULT hr; + CComObject<CDrvDefExt> *pDrvDefExt = NULL; ZeroMemory(&psh, sizeof(PROPSHEETHEADERW)); psh.dwSize = sizeof(PROPSHEETHEADERW); @@ -785,36 +142,40 @@ if (wszName[0] == UNICODE_NULL) { /* FIXME: check if disk is a really a local hdd */ - i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszName, sizeof(wszName) / sizeof(WCHAR) - 6); + UINT i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszName, sizeof(wszName) / sizeof(WCHAR) - 6); StringCchPrintf(wszName + i, sizeof(wszName) / sizeof(WCHAR) - i, L" (%s)", pwszDrive); } } - DriveType = GetDriveTypeW(pwszDrive); - for (i = 0; i < _countof(PropPages); i++) - { - if (PropPages[i].DriveType == (UINT)-1 || PropPages[i].DriveType == DriveType) - { - HPROPSHEETPAGE hprop = SH_CreatePropertySheetPage(PropPages[i].resname, PropPages[i].dlgproc, (LPARAM)pwszDrive, NULL); - if (hprop) + CComPtr<IDataObject> pDataObj; + hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_IDataObject, (LPVOID *)&pDataObj); + + if (SUCCEEDED(hr)) + { + ATLTRY(pDrvDefExt = new CComObject<CDrvDefExt>); + if (pDrvDefExt) + { + hr = pDrvDefExt->Initialize(pidlFolder, pDataObj, NULL); + if (SUCCEEDED(hr)) { - hpsp[psh.nPages] = hprop; - psh.nPages++; - } - } - } - - if (SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_IDataObject, (void **)&pDataObj) == S_OK) - { - hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Drive", MAX_PROPERTY_SHEET_PAGE - _countof(PropPages), pDataObj); + hr = pDrvDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&psh); + if (FAILED(hr)) + ERR("AddPages failed\n"); + } else + ERR("Initialize failed\n"); + } + + hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Drive", MAX_PROPERTY_SHEET_PAGE, pDataObj); if (hpsx) - SHAddFromPropSheetExtArray(hpsx, (LPFNADDPROPSHEETPAGE)AddPropSheetPageProc, (LPARAM)&psh); - } - - hwnd = (HWND)PropertySheetW(&psh); + SHAddFromPropSheetExtArray(hpsx, (LPFNADDPROPSHEETPAGE)AddPropSheetPageCallback, (LPARAM)&psh); + } + + HWND hwnd = (HWND)PropertySheetW(&psh); if (hpsx) SHDestroyPropSheetExtArray(hpsx); + if (pDrvDefExt) + pDrvDefExt->Release(); if (!hwnd) return FALSE; @@ -982,7 +343,7 @@ dwDefault = 0; hwndFileSystems = GetDlgItem(hwndDlg, 28677); - while(pContext->QueryAvailableFileSystemFormat(dwIndex, szText, &uMajor, &uMinor, &Latest)) + while(QueryAvailableFileSystemFormat(dwIndex, szText, &uMajor, &uMinor, &Latest)) { if (!wcsicmp(szText, szFs)) dwDefault = dwIndex; @@ -1119,13 +480,13 @@ */ FormatDrvDialog = hwndDlg; - pContext->FormatEx(szDrive, - FMIFS_HARDDISK, /* FIXME */ - szFileSys, - szLabel, - QuickFormat, - ClusterSize, - FormatExCB); + FormatEx(szDrive, + FMIFS_HARDDISK, /* FIXME */ + szFileSys, + szLabel, + QuickFormat, + ClusterSize, + FormatExCB); ShowWindow(hDlgCtrl, SW_HIDE); FormatDrvDialog = NULL; @@ -1190,18 +551,11 @@ TRACE("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options); - if (!InitializeFmifsLibrary(&Context)) - { - ERR("failed to initialize fmifs\n"); - return SHFMT_NOFORMAT; - } - Context.Drive = drive; Context.Options = options; result = DialogBoxParamW(shell32_hInstance, L"FORMAT_DLG", hwnd, FormatDriveDlg, (LPARAM)&Context); - FreeLibrary(Context.hLibrary); return result; } Modified: trunk/reactos/dll/win32/shell32/drvdefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefex…
============================================================================== --- trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] Wed Jan 11 21:58:47 2012 @@ -1,1 +1,602 @@ - +/* + * Provides default drive shell extension + * + * Copyright 2005 Johannes Anderwald + * Copyright 2012 Rafal Harabien + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <precomp.h> + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +static const GUID GUID_DEVCLASS_DISKDRIVE = {0x4d36e967L, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}; + +typedef enum +{ + HWPD_STANDARDLIST = 0, + HWPD_LARGELIST, + HWPD_MAX = HWPD_LARGELIST +} HWPAGE_DISPLAYMODE, *PHWPAGE_DISPLAYMODE; + +EXTERN_C HWND WINAPI +DeviceCreateHardwarePageEx(HWND hWndParent, + LPGUID lpGuids, + UINT uNumberOfGuids, + HWPAGE_DISPLAYMODE DisplayMode); + +static VOID +GetDriveNameWithLetter(LPWSTR pwszText, UINT cchTextMax, LPCWSTR pwszDrive) +{ + DWORD dwMaxComp, dwFileSys, cchText = 0; + + if (GetVolumeInformationW(pwszDrive, pwszText, cchTextMax, NULL, &dwMaxComp, &dwFileSys, NULL, 0)) + { + cchText = wcslen(pwszText); + if (cchText == 0) + { + /* load default volume label */ + cchText = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, pwszText, cchTextMax); + } + } + + StringCchPrintfW(pwszText + cchText, cchTextMax - cchText, L" (%c)", pwszDrive[0]); +} + +static VOID +InitializeChkDskDialog(HWND hwndDlg, LPCWSTR pwszDrive) +{ + WCHAR wszText[100]; + UINT Length; + SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pwszDrive); + + Length = GetWindowTextW(hwndDlg, wszText, sizeof(wszText) / sizeof(WCHAR)); + wszText[Length] = L' '; + GetDriveNameWithLetter(&wszText[Length + 1], (sizeof(wszText) / sizeof(WCHAR)) - Length - 1, pwszDrive); + SetWindowText(hwndDlg, wszText); +} + +static HWND hChkdskDrvDialog = NULL; +static BOOLEAN bChkdskSuccess = FALSE; + +static BOOLEAN NTAPI +ChkdskCallback( + IN CALLBACKCOMMAND Command, + IN ULONG SubAction, + IN PVOID ActionInfo) +{ + PDWORD Progress; + PBOOLEAN pSuccess; + switch(Command) + { + case PROGRESS: + Progress = (PDWORD)ActionInfo; + SendDlgItemMessageW(hChkdskDrvDialog, 14002, PBM_SETPOS, (WPARAM)*Progress, 0); + break; + case DONE: + pSuccess = (PBOOLEAN)ActionInfo; + bChkdskSuccess = (*pSuccess); + break; + + case VOLUMEINUSE: + case INSUFFICIENTRIGHTS: + case FSNOTSUPPORTED: + case CLUSTERSIZETOOSMALL: + bChkdskSuccess = FALSE; + FIXME("\n"); + break; + + default: + break; + } + + return TRUE; +} + +static VOID +ChkDskNow(HWND hwndDlg, LPCWSTR pwszDrive) +{ + //DWORD ClusterSize = 0; + WCHAR wszFs[30]; + ULARGE_INTEGER TotalNumberOfFreeBytes, FreeBytesAvailableUser; + BOOLEAN bCorrectErrors = FALSE, bScanDrive = FALSE; + + if(!GetVolumeInformationW(pwszDrive, NULL, 0, NULL, NULL, NULL, wszFs, _countof(wszFs))) + { + FIXME("failed to get drive fs type\n"); + return; + } + + if (!GetDiskFreeSpaceExW(pwszDrive, &FreeBytesAvailableUser, &TotalNumberOfFreeBytes, NULL)) + { + FIXME("failed to get drive space type\n"); + return; + } + + /*if (!GetDefaultClusterSize(wszFs, &ClusterSize, &TotalNumberOfFreeBytes)) + { + FIXME("invalid cluster size\n"); + return; + }*/ + + if (SendDlgItemMessageW(hwndDlg, 14000, BM_GETCHECK, 0, 0) == BST_CHECKED) + bCorrectErrors = TRUE; + + if (SendDlgItemMessageW(hwndDlg, 14001, BM_GETCHECK, 0, 0) == BST_CHECKED) + bScanDrive = TRUE; + + hChkdskDrvDialog = hwndDlg; + bChkdskSuccess = FALSE; + SendDlgItemMessageW(hwndDlg, 14002, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); + Chkdsk((LPWSTR)pwszDrive, (LPWSTR)wszFs, bCorrectErrors, TRUE, FALSE, bScanDrive, NULL, NULL, ChkdskCallback); // FIXME: casts + + hChkdskDrvDialog = NULL; + bChkdskSuccess = FALSE; +} + +static INT_PTR CALLBACK +ChkDskDlg( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam); + InitializeChkDskDialog(hwndDlg, (LPCWSTR)lParam); + return TRUE; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDCANCEL: + EndDialog(hwndDlg, 0); + break; + case IDOK: + { + LPCWSTR pwszDrive = (LPCWSTR)GetWindowLongPtr(hwndDlg, DWLP_USER); + ChkDskNow(hwndDlg, pwszDrive); + break; + } + } + break; + } + + return FALSE; +} + +VOID +CDrvDefExt::PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem) +{ + HBRUSH hBrush; + + if (pDrawItem->CtlID == 14013) + { + hBrush = CreateSolidBrush(RGB(0, 0, 255)); + if (hBrush) + { + FillRect(pDrawItem->hDC, &pDrawItem->rcItem, hBrush); + DeleteObject((HGDIOBJ)hBrush); + } + } + else if (pDrawItem->CtlID == 14014) + { + hBrush = CreateSolidBrush(RGB(255, 0, 255)); + if (hBrush) + { + FillRect(pDrawItem->hDC, &pDrawItem->rcItem, hBrush); + DeleteObject((HGDIOBJ)hBrush); + } + } + else if (pDrawItem->CtlID == 14015) + { + HBRUSH hBlueBrush; + HBRUSH hMagBrush; + RECT rect; + LONG horzsize; + LONGLONG Result; + WCHAR szBuffer[20]; + + hBlueBrush = CreateSolidBrush(RGB(0, 0, 255)); + hMagBrush = CreateSolidBrush(RGB(255, 0, 255)); + + GetDlgItemTextW(hwndDlg, 14006, szBuffer, 20); + Result = _wtoi(szBuffer); + + CopyRect(&rect, &pDrawItem->rcItem); + horzsize = rect.right - rect.left; + Result = (Result * horzsize) / 100; + + rect.right = pDrawItem->rcItem.right - Result; + FillRect(pDrawItem->hDC, &rect, hBlueBrush); + rect.left = rect.right; + rect.right = pDrawItem->rcItem.right; + FillRect(pDrawItem->hDC, &rect, hMagBrush); + DeleteObject(hBlueBrush); + DeleteObject(hMagBrush); + } +} + +VOID +CDrvDefExt::InitGeneralPage(HWND hwndDlg) +{ + WCHAR wszVolumeName[MAX_PATH+1] = {0}; + WCHAR wszFileSystem[MAX_PATH+1] = {0}; + WCHAR wszBuf[128]; + BOOL bRet; + + bRet = GetVolumeInformationW(m_wszDrive, wszVolumeName, _countof(wszVolumeName), NULL, NULL, NULL, wszFileSystem, _countof(wszFileSystem)); + if (bRet) + { + /* set volume label */ + SetDlgItemTextW(hwndDlg, 14000, wszVolumeName); + + /* set filesystem type */ + SetDlgItemTextW(hwndDlg, 14002, wszFileSystem); + } + + UINT DriveType = GetDriveTypeW(m_wszDrive); + if (DriveType == DRIVE_FIXED || DriveType == DRIVE_CDROM) + { + ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes; + if(GetDiskFreeSpaceExW(m_wszDrive, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) + { + ULONG SpacePercent; + HANDLE hVolume; + DWORD BytesReturned = 0; + + swprintf(wszBuf, L"\\\\.\\%c:", towupper(m_wszDrive[0])); + hVolume = CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); + if (hVolume != INVALID_HANDLE_VALUE) + { + bRet = DeviceIoControl(hVolume, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (LPVOID)&TotalNumberOfBytes, sizeof(ULARGE_INTEGER), &BytesReturned, NULL); + if (bRet && StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) + SetDlgItemTextW(hwndDlg, 14007, wszBuf); + + CloseHandle(hVolume); + } + + TRACE("wszBuf %s hVolume %p bRet %d LengthInformation %ul BytesReturned %d\n", debugstr_w(wszBuf), hVolume, bRet, TotalNumberOfBytes.QuadPart, BytesReturned); + + if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart - FreeBytesAvailable.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) + SetDlgItemTextW(hwndDlg, 14003, wszBuf); + + if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) + SetDlgItemTextW(hwndDlg, 14005, wszBuf); + + SpacePercent = (ULONG)(TotalNumberOfFreeBytes.QuadPart*100ull/TotalNumberOfBytes.QuadPart); + /* set free bytes percentage */ + swprintf(wszBuf, L"%u%%", SpacePercent); + SetDlgItemTextW(hwndDlg, 14006, wszBuf); + /* store used share amount */ + SpacePercent = 100 - SpacePercent; + swprintf(wszBuf, L"%u%%", SpacePercent); + SetDlgItemTextW(hwndDlg, 14004, wszBuf); + if (DriveType == DRIVE_FIXED) + { + if (LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) + SetDlgItemTextW(hwndDlg, 14001, wszBuf); + } + else /* DriveType == DRIVE_CDROM) */ + { + if (LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) + SetDlgItemTextW(hwndDlg, 14001, wszBuf); + } + } + } + /* set drive description */ + WCHAR wszFormat[50]; + GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat)); + swprintf(wszBuf, wszFormat, m_wszDrive); + SetDlgItemTextW(hwndDlg, 14009, wszBuf); +} + +INT_PTR CALLBACK +CDrvDefExt::GeneralPageProc( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + { + LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam; + if (ppsp == NULL) + break; + + CDrvDefExt *pDrvDefExt = (CDrvDefExt*)ppsp->lParam; + SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pDrvDefExt); + pDrvDefExt->InitGeneralPage(hwndDlg); + return TRUE; + } + case WM_DRAWITEM: + { + LPDRAWITEMSTRUCT pDrawItem = (LPDRAWITEMSTRUCT)lParam; + + if (pDrawItem->CtlID >= 14013 && pDrawItem->CtlID <= 14015) + { + CDrvDefExt::PaintStaticControls(hwndDlg, pDrawItem); + return TRUE; + } + break; + } + + case WM_COMMAND: + if (LOWORD(wParam) == 14010) /* Disk Cleanup */ + { + CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + WCHAR wszBuf[256]; + DWORD cbBuf = sizeof(wszBuf); + + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\CleanupPath", + NULL, + RRF_RT_REG_SZ, + NULL, + (PVOID)wszBuf, + &cbBuf) == ERROR_SUCCESS) + { + WCHAR wszCmd[MAX_PATH]; + + StringCbPrintfW(wszCmd, sizeof(wszCmd), wszBuf, pDrvDefExt->m_wszDrive[0]); + + if (ShellExecuteW(hwndDlg, NULL, wszCmd, NULL, NULL, SW_SHOW) <= (HINSTANCE)32) + ERR("Failed to create cleanup process %ls\n", wszCmd); + } + } + break; + case WM_NOTIFY: + if (LOWORD(wParam) == 14000) // Label + { + if (HIWORD(wParam) == EN_CHANGE) + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + else if (((LPNMHDR)lParam)->hwndFrom == GetParent(hwndDlg)) + { + /* Property Sheet */ + LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; + + if (lppsn->hdr.code == PSN_APPLY) + { + CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + WCHAR wszBuf[256]; + + if (GetDlgItemTextW(hwndDlg, 14000, wszBuf, sizeof(wszBuf) / sizeof(WCHAR))) + SetVolumeLabelW(pDrvDefExt->m_wszDrive, wszBuf); + SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); + return TRUE; + } + } + break; + + default: + break; + } + + return FALSE; +} + +INT_PTR CALLBACK +CDrvDefExt::ExtraPageProc( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam; + SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)ppsp->lParam); + return TRUE; + } + case WM_COMMAND: + { + WCHAR wszBuf[MAX_PATH]; + DWORD cbBuf = sizeof(wszBuf); + CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + + switch(LOWORD(wParam)) + { + case 14000: + DialogBoxParamW(shell32_hInstance, L"CHKDSK_DLG", hwndDlg, ChkDskDlg, (LPARAM)pDrvDefExt->m_wszDrive); + break; + case 14001: + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\DefragPath", + NULL, + RRF_RT_REG_SZ, + NULL, + (PVOID)wszBuf, + &cbBuf) == ERROR_SUCCESS) + { + WCHAR wszCmd[MAX_PATH]; + + StringCbPrintfW(wszCmd, sizeof(wszCmd), wszBuf, pDrvDefExt->m_wszDrive[0]); + + if (ShellExecuteW(hwndDlg, NULL, wszCmd, NULL, NULL, SW_SHOW) <= (HINSTANCE)32) + ERR("Failed to create defrag process %ls\n", wszCmd); + } + break; + case 14002: + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\BackupPath", + NULL, + RRF_RT_REG_EXPAND_SZ, + NULL, + (PVOID)wszBuf, + &cbBuf) == ERROR_SUCCESS) + { + if (ShellExecuteW(hwndDlg, NULL, wszBuf, NULL, NULL, SW_SHOW) <= (HINSTANCE)32) + ERR("Failed to create backup process %ls\n", wszBuf); + } + } + break; + } + } + return FALSE; +} + +INT_PTR CALLBACK +CDrvDefExt::HardwarePageProc( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + UNREFERENCED_PARAMETER(wParam); + + switch(uMsg) + { + case WM_INITDIALOG: + { + GUID Guid = GUID_DEVCLASS_DISKDRIVE; + + /* create the hardware page */ + DeviceCreateHardwarePageEx(hwndDlg, &Guid, 1, HWPD_STANDARDLIST); + break; + } + } + + return FALSE; +} + +CDrvDefExt::CDrvDefExt() +{ + m_wszDrive[0] = L'\0'; +} + +CDrvDefExt::~CDrvDefExt() +{ + +} + +HRESULT WINAPI +CDrvDefExt::Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID) +{ + FORMATETC format; + STGMEDIUM stgm; + HRESULT hr; + + TRACE("%p %p %p %p\n", this, pidlFolder, pDataObj, hkeyProgID); + + if (!pDataObj) + return E_FAIL; + + format.cfFormat = CF_HDROP; + format.ptd = NULL; + format.dwAspect = DVASPECT_CONTENT; + format.lindex = -1; + format.tymed = TYMED_HGLOBAL; + + hr = pDataObj->GetData(&format, &stgm); + if (FAILED(hr)) + return hr; + + if (!DragQueryFileW((HDROP)stgm.hGlobal, 0, m_wszDrive, _countof(m_wszDrive))) + { + ERR("DragQueryFileW failed\n"); + ReleaseStgMedium(&stgm); + return E_FAIL; + } + + ReleaseStgMedium(&stgm); + TRACE("Drive properties %ls\n", m_wszDrive); + + return S_OK; +} + +HRESULT WINAPI +CDrvDefExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CDrvDefExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CDrvDefExt::GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CDrvDefExt::AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) +{ + HPROPSHEETPAGE hPage; + + hPage = SH_CreatePropertySheetPage("DRIVE_GENERAL_DLG", + GeneralPageProc, + (LPARAM)this, + NULL); + if (hPage) + pfnAddPage(hPage, lParam); + + if (GetDriveTypeW(m_wszDrive) == DRIVE_FIXED) + { + hPage = SH_CreatePropertySheetPage("DRIVE_EXTRA_DLG", + ExtraPageProc, + (LPARAM)this, + NULL); + if (hPage) + pfnAddPage(hPage, lParam); + } + + hPage = SH_CreatePropertySheetPage("DRIVE_HARDWARE_DLG", + HardwarePageProc, + (LPARAM)this, + NULL); + if (hPage) + pfnAddPage(hPage, lParam); + + return S_OK; +} + +HRESULT WINAPI +CDrvDefExt::ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CDrvDefExt::SetSite(IUnknown *punk) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CDrvDefExt::GetSite(REFIID iid, void **ppvSite) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} Modified: trunk/reactos/dll/win32/shell32/drvdefext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefex…
============================================================================== --- trunk/reactos/dll/win32/shell32/drvdefext.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/drvdefext.h [iso-8859-1] Wed Jan 11 21:58:47 2012 @@ -1,1 +1,75 @@ +/* + * Provides default drive shell extension + * + * Copyright 2012 Rafal Harabien + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef _DRV_DEF_EXT_H_ +#define _FILE_DEF_EXT_H_ + +class CDrvDefExt : + public CComCoClass<CDrvDefExt, &CLSID_ShellDrvDefExt>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IShellExtInit, + public IContextMenu, + public IShellPropSheetExt, + public IObjectWithSite +{ +private: + static VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem); + VOID InitGeneralPage(HWND hwndDlg); + static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + + WCHAR m_wszDrive[MAX_PATH]; + +public: + CDrvDefExt(); + ~CDrvDefExt(); + + // IShellExtInit + virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID); + + // IContextMenu + virtual HRESULT WINAPI QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); + virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpici); + virtual HRESULT WINAPI GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax); + + // IShellPropSheetExt + virtual HRESULT WINAPI AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam); + virtual HRESULT WINAPI ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam); + + // IObjectWithSite + virtual HRESULT WINAPI SetSite(IUnknown *punk); + virtual HRESULT WINAPI GetSite(REFIID iid, void **ppvSite); + +DECLARE_REGISTRY_RESOURCEID(IDR_DRVDEFEXT) +DECLARE_NOT_AGGREGATABLE(CDrvDefExt) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CDrvDefExt) + COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit) + COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) + COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt) + COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) +END_COM_MAP() +}; + +#endif // _FILE_DEF_EXT_H_ + Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] Wed Jan 11 21:58:47 2012 @@ -1,8 +1,7 @@ /* - * provides new shell item service - * - * Copyright 2007 Johannes Anderwald (janderwald(a)reactos.org) - * Copyright 2009 Andrew Hill + * Provides default file shell extension + * + * Copyright 2005 Johannes Anderwald * Copyright 2012 Rafal Harabien * * This library is free software; you can redistribute it and/or Modified: trunk/reactos/dll/win32/shell32/fprop.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/fprop.cp…
============================================================================== --- trunk/reactos/dll/win32/shell32/fprop.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/fprop.cpp [iso-8859-1] Wed Jan 11 21:58:47 2012 @@ -98,6 +98,7 @@ HRESULT hr; HPROPSHEETPAGE hppages[MAX_PROPERTY_SHEET_PAGE]; HPSXA hpsxa[3] = {NULL, NULL, NULL}; + CComObject<CFileDefExt> *pFileDefExt = NULL; TRACE("SH_ShowPropertiesDialog entered filename %s\n", debugstr_w(pwszPath)); @@ -134,7 +135,6 @@ if (SUCCEEDED(hr)) { - CComObject<CFileDefExt> *pFileDefExt; ATLTRY(pFileDefExt = new CComObject<CFileDefExt>); if (pFileDefExt) { @@ -146,8 +146,6 @@ ERR("AddPages failed\n"); } else ERR("Initialize failed\n"); - - pFileDefExt->Release(); } LoadPropSheetHandlers(wszPath, &Header, MAX_PROPERTY_SHEET_PAGE - 1, hpsxa, pDataObj); @@ -158,6 +156,8 @@ for (UINT i = 0; i < 3; ++i) if (hpsxa[i]) SHDestroyPropSheetExtArray(hpsxa[i]); + if (pFileDefExt) + pFileDefExt->Release(); return (Result != -1); } Modified: trunk/reactos/dll/win32/shell32/shell32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32.rbuild [iso-8859-1] Wed Jan 11 21:58:47 2012 @@ -29,6 +29,7 @@ <library>winmm</library> <library>msvcrt</library> <library>atlnew</library> + <library>fmifs</library> <pch>precomp.h</pch> <file>authors.cpp</file> <file>autocomplete.cpp</file>
12 years, 11 months
1
0
0
0
[rharabien] 54909: [FMIFS] - Make header C++ friendly
by rharabien@svn.reactos.org
Author: rharabien Date: Wed Jan 11 21:31:52 2012 New Revision: 54909 URL:
http://svn.reactos.org/svn/reactos?rev=54909&view=rev
Log: [FMIFS] - Make header C++ friendly Modified: trunk/reactos/include/reactos/libs/fmifs/fmifs.h Modified: trunk/reactos/include/reactos/libs/fmifs/fmifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/fmifs…
============================================================================== --- trunk/reactos/include/reactos/libs/fmifs/fmifs.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/fmifs/fmifs.h [iso-8859-1] Wed Jan 11 21:31:52 2012 @@ -21,6 +21,10 @@ * Add some prototypes * */ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus /* Output command */ typedef struct @@ -198,4 +202,8 @@ IN BOOLEAN ScanDrive, IN PFMIFSCALLBACK Callback); +#ifdef __cplusplus +} +#endif // __cplusplus + #endif /* ndef _FMIFS_H */
12 years, 11 months
1
0
0
0
[rharabien] 54908: [SHELL32] - Add CLSID_ShellFileDefExt, CLSID_ShellDrvDefExt, CLSID_ShellNetDefExt GUIDs - Move File Properties default pages to CFileDefExt
by rharabien@svn.reactos.org
Author: rharabien Date: Wed Jan 11 20:20:01 2012 New Revision: 54908 URL:
http://svn.reactos.org/svn/reactos?rev=54908&view=rev
Log: [SHELL32] - Add CLSID_ShellFileDefExt, CLSID_ShellDrvDefExt, CLSID_ShellNetDefExt GUIDs - Move File Properties default pages to CFileDefExt Added: trunk/reactos/dll/win32/shell32/drvdefext.cpp (with props) trunk/reactos/dll/win32/shell32/drvdefext.h (with props) trunk/reactos/dll/win32/shell32/filedefext.cpp (with props) trunk/reactos/dll/win32/shell32/filedefext.h (with props) trunk/reactos/dll/win32/shell32/res/rgs/shellfiledefext.rgs Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt trunk/reactos/dll/win32/shell32/fprop.cpp trunk/reactos/dll/win32/shell32/precomp.h trunk/reactos/dll/win32/shell32/rgs_res.rc trunk/reactos/dll/win32/shell32/shell32.rbuild trunk/reactos/dll/win32/shell32/shresdef.h trunk/reactos/include/psdk/shlguid_undoc.h Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -69,6 +69,8 @@ newmenu.cpp startmenu.cpp folder_options.cpp + filedefext.cpp + drvdefext.cpp shell32.rc ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/shell32.def) Added: trunk/reactos/dll/win32/shell32/drvdefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefex…
============================================================================== --- trunk/reactos/dll/win32/shell32/drvdefext.cpp (added) +++ trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -1,0 +1,1 @@ + Propchange: trunk/reactos/dll/win32/shell32/drvdefext.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/drvdefext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefex…
============================================================================== --- trunk/reactos/dll/win32/shell32/drvdefext.h (added) +++ trunk/reactos/dll/win32/shell32/drvdefext.h [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -1,0 +1,1 @@ + Propchange: trunk/reactos/dll/win32/shell32/drvdefext.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/shell32/drvdefext.h ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Added: trunk/reactos/dll/win32/shell32/filedefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.cpp (added) +++ trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -1,0 +1,812 @@ +/* + * provides new shell item service + * + * Copyright 2007 Johannes Anderwald (janderwald(a)reactos.org) + * Copyright 2009 Andrew Hill + * Copyright 2012 Rafal Harabien + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <precomp.h> + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +BOOL PathIsExeW(LPCWSTR lpszPath); + +BOOL CFileVersionInfo::Load(LPCWSTR pwszPath) +{ + ULONG cbInfo = GetFileVersionInfoSizeW(pwszPath, NULL); + if (!cbInfo) + { + WARN("GetFileVersionInfoSize %ls failed\n", pwszPath); + return FALSE; + } + + m_pInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbInfo); + if (!m_pInfo) + { + ERR("HeapAlloc failed bytes %x\n", cbInfo); + return FALSE; + } + + if (!GetFileVersionInfoW(pwszPath, 0, cbInfo, m_pInfo)) + { + ERR("GetFileVersionInfoW failed\n"); + return FALSE; + } + + LPLANGANDCODEPAGE lpLangCode; + UINT cBytes; + if (!VerQueryValueW(m_pInfo, L"VarFileInfo\\Translation", (LPVOID *)&lpLangCode, &cBytes)) + { + ERR("VerQueryValueW failed\n"); + return FALSE; + } + + /* FIXME: find language from current locale / if not available, + * default to english + * for now default to first available language + */ + m_wLang = lpLangCode->lang; + m_wCode = lpLangCode->code; + return TRUE; +} + +LPCWSTR CFileVersionInfo::GetString(LPCWSTR pwszName) +{ + if (!m_pInfo) + return NULL; + + WCHAR wszBuf[256]; + swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\%s", m_wLang, m_wCode, pwszName); + + LPCWSTR pwszResult = NULL; + UINT cBytes = 0; + if (!VerQueryValueW(m_pInfo, wszBuf, (LPVOID *)&pwszResult, &cBytes)) + return NULL; + + return pwszResult; +} + +VS_FIXEDFILEINFO *CFileVersionInfo::GetFixedInfo() +{ + if (!m_pInfo) + return NULL; + + VS_FIXEDFILEINFO *pInfo; + UINT cBytes; + if (!VerQueryValueW(m_pInfo, L"\\", (PVOID*)&pInfo, &cBytes)) + return NULL; + return pInfo; +} + +/************************************************************************* + * + * SH_FormatFileSizeWithBytes + * + * Format a size in bytes to string. + * + * lpQwSize = Pointer to 64bit large integer to format + * pszBuf = Buffer to fill with output string + * cchBuf = size of pszBuf in characters + * + */ + +LPWSTR +SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf) +{ + NUMBERFMTW nf; + WCHAR szNumber[24]; + WCHAR szDecimalSep[8]; + WCHAR szThousandSep[8]; + WCHAR szGrouping[12]; + int Len, cchFormatted, i; + size_t cchRemaining; + LPWSTR Ptr; + + // Try to build first Format byte string + if (StrFormatByteSizeW(lpQwSize->QuadPart, pszBuf, cchBuf) == NULL) + return NULL; + + // If there is less bytes than 1KB, we have nothing to do + if (lpQwSize->QuadPart < 1024) + return pszBuf; + + // Print the number in uniform mode + swprintf(szNumber, L"%I64u", lpQwSize->QuadPart); + + // Get system strings for decimal and thousand separators. + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSep, sizeof(szDecimalSep) / sizeof(*szDecimalSep)); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, szThousandSep, sizeof(szThousandSep) / sizeof(*szThousandSep)); + + // Initialize format for printing the number in bytes + ZeroMemory(&nf, sizeof(nf)); + nf.NumDigits = 0; + nf.LeadingZero = 0; + nf.Grouping = 0; + nf.lpDecimalSep = szDecimalSep; + nf.lpThousandSep = szThousandSep; + nf.NegativeOrder = 0; + + // Get system string for groups separator + Len = GetLocaleInfoW(LOCALE_USER_DEFAULT, + LOCALE_SGROUPING, + szGrouping, + sizeof(szGrouping) / sizeof(*szGrouping)); + + // Convert grouping specs from string to integer + for (i = 0; i < Len; i++) + { + WCHAR wch = szGrouping[i]; + + if (wch >= L'0' && wch <= L'9') + nf.Grouping = nf.Grouping * 10 + (wch - L'0'); + else if (wch != L';') + break; + } + + if ((nf.Grouping % 10) == 0) + nf.Grouping /= 10; + else + nf.Grouping *= 10; + + // Concate " (" at the end of buffer + Len = wcslen(pszBuf); + Ptr = pszBuf + Len; + cchRemaining = cchBuf - Len; + StringCchCopyExW(Ptr, cchRemaining, L" (", &Ptr, &cchRemaining, 0); + + // Save formatted number of bytes in buffer + cchFormatted = GetNumberFormatW(LOCALE_USER_DEFAULT, + 0, + szNumber, + &nf, + Ptr, + cchRemaining); + + if (cchFormatted == 0) + return NULL; + + // cchFormatted is number of characters including NULL - make it a real length + --cchFormatted; + + // Copy ' ' to buffer + Ptr += cchFormatted; + cchRemaining -= cchFormatted; + StringCchCopyExW(Ptr, cchRemaining, L" ", &Ptr, &cchRemaining, 0); + + // Copy 'bytes' string and remaining ')' + Len = LoadStringW(shell32_hInstance, IDS_BYTES_FORMAT, Ptr, cchRemaining); + Ptr += Len; + cchRemaining -= Len; + StringCchCopy(Ptr, cchRemaining, L")"); + + return pszBuf; +} + +/************************************************************************* + * + * SH_CreatePropertySheetPage [Internal] + * + * creates a property sheet page from an resource name + * + */ + +HPROPSHEETPAGE +SH_CreatePropertySheetPage(LPCSTR pszResName, DLGPROC pfnDlgProc, LPARAM lParam, LPWSTR pwszTitle) +{ + if (pszResName == NULL) + return NULL; + + HRSRC hRes = FindResourceA(shell32_hInstance, pszResName, (LPSTR)RT_DIALOG); + if (hRes == NULL) + { + ERR("failed to find resource name\n"); + return NULL; + } + + LPVOID pTemplate = LoadResource(shell32_hInstance, hRes); + if (pTemplate == NULL) + { + ERR("failed to load resource\n"); + return NULL; + } + + PROPSHEETPAGEW Page; + memset(&Page, 0x0, sizeof(PROPSHEETPAGEW)); + Page.dwSize = sizeof(PROPSHEETPAGEW); + Page.dwFlags = PSP_DLGINDIRECT; + Page.pResource = (DLGTEMPLATE*)pTemplate; + Page.pfnDlgProc = pfnDlgProc; + Page.lParam = lParam; + Page.pszTitle = pwszTitle; + + if (pwszTitle) + Page.dwFlags |= PSP_USETITLE; + + return CreatePropertySheetPageW(&Page); +} + +VOID +CFileDefExt::InitOpensWithField(HWND hwndDlg) +{ + WCHAR wszBuf[MAX_PATH] = L""; + WCHAR wszPath[MAX_PATH] = L""; + DWORD dwSize = sizeof(wszBuf); + BOOL bUnknownApp = TRUE; + LPCWSTR pwszExt = PathFindExtensionW(m_wszPath); + + if (RegGetValueW(HKEY_CLASSES_ROOT, pwszExt, L"", RRF_RT_REG_SZ, NULL, wszBuf, &dwSize) == ERROR_SUCCESS) + { + bUnknownApp = FALSE; + StringCbCatW(wszBuf, sizeof(wszBuf), L"\\shell\\open\\command"); + dwSize = sizeof(wszPath); + if (RegGetValueW(HKEY_CLASSES_ROOT, wszBuf, L"", RRF_RT_REG_SZ, NULL, wszPath, &dwSize) == ERROR_SUCCESS) + { + /* Get path from command line */ + ExpandEnvironmentStringsW(wszPath, wszBuf, _countof(wszBuf)); + PathRemoveArgs(wszBuf); + PathUnquoteSpacesW(wszBuf); + PathSearchAndQualify(wszBuf, wszPath, _countof(wszPath)); + + if (PathFileExistsW(wszPath)) + { + /* Get file description */ + CFileVersionInfo VerInfo; + VerInfo.Load(wszPath); + LPCWSTR pwszDescr = VerInfo.GetString(L"FileDescription"); + if (pwszDescr) + SetDlgItemTextW(hwndDlg, 14007, pwszDescr); + else + { + /* File has no description - display filename */ + LPWSTR pwszFilename = PathFindFileNameW(wszPath); + PathRemoveExtension(pwszFilename); + pwszFilename[0] = towupper(pwszFilename[0]); + SetDlgItemTextW(hwndDlg, 14007, pwszFilename); + } + } + else + bUnknownApp = TRUE; + } else + WARN("RegGetValueW %ls failed\n", wszBuf); + } else + WARN("RegGetValueW %ls failed\n", pwszExt); + + if (bUnknownApp) + { + /* Unknown application */ + LoadStringW(shell32_hInstance, IDS_UNKNOWN_APP, wszBuf, _countof(wszBuf)); + SetDlgItemTextW(hwndDlg, 14007, wszBuf); + } +} + +/************************************************************************* + * + * SH_FileGeneralFileType [Internal] + * + * retrieves file extension description from registry and sets it in dialog + * + * TODO: retrieve file extension default icon and load it + * find executable name from registry, retrieve description from executable + */ + +BOOL +CFileDefExt::InitFileType(HWND hwndDlg) +{ + TRACE("path %s\n", debugstr_w(m_wszPath)); + + HWND hDlgCtrl = GetDlgItem(hwndDlg, 14005); + if (hDlgCtrl == NULL) + return FALSE; + + /* Get file information */ + SHFILEINFO fi; + if (!SHGetFileInfoW(m_wszPath, 0, &fi, sizeof(fi), SHGFI_TYPENAME|SHGFI_ICON)) + { + ERR("SHGetFileInfoW failed for %ls (%lu)\n", m_wszPath, GetLastError()); + fi.szTypeName[0] = L'\0'; + fi.hIcon = NULL; + } + + LPCWSTR pwszExt = PathFindExtensionW(m_wszPath); + if (pwszExt[0]) + { + WCHAR wszBuf[256]; + + if (!fi.szTypeName[0]) + { + /* The file type is unknown, so default to string "FileExtension File" */ + size_t cchRemaining = 0; + LPWSTR pwszEnd = NULL; + + StringCchPrintfExW(wszBuf, _countof(wszBuf), &pwszEnd, &cchRemaining, 0, L"%s ", pwszExt + 1); + SendMessageW(hDlgCtrl, WM_GETTEXT, (WPARAM)cchRemaining, (LPARAM)pwszEnd); + + SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)wszBuf); + } + else + { + /* Update file type */ + StringCbPrintfW(wszBuf, sizeof(wszBuf), L"%s (%s)", fi.szTypeName, pwszExt); + SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)wszBuf); + } + } + + /* Update file icon */ + if (fi.hIcon) + SendDlgItemMessageW(hwndDlg, 14000, STM_SETICON, (WPARAM)fi.hIcon, 0); + else + ERR("No icon %ls\n", m_wszPath); + + return TRUE; +} + +/************************************************************************* + * + * SHFileGeneralGetFileTimeString [Internal] + * + * formats a given LPFILETIME struct into readable user format + */ + +BOOL +CFileDefExt::GetFileTimeString(LPFILETIME lpFileTime, WCHAR *lpResult) +{ + FILETIME ft; + SYSTEMTIME st; + + if (lpFileTime == NULL || lpResult == NULL) + return FALSE; + + if (!FileTimeToLocalFileTime(lpFileTime, &ft)) + return FALSE; + + FileTimeToSystemTime(&ft, &st); + + /* ddmmyy */ + swprintf(lpResult, L"%02hu/%02hu/%04hu %02hu:%02hu", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute); + + TRACE("result %s\n", debugstr_w(lpResult)); + return TRUE; +} + +/************************************************************************* + * + * SH_FileGeneralSetText [Internal] + * + * sets file path string and filename string + * + */ + +BOOL +CFileDefExt::InitFilePath(HWND hwndDlg) +{ + /* Find the filename */ + WCHAR *pwszFilename = PathFindFileNameW(m_wszPath); + + if (pwszFilename > m_wszPath) + { + /* Location field */ + WCHAR wszLocation[MAX_PATH]; + StringCchCopyNW(wszLocation, _countof(wszLocation), m_wszPath, pwszFilename - m_wszPath); + PathRemoveBackslashW(wszLocation); + + SetDlgItemTextW(hwndDlg, 14009, wszLocation); + } + + /* Filename field */ + SetDlgItemTextW(hwndDlg, 14001, pwszFilename); + + return TRUE; +} + +/************************************************************************* + * + * SH_FileGeneralSetFileSizeTime [Internal] + * + * retrieves file information from file and sets in dialog + * + */ + +BOOL +CFileDefExt::InitFileSizeTime(HWND hwndDlg) +{ + WCHAR wszBuf[MAX_PATH]; + + TRACE("SH_FileGeneralSetFileSizeTime %ls\n", m_wszPath); + + HANDLE hFile = CreateFileW(m_wszPath, + GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + + if (hFile == INVALID_HANDLE_VALUE) + { + WARN("failed to open file %s\n", debugstr_w(m_wszPath)); + return FALSE; + } + + FILETIME CreateTime, AccessedTime, WriteTime; + if (!GetFileTime(hFile, &CreateTime, &AccessedTime, &WriteTime)) + { + WARN("GetFileTime failed\n"); + CloseHandle(hFile); + return FALSE; + } + + LARGE_INTEGER FileSize; + if (!GetFileSizeEx(hFile, &FileSize)) + { + WARN("GetFileSize failed\n"); + CloseHandle(hFile); + return FALSE; + } + + CloseHandle(hFile); + + if (GetFileTimeString(&CreateTime, wszBuf)) + SetDlgItemTextW(hwndDlg, 14015, wszBuf); + + if (GetFileTimeString(&AccessedTime, wszBuf)) + SetDlgItemTextW(hwndDlg, 14019, wszBuf); + + if (GetFileTimeString(&WriteTime, wszBuf)) + SetDlgItemTextW(hwndDlg, 14017, wszBuf); + + if (SH_FormatFileSizeWithBytes((PULARGE_INTEGER)&FileSize, + wszBuf, + sizeof(wszBuf) / sizeof(WCHAR))) + { + SetDlgItemTextW(hwndDlg, 14011, wszBuf); + } + + return TRUE; +} + +/************************************************************************* + * + * CFileDefExt::InitGeneralPage [Internal] + * + * sets all file general properties in dialog + */ + +BOOL +CFileDefExt::InitGeneralPage(HWND hwndDlg) +{ + /* Set general text properties filename filelocation and icon */ + InitFilePath(hwndDlg); + + /* Set file type and icon */ + InitFileType(hwndDlg); + + /* Set open with application */ + if (!PathIsExeW(m_wszPath)) + InitOpensWithField(hwndDlg); + else + { + LPCWSTR pwszDescr = m_VerInfo.GetString(L"FileDescription"); + if (pwszDescr) + SetDlgItemTextW(hwndDlg, 14007, pwszDescr); + } + + /* Set file created/modfied/accessed time */ + InitFileSizeTime(hwndDlg); + + return TRUE; +} + +/************************************************************************* + * + * CFileDefExt::GeneralPageProc + * + * wnd proc of 'General' property sheet page + * + */ + +INT_PTR CALLBACK +CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam; + + if (ppsp == NULL || !ppsp->lParam) + break; + + TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %S\n", hwndDlg, lParam, ppsp->lParam); + + CFileDefExt *pFileDefExt = (CFileDefExt*)ppsp->lParam; + pFileDefExt->InitGeneralPage(hwndDlg); + } + default: + break; + } + + return FALSE; +} + +/************************************************************************* + * + * CFileDefExt::InitVersionPage [Internal] + * + * sets all file version properties in dialog + */ + +BOOL +CFileDefExt::InitVersionPage(HWND hwndDlg) +{ + /* Get fixed info */ + VS_FIXEDFILEINFO *pInfo = m_VerInfo.GetFixedInfo(); + if (pInfo) + { + WCHAR wszVersion[256]; + swprintf(wszVersion, L"%u.%u.%u.%u", HIWORD(pInfo->dwFileVersionMS), + LOWORD(pInfo->dwFileVersionMS), + HIWORD(pInfo->dwFileVersionLS), + LOWORD(pInfo->dwFileVersionLS)); + TRACE("MS %x LS %x ver %s \n", pInfo->dwFileVersionMS, pInfo->dwFileVersionLS, debugstr_w(wszVersion)); + SetDlgItemTextW(hwndDlg, 14001, wszVersion); + } + + /* Update labels */ + SetVersionLabel(hwndDlg, 14003, L"FileDescription"); + SetVersionLabel(hwndDlg, 14005, L"LegalCopyright"); + + /* Add items to listbox */ + AddVersionString(hwndDlg, L"CompanyName"); + /* FIXME insert language identifier */ + AddVersionString(hwndDlg, L"ProductName"); + AddVersionString(hwndDlg, L"InternalName"); + AddVersionString(hwndDlg, L"OriginalFilename"); + AddVersionString(hwndDlg, L"FileVersion"); + AddVersionString(hwndDlg, L"ProductVersion"); + + /* Attach file version to dialog window */ + SetWindowLongPtr(hwndDlg, DWL_USER, (LONG_PTR)this); + + /* Select first item */ + HWND hDlgCtrl = GetDlgItem(hwndDlg, 14009); + SendMessageW(hDlgCtrl, LB_SETCURSEL, 0, 0); + LPCWSTR pwszText = (WCHAR *)SendMessageW(hDlgCtrl, LB_GETITEMDATA, (WPARAM)0, (LPARAM)NULL); + SetDlgItemTextW(hwndDlg, 14010, pwszText); + + return TRUE; +} + +/************************************************************************* + * + * CFileDefExt::SetVersionLabel [Internal] + * + * + */ + +BOOL +CFileDefExt::SetVersionLabel(HWND hwndDlg, DWORD idCtrl, LPCWSTR pwszName) +{ + if (hwndDlg == NULL || pwszName == NULL) + return FALSE; + + LPCWSTR pwszValue = m_VerInfo.GetString(pwszName); + if (pwszValue) + { + /* file description property */ + TRACE("%s :: %s\n", debugstr_w(pwszName), debugstr_w(pwszValue)); + SetDlgItemTextW(hwndDlg, idCtrl, pwszValue); + return TRUE; + } + + return FALSE; +} + +/************************************************************************* + * + * CFileDefExt::AddVersionString [Internal] + * + * retrieves a version string and adds it to listbox + * + */ + +BOOL +CFileDefExt::AddVersionString(HWND hwndDlg, LPCWSTR pwszName) +{ + TRACE("pwszName %s, hwndDlg %p\n", debugstr_w(pwszName), hwndDlg); + + if (hwndDlg == NULL || pwszName == NULL) + return FALSE; + + LPCWSTR pwszValue = m_VerInfo.GetString(pwszName); + if (pwszValue) + { + /* listbox name property */ + HWND hDlgCtrl = GetDlgItem(hwndDlg, 14009); + TRACE("%s :: %s\n", debugstr_w(pwszName), debugstr_w(pwszValue)); + UINT Index = SendMessageW(hDlgCtrl, LB_ADDSTRING, (WPARAM) -1, (LPARAM)pwszName); + SendMessageW(hDlgCtrl, LB_SETITEMDATA, (WPARAM)Index, (LPARAM)(WCHAR *)pwszValue); + return TRUE; + } + + return FALSE; +} + +/************************************************************************* + * + * CFileDefExt::VersionPageProc + * + * wnd proc of 'Version' property sheet page + */ + +INT_PTR CALLBACK +CFileDefExt::VersionPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + LPPROPSHEETPAGE ppsp = (LPPROPSHEETPAGE)lParam; + + if (ppsp == NULL || !ppsp->lParam) + break; + + TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %x\n", hwndDlg, lParam, ppsp->lParam); + + CFileDefExt *pFileDefExt = (CFileDefExt*)ppsp->lParam; + return pFileDefExt->InitVersionPage(hwndDlg); + } + case WM_COMMAND: + if (LOWORD(wParam) == 14009 && HIWORD(wParam) == LBN_SELCHANGE) + { + HWND hDlgCtrl = (HWND)lParam; + + LRESULT Index = SendMessageW(hDlgCtrl, LB_GETCURSEL, (WPARAM)NULL, (LPARAM)NULL); + if (Index == LB_ERR) + break; + + LPCWSTR pwszData = (LPCWSTR)SendMessageW(hDlgCtrl, LB_GETITEMDATA, (WPARAM)Index, (LPARAM)NULL); + if (pwszData == NULL) + break; + + TRACE("hDlgCtrl %x string %s\n", hDlgCtrl, debugstr_w(pwszData)); + SetDlgItemTextW(hwndDlg, 14010, pwszData); + + return TRUE; + } + break; + case WM_DESTROY: + break; + default: + break; + } + + return FALSE; +} + +CFileDefExt::CFileDefExt() +{ + m_wszPath[0] = L'\0'; +} + +CFileDefExt::~CFileDefExt() +{ + +} + +HRESULT WINAPI +CFileDefExt::Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID) +{ + FORMATETC format; + STGMEDIUM stgm; + HRESULT hr; + + TRACE("%p %p %p %p\n", this, pidlFolder, pDataObj, hkeyProgID); + + if (!pDataObj) + return E_FAIL; + + format.cfFormat = CF_HDROP; + format.ptd = NULL; + format.dwAspect = DVASPECT_CONTENT; + format.lindex = -1; + format.tymed = TYMED_HGLOBAL; + + hr = pDataObj->GetData(&format, &stgm); + if (FAILED(hr)) + return hr; + + if (!DragQueryFileW((HDROP)stgm.hGlobal, 0, m_wszPath, _countof(m_wszPath))) + { + ERR("DragQueryFileW failed\n"); + ReleaseStgMedium(&stgm); + return E_FAIL; + } + + ReleaseStgMedium(&stgm); + TRACE("File properties %ls\n", m_wszPath); + m_VerInfo.Load(m_wszPath); + + return S_OK; +} + +HRESULT WINAPI +CFileDefExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CFileDefExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CFileDefExt::GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CFileDefExt::AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) +{ + HPROPSHEETPAGE hPage; + + hPage = SH_CreatePropertySheetPage("SHELL_FILE_GENERAL_DLG", + GeneralPageProc, + (LPARAM)this, + NULL); + if (hPage) + pfnAddPage(hPage, lParam); + + if (GetFileVersionInfoSizeW(m_wszPath, NULL)) + { + hPage = SH_CreatePropertySheetPage("SHELL_FILE_VERSION_DLG", + VersionPageProc, + (LPARAM)this, + NULL); + if (hPage) + pfnAddPage(hPage, lParam); + } + + return S_OK; +} + +HRESULT WINAPI +CFileDefExt::ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CFileDefExt::SetSite(IUnknown *punk) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} + +HRESULT WINAPI +CFileDefExt::GetSite(REFIID iid, void **ppvSite) +{ + UNIMPLEMENTED; + return E_NOTIMPL; +} Propchange: trunk/reactos/dll/win32/shell32/filedefext.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/filedefext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.h (added) +++ trunk/reactos/dll/win32/shell32/filedefext.h [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -1,0 +1,110 @@ +/* + * Provides default file shell extension + * + * Copyright 2012 Rafal Harabien + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _FILE_DEF_EXT_H_ +#define _FILE_DEF_EXT_H_ + +class CFileVersionInfo +{ + private: + PVOID m_pInfo; + WORD m_wLang, m_wCode; + + typedef struct _LANGANDCODEPAGE_ + { + WORD lang; + WORD code; + } LANGANDCODEPAGE, *LPLANGANDCODEPAGE; + + public: + inline CFileVersionInfo(): + m_pInfo(NULL), m_wLang(0), m_wCode(0) {} + + inline ~CFileVersionInfo() + { + if (m_pInfo) + HeapFree(GetProcessHeap(), 0, m_pInfo); + } + + BOOL Load(LPCWSTR pwszPath); + + LPCWSTR GetString(LPCWSTR pwszName); + + VS_FIXEDFILEINFO *GetFixedInfo(); +}; + +class CFileDefExt : + public CComCoClass<CFileDefExt, &CLSID_ShellFileDefExt>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IShellExtInit, + public IContextMenu, + public IShellPropSheetExt, + public IObjectWithSite +{ +private: + VOID InitOpensWithField(HWND hwndDlg); + BOOL InitFileType(HWND hwndDlg); + static BOOL GetFileTimeString(LPFILETIME lpFileTime, WCHAR *lpResult); + BOOL InitFilePath(HWND hwndDlg); + BOOL InitFileSizeTime(HWND hwndDlg); + BOOL InitGeneralPage(HWND hwndDlg); + BOOL SetVersionLabel(HWND hwndDlg, DWORD idCtrl, LPCWSTR pwszName); + BOOL AddVersionString(HWND hwndDlg, LPCWSTR pwszName); + BOOL InitVersionPage(HWND hwndDlg); + static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK VersionPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + + WCHAR m_wszPath[MAX_PATH]; + CFileVersionInfo m_VerInfo; + +public: + CFileDefExt(); + ~CFileDefExt(); + + // IShellExtInit + virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID); + + // IContextMenu + virtual HRESULT WINAPI QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); + virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpici); + virtual HRESULT WINAPI GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax); + + // IShellPropSheetExt + virtual HRESULT WINAPI AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam); + virtual HRESULT WINAPI ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam); + + // IObjectWithSite + virtual HRESULT WINAPI SetSite(IUnknown *punk); + virtual HRESULT WINAPI GetSite(REFIID iid, void **ppvSite); + +DECLARE_REGISTRY_RESOURCEID(IDR_FILEDEFEXT) +DECLARE_NOT_AGGREGATABLE(CFileDefExt) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CFileDefExt) + COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit) + COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) + COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt) + COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) +END_COM_MAP() +}; + +#endif // _FILE_DEF_EXT_H_ Propchange: trunk/reactos/dll/win32/shell32/filedefext.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/shell32/filedefext.h ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Modified: trunk/reactos/dll/win32/shell32/fprop.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/fprop.cp…
============================================================================== --- trunk/reactos/dll/win32/shell32/fprop.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/fprop.cpp [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -2,6 +2,7 @@ * Shell Library Functions * * Copyright 2005 Johannes Anderwald + * Copyright 2012 Rafal Harabien * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,727 +21,11 @@ #include <precomp.h> +#define MAX_PROPERTY_SHEET_PAGE 32 + WINE_DEFAULT_DEBUG_CHANNEL(shell); -#define MAX_PROPERTY_SHEET_PAGE 32 - -typedef struct _LANGANDCODEPAGE_ -{ - WORD lang; - WORD code; -} LANGANDCODEPAGE, *LPLANGANDCODEPAGE; - EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj); -BOOL PathIsExeW(LPCWSTR lpszPath); - -class CFileVersionInfo -{ - public: - inline CFileVersionInfo(): - m_pInfo(NULL), m_wLang(0), m_wCode(0) {} - - inline ~CFileVersionInfo() - { - if (m_pInfo) - HeapFree(GetProcessHeap(), 0, m_pInfo); - } - - BOOL Load(LPCWSTR pwszPath) - { - ULONG cbBuf = GetFileVersionInfoSizeW(pwszPath, NULL); - if (!cbBuf) - { - WARN("GetFileVersionInfoSize %ls failed\n", pwszPath); - return FALSE; - } - - m_pInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbBuf); - if (!m_pInfo) - { - ERR("HeapAlloc failed bytes %x\n", cbBuf); - return FALSE; - } - - if (!GetFileVersionInfoW(pwszPath, 0, cbBuf, m_pInfo)) - { - ERR("GetFileVersionInfoW failed\n"); - return FALSE; - } - - LPLANGANDCODEPAGE lpLangCode; - UINT cBytes; - if (!VerQueryValueW(m_pInfo, L"VarFileInfo\\Translation", (LPVOID *)&lpLangCode, &cBytes)) - { - ERR("VerQueryValueW failed\n"); - return FALSE; - } - - /* FIXME: find language from current locale / if not available, - * default to english - * for now default to first available language - */ - m_wLang = lpLangCode->lang; - m_wCode = lpLangCode->code; - return TRUE; - } - - LPCWSTR GetString(LPCWSTR pwszName) - { - if (!m_pInfo) - return NULL; - - WCHAR wszBuf[256]; - swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\%s", m_wLang, m_wCode, pwszName); - - LPCWSTR pwszResult = NULL; - UINT cBytes = 0; - if (!VerQueryValueW(m_pInfo, wszBuf, (LPVOID *)&pwszResult, &cBytes)) - return NULL; - - return pwszResult; - } - - VS_FIXEDFILEINFO *GetFixedInfo() - { - if (!m_pInfo) - return NULL; - - VS_FIXEDFILEINFO *pInfo; - UINT cBytes; - if (!VerQueryValueW(m_pInfo, L"\\", (PVOID*)&pInfo, &cBytes)) - return NULL; - return pInfo; - } - - - private: - PVOID m_pInfo; - WORD m_wLang, m_wCode; -}; - -static VOID -SH_FileGeneralOpensWith(HWND hwndDlg, LPCWSTR pwszExt) -{ - WCHAR wszBuf[MAX_PATH] = L""; - WCHAR wszPath[MAX_PATH] = L""; - DWORD dwSize = sizeof(wszBuf); - - if (RegGetValueW(HKEY_CLASSES_ROOT, pwszExt, L"", RRF_RT_REG_SZ, NULL, wszBuf, &dwSize) == ERROR_SUCCESS) - { - StringCbCatW(wszBuf, sizeof(wszBuf), L"\\shell\\open\\command"); - dwSize = sizeof(wszPath); - if (RegGetValueW(HKEY_CLASSES_ROOT, wszBuf, L"", RRF_RT_REG_SZ, NULL, wszPath, &dwSize) == ERROR_SUCCESS) - { - /* Get path from command line */ - ExpandEnvironmentStringsW(wszPath, wszBuf, _countof(wszBuf)); - PathRemoveArgs(wszBuf); - PathUnquoteSpacesW(wszBuf); - PathSearchAndQualify(wszBuf, wszPath, _countof(wszPath)); - - if (PathFileExistsW(wszPath)) - { - /* Get file description */ - CFileVersionInfo VerInfo; - VerInfo.Load(wszPath); - LPCWSTR pwszDescr = VerInfo.GetString(L"FileDescription"); - if (pwszDescr) - SetDlgItemTextW(hwndDlg, 14007, pwszDescr); - else - { - /* File has no description - display filename */ - LPWSTR pwszFilename = PathFindFileNameW(wszPath); - PathRemoveExtension(pwszFilename); - pwszFilename[0] = towupper(pwszFilename[0]); - SetDlgItemTextW(hwndDlg, 14007, pwszFilename); - } - } - else - { - /* Unknown application */ - LoadStringW(shell32_hInstance, IDS_UNKNOWN_APP, wszBuf, _countof(wszBuf)); - SetDlgItemTextW(hwndDlg, 14007, wszBuf); - } - } else - WARN("RegGetValueW %ls failed\n", wszBuf); - } else - WARN("RegGetValueW %ls failed\n", pwszExt); - - -} - -/************************************************************************* - * - * SH_FormatFileSizeWithBytes - * - * Format a size in bytes to string. - * - * lpQwSize = Pointer to 64bit large integer to format - * pszBuf = Buffer to fill with output string - * cchBuf = size of pszBuf in characters - * - */ - -LPWSTR -SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf) -{ - NUMBERFMTW nf; - WCHAR szNumber[24]; - WCHAR szDecimalSep[8]; - WCHAR szThousandSep[8]; - WCHAR szGrouping[12]; - int Len, cchFormatted, i; - size_t cchRemaining; - LPWSTR Ptr; - - // Try to build first Format byte string - if (StrFormatByteSizeW(lpQwSize->QuadPart, pszBuf, cchBuf) == NULL) - return NULL; - - // If there is less bytes than 1KB, we have nothing to do - if (lpQwSize->QuadPart < 1024) - return pszBuf; - - // Print the number in uniform mode - swprintf(szNumber, L"%I64u", lpQwSize->QuadPart); - - // Get system strings for decimal and thousand separators. - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSep, sizeof(szDecimalSep) / sizeof(*szDecimalSep)); - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, szThousandSep, sizeof(szThousandSep) / sizeof(*szThousandSep)); - - // Initialize format for printing the number in bytes - ZeroMemory(&nf, sizeof(nf)); - nf.NumDigits = 0; - nf.LeadingZero = 0; - nf.Grouping = 0; - nf.lpDecimalSep = szDecimalSep; - nf.lpThousandSep = szThousandSep; - nf.NegativeOrder = 0; - - // Get system string for groups separator - Len = GetLocaleInfoW(LOCALE_USER_DEFAULT, - LOCALE_SGROUPING, - szGrouping, - sizeof(szGrouping) / sizeof(*szGrouping)); - - // Convert grouping specs from string to integer - for (i = 0; i < Len; i++) - { - WCHAR wch = szGrouping[i]; - - if (wch >= L'0' && wch <= L'9') - nf.Grouping = nf.Grouping * 10 + (wch - L'0'); - else if (wch != L';') - break; - } - - if ((nf.Grouping % 10) == 0) - nf.Grouping /= 10; - else - nf.Grouping *= 10; - - // Concate " (" at the end of buffer - Len = wcslen(pszBuf); - Ptr = pszBuf + Len; - cchRemaining = cchBuf - Len; - StringCchCopyExW(Ptr, cchRemaining, L" (", &Ptr, &cchRemaining, 0); - - // Save formatted number of bytes in buffer - cchFormatted = GetNumberFormatW(LOCALE_USER_DEFAULT, - 0, - szNumber, - &nf, - Ptr, - cchRemaining); - - if (cchFormatted == 0) - return NULL; - - // cchFormatted is number of characters including NULL - make it a real length - --cchFormatted; - - // Copy ' ' to buffer - Ptr += cchFormatted; - cchRemaining -= cchFormatted; - StringCchCopyExW(Ptr, cchRemaining, L" ", &Ptr, &cchRemaining, 0); - - // Copy 'bytes' string and remaining ')' - Len = LoadStringW(shell32_hInstance, IDS_BYTES_FORMAT, Ptr, cchRemaining); - Ptr += Len; - cchRemaining -= Len; - StringCchCopy(Ptr, cchRemaining, L")"); - - return pszBuf; -} - -/************************************************************************* - * - * SH_CreatePropertySheetPage [Internal] - * - * creates a property sheet page from an resource name - * - */ - -HPROPSHEETPAGE -SH_CreatePropertySheetPage(LPCSTR pwszResName, DLGPROC pfnDlgProc, LPARAM lParam, LPWSTR pwszTitle) -{ - if (pwszResName == NULL) - return NULL; - - HRSRC hRes = FindResourceA(shell32_hInstance, pwszResName, (LPSTR)RT_DIALOG); - if (hRes == NULL) - { - ERR("failed to find resource name\n"); - return NULL; - } - - LPVOID pTemplate = LoadResource(shell32_hInstance, hRes); - if (pTemplate == NULL) - { - ERR("failed to load resource\n"); - return NULL; - } - - PROPSHEETPAGEW Page; - memset(&Page, 0x0, sizeof(PROPSHEETPAGEW)); - Page.dwSize = sizeof(PROPSHEETPAGEW); - Page.dwFlags = PSP_DLGINDIRECT; - Page.pResource = (DLGTEMPLATE*)pTemplate; - Page.pfnDlgProc = pfnDlgProc; - Page.lParam = lParam; - Page.pszTitle = pwszTitle; - - if (pwszTitle) - Page.dwFlags |= PSP_USETITLE; - - return CreatePropertySheetPageW(&Page); -} - -/************************************************************************* - * - * SH_FileGeneralFileType [Internal] - * - * retrieves file extension description from registry and sets it in dialog - * - * TODO: retrieve file extension default icon and load it - * find executable name from registry, retrieve description from executable - */ - -static BOOL -SH_FileGeneralSetFileType(HWND hwndDlg, LPCWSTR pwszPath) -{ - TRACE("path %s\n", debugstr_w(pwszPath)); - - if (pwszPath == NULL || !pwszPath[0]) - return FALSE; - - HWND hDlgCtrl = GetDlgItem(hwndDlg, 14005); - if (hDlgCtrl == NULL) - return FALSE; - - /* Get file information */ - SHFILEINFO fi; - if (!SHGetFileInfoW(pwszPath, 0, &fi, sizeof(fi), SHGFI_TYPENAME|SHGFI_ICON)) - { - ERR("SHGetFileInfoW failed for %ls (%lu)\n", pwszPath, GetLastError()); - fi.szTypeName[0] = L'\0'; - fi.hIcon = NULL; - } - - LPCWSTR pwszExt = PathFindExtensionW(pwszPath); - if (pwszExt[0]) - { - WCHAR wszBuf[256]; - - if (!fi.szTypeName[0]) - { - /* The file type is unknown, so default to string "FileExtension File" */ - size_t cchRemaining = 0; - LPWSTR pwszEnd = NULL; - - StringCchPrintfExW(wszBuf, _countof(wszBuf), &pwszEnd, &cchRemaining, 0, L"%s ", pwszExt + 1); - SendMessageW(hDlgCtrl, WM_GETTEXT, (WPARAM)cchRemaining, (LPARAM)pwszEnd); - - SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)wszBuf); - } - else - { - /* Update file type */ - StringCbPrintfW(wszBuf, sizeof(wszBuf), L"%s (%s)", fi.szTypeName, pwszExt); - SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)wszBuf); - } - } - - /* Update file icon */ - if (fi.hIcon) - SendDlgItemMessageW(hwndDlg, 14000, STM_SETICON, (WPARAM)fi.hIcon, 0); - else - ERR("No icon %ls\n", pwszPath); - - return TRUE; -} - -/************************************************************************* - * - * SHFileGeneralGetFileTimeString [Internal] - * - * formats a given LPFILETIME struct into readable user format - */ - -static BOOL -SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR *lpResult) -{ - FILETIME ft; - SYSTEMTIME st; - - if (lpFileTime == NULL || lpResult == NULL) - return FALSE; - - if (!FileTimeToLocalFileTime(lpFileTime, &ft)) - return FALSE; - - FileTimeToSystemTime(&ft, &st); - - /* ddmmyy */ - swprintf(lpResult, L"%02hu/%02hu/%04hu %02hu:%02hu", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute); - - TRACE("result %s\n", debugstr_w(lpResult)); - return TRUE; -} - -/************************************************************************* - * - * SH_FileGeneralSetText [Internal] - * - * sets file path string and filename string - * - */ - -static BOOL -SH_FileGeneralSetText(HWND hwndDlg, LPCWSTR pwszPath) -{ - if (pwszPath == NULL) - return FALSE; - - /* Find the filename */ - WCHAR *pwszFilename = PathFindFileNameW(pwszPath); - - if (pwszFilename > pwszPath) - { - /* Location field */ - WCHAR wszLocation[MAX_PATH]; - StringCchCopyNW(wszLocation, _countof(wszLocation), pwszPath, pwszFilename - pwszPath); - PathRemoveBackslashW(wszLocation); - - SetDlgItemTextW(hwndDlg, 14009, wszLocation); - } - - /* Filename field */ - SetDlgItemTextW(hwndDlg, 14001, pwszFilename); - - return TRUE; -} - -/************************************************************************* - * - * SH_FileGeneralSetFileSizeTime [Internal] - * - * retrieves file information from file and sets in dialog - * - */ - -static BOOL -SH_FileGeneralSetFileSizeTime(HWND hwndDlg, LPCWSTR pwszPath) -{ - HANDLE hFile; - FILETIME CreateTime; - FILETIME AccessedTime; - FILETIME WriteTime; - WCHAR wszBuf[MAX_PATH]; - LARGE_INTEGER FileSize; - - if (pwszPath == NULL) - return FALSE; - - TRACE("SH_FileGeneralSetFileSizeTime %ls\n", pwszPath); - - hFile = CreateFileW(pwszPath, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - WARN("failed to open file %s\n", debugstr_w(pwszPath)); - return FALSE; - } - - if (!GetFileTime(hFile, &CreateTime, &AccessedTime, &WriteTime)) - { - WARN("GetFileTime failed\n"); - CloseHandle(hFile); - return FALSE; - } - - if (!GetFileSizeEx(hFile, &FileSize)) - { - WARN("GetFileSize failed\n"); - CloseHandle(hFile); - return FALSE; - } - - CloseHandle(hFile); - - if (SHFileGeneralGetFileTimeString(&CreateTime, wszBuf)) - SetDlgItemTextW(hwndDlg, 14015, wszBuf); - - if (SHFileGeneralGetFileTimeString(&AccessedTime, wszBuf)) - SetDlgItemTextW(hwndDlg, 14019, wszBuf); - - if (SHFileGeneralGetFileTimeString(&WriteTime, wszBuf)) - SetDlgItemTextW(hwndDlg, 14017, wszBuf); - - if (SH_FormatFileSizeWithBytes((PULARGE_INTEGER)&FileSize, - wszBuf, - sizeof(wszBuf) / sizeof(WCHAR))) - { - SetDlgItemTextW(hwndDlg, 14011, wszBuf); - } - - return TRUE; -} - -/************************************************************************* - * - * SH_SetFileVersionText [Internal] - * - * - */ - -static BOOL -SH_FileVersionQuerySetText(HWND hwndDlg, DWORD idCtrl, CFileVersionInfo *pVerInfo, LPCWSTR pwszName) -{ - if (hwndDlg == NULL || pwszName == NULL) - return FALSE; - - LPCWSTR pwszValue = pVerInfo->GetString(pwszName); - if (pwszValue) - { - /* file description property */ - TRACE("%s :: %s\n", debugstr_w(pwszName), debugstr_w(pwszValue)); - SetDlgItemTextW(hwndDlg, idCtrl, pwszValue); - return TRUE; - } - - return FALSE; -} - -/************************************************************************* - * - * SH_FileVersionQuerySetListText [Internal] - * - * retrieves a version string and adds it to listbox - * - */ - -static BOOL -SH_FileVersionQuerySetListText(HWND hwndDlg, CFileVersionInfo *pVerInfo, LPCWSTR pwszName) -{ - TRACE("pwszName %s, hwndDlg %p\n", debugstr_w(pwszName), hwndDlg); - - if (hwndDlg == NULL || pwszName == NULL) - return FALSE; - - LPCWSTR pwszValue = pVerInfo->GetString(pwszName); - if (pwszValue) - { - /* listbox name property */ - HWND hDlgCtrl = GetDlgItem(hwndDlg, 14009); - TRACE("%s :: %s\n", debugstr_w(pwszName), debugstr_w(pwszValue)); - UINT Index = SendMessageW(hDlgCtrl, LB_ADDSTRING, (WPARAM) -1, (LPARAM)pwszName); - SendMessageW(hDlgCtrl, LB_SETITEMDATA, (WPARAM)Index, (LPARAM)(WCHAR *)pwszValue); - return TRUE; - } - - return FALSE; -} - -/************************************************************************* - * - * SH_FileVersionInitialize [Internal] - * - * sets all file version properties in dialog - */ - -static BOOL -SH_FileVersionInitialize(HWND hwndDlg, LPCWSTR pwszPath) -{ - if (pwszPath == NULL) - return FALSE; - - /* Get file version info */ - CFileVersionInfo *pVerInfo; - pVerInfo = new CFileVersionInfo; - if (!pVerInfo || !pVerInfo->Load(pwszPath)) - return FALSE; - - /* Get fixed info */ - VS_FIXEDFILEINFO *pInfo = pVerInfo->GetFixedInfo(); - if (pInfo) - { - WCHAR wszVersion[256]; - swprintf(wszVersion, L"%u.%u.%u.%u", HIWORD(pInfo->dwFileVersionMS), - LOWORD(pInfo->dwFileVersionMS), - HIWORD(pInfo->dwFileVersionLS), - LOWORD(pInfo->dwFileVersionLS)); - TRACE("MS %x LS %x ver %s \n", pInfo->dwFileVersionMS, pInfo->dwFileVersionLS, debugstr_w(wszVersion)); - SetDlgItemTextW(hwndDlg, 14001, wszVersion); - } - - /* Update labels */ - SH_FileVersionQuerySetText(hwndDlg, 14003, pVerInfo, L"FileDescription"); - SH_FileVersionQuerySetText(hwndDlg, 14005, pVerInfo, L"LegalCopyright"); - - /* Add items to listbox */ - SH_FileVersionQuerySetListText(hwndDlg, pVerInfo, L"CompanyName"); - /* FIXME insert language identifier */ - SH_FileVersionQuerySetListText(hwndDlg, pVerInfo, L"ProductName"); - SH_FileVersionQuerySetListText(hwndDlg, pVerInfo, L"InternalName"); - SH_FileVersionQuerySetListText(hwndDlg, pVerInfo, L"OriginalFilename"); - SH_FileVersionQuerySetListText(hwndDlg, pVerInfo, L"FileVersion"); - SH_FileVersionQuerySetListText(hwndDlg, pVerInfo, L"ProductVersion"); - - /* Attach file version to dialog window */ - SetWindowLongPtr(hwndDlg, DWL_USER, (LONG_PTR)pVerInfo); - - /* Select first item */ - HWND hDlgCtrl = GetDlgItem(hwndDlg, 14009); - SendMessageW(hDlgCtrl, LB_SETCURSEL, 0, 0); - LPCWSTR pwszText = (WCHAR *)SendMessageW(hDlgCtrl, LB_GETITEMDATA, (WPARAM)0, (LPARAM)NULL); - SetDlgItemTextW(hwndDlg, 14010, pwszText); - - return TRUE; -} - -/************************************************************************* - * - * SH_FileVersionDlgProc - * - * wnd proc of 'Version' property sheet page - */ - -INT_PTR CALLBACK -SH_FileVersionDlgProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - { - LPPROPSHEETPAGE ppsp = (LPPROPSHEETPAGE)lParam; - - if (ppsp == NULL) - break; - - TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %x\n", hwndDlg, lParam, ppsp->lParam); - - LPCWSTR pwszFilename = (LPCWSTR)ppsp->lParam; - - if (pwszFilename == NULL) - break; - - return SH_FileVersionInitialize(hwndDlg, pwszFilename); - } - case WM_COMMAND: - if (LOWORD(wParam) == 14009 && HIWORD(wParam) == LBN_SELCHANGE) - { - HWND hDlgCtrl = (HWND)lParam; - - LRESULT Index = SendMessageW(hDlgCtrl, LB_GETCURSEL, (WPARAM)NULL, (LPARAM)NULL); - if (Index == LB_ERR) - break; - - LPCWSTR pwszData = (LPCWSTR)SendMessageW(hDlgCtrl, LB_GETITEMDATA, (WPARAM)Index, (LPARAM)NULL); - if (pwszData == NULL) - break; - - TRACE("hDlgCtrl %x string %s\n", hDlgCtrl, debugstr_w(pwszData)); - SetDlgItemTextW(hwndDlg, 14010, pwszData); - - return TRUE; - } - break; - case WM_DESTROY: - { - CFileVersionInfo *pVerInfo = (CFileVersionInfo*)GetWindowLongPtr(hwndDlg, DWL_USER); - if (pVerInfo) - delete pVerInfo; - break; - } - default: - break; - } - - return FALSE; -} - -/************************************************************************* - * - * SH_FileGeneralDlgProc - * - * wnd proc of 'General' property sheet page - * - */ - -INT_PTR CALLBACK -SH_FileGeneralDlgProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - { - LPPROPSHEETPAGEW ppsp = (LPPROPSHEETPAGEW)lParam; - - if (ppsp == NULL) - break; - - TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %S\n", hwndDlg, lParam, ppsp->lParam); - - LPCWSTR pwszPath = (WCHAR *)ppsp->lParam; - if (pwszPath == NULL) - { - ERR("no path\n"); - break; - } - - /* Set general text properties filename filelocation and icon */ - SH_FileGeneralSetText(hwndDlg, pwszPath); - - /* Set file type and icon */ - SH_FileGeneralSetFileType(hwndDlg, pwszPath); - - /* Set open with application */ - if (!PathIsExeW(pwszPath)) - SH_FileGeneralOpensWith(hwndDlg, PathFindExtensionW(pwszPath)); - - /* Set file created/modfied/accessed time */ - SH_FileGeneralSetFileSizeTime(hwndDlg, pwszPath); - - return TRUE; - } - default: - break; - } - - return FALSE; -} static BOOL CALLBACK AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam) @@ -844,31 +129,29 @@ Header.phpage = hppages; Header.pszCaption = PathFindFileNameW(wszPath); - hppages[Header.nPages] = - SH_CreatePropertySheetPage("SHELL_FILE_GENERAL_DLG", - SH_FileGeneralDlgProc, - (LPARAM)wszPath, - NULL); - - if (hppages[Header.nPages]) - Header.nPages++; - - if (GetFileVersionInfoSizeW(wszPath, NULL) && Header.nPages < _countof(hppages)) - { - hppages[Header.nPages] = - SH_CreatePropertySheetPage("SHELL_FILE_VERSION_DLG", - SH_FileVersionDlgProc, - (LPARAM)wszPath, - NULL); - if (hppages[Header.nPages]) - Header.nPages++; - } - CComPtr<IDataObject> pDataObj; hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_IDataObject, (LPVOID *)&pDataObj); if (SUCCEEDED(hr)) + { + CComObject<CFileDefExt> *pFileDefExt; + ATLTRY(pFileDefExt = new CComObject<CFileDefExt>); + if (pFileDefExt) + { + hr = pFileDefExt->Initialize(pidlFolder, pDataObj, NULL); + if (SUCCEEDED(hr)) + { + hr = pFileDefExt->AddPages(AddPropSheetPageCallback, (LPARAM)&Header); + if (FAILED(hr)) + ERR("AddPages failed\n"); + } else + ERR("Initialize failed\n"); + + pFileDefExt->Release(); + } + LoadPropSheetHandlers(wszPath, &Header, MAX_PROPERTY_SHEET_PAGE - 1, hpsxa, pDataObj); + } INT_PTR Result = PropertySheetW(&Header); Modified: trunk/reactos/dll/win32/shell32/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/precomp.…
============================================================================== --- trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -82,6 +82,8 @@ #include "openwithmenu.h" #include "newmenu.h" #include "startmenu.h" +#include "filedefext.h" +#include "drvdefext.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -96,5 +98,4 @@ extern const GUID SHELL32_AdvtShortcutProduct; extern const GUID SHELL32_AdvtShortcutComponent; - #endif Added: trunk/reactos/dll/win32/shell32/res/rgs/shellfiledefext.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/res/rgs/shellfiledefext.rgs (added) +++ trunk/reactos/dll/win32/shell32/res/rgs/shellfiledefext.rgs [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -1,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {21B22460-3AEA-1069-A2DC-08002B30309D} = s 'File Default Extension' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} Modified: trunk/reactos/dll/win32/shell32/rgs_res.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/rgs_res.…
============================================================================== --- trunk/reactos/dll/win32/shell32/rgs_res.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/rgs_res.rc [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -21,3 +21,4 @@ IDR_SHELLLINK REGISTRY "res\\rgs\\shelllink.rgs" IDR_STARTMENU REGISTRY "res\\rgs\\startmenu.rgs" IDR_OPENWITHMENU REGISTRY "res\\rgs\\openwithmenu.rgs" +IDR_FILEDEFEXT REGISTRY "res\\rgs\\shellfiledefext.rgs" Modified: trunk/reactos/dll/win32/shell32/shell32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32.rbuild [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -84,6 +84,8 @@ <file>openwithmenu.cpp</file> <file>newmenu.cpp</file> <file>folder_options.cpp</file> + <file>filedefext.cpp</file> + <file>drvdefext.cpp</file> <file>shell32.rc</file> </module> <module name="shobjidl_local_interface" type="idlinterface"> Modified: trunk/reactos/dll/win32/shell32/shresdef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shresdef…
============================================================================== --- trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -476,5 +476,7 @@ #define IDR_SHELLLINK 144 #define IDR_STARTMENU 145 #define IDR_OPENWITHMENU 146 +#define IDR_FILEDEFEXT 147 +#define IDR_DRVDEFEXT 148 #endif Modified: trunk/reactos/include/psdk/shlguid_undoc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlguid_undoc…
============================================================================== --- trunk/reactos/include/psdk/shlguid_undoc.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/shlguid_undoc.h [iso-8859-1] Wed Jan 11 20:20:01 2012 @@ -19,6 +19,7 @@ #ifndef __SHLGUID_UNDOC_H #define __SHLGUID_UNDOC_H + DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1); DEFINE_GUID(CLSID_BandSiteMenu, 0xECD4FC4E, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1); DEFINE_GUID(IID_IBandSiteHelper, 0xD1E7AFEA, 0x6A2E, 0x11D0, 0x8C, 0x78, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xB4); @@ -97,8 +98,12 @@ DEFINE_GUID(CLSID_FolderOptions, 0x6DFD7C5C, 0x2451, 0x11D3, 0xA2, 0x99, 0x00, 0xC0, 0x4F, 0x8E, 0xF6, 0xAF); +DEFINE_GUID(CLSID_ShellFileDefExt, 0x21B22460, 0x3AEA, 0x1069, 0xA2, 0xDC, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); +DEFINE_GUID(CLSID_ShellDrvDefExt, 0x5F5295E0, 0x429F, 0x1069, 0xA2, 0xE2, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); +DEFINE_GUID(CLSID_ShellNetDefExt, 0x86422020, 0x42A0, 0x1069, 0xA2, 0xE5, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); + // In theory, this is documented. But until I see an SDK header that defines it, it will be treated as undocumented... -DEFINE_GUID(CLSID_ShellItem, 0x2fe352ea, 0xfd1f, 0x11d2, 0xb1, 0xf4, 0x00, 0xc0, 0x4f, 0x8e, 0xeb, 0x3e); +DEFINE_GUID(CLSID_ShellItem, 0x2FE352EA, 0xFD1F, 0x11D2, 0xB1, 0xF4, 0x00, 0xC0, 0x4F, 0x8E, 0xEB, 0x3E); #define CGID_IExplorerToolbar IID_IExplorerToolbar #define SID_IExplorerToolbar IID_IExplorerToolbar
12 years, 11 months
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
56
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200