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
September 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
22 participants
582 discussions
Start a n
N
ew thread
[weiden] 18061: - fixed uninitialized variable warning
by weiden@svn.reactos.com
- fixed uninitialized variable warning - ProbeAndCaptureUnicodeString should check if allocating memory succeeded Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h Modified: trunk/reactos/ntoskrnl/io/driver.c _____ Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h 2005-09-25 17:25:55 UTC (rev 18060) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h 2005-09-25 17:49:14 UTC (rev 18061) @@ -130,11 +130,16 @@ /* Allocate space for the buffer */ Buffer = ExAllocatePool(PagedPool, Dest->MaximumLength); - /* Copy it */ - RtlCopyMemory(Buffer, Dest->Buffer, Dest->MaximumLength); + if (Buffer != NULL) + { + /* Copy it */ + RtlCopyMemory(Buffer, Dest->Buffer, Dest->MaximumLength); - /* Set it as the buffer */ - Dest->Buffer = Buffer; + /* Set it as the buffer */ + Dest->Buffer = Buffer; + } + else + Status = STATUS_INSUFFICIENT_RESOURCES; /* Return */ return Status; _____ Modified: trunk/reactos/ntoskrnl/io/driver.c --- trunk/reactos/ntoskrnl/io/driver.c 2005-09-25 17:25:55 UTC (rev 18060) +++ trunk/reactos/ntoskrnl/io/driver.c 2005-09-25 17:49:14 UTC (rev 18061) @@ -1852,7 +1852,7 @@ RTL_QUERY_REGISTRY_TABLE QueryTable[3]; UNICODE_STRING ImagePath; UNICODE_STRING ServiceName; - UNICODE_STRING CapturedDriverServiceName; + UNICODE_STRING CapturedDriverServiceName = {0}; KPROCESSOR_MODE PreviousMode; NTSTATUS Status; ULONG Type;
19 years, 3 months
1
0
0
0
[hbirr] 18060: - Don't convert the device name, if the name is a NULL pointer (in QueryDosDeviceA).
by hbirr@svn.reactos.com
- Don't convert the device name, if the name is a NULL pointer (in QueryDosDeviceA). - Convert the string in several steps, because the string may be longer than 32k characters (in QueryDosDeviceA). Modified: trunk/reactos/lib/kernel32/file/dosdev.c _____ Modified: trunk/reactos/lib/kernel32/file/dosdev.c --- trunk/reactos/lib/kernel32/file/dosdev.c 2005-09-25 17:21:45 UTC (rev 18059) +++ trunk/reactos/lib/kernel32/file/dosdev.c 2005-09-25 17:25:55 UTC (rev 18060) @@ -96,51 +96,68 @@ UNICODE_STRING TargetPathU; ANSI_STRING TargetPathA; DWORD Length; + DWORD CurrentLength; + PWCHAR Buffer; - if (!RtlCreateUnicodeStringFromAsciiz (&DeviceNameU, - (LPSTR)lpDeviceName)) + if (lpDeviceName) { - SetLastError (ERROR_NOT_ENOUGH_MEMORY); - return 0; + if (!RtlCreateUnicodeStringFromAsciiz (&DeviceNameU, + (LPSTR)lpDeviceName)) + { + SetLastError (ERROR_NOT_ENOUGH_MEMORY); + return 0; + } } - - TargetPathU.Length = 0; - TargetPathU.MaximumLength = (USHORT)ucchMax * sizeof(WCHAR); - TargetPathU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (), - 0, - TargetPathU.MaximumLength); - if (TargetPathU.Buffer == NULL) + Buffer = RtlAllocateHeap (RtlGetProcessHeap (), + 0, + ucchMax * sizeof(WCHAR)); + if (Buffer == NULL) { + if (lpDeviceName) + { + RtlFreeHeap (RtlGetProcessHeap (), + 0, + DeviceNameU.Buffer); + } SetLastError (ERROR_NOT_ENOUGH_MEMORY); return 0; } - Length = QueryDosDeviceW (DeviceNameU.Buffer, - TargetPathU.Buffer, + Length = QueryDosDeviceW (lpDeviceName ? DeviceNameU.Buffer : NULL, + Buffer, ucchMax); if (Length != 0) { - TargetPathU.Length = Length * sizeof(WCHAR); - - TargetPathA.Length = 0; - TargetPathA.MaximumLength = (USHORT)ucchMax; TargetPathA.Buffer = lpTargetPath; + TargetPathU.Buffer = Buffer; + ucchMax = Length; - RtlUnicodeStringToAnsiString (&TargetPathA, - &TargetPathU, - FALSE); + while (ucchMax) + { + CurrentLength = min (ucchMax, MAXUSHORT / 2); + TargetPathU.MaximumLength = TargetPathU.Length = CurrentLength * sizeof(WCHAR); + + TargetPathA.Length = 0; + TargetPathA.MaximumLength = CurrentLength; - DPRINT ("TargetPathU: '%wZ'\n", &TargetPathU); - DPRINT ("TargetPathA: '%Z'\n", &TargetPathA); + RtlUnicodeStringToAnsiString (&TargetPathA, + &TargetPathU, + FALSE); + ucchMax -= CurrentLength; + TargetPathA.Buffer += TargetPathA.Length; + TargetPathU.Buffer += TargetPathU.Length / sizeof(WCHAR); + } } RtlFreeHeap (RtlGetProcessHeap (), 0, - TargetPathU.Buffer); - RtlFreeHeap (RtlGetProcessHeap (), - 0, - DeviceNameU.Buffer); - + Buffer); + if (lpDeviceName) + { + RtlFreeHeap (RtlGetProcessHeap (), + 0, + DeviceNameU.Buffer); + } return Length; }
19 years, 3 months
1
0
0
0
[weiden] 18059: fixed uninitialized variable warnings
by weiden@svn.reactos.com
fixed uninitialized variable warnings Modified: trunk/reactos/drivers/usb/miniport/common/fdo.c Modified: trunk/reactos/drivers/usb/usbhub/fdo.c Modified: trunk/reactos/drivers/usb/usbport/message.c _____ Modified: trunk/reactos/drivers/usb/miniport/common/fdo.c --- trunk/reactos/drivers/usb/miniport/common/fdo.c 2005-09-25 17:16:03 UTC (rev 18058) +++ trunk/reactos/drivers/usb/miniport/common/fdo.c 2005-09-25 17:21:45 UTC (rev 18059) @@ -227,7 +227,7 @@ { case BusRelations: { - PDEVICE_RELATIONS DeviceRelations; + PDEVICE_RELATIONS DeviceRelations = NULL; DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n"); Status = UsbMpFdoQueryBusRelations(DeviceObject, &DeviceRelations); Information = (ULONG_PTR)DeviceRelations; _____ Modified: trunk/reactos/drivers/usb/usbhub/fdo.c --- trunk/reactos/drivers/usb/usbhub/fdo.c 2005-09-25 17:16:03 UTC (rev 18058) +++ trunk/reactos/drivers/usb/usbhub/fdo.c 2005-09-25 17:21:45 UTC (rev 18059) @@ -252,7 +252,7 @@ { case BusRelations: { - PDEVICE_RELATIONS DeviceRelations; + PDEVICE_RELATIONS DeviceRelations = NULL; DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n"); Status = UsbhubFdoQueryBusRelations(DeviceObject, &DeviceRelations); Information = (ULONG_PTR)DeviceRelations; _____ Modified: trunk/reactos/drivers/usb/usbport/message.c --- trunk/reactos/drivers/usb/usbport/message.c 2005-09-25 17:16:03 UTC (rev 18058) +++ trunk/reactos/drivers/usb/usbport/message.c 2005-09-25 17:21:45 UTC (rev 18059) @@ -569,7 +569,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char index, void *buf, int size) { int i = 5; - int result; + int result = 0; memset(buf,0,size); // Make sure we parse really received data
19 years, 3 months
1
0
0
0
[weiden] 18058: fixed uninitialized variable warning
by weiden@svn.reactos.com
fixed uninitialized variable warning Modified: trunk/reactos/apps/utils/net/arp/arp.c _____ Modified: trunk/reactos/apps/utils/net/arp/arp.c --- trunk/reactos/apps/utils/net/arp/arp.c 2005-09-25 17:01:24 UTC (rev 18057) +++ trunk/reactos/apps/utils/net/arp/arp.c 2005-09-25 17:16:03 UTC (rev 18058) @@ -253,7 +253,7 @@ PMIB_IPNETROW pAddHost; PMIB_IPADDRTABLE pIpAddrTable; PMIB_IPNETTABLE pIpNetTable; - DWORD dwIpAddr; + DWORD dwIpAddr = 0; DWORD dwSize = 0; ULONG ulSize = 0; INT iRet, i, val; @@ -395,7 +395,7 @@ PMIB_IPADDRTABLE pIpAddrTable; PMIB_IPNETTABLE pIpNetTable; ULONG ulSize = 0; - DWORD dwIpAddr; + DWORD dwIpAddr = 0; DWORD dwSize = 0; INT iRet; BOOL bFlushTable = FALSE;
19 years, 3 months
1
0
0
0
[gedmurphy] 18057: added more functionality to arp
by gedmurphy@svn.reactos.com
added more functionality to arp - display correct interface index - delete all hosts with -d * - display informative error messages - better argument control - clean up formatting Modified: trunk/reactos/apps/utils/net/arp/arp.c Deleted: trunk/reactos/apps/utils/net/arp/trace.c Deleted: trunk/reactos/apps/utils/net/arp/trace.h _____ Modified: trunk/reactos/apps/utils/net/arp/arp.c --- trunk/reactos/apps/utils/net/arp/arp.c 2005-09-25 16:56:52 UTC (rev 18056) +++ trunk/reactos/apps/utils/net/arp/arp.c 2005-09-25 17:01:24 UTC (rev 18057) @@ -1,4 +1,23 @@ -/* +/* + * ReactOS Win32 Applications + * Copyright (C) 2005 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS arp utility * FILE: apps/utils/net/arp/arp.c @@ -9,7 +28,6 @@ * */ -#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> #include <stdlib.h> @@ -19,27 +37,102 @@ #include <winsock2.h> #include <iphlpapi.h> - +#define WIN32_LEAN_AND_MEAN +#define UNICODE +#define _UNICODE + /* * Globals - */ + */ const char SEPERATOR = '-'; - - - +int _CRT_glob = 0; // stop * from listing dir files in arp -d * + + /* * function declerations - */ + */ +DWORD DoFormatMessage(DWORD ErrorCode); +INT PrintEntries(PMIB_IPNETROW pIpAddRow); INT DisplayArpEntries(PTCHAR pszInetAddr, PTCHAR pszIfAddr); -INT PrintEntries(PMIB_IPNETROW pIpAddRow); INT Addhost(PTCHAR pszInetAddr, PTCHAR pszEthAddr, PTCHAR pszIfAddr); INT Deletehost(PTCHAR pszInetAddr, PTCHAR pszIfAddr); VOID Usage(VOID); - - - + + /* + * convert error code into meaningful message + */ +DWORD DoFormatMessage(DWORD ErrorCode) +{ + LPVOID lpMsgBuf; + DWORD RetVal; + /* double brackets to silence the assignment warning message */ + if ((RetVal = FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + ErrorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ + (LPTSTR) &lpMsgBuf, + 0, + NULL ))) { + _tprintf(_T("%s"), (LPTSTR)lpMsgBuf); + + LocalFree(lpMsgBuf); + /* return number of TCHAR's stored in output buffer + * excluding '\0' - as FormatMessage does*/ + return RetVal; + } + else + return 0; +} + + + +/* * + * Takes an ARP entry and prints the IP address, + * the MAC address and the entry type to screen + * + */ +INT PrintEntries(PMIB_IPNETROW pIpAddRow) +{ + IN_ADDR inaddr; + TCHAR cMacAddr[20]; + + /* print IP addresses */ + inaddr.S_un.S_addr = pIpAddRow->dwAddr; + _tprintf(_T(" %-22s"), inet_ntoa(inaddr)); + + /* print MAC address */ + _stprintf(cMacAddr, _T("%02x-%02x-%02x-%02x-%02x-%02x"), + pIpAddRow->bPhysAddr[0], + pIpAddRow->bPhysAddr[1], + pIpAddRow->bPhysAddr[2], + pIpAddRow->bPhysAddr[3], + pIpAddRow->bPhysAddr[4], + pIpAddRow->bPhysAddr[5]); + _tprintf(_T("%-22s"), cMacAddr); + + /* print cache type */ + switch (pIpAddRow->dwType) + { + case MIB_IPNET_TYPE_DYNAMIC : _tprintf(_T("dynamic\n")); + break; + case MIB_IPNET_TYPE_STATIC : _tprintf(_T("static\n")); + break; + case MIB_IPNET_TYPE_INVALID : _tprintf(_T("invalid\n")); + break; + case MIB_IPNET_TYPE_OTHER : _tprintf(_T("other\n")); + break; + } + return EXIT_SUCCESS; +} + + +/* + * * Takes optional parameters of an internet address and interface address. * Retrieve all entries in the ARP cache. If an internet address is * specified, display the ARP entry relating to that address. If an @@ -59,136 +152,99 @@ DWORD dwSize = 0; PTCHAR pszIpAddr; TCHAR szIntIpAddr[20]; - + /* Return required buffer size */ GetIpNetTable(NULL, &ulSize, 0); - + /* allocate memory for ARP address table */ pIpNetTable = (PMIB_IPNETTABLE) malloc(ulSize * sizeof(BYTE)); ZeroMemory(pIpNetTable, sizeof(*pIpNetTable)); - + /* get Arp address table */ - if (pIpNetTable != NULL) { + if (pIpNetTable != NULL) GetIpNetTable(pIpNetTable, &ulSize, TRUE); - } else { + else + { _tprintf(_T("failed to allocate memory for GetIpNetTable\n")); free(pIpNetTable); - return -1; + exit(EXIT_FAILURE); } - - /* check there are entries in the table */ - if (pIpNetTable->dwNumEntries == 0) { + + /* check there are entries in the table */ + if (pIpNetTable->dwNumEntries == 0) + { _tprintf(_T("No ARP entires found\n")); free(pIpNetTable); - return -1; + exit(EXIT_FAILURE); } - - - + + + /* try doing this in the way it's done above, it's clearer */ /* Retrieve the interface-to-ip address mapping - * table to get the IP address for adapter */ + * table to get the IP address for adapter */ pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize); GetIpAddrTable(pIpAddrTable, &dwSize, 0); // NULL ? - + pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize); //ZeroMemory(pIpAddrTable, sizeof(*pIpAddrTable)); - - if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR) { // NO_ERROR = 0 + + if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR) + { _tprintf(_T("GetIpAddrTable failed: %d\n"), iRet); _tprintf(_T("error: %d\n"), WSAGetLastError()); } - - - for (k=0; k < pIpAddrTable->dwNumEntries; k++) { - if (pIpNetTable->table[0].dwIndex == pIpAddrTable->table[k].dwIndex) { - //printf("printing pIpAddrTable->table[?].dwIndex = %lx\n", pIpNetTable->table[k].dwIndex); + + + for (k=0; k < pIpAddrTable->dwNumEntries; k++) + { + if (pIpNetTable->table[0].dwIndex == pIpAddrTable->table[k].dwIndex) + { + //printf("debug print: pIpAddrTable->table[?].dwIndex = %lx\n", pIpNetTable->table[k].dwIndex); inaddr2.s_addr = pIpAddrTable->table[k].dwAddr; pszIpAddr = inet_ntoa(inaddr2); strcpy(szIntIpAddr, pszIpAddr); } - } - - + } + + /* print header, including interface IP address and index number */ _tprintf(_T("\nInterface: %s --- 0x%lx \n"), szIntIpAddr, pIpNetTable->table[0].dwIndex); _tprintf(_T(" Internet Address Physical Address Type\n")); - + /* go through all ARP entries */ - for (i=0; i < pIpNetTable->dwNumEntries; i++) { - + for (i=0; i < pIpNetTable->dwNumEntries; i++) + { + /* if the user has supplied their own internet addesss * * only print the arp entry which matches that */ - if (pszInetAddr) { - inaddr.S_un.S_addr = pIpNetTable->table[i].dwAddr; + if (pszInetAddr) + { + inaddr.S_un.S_addr = pIpNetTable->table[i].dwAddr; pszIpAddr = inet_ntoa(inaddr); - + /* check if it matches, print it */ - if (strcmp(pszIpAddr, pszInetAddr) == 0) { + if (strcmp(pszIpAddr, pszInetAddr) == 0) PrintEntries(&pIpNetTable->table[i]); - } - } else { + } + else /* if an address is not supplied, print all entries */ PrintEntries(&pIpNetTable->table[i]); - } - } - + free(pIpNetTable); free(pIpAddrTable); - - return 0; + + return EXIT_SUCCESS; } - - - + + /* * - * Takes an ARP entry and prints the IP address, - * the MAC address and the entry type to screen - * - */ -INT PrintEntries(PMIB_IPNETROW pIpAddRow) -{ - IN_ADDR inaddr; - TCHAR cMacAddr[20]; - - /* print IP addresses */ - inaddr.S_un.S_addr = pIpAddRow->dwAddr; - _tprintf(_T(" %-22s"), inet_ntoa(inaddr)); //error checking - - /* print MAC address */ - _stprintf(cMacAddr, _T("%02x-%02x-%02x-%02x-%02x-%02x"), - pIpAddRow->bPhysAddr[0], - pIpAddRow->bPhysAddr[1], - pIpAddRow->bPhysAddr[2], - pIpAddRow->bPhysAddr[3], - pIpAddRow->bPhysAddr[4], - pIpAddRow->bPhysAddr[5]); - _tprintf(_T("%-22s"), cMacAddr); - - /* print cache type */ - switch (pIpAddRow->dwType) { - case MIB_IPNET_TYPE_DYNAMIC : _tprintf(_T("dynamic\n")); - break; - case MIB_IPNET_TYPE_STATIC : _tprintf(_T("static\n")); - break; - case MIB_IPNET_TYPE_INVALID : _tprintf(_T("invalid\n")); - break; - case MIB_IPNET_TYPE_OTHER : _tprintf(_T("other\n")); - break; - } - return 0; -} - - - -/* - * * Takes an internet address, a MAC address and an optional interface * address as arguments and checks their validity. - * Fill out an MIB_IPNETROW structure and insert the data into the + * Fill out an MIB_IPNETROW structure and insert the data into the * ARP cache as a static entry. * */ @@ -196,73 +252,101 @@ { PMIB_IPNETROW pAddHost; PMIB_IPADDRTABLE pIpAddrTable; + PMIB_IPNETTABLE pIpNetTable; DWORD dwIpAddr; DWORD dwSize = 0; + ULONG ulSize = 0; INT iRet, i, val; TCHAR c; - + /* error checking */ - + /* check IP address */ - if (pszInetAddr != NULL) { - if ((dwIpAddr = inet_addr(pszInetAddr)) == INADDR_NONE) { + if (pszInetAddr != NULL) + { + if ((dwIpAddr = inet_addr(pszInetAddr)) == INADDR_NONE) + { _tprintf(_T("ARP: bad IP address: %s\n"), pszInetAddr); - return -1; + exit(EXIT_FAILURE); } - } else { + } + else + { Usage(); - return -1; + exit(EXIT_FAILURE); } - + /* check MAC address */ - if (strlen(pszEthAddr) != 17) { + if (strlen(pszEthAddr) != 17) + { _tprintf(_T("ARP: bad argument: %s\n"), pszEthAddr); - return -1; + exit(EXIT_FAILURE); } - for (i=0; i<17; i++) { - if (pszEthAddr[i] == SEPERATOR) { + for (i=0; i<17; i++) + { + if (pszEthAddr[i] == SEPERATOR) continue; - } - if (!isxdigit(pszEthAddr[i])) { + + if (!isxdigit(pszEthAddr[i])) + { _tprintf(_T("ARP: bad argument: %s\n"), pszEthAddr); - return -1; + exit(EXIT_FAILURE); } } - + + /* We need the IpNetTable to get the adapter index */ + /* Return required buffer size */ + GetIpNetTable(NULL, &ulSize, 0); + /* allocate memory for ARP address table */ + pIpNetTable = (PMIB_IPNETTABLE) malloc(ulSize * sizeof(BYTE)); + ZeroMemory(pIpNetTable, sizeof(*pIpNetTable)); + /* get Arp address table */ + if (pIpNetTable != NULL) + GetIpNetTable(pIpNetTable, &ulSize, TRUE); + else + { + _tprintf(_T("failed to allocate memory for GetIpNetTable\n")); + free(pIpNetTable); + return -1; + } + + /* reserve memory on heap and zero */ pAddHost = (MIB_IPNETROW *) malloc(sizeof(MIB_IPNETROW)); ZeroMemory(pAddHost, sizeof(MIB_IPNETROW)); - - - - - /* set dwIndex field to the index of a local IP address to + + /* set dwIndex field to the index of a local IP address to * indicate the network on which the ARP entry applies */ - if (pszIfAddr) { + if (pszIfAddr) sscanf(pszIfAddr, "%lx", &pAddHost->dwIndex); - } else { - /* map the IP to the index */ + else + { + /* map the IP to the index */ pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize); GetIpAddrTable(pIpAddrTable, &dwSize, 0); - + pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize); - - if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR) { // NO_ERROR = 0 + + if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR) + { _tprintf(_T("GetIpAddrTable failed: %d\n"), iRet); _tprintf(_T("error: %d\n"), WSAGetLastError()); } - printf("printing pIpAddrTable->table[0].dwIndex = %lx\n", pIpAddrTable->table[0].dwIndex); - pAddHost->dwIndex = 4; + //printf("debug print: pIpNetTable->table[0].dwIndex = %lx\n", pIpNetTable->table[0].dwIndex); + /* needs testing. I get the correct index on my machine, but need others + * to test their card index. Any problems and we can use GetAdaptersInfo instead */ + pAddHost->dwIndex = pIpNetTable->table[0].dwIndex; free(pIpAddrTable); } - + /* Set MAC address to 6 bytes (typical) */ pAddHost->dwPhysAddrLen = 6; - - + + /* Encode bPhysAddr into correct byte array */ - for (i=0; i<6; i++) { + for (i=0; i<6; i++) + { val =0; c = toupper(pszEthAddr[i*3]); c = c - (isdigit(c) ? '0' : ('A' - 10)); @@ -272,103 +356,155 @@ c = c - (isdigit(c) ? '0' : ('A' - 10)); val += c; pAddHost->bPhysAddr[i] = val; - } - - + + /* copy converted IP address */ pAddHost->dwAddr = dwIpAddr; - - + + /* set type to static */ pAddHost->dwType = MIB_IPNET_TYPE_STATIC; - - + + /* Add the ARP entry */ - if ((iRet = SetIpNetEntry(pAddHost)) != NO_ERROR) { - _tprintf(_T("The ARP entry addition failed: %d\n"), iRet); - return -1; + if ((iRet = SetIpNetEntry(pAddHost)) != NO_ERROR) + { + DoFormatMessage(iRet); + free(pAddHost); + exit(EXIT_FAILURE); } - + free(pAddHost); - - return 0; + + return EXIT_SUCCESS; } - - - + + /* * - * Takes an internet address and an optional interface address as + * Takes an internet address and an optional interface address as * arguments and checks their validity. - * Add the interface number and IP to an MIB_IPNETROW structure - * and remove the entrty from the ARP cache. + * Add the interface number and IP to an MIB_IPNETROW structure + * and remove the entry from the ARP cache. * */ INT Deletehost(PTCHAR pszInetAddr, PTCHAR pszIfAddr) { PMIB_IPNETROW pDelHost; PMIB_IPADDRTABLE pIpAddrTable; + PMIB_IPNETTABLE pIpNetTable; + ULONG ulSize = 0; DWORD dwIpAddr; DWORD dwSize = 0; - INT iret; - + INT iRet; + BOOL bFlushTable = FALSE; + /* error checking */ - + /* check IP address */ - if (pszInetAddr != NULL) { - if ((dwIpAddr = inet_addr(pszInetAddr)) == INADDR_NONE) { + if (pszInetAddr != NULL) + { + /* if wildcard is given, set flag to delete all hosts */ + if (strncmp(pszInetAddr, "*", 1) == 0) + bFlushTable = TRUE; + else if ((dwIpAddr = inet_addr(pszInetAddr)) == INADDR_NONE) + { _tprintf(_T("ARP: bad IP address: %s\n"), pszInetAddr); - return -1; + exit(EXIT_FAILURE); } - } else { + } + else + { Usage(); + exit(EXIT_FAILURE); + } + + /* We need the IpNetTable to get the adapter index */ + /* Return required buffer size */ + GetIpNetTable(NULL, &ulSize, 0); + /* allocate memory for ARP address table */ + pIpNetTable = (PMIB_IPNETTABLE) malloc(ulSize * sizeof(BYTE)); + ZeroMemory(pIpNetTable, sizeof(*pIpNetTable)); + /* get Arp address table */ + if (pIpNetTable != NULL) + GetIpNetTable(pIpNetTable, &ulSize, TRUE); + else + { + _tprintf(_T("failed to allocate memory for GetIpNetTable\n")); + free(pIpNetTable); return -1; } - - + + pIpAddrTable = (MIB_IPADDRTABLE*) malloc(sizeof(MIB_IPADDRTABLE)); pDelHost = (MIB_IPNETROW *) malloc(sizeof(MIB_IPNETROW)); ZeroMemory(pIpAddrTable, sizeof(MIB_IPADDRTABLE)); ZeroMemory(pDelHost, sizeof(MIB_IPNETROW)); - /* set dwIndex field to the index of a local IP address to + /* set dwIndex field to the index of a local IP address to * indicate the network on which the ARP entry applies */ - if (pszIfAddr) { + if (pszIfAddr) sscanf(pszIfAddr, "%lx", &pDelHost->dwIndex); - } else { + else + { /* map the IP to the index */ - if (GetIpAddrTable(pIpAddrTable, &dwSize, 0) == ERROR_INSUFFICIENT_BUFFER) { + if (GetIpAddrTable(pIpAddrTable, &dwSize, 0) == ERROR_INSUFFICIENT_BUFFER) pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize); - } - if ((iret = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR) { - _tprintf(_T("GetIpAddrTable failed: %d\n"), iret); + + if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR) + { + _tprintf(_T("GetIpAddrTable failed: %d\n"), iRet); _tprintf(_T("error: %d\n"), WSAGetLastError()); } - pDelHost->dwIndex = 4; //pIpAddrTable->table[0].dwIndex; - } - - /* copy converted IP address */ - pDelHost->dwAddr = dwIpAddr; - + /* needs testing. I get the correct index on my machine, but need others + * to test their card index. Any problems and we can use GetAdaptersInfo instead */ + pDelHost->dwIndex = pIpNetTable->table[0].dwIndex; + } + + if (bFlushTable == TRUE) + { + /* delete arp cache */ + if ((iRet = FlushIpNetTable(pDelHost->dwIndex)) != NO_ERROR) + { + DoFormatMessage(iRet); + free(pIpAddrTable); + free(pDelHost); + return EXIT_FAILURE; + } + else + { + free(pIpAddrTable); + free(pDelHost); + return EXIT_SUCCESS; + } + } + else + /* copy converted IP address */ + pDelHost->dwAddr = dwIpAddr; + /* Add the ARP entry */ - if ((iret = DeleteIpNetEntry(pDelHost)) != NO_ERROR) { - _tprintf(_T("The ARP entry deletion failed: %d\n"), iret); - return -1; + if ((iRet = DeleteIpNetEntry(pDelHost)) != NO_ERROR) + { + + DoFormatMessage(iRet); + free(pIpAddrTable); + free(pDelHost); + exit(EXIT_FAILURE); } - + free(pIpAddrTable); free(pDelHost); - - return 0; + + return EXIT_SUCCESS; } - - - + + + /* * * print program usage to screen * - */ + */ VOID Usage(VOID) { _tprintf(_T("\nDisplays and modifies the IP-to-Physical address translation tables used by\n" @@ -401,10 +537,10 @@ " > arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.\n" " > arp -a .... Displays the arp table.\n\n")); } - - - -/* + + + +/* * * Program entry. * Parse command line and call the required function @@ -412,35 +548,37 @@ */ INT main(int argc, char* argv[]) { - const char N[] = "-N"; - - if ((argc < 2) || (argc > 5)) + if ((argc < 2) || (argc > 5)) { Usage(); - return FALSE; + return EXIT_FAILURE; } - - - if (argv[1][0] == '-') { - switch (argv[1][1]) { - /* FIX ME */ - /* need better control for -a, as -N might not be arg 4 */ - case 'a': if (argc == 2) + + if (argv[1][0] == '-') + { + switch (argv[1][1]) + { + case 'a': /* fall through */ + case 'g': + if (argc == 2) DisplayArpEntries(NULL, NULL); else if (argc == 3) DisplayArpEntries(argv[2], NULL); - else if ((argc == 5) && ((strcmp(argv[3], N)) == 0)) + else if ((argc == 4) && ((strcmp(argv[2], "-N")) == 0)) + DisplayArpEntries(NULL, argv[3]); + else if ((argc == 5) && ((strcmp(argv[3], "-N")) == 0)) DisplayArpEntries(argv[2], argv[4]); else Usage(); + return EXIT_FAILURE; break; - case 'g': break; case 'd': if (argc == 3) Deletehost(argv[2], NULL); else if (argc == 4) Deletehost(argv[2], argv[3]); else Usage(); + return EXIT_FAILURE; break; case 's': if (argc == 4) Addhost(argv[2], argv[3], NULL); @@ -448,15 +586,17 @@ Addhost(argv[2], argv[3], argv[4]); else Usage(); + return EXIT_FAILURE; break; default: Usage(); - return -1; + return EXIT_FAILURE; } - } else { + } + else Usage(); - return -1; - } - - return 0; -} + + return EXIT_SUCCESS; +} /* +warning: suggest parentheses around assignment used as truth value +warning: char format, void arg (arg 2)*/ _____ Deleted: trunk/reactos/apps/utils/net/arp/trace.c --- trunk/reactos/apps/utils/net/arp/trace.c 2005-09-25 16:56:52 UTC (rev 18056) +++ trunk/reactos/apps/utils/net/arp/trace.c 2005-09-25 17:01:24 UTC (rev 18057) @@ -1,53 +0,0 @@ -/////////////////////////////////////////////////////////////////////// ////// -// Diagnostic Trace -// -#include <stdio.h> -#include <stdarg.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <tchar.h> -#include "trace.h" - - -#ifdef _DEBUG - -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; - -void _DebugBreak(void) -{ - DebugBreak(); -} - -void Trace(TCHAR* lpszFormat, ...) -{ - va_list args; - int nBuf; - TCHAR szBuffer[512]; - - va_start(args, lpszFormat); - nBuf = _vsntprintf(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), lpszFormat, args); - OutputDebugString(szBuffer); - // was there an error? was the expanded string too long? - //ASSERT(nBuf >= 0); - va_end(args); -} - -void Assert(void* assert, TCHAR* file, int line, void* msg) -{ - if (msg == NULL) { - printf("ASSERT -- %s occured on line %u of file %s.\n", - assert, line, file); - } else { - printf("ASSERT -- %s occured on line %u of file %s: Message = %s.\n", - assert, line, file, msg); - } -} - -#else - -void Trace(TCHAR* lpszFormat, ...) { }; -void Assert(void* assert, TCHAR* file, int line, void* msg) { }; - -#endif //_DEBUG -/////////////////////////////////////////////////////////////////////// ////// _____ Deleted: trunk/reactos/apps/utils/net/arp/trace.h --- trunk/reactos/apps/utils/net/arp/trace.h 2005-09-25 16:56:52 UTC (rev 18056) +++ trunk/reactos/apps/utils/net/arp/trace.h 2005-09-25 17:01:24 UTC (rev 18057) @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////// ////// -// Diagnostic Trace -// -#ifndef __TRACE_H__ -#define __TRACE_H__ - -#ifdef _DEBUG - -#ifdef _X86_ -#define BreakPoint() _asm { int 3h } -#else -#define BreakPoint() _DebugBreak() -#endif - -#ifndef ASSERT -#define ASSERT(exp) \ -{ \ - if (!(exp)) { \ - Assert(#exp, __FILE__, __LINE__, NULL); \ - BreakPoint(); \ - } \ -} \ - -#define ASSERTMSG(exp, msg) \ -{ \ - if (!(exp)) { \ - Assert(#exp, __FILE__, __LINE__, msg); \ - BreakPoint(); \ - } \ -} -#endif - -//===================================================================== ======== -// MACRO: TRACE() -//===================================================================== ======== - -#define TRACE Trace - - -#else // _DEBUG - -//===================================================================== ======== -// Define away MACRO's ASSERT() and TRACE() in non debug builds -//===================================================================== ======== - -#ifndef ASSERT -#define ASSERT(exp) -#define ASSERTMSG(exp, msg) -#endif - -#define TRACE 0 ? (void)0 : Trace - -#endif // !_DEBUG - - -void Assert(void* assert, TCHAR* file, int line, void* msg); -void Trace(TCHAR* lpszFormat, ...); - - -#endif // __TRACE_H__ -/////////////////////////////////////////////////////////////////////// //////
19 years, 3 months
1
0
0
0
[npwoods] 18056: Lightweight sync with WINE regedit; imported obvious changes such as const correctness, TCHAR string usage etc
by npwoods@svn.reactos.com
Lightweight sync with WINE regedit; imported obvious changes such as const correctness, TCHAR string usage etc Modified: trunk/reactos/subsys/system/regedit/childwnd.c Modified: trunk/reactos/subsys/system/regedit/framewnd.c Modified: trunk/reactos/subsys/system/regedit/regedit.c Modified: trunk/reactos/subsys/system/regedit/regproc.c Modified: trunk/reactos/subsys/system/regedit/regproc.h Modified: trunk/reactos/subsys/system/regedit/treeview.c _____ Modified: trunk/reactos/subsys/system/regedit/childwnd.c --- trunk/reactos/subsys/system/regedit/childwnd.c 2005-09-25 15:59:38 UTC (rev 18055) +++ trunk/reactos/subsys/system/regedit/childwnd.c 2005-09-25 16:56:52 UTC (rev 18056) @@ -42,6 +42,7 @@ if (hRootKey == HKEY_LOCAL_MACHINE) return _T("HKEY_LOCAL_MACHINE"); if (hRootKey == HKEY_USERS) return _T("HKEY_USERS"); if (hRootKey == HKEY_CURRENT_CONFIG) return _T("HKEY_CURRENT_CONFIG"); + if (hRootKey == HKEY_DYN_DATA) return _T("HKEY_DYN_DATA"); return _T("UKNOWN HKEY, PLEASE REPORT"); } @@ -169,8 +170,7 @@ * WM_DESTROY - post a quit message and return * */ -LRESULT CALLBACK -ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static short last_split; BOOL Result; _____ Modified: trunk/reactos/subsys/system/regedit/framewnd.c --- trunk/reactos/subsys/system/regedit/framewnd.c 2005-09-25 15:59:38 UTC (rev 18055) +++ trunk/reactos/subsys/system/regedit/framewnd.c 2005-09-25 16:56:52 UTC (rev 18056) @@ -61,7 +61,7 @@ MoveWindow(g_pChildWnd->hWnd, prect->left, prect->top, prect->right, prect->bottom, TRUE); } -void resize_frame_client(HWND hWnd) +static void resize_frame_client(HWND hWnd) { RECT rect; @@ -183,7 +183,7 @@ return TRUE; } -UINT_PTR CALLBACK ImportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) +static UINT_PTR CALLBACK ImportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) { OPENFILENAME* pOpenFileName; OFNOTIFY* pOfNotify; @@ -375,7 +375,7 @@ pd.nToPage = 0xFFFF; pd.nMinPage = 1; pd.nMaxPage = 0xFFFF; - if (PrintDlg(&pd) == TRUE) { + if (PrintDlg(&pd)) { /* GDI calls to render output. */ DeleteDC(pd.hDC); /* Delete DC when done.*/ } @@ -424,7 +424,7 @@ return TRUE; } -BOOL CopyKeyName(HWND hWnd, LPTSTR keyName) +static BOOL CopyKeyName(HWND hWnd, LPCTSTR keyName) { BOOL result; @@ -717,8 +717,7 @@ * */ -LRESULT CALLBACK -FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_CREATE: @@ -730,6 +729,10 @@ if (!_CmdWndProc(hWnd, message, wParam, lParam)) return DefWindowProc(hWnd, message, wParam, lParam); break; + case WM_ACTIVATE: + if (LOWORD(hWnd)) + SetFocus(g_pChildWnd->hWnd); + break; case WM_SIZE: resize_frame_client(hWnd); break; @@ -744,10 +747,6 @@ case WM_MENUSELECT: OnMenuSelect(hWnd, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam); break; - case WM_ACTIVATE: - if (LOWORD(hWnd)) - SetFocus(g_pChildWnd->hWnd); - break; case WM_DESTROY: WinHelp(hWnd, _T("regedit"), HELP_QUIT, 0); PostQuitMessage(0); _____ Modified: trunk/reactos/subsys/system/regedit/regedit.c --- trunk/reactos/subsys/system/regedit/regedit.c 2005-09-25 15:59:38 UTC (rev 18055) +++ trunk/reactos/subsys/system/regedit/regedit.c 2005-09-25 16:56:52 UTC (rev 18056) @@ -23,7 +23,7 @@ #include <windows.h> #include "regproc.h" -static char *usage = +static const char *usage = "Usage:\n" " regedit filename\n" " regedit /E filename [regpath]\n" @@ -52,8 +52,7 @@ "\n" "The switches are case-insensitive, can be prefixed either by '-' or '/'.\n" "This program is command-line compatible with Microsoft Windows\n" - "regedit. The difference with Windows regedit - this application has\n" - "command-line interface only.\n"; + "regedit.\n"; typedef enum { ACTION_UNDEF, ACTION_ADD, ACTION_EXPORT, ACTION_DELETE @@ -68,7 +67,7 @@ * chu - the switch character in upper-case. * s - the command line string where s points to the switch character. */ -void error_unknown_switch(char chu, char *s) +static void error_unknown_switch(char chu, char *s) { if (isalpha(chu)) { fprintf(stderr,"%s: Undefined switch /%c!\n", getAppName(), chu); _____ Modified: trunk/reactos/subsys/system/regedit/regproc.c --- trunk/reactos/subsys/system/regedit/regproc.c 2005-09-25 15:59:38 UTC (rev 18055) +++ trunk/reactos/subsys/system/regedit/regproc.c 2005-09-25 16:56:52 UTC (rev 18056) @@ -46,18 +46,18 @@ static HKEY currentKeyHandle = 0; static BOOL bTheKeyIsOpen = FALSE; -static CHAR *app_name = "UNKNOWN"; +static const CHAR *app_name = "UNKNOWN"; -static CHAR *reg_class_names[] = { +static const CHAR *reg_class_names[] = { "HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_CLASSES_ROOT", - "HKEY_CURRENT_CONFIG", "HKEY_CURRENT_USER" + "HKEY_CURRENT_CONFIG", "HKEY_CURRENT_USER", "HKEY_DYN_DATA" }; #define REG_CLASS_NUMBER (sizeof(reg_class_names) / sizeof(reg_class_names[0])) static HKEY reg_class_keys[REG_CLASS_NUMBER] = { HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, - HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER + HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_DYN_DATA }; /* return values */ @@ -234,7 +234,7 @@ DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen) { char *s = str; /* Pointer to current */ - char *b = (char*)buf; /* Pointer to result */ + char *b = (char*) buf; /* Pointer to result */ ULONG strLen = strlen(str); ULONG strPos = 0; @@ -346,7 +346,7 @@ /*********************************************************************** ******* * Replaces escape sequences with the characters. */ -void REGPROC_unescape_string(LPSTR str) +static void REGPROC_unescape_string(LPSTR str) { int str_idx = 0; /* current character under analysis */ int val_idx = 0; /* the last character of the unescaped string */ @@ -427,7 +427,7 @@ } } - hRes = RegSetValueExA( + hRes = RegSetValueEx( currentKeyHandle, val_name, 0, /* Reserved */ @@ -522,14 +522,14 @@ { LPSTR classNameEnd; LPSTR classNameBeg; - UINT i; + unsigned int i; char lpClassCopy[KEY_MAX_LEN]; if (lpClass == NULL) return (HKEY)ERROR_INVALID_PARAMETER; - strncpy(lpClassCopy, lpClass, KEY_MAX_LEN); + lstrcpynA(lpClassCopy, lpClass, KEY_MAX_LEN); classNameEnd = strchr(lpClassCopy, '\\'); /* The class name ends by '\' */ if (!classNameEnd) /* or the whole string */ @@ -558,7 +558,7 @@ /*********************************************************************** ******* * Close the currently opened key. */ -void closeKey() +void closeKey(void) { RegCloseKey(currentKeyHandle); @@ -579,7 +579,7 @@ void doSetValue(LPSTR stdInput) { /* - * We encoutered the end of the file, make sure we + * We encountered the end of the file, make sure we * close the opened key and exit */ if (stdInput == NULL) { @@ -610,14 +610,14 @@ } /*********************************************************************** ******* - * This funtion is the main entry point to the queryValue type of action. It + * This function is the main entry point to the queryValue type of action. It * receives the currently read line and dispatch the work depending on the * context. */ void doQueryValue(LPSTR stdInput) { /* - * We encoutered the end of the file, make sure we + * We encountered the end of the file, make sure we * close the opened key and exit */ if (stdInput == NULL) { @@ -648,7 +648,7 @@ } /*********************************************************************** ******* - * This funtion is the main entry point to the deletetValue type of action. It + * This function is the main entry point to the deleteValue type of action. It * receives the currently read line and dispatch the work depending on the * context. */ @@ -658,7 +658,7 @@ } /*********************************************************************** ******* - * This funtion is the main entry point to the deleteKey type of action. It + * This function is the main entry point to the deleteKey type of action. It * receives the currently read line and dispatch the work depending on the * context. */ @@ -668,7 +668,7 @@ } /*********************************************************************** ******* - * This funtion is the main entry point to the createKey type of action. It + * This function is the main entry point to the createKey type of action. It * receives the currently read line and dispatch the work depending on the * context. */ @@ -793,8 +793,7 @@ if (hRes == ERROR_SUCCESS) { lpsRes = HeapAlloc( GetProcessHeap(), 0, lLen); - strncpy(lpsRes, lpsData, lLen); - lpsRes[lLen-1]='\0'; + lstrcpynA(lpsRes, lpsData, lLen); } } else { DWORD dwLen = KEY_MAX_LEN; @@ -824,8 +823,7 @@ case REG_SZ: case REG_EXPAND_SZ: { lpsRes = HeapAlloc( GetProcessHeap(), 0, dwLen); - strncpy(lpsRes, lpbData, dwLen); - lpsRes[dwLen-1]='\0'; + lstrcpynA(lpsRes, lpbData, dwLen); break; } case REG_DWORD: { @@ -976,7 +974,7 @@ } /*********************************************************************** ******* - * This funtion is the main entry point to the registerDLL action. It + * This function is the main entry point to the registerDLL action. It * receives the currently read line, then loads and registers the requested DLLs */ void doRegisterDLL(LPSTR stdInput) @@ -989,7 +987,7 @@ return; /* Load and register the library, then free it */ - theLib = LoadLibraryA(stdInput); + theLib = LoadLibrary(stdInput); if (theLib) { FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllRegisterServer"); if (lpfnDLLRegProc) @@ -1009,7 +1007,7 @@ } /*********************************************************************** ******* - * This funtion is the main entry point to the unregisterDLL action. It + * This function is the main entry point to the unregisterDLL action. It * receives the currently read line, then loads and unregisters the requested DLLs */ void doUnregisterDLL(LPSTR stdInput) @@ -1022,7 +1020,7 @@ return; /* Load and unregister the library, then free it */ - theLib = LoadLibraryA(stdInput); + theLib = LoadLibrary(stdInput); if (theLib) { FARPROC lpfnDLLRegProc = GetProcAddress(theLib, "DllUnregisterServer"); if (lpfnDLLRegProc) @@ -1047,7 +1045,7 @@ * Print the message for GetLastError */ -void REGPROC_print_error() +static void REGPROC_print_error(void) { LPVOID lpMsgBuf; DWORD error_code; @@ -1076,7 +1074,7 @@ * required_len - length of the string to place to the buffer in characters. * The length does not include the terminating null character. */ -void REGPROC_resize_char_buffer(CHAR **buffer, DWORD *len, DWORD required_len) +static void REGPROC_resize_char_buffer(CHAR **buffer, DWORD *len, DWORD required_len) { required_len++; if (required_len > *len) { @@ -1092,7 +1090,7 @@ /*********************************************************************** ******* * Prints string str to file */ -void REGPROC_export_string(FILE *file, CHAR *str) +static void REGPROC_export_string(FILE *file, CHAR *str) { size_t len = strlen(str); size_t i; @@ -1133,7 +1131,7 @@ * Is resized if necessary. * val_size - size of the buffer for storing values in bytes. */ -void export_hkey(FILE *file, HKEY key, +static void export_hkey(FILE *file, HKEY key, CHAR **reg_key_name_buf, DWORD *reg_key_name_len, CHAR **val_name_buf, DWORD *val_name_len, BYTE **val_buf, DWORD *val_size) @@ -1176,8 +1174,8 @@ DWORD value_type; DWORD val_name_len1 = *val_name_len; DWORD val_size1 = *val_size; - ret = RegEnumValueA(key, i, *val_name_buf, &val_name_len1, NULL, - &value_type, *val_buf, &val_size1); + ret = RegEnumValue(key, i, *val_name_buf, &val_name_len1, NULL, + &value_type, *val_buf, &val_size1); if (ret != ERROR_SUCCESS) { more_data = FALSE; if (ret != ERROR_NO_MORE_ITEMS) { @@ -1198,7 +1196,7 @@ case REG_SZ: case REG_EXPAND_SZ: fputs("\"", file); - REGPROC_export_string(file, (CHAR*)*val_buf); + REGPROC_export_string(file, (char*) *val_buf); fputs("\"\n", file); break; @@ -1217,7 +1215,7 @@ /* falls through */ case REG_BINARY: { DWORD i1; - CHAR *hex_prefix; + const CHAR *hex_prefix; CHAR buf[20]; int cur_pos; @@ -1260,8 +1258,8 @@ while(more_data) { DWORD buf_len = *reg_key_name_len - curr_len; - ret = RegEnumKeyExA(key, i, *reg_key_name_buf + curr_len + 1, &buf_len, - NULL, NULL, NULL, NULL); + ret = RegEnumKeyEx(key, i, *reg_key_name_buf + curr_len + 1, &buf_len, + NULL, NULL, NULL, NULL); if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) { more_data = FALSE; if (ret != ERROR_NO_MORE_ITEMS) { @@ -1271,8 +1269,8 @@ HKEY subkey; i++; - if (RegOpenKeyA(key, *reg_key_name_buf + curr_len + 1, - &subkey) == ERROR_SUCCESS) { + if (RegOpenKey(key, *reg_key_name_buf + curr_len + 1, + &subkey) == ERROR_SUCCESS) { export_hkey(file, subkey, reg_key_name_buf, reg_key_name_len, val_name_buf, val_name_len, val_buf, val_size); RegCloseKey(subkey); @@ -1287,7 +1285,7 @@ /*********************************************************************** ******* * Open file for export. */ -FILE *REGPROC_open_export_file(CHAR *file_name) +static FILE *REGPROC_open_export_file(CHAR *file_name) { FILE *file = fopen(file_name, "w"); if (!file) { @@ -1350,7 +1348,7 @@ ®_key_name_buf, ®_key_name_len, &val_name_buf, &val_name_len, &val_buf, &val_size); - } else if (RegOpenKeyA(reg_key_class, branch_name, &key) == ERROR_SUCCESS) { + } else if (RegOpenKey(reg_key_class, branch_name, &key) == ERROR_SUCCESS) { file = REGPROC_open_export_file(file_name); export_hkey(file, key, ®_key_name_buf, ®_key_name_len, @@ -1372,7 +1370,8 @@ /* do not export HKEY_CLASSES_ROOT */ if (reg_class_keys[i] != HKEY_CLASSES_ROOT && reg_class_keys[i] != HKEY_CURRENT_USER && - reg_class_keys[i] != HKEY_CURRENT_CONFIG) { + reg_class_keys[i] != HKEY_CURRENT_CONFIG && + reg_class_keys[i] != HKEY_DYN_DATA) { strcpy(reg_key_name_buf, reg_class_names[i]); export_hkey(file, reg_class_keys[i], ®_key_name_buf, ®_key_name_len, @@ -1393,7 +1392,7 @@ /*********************************************************************** ******* * Reads contents of the specified file into the registry. */ -BOOL import_registry_file(LPSTR filename) +BOOL import_registry_file(LPTSTR filename) { FILE* reg_file = fopen(filename, "r"); @@ -1407,7 +1406,7 @@ /*********************************************************************** ******* * Recursive function which removes the registry key with all subkeys. */ -void delete_branch(HKEY key, +static void delete_branch(HKEY key, CHAR **reg_key_name_buf, DWORD *reg_key_name_len) { HKEY branch_key; @@ -1417,7 +1416,7 @@ LONG ret; long int i; - if (RegOpenKeyA(key, *reg_key_name_buf, &branch_key) != ERROR_SUCCESS) { + if (RegOpenKey(key, *reg_key_name_buf, &branch_key) != ERROR_SUCCESS) { REGPROC_print_error(); } @@ -1436,8 +1435,8 @@ for (i = subkeys - 1; i >= 0; i--) { DWORD buf_len = *reg_key_name_len - curr_len; - ret = RegEnumKeyExA(branch_key, i, *reg_key_name_buf + curr_len + 1, - &buf_len, NULL, NULL, NULL, NULL); + ret = RegEnumKeyEx(branch_key, i, *reg_key_name_buf + curr_len + 1, + &buf_len, NULL, NULL, NULL, NULL); if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA && ret != ERROR_NO_MORE_ITEMS) { @@ -1448,7 +1447,7 @@ } (*reg_key_name_buf)[curr_len] = '\0'; RegCloseKey(branch_key); - RegDeleteKeyA(key, *reg_key_name_buf); + RegDeleteKey(key, *reg_key_name_buf); } /*********************************************************************** ******* @@ -1482,7 +1481,7 @@ getAppName(), reg_key_name); exit(1); } - if (RegOpenKeyA(reg_key_class, branch_name, &branch_key) == ERROR_SUCCESS) { + if (RegOpenKey(reg_key_class, branch_name, &branch_key) == ERROR_SUCCESS) { /* check whether the key exists */ RegCloseKey(branch_key); delete_branch(reg_key_class, &branch_name, &branch_name_len); @@ -1494,12 +1493,12 @@ * Sets the application name. Then application name is used in the error * reporting. */ -void setAppName(CHAR *name) +void setAppName(const CHAR *name) { app_name = name; } -CHAR *getAppName() +const CHAR *getAppName(void) { return app_name; } _____ Modified: trunk/reactos/subsys/system/regedit/regproc.h --- trunk/reactos/subsys/system/regedit/regproc.h 2005-09-25 15:59:38 UTC (rev 18055) +++ trunk/reactos/subsys/system/regedit/regproc.h 2005-09-25 16:56:52 UTC (rev 18056) @@ -39,11 +39,11 @@ void doUnregisterDLL(LPSTR lpsLine); BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name); -BOOL import_registry_file(LPSTR filename); +BOOL import_registry_file(LPTSTR filename); void delete_registry_key(CHAR *reg_key_name); -void setAppName(CHAR *name); -CHAR *getAppName(); +void setAppName(const CHAR *name); +const CHAR *getAppName(void); void processRegLines(FILE *in, CommandAPI command); @@ -61,7 +61,7 @@ DWORD getDataType(LPSTR *lpValue, DWORD* parse_type); LPSTR getArg(LPSTR arg); HRESULT openKey(LPSTR stdInput); -void closeKey(); +void closeKey(void); /* * api setValue prototypes _____ Modified: trunk/reactos/subsys/system/regedit/treeview.c --- trunk/reactos/subsys/system/regedit/treeview.c 2005-09-25 15:59:38 UTC (rev 18055) +++ trunk/reactos/subsys/system/regedit/treeview.c 2005-09-25 16:56:52 UTC (rev 18056) @@ -100,7 +100,6 @@ if (!hItem) hItem = TreeView_GetSelection(hwndTV); if (!hItem) return NULL; if (!get_item_path(hwndTV, hItem, phRootKey, &pathBuffer, &pathLen, &maxLen)) return NULL; - /*printf("hRoot=%p, keyPath='%s'\n", *phRootKey, pathBuffer);*/ return pathBuffer; }
19 years, 3 months
1
0
0
0
[mf] 18055: try to use IShellFolderViewCB::MessageSFVCB() in order to override explorer context menus
by mf@svn.reactos.com
try to use IShellFolderViewCB::MessageSFVCB() in order to override explorer context menus Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.h Modified: trunk/reactos/subsys/system/explorer/shell/webchild.h Modified: trunk/reactos/subsys/system/explorer/utility/shellclasses.h _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp --- trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-09-25 13:58:27 UTC (rev 18054) +++ trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-09-25 15:59:38 UTC (rev 18055) @@ -33,7 +33,12 @@ ShellBrowser::ShellBrowser(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info, HIMAGELIST himl, BrowserCallback* cb, CtxMenuInterfaces& cm_ifs) - : _hwnd(hwnd), +#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) + : super(IID_IShellFolderViewCB), +#else + : +#endif + _hwnd(hwnd), _left_hwnd(left_hwnd), _right_hwnd(right_hwnd), _create_info(create_info), @@ -357,7 +362,18 @@ fs.fFlags = FWF_NOCLIENTEDGE|FWF_BESTFITWINDOW; } +#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) + SFV_CREATE sfv_create; + + sfv_create.cbSize = sizeof(SFV_CREATE); + sfv_create.pshf = folder; + sfv_create.psvOuter = NULL; + sfv_create.psfvcb = this; + + HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView); +#else HRESULT hr = folder->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView); +#endif if (FAILED(hr)) { _pShellView = NULL; @@ -378,6 +394,23 @@ } +#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) + + /// shell view callback +HRESULT STDMETHODCALLTYPE ShellBrowser::MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + if (uMsg == SFVM_INITMENUPOPUP) { + //@todo never reached + InsertMenu((HMENU)lParam, 0, MF_BYPOSITION, 12345, TEXT("TEST ENTRY")); + return S_OK; + } + + return E_NOTIMPL; +} + +#endif + + HRESULT ShellBrowser::OnDefaultCommand(LPIDA pida) { CONTEXT("ShellBrowser::OnDefaultCommand()"); _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.h --- trunk/reactos/subsys/system/explorer/shell/shellbrowser.h 2005-09-25 13:58:27 UTC (rev 18054) +++ trunk/reactos/subsys/system/explorer/shell/shellbrowser.h 2005-09-25 15:59:38 UTC (rev 18055) @@ -57,6 +57,10 @@ /// Implementation of IShellBrowserImpl interface in explorer child windows struct ShellBrowser : public IShellBrowserImpl +#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) + , public IComSrvBase<IShellFolderViewCB, ShellBrowser>, + public SimpleComObject +#endif { ShellBrowser(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info, HIMAGELIST himl, BrowserCallback* cb, CtxMenuInterfaces& cm_ifs); @@ -162,6 +166,13 @@ void InitializeTree(HIMAGELIST himl); bool InitDragDrop(); + +#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) + typedef IComSrvBase<IShellFolderViewCB, ShellBrowser> super; + + // IShellFolderViewCB + virtual HRESULT STDMETHODCALLTYPE MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam); +#endif }; _____ Modified: trunk/reactos/subsys/system/explorer/shell/webchild.h --- trunk/reactos/subsys/system/explorer/shell/webchild.h 2005-09-25 13:58:27 UTC (rev 18054) +++ trunk/reactos/subsys/system/explorer/shell/webchild.h 2005-09-25 15:59:38 UTC (rev 18055) @@ -79,94 +79,10 @@ #endif #ifdef _MSC_VER -#define NOVTABLE __declspec(novtable) -#else -#define NOVTABLE -#endif -#define ANSUNC - -#ifdef _MSC_VER #pragma warning(disable: 4355) // use of 'this' for initialization of _connector #endif -struct NOVTABLE ComSrvObject // NOVTABLE erlaubt, da protected Destruktor -{ -protected: - ComSrvObject() : _ref(1) {} - virtual ~ComSrvObject() {} - - ULONG _ref; -}; - -struct SimpleComObject : public ComSrvObject -{ - ULONG IncRef() {return ++_ref;} - ULONG DecRef() {ULONG ref=--_ref; if (!ref) {_ref++; delete this;} return ref;} -}; - - - // server object interfaces - -template<typename BASE> struct IComSrvQI : public BASE -{ - IComSrvQI(REFIID uuid_base) - : _uuid_base(uuid_base) - { - } - - STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) - { - *ppv = NULL; - - if (IsEqualIID(riid, _uuid_base) || IsEqualIID(riid, IID_IUnknown)) - {*ppv=static_cast<BASE*>(this); this->AddRef(); return S_OK;} - - return E_NOINTERFACE; - } - -protected: - IComSrvQI() {} - virtual ~IComSrvQI() {} - - REFIID _uuid_base; -}; - -template<> struct IComSrvQI<IUnknown> : public IUnknown -{ - STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) - { - *ppv = NULL; - - if (IsEqualIID(riid, IID_IUnknown)) - {*ppv=this; AddRef(); return S_OK;} - - return E_NOINTERFACE; - } - -protected: - IComSrvQI<IUnknown>() {} - virtual ~IComSrvQI<IUnknown>() {} -}; - - -template<typename BASE, typename OBJ> - class IComSrvBase : public IComSrvQI<BASE> -{ - typedef IComSrvQI<BASE> super; - -protected: - IComSrvBase(REFIID uuid_base) - : super(uuid_base) - { - } - -public: - STDMETHODIMP_(ULONG) AddRef() {return static_cast<OBJ*>(this)->IncRef();} - STDMETHODIMP_(ULONG) Release() {return static_cast<OBJ*>(this)->DecRef();} -}; - - template<typename T> struct ConnectionPoint : public SIfacePtr<T> { ConnectionPoint(IConnectionPointContainer* pCPC, REFIID riid) _____ Modified: trunk/reactos/subsys/system/explorer/utility/shellclasses.h --- trunk/reactos/subsys/system/explorer/utility/shellclasses.h 2005-09-25 13:58:27 UTC (rev 18054) +++ trunk/reactos/subsys/system/explorer/utility/shellclasses.h 2005-09-25 15:59:38 UTC (rev 18055) @@ -52,7 +52,14 @@ #define CFSTR_SHELLIDLIST sCFSTR_SHELLIDLIST #endif +#ifdef _MSC_VER +#define NOVTABLE __declspec(novtable) +#else +#define NOVTABLE +#endif +#define ANSUNC + // Exception Handling #ifndef _NO_COMUTIL @@ -438,7 +445,84 @@ }; +struct NOVTABLE ComSrvObject // NOVTABLE erlaubt, da protected Destruktor +{ +protected: + ComSrvObject() : _ref(1) {} + virtual ~ComSrvObject() {} + ULONG _ref; +}; + +struct SimpleComObject : public ComSrvObject +{ + ULONG IncRef() {return ++_ref;} + ULONG DecRef() {ULONG ref=--_ref; if (!ref) {_ref++; delete this;} return ref;} +}; + + + // server object interfaces + +template<typename BASE> struct IComSrvQI : public BASE +{ + IComSrvQI(REFIID uuid_base) + : _uuid_base(uuid_base) + { + } + + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) + { + *ppv = NULL; + + if (IsEqualIID(riid, _uuid_base) || IsEqualIID(riid, IID_IUnknown)) + {*ppv=static_cast<BASE*>(this); this->AddRef(); return S_OK;} + + return E_NOINTERFACE; + } + +protected: + IComSrvQI() {} + virtual ~IComSrvQI() {} + + REFIID _uuid_base; +}; + +template<> struct IComSrvQI<IUnknown> : public IUnknown +{ + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) + { + *ppv = NULL; + + if (IsEqualIID(riid, IID_IUnknown)) + {*ppv=this; AddRef(); return S_OK;} + + return E_NOINTERFACE; + } + +protected: + IComSrvQI<IUnknown>() {} + virtual ~IComSrvQI<IUnknown>() {} +}; + + +template<typename BASE, typename OBJ> + class IComSrvBase : public IComSrvQI<BASE> +{ + typedef IComSrvQI<BASE> super; + +protected: + IComSrvBase(REFIID uuid_base) + : super(uuid_base) + { + } + +public: + STDMETHODIMP_(ULONG) AddRef() {return static_cast<OBJ*>(this)->IncRef();} + STDMETHODIMP_(ULONG) Release() {return static_cast<OBJ*>(this)->DecRef();} +}; + + + struct ShellFolder;
19 years, 3 months
1
0
0
0
[ea] 18054: Minor changes. This program does NOT work in ROS.
by ea@svn.reactos.com
Minor changes. This program does NOT work in ROS. Modified: trunk/rosapps/sysutils/lsdd/lsdd.c _____ Modified: trunk/rosapps/sysutils/lsdd/lsdd.c --- trunk/rosapps/sysutils/lsdd/lsdd.c 2005-09-25 13:56:45 UTC (rev 18053) +++ trunk/rosapps/sysutils/lsdd/lsdd.c 2005-09-25 13:58:27 UTC (rev 18054) @@ -1,6 +1,6 @@ /* $Id$ * - * FILE : ldd.c + * FILE : lsdd.c * AUTHOR: Emanuele ALIBERTI * DATE : 2000-08-04 * DESC : List DOS devices, i.e. symbolic links created @@ -21,6 +21,8 @@ #define LINKS_SIZE 32768 #define DEVICE_SIZE 8192 +static const LPWSTR error_prefix = L"lsdd: "; + static char SymbolicLinks [LINKS_SIZE]; static char DosDeviceName [DEVICE_SIZE]; @@ -57,7 +59,7 @@ main (int argc, char * argv [] ) { printf ( - "ReactOS %s - List DOS Devices Utility\n" + "ReactOS/Win32 %s - List DOS Devices Utility\n" "Written by E.Aliberti (%s)\n\n", KERNEL_RELEASE_STR, __DATE__ @@ -102,7 +104,7 @@ else { PrintWin32Error ( - L"ldd: ", + error_prefix, GetLastError () ); } @@ -112,7 +114,7 @@ else { PrintWin32Error ( - L"ldd: ", + error_prefix, GetLastError () ); return EXIT_FAILURE;
19 years, 3 months
1
0
0
0
[ea] 18053: Fix compiling.
by ea@svn.reactos.com
Fix compiling. Modified: trunk/reactos/subsys/system/notepad/text.c _____ Modified: trunk/reactos/subsys/system/notepad/text.c --- trunk/reactos/subsys/system/notepad/text.c 2005-09-25 13:54:19 UTC (rev 18052) +++ trunk/reactos/subsys/system/notepad/text.c 2005-09-25 13:56:45 UTC (rev 18053) @@ -63,7 +63,7 @@ DWORD dwPos, i; DWORD dwCharCount; BOOL bSuccess = FALSE; - BYTE b; + BYTE b = 0; int iEncoding = ENCODING_ANSI; int iCodePage; WCHAR szCrlf[2] = { '\r', '\n' }; @@ -216,14 +216,14 @@ static BOOL WriteEncodedText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, int iEncoding) { - LPBYTE pBytes; + LPBYTE pBytes = NULL; LPBYTE pAllocBuffer = NULL; DWORD dwPos = 0; DWORD dwByteCount; BYTE buffer[1024]; UINT iCodePage; DWORD dwDummy, i; - BOOL bSuccess; + BOOL bSuccess = FALSE; int iBufferSize, iRequiredBytes; BYTE b;
19 years, 3 months
1
0
0
0
[greatlrd] 18052: Remove Es.rc from timedate for it is 100% empty. Thx tsk
by greatlrd@svn.reactos.com
Remove Es.rc from timedate for it is 100% empty. Thx tsk Deleted: trunk/reactos/lib/cpl/timedate/Es.rc Modified: trunk/reactos/lib/cpl/timedate/timedate.rc _____ Deleted: trunk/reactos/lib/cpl/timedate/Es.rc _____ Modified: trunk/reactos/lib/cpl/timedate/timedate.rc --- trunk/reactos/lib/cpl/timedate/timedate.rc 2005-09-25 13:43:33 UTC (rev 18051) +++ trunk/reactos/lib/cpl/timedate/timedate.rc 2005-09-25 13:54:19 UTC (rev 18052) @@ -19,7 +19,6 @@ #include "Cz.rc" #include "De.rc" #include "Dk.rc" -#include "Es.rc" #include "Fr.rc" #include "Nl.rc" #include "Pl.rc"
19 years, 3 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
59
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
57
58
59
Results per page:
10
25
50
100
200