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
2025
January
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
April 2006
----- 2025 -----
January 2025
----- 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
14 participants
324 discussions
Start a n
N
ew thread
[gedmurphy] 21476: remove Wine's wordpad.
by aleksey@studiocerebral.com
Author: gedmurphy Date: Thu Apr 6 19:37:38 2006 New Revision: 21476 URL:
http://svn.reactos.ru/svn/reactos?rev=21476&view=rev
Log: remove Wine's wordpad. Removed: trunk/reactos/base/applications/wordpad/
18 years, 8 months
1
0
0
0
[amunger] 21475: Changed the ParameterType in NdisReadConfiguration to Hex. Since 21002, we actually check this in ndis, before we just assumed Hex regardless of what was sent in. This fixes networking under qemu.
by aleksey@studiocerebral.com
Author: amunger Date: Wed Apr 5 21:36:28 2006 New Revision: 21475 URL:
http://svn.reactos.ru/svn/reactos?rev=21475&view=rev
Log: Changed the ParameterType in NdisReadConfiguration to Hex. Since 21002, we actually check this in ndis, before we just assumed Hex regardless of what was sent in. This fixes networking under qemu. Modified: trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c Modified: trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/network/dd/ne2000/n…
============================================================================== --- trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c (original) +++ trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c Wed Apr 5 21:36:28 2006 @@ -224,7 +224,7 @@ } NdisInitUnicodeString(&Keyword, L"Irq"); - NdisReadConfiguration(&Status, &ConfigurationParameter, ConfigurationHandle, &Keyword, NdisParameterInteger); + NdisReadConfiguration(&Status, &ConfigurationParameter, ConfigurationHandle, &Keyword, NdisParameterHexInteger); if(Status == NDIS_STATUS_SUCCESS) { NDIS_DbgPrint(MID_TRACE,("NdisReadConfiguration for Irq returned successfully, irq 0x%x\n", @@ -233,7 +233,7 @@ } NdisInitUnicodeString(&Keyword, L"Port"); - NdisReadConfiguration(&Status, &ConfigurationParameter, ConfigurationHandle, &Keyword, NdisParameterInteger); + NdisReadConfiguration(&Status, &ConfigurationParameter, ConfigurationHandle, &Keyword, NdisParameterHexInteger); if(Status == NDIS_STATUS_SUCCESS) { NDIS_DbgPrint(MID_TRACE,("NdisReadConfiguration for Port returned successfully, port 0x%x\n",
18 years, 9 months
1
0
0
0
[amunger] 21474: DHCP Client fixes and enhancements Set the correct hardware type flag. Fixes bug 651. Send option 12 on discovery, allows some DHCP servers to dynamically update DNS. Send option 61 for good measure. We use the MAC address as some other OSes do.
by aleksey@studiocerebral.com
Author: amunger Date: Wed Apr 5 20:38:03 2006 New Revision: 21474 URL:
http://svn.reactos.ru/svn/reactos?rev=21474&view=rev
Log: DHCP Client fixes and enhancements Set the correct hardware type flag. Fixes bug 651. Send option 12 on discovery, allows some DHCP servers to dynamically update DNS. Send option 61 for good measure. We use the MAC address as some other OSes do. Modified: trunk/reactos/base/services/dhcp/adapter.c trunk/reactos/base/services/dhcp/dhclient.c trunk/reactos/base/services/dhcp/util.c Modified: trunk/reactos/base/services/dhcp/adapter.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/services/dhcp/adapter.…
============================================================================== --- trunk/reactos/base/services/dhcp/adapter.c (original) +++ trunk/reactos/base/services/dhcp/adapter.c Wed Apr 5 20:38:03 2006 @@ -258,6 +258,12 @@ Adapter->IfMib.dwPhysAddrLen); Adapter->DhclientInfo.hw_address.hlen = Adapter->IfMib.dwPhysAddrLen; + /* I'm not sure where else to set this, but + some DHCP servers won't take a zero. + We checked the hardware type earlier in + the if statement. */ + Adapter->DhclientInfo.hw_address.htype = + HTYPE_ETHER; if( DhcpSocket == INVALID_SOCKET ) { DhcpSocket = Modified: trunk/reactos/base/services/dhcp/dhclient.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/services/dhcp/dhclient…
============================================================================== --- trunk/reactos/base/services/dhcp/dhclient.c (original) +++ trunk/reactos/base/services/dhcp/dhclient.c Wed Apr 5 20:38:03 2006 @@ -114,6 +114,13 @@ time_t scripttime; +/* XXX Added this since it's not in the NDK ;0/ */ +ULONG +NTAPI +RtlRandom( + IN OUT PULONG Seed + ); + /* XXX Implement me */ int check_arp( struct interface_info *ip, struct client_lease *lp ) { return 1; @@ -221,6 +228,7 @@ state_reboot(void *ipp) { struct interface_info *ip = ipp; + ULONG foo = (ULONG) GetTickCount(); /* If we don't remember an active lease, go straight to INIT. */ if (!ip->client->active || ip->client->active->is_bootp) { @@ -234,7 +242,7 @@ /* make_request doesn't initialize xid because it normally comes from the DHCPDISCOVER, but we haven't sent a DHCPDISCOVER, so pick an xid now. */ - ip->client->xid = rand(); + ip->client->xid = RtlRandom(&foo); /* Make a DHCPREQUEST packet, and set appropriate per-interface flags. */ @@ -1229,6 +1237,7 @@ struct tree_cache *options[256]; struct tree_cache option_elements[256]; int i; + ULONG foo = (ULONG) GetTickCount(); memset(option_elements, 0, sizeof(option_elements)); memset(options, 0, sizeof(options)); @@ -1287,7 +1296,7 @@ ip->client->packet.htype = ip->hw_address.htype; ip->client->packet.hlen = ip->hw_address.hlen; ip->client->packet.hops = 0; - ip->client->packet.xid = rand(); + ip->client->packet.xid = RtlRandom(&foo); ip->client->packet.secs = 0; /* filled in by send_discover. */ ip->client->packet.flags = 0; @@ -1996,11 +2005,11 @@ struct in_addr jnk; int i = 0; - note("Input: %s\n", buf); + note("Input: %s", buf); do { tmp = strtok(buf, " "); - note("got %s\n", tmp); + note("got %s", tmp); if( tmp && inet_aton(tmp, &jnk) ) i++; buf = NULL; } while( tmp ); Modified: trunk/reactos/base/services/dhcp/util.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/services/dhcp/util.c?r…
============================================================================== --- trunk/reactos/base/services/dhcp/util.c (original) +++ trunk/reactos/base/services/dhcp/util.c Wed Apr 5 20:38:03 2006 @@ -3,6 +3,8 @@ #define NDEBUG #include <reactos/debug.h> + +extern struct interface_info *ifi; char *piaddr( struct iaddr addr ) { struct sockaddr_in sa; @@ -95,7 +97,33 @@ void *dmalloc( int size, char *name ) { return malloc( size ); } int read_client_conf(void) { - error("util.c read_client_conf not implemented!"); + /* What a strage dance */ + struct client_config *config = ifi->client->config; + char ComputerName [MAX_COMPUTERNAME_LENGTH + 1]; + DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0]; + + GetComputerName(ComputerName, & ComputerNameSize); + /* This never gets freed since it's only called once */ + LPSTR lpCompName = + HeapAlloc(GetProcessHeap(), 0, strlen(ComputerName) + 1); + if (lpCompName !=NULL) { + GetComputerName(lpCompName, & ComputerNameSize); + /* Send our hostname, some dhcpds use this to update DNS */ + config->send_options[DHO_HOST_NAME].data = strlwr(lpCompName); + config->send_options[DHO_HOST_NAME].len = strlen(ComputerName); + debug("Hostname: %s, length: %d", + config->send_options[DHO_HOST_NAME].data, + config->send_options[DHO_HOST_NAME].len); + } else { + error("Failed to allocate heap for hostname"); + } + /* Both Linux and Windows send this */ + config->send_options[DHO_DHCP_CLIENT_IDENTIFIER].data = + ifi->hw_address.haddr; + config->send_options[DHO_DHCP_CLIENT_IDENTIFIER].len = + ifi->hw_address.hlen; + + warn("util.c read_client_conf poorly implemented!"); return 0; }
18 years, 9 months
1
0
0
0
[tretiakov] 21473: [AUDIT] \trunk\reactos\drivers\network\dd\ne2000 (unlocked) Written by Casper. Fireball and WaxDragon agreed it is clean.
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Apr 5 20:35:30 2006 New Revision: 21473 URL:
http://svn.reactos.ru/svn/reactos?rev=21473&view=rev
Log: [AUDIT] \trunk\reactos\drivers\network\dd\ne2000 (unlocked) Written by Casper. Fireball and WaxDragon agreed it is clean. Modified: trunk/reactos/drivers/network/dd/ne2000/include/8390.h (props changed) trunk/reactos/drivers/network/dd/ne2000/include/debug.h (props changed) trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h (props changed) trunk/reactos/drivers/network/dd/ne2000/ne2000.rc (props changed) trunk/reactos/drivers/network/dd/ne2000/ne2000/8390.c (props changed) trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c (props changed) Propchange: trunk/reactos/drivers/network/dd/ne2000/include/8390.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/network/dd/ne2000/include/debug.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/network/dd/ne2000/ne2000.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/network/dd/ne2000/ne2000/8390.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 9 months
1
0
0
0
[tretiakov] 21472: [AUDIT] unlock \trunk\reactos\base\services\dhcp Clean. Mostly OpenBSD and ISC code, with some arty and tinus rosglue.
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Apr 5 20:31:32 2006 New Revision: 21472 URL:
http://svn.reactos.ru/svn/reactos?rev=21472&view=rev
Log: [AUDIT] unlock \trunk\reactos\base\services\dhcp Clean. Mostly OpenBSD and ISC code, with some arty and tinus rosglue. Modified: trunk/reactos/base/services/dhcp/adapter.c (props changed) trunk/reactos/base/services/dhcp/alloc.c (props changed) trunk/reactos/base/services/dhcp/api.c (props changed) trunk/reactos/base/services/dhcp/compat.c (props changed) trunk/reactos/base/services/dhcp/design.txt (props changed) trunk/reactos/base/services/dhcp/dhclient.c (props changed) trunk/reactos/base/services/dhcp/dhcp.rc (props changed) trunk/reactos/base/services/dhcp/dhcpmain.c (props changed) trunk/reactos/base/services/dhcp/dispatch.c (props changed) trunk/reactos/base/services/dhcp/hash.c (props changed) trunk/reactos/base/services/dhcp/include/cdefs.h (props changed) trunk/reactos/base/services/dhcp/include/debug.h (props changed) trunk/reactos/base/services/dhcp/include/dhcp.h (props changed) trunk/reactos/base/services/dhcp/include/dhcpd.h (props changed) trunk/reactos/base/services/dhcp/include/dhctoken.h (props changed) trunk/reactos/base/services/dhcp/include/hash.h (props changed) trunk/reactos/base/services/dhcp/include/inet.h (props changed) trunk/reactos/base/services/dhcp/include/osdep.h (props changed) trunk/reactos/base/services/dhcp/include/predec.h (props changed) trunk/reactos/base/services/dhcp/include/privsep.h (props changed) trunk/reactos/base/services/dhcp/include/rosdhcp.h (props changed) trunk/reactos/base/services/dhcp/include/site.h (props changed) trunk/reactos/base/services/dhcp/include/stdint.h (props changed) trunk/reactos/base/services/dhcp/include/sysconf.h (props changed) trunk/reactos/base/services/dhcp/include/tree.h (props changed) trunk/reactos/base/services/dhcp/include/version.h (props changed) trunk/reactos/base/services/dhcp/memory.c (props changed) trunk/reactos/base/services/dhcp/options.c (props changed) trunk/reactos/base/services/dhcp/pipe.c (props changed) trunk/reactos/base/services/dhcp/privsep.c (props changed) trunk/reactos/base/services/dhcp/socket.c (props changed) trunk/reactos/base/services/dhcp/tables.c (props changed) trunk/reactos/base/services/dhcp/timer.c (props changed) trunk/reactos/base/services/dhcp/tree.c (props changed) trunk/reactos/base/services/dhcp/util.c (props changed) Propchange: trunk/reactos/base/services/dhcp/adapter.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/alloc.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/api.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/compat.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/design.txt ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/dhclient.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/dhcp.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/dhcpmain.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/dispatch.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/hash.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/cdefs.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/debug.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/dhcp.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/dhcpd.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/dhctoken.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/hash.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/inet.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/osdep.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/predec.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/privsep.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/rosdhcp.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/site.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/stdint.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/sysconf.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/tree.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/include/version.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/memory.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/options.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/pipe.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/privsep.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/socket.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/tables.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/timer.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/tree.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/base/services/dhcp/util.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 9 months
1
0
0
0
[tretiakov] 21471: [AUDIT] trunk\reactos\dll\win32\serialui (unlocked) I used clean methods to develop this dll. Function prototypes are from wine. Only drvCommConfigDialog is implemented. MSDN says: "The CommConfigDialog function requires a dynamic-link library (DLL) provided by the communications hardware vendor."
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Apr 5 18:17:22 2006 New Revision: 21471 URL:
http://svn.reactos.ru/svn/reactos?rev=21471&view=rev
Log: [AUDIT] trunk\reactos\dll\win32\serialui (unlocked) I used clean methods to develop this dll. Function prototypes are from wine. Only drvCommConfigDialog is implemented. MSDN says: "The CommConfigDialog function requires a dynamic-link library (DLL) provided by the communications hardware vendor." Modified: trunk/reactos/dll/win32/serialui/resource.h (props changed) trunk/reactos/dll/win32/serialui/serialui.c (props changed) trunk/reactos/dll/win32/serialui/serialui.def (props changed) trunk/reactos/dll/win32/serialui/serialui.h (props changed) trunk/reactos/dll/win32/serialui/serialui.rc (props changed) Propchange: trunk/reactos/dll/win32/serialui/resource.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/serialui/serialui.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/serialui/serialui.def ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/serialui/serialui.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/serialui/serialui.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 9 months
1
0
0
0
[tretiakov] 21470: [AUDIT] \trunk\reactos\dll\cpl\hdwwiz (unlocked) Herve Poussineau says it is clean.
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Apr 5 17:53:43 2006 New Revision: 21470 URL:
http://svn.reactos.ru/svn/reactos?rev=21470&view=rev
Log: [AUDIT] \trunk\reactos\dll\cpl\hdwwiz (unlocked) Herve Poussineau says it is clean. Modified: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c (props changed) trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h (props changed) trunk/reactos/dll/cpl/hdwwiz/resource.h (props changed) trunk/reactos/dll/cpl/hdwwiz/resources/applet.ico (props changed) Propchange: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/hdwwiz/hdwwiz.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/hdwwiz/resource.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/hdwwiz/resources/applet.ico ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 9 months
1
0
0
0
[tretiakov] 21469: [AUDIT] trunk\reactos\dll\cpl\appwiz (unlocked) I examined the code and it seems clean to me.
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Apr 5 17:32:05 2006 New Revision: 21469 URL:
http://svn.reactos.ru/svn/reactos?rev=21469&view=rev
Log: [AUDIT] trunk\reactos\dll\cpl\appwiz (unlocked) I examined the code and it seems clean to me. Modified: trunk/reactos/dll/cpl/appwiz/appwiz.c (props changed) trunk/reactos/dll/cpl/appwiz/appwiz.h (props changed) trunk/reactos/dll/cpl/appwiz/resource.h (props changed) trunk/reactos/dll/cpl/appwiz/resources/applet.ico (props changed) Propchange: trunk/reactos/dll/cpl/appwiz/appwiz.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/appwiz/appwiz.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/appwiz/resource.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/appwiz/resources/applet.ico ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 9 months
1
0
0
0
[tretiakov] 21468: [AUDIT] trunk\reactos\dll\cpl\control (unlocked) I examined the code and it seems clean to me.
by aleksey@studiocerebral.com
Author: tretiakov Date: Wed Apr 5 17:20:43 2006 New Revision: 21468 URL:
http://svn.reactos.ru/svn/reactos?rev=21468&view=rev
Log: [AUDIT] trunk\reactos\dll\cpl\control (unlocked) I examined the code and it seems clean to me. Modified: trunk/reactos/dll/cpl/control/control.c (props changed) trunk/reactos/dll/cpl/control/resource.h (props changed) trunk/reactos/dll/cpl/control/resources/config.ico (props changed) Propchange: trunk/reactos/dll/cpl/control/control.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/control/resource.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/control/resources/config.ico ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 9 months
1
0
0
0
[hpoussin] 21467: Fix formatting which was screwed in 19254. Code changes will follow later
by aleksey@studiocerebral.com
Author: hpoussin Date: Wed Apr 5 16:08:50 2006 New Revision: 21467 URL:
http://svn.reactos.ru/svn/reactos?rev=21467&view=rev
Log: Fix formatting which was screwed in 19254. Code changes will follow later Modified: trunk/reactos/dll/win32/newdev/newdev.c Modified: trunk/reactos/dll/win32/newdev/newdev.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/newdev.c (original) +++ trunk/reactos/dll/win32/newdev/newdev.c Wed Apr 5 16:08:50 2006 @@ -34,123 +34,132 @@ HANDLE hThread; static BOOL -CanDisableDevice(IN DEVINST DevInst, - IN HMACHINE hMachine, - OUT BOOL *CanDisable) +CanDisableDevice( + IN DEVINST DevInst, + IN HMACHINE hMachine, + OUT BOOL *CanDisable) { #if 0 - /* hpoussin, Dec 2005. I've disabled this code because - * ntoskrnl never sets the DN_DISABLEABLE flag. - */ - CONFIGRET cr; - ULONG Status, ProblemNumber; - BOOL Ret = FALSE; - - cr = CM_Get_DevNode_Status_Ex(&Status, - &ProblemNumber, - DevInst, - 0, - hMachine); - if (cr == CR_SUCCESS) - { - *CanDisable = ((Status & DN_DISABLEABLE) != 0); - Ret = TRUE; - } - - return Ret; + /* hpoussin, Dec 2005. I've disabled this code because + * ntoskrnl never sets the DN_DISABLEABLE flag. + */ + CONFIGRET cr; + ULONG Status, ProblemNumber; + BOOL Ret = FALSE; + + cr = CM_Get_DevNode_Status_Ex( + &Status, + &ProblemNumber, + DevInst, + 0, + hMachine); + if (cr == CR_SUCCESS) + { + *CanDisable = ((Status & DN_DISABLEABLE) != 0); + Ret = TRUE; + } + + return Ret; #else - *CanDisable = TRUE; - return TRUE; + *CanDisable = TRUE; + return TRUE; #endif } static BOOL -IsDeviceStarted(IN DEVINST DevInst, - IN HMACHINE hMachine, - OUT BOOL *IsEnabled) -{ - CONFIGRET cr; - ULONG Status, ProblemNumber; - BOOL Ret = FALSE; - - cr = CM_Get_DevNode_Status_Ex(&Status, - &ProblemNumber, - DevInst, - 0, - hMachine); - if (cr == CR_SUCCESS) - { - *IsEnabled = ((Status & DN_STARTED) != 0); - Ret = TRUE; - } - - return Ret; +IsDeviceStarted( + IN DEVINST DevInst, + IN HMACHINE hMachine, + OUT BOOL *IsEnabled) +{ + CONFIGRET cr; + ULONG Status, ProblemNumber; + BOOL Ret = FALSE; + + cr = CM_Get_DevNode_Status_Ex( + &Status, + &ProblemNumber, + DevInst, + 0, + hMachine); + if (cr == CR_SUCCESS) + { + *IsEnabled = ((Status & DN_STARTED) != 0); + Ret = TRUE; + } + + return Ret; } static BOOL -StartDevice(IN HDEVINFO DeviceInfoSet, - IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, - IN BOOL bEnable, - IN DWORD HardwareProfile OPTIONAL, - OUT BOOL *bNeedReboot OPTIONAL) -{ - SP_PROPCHANGE_PARAMS pcp; - SP_DEVINSTALL_PARAMS dp; - DWORD LastErr; - BOOL Ret = FALSE; - - pcp.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER); - pcp.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE; - pcp.HwProfile = HardwareProfile; - - if (bEnable) - { - /* try to enable the device on the global profile */ - pcp.StateChange = DICS_ENABLE; - pcp.Scope = DICS_FLAG_GLOBAL; - - /* ignore errors */ - LastErr = GetLastError(); - if (SetupDiSetClassInstallParams(DeviceInfoSet, - DevInfoData, - &pcp.ClassInstallHeader, - sizeof(SP_PROPCHANGE_PARAMS))) - { - SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, - DeviceInfoSet, - DevInfoData); - } - SetLastError(LastErr); - } - - /* try config-specific */ - pcp.StateChange = (bEnable ? DICS_ENABLE : DICS_DISABLE); - pcp.Scope = DICS_FLAG_CONFIGSPECIFIC; - - if (SetupDiSetClassInstallParams(DeviceInfoSet, - DevInfoData, - &pcp.ClassInstallHeader, - sizeof(SP_PROPCHANGE_PARAMS)) && - SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, - DeviceInfoSet, - DevInfoData)) - { - dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS); - if (SetupDiGetDeviceInstallParams(DeviceInfoSet, - DevInfoData, - &dp)) - { - if (bNeedReboot != NULL) - { - *bNeedReboot = ((dp.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) != 0); - } - - Ret = TRUE; - } - } - return Ret; +StartDevice( + IN HDEVINFO DeviceInfoSet, + IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, + IN BOOL bEnable, + IN DWORD HardwareProfile OPTIONAL, + OUT BOOL *bNeedReboot OPTIONAL) +{ + SP_PROPCHANGE_PARAMS pcp; + SP_DEVINSTALL_PARAMS dp; + DWORD LastErr; + BOOL Ret = FALSE; + + pcp.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER); + pcp.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE; + pcp.HwProfile = HardwareProfile; + + if (bEnable) + { + /* try to enable the device on the global profile */ + pcp.StateChange = DICS_ENABLE; + pcp.Scope = DICS_FLAG_GLOBAL; + + /* ignore errors */ + LastErr = GetLastError(); + if (SetupDiSetClassInstallParams( + DeviceInfoSet, + DevInfoData, + &pcp.ClassInstallHeader, + sizeof(SP_PROPCHANGE_PARAMS))) + { + SetupDiCallClassInstaller( + DIF_PROPERTYCHANGE, + DeviceInfoSet, + DevInfoData); + } + SetLastError(LastErr); + } + + /* try config-specific */ + pcp.StateChange = (bEnable ? DICS_ENABLE : DICS_DISABLE); + pcp.Scope = DICS_FLAG_CONFIGSPECIFIC; + + if (SetupDiSetClassInstallParams( + DeviceInfoSet, + DevInfoData, + &pcp.ClassInstallHeader, + sizeof(SP_PROPCHANGE_PARAMS)) && + SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, + DeviceInfoSet, + DevInfoData)) + { + dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS); + if (SetupDiGetDeviceInstallParams( + DeviceInfoSet, + DevInfoData, + &dp)) + { + if (bNeedReboot != NULL) + { + *bNeedReboot = ((dp.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) != 0); + } + + Ret = TRUE; + } + } + return Ret; } /* @@ -158,15 +167,15 @@ */ BOOL WINAPI UpdateDriverForPlugAndPlayDevicesW( - IN HWND hwndParent, - IN LPCWSTR HardwareId, - IN LPCWSTR FullInfPath, - IN DWORD InstallFlags, - OUT PBOOL bRebootRequired OPTIONAL) -{ - UNIMPLEMENTED; - SetLastError(ERROR_GEN_FAILURE); - return FALSE; + IN HWND hwndParent, + IN LPCWSTR HardwareId, + IN LPCWSTR FullInfPath, + IN DWORD InstallFlags, + OUT PBOOL bRebootRequired OPTIONAL) +{ + UNIMPLEMENTED; + SetLastError(ERROR_GEN_FAILURE); + return FALSE; } /* @@ -174,858 +183,870 @@ */ BOOL WINAPI UpdateDriverForPlugAndPlayDevicesA( - IN HWND hwndParent, - IN LPCSTR HardwareId, - IN LPCSTR FullInfPath, - IN DWORD InstallFlags, - OUT PBOOL bRebootRequired OPTIONAL) -{ - BOOL Result; - LPWSTR HardwareIdW = NULL; - LPWSTR FullInfPathW = NULL; - - int len = MultiByteToWideChar(CP_ACP, 0, HardwareId, -1, NULL, 0); - HardwareIdW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - if (!HardwareIdW) - { - SetLastError(ERROR_GEN_FAILURE); - return FALSE; - } - MultiByteToWideChar(CP_ACP, 0, HardwareId, -1, HardwareIdW, len); - - len = MultiByteToWideChar(CP_ACP, 0, FullInfPath, -1, NULL, 0); - FullInfPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - if (!FullInfPathW) - { - HeapFree(GetProcessHeap(), 0, HardwareIdW); - SetLastError(ERROR_GEN_FAILURE); - return FALSE; - } - MultiByteToWideChar(CP_ACP, 0, FullInfPath, -1, FullInfPathW, len); - - Result = UpdateDriverForPlugAndPlayDevicesW(hwndParent, - HardwareIdW, - FullInfPathW, - InstallFlags, - bRebootRequired); - - HeapFree(GetProcessHeap(), 0, HardwareIdW); - HeapFree(GetProcessHeap(), 0, FullInfPathW); - - return Result; + IN HWND hwndParent, + IN LPCSTR HardwareId, + IN LPCSTR FullInfPath, + IN DWORD InstallFlags, + OUT PBOOL bRebootRequired OPTIONAL) +{ + BOOL Result; + LPWSTR HardwareIdW = NULL; + LPWSTR FullInfPathW = NULL; + + int len = MultiByteToWideChar(CP_ACP, 0, HardwareId, -1, NULL, 0); + HardwareIdW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!HardwareIdW) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + MultiByteToWideChar(CP_ACP, 0, HardwareId, -1, HardwareIdW, len); + + len = MultiByteToWideChar(CP_ACP, 0, FullInfPath, -1, NULL, 0); + FullInfPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!FullInfPathW) + { + HeapFree(GetProcessHeap(), 0, HardwareIdW); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + MultiByteToWideChar(CP_ACP, 0, FullInfPath, -1, FullInfPathW, len); + + Result = UpdateDriverForPlugAndPlayDevicesW( + hwndParent, + HardwareIdW, + FullInfPathW, + InstallFlags, + bRebootRequired); + + HeapFree(GetProcessHeap(), 0, HardwareIdW); + HeapFree(GetProcessHeap(), 0, FullInfPathW); + + return Result; } static HFONT CreateTitleFont(VOID) { - NONCLIENTMETRICS ncm; - LOGFONT LogFont; - HDC hdc; - INT FontSize; - HFONT hFont; - - ncm.cbSize = sizeof(NONCLIENTMETRICS); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); - - LogFont = ncm.lfMessageFont; - LogFont.lfWeight = FW_BOLD; - _tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg")); - - hdc = GetDC(NULL); - FontSize = 12; - LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72; - hFont = CreateFontIndirect(&LogFont); - ReleaseDC(NULL, hdc); - - return hFont; + NONCLIENTMETRICS ncm; + LOGFONT LogFont; + HDC hdc; + INT FontSize; + HFONT hFont; + + ncm.cbSize = sizeof(NONCLIENTMETRICS); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); + + LogFont = ncm.lfMessageFont; + LogFont.lfWeight = FW_BOLD; + _tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg")); + + hdc = GetDC(NULL); + FontSize = 12; + LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72; + hFont = CreateFontIndirect(&LogFont); + ReleaseDC(NULL, hdc); + + return hFont; } static VOID -CenterWindow(HWND hWnd) -{ - HWND hWndParent; - RECT rcParent; - RECT rcWindow; - - hWndParent = GetParent(hWnd); - if (hWndParent == NULL) - hWndParent = GetDesktopWindow(); - - GetWindowRect(hWndParent, &rcParent); - GetWindowRect(hWnd, &rcWindow); - - SetWindowPos(hWnd, - HWND_TOP, - ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2, - ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2, - 0, - 0, - SWP_NOSIZE); +CenterWindow( + IN HWND hWnd) +{ + HWND hWndParent; + RECT rcParent; + RECT rcWindow; + + hWndParent = GetParent(hWnd); + if (hWndParent == NULL) + hWndParent = GetDesktopWindow(); + + GetWindowRect(hWndParent, &rcParent); + GetWindowRect(hWnd, &rcWindow); + + SetWindowPos( + hWnd, + HWND_TOP, + ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2, + ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2, + 0, + 0, + SWP_NOSIZE); } static INT_PTR CALLBACK WelcomeDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - DWORD dwStyle; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetParent(hwndDlg); - - /* Center the wizard window */ - CenterWindow (hwndControl); - - /* Hide the system menu */ - dwStyle = GetWindowLong(hwndControl, GWL_STYLE); - SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); - - /* Set title font */ - SendDlgItemMessage(hwndDlg, - IDC_WELCOMETITLE, - WM_SETFONT, - (WPARAM)DevInstData->hTitleFont, - (LPARAM)TRUE); - - SendDlgItemMessage(hwndDlg, - IDC_DEVICE, - WM_SETTEXT, - 0, - (LPARAM) DevInstData->buffer); - - SendDlgItemMessage(hwndDlg, - IDC_RADIO_AUTO, - BM_SETCHECK, - (WPARAM) TRUE, - (LPARAM) 0); - - - } - break; - - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the Next button */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT); - break; - - case PSN_WIZNEXT: - /* Handle a Next button click, if necessary */ - - if (SendDlgItemMessage(hwndDlg, IDC_RADIO_AUTO, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED) - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_SEARCHDRV); - - break; - - default: - break; - } - } - break; - - default: - break; - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + + PDEVINSTDATA DevInstData; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + DWORD dwStyle; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetParent(hwndDlg); + + /* Center the wizard window */ + CenterWindow (hwndControl); + + /* Hide the system menu */ + dwStyle = GetWindowLong(hwndControl, GWL_STYLE); + SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + + /* Set title font */ + SendDlgItemMessage( + hwndDlg, + IDC_WELCOMETITLE, + WM_SETFONT, + (WPARAM)DevInstData->hTitleFont, + (LPARAM)TRUE); + + SendDlgItemMessage( + hwndDlg, + IDC_DEVICE, + WM_SETTEXT, + 0, + (LPARAM) DevInstData->buffer); + + SendDlgItemMessage( + hwndDlg, + IDC_RADIO_AUTO, + BM_SETCHECK, + (WPARAM) TRUE, + (LPARAM) 0); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the Next button */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT); + break; + + case PSN_WIZNEXT: + /* Handle a Next button click, if necessary */ + if (SendDlgItemMessage(hwndDlg, IDC_RADIO_AUTO, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED) + PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_SEARCHDRV); + break; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; } static INT_PTR CALLBACK CHSourceDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - DWORD dwStyle; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetParent(hwndDlg); - - /* Center the wizard window */ - CenterWindow (hwndControl); - - /* Hide the system menu */ - dwStyle = GetWindowLong(hwndControl, GWL_STYLE); - SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); - - SendDlgItemMessage(hwndDlg, - IDC_RADIO_SEARCHHERE, - BM_SETCHECK, - (WPARAM) TRUE, - (LPARAM) 0); - - } - break; - - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the Next and Back buttons */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK); - break; - - case PSN_WIZNEXT: - /* Handle a Next button click, if necessary */ - PropSheet_SetCurSel(GetParent(hwndDlg), 0, 4); - break; - - default: - break; - } - } - break; - - default: - break; - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PDEVINSTDATA DevInstData; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + DWORD dwStyle; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetParent(hwndDlg); + + /* Center the wizard window */ + CenterWindow (hwndControl); + + /* Hide the system menu */ + dwStyle = GetWindowLong(hwndControl, GWL_STYLE); + SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + + SendDlgItemMessage( + hwndDlg, + IDC_RADIO_SEARCHHERE, + BM_SETCHECK, + (WPARAM) TRUE, + (LPARAM) 0); + + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the Next and Back buttons */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK); + break; + + case PSN_WIZNEXT: + /* Handle a Next button click, if necessary */ + PropSheet_SetCurSel(GetParent(hwndDlg), 0, 4); + break; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; } static INT_PTR CALLBACK SearchDrvDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - DWORD dwThreadId; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - DWORD dwStyle; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - DevInstData->hDialog = hwndDlg; - hwndControl = GetParent(hwndDlg); - - /* Center the wizard window */ - CenterWindow (hwndControl); - - SendDlgItemMessage(hwndDlg, - IDC_DEVICE, - WM_SETTEXT, - 0, - (LPARAM) DevInstData->buffer); - - /* Hide the system menu */ - dwStyle = GetWindowLong(hwndControl, GWL_STYLE); - SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); - } - break; - - case WM_SEARCH_FINISHED: - { - CloseHandle(hThread); - hThread = 0; - if (wParam == 0) - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_NODRIVER); - else - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_FINISHPAGE); - break; - } - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - PropSheet_SetWizButtons(GetParent(hwndDlg), !PSWIZB_NEXT | !PSWIZB_BACK); - hThread = CreateThread( NULL, 0, FindDriverProc, DevInstData, 0, &dwThreadId); - break; - - case PSN_KILLACTIVE: - if (hThread != 0) - { - SetWindowLong ( hwndDlg, DWL_MSGRESULT, TRUE); - return TRUE; - } - break; - case PSN_WIZNEXT: - /* Handle a Next button click, if necessary */ - break; - - default: - break; - } - } - break; - - default: - break; - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PDEVINSTDATA DevInstData; + DWORD dwThreadId; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + DWORD dwStyle; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + DevInstData->hDialog = hwndDlg; + hwndControl = GetParent(hwndDlg); + + /* Center the wizard window */ + CenterWindow (hwndControl); + + SendDlgItemMessage( + hwndDlg, + IDC_DEVICE, + WM_SETTEXT, + 0, + (LPARAM) DevInstData->buffer); + + /* Hide the system menu */ + dwStyle = GetWindowLong(hwndControl, GWL_STYLE); + SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU); + break; + } + + case WM_SEARCH_FINISHED: + { + CloseHandle(hThread); + hThread = 0; + if (wParam == 0) + PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_NODRIVER); + else + PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_FINISHPAGE); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + PropSheet_SetWizButtons(GetParent(hwndDlg), !PSWIZB_NEXT | !PSWIZB_BACK); + hThread = CreateThread( NULL, 0, FindDriverProc, DevInstData, 0, &dwThreadId); + break; + + case PSN_KILLACTIVE: + if (hThread != 0) + { + SetWindowLong ( hwndDlg, DWL_MSGRESULT, TRUE); + return TRUE; + } + break; + + case PSN_WIZNEXT: + /* Handle a Next button click, if necessary */ + break; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; } static DWORD WINAPI FindDriverProc( - IN LPVOID lpParam) -{ - TCHAR drive[] = {'?',':',0}; - size_t nType; - DWORD dwDrives; - PDEVINSTDATA DevInstData; - DWORD config_flags; - UINT i = 1; - - DevInstData = (PDEVINSTDATA)lpParam; - - dwDrives = GetLogicalDrives(); - for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) - { - if (dwDrives & i) - { - nType = GetDriveType( drive ); - if ((nType == DRIVE_CDROM)) - //if ((nType == DRIVE_CDROM) || (nType == DRIVE_FIXED)) - { - /* search for inf file */ - if (SearchDriver ( DevInstData, drive )) - { - /* if we found a valid driver inf... */ - if (FindDriver ( DevInstData )) - { - InstallDriver ( DevInstData ); - PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0); - return 0; - } - } - } - } - i <<= 1; - } - - /* update device configuration */ - if(SetupDiGetDeviceRegistryProperty(DevInstData->hDevInfo, - &DevInstData->devInfoData, - SPDRP_CONFIGFLAGS, - NULL, - (BYTE *)&config_flags, - sizeof(config_flags), - NULL)) - { - config_flags |= CONFIGFLAG_FAILEDINSTALL; - SetupDiSetDeviceRegistryProperty( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - SPDRP_CONFIGFLAGS, - (BYTE *)&config_flags, sizeof(config_flags) ); - } - - PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0); - return 0; + IN LPVOID lpParam) +{ + TCHAR drive[] = {'?',':',0}; + size_t nType; + DWORD dwDrives; + PDEVINSTDATA DevInstData; + DWORD config_flags; + UINT i = 1; + + DevInstData = (PDEVINSTDATA)lpParam; + + dwDrives = GetLogicalDrives(); + for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) + { + if (dwDrives & i) + { + nType = GetDriveType( drive ); + if (nType == DRIVE_CDROM) + { + /* search for inf file */ + if (SearchDriver ( DevInstData, drive )) + { + /* if we found a valid driver inf... */ + if (FindDriver ( DevInstData )) + { + InstallDriver ( DevInstData ); + PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0); + return 0; + } + } + } + } + i <<= 1; + } + + /* update device configuration */ + if (SetupDiGetDeviceRegistryProperty( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDRP_CONFIGFLAGS, + NULL, + (BYTE *)&config_flags, + sizeof(config_flags), + NULL)) + { + config_flags |= CONFIGFLAG_FAILEDINSTALL; + SetupDiSetDeviceRegistryProperty( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDRP_CONFIGFLAGS, + (BYTE *)&config_flags, sizeof(config_flags) ); + } + + PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0); + return 0; } static INT_PTR CALLBACK FinishDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - - /* Retrieve pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); - ShowWindow (hwndControl, SW_HIDE); - EnableWindow (hwndControl, FALSE); - - SendDlgItemMessage(hwndDlg, - IDC_DEVICE, - WM_SETTEXT, - 0, - (LPARAM) DevInstData->drvInfoData.Description); - - /* Set title font */ - SendDlgItemMessage(hwndDlg, - IDC_FINISHTITLE, - WM_SETFONT, - (WPARAM)DevInstData->hTitleFont, - (LPARAM)TRUE); - } - break; - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the correct buttons on for the active page */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH); - break; - - case PSN_WIZBACK: - /* Handle a Back button click, if necessary */ - break; - - case PSN_WIZFINISH: - /* Handle a Finish button click, if necessary */ - break; - - default: - break; - } - } - break; - - default: - break; - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + + PDEVINSTDATA DevInstData; + + /* Retrieve pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); + ShowWindow (hwndControl, SW_HIDE); + EnableWindow (hwndControl, FALSE); + + SendDlgItemMessage( + hwndDlg, + IDC_DEVICE, + WM_SETTEXT, + 0, + (LPARAM) DevInstData->drvInfoData.Description); + + /* Set title font */ + SendDlgItemMessage( + hwndDlg, + IDC_FINISHTITLE, + WM_SETFONT, + (WPARAM)DevInstData->hTitleFont, + (LPARAM)TRUE); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the correct buttons on for the active page */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH); + break; + + case PSN_WIZBACK: + /* Handle a Back button click, if necessary */ + break; + + case PSN_WIZFINISH: + /* Handle a Finish button click, if necessary */ + break; + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; } static INT_PTR CALLBACK InstFailDlgProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - - PDEVINSTDATA DevInstData; - - /* Get pointer to the global setup data */ - DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - HWND hwndControl; - BOOL DisableableDevice = FALSE; - - DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); - - hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); - ShowWindow (hwndControl, SW_HIDE); - EnableWindow (hwndControl, FALSE); - - /* Set title font */ - SendDlgItemMessage(hwndDlg, - IDC_FINISHTITLE, - WM_SETFONT, - (WPARAM)DevInstData->hTitleFont, - (LPARAM)TRUE); - - /* disable the "do not show this dialog anymore" checkbox - if the device cannot be disabled */ - CanDisableDevice(DevInstData->devInfoData.DevInst, - NULL, - &DisableableDevice); - EnableWindow(GetDlgItem(hwndDlg, - IDC_DONOTSHOWDLG), - DisableableDevice); - } - break; - - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - - switch (lpnm->code) - { - case PSN_SETACTIVE: - /* Enable the correct buttons on for the active page */ - PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH); - break; - - case PSN_WIZBACK: - PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_WELCOMEPAGE); - /* Handle a Back button click, if necessary */ - break; - - case PSN_WIZFINISH: - { - BOOL DisableableDevice = FALSE; - BOOL IsStarted = FALSE; - - if (CanDisableDevice(DevInstData->devInfoData.DevInst, - NULL, - &DisableableDevice) && - DisableableDevice && - IsDeviceStarted(DevInstData->devInfoData.DevInst, - NULL, - &IsStarted) && - !IsStarted && - SendDlgItemMessage(hwndDlg, IDC_DONOTSHOWDLG, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED) - { - /* disable the device */ - StartDevice(DevInstData->hDevInfo, - &DevInstData->devInfoData, - FALSE, - 0, - NULL); - } - break; - } - - default: - break; - } - } - break; - - default: - break; - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + + PDEVINSTDATA DevInstData; + + /* Get pointer to the global setup data */ + DevInstData = (PDEVINSTDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + HWND hwndControl; + BOOL DisableableDevice = FALSE; + + DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)DevInstData); + + hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL); + ShowWindow (hwndControl, SW_HIDE); + EnableWindow (hwndControl, FALSE); + + /* Set title font */ + SendDlgItemMessage( + hwndDlg, + IDC_FINISHTITLE, + WM_SETFONT, + (WPARAM)DevInstData->hTitleFont, + (LPARAM)TRUE); + + /* disable the "do not show this dialog anymore" checkbox + if the device cannot be disabled */ + CanDisableDevice( + DevInstData->devInfoData.DevInst, + NULL, + &DisableableDevice); + EnableWindow( + GetDlgItem(hwndDlg, IDC_DONOTSHOWDLG), + DisableableDevice); + break; + } + + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + + switch (lpnm->code) + { + case PSN_SETACTIVE: + /* Enable the correct buttons on for the active page */ + PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH); + break; + + case PSN_WIZBACK: + PropSheet_SetCurSel(GetParent(hwndDlg), 0, IDD_WELCOMEPAGE); + /* Handle a Back button click, if necessary */ + break; + + case PSN_WIZFINISH: + { + BOOL DisableableDevice = FALSE; + BOOL IsStarted = FALSE; + + if (CanDisableDevice(DevInstData->devInfoData.DevInst, + NULL, + &DisableableDevice) && + DisableableDevice && + IsDeviceStarted( + DevInstData->devInfoData.DevInst, + NULL, + &IsStarted) && + !IsStarted && + SendDlgItemMessage( + hwndDlg, + IDC_DONOTSHOWDLG, + BM_GETCHECK, + (WPARAM) 0, (LPARAM) 0) == BST_CHECKED) + { + /* disable the device */ + StartDevice( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + FALSE, + 0, + NULL); + } + break; + } + + default: + break; + } + break; + } + + default: + break; + } + + return FALSE; } static BOOL FindDriver( - IN PDEVINSTDATA DevInstData) -{ - SP_DEVINSTALL_PARAMS DevInstallParams = {0,}; - BOOL ret; - - DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); - if (!SetupDiGetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) - { - TRACE("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - DevInstallParams.FlagsEx |= DI_FLAGSEX_ALLOWEXCLUDEDDRVS; - if (!SetupDiSetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) - { - TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiBuildDriverInfoList(DevInstData->hDevInfo, &DevInstData->devInfoData, SPDIT_COMPATDRIVER); - if (!ret) - { - TRACE("SetupDiBuildDriverInfoList() failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - DevInstData->drvInfoData.cbSize = sizeof(SP_DRVINFO_DATA); - ret = SetupDiEnumDriverInfo( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - SPDIT_COMPATDRIVER, - 0, - &DevInstData->drvInfoData); - if (!ret) - { - if (GetLastError() == ERROR_NO_MORE_ITEMS) - return FALSE; - TRACE("SetupDiEnumDriverInfo() failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - TRACE("Installing driver %S: %S\n", DevInstData->drvInfoData.MfgName, DevInstData->drvInfoData.Description); - - return TRUE; + IN PDEVINSTDATA DevInstData) +{ + SP_DEVINSTALL_PARAMS DevInstallParams = {0,}; + BOOL ret; + + DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); + if (!SetupDiGetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) + { + TRACE("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + DevInstallParams.FlagsEx |= DI_FLAGSEX_ALLOWEXCLUDEDDRVS; + if (!SetupDiSetDeviceInstallParams(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) + { + TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiBuildDriverInfoList(DevInstData->hDevInfo, &DevInstData->devInfoData, SPDIT_COMPATDRIVER); + if (!ret) + { + TRACE("SetupDiBuildDriverInfoList() failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + DevInstData->drvInfoData.cbSize = sizeof(SP_DRVINFO_DATA); + ret = SetupDiEnumDriverInfo( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + SPDIT_COMPATDRIVER, + 0, + &DevInstData->drvInfoData); + if (!ret) + { + if (GetLastError() == ERROR_NO_MORE_ITEMS) + return FALSE; + TRACE("SetupDiEnumDriverInfo() failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + TRACE("Installing driver %S: %S\n", DevInstData->drvInfoData.MfgName, DevInstData->drvInfoData.Description); + + return TRUE; } static BOOL IsDots(IN LPCTSTR str) { - if(_tcscmp(str, _T(".")) && _tcscmp(str, _T(".."))) return FALSE; - return TRUE; + if(_tcscmp(str, _T(".")) && _tcscmp(str, _T(".."))) return FALSE; + return TRUE; } static LPTSTR GetFileExt(IN LPTSTR FileName) { - if (FileName == 0) - return _T(""); - - int i = _tcsclen(FileName); - while ((i >= 0) && (FileName[i] != _T('.'))) - i--; - - FileName = _tcslwr(FileName); - - if (i >= 0) - return &FileName[i]; - else - return _T(""); + if (FileName == 0) + return _T(""); + + int i = _tcsclen(FileName); + while ((i >= 0) && (FileName[i] != _T('.'))) + i--; + + FileName = _tcslwr(FileName); + + if (i >= 0) + return &FileName[i]; + else + return _T(""); } static BOOL SearchDriver( - IN PDEVINSTDATA DevInstData, - IN LPCTSTR Path) -{ - WIN32_FIND_DATA wfd; - SP_DEVINSTALL_PARAMS DevInstallParams; - TCHAR DirPath[MAX_PATH]; - TCHAR FileName[MAX_PATH]; - TCHAR FullPath[MAX_PATH]; - TCHAR LastDirPath[MAX_PATH] = _T(""); - TCHAR PathWithPattern[MAX_PATH]; - BOOL ok = TRUE; - BOOL ret; - HANDLE hFindFile; - - _tcscpy(DirPath, Path); - - if (DirPath[_tcsclen(DirPath) - 1] != '\\') - _tcscat(DirPath, _T("\\")); - - _tcscpy(PathWithPattern, DirPath); - _tcscat(PathWithPattern, _T("\\*")); - - for (hFindFile = FindFirstFile(PathWithPattern, &wfd); ((hFindFile != INVALID_HANDLE_VALUE) && ok); ok = FindNextFile(hFindFile, &wfd)) - { - - _tcscpy(FileName, wfd.cFileName); - if (IsDots(FileName)) continue; - - if((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - _tcscpy(FullPath, DirPath); - _tcscat(FullPath, FileName); - if(SearchDriver(DevInstData, FullPath)) - break; - } - else - { - LPCTSTR pszExtension = GetFileExt(FileName); - - if ((_tcscmp(pszExtension, _T(".inf")) == 0) && (_tcscmp(LastDirPath, DirPath) != 0)) - { - _tcscpy(LastDirPath, DirPath); - ZeroMemory (&DevInstallParams, sizeof(SP_DEVINSTALL_PARAMS)); - DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); - - ret = SetupDiGetDeviceInstallParams( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - &DevInstallParams); - - if (_tcsclen(DirPath) <= MAX_PATH) - { - memcpy(DevInstallParams.DriverPath, DirPath, (_tcsclen(DirPath) + 1) * sizeof(TCHAR)); - } - - ret = SetupDiSetDeviceInstallParams( - DevInstData->hDevInfo, - &DevInstData->devInfoData, - &DevInstallParams); - - if ( FindDriver ( DevInstData ) ) - { - if (hFindFile != INVALID_HANDLE_VALUE) - FindClose(hFindFile); - return TRUE; - } - - } - } - } - - if (hFindFile != INVALID_HANDLE_VALUE) - FindClose(hFindFile); - - return FALSE; + IN PDEVINSTDATA DevInstData, + IN LPCTSTR Path) +{ + WIN32_FIND_DATA wfd; + SP_DEVINSTALL_PARAMS DevInstallParams; + TCHAR DirPath[MAX_PATH]; + TCHAR FileName[MAX_PATH]; + TCHAR FullPath[MAX_PATH]; + TCHAR LastDirPath[MAX_PATH] = _T(""); + TCHAR PathWithPattern[MAX_PATH]; + BOOL ok = TRUE; + BOOL ret; + HANDLE hFindFile; + + _tcscpy(DirPath, Path); + + if (DirPath[_tcsclen(DirPath) - 1] != '\\') + _tcscat(DirPath, _T("\\")); + + _tcscpy(PathWithPattern, DirPath); + _tcscat(PathWithPattern, _T("\\*")); + + for (hFindFile = FindFirstFile(PathWithPattern, &wfd); ((hFindFile != INVALID_HANDLE_VALUE) && ok); ok = FindNextFile(hFindFile, &wfd)) + { + + _tcscpy(FileName, wfd.cFileName); + if (IsDots(FileName)) + continue; + + if((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + _tcscpy(FullPath, DirPath); + _tcscat(FullPath, FileName); + if(SearchDriver(DevInstData, FullPath)) + break; + } + else + { + LPCTSTR pszExtension = GetFileExt(FileName); + + if ((_tcscmp(pszExtension, _T(".inf")) == 0) && (_tcscmp(LastDirPath, DirPath) != 0)) + { + _tcscpy(LastDirPath, DirPath); + ZeroMemory (&DevInstallParams, sizeof(SP_DEVINSTALL_PARAMS)); + DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS); + + ret = SetupDiGetDeviceInstallParams( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + &DevInstallParams); + + if (_tcsclen(DirPath) <= MAX_PATH) + { + memcpy(DevInstallParams.DriverPath, DirPath, (_tcsclen(DirPath) + 1) * sizeof(TCHAR)); + } + + ret = SetupDiSetDeviceInstallParams( + DevInstData->hDevInfo, + &DevInstData->devInfoData, + &DevInstallParams); + + if ( FindDriver ( DevInstData ) ) + { + if (hFindFile != INVALID_HANDLE_VALUE) + FindClose(hFindFile); + return TRUE; + } + + } + } + } + + if (hFindFile != INVALID_HANDLE_VALUE) + FindClose(hFindFile); + + return FALSE; } static BOOL InstallDriver( - IN PDEVINSTDATA DevInstData) -{ - - BOOL ret; - - ret = SetupDiCallClassInstaller( - DIF_SELECTBESTCOMPATDRV, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_ALLOW_INSTALL, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_NEWDEVICEWIZARD_PREANALYZE, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_NEWDEVICEWIZARD_POSTANALYZE, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_INSTALLDEVICEFILES, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_REGISTER_COINSTALLERS, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_INSTALLINTERFACES, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_INSTALLDEVICE, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_NEWDEVICEWIZARD_FINISHINSTALL, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - ret = SetupDiCallClassInstaller( - DIF_DESTROYPRIVATEDATA, - DevInstData->hDevInfo, - &DevInstData->devInfoData); - if (!ret) - { - TRACE("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%lx\n", GetLastError()); - return FALSE; - } - - return TRUE; - + IN PDEVINSTDATA DevInstData) +{ + + BOOL ret; + + ret = SetupDiCallClassInstaller( + DIF_SELECTBESTCOMPATDRV, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_ALLOW_INSTALL, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_NEWDEVICEWIZARD_PREANALYZE, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_NEWDEVICEWIZARD_POSTANALYZE, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_INSTALLDEVICEFILES, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_REGISTER_COINSTALLERS, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_INSTALLINTERFACES, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_INSTALLDEVICE, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_NEWDEVICEWIZARD_FINISHINSTALL, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + ret = SetupDiCallClassInstaller( + DIF_DESTROYPRIVATEDATA, + DevInstData->hDevInfo, + &DevInstData->devInfoData); + if (!ret) + { + TRACE("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%lx\n", GetLastError()); + return FALSE; + } + + return TRUE; } static VOID CleanUp(VOID) { - if (DevInstData.devInfoData.cbSize != 0) - { - if (!SetupDiDestroyDriverInfoList(DevInstData.hDevInfo, &DevInstData.devInfoData, SPDIT_COMPATDRIVER)) - TRACE("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError()); - } - - if (DevInstData.hDevInfo != INVALID_HANDLE_VALUE) - { - if (!SetupDiDestroyDeviceInfoList(DevInstData.hDevInfo)) - TRACE("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError()); - } - - if (DevInstData.buffer) - HeapFree(GetProcessHeap(), 0, DevInstData.buffer); + if (DevInstData.devInfoData.cbSize != 0) + { + if (!SetupDiDestroyDriverInfoList(DevInstData.hDevInfo, &DevInstData.devInfoData, SPDIT_COMPATDRIVER)) + TRACE("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError()); + } + + if (DevInstData.hDevInfo != INVALID_HANDLE_VALUE) + { + if (!SetupDiDestroyDeviceInfoList(DevInstData.hDevInfo)) + TRACE("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError()); + } + + if (DevInstData.buffer) + HeapFree(GetProcessHeap(), 0, DevInstData.buffer); } @@ -1034,208 +1055,203 @@ */ BOOL WINAPI DevInstallW( - IN HWND hWndParent, - IN HINSTANCE hInstance, - IN LPCWSTR InstanceId, - IN INT Show) -{ - - PROPSHEETHEADER psh; - HPROPSHEETPAGE ahpsp[5]; - PROPSHEETPAGE psp; - BOOL ret; - DWORD config_flags; - - if (!IsUserAdmin()) - { - /* XP kills the process... */ - ExitProcess(ERROR_ACCESS_DENIED); - } - - /* Clear devinst data */ - ZeroMemory(&DevInstData, sizeof(DEVINSTDATA)); - DevInstData.devInfoData.cbSize = 0; /* Tell if the devInfoData is valid */ - - - DevInstData.hDevInfo = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); - if (DevInstData.hDevInfo == INVALID_HANDLE_VALUE) - { - TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%lx\n", GetLastError()); - CleanUp(); - return FALSE; - } - - DevInstData.devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); - ret = SetupDiOpenDeviceInfoW( - DevInstData.hDevInfo, - InstanceId, - NULL, - 0, /* Open flags */ - &DevInstData.devInfoData); - if (!ret) - { - TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); - DevInstData.devInfoData.cbSize = 0; - CleanUp(); - return FALSE; - } - - SetLastError(ERROR_GEN_FAILURE); - ret = SetupDiGetDeviceRegistryProperty( - DevInstData.hDevInfo, - &DevInstData.devInfoData, - SPDRP_DEVICEDESC, - &DevInstData.regDataType, - NULL, 0, - &DevInstData.requiredSize); - - if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER && DevInstData.regDataType == REG_SZ) - { - DevInstData.buffer = HeapAlloc(GetProcessHeap(), 0, DevInstData.requiredSize); - if (!DevInstData.buffer) - { - TRACE("HeapAlloc() failed\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - } - else - { - ret = SetupDiGetDeviceRegistryProperty( - DevInstData.hDevInfo, - &DevInstData.devInfoData, - SPDRP_DEVICEDESC, - &DevInstData.regDataType, - DevInstData.buffer, DevInstData.requiredSize, - &DevInstData.requiredSize); - } - } - if (!ret) - { - TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); - CleanUp(); - return FALSE; - } - - if(SetupDiGetDeviceRegistryProperty(DevInstData.hDevInfo, - &DevInstData.devInfoData, - SPDRP_CONFIGFLAGS, - NULL, - (BYTE *)&config_flags, - sizeof(config_flags), - NULL)) - { - if (config_flags & CONFIGFLAG_FAILEDINSTALL) - { - CleanUp(); - return TRUE; - } - } - /* - else - { - swprintf(buf, _T("%ld"), GetLastError()); - MessageBox(0,buf,buf,0); - } - */ - - TRACE("Installing %S (%S)\n", DevInstData.buffer, InstanceId); - - if ((!FindDriver(&DevInstData)) && (Show != SW_HIDE)) - { - - /* Create the Welcome page */ - ZeroMemory (&psp, sizeof(PROPSHEETPAGE)); - psp.dwSize = sizeof(PROPSHEETPAGE); - psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.hInstance = hDllInstance; - psp.lParam = (LPARAM)&DevInstData; - psp.pfnDlgProc = WelcomeDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE); - ahpsp[IDD_WELCOMEPAGE] = CreatePropertySheetPage(&psp); - - /* Create the Select Source page */ - psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; - psp.pfnDlgProc = CHSourceDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE); - ahpsp[IDD_CHSOURCE] = CreatePropertySheetPage(&psp); - - /* Create the Search driver page */ - psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; - psp.pfnDlgProc = SearchDrvDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV); - ahpsp[IDD_SEARCHDRV] = CreatePropertySheetPage(&psp); - - /* Create the Finish page */ - psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = FinishDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE); - ahpsp[IDD_FINISHPAGE] = CreatePropertySheetPage(&psp); - - /* Create the Install failed page */ - psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = InstFailDlgProc; - psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER); - ahpsp[IDD_NODRIVER] = CreatePropertySheetPage(&psp); - - /* Create the property sheet */ - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER; - psh.hInstance = hDllInstance; - psh.hwndParent = NULL; - psh.nPages = 5; - psh.nStartPage = 0; - psh.phpage = ahpsp; - psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK); - psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER); - - /* Create title font */ - DevInstData.hTitleFont = CreateTitleFont(); - - /* Display the wizard */ - PropertySheet(&psh); - - DeleteObject(DevInstData.hTitleFont); - - } - else - { - InstallDriver ( &DevInstData ); - } - - CleanUp(); - return TRUE; + IN HWND hWndParent, + IN HINSTANCE hInstance, + IN LPCWSTR InstanceId, + IN INT Show) +{ + + PROPSHEETHEADER psh; + HPROPSHEETPAGE ahpsp[5]; + PROPSHEETPAGE psp; + BOOL ret; + DWORD config_flags; + + if (!IsUserAdmin()) + { + /* XP kills the process... */ + ExitProcess(ERROR_ACCESS_DENIED); + } + + /* Clear devinst data */ + ZeroMemory(&DevInstData, sizeof(DEVINSTDATA)); + DevInstData.devInfoData.cbSize = 0; /* Tell if the devInfoData is valid */ + + DevInstData.hDevInfo = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); + if (DevInstData.hDevInfo == INVALID_HANDLE_VALUE) + { + TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%lx\n", GetLastError()); + CleanUp(); + return FALSE; + } + + DevInstData.devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + ret = SetupDiOpenDeviceInfoW( + DevInstData.hDevInfo, + InstanceId, + NULL, + 0, /* Open flags */ + &DevInstData.devInfoData); + if (!ret) + { + TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); + DevInstData.devInfoData.cbSize = 0; + CleanUp(); + return FALSE; + } + + SetLastError(ERROR_GEN_FAILURE); + ret = SetupDiGetDeviceRegistryProperty( + DevInstData.hDevInfo, + &DevInstData.devInfoData, + SPDRP_DEVICEDESC, + &DevInstData.regDataType, + NULL, 0, + &DevInstData.requiredSize); + + if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER && DevInstData.regDataType == REG_SZ) + { + DevInstData.buffer = HeapAlloc(GetProcessHeap(), 0, DevInstData.requiredSize); + if (!DevInstData.buffer) + { + TRACE("HeapAlloc() failed\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + } + else + { + ret = SetupDiGetDeviceRegistryProperty( + DevInstData.hDevInfo, + &DevInstData.devInfoData, + SPDRP_DEVICEDESC, + &DevInstData.regDataType, + DevInstData.buffer, DevInstData.requiredSize, + &DevInstData.requiredSize); + } + } + if (!ret) + { + TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); + CleanUp(); + return FALSE; + } + + if (SetupDiGetDeviceRegistryProperty( + DevInstData.hDevInfo, + &DevInstData.devInfoData, + SPDRP_CONFIGFLAGS, + NULL, + (BYTE *)&config_flags, + sizeof(config_flags), + NULL)) + { + if (config_flags & CONFIGFLAG_FAILEDINSTALL) + { + CleanUp(); + return TRUE; + } + } + + TRACE("Installing %S (%S)\n", DevInstData.buffer, InstanceId); + + if ((!FindDriver(&DevInstData)) && (Show != SW_HIDE)) + { + + /* Create the Welcome page */ + ZeroMemory (&psp, sizeof(PROPSHEETPAGE)); + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.hInstance = hDllInstance; + psp.lParam = (LPARAM)&DevInstData; + psp.pfnDlgProc = WelcomeDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE); + ahpsp[IDD_WELCOMEPAGE] = CreatePropertySheetPage(&psp); + + /* Create the Select Source page */ + psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + psp.pfnDlgProc = CHSourceDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE); + ahpsp[IDD_CHSOURCE] = CreatePropertySheetPage(&psp); + + /* Create the Search driver page */ + psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + psp.pfnDlgProc = SearchDrvDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV); + ahpsp[IDD_SEARCHDRV] = CreatePropertySheetPage(&psp); + + /* Create the Finish page */ + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.pfnDlgProc = FinishDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE); + ahpsp[IDD_FINISHPAGE] = CreatePropertySheetPage(&psp); + + /* Create the Install failed page */ + psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; + psp.pfnDlgProc = InstFailDlgProc; + psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER); + ahpsp[IDD_NODRIVER] = CreatePropertySheetPage(&psp); + + /* Create the property sheet */ + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER; + psh.hInstance = hDllInstance; + psh.hwndParent = NULL; + psh.nPages = 5; + psh.nStartPage = 0; + psh.phpage = ahpsp; + psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK); + psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER); + + /* Create title font */ + DevInstData.hTitleFont = CreateTitleFont(); + + /* Display the wizard */ + PropertySheet(&psh); + + DeleteObject(DevInstData.hTitleFont); + + } + else + { + InstallDriver ( &DevInstData ); + } + + CleanUp(); + return TRUE; } /* * @unimplemented */ BOOL WINAPI -ClientSideInstallW(IN HWND hWndOwner, - IN DWORD dwUnknownFlags, - IN LPWSTR lpNamedPipeName) -{ - /* NOTE: pNamedPipeName is in the format: - * "\\.\pipe\PNP_Device_Install_Pipe_0.{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" - */ - return FALSE; +ClientSideInstallW( + IN HWND hWndOwner, + IN DWORD dwUnknownFlags, + IN LPWSTR lpNamedPipeName) +{ + /* NOTE: pNamedPipeName is in the format: + * "\\.\pipe\PNP_Device_Install_Pipe_0.{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" + */ + FIXME("Stub\n"); + return FALSE; } BOOL WINAPI DllMain( - IN HINSTANCE hInstance, - IN DWORD dwReason, - IN LPVOID lpReserved) -{ - if (dwReason == DLL_PROCESS_ATTACH) - { - INITCOMMONCONTROLSEX InitControls; - - DisableThreadLibraryCalls(hInstance); - - InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX); - InitControls.dwICC = ICC_PROGRESS_CLASS; - InitCommonControlsEx(&InitControls); - hDllInstance = hInstance; - } - - return TRUE; -} + IN HINSTANCE hInstance, + IN DWORD dwReason, + IN LPVOID lpReserved) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + INITCOMMONCONTROLSEX InitControls; + + DisableThreadLibraryCalls(hInstance); + + InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitControls.dwICC = ICC_PROGRESS_CLASS; + InitCommonControlsEx(&InitControls); + hDllInstance = hInstance; + } + + return TRUE; +}
18 years, 9 months
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
33
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
Results per page:
10
25
50
100
200