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
November 2015
----- 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
457 discussions
Start a n
N
ew thread
[akhaldi] 70224: [SETUPAPI_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 30 22:25:50 2015 New Revision: 70224 URL:
http://svn.reactos.org/svn/reactos?rev=70224&view=rev
Log: [SETUPAPI_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536 Added: trunk/rostests/winetests/setupapi/dialog.c (with props) Modified: trunk/rostests/winetests/setupapi/CMakeLists.txt trunk/rostests/winetests/setupapi/install.c trunk/rostests/winetests/setupapi/testlist.c Modified: trunk/rostests/winetests/setupapi/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/CMakeL…
============================================================================== --- trunk/rostests/winetests/setupapi/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/setupapi/CMakeLists.txt [iso-8859-1] Mon Nov 30 22:25:50 2015 @@ -1,6 +1,7 @@ list(APPEND SOURCE devinst.c + dialog.c diskspace.c install.c misc.c Added: trunk/rostests/winetests/setupapi/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/dialog…
============================================================================== --- trunk/rostests/winetests/setupapi/dialog.c (added) +++ trunk/rostests/winetests/setupapi/dialog.c [iso-8859-1] Mon Nov 30 22:25:50 2015 @@ -0,0 +1,107 @@ +/* + * Unit tests for SetupPromptForDisk + * + * Copyright 2014 Michael Müller + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "guiddef.h" +#include "setupapi.h" + +#include "wine/test.h" + +static void test_SetupPromptForDiskA(void) +{ + char path[] = "C:\\windows\\system32"; + char file[] = "kernel32.dll"; + char buffer[MAX_PATH]; + UINT ret; + DWORD length; + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, sizeof(buffer) - 1, &length); + ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret); + ok(length == strlen(path)+1, "Expect length %u, got %u\n", (DWORD)strlen(path) + 1, length); + ok(strcmp(path, buffer) == 0, "Expected path %s, got %s\n", path, buffer); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, 0, 0, &length); + ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %d\n", ret); + ok(length == strlen(path)+1, "Expect length %u, got %u\n", (DWORD)strlen(path) + 1, length); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, 1, &length); + ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, strlen(path), &length); + ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskA(0, "Test", "Testdisk", path, file, 0, IDF_CHECKFIRST, buffer, strlen(path)+1, &length); + ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret); + ok(length == strlen(path)+1, "Expect length %u, got %u\n", (DWORD)strlen(path) + 1, length); + ok(strcmp(path, buffer) == 0, "Expected path %s, got %s\n", path, buffer); +} + +static void test_SetupPromptForDiskW(void) +{ + WCHAR path[] = {'C',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m','3','2','\0'}; + WCHAR file[] = {'k','e','r','n','e','l','3','2','.','d','l','l','\0'}; + WCHAR title[] = {'T','e','s','t','\0'}; + WCHAR disk[] = {'T','e','s','t','d','i','s','k','\0'}; + WCHAR buffer[MAX_PATH]; + UINT ret; + DWORD length; + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskW(0, title, disk, path, file, 0, IDF_CHECKFIRST, buffer, MAX_PATH-1, &length); + ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret); + ok(length == lstrlenW(path)+1, "Expect length %u, got %u\n", lstrlenW(path)+1, length); + ok(lstrcmpW(path, buffer) == 0, "Expected path %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskW(0, title, disk, path, file, 0, IDF_CHECKFIRST, 0, 0, &length); + ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %d\n", ret); + ok(length == lstrlenW(path)+1, "Expect length %u, got %u\n", lstrlenW(path)+1, length); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskW(0, title, disk, path, file, 0, IDF_CHECKFIRST, buffer, 1, &length); + ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskW(0, title, disk, path, file, 0, IDF_CHECKFIRST, buffer, lstrlenW(path), &length); + ok(ret == DPROMPT_BUFFERTOOSMALL, "Expected DPROMPT_BUFFERTOOSMALL, got %u\n", ret); + + memset(buffer, 0, sizeof(buffer)); + ret = SetupPromptForDiskW(0, title, disk, path, file, 0, IDF_CHECKFIRST, buffer, lstrlenW(path)+1, &length); + ok(ret == DPROMPT_SUCCESS, "Expected DPROMPT_SUCCESS, got %u\n", ret); + ok(length == lstrlenW(path)+1, "Expect length %u, got %u\n", lstrlenW(path)+1, length); + ok(lstrcmpW(path, buffer) == 0, "Expected path %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer)); +} + +START_TEST(dialog) +{ + test_SetupPromptForDiskA(); + test_SetupPromptForDiskW(); +} Propchange: trunk/rostests/winetests/setupapi/dialog.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/winetests/setupapi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/instal…
============================================================================== --- trunk/rostests/winetests/setupapi/install.c [iso-8859-1] (original) +++ trunk/rostests/winetests/setupapi/install.c [iso-8859-1] Mon Nov 30 22:25:50 2015 @@ -63,10 +63,12 @@ static void create_inf_file(LPCSTR filename, const char *data) { DWORD res; + BOOL ret; HANDLE handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); assert(handle != INVALID_HANDLE_VALUE); - assert(WriteFile(handle, data, strlen(data), &res, NULL)); + ret = WriteFile(handle, data, strlen(data), &res, NULL); + assert(ret != 0); CloseHandle(handle); } @@ -718,6 +720,64 @@ RemoveDirectoryA(dirA); } +static const char dirid_inf[] = "[Version]\n" + "Signature=\"$Chicago$\"\n" + "[DefaultInstall]\n" + "AddReg=Add.Settings\n" + "[Add.Settings]\n" + "HKCU,Software\\Wine\\setupapitest,dirid,,%%%i%%\n"; + +static void check_dirid(int dirid, LPCSTR expected) +{ + char buffer[sizeof(dirid_inf)+11]; + char path[MAX_PATH], actual[MAX_PATH]; + LONG ret; + DWORD size, type; + HKEY key; + + sprintf(buffer, dirid_inf, dirid); + + create_inf_file(inffile, buffer); + + sprintf(path, "%s\\%s", CURR_DIR, inffile); + run_cmdline("DefaultInstall", 128, path); + + size = sizeof(actual); + actual[0] = '\0'; + ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest", &key); + if (ret == ERROR_SUCCESS) + { + ret = RegQueryValueExA(key, "dirid", NULL, &type, (BYTE*)&actual, &size); + RegCloseKey(key); + if (type != REG_SZ) + ret = ERROR_FILE_NOT_FOUND; + } + + ok(ret == ERROR_SUCCESS, "Failed getting value for dirid %i, err=%d\n", dirid, ret); + ok(!strcmp(actual, expected), "Expected path for dirid %i was \"%s\", got \"%s\"\n", dirid, expected, actual); + + ok_registry(TRUE); + ret = DeleteFileA(inffile); + ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError()); +} + +/* Test dirid values */ +static void test_dirid(void) +{ + char expected[MAX_PATH]; + + check_dirid(DIRID_NULL, ""); + + GetWindowsDirectoryA(expected, MAX_PATH); + check_dirid(DIRID_WINDOWS, expected); + + GetSystemDirectoryA(expected, MAX_PATH); + check_dirid(DIRID_SYSTEM, expected); + + strcat(expected, "\\unknown"); + check_dirid(40, expected); +} + START_TEST(install) { HMODULE hsetupapi = GetModuleHandleA("setupapi.dll"); @@ -768,6 +828,7 @@ test_registry(); test_install_svc_from(); test_driver_install(); + test_dirid(); UnhookWindowsHookEx(hhook); Modified: trunk/rostests/winetests/setupapi/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/testli…
============================================================================== --- trunk/rostests/winetests/setupapi/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/setupapi/testlist.c [iso-8859-1] Mon Nov 30 22:25:50 2015 @@ -4,6 +4,7 @@ #include <wine/test.h> extern void func_devinst(void); +extern void func_dialog(void); extern void func_diskspace(void); extern void func_install(void); extern void func_misc(void); @@ -15,6 +16,7 @@ const struct test winetest_testlist[] = { { "devinst", func_devinst }, + { "dialog", func_dialog }, { "diskspace", func_diskspace }, { "install", func_install }, { "misc", func_misc },
9 years
1
0
0
0
[akhaldi] 70223: [PSDK] Update d3d9types.h. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 30 21:55:07 2015 New Revision: 70223 URL:
http://svn.reactos.org/svn/reactos?rev=70223&view=rev
Log: [PSDK] Update d3d9types.h. CORE-10536 Modified: trunk/reactos/include/psdk/d3d9types.h Modified: trunk/reactos/include/psdk/d3d9types.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/d3d9types.h?r…
============================================================================== --- trunk/reactos/include/psdk/d3d9types.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/d3d9types.h [iso-8859-1] Mon Nov 30 21:55:07 2015 @@ -21,6 +21,10 @@ #ifndef __WINE_D3D9TYPES_H #define __WINE_D3D9TYPES_H +#ifdef __i386__ +#include <pshpack4.h> +#endif + /***************************************************************************** * Direct 3D v9 #defines */ @@ -56,10 +60,10 @@ #define D3DCS_PLANE5 0x800L #define D3DCS_ALL 0xFFFL -#define D3DFVF_TEXTUREFORMAT1 3 -#define D3DFVF_TEXTUREFORMAT2 0 -#define D3DFVF_TEXTUREFORMAT3 1 -#define D3DFVF_TEXTUREFORMAT4 2 +#define D3DFVF_TEXTUREFORMAT1 3u +#define D3DFVF_TEXTUREFORMAT2 0u +#define D3DFVF_TEXTUREFORMAT3 1u +#define D3DFVF_TEXTUREFORMAT4 2u #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16)) #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2) #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)) @@ -174,8 +178,8 @@ #define D3DPV_DONOTCOPYDATA (1 << 0) -#define D3DSTREAMSOURCE_INDEXEDDATA (1 << 30) -#define D3DSTREAMSOURCE_INSTANCEDATA (2 << 30) +#define D3DSTREAMSOURCE_INDEXEDDATA (1u << 30) +#define D3DSTREAMSOURCE_INSTANCEDATA (2u << 30) #define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4 @@ -206,7 +210,6 @@ #define D3DPRESENTFLAG_NOAUTOROTATE 0x00000020 /* d3d9ex, ignore display rotation */ #define D3DPRESENTFLAG_UNPRUNEDMODE 0x00000040 /* d3d9ex, specify invalid display modes */ -#define D3DPRESENT_BACK_BUFFERS_MAX 3L #define D3DPRESENT_RATE_DEFAULT 0x00000000 /**************************** @@ -642,8 +645,6 @@ D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff } D3DBACKBUFFER_TYPE; - -#define D3DPRESENT_BACK_BUFFER_MAX 3L typedef enum _D3DBASISTYPE { D3DBASIS_BEZIER = 0, @@ -1583,4 +1584,8 @@ D3DSPC_RESERVED1, } D3DSHADER_COMPARISON; +#ifdef __i386__ +#include <poppack.h> +#endif + #endif /* __WINE_D3D9TYPES_H */
9 years
1
0
0
0
[akhaldi] 70222: [IPHLPAPI_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 30 21:47:40 2015 New Revision: 70222 URL:
http://svn.reactos.org/svn/reactos?rev=70222&view=rev
Log: [IPHLPAPI_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/rostests/winetests/iphlpapi/iphlpapi.c Modified: trunk/rostests/winetests/iphlpapi/iphlpapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/iphlpapi/iphlpa…
============================================================================== --- trunk/rostests/winetests/iphlpapi/iphlpapi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/iphlpapi/iphlpapi.c [iso-8859-1] Mon Nov 30 21:47:40 2015 @@ -38,11 +38,15 @@ #include "winsock2.h" #include "windef.h" #include "winbase.h" +#include "ws2tcpip.h" #include "iphlpapi.h" #include "iprtrmib.h" +#include "netioapi.h" #include "wine/test.h" #include <stdio.h> #include <stdlib.h> + +#define ICMP_MINLEN 8 /* copied from dlls/iphlpapi/ip_icmp.h file */ #undef htonl #undef htons @@ -56,117 +60,100 @@ static HMODULE hLibrary = NULL; -typedef DWORD (WINAPI *GetNumberOfInterfacesFunc)(PDWORD); -typedef DWORD (WINAPI *GetIpAddrTableFunc)(PMIB_IPADDRTABLE,PULONG,BOOL); -typedef DWORD (WINAPI *GetIfEntryFunc)(PMIB_IFROW); -typedef DWORD (WINAPI *GetFriendlyIfIndexFunc)(DWORD); -typedef DWORD (WINAPI *GetIfTableFunc)(PMIB_IFTABLE,PULONG,BOOL); -typedef DWORD (WINAPI *GetIpForwardTableFunc)(PMIB_IPFORWARDTABLE,PULONG,BOOL); -typedef DWORD (WINAPI *GetIpNetTableFunc)(PMIB_IPNETTABLE,PULONG,BOOL); -typedef DWORD (WINAPI *GetInterfaceInfoFunc)(PIP_INTERFACE_INFO,PULONG); -typedef DWORD (WINAPI *GetAdaptersInfoFunc)(PIP_ADAPTER_INFO,PULONG); -typedef DWORD (WINAPI *GetNetworkParamsFunc)(PFIXED_INFO,PULONG); -typedef DWORD (WINAPI *GetIcmpStatisticsFunc)(PMIB_ICMP); -typedef DWORD (WINAPI *GetIpStatisticsFunc)(PMIB_IPSTATS); -typedef DWORD (WINAPI *GetTcpStatisticsFunc)(PMIB_TCPSTATS); -typedef DWORD (WINAPI *GetUdpStatisticsFunc)(PMIB_UDPSTATS); -typedef DWORD (WINAPI *GetTcpTableFunc)(PMIB_TCPTABLE,PDWORD,BOOL); -typedef DWORD (WINAPI *GetUdpTableFunc)(PMIB_UDPTABLE,PDWORD,BOOL); -typedef DWORD (WINAPI *GetPerAdapterInfoFunc)(ULONG,PIP_PER_ADAPTER_INFO,PULONG); -typedef DWORD (WINAPI *GetAdaptersAddressesFunc)(ULONG,ULONG,PVOID,PIP_ADAPTER_ADDRESSES,PULONG); -typedef DWORD (WINAPI *NotifyAddrChangeFunc)(PHANDLE,LPOVERLAPPED); -typedef BOOL (WINAPI *CancelIPChangeNotifyFunc)(LPOVERLAPPED); - -static GetNumberOfInterfacesFunc gGetNumberOfInterfaces = NULL; -static GetIpAddrTableFunc gGetIpAddrTable = NULL; -static GetIfEntryFunc gGetIfEntry = NULL; -static GetFriendlyIfIndexFunc gGetFriendlyIfIndex = NULL; -static GetIfTableFunc gGetIfTable = NULL; -static GetIpForwardTableFunc gGetIpForwardTable = NULL; -static GetIpNetTableFunc gGetIpNetTable = NULL; -static GetInterfaceInfoFunc gGetInterfaceInfo = NULL; -static GetAdaptersInfoFunc gGetAdaptersInfo = NULL; -static GetNetworkParamsFunc gGetNetworkParams = NULL; -static GetIcmpStatisticsFunc gGetIcmpStatistics = NULL; -static GetIpStatisticsFunc gGetIpStatistics = NULL; -static GetTcpStatisticsFunc gGetTcpStatistics = NULL; -static GetUdpStatisticsFunc gGetUdpStatistics = NULL; -static GetTcpTableFunc gGetTcpTable = NULL; -static GetUdpTableFunc gGetUdpTable = NULL; -static GetPerAdapterInfoFunc gGetPerAdapterInfo = NULL; -static GetAdaptersAddressesFunc gGetAdaptersAddresses = NULL; -static NotifyAddrChangeFunc gNotifyAddrChange = NULL; -static CancelIPChangeNotifyFunc gCancelIPChangeNotify = NULL; +static DWORD (WINAPI *pGetNumberOfInterfaces)(PDWORD); +static DWORD (WINAPI *pGetIpAddrTable)(PMIB_IPADDRTABLE,PULONG,BOOL); +static DWORD (WINAPI *pGetIfEntry)(PMIB_IFROW); +static DWORD (WINAPI *pGetIfEntry2)(PMIB_IF_ROW2); +static DWORD (WINAPI *pGetFriendlyIfIndex)(DWORD); +static DWORD (WINAPI *pGetIfTable)(PMIB_IFTABLE,PULONG,BOOL); +static DWORD (WINAPI *pGetIfTable2)(PMIB_IF_TABLE2*); +static DWORD (WINAPI *pGetIpForwardTable)(PMIB_IPFORWARDTABLE,PULONG,BOOL); +static DWORD (WINAPI *pGetIpNetTable)(PMIB_IPNETTABLE,PULONG,BOOL); +static DWORD (WINAPI *pGetInterfaceInfo)(PIP_INTERFACE_INFO,PULONG); +static DWORD (WINAPI *pGetAdaptersInfo)(PIP_ADAPTER_INFO,PULONG); +static DWORD (WINAPI *pGetNetworkParams)(PFIXED_INFO,PULONG); +static DWORD (WINAPI *pGetIcmpStatistics)(PMIB_ICMP); +static DWORD (WINAPI *pGetIpStatistics)(PMIB_IPSTATS); +static DWORD (WINAPI *pGetTcpStatistics)(PMIB_TCPSTATS); +static DWORD (WINAPI *pGetUdpStatistics)(PMIB_UDPSTATS); +static DWORD (WINAPI *pGetIcmpStatisticsEx)(PMIB_ICMP_EX,DWORD); +static DWORD (WINAPI *pGetIpStatisticsEx)(PMIB_IPSTATS,DWORD); +static DWORD (WINAPI *pGetTcpStatisticsEx)(PMIB_TCPSTATS,DWORD); +static DWORD (WINAPI *pGetUdpStatisticsEx)(PMIB_UDPSTATS,DWORD); +static DWORD (WINAPI *pGetTcpTable)(PMIB_TCPTABLE,PDWORD,BOOL); +static DWORD (WINAPI *pGetUdpTable)(PMIB_UDPTABLE,PDWORD,BOOL); +static DWORD (WINAPI *pGetPerAdapterInfo)(ULONG,PIP_PER_ADAPTER_INFO,PULONG); +static DWORD (WINAPI *pGetAdaptersAddresses)(ULONG,ULONG,PVOID,PIP_ADAPTER_ADDRESSES,PULONG); +static DWORD (WINAPI *pNotifyAddrChange)(PHANDLE,LPOVERLAPPED); +static BOOL (WINAPI *pCancelIPChangeNotify)(LPOVERLAPPED); +static DWORD (WINAPI *pGetExtendedTcpTable)(PVOID,PDWORD,BOOL,ULONG,TCP_TABLE_CLASS,ULONG); +static DWORD (WINAPI *pGetExtendedUdpTable)(PVOID,PDWORD,BOOL,ULONG,UDP_TABLE_CLASS,ULONG); +static DWORD (WINAPI *pSetTcpEntry)(PMIB_TCPROW); +static HANDLE(WINAPI *pIcmpCreateFile)(VOID); +static DWORD (WINAPI *pIcmpSendEcho)(HANDLE,IPAddr,LPVOID,WORD,PIP_OPTION_INFORMATION,LPVOID,DWORD,DWORD); +static DWORD (WINAPI *pCreateSortedAddressPairs)(const PSOCKADDR_IN6,ULONG,const PSOCKADDR_IN6,ULONG,ULONG, + PSOCKADDR_IN6_PAIR*,ULONG*); +static void (WINAPI *pFreeMibTable)(void*); +static DWORD (WINAPI *pConvertInterfaceGuidToLuid)(const GUID*,NET_LUID*); +static DWORD (WINAPI *pConvertInterfaceIndexToLuid)(NET_IFINDEX,NET_LUID*); +static DWORD (WINAPI *pConvertInterfaceLuidToGuid)(const NET_LUID*,GUID*); +static DWORD (WINAPI *pConvertInterfaceLuidToIndex)(const NET_LUID*,NET_IFINDEX*); +static DWORD (WINAPI *pConvertInterfaceLuidToNameW)(const NET_LUID*,WCHAR*,SIZE_T); +static DWORD (WINAPI *pConvertInterfaceLuidToNameA)(const NET_LUID*,char*,SIZE_T); +static DWORD (WINAPI *pConvertInterfaceNameToLuidA)(const char*,NET_LUID*); +static DWORD (WINAPI *pConvertInterfaceNameToLuidW)(const WCHAR*,NET_LUID*); static void loadIPHlpApi(void) { hLibrary = LoadLibraryA("iphlpapi.dll"); if (hLibrary) { - gGetNumberOfInterfaces = (GetNumberOfInterfacesFunc)GetProcAddress( - hLibrary, "GetNumberOfInterfaces"); - gGetIpAddrTable = (GetIpAddrTableFunc)GetProcAddress( - hLibrary, "GetIpAddrTable"); - gGetIfEntry = (GetIfEntryFunc)GetProcAddress( - hLibrary, "GetIfEntry"); - gGetFriendlyIfIndex = (GetFriendlyIfIndexFunc)GetProcAddress( - hLibrary, "GetFriendlyIfIndex"); - gGetIfTable = (GetIfTableFunc)GetProcAddress( - hLibrary, "GetIfTable"); - gGetIpForwardTable = (GetIpForwardTableFunc)GetProcAddress( - hLibrary, "GetIpForwardTable"); - gGetIpNetTable = (GetIpNetTableFunc)GetProcAddress( - hLibrary, "GetIpNetTable"); - gGetInterfaceInfo = (GetInterfaceInfoFunc)GetProcAddress( - hLibrary, "GetInterfaceInfo"); - gGetAdaptersInfo = (GetAdaptersInfoFunc)GetProcAddress( - hLibrary, "GetAdaptersInfo"); - gGetNetworkParams = (GetNetworkParamsFunc)GetProcAddress( - hLibrary, "GetNetworkParams"); - gGetIcmpStatistics = (GetIcmpStatisticsFunc)GetProcAddress( - hLibrary, "GetIcmpStatistics"); - gGetIpStatistics = (GetIpStatisticsFunc)GetProcAddress( - hLibrary, "GetIpStatistics"); - gGetTcpStatistics = (GetTcpStatisticsFunc)GetProcAddress( - hLibrary, "GetTcpStatistics"); - gGetUdpStatistics = (GetUdpStatisticsFunc)GetProcAddress( - hLibrary, "GetUdpStatistics"); - gGetTcpTable = (GetTcpTableFunc)GetProcAddress( - hLibrary, "GetTcpTable"); - gGetUdpTable = (GetUdpTableFunc)GetProcAddress( - hLibrary, "GetUdpTable"); - gGetPerAdapterInfo = (GetPerAdapterInfoFunc)GetProcAddress(hLibrary, "GetPerAdapterInfo"); - gGetAdaptersAddresses = (GetAdaptersAddressesFunc)GetProcAddress(hLibrary, "GetAdaptersAddresses"); - gNotifyAddrChange = (NotifyAddrChangeFunc)GetProcAddress( - hLibrary, "NotifyAddrChange"); - gCancelIPChangeNotify = (CancelIPChangeNotifyFunc)GetProcAddress( - hLibrary, "CancelIPChangeNotify"); + pGetNumberOfInterfaces = (void *)GetProcAddress(hLibrary, "GetNumberOfInterfaces"); + pGetIpAddrTable = (void *)GetProcAddress(hLibrary, "GetIpAddrTable"); + pGetIfEntry = (void *)GetProcAddress(hLibrary, "GetIfEntry"); + pGetIfEntry2 = (void *)GetProcAddress(hLibrary, "GetIfEntry2"); + pGetFriendlyIfIndex = (void *)GetProcAddress(hLibrary, "GetFriendlyIfIndex"); + pGetIfTable = (void *)GetProcAddress(hLibrary, "GetIfTable"); + pGetIfTable2 = (void *)GetProcAddress(hLibrary, "GetIfTable2"); + pGetIpForwardTable = (void *)GetProcAddress(hLibrary, "GetIpForwardTable"); + pGetIpNetTable = (void *)GetProcAddress(hLibrary, "GetIpNetTable"); + pGetInterfaceInfo = (void *)GetProcAddress(hLibrary, "GetInterfaceInfo"); + pGetAdaptersInfo = (void *)GetProcAddress(hLibrary, "GetAdaptersInfo"); + pGetNetworkParams = (void *)GetProcAddress(hLibrary, "GetNetworkParams"); + pGetIcmpStatistics = (void *)GetProcAddress(hLibrary, "GetIcmpStatistics"); + pGetIpStatistics = (void *)GetProcAddress(hLibrary, "GetIpStatistics"); + pGetTcpStatistics = (void *)GetProcAddress(hLibrary, "GetTcpStatistics"); + pGetUdpStatistics = (void *)GetProcAddress(hLibrary, "GetUdpStatistics"); + pGetIcmpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetIcmpStatisticsEx"); + pGetIpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetIpStatisticsEx"); + pGetTcpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetTcpStatisticsEx"); + pGetUdpStatisticsEx = (void *)GetProcAddress(hLibrary, "GetUdpStatisticsEx"); + pGetTcpTable = (void *)GetProcAddress(hLibrary, "GetTcpTable"); + pGetUdpTable = (void *)GetProcAddress(hLibrary, "GetUdpTable"); + pGetPerAdapterInfo = (void *)GetProcAddress(hLibrary, "GetPerAdapterInfo"); + pGetAdaptersAddresses = (void *)GetProcAddress(hLibrary, "GetAdaptersAddresses"); + pNotifyAddrChange = (void *)GetProcAddress(hLibrary, "NotifyAddrChange"); + pCancelIPChangeNotify = (void *)GetProcAddress(hLibrary, "CancelIPChangeNotify"); + pGetExtendedTcpTable = (void *)GetProcAddress(hLibrary, "GetExtendedTcpTable"); + pGetExtendedUdpTable = (void *)GetProcAddress(hLibrary, "GetExtendedUdpTable"); + pSetTcpEntry = (void *)GetProcAddress(hLibrary, "SetTcpEntry"); + pIcmpCreateFile = (void *)GetProcAddress(hLibrary, "IcmpCreateFile"); + pIcmpSendEcho = (void *)GetProcAddress(hLibrary, "IcmpSendEcho"); + pCreateSortedAddressPairs = (void *)GetProcAddress(hLibrary, "CreateSortedAddressPairs"); + pFreeMibTable = (void *)GetProcAddress(hLibrary, "FreeMibTable"); + pConvertInterfaceGuidToLuid = (void *)GetProcAddress(hLibrary, "ConvertInterfaceGuidToLuid"); + pConvertInterfaceIndexToLuid = (void *)GetProcAddress(hLibrary, "ConvertInterfaceIndexToLuid"); + pConvertInterfaceLuidToGuid = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToGuid"); + pConvertInterfaceLuidToIndex = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToIndex"); + pConvertInterfaceLuidToNameA = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToNameA"); + pConvertInterfaceLuidToNameW = (void *)GetProcAddress(hLibrary, "ConvertInterfaceLuidToNameW"); + pConvertInterfaceNameToLuidA = (void *)GetProcAddress(hLibrary, "ConvertInterfaceNameToLuidA"); + pConvertInterfaceNameToLuidW = (void *)GetProcAddress(hLibrary, "ConvertInterfaceNameToLuidW"); } } static void freeIPHlpApi(void) { - if (hLibrary) { - gGetNumberOfInterfaces = NULL; - gGetIpAddrTable = NULL; - gGetIfEntry = NULL; - gGetFriendlyIfIndex = NULL; - gGetIfTable = NULL; - gGetIpForwardTable = NULL; - gGetIpNetTable = NULL; - gGetInterfaceInfo = NULL; - gGetAdaptersInfo = NULL; - gGetNetworkParams = NULL; - gGetIcmpStatistics = NULL; - gGetIpStatistics = NULL; - gGetTcpStatistics = NULL; - gGetUdpStatistics = NULL; - gGetTcpTable = NULL; - gGetUdpTable = NULL; - gNotifyAddrChange = NULL; - gCancelIPChangeNotify = NULL; FreeLibrary(hLibrary); - hLibrary = NULL; - } } /* replacement for inet_ntoa */ @@ -177,6 +164,16 @@ ip = htonl(ip); sprintf( buffer, "%u.%u.%u.%u", (ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff ); return buffer; +} + +static inline const char* debugstr_longlong(ULONGLONG ll) +{ + static char string[17]; + if (sizeof(ll) > sizeof(unsigned long) && ll >> 32) + sprintf(string, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll); + else + sprintf(string, "%lx", (unsigned long)ll); + return string; } /* @@ -189,12 +186,12 @@ static void testGetNumberOfInterfaces(void) { - if (gGetNumberOfInterfaces) { + if (pGetNumberOfInterfaces) { DWORD apiReturn, numInterfaces; /* Crashes on Vista */ if (0) { - apiReturn = gGetNumberOfInterfaces(NULL); + apiReturn = pGetNumberOfInterfaces(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) return; ok(apiReturn == ERROR_INVALID_PARAMETER, @@ -202,7 +199,7 @@ apiReturn); } - apiReturn = gGetNumberOfInterfaces(&numInterfaces); + apiReturn = pGetNumberOfInterfaces(&numInterfaces); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetNumberOfInterfaces is not supported\n"); return; @@ -214,12 +211,12 @@ static void testGetIfEntry(DWORD index) { - if (gGetIfEntry) { + if (pGetIfEntry) { DWORD apiReturn; MIB_IFROW row; memset(&row, 0, sizeof(row)); - apiReturn = gGetIfEntry(NULL); + apiReturn = pGetIfEntry(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIfEntry is not supported\n"); return; @@ -228,13 +225,13 @@ "GetIfEntry(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); row.dwIndex = -1; /* hope that's always bogus! */ - apiReturn = gGetIfEntry(&row); + apiReturn = pGetIfEntry(&row); ok(apiReturn == ERROR_INVALID_DATA || apiReturn == ERROR_FILE_NOT_FOUND /* Vista */, "GetIfEntry(bogus row) returned %d, expected ERROR_INVALID_DATA or ERROR_FILE_NOT_FOUND\n", apiReturn); row.dwIndex = index; - apiReturn = gGetIfEntry(&row); + apiReturn = pGetIfEntry(&row); ok(apiReturn == NO_ERROR, "GetIfEntry returned %d, expected NO_ERROR\n", apiReturn); } @@ -242,11 +239,11 @@ static void testGetIpAddrTable(void) { - if (gGetIpAddrTable) { + if (pGetIpAddrTable) { DWORD apiReturn; ULONG dwSize = 0; - apiReturn = gGetIpAddrTable(NULL, NULL, FALSE); + apiReturn = pGetIpAddrTable(NULL, NULL, FALSE); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIpAddrTable is not supported\n"); return; @@ -254,19 +251,28 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIpAddrTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetIpAddrTable(NULL, &dwSize, FALSE); + apiReturn = pGetIpAddrTable(NULL, &dwSize, FALSE); ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, "GetIpAddrTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_IPADDRTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - apiReturn = gGetIpAddrTable(buf, &dwSize, FALSE); + apiReturn = pGetIpAddrTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetIpAddrTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && buf->dwNumEntries) + { + int i; testGetIfEntry(buf->table[0].dwIndex); + for (i = 0; i < buf->dwNumEntries; i++) + { + ok (buf->table[i].wType != 0, "Test[%d]: expected wType > 0\n", i); + trace("Entry[%d]: addr %s, dwIndex %u, wType 0x%x\n", i, + ntoa(buf->table[i].dwAddr), buf->table[i].dwIndex, buf->table[i].wType); + } + } HeapFree(GetProcessHeap(), 0, buf); } } @@ -274,11 +280,11 @@ static void testGetIfTable(void) { - if (gGetIfTable) { + if (pGetIfTable) { DWORD apiReturn; ULONG dwSize = 0; - apiReturn = gGetIfTable(NULL, NULL, FALSE); + apiReturn = pGetIfTable(NULL, NULL, FALSE); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIfTable is not supported\n"); return; @@ -286,14 +292,14 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIfTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetIfTable(NULL, &dwSize, FALSE); + apiReturn = pGetIfTable(NULL, &dwSize, FALSE); ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, "GetIfTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_IFTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - apiReturn = gGetIfTable(buf, &dwSize, FALSE); + apiReturn = pGetIfTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetIfTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n\n", apiReturn); @@ -328,11 +334,11 @@ static void testGetIpForwardTable(void) { - if (gGetIpForwardTable) { + if (pGetIpForwardTable) { DWORD apiReturn; ULONG dwSize = 0; - apiReturn = gGetIpForwardTable(NULL, NULL, FALSE); + apiReturn = pGetIpForwardTable(NULL, NULL, FALSE); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIpForwardTable is not supported\n"); return; @@ -340,14 +346,14 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIpForwardTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetIpForwardTable(NULL, &dwSize, FALSE); + apiReturn = pGetIpForwardTable(NULL, &dwSize, FALSE); ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, "GetIpForwardTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_IPFORWARDTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - apiReturn = gGetIpForwardTable(buf, &dwSize, FALSE); + apiReturn = pGetIpForwardTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetIpForwardTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); @@ -359,12 +365,12 @@ trace( "IP forward table: %u entries\n", buf->dwNumEntries ); for (i = 0; i < buf->dwNumEntries; i++) { - char buffer[40]; + char buffer[100]; sprintf( buffer, "dest %s", ntoa( buf->table[i].dwForwardDest )); sprintf( buffer + strlen(buffer), " mask %s", ntoa( buf->table[i].dwForwardMask )); trace( "%u: %s gw %s if %u type %u\n", i, buffer, ntoa( buf->table[i].dwForwardNextHop ), - buf->table[i].dwForwardIfIndex, buf->table[i].dwForwardType ); + buf->table[i].dwForwardIfIndex, U1(buf->table[i]).dwForwardType ); } } HeapFree(GetProcessHeap(), 0, buf); @@ -374,11 +380,11 @@ static void testGetIpNetTable(void) { - if (gGetIpNetTable) { + if (pGetIpNetTable) { DWORD apiReturn; ULONG dwSize = 0; - apiReturn = gGetIpNetTable(NULL, NULL, FALSE); + apiReturn = pGetIpNetTable(NULL, NULL, FALSE); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIpNetTable is not supported\n"); return; @@ -386,7 +392,7 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIpNetTable(NULL, NULL, FALSE) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetIpNetTable(NULL, &dwSize, FALSE); + apiReturn = pGetIpNetTable(NULL, &dwSize, FALSE); ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_INSUFFICIENT_BUFFER, "GetIpNetTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_NO_DATA or ERROR_INSUFFICIENT_BUFFER\n", apiReturn); @@ -395,7 +401,7 @@ else if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_IPNETTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - apiReturn = gGetIpNetTable(buf, &dwSize, FALSE); + apiReturn = pGetIpNetTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR || apiReturn == ERROR_NO_DATA, /* empty ARP table's okay */ "GetIpNetTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", @@ -409,7 +415,7 @@ for (i = 0; i < buf->dwNumEntries; i++) { trace( "%u: idx %u type %u addr %s phys", - i, buf->table[i].dwIndex, buf->table[i].dwType, ntoa( buf->table[i].dwAddr )); + i, buf->table[i].dwIndex, U(buf->table[i]).dwType, ntoa( buf->table[i].dwAddr )); for (j = 0; j < buf->table[i].dwPhysAddrLen; j++) printf( " %02x", buf->table[i].bPhysAddr[j] ); printf( "\n" ); @@ -422,13 +428,13 @@ static void testGetIcmpStatistics(void) { - if (gGetIcmpStatistics) { + if (pGetIcmpStatistics) { DWORD apiReturn; MIB_ICMP stats; /* Crashes on Vista */ if (0) { - apiReturn = gGetIcmpStatistics(NULL); + apiReturn = pGetIcmpStatistics(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) return; ok(apiReturn == ERROR_INVALID_PARAMETER, @@ -436,7 +442,7 @@ apiReturn); } - apiReturn = gGetIcmpStatistics(&stats); + apiReturn = pGetIcmpStatistics(&stats); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIcmpStatistics is not supported\n"); @@ -466,11 +472,11 @@ static void testGetIpStatistics(void) { - if (gGetIpStatistics) { + if (pGetIpStatistics) { DWORD apiReturn; MIB_IPSTATS stats; - apiReturn = gGetIpStatistics(NULL); + apiReturn = pGetIpStatistics(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetIpStatistics is not supported\n"); return; @@ -478,13 +484,13 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetIpStatistics(&stats); + apiReturn = pGetIpStatistics(&stats); ok(apiReturn == NO_ERROR, "GetIpStatistics returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "IP stats:\n" ); - trace( " dwForwarding: %u\n", stats.dwForwarding ); + trace( " dwForwarding: %u\n", U(stats).dwForwarding ); trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); trace( " dwInReceives: %u\n", stats.dwInReceives ); trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); @@ -513,11 +519,11 @@ static void testGetTcpStatistics(void) { - if (gGetTcpStatistics) { + if (pGetTcpStatistics) { DWORD apiReturn; MIB_TCPSTATS stats; - apiReturn = gGetTcpStatistics(NULL); + apiReturn = pGetTcpStatistics(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetTcpStatistics is not supported\n"); return; @@ -525,13 +531,13 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetTcpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetTcpStatistics(&stats); + apiReturn = pGetTcpStatistics(&stats); ok(apiReturn == NO_ERROR, "GetTcpStatistics returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { trace( "TCP stats:\n" ); - trace( " dwRtoAlgorithm: %u\n", stats.dwRtoAlgorithm ); + trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); trace( " dwRtoMin: %u\n", stats.dwRtoMin ); trace( " dwRtoMax: %u\n", stats.dwRtoMax ); trace( " dwMaxConn: %u\n", stats.dwMaxConn ); @@ -552,11 +558,11 @@ static void testGetUdpStatistics(void) { - if (gGetUdpStatistics) { + if (pGetUdpStatistics) { DWORD apiReturn; MIB_UDPSTATS stats; - apiReturn = gGetUdpStatistics(NULL); + apiReturn = pGetUdpStatistics(NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetUdpStatistics is not supported\n"); return; @@ -564,7 +570,7 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetUdpStatistics(NULL) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetUdpStatistics(&stats); + apiReturn = pGetUdpStatistics(&stats); ok(apiReturn == NO_ERROR, "GetUdpStatistics returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) @@ -579,13 +585,252 @@ } } +static void testGetIcmpStatisticsEx(void) +{ + DWORD apiReturn; + MIB_ICMP_EX stats; + + if (!pGetIcmpStatisticsEx) + { + win_skip( "GetIcmpStatisticsEx not available\n" ); + return; + } + + /* Crashes on Vista */ + if (1) { + apiReturn = pGetIcmpStatisticsEx(NULL, AF_INET); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIcmpStatisticsEx(NULL, AF_INET) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + } + + apiReturn = pGetIcmpStatisticsEx(&stats, AF_BAN); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIcmpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + + apiReturn = pGetIcmpStatisticsEx(&stats, AF_INET); + ok(apiReturn == NO_ERROR, "GetIcmpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + INT i; + trace( "ICMP IPv4 Ex stats: %8s %8s\n", "in", "out" ); + trace( " dwMsgs: %8u %8u\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); + trace( " dwErrors: %8u %8u\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); + for (i = 0; i < 256; i++) + trace( " rgdwTypeCount[%3i]: %8u %8u\n", i, stats.icmpInStats.rgdwTypeCount[i], stats.icmpOutStats.rgdwTypeCount[i] ); + } + + apiReturn = pGetIcmpStatisticsEx(&stats, AF_INET6); + ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), + "GetIcmpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + INT i; + trace( "ICMP IPv6 Ex stats: %8s %8s\n", "in", "out" ); + trace( " dwMsgs: %8u %8u\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); + trace( " dwErrors: %8u %8u\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); + for (i = 0; i < 256; i++) + trace( " rgdwTypeCount[%3i]: %8u %8u\n", i, stats.icmpInStats.rgdwTypeCount[i], stats.icmpOutStats.rgdwTypeCount[i] ); + } +} + +static void testGetIpStatisticsEx(void) +{ + DWORD apiReturn; + MIB_IPSTATS stats; + + if (!pGetIpStatisticsEx) + { + win_skip( "GetIpStatisticsEx not available\n" ); + return; + } + + apiReturn = pGetIpStatisticsEx(NULL, AF_INET); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIpStatisticsEx(NULL, AF_INET) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + + apiReturn = pGetIpStatisticsEx(&stats, AF_BAN); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + + apiReturn = pGetIpStatisticsEx(&stats, AF_INET); + ok(apiReturn == NO_ERROR, "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "IP IPv4 Ex stats:\n" ); + trace( " dwForwarding: %u\n", U(stats).dwForwarding ); + trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); + trace( " dwInReceives: %u\n", stats.dwInReceives ); + trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); + trace( " dwInAddrErrors: %u\n", stats.dwInAddrErrors ); + trace( " dwForwDatagrams: %u\n", stats.dwForwDatagrams ); + trace( " dwInUnknownProtos: %u\n", stats.dwInUnknownProtos ); + trace( " dwInDiscards: %u\n", stats.dwInDiscards ); + trace( " dwInDelivers: %u\n", stats.dwInDelivers ); + trace( " dwOutRequests: %u\n", stats.dwOutRequests ); + trace( " dwRoutingDiscards: %u\n", stats.dwRoutingDiscards ); + trace( " dwOutDiscards: %u\n", stats.dwOutDiscards ); + trace( " dwOutNoRoutes: %u\n", stats.dwOutNoRoutes ); + trace( " dwReasmTimeout: %u\n", stats.dwReasmTimeout ); + trace( " dwReasmReqds: %u\n", stats.dwReasmReqds ); + trace( " dwReasmOks: %u\n", stats.dwReasmOks ); + trace( " dwReasmFails: %u\n", stats.dwReasmFails ); + trace( " dwFragOks: %u\n", stats.dwFragOks ); + trace( " dwFragFails: %u\n", stats.dwFragFails ); + trace( " dwFragCreates: %u\n", stats.dwFragCreates ); + trace( " dwNumIf: %u\n", stats.dwNumIf ); + trace( " dwNumAddr: %u\n", stats.dwNumAddr ); + trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); + } + + apiReturn = pGetIpStatisticsEx(&stats, AF_INET6); + ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), + "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "IP IPv6 Ex stats:\n" ); + trace( " dwForwarding: %u\n", U(stats).dwForwarding ); + trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); + trace( " dwInReceives: %u\n", stats.dwInReceives ); + trace( " dwInHdrErrors: %u\n", stats.dwInHdrErrors ); + trace( " dwInAddrErrors: %u\n", stats.dwInAddrErrors ); + trace( " dwForwDatagrams: %u\n", stats.dwForwDatagrams ); + trace( " dwInUnknownProtos: %u\n", stats.dwInUnknownProtos ); + trace( " dwInDiscards: %u\n", stats.dwInDiscards ); + trace( " dwInDelivers: %u\n", stats.dwInDelivers ); + trace( " dwOutRequests: %u\n", stats.dwOutRequests ); + trace( " dwRoutingDiscards: %u\n", stats.dwRoutingDiscards ); + trace( " dwOutDiscards: %u\n", stats.dwOutDiscards ); + trace( " dwOutNoRoutes: %u\n", stats.dwOutNoRoutes ); + trace( " dwReasmTimeout: %u\n", stats.dwReasmTimeout ); + trace( " dwReasmReqds: %u\n", stats.dwReasmReqds ); + trace( " dwReasmOks: %u\n", stats.dwReasmOks ); + trace( " dwReasmFails: %u\n", stats.dwReasmFails ); + trace( " dwFragOks: %u\n", stats.dwFragOks ); + trace( " dwFragFails: %u\n", stats.dwFragFails ); + trace( " dwFragCreates: %u\n", stats.dwFragCreates ); + trace( " dwNumIf: %u\n", stats.dwNumIf ); + trace( " dwNumAddr: %u\n", stats.dwNumAddr ); + trace( " dwNumRoutes: %u\n", stats.dwNumRoutes ); + } +} + +static void testGetTcpStatisticsEx(void) +{ + DWORD apiReturn; + MIB_TCPSTATS stats; + + if (!pGetTcpStatisticsEx) + { + win_skip( "GetTcpStatisticsEx not available\n" ); + return; + } + + apiReturn = pGetTcpStatisticsEx(NULL, AF_INET); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetTcpStatisticsEx(NULL, AF_INET); returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + + apiReturn = pGetTcpStatisticsEx(&stats, AF_BAN); + ok(apiReturn == ERROR_INVALID_PARAMETER || apiReturn == ERROR_NOT_SUPPORTED, + "GetTcpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + + apiReturn = pGetTcpStatisticsEx(&stats, AF_INET); + ok(apiReturn == NO_ERROR, "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "TCP IPv4 Ex stats:\n" ); + trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); + trace( " dwRtoMin: %u\n", stats.dwRtoMin ); + trace( " dwRtoMax: %u\n", stats.dwRtoMax ); + trace( " dwMaxConn: %u\n", stats.dwMaxConn ); + trace( " dwActiveOpens: %u\n", stats.dwActiveOpens ); + trace( " dwPassiveOpens: %u\n", stats.dwPassiveOpens ); + trace( " dwAttemptFails: %u\n", stats.dwAttemptFails ); + trace( " dwEstabResets: %u\n", stats.dwEstabResets ); + trace( " dwCurrEstab: %u\n", stats.dwCurrEstab ); + trace( " dwInSegs: %u\n", stats.dwInSegs ); + trace( " dwOutSegs: %u\n", stats.dwOutSegs ); + trace( " dwRetransSegs: %u\n", stats.dwRetransSegs ); + trace( " dwInErrs: %u\n", stats.dwInErrs ); + trace( " dwOutRsts: %u\n", stats.dwOutRsts ); + trace( " dwNumConns: %u\n", stats.dwNumConns ); + } + + apiReturn = pGetTcpStatisticsEx(&stats, AF_INET6); + todo_wine ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), + "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "TCP IPv6 Ex stats:\n" ); + trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); + trace( " dwRtoMin: %u\n", stats.dwRtoMin ); + trace( " dwRtoMax: %u\n", stats.dwRtoMax ); + trace( " dwMaxConn: %u\n", stats.dwMaxConn ); + trace( " dwActiveOpens: %u\n", stats.dwActiveOpens ); + trace( " dwPassiveOpens: %u\n", stats.dwPassiveOpens ); + trace( " dwAttemptFails: %u\n", stats.dwAttemptFails ); + trace( " dwEstabResets: %u\n", stats.dwEstabResets ); + trace( " dwCurrEstab: %u\n", stats.dwCurrEstab ); + trace( " dwInSegs: %u\n", stats.dwInSegs ); + trace( " dwOutSegs: %u\n", stats.dwOutSegs ); + trace( " dwRetransSegs: %u\n", stats.dwRetransSegs ); + trace( " dwInErrs: %u\n", stats.dwInErrs ); + trace( " dwOutRsts: %u\n", stats.dwOutRsts ); + trace( " dwNumConns: %u\n", stats.dwNumConns ); + } +} + +static void testGetUdpStatisticsEx(void) +{ + DWORD apiReturn; + MIB_UDPSTATS stats; + + if (!pGetUdpStatisticsEx) + { + win_skip( "GetUdpStatisticsEx not available\n" ); + return; + } + + apiReturn = pGetUdpStatisticsEx(NULL, AF_INET); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetUdpStatisticsEx(NULL, AF_INET); returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + + apiReturn = pGetUdpStatisticsEx(&stats, AF_BAN); + ok(apiReturn == ERROR_INVALID_PARAMETER || apiReturn == ERROR_NOT_SUPPORTED, + "GetUdpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + + apiReturn = pGetUdpStatisticsEx(&stats, AF_INET); + ok(apiReturn == NO_ERROR, "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "UDP IPv4 Ex stats:\n" ); + trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); + trace( " dwNoPorts: %u\n", stats.dwNoPorts ); + trace( " dwInErrors: %u\n", stats.dwInErrors ); + trace( " dwOutDatagrams: %u\n", stats.dwOutDatagrams ); + trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); + } + + apiReturn = pGetUdpStatisticsEx(&stats, AF_INET6); + ok(apiReturn == NO_ERROR || broken(apiReturn == ERROR_NOT_SUPPORTED), + "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); + if (apiReturn == NO_ERROR && winetest_debug > 1) + { + trace( "UDP IPv6 Ex stats:\n" ); + trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); + trace( " dwNoPorts: %u\n", stats.dwNoPorts ); + trace( " dwInErrors: %u\n", stats.dwInErrors ); + trace( " dwOutDatagrams: %u\n", stats.dwOutDatagrams ); + trace( " dwNumAddrs: %u\n", stats.dwNumAddrs ); + } +} + static void testGetTcpTable(void) { - if (gGetTcpTable) { + if (pGetTcpTable) { DWORD apiReturn; ULONG dwSize = 0; - apiReturn = gGetTcpTable(NULL, &dwSize, FALSE); + apiReturn = pGetTcpTable(NULL, &dwSize, FALSE); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetTcpTable is not supported\n"); return; @@ -597,7 +842,7 @@ if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_TCPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - apiReturn = gGetTcpTable(buf, &dwSize, FALSE); + apiReturn = pGetTcpTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetTcpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); @@ -613,7 +858,7 @@ ntoa(buf->table[i].dwLocalAddr), ntohs(buf->table[i].dwLocalPort) ); trace( "%u: %s remote %s:%u state %u\n", i, buffer, ntoa( buf->table[i].dwRemoteAddr ), - ntohs(buf->table[i].dwRemotePort), buf->table[i].dwState ); + ntohs(buf->table[i].dwRemotePort), U(buf->table[i]).dwState ); } } HeapFree(GetProcessHeap(), 0, buf); @@ -623,11 +868,11 @@ static void testGetUdpTable(void) { - if (gGetUdpTable) { + if (pGetUdpTable) { DWORD apiReturn; ULONG dwSize = 0; - apiReturn = gGetUdpTable(NULL, &dwSize, FALSE); + apiReturn = pGetUdpTable(NULL, &dwSize, FALSE); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetUdpTable is not supported\n"); return; @@ -638,7 +883,7 @@ if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PMIB_UDPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); - apiReturn = gGetUdpTable(buf, &dwSize, FALSE); + apiReturn = pGetUdpTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetUdpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); @@ -654,6 +899,200 @@ HeapFree(GetProcessHeap(), 0, buf); } } +} + +static void testSetTcpEntry(void) +{ + DWORD ret; + MIB_TCPROW row; + + memset(&row, 0, sizeof(row)); + if(0) /* This test crashes in OS >= VISTA */ + { + ret = pSetTcpEntry(NULL); + ok( ret == ERROR_INVALID_PARAMETER, "got %u, expected %u\n", ret, ERROR_INVALID_PARAMETER); + } + + ret = pSetTcpEntry(&row); + if (ret == ERROR_NETWORK_ACCESS_DENIED) + { + win_skip("SetTcpEntry failed with access error. Skipping test.\n"); + return; + } + todo_wine ok( ret == ERROR_INVALID_PARAMETER, "got %u, expected %u\n", ret, ERROR_INVALID_PARAMETER); + + U(row).dwState = MIB_TCP_STATE_DELETE_TCB; + ret = pSetTcpEntry(&row); + todo_wine ok( ret == ERROR_MR_MID_NOT_FOUND || broken(ret == ERROR_INVALID_PARAMETER), + "got %u, expected %u\n", ret, ERROR_MR_MID_NOT_FOUND); +} + +static void testIcmpSendEcho(void) +{ + HANDLE icmp; + char senddata[32], replydata[sizeof(senddata) + sizeof(ICMP_ECHO_REPLY)]; + DWORD ret, error, replysz = sizeof(replydata); + IPAddr address; + + if (!pIcmpSendEcho || !pIcmpCreateFile) + { + win_skip( "IcmpSendEcho or IcmpCreateFile not available\n" ); + return; + } + memset(senddata, 0, sizeof(senddata)); + + address = htonl(INADDR_LOOPBACK); + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(INVALID_HANDLE_VALUE, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + error = GetLastError(); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); +todo_wine + ok (error == ERROR_INVALID_PARAMETER + || broken(error == ERROR_INVALID_HANDLE) /* <= 2003 */, + "expected 87, got %d\n", error); + + icmp = pIcmpCreateFile(); + if (icmp == INVALID_HANDLE_VALUE) + { + error = GetLastError(); + if (error == ERROR_ACCESS_DENIED) + { + skip ("ICMP is not available.\n"); + return; + } + } + ok (icmp != INVALID_HANDLE_VALUE, "IcmpCreateFile failed unexpectedly with error %d\n", GetLastError()); + + address = 0; + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + error = GetLastError(); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); + ok (error == ERROR_INVALID_NETNAME + || broken(error == IP_BAD_DESTINATION) /* <= 2003 */, + "expected 1214, got %d\n", error); + + address = htonl(INADDR_LOOPBACK); + if (0) /* crashes in XP */ + { + ret = pIcmpSendEcho(icmp, address, NULL, sizeof(senddata), NULL, replydata, replysz, 1000); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); + } + + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000); + error = GetLastError(); + ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, NULL, 0, NULL, replydata, replysz, 1000); + error = GetLastError(); + ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + + if (0) /* crashes in wine, remove IF when fixed */ + { + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, replysz, 1000); + error = GetLastError(); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); + ok (error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error); + } + + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, 0, 1000); + error = GetLastError(); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); +todo_wine + ok (error == ERROR_INVALID_PARAMETER + || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, + "expected 87, got %d\n", error); + + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, 0, 1000); + error = GetLastError(); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); +todo_wine + ok (error == ERROR_INVALID_PARAMETER + || broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */, + "expected 87, got %d\n", error); + + SetLastError(0xdeadbeef); + replysz = sizeof(replydata) - 1; + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + error = GetLastError(); + todo_wine { + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); + ok (error == IP_GENERAL_FAILURE + || broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */, + "expected 11050, got %d\n", error); + } + + SetLastError(0xdeadbeef); + replysz = sizeof(ICMP_ECHO_REPLY); + ret = pIcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000); + error = GetLastError(); +todo_wine + ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + + SetLastError(0xdeadbeef); + replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN; + ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz, 1000); + error = GetLastError(); +todo_wine + ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error); + + SetLastError(0xdeadbeef); + replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN; + ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN + 1, NULL, replydata, replysz, 1000); + error = GetLastError(); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); +todo_wine + ok (error == IP_GENERAL_FAILURE + || broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */, + "expected 11050, got %d\n", error); + + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz - 1, 1000); + error = GetLastError(); + ok (!ret, "IcmpSendEcho succeeded unexpectedly\n"); +todo_wine + ok (error == IP_GENERAL_FAILURE + || broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */, + "expected 11050, got %d\n", error); + + /* in windows >= vista the timeout can't be invalid */ + SetLastError(0xdeadbeef); + replysz = sizeof(replydata); + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 0); + error = GetLastError(); + if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error); + + SetLastError(0xdeadbeef); + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, -1); + error = GetLastError(); + if (!ret) ok(error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error); + + /* real ping test */ + SetLastError(0xdeadbeef); + address = htonl(INADDR_LOOPBACK); + ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000); + error = GetLastError(); + if (ret) + { + PICMP_ECHO_REPLY pong = (PICMP_ECHO_REPLY) replydata; + trace ("send addr : %s\n", ntoa(address)); + trace ("reply addr : %s\n", ntoa(pong->Address)); + trace ("reply size : %u\n", replysz); + trace ("roundtrip : %u ms\n", pong->RoundTripTime); + trace ("status : %u\n", pong->Status); + trace ("recv size : %u\n", pong->DataSize); + trace ("ttl : %u\n", pong->Options.Ttl); + trace ("flags : 0x%x\n", pong->Options.Flags); + } + else + { + skip ("Failed to ping with error %d, is lo interface down?.\n", error); + } } /* @@ -669,7 +1108,6 @@ SetIpNetEntry SetIpStatistics SetIpTTL -SetTcpEntry */ static void testWinNT4Functions(void) { @@ -682,17 +1120,23 @@ testGetIpStatistics(); testGetTcpStatistics(); testGetUdpStatistics(); + testGetIcmpStatisticsEx(); + testGetIpStatisticsEx(); + testGetTcpStatisticsEx(); + testGetUdpStatisticsEx(); testGetTcpTable(); testGetUdpTable(); + testSetTcpEntry(); + testIcmpSendEcho(); } static void testGetInterfaceInfo(void) { - if (gGetInterfaceInfo) { + if (pGetInterfaceInfo) { DWORD apiReturn; ULONG len = 0; - apiReturn = gGetInterfaceInfo(NULL, NULL); + apiReturn = pGetInterfaceInfo(NULL, NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetInterfaceInfo is not supported\n"); return; @@ -700,14 +1144,14 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetInterfaceInfo returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetInterfaceInfo(NULL, &len); + apiReturn = pGetInterfaceInfo(NULL, &len); ok(apiReturn == ERROR_INSUFFICIENT_BUFFER, "GetInterfaceInfo returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { PIP_INTERFACE_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); - apiReturn = gGetInterfaceInfo(buf, &len); + apiReturn = pGetInterfaceInfo(buf, &len); ok(apiReturn == NO_ERROR, "GetInterfaceInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); @@ -718,11 +1162,11 @@ static void testGetAdaptersInfo(void) { - if (gGetAdaptersInfo) { + if (pGetAdaptersInfo) { DWORD apiReturn; ULONG len = 0; - apiReturn = gGetAdaptersInfo(NULL, NULL); + apiReturn = pGetAdaptersInfo(NULL, NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetAdaptersInfo is not supported\n"); return; @@ -730,19 +1174,27 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetAdaptersInfo returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetAdaptersInfo(NULL, &len); + apiReturn = pGetAdaptersInfo(NULL, &len); ok(apiReturn == ERROR_NO_DATA || apiReturn == ERROR_BUFFER_OVERFLOW, "GetAdaptersInfo returned %d, expected ERROR_NO_DATA or ERROR_BUFFER_OVERFLOW\n", apiReturn); if (apiReturn == ERROR_NO_DATA) ; /* no adapter's, that's okay */ else if (apiReturn == ERROR_BUFFER_OVERFLOW) { - PIP_ADAPTER_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); - - apiReturn = gGetAdaptersInfo(buf, &len); + PIP_ADAPTER_INFO ptr, buf = HeapAlloc(GetProcessHeap(), 0, len); + + apiReturn = pGetAdaptersInfo(buf, &len); ok(apiReturn == NO_ERROR, "GetAdaptersInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); + ptr = buf; + while (ptr) { + ok(ptr->IpAddressList.IpAddress.String[0], "A valid IP must be present\n"); + ok(ptr->IpAddressList.IpMask.String[0], "A valid mask must be present\n"); + trace("Adapter '%s', IP %s, Mask %s\n", ptr->AdapterName, + ptr->IpAddressList.IpAddress.String, ptr->IpAddressList.IpMask.String); + ptr = ptr->Next; + } HeapFree(GetProcessHeap(), 0, buf); } } @@ -750,11 +1202,11 @@ static void testGetNetworkParams(void) { - if (gGetNetworkParams) { + if (pGetNetworkParams) { DWORD apiReturn; ULONG len = 0; - apiReturn = gGetNetworkParams(NULL, NULL); + apiReturn = pGetNetworkParams(NULL, NULL); if (apiReturn == ERROR_NOT_SUPPORTED) { skip("GetNetworkParams is not supported\n"); return; @@ -762,14 +1214,14 @@ ok(apiReturn == ERROR_INVALID_PARAMETER, "GetNetworkParams returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); - apiReturn = gGetNetworkParams(NULL, &len); + apiReturn = pGetNetworkParams(NULL, &len); ok(apiReturn == ERROR_BUFFER_OVERFLOW, "GetNetworkParams returned %d, expected ERROR_BUFFER_OVERFLOW\n", apiReturn); if (apiReturn == ERROR_BUFFER_OVERFLOW) { PFIXED_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); - apiReturn = gGetNetworkParams(buf, &len); + apiReturn = pGetNetworkParams(buf, &len); ok(apiReturn == NO_ERROR, "GetNetworkParams(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); @@ -798,20 +1250,20 @@ DWORD ret, needed; void *buffer; - if (!gGetPerAdapterInfo) return; - ret = gGetPerAdapterInfo(1, NULL, NULL); + if (!pGetPerAdapterInfo) return; + ret = pGetPerAdapterInfo(1, NULL, NULL); if (ret == ERROR_NOT_SUPPORTED) { skip("GetPerAdapterInfo is not supported\n"); return; } ok( ret == ERROR_INVALID_PARAMETER, "got %u instead of ERROR_INVALID_PARAMETER\n", ret ); needed = 0xdeadbeef; - ret = gGetPerAdapterInfo(1, NULL, &needed); + ret = pGetPerAdapterInfo(1, NULL, &needed); if (ret == ERROR_NO_DATA) return; /* no such adapter */ ok( ret == ERROR_BUFFER_OVERFLOW, "got %u instead of ERROR_BUFFER_OVERFLOW\n", ret ); ok( needed != 0xdeadbeef, "needed not set\n" ); buffer = HeapAlloc( GetProcessHeap(), 0, needed ); - ret = gGetPerAdapterInfo(1, buffer, &needed); + ret = pGetPerAdapterInfo(1, buffer, &needed); ok( ret == NO_ERROR, "got %u instead of NO_ERROR\n", ret ); HeapFree( GetProcessHeap(), 0, buffer ); } @@ -823,12 +1275,12 @@ HANDLE handle; BOOL success; - if (!gNotifyAddrChange) + if (!pNotifyAddrChange) { win_skip("NotifyAddrChange not present\n"); return; } - if (!gCancelIPChangeNotify) + if (!pCancelIPChangeNotify) { win_skip("CancelIPChangeNotify not present\n"); return; @@ -836,7 +1288,7 @@ handle = NULL; ZeroMemory(&overlapped, sizeof(overlapped)); - ret = gNotifyAddrChange(&handle, &overlapped); + ret = pNotifyAddrChange(&handle, &overlapped); if (ret == ERROR_NOT_SUPPORTED) { win_skip("NotifyAddrChange is not supported\n"); @@ -845,34 +1297,34 @@ ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected ERROR_IO_PENDING\n", ret); ret = GetLastError(); todo_wine ok(ret == ERROR_IO_PENDING, "GetLastError returned %d, expected ERROR_IO_PENDING\n", ret); - success = gCancelIPChangeNotify(&overlapped); + success = pCancelIPChangeNotify(&overlapped); todo_wine ok(success == TRUE, "CancelIPChangeNotify returned FALSE, expected TRUE\n"); ZeroMemory(&overlapped, sizeof(overlapped)); - success = gCancelIPChangeNotify(&overlapped); + success = pCancelIPChangeNotify(&overlapped); ok(success == FALSE, "CancelIPChangeNotify returned TRUE, expected FALSE\n"); handle = NULL; ZeroMemory(&overlapped, sizeof(overlapped)); - overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - ret = gNotifyAddrChange(&handle, &overlapped); + overlapped.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + ret = pNotifyAddrChange(&handle, &overlapped); ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected ERROR_IO_PENDING\n", ret); todo_wine ok(handle != INVALID_HANDLE_VALUE, "NotifyAddrChange returned invalid file handle\n"); success = GetOverlappedResult(handle, &overlapped, &bytes, FALSE); ok(success == FALSE, "GetOverlappedResult returned TRUE, expected FALSE\n"); ret = GetLastError(); ok(ret == ERROR_IO_INCOMPLETE, "GetLastError returned %d, expected ERROR_IO_INCOMPLETE\n", ret); - success = gCancelIPChangeNotify(&overlapped); + success = pCancelIPChangeNotify(&overlapped); todo_wine ok(success == TRUE, "CancelIPChangeNotify returned FALSE, expected TRUE\n"); if (winetest_interactive) { handle = NULL; ZeroMemory(&overlapped, sizeof(overlapped)); - overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + overlapped.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); trace("Testing asynchronous ipv4 address change notification. Please " "change the ipv4 address of one of your network interfaces\n"); - ret = gNotifyAddrChange(&handle, &overlapped); + ret = pNotifyAddrChange(&handle, &overlapped); ok(ret == ERROR_IO_PENDING, "NotifyAddrChange returned %d, expected NO_ERROR\n", ret); success = GetOverlappedResult(handle, &overlapped, &bytes, TRUE); ok(success == TRUE, "GetOverlappedResult returned FALSE, expected TRUE\n"); @@ -883,7 +1335,7 @@ { trace("Testing synchronous ipv4 address change notification. Please " "change the ipv4 address of one of your network interfaces\n"); - ret = gNotifyAddrChange(NULL, NULL); + ret = pNotifyAddrChange(NULL, NULL); todo_wine ok(ret == NO_ERROR, "NotifyAddrChange returned %d, expected NO_ERROR\n", ret); } } @@ -909,38 +1361,50 @@ static void test_GetAdaptersAddresses(void) { - ULONG ret, size; + ULONG ret, size, osize, i; IP_ADAPTER_ADDRESSES *aa, *ptr; IP_ADAPTER_UNICAST_ADDRESS *ua; - if (!gGetAdaptersAddresses) + if (!pGetAdaptersAddresses) { win_skip("GetAdaptersAddresses not present\n"); return; } - ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL); + ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL); ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", ret); /* size should be ignored and overwritten if buffer is NULL */ size = 0x7fffffff; - ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size); + ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size); ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret); if (ret != ERROR_BUFFER_OVERFLOW) return; ptr = HeapAlloc(GetProcessHeap(), 0, size); - ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &size); + ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &size); ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); + HeapFree(GetProcessHeap(), 0, ptr); + + /* higher size must not be changed to lower size */ + size *= 2; + osize = size; + ptr = HeapAlloc(GetProcessHeap(), 0, osize); + ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &osize); + ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); + ok(osize == size, "expected %d, got %d\n", size, osize); for (aa = ptr; !ret && aa; aa = aa->Next) { + char temp[128]; + + ok(S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_LH) || + S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_XP), + "Unknown structure size of %u bytes\n", S(U(*aa)).Length); ok(aa->DnsSuffix != NULL, "DnsSuffix is not a valid pointer\n"); ok(aa->Description != NULL, "Description is not a valid pointer\n"); ok(aa->FriendlyName != NULL, "FriendlyName is not a valid pointer\n"); - if (winetest_debug <= 1) - continue; - + trace("\n"); trace("Length: %u\n", S(U(*aa)).Length); trace("IfIndex: %u\n", S(U(*aa)).IfIndex); trace("Next: %p\n", aa->Next); @@ -949,6 +1413,21 @@ ua = aa->FirstUnicastAddress; while (ua) { + ok(ua->PrefixOrigin != IpPrefixOriginOther, + "bad address config value %d\n", ua->PrefixOrigin); + ok(ua->SuffixOrigin != IpSuffixOriginOther, + "bad address config value %d\n", ua->PrefixOrigin); + /* Address configured manually or from DHCP server? */ + if (ua->PrefixOrigin == IpPrefixOriginManual || + ua->PrefixOrigin == IpPrefixOriginDhcp) + { + ok(ua->ValidLifetime, "expected non-zero value\n"); + ok(ua->PreferredLifetime, "expected non-zero value\n"); + ok(ua->LeaseLifetime, "expected non-zero\n"); + } + /* Is the address ok in the network (not duplicated)? */ + ok(ua->DadState != IpDadStateInvalid && ua->DadState != IpDadStateDuplicate, + "bad address duplication value %d\n", ua->DadState); trace("\tLength: %u\n", S(U(*ua)).Length); trace("\tFlags: 0x%08x\n", S(U(*ua)).Flags); trace("\tNext: %p\n", ua->Next); @@ -957,27 +1436,468 @@ trace("\tPrefixOrigin: %u\n", ua->PrefixOrigin); trace("\tSuffixOrigin: %u\n", ua->SuffixOrigin); trace("\tDadState: %u\n", ua->DadState); - trace("\tValidLifetime: 0x%08x\n", ua->ValidLifetime); - trace("\tPreferredLifetime: 0x%08x\n", ua->PreferredLifetime); - trace("\tLeaseLifetime: 0x%08x\n", ua->LeaseLifetime); + trace("\tValidLifetime: %u seconds\n", ua->ValidLifetime); + trace("\tPreferredLifetime: %u seconds\n", ua->PreferredLifetime); + trace("\tLeaseLifetime: %u seconds\n", ua->LeaseLifetime); trace("\n"); ua = ua->Next; } trace("FirstAnycastAddress: %p\n", aa->FirstAnycastAddress); trace("FirstMulticastAddress: %p\n", aa->FirstMulticastAddress); trace("FirstDnsServerAddress: %p\n", aa->FirstDnsServerAddress); - trace("DnsSuffix: %p\n", aa->DnsSuffix); - trace("Description: %p\n", aa->Description); - trace("FriendlyName: %p\n", aa->FriendlyName); - trace("PhysicalAddress: %02x\n", aa->PhysicalAddress[0]); + trace("DnsSuffix: %s %p\n", wine_dbgstr_w(aa->DnsSuffix), aa->DnsSuffix); + trace("Description: %s %p\n", wine_dbgstr_w(aa->Description), aa->Description); + trace("FriendlyName: %s %p\n", wine_dbgstr_w(aa->FriendlyName), aa->FriendlyName); trace("PhysicalAddressLength: %u\n", aa->PhysicalAddressLength); + for (i = 0; i < aa->PhysicalAddressLength; i++) + sprintf(temp + i * 3, "%02X-", aa->PhysicalAddress[i]); + temp[i ? i * 3 - 1 : 0] = '\0'; + trace("PhysicalAddress: %s\n", temp); trace("Flags: 0x%08x\n", aa->Flags); trace("Mtu: %u\n", aa->Mtu); trace("IfType: %u\n", aa->IfType); trace("OperStatus: %u\n", aa->OperStatus); + trace("Ipv6IfIndex: %u\n", aa->Ipv6IfIndex); + for (i = 0, temp[0] = '\0'; i < sizeof(aa->ZoneIndices) / sizeof(aa->ZoneIndices[0]); i++) + sprintf(temp + strlen(temp), "%d ", aa->ZoneIndices[i]); + trace("ZoneIndices: %s\n", temp); + trace("FirstPrefix: %p\n", aa->FirstPrefix); + + if (S(U(*aa)).Length < sizeof(IP_ADAPTER_ADDRESSES_LH)) continue; +#ifndef __REACTOS__ + trace("TransmitLinkSpeed: %s\n", debugstr_longlong(aa->TransmitLinkSpeed)); + trace("ReceiveLinkSpeed: %s\n", debugstr_longlong(aa->ReceiveLinkSpeed)); + trace("FirstWinsServerAddress:%p\n", aa->FirstWinsServerAddress); + trace("FirstGatewayAddress: %p\n", aa->FirstGatewayAddress); + trace("Ipv4Metric: %u\n", aa->Ipv4Metric); + trace("Ipv6Metric: %u\n", aa->Ipv6Metric); + trace("Luid: %p\n", &aa->Luid); + trace("Dhcpv4Server: %p\n", &aa->Dhcpv4Server); + trace("CompartmentId: %u\n", aa->CompartmentId); + trace("NetworkGuid: %s\n", wine_dbgstr_guid((GUID*) &aa->NetworkGuid)); + trace("ConnectionType: %u\n", aa->ConnectionType); + trace("TunnelType: %u\n", aa->TunnelType); + trace("Dhcpv6Server: %p\n", &aa->Dhcpv6Server); + trace("Dhcpv6ClientDuidLength:%u\n", aa->Dhcpv6ClientDuidLength); + trace("Dhcpv6ClientDuid: %p\n", aa->Dhcpv6ClientDuid); + trace("Dhcpv6Iaid: %u\n", aa->Dhcpv6Iaid); + trace("FirstDnsSuffix: %p\n", aa->FirstDnsSuffix); trace("\n"); +#endif } HeapFree(GetProcessHeap(), 0, ptr); +} + +static void test_GetExtendedTcpTable(void) +{ + DWORD ret, size; + MIB_TCPTABLE *table; + MIB_TCPTABLE_OWNER_PID *table_pid; + MIB_TCPTABLE_OWNER_MODULE *table_module; + + if (!pGetExtendedTcpTable) + { + win_skip("GetExtendedTcpTable not available\n"); + return; + } + ret = pGetExtendedTcpTable( NULL, NULL, TRUE, AF_INET, TCP_TABLE_BASIC_ALL, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_BASIC_ALL, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table, &size, TRUE, AF_INET, TCP_TABLE_BASIC_ALL, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_BASIC_LISTENER, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table, &size, TRUE, AF_INET, TCP_TABLE_BASIC_LISTENER, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_pid = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table_pid, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_pid ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_LISTENER, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_pid = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table_pid, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_LISTENER, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_pid ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_ALL, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_module = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table_module, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_ALL, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_module ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_LISTENER, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_module = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table_module, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_LISTENER, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_module ); +} + +static void test_GetExtendedUdpTable(void) +{ + DWORD ret, size; + MIB_UDPTABLE *table; + MIB_UDPTABLE_OWNER_PID *table_pid; + MIB_UDPTABLE_OWNER_MODULE *table_module; + + if (!pGetExtendedUdpTable) + { + win_skip("GetExtendedUdpTable not available\n"); + return; + } + ret = pGetExtendedUdpTable( NULL, NULL, TRUE, AF_INET, UDP_TABLE_BASIC, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + size = 0; + ret = pGetExtendedUdpTable( NULL, &size, TRUE, AF_INET, UDP_TABLE_BASIC, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedUdpTable( table, &size, TRUE, AF_INET, UDP_TABLE_BASIC, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table ); + + size = 0; + ret = pGetExtendedUdpTable( NULL, &size, TRUE, AF_INET, UDP_TABLE_OWNER_PID, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_pid = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedUdpTable( table_pid, &size, TRUE, AF_INET, UDP_TABLE_OWNER_PID, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_pid ); + + size = 0; + ret = pGetExtendedUdpTable( NULL, &size, TRUE, AF_INET, UDP_TABLE_OWNER_MODULE, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_module = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedUdpTable( table_module, &size, TRUE, AF_INET, UDP_TABLE_OWNER_MODULE, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_module ); +} + +static void test_CreateSortedAddressPairs(void) +{ + SOCKADDR_IN6 dst[2]; + SOCKADDR_IN6_PAIR *pair; + ULONG pair_count; + DWORD ret; + + if (!pCreateSortedAddressPairs) + { + win_skip( "CreateSortedAddressPairs not available\n" ); + return; + } + + memset( dst, 0, sizeof(dst) ); + dst[0].sin6_family = AF_INET6; + dst[0].sin6_addr.u.Word[5] = 0xffff; + dst[0].sin6_addr.u.Word[6] = 0x0808; + dst[0].sin6_addr.u.Word[7] = 0x0808; + + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, dst, 1, 0, NULL, &pair_count ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( pair_count == 0xdeadbeef, "got %u\n", pair_count ); + + pair = (SOCKADDR_IN6_PAIR *)0xdeadbeef; + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, NULL, 1, 0, &pair, &pair_count ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( pair == (SOCKADDR_IN6_PAIR *)0xdeadbeef, "got %p\n", pair ); + ok( pair_count == 0xdeadbeef, "got %u\n", pair_count ); + + pair = NULL; + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, dst, 1, 0, &pair, &pair_count ); + ok( ret == NO_ERROR, "got %u\n", ret ); + ok( pair != NULL, "pair not set\n" ); + ok( pair_count >= 1, "got %u\n", pair_count ); + ok( pair[0].SourceAddress != NULL, "src address not set\n" ); + ok( pair[0].DestinationAddress != NULL, "dst address not set\n" ); + pFreeMibTable( pair ); + + dst[1].sin6_family = AF_INET6; + dst[1].sin6_addr.u.Word[5] = 0xffff; + dst[1].sin6_addr.u.Word[6] = 0x0404; + dst[1].sin6_addr.u.Word[7] = 0x0808; + + pair = NULL; + pair_count = 0xdeadbeef; + ret = pCreateSortedAddressPairs( NULL, 0, dst, 2, 0, &pair, &pair_count ); + ok( ret == NO_ERROR, "got %u\n", ret ); + ok( pair != NULL, "pair not set\n" ); + ok( pair_count >= 2, "got %u\n", pair_count ); + ok( pair[0].SourceAddress != NULL, "src address not set\n" ); + ok( pair[0].DestinationAddress != NULL, "dst address not set\n" ); + ok( pair[1].SourceAddress != NULL, "src address not set\n" ); + ok( pair[1].DestinationAddress != NULL, "dst address not set\n" ); + pFreeMibTable( pair ); +} + +static DWORD get_interface_index(void) +{ + DWORD size = 0, ret = 0; + IP_ADAPTER_ADDRESSES *buf, *aa; + + if (pGetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size ) != ERROR_BUFFER_OVERFLOW) + return 0; + + buf = HeapAlloc( GetProcessHeap(), 0, size ); + pGetAdaptersAddresses( AF_UNSPEC, 0, NULL, buf, &size ); + for (aa = buf; aa; aa = aa->Next) + { + if (aa->IfType == IF_TYPE_ETHERNET_CSMACD) + { + ret = aa->IfIndex; + break; + } + } + HeapFree( GetProcessHeap(), 0, buf ); + return ret; +} + +static void test_interface_identifier_conversion(void) +{ + DWORD ret; + NET_LUID luid; + GUID guid; + SIZE_T len; + WCHAR nameW[IF_MAX_STRING_SIZE + 1]; + char nameA[IF_MAX_STRING_SIZE + 1]; + NET_IFINDEX index; + + if (!pConvertInterfaceIndexToLuid) + { + win_skip( "ConvertInterfaceIndexToLuid not available\n" ); + return; + } + if (!(index = get_interface_index())) + { + skip( "no suitable interface found\n" ); + return; + } + + /* ConvertInterfaceIndexToLuid */ + ret = pConvertInterfaceIndexToLuid( 0, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &luid, 0xff, sizeof(luid) ); + ret = pConvertInterfaceIndexToLuid( 0, &luid ); + ok( ret == ERROR_FILE_NOT_FOUND, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( !luid.Info.NetLuidIndex, "got %u\n", luid.Info.NetLuidIndex ); + ok( !luid.Info.IfType, "got %u\n", luid.Info.IfType ); + + luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; + ret = pConvertInterfaceIndexToLuid( index, &luid ); + ok( !ret, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex != 0xdead, "index not set\n" ); + ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); + + /* ConvertInterfaceLuidToIndex */ + ret = pConvertInterfaceLuidToIndex( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToIndex( NULL, &index ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToIndex( &luid, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToIndex( &luid, &index ); + ok( !ret, "got %u\n", ret ); + + /* ConvertInterfaceLuidToGuid */ + ret = pConvertInterfaceLuidToGuid( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &guid, 0xff, sizeof(guid) ); + ret = pConvertInterfaceLuidToGuid( NULL, &guid ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( guid.Data1 == 0xffffffff, "got %x\n", guid.Data1 ); + + ret = pConvertInterfaceLuidToGuid( &luid, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &guid, 0, sizeof(guid) ); + ret = pConvertInterfaceLuidToGuid( &luid, &guid ); + ok( !ret, "got %u\n", ret ); + ok( guid.Data1, "got %x\n", guid.Data1 ); + + /* ConvertInterfaceGuidToLuid */ + ret = pConvertInterfaceGuidToLuid( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + luid.Info.NetLuidIndex = 1; + ret = pConvertInterfaceGuidToLuid( NULL, &luid ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( luid.Info.NetLuidIndex == 1, "got %u\n", luid.Info.NetLuidIndex ); + + ret = pConvertInterfaceGuidToLuid( &guid, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; + ret = pConvertInterfaceGuidToLuid( &guid, &luid ); + ok( !ret, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex != 0xdead, "index not set\n" ); + ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); + + /* ConvertInterfaceLuidToNameW */ + ret = pConvertInterfaceLuidToNameW( NULL, NULL, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameW( &luid, NULL, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameW( NULL, nameW, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameW( &luid, nameW, 0 ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + + nameW[0] = 0; + len = sizeof(nameW)/sizeof(nameW[0]); + ret = pConvertInterfaceLuidToNameW( &luid, nameW, len ); + ok( !ret, "got %u\n", ret ); + ok( nameW[0], "name not set\n" ); + + /* ConvertInterfaceLuidToNameA */ + ret = pConvertInterfaceLuidToNameA( NULL, NULL, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameA( &luid, NULL, 0 ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameA( NULL, nameA, 0 ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = pConvertInterfaceLuidToNameA( &luid, nameA, 0 ); + ok( ret == ERROR_NOT_ENOUGH_MEMORY, "got %u\n", ret ); + + nameA[0] = 0; + len = sizeof(nameA)/sizeof(nameA[0]); + ret = pConvertInterfaceLuidToNameA( &luid, nameA, len ); + ok( !ret, "got %u\n", ret ); + ok( nameA[0], "name not set\n" ); + + /* ConvertInterfaceNameToLuidW */ + ret = pConvertInterfaceNameToLuidW( NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; + ret = pConvertInterfaceNameToLuidW( NULL, &luid ); + ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex != 0xdead, "index not set\n" ); + ok( !luid.Info.IfType, "got %u\n", luid.Info.IfType ); + + ret = pConvertInterfaceNameToLuidW( nameW, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; + ret = pConvertInterfaceNameToLuidW( nameW, &luid ); + ok( !ret, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex != 0xdead, "index not set\n" ); + ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); + + /* ConvertInterfaceNameToLuidA */ + ret = pConvertInterfaceNameToLuidA( NULL, NULL ); + ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + + luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; + ret = pConvertInterfaceNameToLuidA( NULL, &luid ); + ok( ret == ERROR_INVALID_NAME, "got %u\n", ret ); + ok( luid.Info.Reserved == 0xdead, "reserved set\n" ); + ok( luid.Info.NetLuidIndex == 0xdead, "index set\n" ); + ok( luid.Info.IfType == 0xdead, "type set\n" ); + + ret = pConvertInterfaceNameToLuidA( nameA, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + luid.Info.Reserved = luid.Info.NetLuidIndex = luid.Info.IfType = 0xdead; + ret = pConvertInterfaceNameToLuidA( nameA, &luid ); + ok( !ret, "got %u\n", ret ); + ok( !luid.Info.Reserved, "got %x\n", luid.Info.Reserved ); + ok( luid.Info.NetLuidIndex != 0xdead, "index not set\n" ); + ok( luid.Info.IfType == IF_TYPE_ETHERNET_CSMACD, "got %u\n", luid.Info.IfType ); +} + +static void test_GetIfEntry2(void) +{ + DWORD ret; + MIB_IF_ROW2 row; + NET_IFINDEX index; + + if (!pGetIfEntry2) + { + win_skip( "GetIfEntry2 not available\n" ); + return; + } + if (!(index = get_interface_index())) + { + skip( "no suitable interface found\n" ); + return; + } + + ret = pGetIfEntry2( NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &row, 0, sizeof(row) ); + ret = pGetIfEntry2( &row ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + memset( &row, 0, sizeof(row) ); + row.InterfaceIndex = index; + ret = pGetIfEntry2( &row ); + ok( ret == NO_ERROR, "got %u\n", ret ); + ok( row.InterfaceIndex == index, "got %u\n", index ); +} + +static void test_GetIfTable2(void) +{ + DWORD ret; + MIB_IF_TABLE2 *table; + + if (!pGetIfTable2) + { + win_skip( "GetIfTable2 not available\n" ); + return; + } + + table = NULL; + ret = pGetIfTable2( &table ); + ok( ret == NO_ERROR, "got %u\n", ret ); + ok( table != NULL, "table not set\n" ); + pFreeMibTable( table ); } START_TEST(iphlpapi) @@ -997,6 +1917,12 @@ testWin2KFunctions(); test_GetAdaptersAddresses(); + test_GetExtendedTcpTable(); + test_GetExtendedUdpTable(); + test_CreateSortedAddressPairs(); + test_interface_identifier_conversion(); + test_GetIfEntry2(); + test_GetIfTable2(); freeIPHlpApi(); } }
9 years
1
0
0
0
[akhaldi] 70221: [IPHLPAPI] Properly stub GetExtendedUdpTable().
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 30 21:45:34 2015 New Revision: 70221 URL:
http://svn.reactos.org/svn/reactos?rev=70221&view=rev
Log: [IPHLPAPI] Properly stub GetExtendedUdpTable(). Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/iphlpap…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/iphlpapi.spec [iso-8859-1] Mon Nov 30 21:45:34 2015 @@ -33,7 +33,7 @@ @ stdcall GetBestRoute( long long long ) @ stub GetBestRouteFromStack @ stdcall GetExtendedTcpTable( ptr ptr long long long long ) -@ stub GetExtendedUdpTable +@ stdcall -stub GetExtendedUdpTable( ptr ptr long long long long ) @ stdcall GetFriendlyIfIndex( long ) @ stdcall GetIcmpStatistics( ptr ) @ stdcall GetIcmpStatisticsEx(ptr long)
9 years
1
0
0
0
[akhaldi] 70220: [PSDK] Attempt to improve the whole iphlpapi related headers situation. CORE-7685 CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 30 20:08:57 2015 New Revision: 70220 URL:
http://svn.reactos.org/svn/reactos?rev=70220&view=rev
Log: [PSDK] Attempt to improve the whole iphlpapi related headers situation. CORE-7685 CORE-10536 Added: trunk/reactos/include/psdk/ifmib.h (with props) trunk/reactos/include/psdk/ipmib.h (with props) trunk/reactos/include/psdk/tcpmib.h (with props) trunk/reactos/include/psdk/udpmib.h (with props) Modified: trunk/reactos/dll/win32/inetmib1/main.c trunk/reactos/include/psdk/ifdef.h trunk/reactos/include/psdk/ipexport.h trunk/reactos/include/psdk/ipifcons.h trunk/reactos/include/psdk/iprtrmib.h trunk/reactos/include/psdk/iptypes.h Modified: trunk/reactos/dll/win32/inetmib1/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetmib1/main.c?…
============================================================================== --- trunk/reactos/dll/win32/inetmib1/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetmib1/main.c [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -674,7 +674,7 @@ } static struct structToAsnValue mib2IpMap[] = { - { FIELD_OFFSET(MIB_IPSTATS, dwForwarding), copyInt }, /* 1 */ + { FIELD_OFFSET(MIB_IPSTATS, u.dwForwarding), copyInt }, /* 1 */ { FIELD_OFFSET(MIB_IPSTATS, dwDefaultTTL), copyInt }, /* 2 */ { FIELD_OFFSET(MIB_IPSTATS, dwInReceives), copyInt }, /* 3 */ { FIELD_OFFSET(MIB_IPSTATS, dwInHdrErrors), copyInt }, /* 4 */ @@ -831,8 +831,8 @@ { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric3), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric4), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardNextHop), copyIpAddr }, - { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardType), copyInt }, - { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardProto), copyInt }, + { FIELD_OFFSET(MIB_IPFORWARDROW, u1.dwForwardType), copyInt }, + { FIELD_OFFSET(MIB_IPFORWARDROW, u2.dwForwardProto), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardAge), copyInt }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMask), copyIpAddr }, { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric5), copyInt }, @@ -929,7 +929,7 @@ { FIELD_OFFSET(MIB_IPNETROW, dwIndex), copyInt }, { FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyIpNetPhysAddr }, { FIELD_OFFSET(MIB_IPNETROW, dwAddr), copyIpAddr }, - { FIELD_OFFSET(MIB_IPNETROW, dwType), copyInt }, + { FIELD_OFFSET(MIB_IPNETROW, u.dwType), copyInt }, }; static void mib2IpNetInit(void) @@ -1084,7 +1084,7 @@ } static struct structToAsnValue mib2TcpMap[] = { - { FIELD_OFFSET(MIB_TCPSTATS, dwRtoAlgorithm), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, u.dwRtoAlgorithm), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, dwRtoMin), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, dwRtoMax), copyInt }, { FIELD_OFFSET(MIB_TCPSTATS, dwMaxConn), copyInt }, Modified: trunk/reactos/include/psdk/ifdef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ifdef.h?rev=7…
============================================================================== --- trunk/reactos/include/psdk/ifdef.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ifdef.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -1,83 +1,229 @@ -#ifndef _IFDEF_ -#define _IFDEF_ +/* WINE ifdef.h + * Copyright 2010 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef WINE_IFDEF_H +#define WINE_IFDEF_H + +#include <ipifcons.h> + +typedef ULONG32 NET_IF_OBJECT_ID, *PNET_IF_OBJECT_ID; +typedef UINT32 NET_IF_COMPARTMENT_ID, *PNET_IF_COMPARTMENT_ID; +typedef GUID NET_IF_NETWORK_GUID, *PNET_IF_NETWORK_GUID; +typedef ULONG NET_IFINDEX, *PNET_IFINDEX; +typedef NET_IFINDEX IF_INDEX, *PIF_INDEX; +typedef UINT16 NET_IFTYPE, *PNET_IFTYPE; + +#define NET_IF_OPER_STATUS_DOWN_NOT_AUTHENTICATED 0x00000001 +#define NET_IF_OPER_STATUS_DOWN_NOT_MEDIA_CONNECTED 0x00000002 +#define NET_IF_OPER_STATUS_DORMANT_PAUSED 0x00000004 +#define NET_IF_OPER_STATUS_DORMANT_LOW_POWER 0x00000008 + +#define NET_IF_COMPARTMENT_ID_UNSPECIFIED 0 +#define NET_IF_COMPARTMENT_ID_PRIMARY 1 + +#define NET_IF_OID_IF_ALIAS 0x00000001 +#define NET_IF_OID_COMPARTMENT_ID 0x00000002 +#define NET_IF_OID_NETWORK_GUID 0x00000003 +#define NET_IF_OID_IF_ENTRY 0x00000004 + +#define NET_SET_UNSPECIFIED_NETWORK_GUID(x) +#define NET_IS_UNSPECIFIED_NETWORK_GUID(x) + +#define NET_SITEID_UNSPECIFIED 0 +#define NET_SITEID_MAXUSER 0x07ffffff +#define NET_SITEID_MAXSYSTEM 0x0fffffff + +#define NET_IFINDEX_UNSPECIFIED 0 +#define IFI_UNSPECIFIED NET_IFINDEX_UNSPECIFIED + +#define NET_IFLUID_UNSPECIFIED 0 + +#define NIIF_HARDWARE_INTERFACE 0x00000001 +#define NIIF_FILTER_INTERFACE 0x00000002 +#define NIIF_NDIS_WDM_INTERFACE 0x00000020 +#define NIIF_NDIS_ENDPOINT_INTERFACE 0x00000040 +#define NIIF_NDIS_ISCSI_INTERFACE 0x00000080 +#define NIIF_WAN_TUNNEL_TYPE_UNKNOWN 0xffffffff + +#define NET_BUS_NUMBER_UNKNOWN 0xffffffff +#define NET_SLOT_NUMBER_UNKNOWN 0xffffffff +#define NET_FUNCTION_NUMBER_UNKNOWN 0xffffffff #define IF_MAX_STRING_SIZE 256 #define IF_MAX_PHYS_ADDRESS_LENGTH 32 -typedef union _NET_LUID_LH -{ - ULONG64 Value; - struct - { - ULONG64 Reserved:24; - ULONG64 NetLuidIndex:24; - ULONG64 IfType:16; - }Info; -} NET_LUID_LH, *PNET_LUID_LH; - -typedef NET_LUID_LH NET_LUID; -typedef NET_LUID* PNET_LUID; - -typedef ULONG NET_IFINDEX, *PNET_IFINDEX; -typedef ULONG IFTYPE; -typedef GUID NET_IF_NETWORK_GUID, *PNET_IF_NETWORK_GUID; - -typedef enum { - TUNNEL_TYPE_NONE = 0, - TUNNEL_TYPE_OTHER = 1, - TUNNEL_TYPE_DIRECT = 2, - TUNNEL_TYPE_6TO4 = 11, - TUNNEL_TYPE_ISATAP = 13, - TUNNEL_TYPE_TEREDO = 14, -} TUNNEL_TYPE, *PTUNNEL_TYPE; - -typedef enum _NET_IF_ACCESS_TYPE -{ - NET_IF_ACCESS_LOOPBACK = 1, - NET_IF_ACCESS_BROADCAST = 2, - NET_IF_ACCESS_POINT_TO_POINT = 3, - NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4, - NET_IF_ACCESS_MAXIMUM = 5 -} NET_IF_ACCESS_TYPE, *PNET_IF_ACCESS_TYPE; - -typedef enum _NET_IF_DIRECTION_TYPE -{ - NET_IF_DIRECTION_SENDRECEIVE, - NET_IF_DIRECTION_SENDONLY, - NET_IF_DIRECTION_RECEIVEONLY, - NET_IF_DIRECTION_MAXIMUM -} NET_IF_DIRECTION_TYPE, *PNET_IF_DIRECTION_TYPE; - -typedef enum _NET_IF_ADMIN_STATUS -{ - NET_IF_ADMIN_STATUS_UP = 1, - NET_IF_ADMIN_STATUS_DOWN = 2, +typedef enum _NET_IF_ADMIN_STATUS { + NET_IF_ADMIN_STATUS_UP = 1, + NET_IF_ADMIN_STATUS_DOWN = 2, NET_IF_ADMIN_STATUS_TESTING = 3 } NET_IF_ADMIN_STATUS, *PNET_IF_ADMIN_STATUS; -typedef enum _NET_IF_MEDIA_CONNECT_STATE -{ - MediaConnectStateUnknown, - MediaConnectStateConnected, - MediaConnectStateDisconnected +typedef enum _NET_IF_OPER_STATUS { + NET_IF_OPER_STATUS_UP = 1, + NET_IF_OPER_STATUS_DOWN = 2, + NET_IF_OPER_STATUS_TESTING = 3, + NET_IF_OPER_STATUS_UNKNOWN = 4, + NET_IF_OPER_STATUS_DORMANT = 5, + NET_IF_OPER_STATUS_NOT_PRESENT = 6, + NET_IF_OPER_STATUS_LOWER_LAYER_DOWN = 7 +} NET_IF_OPER_STATUS, *PNET_IF_OPER_STATUS; + +typedef enum _NET_IF_RCV_ADDRESS_TYPE { + NET_IF_RCV_ADDRESS_TYPE_OTHER = 1, + NET_IF_RCV_ADDRESS_TYPE_VOLATILE = 2, + NET_IF_RCV_ADDRESS_TYPE_NON_VOLATILE = 3 +} NET_IF_RCV_ADDRESS_TYPE, *PNET_IF_RCV_ADDRESS_TYPE; + +typedef struct _NET_IF_RCV_ADDRESS_LH { + NET_IF_RCV_ADDRESS_TYPE ifRcvAddressType; + USHORT ifRcvAddressLength; + USHORT ifRcvAddressOffset; +} NET_IF_RCV_ADDRESS_LH, *PNET_IF_RCV_ADDRESS_LH; +typedef NET_IF_RCV_ADDRESS_LH NET_IF_RCV_ADDRESS; +typedef NET_IF_RCV_ADDRESS_LH *PNET_IF_RCV_ADDRESS; + +typedef union _NET_LUID_LH { + ULONG64 Value; + struct { + ULONG64 Reserved : 24; + ULONG64 NetLuidIndex : 24; + ULONG64 IfType : 16; + } Info; +} NET_LUID_LH, *PNET_LUID_LH; +typedef NET_LUID_LH NET_LUID; +typedef NET_LUID *PNET_LUID; +typedef NET_LUID IF_LUID; +typedef NET_LUID *PIF_LUID; + +typedef enum _NET_IF_ACCESS_TYPE { + NET_IF_ACCESS_LOOPBACK = 1, + NET_IF_ACCESS_BROADCAST = 2, + NET_IF_ACCESS_POINT_TO_POINT = 2, + NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4, + NET_IF_ACCESS_MAXIMUM = 5 +} NET_IF_ACCESS_TYPE, *PNET_IF_ACCESS_TYPE; + +typedef enum _NET_IF_DIRECTION_TYPE { + NET_IF_DIRECTION_SENDRECEIVE = 0, + NET_IF_DIRECTION_SENDONLY = 1, + NET_IF_DIRECTION_RECEIVEONLY = 2, + NET_IF_DIRECTION_MAXIMUM = 3 +} NET_IF_DIRECTION_TYPE, *PNET_IF_DIRECTION_TYPE; + +typedef enum _NET_IF_CONNECTION_TYPE { + NET_IF_CONNECTION_DEDICATED = 1, + NET_IF_CONNECTION_PASSIVE = 2, + NET_IF_CONNECTION_DEMAND = 3, + NET_IF_CONNECTION_MAXIMUM = 4, +} NET_IF_CONNECTION_TYPE, *PNET_IF_CONNECTION_TYPE; + +typedef enum _NET_IF_MEDIA_CONNECT_STATE { + MediaConnectStateUnknown = 0, + MediaConnectStateConnected = 1, + MediaConnectStateDisconnected = 2 } NET_IF_MEDIA_CONNECT_STATE, *PNET_IF_MEDIA_CONNECT_STATE; -typedef enum _NET_IF_CONNECTION_TYPE -{ - NET_IF_CONNECTION_DEDICATED = 1, - NET_IF_CONNECTION_PASSIVE = 2, - NET_IF_CONNECTION_DEMAND = 3, - NET_IF_CONNECTION_MAXIMUM = 4 -} NET_IF_CONNECTION_TYPE, *PNET_IF_CONNECTION_TYPE; +typedef enum _NET_IF_MEDIA_DUPLEX_STATE { + MediaDuplexStateUnknown = 0, + MediaDuplexStateHalf = 1, + MediaDuplexStateFull = 2 +} NET_IF_MEDIA_DUPLEX_STATE, *PNET_IF_MEDIA_DUPLEX_STATE; + +typedef struct _NET_PHYSICAL_LOCATION_LH { + ULONG BusNumber; + ULONG SlotNumber; + ULONG FunctionNumber; +} NET_PHYSICAL_LOCATION_LH, *PNET_PHYSICAL_LOCATION_LH; +typedef NET_PHYSICAL_LOCATION_LH NET_PHYSICAL_LOCATION; +typedef NET_PHYSICAL_LOCATION *PNET_PHYSICAL_LOCATION; + +typedef struct _IF_COUNTED_STRING_LH { + USHORT Length; + WCHAR String[IF_MAX_STRING_SIZE + 1]; +} IF_COUNTED_STRING_LH, *PIF_COUNTED_STRING_LH; +typedef IF_COUNTED_STRING_LH IF_COUNTED_STRING; +typedef IF_COUNTED_STRING *PIF_COUNTED_STRING; + +typedef struct _IF_PHYSICAL_ADDRESS_LH { + USHORT Length; + UCHAR Address[IF_MAX_PHYS_ADDRESS_LENGTH]; +} IF_PHYSICAL_ADDRESS_LH, *PIF_PHYSICAL_ADDRESS_LH; +typedef IF_PHYSICAL_ADDRESS_LH IF_PHYSICAL_ADDRESS; +typedef IF_PHYSICAL_ADDRESS *PIF_PHYSICAL_ADDRESS; typedef enum { - IfOperStatusUp = 1, - IfOperStatusDown, - IfOperStatusTesting, - IfOperStatusUnknown, - IfOperStatusDormant, - IfOperStatusNotPresent, - IfOperStatusLowerLayerDown + TUNNEL_TYPE_NONE = 0, + TUNNEL_TYPE_OTHER = 1, + TUNNEL_TYPE_DIRECT = 2, + TUNNEL_TYPE_6TO4 = 11, + TUNNEL_TYPE_ISATAP = 13, + TUNNEL_TYPE_TEREDO = 14, + TUNNEL_TYPE_IPHTTPS = 15, +} TUNNEL_TYPE; + +typedef enum _IF_ADMINISTRATIVE_STATE { + IF_ADMINISTRATIVE_STATE_DISABLED = 0, + IF_ADMINISTRATIVE_STATE_ENABLED = 1, + IF_ADMINISTRATIVE_STATE_DEMANDDIAL = 2 +} IF_ADMINISTRATIVE_STATE, *PIF_ADMINISTRATIVE_STATE; + +typedef enum { + IfOperStatusUp = 1, + IfOperStatusDown, + IfOperStatusTesting, + IfOperStatusUnknown, + IfOperStatusDormant, + IfOperStatusNotPresent, + IfOperStatusLowerLayerDown } IF_OPER_STATUS; -#endif /* _IFDEF_ */ +typedef struct _NDIS_INTERFACE_INFORMATION { + NET_IF_OPER_STATUS ifOperStatus; + ULONG ifOperStatusFlags; + NET_IF_MEDIA_CONNECT_STATE MediaConnectState; + NET_IF_MEDIA_DUPLEX_STATE MediaDuplexState; + ULONG ifMtu; + BOOLEAN ifPromiscuousMode; + BOOLEAN ifDeviceWakeUpEnable; + ULONG64 XmitLinkSpeed; + ULONG64 RcvLinkSpeed; + ULONG64 ifLastChange; + ULONG64 ifCounterDiscontinuityTime; + ULONG64 ifInUnknownProtos; + ULONG64 ifInDiscards; + ULONG64 ifInErrors; + ULONG64 ifHCInOctets; + ULONG64 ifHCInUcastPkts; + ULONG64 ifHCInMulticastPkts; + ULONG64 ifHCInBroadcastPkts; + ULONG64 ifHCOutOctets; + ULONG64 ifHCOutUcastPkts; + ULONG64 ifHCOutMulticastPkts; + ULONG64 ifHCOutBroadcastPkts; + ULONG64 ifOutErrors; + ULONG64 ifOutDiscards; + ULONG64 ifHCInUcastOctets; + ULONG64 ifHCInMulticastOctets; + ULONG64 ifHCInBroadcastOctets; + ULONG64 ifHCOutUcastOctets; + ULONG64 ifHCOutMulticastOctets; + ULONG64 ifHCOutBroadcastOctets; + NET_IF_COMPARTMENT_ID CompartmentId; + ULONG SupportedStatistics; +} NDIS_INTERFACE_INFORMATION, *PNDIS_INTERFACE_INFORMATION; + +#endif /* WINE_IFDEF_H*/ Added: trunk/reactos/include/psdk/ifmib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ifmib.h?rev=7…
============================================================================== --- trunk/reactos/include/psdk/ifmib.h (added) +++ trunk/reactos/include/psdk/ifmib.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_IFMIB_H +#define __WINE_IFMIB_H + +#include <ifdef.h> + +typedef struct _MIB_IFNUMBER +{ + DWORD dwValue; +} MIB_IFNUMBER, *PMIB_IFNUMBER; + + +/* Interface table */ + +#define MAX_INTERFACE_NAME_LEN 256 +#define MAXLEN_PHYSADDR 8 +#define MAXLEN_IFDESCR 256 + +typedef struct _MIB_IFROW +{ + WCHAR wszName[MAX_INTERFACE_NAME_LEN]; + DWORD dwIndex; + DWORD dwType; + DWORD dwMtu; + DWORD dwSpeed; + DWORD dwPhysAddrLen; + UCHAR bPhysAddr[MAXLEN_PHYSADDR]; + DWORD dwAdminStatus; + INTERNAL_IF_OPER_STATUS dwOperStatus; + DWORD dwLastChange; + DWORD dwInOctets; + DWORD dwInUcastPkts; + DWORD dwInNUcastPkts; + DWORD dwInDiscards; + DWORD dwInErrors; + DWORD dwInUnknownProtos; + DWORD dwOutOctets; + DWORD dwOutUcastPkts; + DWORD dwOutNUcastPkts; + DWORD dwOutDiscards; + DWORD dwOutErrors; + DWORD dwOutQLen; + DWORD dwDescrLen; + BYTE bDescr[MAXLEN_IFDESCR]; +} MIB_IFROW, *PMIB_IFROW; + +typedef struct _MIB_IFTABLE +{ + DWORD dwNumEntries; + MIB_IFROW table[1]; +} MIB_IFTABLE, *PMIB_IFTABLE; + + +#endif /* __WINE_IFMIB_H */ Propchange: trunk/reactos/include/psdk/ifmib.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/psdk/ipexport.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ipexport.h?re…
============================================================================== --- trunk/reactos/include/psdk/ipexport.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ipexport.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -15,15 +15,18 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WINE_IPEXPORT_H #define __WINE_IPEXPORT_H -typedef unsigned long IPAddr; -typedef unsigned long IPMask; -typedef unsigned long IP_STATUS; +#include <in6addr.h> +#include <inaddr.h> + +typedef ULONG IPAddr; +typedef ULONG IPMask; +typedef ULONG IP_STATUS; struct ip_option_information { @@ -44,7 +47,6 @@ #define IP_OPT_RR 0x7 #define IP_OPT_TS 0x44 #define IP_OPT_SID 0x88 -#define IP_OPT_ROUTER_ALERT 0x94 #define MAX_OPT_SIZE 40 @@ -52,8 +54,8 @@ struct icmp_echo_reply { IPAddr Address; - unsigned long Status; - unsigned long RoundTripTime; + ULONG Status; + ULONG RoundTripTime; unsigned short DataSize; unsigned short Reserved; void* Data; @@ -91,18 +93,6 @@ #define IP_SPEC_MTU_CHANGE (IP_STATUS_BASE + 20) #define IP_MTU_CHANGE (IP_STATUS_BASE + 21) #define IP_UNLOAD (IP_STATUS_BASE + 22) -#define IP_ADDR_ADDED (IP_STATUS_BASE + 23) -#define IP_MEDIA_CONNECT (IP_STATUS_BASE + 24) -#define IP_MEDIA_DISCONNECT (IP_STATUS_BASE + 25) -#define IP_BIND_ADAPTER (IP_STATUS_BASE + 26) -#define IP_UNBIND_ADAPTER (IP_STATUS_BASE + 27) -#define IP_DEVICE_DOES_NOT_EXIST (IP_STATUS_BASE + 28) -#define IP_DUPLICATE_ADDRESS (IP_STATUS_BASE + 29) -#define IP_INTERFACE_METRIC_CHANGE (IP_STATUS_BASE + 30) -#define IP_RECONFIG_SECFLTR (IP_STATUS_BASE + 31) -#define IP_NEGOTIATING_IPSEC (IP_STATUS_BASE + 32) -#define IP_INTERFACE_WOL_CAPABILITY_CHANGE (IP_STATUS_BASE + 33) -#define IP_DUPLICATE_IPADD (IP_STATUS_BASE + 34) #define IP_GENERAL_FAILURE (IP_STATUS_BASE + 50) #define MAX_IP_STATUS IP_GENERAL_FAILURE @@ -126,9 +116,33 @@ IPAddr Address[1]; } IP_UNIDIRECTIONAL_ADAPTER_ADDRESS, *PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS; +/* ReactOS */ + typedef struct _IP_ADAPTER_ORDER_MAP { - ULONG NumAdapters; - ULONG AdapterOrder[1]; + ULONG NumAdapters; + ULONG AdapterOrder[1]; } IP_ADAPTER_ORDER_MAP, *PIP_ADAPTER_ORDER_MAP; +#if (NTDDI_VERSION >= NTDDI_WINXP) + +#include <pshpack1.h> +typedef struct _IPV6_ADDRESS_EX { + USHORT sin6_port; + ULONG sin6_flowinfo; + USHORT sin6_addr[8]; + ULONG sin6_scope_id; +} IPV6_ADDRESS_EX, *PIPV6_ADDRESS_EX; +#include <poppack.h> + +typedef struct icmpv6_echo_reply_lh { + IPV6_ADDRESS_EX Address; + ULONG Status; + unsigned int RoundTripTime; +} ICMPV6_ECHO_REPLY_LH, *PICMPV6_ECHO_REPLY_LH; + +typedef ICMPV6_ECHO_REPLY_LH ICMPV6_ECHO_REPLY; +typedef ICMPV6_ECHO_REPLY_LH *PICMPV6_ECHO_REPLY; + +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + #endif /* __WINE_IPEXPORT_H */ Modified: trunk/reactos/include/psdk/ipifcons.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ipifcons.h?re…
============================================================================== --- trunk/reactos/include/psdk/ipifcons.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ipifcons.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -227,6 +227,8 @@ #define MIB_IF_TYPE_LOOPBACK 24 #define MIB_IF_TYPE_SLIP 28 +typedef ULONG IFTYPE; + #define MIB_IF_ADMIN_STATUS_UP 1 #define MIB_IF_ADMIN_STATUS_DOWN 2 #define MIB_IF_ADMIN_STATUS_TESTING 3 Added: trunk/reactos/include/psdk/ipmib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ipmib.h?rev=7…
============================================================================== --- trunk/reactos/include/psdk/ipmib.h (added) +++ trunk/reactos/include/psdk/ipmib.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_IPMIB_H +#define __WINE_IPMIB_H + +#include <ifmib.h> +#include <nldef.h> + +/* Flags used in the wType field from MIB_IPADDRROW */ + +#define MIB_IPADDR_PRIMARY 0x0001 +#define MIB_IPADDR_DYNAMIC 0x0004 +#define MIB_IPADDR_DISCONNECTED 0x0008 +#define MIB_IPADDR_DELETED 0x0040 +#define MIB_IPADDR_TRANSIENT 0x0080 + +/* IPADDR table */ + +typedef struct _MIB_IPADDRROW +{ + DWORD dwAddr; + IF_INDEX dwIndex; + DWORD dwMask; + DWORD dwBCastAddr; + DWORD dwReasmSize; + unsigned short unused1; + unsigned short wType; +} MIB_IPADDRROW, *PMIB_IPADDRROW; + +typedef struct _MIB_IPADDRTABLE +{ + DWORD dwNumEntries; + MIB_IPADDRROW table[1]; +} MIB_IPADDRTABLE, *PMIB_IPADDRTABLE; + + +/* IPFORWARD table */ + +typedef struct _MIB_IPFORWARDNUMBER +{ + DWORD dwValue; +} MIB_IPFORWARDNUMBER, *PMIB_IPFORWARDNUMBER; + +typedef enum +{ + MIB_IPROUTE_TYPE_OTHER = 1, + MIB_IPROUTE_TYPE_INVALID = 2, + MIB_IPROUTE_TYPE_DIRECT = 3, + MIB_IPROUTE_TYPE_INDIRECT = 4, +} MIB_IPFORWARD_TYPE; + +typedef NL_ROUTE_PROTOCOL MIB_IPFORWARD_PROTO; + +typedef struct _MIB_IPFORWARDROW +{ + DWORD dwForwardDest; + DWORD dwForwardMask; + DWORD dwForwardPolicy; + DWORD dwForwardNextHop; + IF_INDEX dwForwardIfIndex; + union + { + DWORD dwForwardType; + MIB_IPFORWARD_TYPE ForwardType; + } DUMMYUNIONNAME1; + union + { + DWORD dwForwardProto; + MIB_IPFORWARD_PROTO ForwardProto; + } DUMMYUNIONNAME2; + DWORD dwForwardAge; + DWORD dwForwardNextHopAS; + DWORD dwForwardMetric1; + DWORD dwForwardMetric2; + DWORD dwForwardMetric3; + DWORD dwForwardMetric4; + DWORD dwForwardMetric5; +} MIB_IPFORWARDROW, *PMIB_IPFORWARDROW; + +typedef struct _MIB_IPFORWARDTABLE +{ + DWORD dwNumEntries; + MIB_IPFORWARDROW table[1]; +} MIB_IPFORWARDTABLE, *PMIB_IPFORWARDTABLE; + + +/* IPNET table */ + +typedef enum +{ + MIB_IPNET_TYPE_OTHER = 1, + MIB_IPNET_TYPE_INVALID = 2, + MIB_IPNET_TYPE_DYNAMIC = 3, + MIB_IPNET_TYPE_STATIC = 4, +} MIB_IPNET_TYPE; + +typedef struct _MIB_IPNETROW +{ + DWORD dwIndex; + DWORD dwPhysAddrLen; + BYTE bPhysAddr[MAXLEN_PHYSADDR]; + DWORD dwAddr; + union + { + DWORD dwType; + MIB_IPNET_TYPE Type; + } DUMMYUNIONNAME; +} MIB_IPNETROW, *PMIB_IPNETROW; + +typedef struct _MIB_IPNETTABLE +{ + DWORD dwNumEntries; + MIB_IPNETROW table[1]; +} MIB_IPNETTABLE, *PMIB_IPNETTABLE; + + +/* IP statistics */ + +typedef enum +{ + MIB_IP_FORWARDING = 1, + MIB_IP_NOT_FORWARDING = 2, +} MIB_IPSTATS_FORWARDING, *PMIB_IPSTATS_FORWARDING; + +typedef struct _MIB_IPSTATS +{ + union + { + DWORD dwForwarding; + MIB_IPSTATS_FORWARDING Forwarding; + } DUMMYUNIONNAME; + DWORD dwDefaultTTL; + DWORD dwInReceives; + DWORD dwInHdrErrors; + DWORD dwInAddrErrors; + DWORD dwForwDatagrams; + DWORD dwInUnknownProtos; + DWORD dwInDiscards; + DWORD dwInDelivers; + DWORD dwOutRequests; + DWORD dwRoutingDiscards; + DWORD dwOutDiscards; + DWORD dwOutNoRoutes; + DWORD dwReasmTimeout; + DWORD dwReasmReqds; + DWORD dwReasmOks; + DWORD dwReasmFails; + DWORD dwFragOks; + DWORD dwFragFails; + DWORD dwFragCreates; + DWORD dwNumIf; + DWORD dwNumAddr; + DWORD dwNumRoutes; +} MIB_IPSTATS, *PMIB_IPSTATS; + + +/* ICMP statistics */ + +typedef struct _MIBICMPSTATS +{ + DWORD dwMsgs; + DWORD dwErrors; + DWORD dwDestUnreachs; + DWORD dwTimeExcds; + DWORD dwParmProbs; + DWORD dwSrcQuenchs; + DWORD dwRedirects; + DWORD dwEchos; + DWORD dwEchoReps; + DWORD dwTimestamps; + DWORD dwTimestampReps; + DWORD dwAddrMasks; + DWORD dwAddrMaskReps; +} MIBICMPSTATS, *PMIBICMPSTATS; + +typedef struct _MIBICMPINFO +{ + MIBICMPSTATS icmpInStats; + MIBICMPSTATS icmpOutStats; +} MIBICMPINFO; + +typedef struct _MIB_ICMP +{ + MIBICMPINFO stats; +} MIB_ICMP, *PMIB_ICMP; + +typedef enum +{ + ICMP4_ECHO_REPLY = 0, + ICMP4_DST_UNREACH = 3, + ICMP4_SOURCE_QUENCH = 4, + ICMP4_REDIRECT = 5, + ICMP4_ECHO_REQUEST = 8, + ICMP4_ROUTER_ADVERT = 9, + ICMP4_ROUTER_SOLICIT = 10, + ICMP4_TIME_EXCEEDED = 11, + ICMP4_PARAM_PROB = 12, + ICMP4_TIMESTAMP_REQUEST = 13, + ICMP4_TIMESTAMP_REPLY = 14, + ICMP4_MASK_REQUEST = 17, + ICMP4_MASK_REPLY = 18, +} ICMP4_TYPE, *PICMP4_TYPE; + +typedef enum +{ + ICMP6_DST_UNREACH = 1, + ICMP6_PACKET_TOO_BIG = 2, + ICMP6_TIME_EXCEEDED = 3, + ICMP6_PARAM_PROB = 4, + ICMP6_ECHO_REQUEST = 128, + ICMP6_ECHO_REPLY = 129, + ICMP6_MEMBERSHIP_QUERY = 130, + ICMP6_MEMBERSHIP_REPORT = 131, + ICMP6_MEMBERSHIP_REDUCTION = 132, + ND_ROUTER_SOLICIT = 133, + ND_ROUTER_ADVERT = 134, + ND_NEIGHBOR_SOLICIT = 135, + ND_NEIGHBOR_ADVERT = 136, + ND_REDIRECT = 137, + ICMP6_V2_MEMBERSHIP_REPORT = 143, +} ICMP6_TYPE, *PICMP6_TYPE; + +typedef struct _MIBICMPSTATS_EX +{ + DWORD dwMsgs; + DWORD dwErrors; + DWORD rgdwTypeCount[256]; +} MIBICMPSTATS_EX, *PMIBICMPSTATS_EX; + +typedef struct _MIB_ICMP_EX +{ + MIBICMPSTATS_EX icmpInStats; + MIBICMPSTATS_EX icmpOutStats; +} MIB_ICMP_EX, *PMIB_ICMP_EX; + +#endif /* __WINE_IPMIB_H */ Propchange: trunk/reactos/include/psdk/ipmib.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/psdk/iprtrmib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/iprtrmib.h?re…
============================================================================== --- trunk/reactos/include/psdk/iprtrmib.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/iprtrmib.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -13,298 +13,20 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef WINE_IPRTRMIB_H__ #define WINE_IPRTRMIB_H__ -#define MAX_INTERFACE_NAME_LEN 256 - +#include <mprapi.h> #include <ipifcons.h> -#define MAXLEN_IFDESCR 256 -#define MAXLEN_PHYSADDR 8 +#include <ipmib.h> +#include <tcpmib.h> +#include <udpmib.h> -//It should be 16 according to Lei Shen blog (
http://www.mychinaworks.com/blog/lshen/2008/04/16/220/
-#define TCPIP_OWNING_MODULE_SIZE 16 - -typedef struct _MIB_IFROW +typedef enum _TCP_TABLE_CLASS { - WCHAR wszName[MAX_INTERFACE_NAME_LEN]; - DWORD dwIndex; - DWORD dwType; - DWORD dwMtu; - DWORD dwSpeed; - DWORD dwPhysAddrLen; - BYTE bPhysAddr[MAXLEN_PHYSADDR]; - DWORD dwAdminStatus; - DWORD dwOperStatus; - DWORD dwLastChange; - DWORD dwInOctets; - DWORD dwInUcastPkts; - DWORD dwInNUcastPkts; - DWORD dwInDiscards; - DWORD dwInErrors; - DWORD dwInUnknownProtos; - DWORD dwOutOctets; - DWORD dwOutUcastPkts; - DWORD dwOutNUcastPkts; - DWORD dwOutDiscards; - DWORD dwOutErrors; - DWORD dwOutQLen; - DWORD dwDescrLen; - BYTE bDescr[MAXLEN_IFDESCR]; -} MIB_IFROW,*PMIB_IFROW; - -typedef struct _MIB_IFTABLE -{ - DWORD dwNumEntries; - MIB_IFROW table[1]; -} MIB_IFTABLE, *PMIB_IFTABLE; - -typedef struct _MIBICMPSTATS -{ - DWORD dwMsgs; - DWORD dwErrors; - DWORD dwDestUnreachs; - DWORD dwTimeExcds; - DWORD dwParmProbs; - DWORD dwSrcQuenchs; - DWORD dwRedirects; - DWORD dwEchos; - DWORD dwEchoReps; - DWORD dwTimestamps; - DWORD dwTimestampReps; - DWORD dwAddrMasks; - DWORD dwAddrMaskReps; -} MIBICMPSTATS; - -typedef struct _MIBICMPINFO -{ - MIBICMPSTATS icmpInStats; - MIBICMPSTATS icmpOutStats; -} MIBICMPINFO; - -typedef struct _MIB_ICMP -{ - MIBICMPINFO stats; -} MIB_ICMP,*PMIB_ICMP; - -typedef struct _MIB_UDPSTATS -{ - DWORD dwInDatagrams; - DWORD dwNoPorts; - DWORD dwInErrors; - DWORD dwOutDatagrams; - DWORD dwNumAddrs; -} MIB_UDPSTATS,*PMIB_UDPSTATS; - -typedef struct _MIB_UDPROW -{ - DWORD dwLocalAddr; - DWORD dwLocalPort; -} MIB_UDPROW, *PMIB_UDPROW; - -typedef struct _MIB_UDPTABLE -{ - DWORD dwNumEntries; - MIB_UDPROW table[1]; -} MIB_UDPTABLE, *PMIB_UDPTABLE; - -typedef struct _MIB_TCPSTATS -{ - DWORD dwRtoAlgorithm; - DWORD dwRtoMin; - DWORD dwRtoMax; - DWORD dwMaxConn; - DWORD dwActiveOpens; - DWORD dwPassiveOpens; - DWORD dwAttemptFails; - DWORD dwEstabResets; - DWORD dwCurrEstab; - DWORD dwInSegs; - DWORD dwOutSegs; - DWORD dwRetransSegs; - DWORD dwInErrs; - DWORD dwOutRsts; - DWORD dwNumConns; -} MIB_TCPSTATS, *PMIB_TCPSTATS; - -typedef struct _MIBICMPSTATS_EX -{ - DWORD dwMsgs; - DWORD dwErrors; - DWORD rgdwTypeCount[256]; -} MIBICMPSTATS_EX, *PMIBICMPSTATS_EX; - -typedef struct _MIB_ICMP_EX -{ - MIBICMPSTATS_EX icmpInStats; - MIBICMPSTATS_EX icmpOutStats; -} MIB_ICMP_EX,*PMIB_ICMP_EX; - -typedef struct _MIB_TCPROW -{ - DWORD dwState; - DWORD dwLocalAddr; - DWORD dwLocalPort; - DWORD dwRemoteAddr; - DWORD dwRemotePort; -} MIB_TCPROW, *PMIB_TCPROW; - -#define MIB_TCP_STATE_CLOSED 1 -#define MIB_TCP_STATE_LISTEN 2 -#define MIB_TCP_STATE_SYN_SENT 3 -#define MIB_TCP_STATE_SYN_RCVD 4 -#define MIB_TCP_STATE_ESTAB 5 -#define MIB_TCP_STATE_FIN_WAIT1 6 -#define MIB_TCP_STATE_FIN_WAIT2 7 -#define MIB_TCP_STATE_CLOSE_WAIT 8 -#define MIB_TCP_STATE_CLOSING 9 -#define MIB_TCP_STATE_LAST_ACK 10 -#define MIB_TCP_STATE_TIME_WAIT 11 -#define MIB_TCP_STATE_DELETE_TCB 12 - -typedef struct _MIB_TCPTABLE -{ - DWORD dwNumEntries; - MIB_TCPROW table[1]; -} MIB_TCPTABLE, *PMIB_TCPTABLE; - -typedef struct _MIB_IPSTATS -{ - DWORD dwForwarding; - DWORD dwDefaultTTL; - DWORD dwInReceives; - DWORD dwInHdrErrors; - DWORD dwInAddrErrors; - DWORD dwForwDatagrams; - DWORD dwInUnknownProtos; - DWORD dwInDiscards; - DWORD dwInDelivers; - DWORD dwOutRequests; - DWORD dwRoutingDiscards; - DWORD dwOutDiscards; - DWORD dwOutNoRoutes; - DWORD dwReasmTimeout; - DWORD dwReasmReqds; - DWORD dwReasmOks; - DWORD dwReasmFails; - DWORD dwFragOks; - DWORD dwFragFails; - DWORD dwFragCreates; - DWORD dwNumIf; - DWORD dwNumAddr; - DWORD dwNumRoutes; -} MIB_IPSTATS, *PMIB_IPSTATS; - -typedef struct _MIB_IPADDRROW -{ - DWORD dwAddr; - DWORD dwIndex; - DWORD dwMask; - DWORD dwBCastAddr; - DWORD dwReasmSize; - unsigned short unused1; - unsigned short wType; -} MIB_IPADDRROW, *PMIB_IPADDRROW; - -typedef struct _MIB_IPADDRTABLE -{ - DWORD dwNumEntries; - MIB_IPADDRROW table[1]; -} MIB_IPADDRTABLE, *PMIB_IPADDRTABLE; - - -typedef struct _MIB_IPFORWARDNUMBER -{ - DWORD dwValue; -}MIB_IPFORWARDNUMBER,*PMIB_IPFORWARDNUMBER; - -typedef struct _MIB_IPFORWARDROW -{ - DWORD dwForwardDest; - DWORD dwForwardMask; - DWORD dwForwardPolicy; - DWORD dwForwardNextHop; - DWORD dwForwardIfIndex; - DWORD dwForwardType; - DWORD dwForwardProto; - DWORD dwForwardAge; - DWORD dwForwardNextHopAS; - DWORD dwForwardMetric1; - DWORD dwForwardMetric2; - DWORD dwForwardMetric3; - DWORD dwForwardMetric4; - DWORD dwForwardMetric5; -}MIB_IPFORWARDROW, *PMIB_IPFORWARDROW; - -#define MIB_IPROUTE_TYPE_OTHER 1 -#define MIB_IPROUTE_TYPE_INVALID 2 -#define MIB_IPROUTE_TYPE_DIRECT 3 -#define MIB_IPROUTE_TYPE_INDIRECT 4 - -#define MIB_IPPROTO_OTHER 1 -#define MIB_IPPROTO_LOCAL 2 -#define MIB_IPPROTO_NETMGMT 3 -#define MIB_IPPROTO_ICMP 4 -#define MIB_IPPROTO_EGP 5 -#define MIB_IPPROTO_GGP 6 -#define MIB_IPPROTO_HELLO 7 -#define MIB_IPPROTO_RIP 8 -#define MIB_IPPROTO_IS_IS 9 -#define MIB_IPPROTO_ES_IS 10 -#define MIB_IPPROTO_CISCO 11 -#define MIB_IPPROTO_BBN 12 -#define MIB_IPPROTO_OSPF 13 -#define MIB_IPPROTO_BGP 14 - -#define MIB_IPPROTO_NT_AUTOSTATIC 10002 -#define MIB_IPPROTO_NT_STATIC 10006 -#define MIB_IPPROTO_NT_STATIC_NON_DOD 10007 - -typedef struct _MIB_IPFORWARDTABLE -{ - DWORD dwNumEntries; - MIB_IPFORWARDROW table[1]; -} MIB_IPFORWARDTABLE, *PMIB_IPFORWARDTABLE; - -typedef struct _MIB_IPNETROW -{ - DWORD dwIndex; - DWORD dwPhysAddrLen; - BYTE bPhysAddr[MAXLEN_PHYSADDR]; - DWORD dwAddr; - DWORD dwType; -} MIB_IPNETROW, *PMIB_IPNETROW; - -#define MIB_IPNET_TYPE_OTHER 1 -#define MIB_IPNET_TYPE_INVALID 2 -#define MIB_IPNET_TYPE_DYNAMIC 3 -#define MIB_IPNET_TYPE_STATIC 4 - -typedef struct _MIB_IPNETTABLE -{ - DWORD dwNumEntries; - MIB_IPNETROW table[1]; -} MIB_IPNETTABLE, *PMIB_IPNETTABLE; - -typedef struct _MIB_TCPROW_OWNER_MODULE { - DWORD dwState; - DWORD dwLocalAddr; - DWORD dwLocalPort; - DWORD dwRemoteAddr; - DWORD dwRemotePort; - DWORD dwOwningPid; - LARGE_INTEGER liCreateTimestamp; - ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; -} MIB_TCPROW_OWNER_MODULE, *PMIB_TCPROW_OWNER_MODULE; - -typedef enum { - TCPIP_OWNER_MODULE_INFO_BASIC -} TCPIP_OWNER_MODULE_INFO_CLASS, *PTCPIP_OWNER_MODULE_INFO_CLASS; - -typedef enum { TCP_TABLE_BASIC_LISTENER, TCP_TABLE_BASIC_CONNECTIONS, TCP_TABLE_BASIC_ALL, @@ -316,19 +38,17 @@ TCP_TABLE_OWNER_MODULE_ALL } TCP_TABLE_CLASS, *PTCP_TABLE_CLASS; -typedef struct _MIB_TCPROW_OWNER_PID { - DWORD dwState; - DWORD dwLocalAddr; - DWORD dwLocalPort; - DWORD dwRemoteAddr; - DWORD dwRemotePort; - DWORD dwOwningPid; -} MIB_TCPROW_OWNER_PID, *PMIB_TCPROW_OWNER_PID; +typedef enum _UDP_TABLE_CLASS +{ + UDP_TABLE_BASIC, + UDP_TABLE_OWNER_PID, + UDP_TABLE_OWNER_MODULE +} UDP_TABLE_CLASS, *PUDP_TABLE_CLASS; -typedef struct { - DWORD dwNumEntries; - MIB_TCPROW_OWNER_PID table[1]; -} MIB_TCPTABLE_OWNER_PID, *PMIB_TCPTABLE_OWNER_PID; - +/* ReactOS */ +typedef enum _TCPIP_OWNER_MODULE_INFO_CLASS +{ + TCPIP_OWNER_MODULE_INFO_BASIC +} TCPIP_OWNER_MODULE_INFO_CLASS, *PTCPIP_OWNER_MODULE_INFO_CLASS; #endif /* WINE_IPRTRMIB_H__ */ Modified: trunk/reactos/include/psdk/iptypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/iptypes.h?rev…
============================================================================== --- trunk/reactos/include/psdk/iptypes.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/iptypes.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -1,206 +1,315 @@ -#ifndef _IPTYPES_H -#define _IPTYPES_H - -#include <sys/types.h> +/* WINE iptypes.h + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef WINE_IPTYPES_H_ +#define WINE_IPTYPES_H_ + +#include <time.h> #include <ifdef.h> - -#ifdef __cplusplus -extern "C" { +#include <nldef.h> + +#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 +#define MAX_ADAPTER_NAME_LENGTH 256 +#define MAX_ADAPTER_ADDRESS_LENGTH 8 +#define MAX_HOSTNAME_LEN 128 +#define MAX_DOMAIN_NAME_LEN 128 +#define MAX_SCOPE_ID_LEN 256 +#define MAX_DHCPV6_DUID_LENGTH 130 +#define MAX_DNS_SUFFIX_STRING_LENGTH 256 + +#define BROADCAST_NODETYPE 1 +#define PEER_TO_PEER_NODETYPE 2 +#define MIXED_NODETYPE 4 +#define HYBRID_NODETYPE 8 + +typedef struct { + char String[4 * 4]; +} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING; + +typedef struct _IP_ADDR_STRING { + struct _IP_ADDR_STRING* Next; + IP_ADDRESS_STRING IpAddress; + IP_MASK_STRING IpMask; + DWORD Context; +} IP_ADDR_STRING, *PIP_ADDR_STRING; + +typedef struct _IP_ADAPTER_INFO { + struct _IP_ADAPTER_INFO* Next; + DWORD ComboIndex; + char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4]; + char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4]; + UINT AddressLength; + BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]; + DWORD Index; + UINT Type; + UINT DhcpEnabled; + PIP_ADDR_STRING CurrentIpAddress; + IP_ADDR_STRING IpAddressList; + IP_ADDR_STRING GatewayList; + IP_ADDR_STRING DhcpServer; + BOOL HaveWins; + IP_ADDR_STRING PrimaryWinsServer; + IP_ADDR_STRING SecondaryWinsServer; + time_t LeaseObtained; + time_t LeaseExpires; +} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO; + +typedef struct _IP_PER_ADAPTER_INFO { + UINT AutoconfigEnabled; + UINT AutoconfigActive; + PIP_ADDR_STRING CurrentDnsServer; + IP_ADDR_STRING DnsServerList; +} IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO; + +typedef struct { + char HostName[MAX_HOSTNAME_LEN + 4] ; + char DomainName[MAX_DOMAIN_NAME_LEN + 4]; + PIP_ADDR_STRING CurrentDnsServer; + IP_ADDR_STRING DnsServerList; + UINT NodeType; + char ScopeId[MAX_SCOPE_ID_LEN + 4]; + UINT EnableRouting; + UINT EnableProxy; + UINT EnableDns; +} FIXED_INFO, *PFIXED_INFO; + +typedef NL_PREFIX_ORIGIN IP_PREFIX_ORIGIN; +typedef NL_SUFFIX_ORIGIN IP_SUFFIX_ORIGIN; +typedef NL_DAD_STATE IP_DAD_STATE; + +/* ReactOS */ +#if (NTDDI_VERSION >= NTDDI_WIN2KSP1) +typedef struct _IP_INTERFACE_NAME_INFO { + ULONG Index; + ULONG MediaType; + UCHAR ConnectionType; + UCHAR AccessType; + GUID DeviceGuid; + GUID InterfaceGuid; +} IP_INTERFACE_NAME_INFO, *PIP_INTERFACE_NAME_INFO; #endif -#define DEFAULT_MINIMUM_ENTITIES 32 -#define MAX_ADAPTER_ADDRESS_LENGTH 8 -#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 -#define MAX_ADAPTER_NAME_LENGTH 256 -#define MAX_DOMAIN_NAME_LEN 128 -#define MAX_HOSTNAME_LEN 128 -#define MAX_SCOPE_ID_LEN 256 -#define BROADCAST_NODETYPE 1 -#define PEER_TO_PEER_NODETYPE 2 -#define MIXED_NODETYPE 4 -#define HYBRID_NODETYPE 8 -#define IF_OTHER_ADAPTERTYPE 0 -#define IF_ETHERNET_ADAPTERTYPE 1 -#define IF_TOKEN_RING_ADAPTERTYPE 2 -#define IF_FDDI_ADAPTERTYPE 3 -#define IF_PPP_ADAPTERTYPE 4 -#define IF_LOOPBACK_ADAPTERTYPE 5 -typedef struct { - char String[16]; -} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING; -typedef struct _IP_ADDR_STRING { - struct _IP_ADDR_STRING* Next; - IP_ADDRESS_STRING IpAddress; - IP_MASK_STRING IpMask; - DWORD Context; -} IP_ADDR_STRING, *PIP_ADDR_STRING; -typedef struct _IP_ADAPTER_INFO { - struct _IP_ADAPTER_INFO* Next; - DWORD ComboIndex; - char AdapterName[MAX_ADAPTER_NAME_LENGTH+4]; - char Description[MAX_ADAPTER_DESCRIPTION_LENGTH+4]; - UINT AddressLength; - BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]; - DWORD Index; - UINT Type; - UINT DhcpEnabled; - PIP_ADDR_STRING CurrentIpAddress; - IP_ADDR_STRING IpAddressList; - IP_ADDR_STRING GatewayList; - IP_ADDR_STRING DhcpServer; - BOOL HaveWins; - IP_ADDR_STRING PrimaryWinsServer; - IP_ADDR_STRING SecondaryWinsServer; - time_t LeaseObtained; - time_t LeaseExpires; -} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO; -typedef struct _IP_PER_ADAPTER_INFO { - UINT AutoconfigEnabled; - UINT AutoconfigActive; - PIP_ADDR_STRING CurrentDnsServer; - IP_ADDR_STRING DnsServerList; -} IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO; -typedef struct { - ULONG Index; - ULONG MediaType; - UCHAR ConnectionType; - UCHAR AccessType; - GUID DeviceGuid; - GUID InterfaceGuid; -} IP_INTERFACE_NAME_INFO, *PIP_INTERFACE_NAME_INFO; -typedef struct _FIXED_INFO { - char HostName[MAX_HOSTNAME_LEN+4] ; - char DomainName[MAX_DOMAIN_NAME_LEN+4]; - PIP_ADDR_STRING CurrentDnsServer; - IP_ADDR_STRING DnsServerList; - UINT NodeType; - char ScopeId[MAX_SCOPE_ID_LEN+4]; - UINT EnableRouting; - UINT EnableProxy; - UINT EnableDns; -} FIXED_INFO, *PFIXED_INFO; + #ifdef _WINSOCK2API_ -typedef enum { - IpPrefixOriginOther = 0, - IpPrefixOriginManual, - IpPrefixOriginWellKnown, - IpPrefixOriginDhcp, - IpPrefixOriginRouterAdvertisement, -} IP_PREFIX_ORIGIN; -typedef enum { - IpSuffixOriginOther = 0, - IpSuffixOriginManual, - IpSuffixOriginWellKnown, - IpSuffixOriginDhcp, - IpSuffixOriginLinkLayerAddress, - IpSuffixOriginRandom, -} IP_SUFFIX_ORIGIN; -typedef enum { - IpDadStateInvalid = 0, - IpDadStateTentative, - IpDadStateDuplicate, - IpDadStateDeprecated, - IpDadStatePreferred, -} IP_DAD_STATE; + typedef struct _IP_ADAPTER_UNICAST_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_UNICAST_ADDRESS *Next; - SOCKET_ADDRESS Address; - IP_PREFIX_ORIGIN PrefixOrigin; - IP_SUFFIX_ORIGIN SuffixOrigin; - IP_DAD_STATE DadState; - ULONG ValidLifetime; - ULONG PreferredLifetime; - ULONG LeaseLifetime; + union { + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_UNICAST_ADDRESS *Next; + SOCKET_ADDRESS Address; + IP_PREFIX_ORIGIN PrefixOrigin; + IP_SUFFIX_ORIGIN SuffixOrigin; + IP_DAD_STATE DadState; + ULONG ValidLifetime; + ULONG PreferredLifetime; + ULONG LeaseLifetime; } IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS; + typedef struct _IP_ADAPTER_ANYCAST_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_ANYCAST_ADDRESS *Next; - SOCKET_ADDRESS Address; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_ANYCAST_ADDRESS *Next; + SOCKET_ADDRESS Address; } IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS; + typedef struct _IP_ADAPTER_MULTICAST_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_MULTICAST_ADDRESS *Next; - SOCKET_ADDRESS Address; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_MULTICAST_ADDRESS *Next; + SOCKET_ADDRESS Address; } IP_ADAPTER_MULTICAST_ADDRESS, *PIP_ADAPTER_MULTICAST_ADDRESS; + typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Reserved; - }; - }; - struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next; - SOCKET_ADDRESS Address; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Reserved; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next; + SOCKET_ADDRESS Address; } IP_ADAPTER_DNS_SERVER_ADDRESS, *PIP_ADAPTER_DNS_SERVER_ADDRESS; + typedef struct _IP_ADAPTER_PREFIX { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD Flags; - }; - }; - struct _IP_ADAPTER_PREFIX *Next; - SOCKET_ADDRESS Address; - ULONG PrefixLength; + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Flags; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_PREFIX *Next; + SOCKET_ADDRESS Address; + ULONG PrefixLength; } IP_ADAPTER_PREFIX, *PIP_ADAPTER_PREFIX; -typedef struct _IP_ADAPTER_ADDRESSES { - union { - ULONGLONG Alignment; - struct { - ULONG Length; - DWORD IfIndex; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - struct _IP_ADAPTER_ADDRESSES *Next; - PCHAR AdapterName; - PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress; - PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress; - PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress; - PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress; - PWCHAR DnsSuffix; - PWCHAR Description; - PWCHAR FriendlyName; - BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; - DWORD PhysicalAddressLength; - DWORD Flags; - DWORD Mtu; - DWORD IfType; - IF_OPER_STATUS OperStatus; - DWORD Ipv6IfIndex; - DWORD ZoneIndices[16]; - PIP_ADAPTER_PREFIX FirstPrefix; -} IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES; - -#define GAA_FLAG_SKIP_UNICAST 0x00000001 -#define GAA_FLAG_SKIP_ANYCAST 0x00000002 -#define GAA_FLAG_SKIP_MULTICAST 0x00000004 -#define GAA_FLAG_SKIP_DNS_SERVER 0x00000008 -#define GAA_FLAG_INCLUDE_PREFIX 0x00000010 -#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x00000020 - + +typedef struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Reserved; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH *Next; + SOCKET_ADDRESS Address; +} IP_ADAPTER_WINS_SERVER_ADDRESS_LH, *PIP_ADAPTER_WINS_SERVER_ADDRESS_LH; +typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH IP_ADAPTER_WINS_SERVER_ADDRESS; +typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH *PIP_ADAPTER_WINS_SERVER_ADDRESS; + +typedef struct _IP_ADAPTER_GATEWAY_ADDRESS_LH { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD Reserved; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_GATEWAY_ADDRESS_LH *Next; + SOCKET_ADDRESS Address; +} IP_ADAPTER_GATEWAY_ADDRESS_LH, *PIP_ADAPTER_GATEWAY_ADDRESS_LH; +typedef IP_ADAPTER_GATEWAY_ADDRESS_LH IP_ADAPTER_GATEWAY_ADDRESS; +typedef IP_ADAPTER_GATEWAY_ADDRESS_LH *PIP_ADAPTER_GATEWAY_ADDRESS; + +typedef struct _IP_ADAPTER_DNS_SUFFIX { + struct _IP_ADAPTER_DNS_SUFFIX *Next; + WCHAR String[MAX_DNS_SUFFIX_STRING_LENGTH]; +} IP_ADAPTER_DNS_SUFFIX, *PIP_ADAPTER_DNS_SUFFIX; + +#define IP_ADAPTER_DDNS_ENABLED 0x1 +#define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x2 +#define IP_ADAPTER_DHCP_ENABLED 0x4 +#define IP_ADAPTER_RECEIVE_ONLY 0x8 +#define IP_ADAPTER_NO_MULTICAST 0x10 +#define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x20 +#define IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED 0x40 +#define IP_ADAPTER_IPV4_ENABLED 0x80 +#define IP_ADAPTER_IPV6_ENABLED 0x100 +#define IP_ADAPTER_IPV6_MANAGE_ADDRESS_CONFIG 0x200 + +typedef struct _IP_ADAPTER_ADDRESSES_LH { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD IfIndex; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_ADDRESSES_LH *Next; + PCHAR AdapterName; + PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress; + PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress; + PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress; + PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress; + PWCHAR DnsSuffix; + PWCHAR Description; + PWCHAR FriendlyName; + BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; + DWORD PhysicalAddressLength; + DWORD Flags; + DWORD Mtu; + DWORD IfType; + IF_OPER_STATUS OperStatus; + DWORD Ipv6IfIndex; + DWORD ZoneIndices[16]; + PIP_ADAPTER_PREFIX FirstPrefix; + ULONG64 TransmitLinkSpeed; + ULONG64 ReceiveLinkSpeed; + PIP_ADAPTER_WINS_SERVER_ADDRESS_LH FirstWinsServerAddress; + PIP_ADAPTER_GATEWAY_ADDRESS_LH FirstGatewayAddress; + ULONG Ipv4Metric; + ULONG Ipv6Metric; + IF_LUID Luid; + SOCKET_ADDRESS Dhcpv4Server; + NET_IF_COMPARTMENT_ID CompartmentId; + NET_IF_NETWORK_GUID NetworkGuid; + NET_IF_CONNECTION_TYPE ConnectionType; + TUNNEL_TYPE TunnelType; + SOCKET_ADDRESS Dhcpv6Server; + BYTE Dhcpv6ClientDuid[MAX_DHCPV6_DUID_LENGTH]; + ULONG Dhcpv6ClientDuidLength; + ULONG Dhcpv6Iaid; + PIP_ADAPTER_DNS_SUFFIX FirstDnsSuffix; +} IP_ADAPTER_ADDRESSES_LH, *PIP_ADAPTER_ADDRESSES_LH; + +typedef struct _IP_ADAPTER_ADDRESSES_XP { + union { + ULONGLONG Alignment; + struct { + ULONG Length; + DWORD IfIndex; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + struct _IP_ADAPTER_ADDRESSES_XP *Next; + PCHAR AdapterName; + PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress; + PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress; + PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress; + PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress; + PWCHAR DnsSuffix; + PWCHAR Description; + PWCHAR FriendlyName; + BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]; + DWORD PhysicalAddressLength; + DWORD Flags; + DWORD Mtu; + DWORD IfType; + IF_OPER_STATUS OperStatus; + DWORD Ipv6IfIndex; + DWORD ZoneIndices[16]; + PIP_ADAPTER_PREFIX FirstPrefix; +} IP_ADAPTER_ADDRESSES_XP, *PIP_ADAPTER_ADDRESSES_XP; + +/* ReactOS */ +#if (NTDDI_VERSION >= NTDDI_VISTA) +typedef IP_ADAPTER_ADDRESSES_LH IP_ADAPTER_ADDRESSES; +typedef IP_ADAPTER_ADDRESSES_LH *PIP_ADAPTER_ADDRESSES; +#else +typedef IP_ADAPTER_ADDRESSES_XP IP_ADAPTER_ADDRESSES; +typedef IP_ADAPTER_ADDRESSES_XP *PIP_ADAPTER_ADDRESSES; #endif -#ifdef __cplusplus -} -#endif -#endif /* _IPTYPES_H */ +#define GAA_FLAG_SKIP_UNICAST 0x00000001 +#define GAA_FLAG_SKIP_ANYCAST 0x00000002 +#define GAA_FLAG_SKIP_MULTICAST 0x00000004 +#define GAA_FLAG_SKIP_DNS_SERVER 0x00000008 +#define GAA_FLAG_INCLUDE_PREFIX 0x00000010 +#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x00000020 +#define GAA_FLAG_INCLUDE_WINS_INFO 0x00000040 +#define GAA_FLAG_INCLUDE_ALL_GATEWAYS 0x00000080 +#define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x00000100 +#define GAA_FLAG_INCLUDE_ALL_COMPARTMENTS 0x00000200 +#define GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER 0x00000400 + +#endif /* _WINSOCK2API_ */ + +#endif /* WINE_IPTYPES_H_*/ Added: trunk/reactos/include/psdk/tcpmib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/tcpmib.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/tcpmib.h (added) +++ trunk/reactos/include/psdk/tcpmib.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -0,0 +1,192 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_TCPMIB_H +#define __WINE_TCPMIB_H + +#define TCPIP_OWNING_MODULE_SIZE 16 + + +/* TCP tables */ + +typedef enum +{ + MIB_TCP_STATE_CLOSED = 1, + MIB_TCP_STATE_LISTEN = 2, + MIB_TCP_STATE_SYN_SENT = 3, + MIB_TCP_STATE_SYN_RCVD = 4, + MIB_TCP_STATE_ESTAB = 5, + MIB_TCP_STATE_FIN_WAIT1 = 6, + MIB_TCP_STATE_FIN_WAIT2 = 7, + MIB_TCP_STATE_CLOSE_WAIT = 8, + MIB_TCP_STATE_CLOSING = 9, + MIB_TCP_STATE_LAST_ACK = 10, + MIB_TCP_STATE_TIME_WAIT = 11, + MIB_TCP_STATE_DELETE_TCB = 12, +} MIB_TCP_STATE; + +typedef enum +{ + TcpConnectionOffloadStateInHost, + TcpConnectionOffloadStateOffloading, + TcpConnectionOffloadStateOffloaded, + TcpConnectionOffloadStateUploading, + TcpConnectionOffloadStateMax, +} TCP_CONNECTION_OFFLOAD_STATE, *PTCP_CONNECTION_OFFLOAD_STATE; + +typedef struct _MIB_TCPROW +{ + union + { + DWORD dwState; + MIB_TCP_STATE State; + } DUMMYUNIONNAME; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; +} MIB_TCPROW, *PMIB_TCPROW; + +typedef struct _MIB_TCPTABLE +{ + DWORD dwNumEntries; + MIB_TCPROW table[1]; +} MIB_TCPTABLE, *PMIB_TCPTABLE; + +typedef struct _MIB_TCP6ROW { + MIB_TCP_STATE State; + IN6_ADDR LocalAddr; + DWORD dwLocalScopeId; + DWORD dwLocalPort; + IN6_ADDR RemoteAddr; + DWORD dwRemoteScopeId; + DWORD dwRemotePort; +} MIB_TCP6ROW, *PMIB_TCP6ROW; + +typedef struct _MIB_TCP6TABLE { + DWORD dwNumEntries; + MIB_TCP6ROW table[1]; +} MIB_TCP6TABLE, *PMIB_TCP6TABLE; + +typedef struct _MIB_TCP6ROW2 { + IN6_ADDR LocalAddr; + DWORD dwLocalScopeId; + DWORD dwLocalPort; + IN6_ADDR RemoteAddr; + DWORD dwRemoteScopeId; + DWORD dwRemotePort; + MIB_TCP_STATE State; + DWORD dwOwningPid; + TCP_CONNECTION_OFFLOAD_STATE dwOffloadState; +} MIB_TCP6ROW2, *PMIB_TCP6ROW2; + +typedef struct _MIB_TCP6TABLE2 { + DWORD dwNumEntries; + MIB_TCP6ROW2 table[1]; +} MIB_TCP6TABLE2, *PMIB_TCP6TABLE2; + +typedef struct _MIB_TCPROW_OWNER_PID +{ + DWORD dwState; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; + DWORD dwOwningPid; +} MIB_TCPROW_OWNER_PID, *PMIB_TCPROW_OWNER_PID; + +typedef struct _MIB_TCPTABLE_OWNER_PID +{ + DWORD dwNumEntries; + MIB_TCPROW_OWNER_PID table[1]; +} MIB_TCPTABLE_OWNER_PID, *PMIB_TCPTABLE_OWNER_PID; + +typedef struct _MIB_TCPROW_OWNER_MODULE +{ + DWORD dwState; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; + DWORD dwOwningPid; + LARGE_INTEGER liCreateTimestamp; + ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; +} MIB_TCPROW_OWNER_MODULE, *PMIB_TCPROW_OWNER_MODULE; + +typedef struct _MIB_TCPTABLE_OWNER_MODULE +{ + DWORD dwNumEntries; + MIB_TCPROW_OWNER_MODULE table[1]; +} MIB_TCPTABLE_OWNER_MODULE, *PMIB_TCPTABLE_OWNER_MODULE; + +typedef struct _MIB_TCPROW2 +{ + DWORD dwState; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; + DWORD dwOwningPid; + TCP_CONNECTION_OFFLOAD_STATE dwOffloadState; +} MIB_TCPROW2, *PMIB_TCPROW2; + +typedef struct _MIB_TCPTABLE2 +{ + DWORD dwNumEntries; + MIB_TCPROW2 table[1]; +} MIB_TCPTABLE2, *PMIB_TCPTABLE2; + + +/* TCP stats */ + +typedef enum +{ + TcpRtoAlgorithmOther = 0, + TcpRtoAlgorithmConstant = 1, + TcpRtoAlgorithmRsre = 2, + TcpRtoAlgorithmVanj = 3, + + MIB_TCP_RTO_OTHER = 1, + MIB_TCP_RTO_CONSTANT = 2, + MIB_TCP_RTO_RSRE = 3, + MIB_TCP_RTO_VANJ = 4, +} TCP_RTO_ALGORITHM, *PTCP_RTO_ALGORITHM; + +typedef struct _MIB_TCPSTATS +{ + union + { + DWORD dwRtoAlgorithm; + TCP_RTO_ALGORITHM RtoAlgorithm; + } DUMMYUNIONNAME; + DWORD dwRtoMin; + DWORD dwRtoMax; + DWORD dwMaxConn; + DWORD dwActiveOpens; + DWORD dwPassiveOpens; + DWORD dwAttemptFails; + DWORD dwEstabResets; + DWORD dwCurrEstab; + DWORD dwInSegs; + DWORD dwOutSegs; + DWORD dwRetransSegs; + DWORD dwInErrs; + DWORD dwOutRsts; + DWORD dwNumConns; +} MIB_TCPSTATS, *PMIB_TCPSTATS; + +#endif /* __WINE_TCPMIB_H */ Propchange: trunk/reactos/include/psdk/tcpmib.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/include/psdk/udpmib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/udpmib.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/udpmib.h (added) +++ trunk/reactos/include/psdk/udpmib.h [iso-8859-1] Mon Nov 30 20:08:57 2015 @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2003 Juan Lang + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_UDPMIB_H +#define __WINE_UDPMIB_H + +#define TCPIP_OWNING_MODULE_SIZE 16 + + +/* UDP table */ + +typedef struct _MIB_UDPROW +{ + DWORD dwLocalAddr; + DWORD dwLocalPort; +} MIB_UDPROW, *PMIB_UDPROW; + +typedef struct _MIB_UDPTABLE +{ + DWORD dwNumEntries; + MIB_UDPROW table[1]; +} MIB_UDPTABLE, *PMIB_UDPTABLE; + +typedef struct _MIB_UDPROW_OWNER_PID +{ + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwOwningPid; +} MIB_UDPROW_OWNER_PID, *PMIB_UDPROW_OWNER_PID; + +typedef struct _MIB_UDPTABLE_OWNER_PID +{ + DWORD dwNumEntries; + MIB_UDPROW_OWNER_PID table[1]; +} MIB_UDPTABLE_OWNER_PID, *PMIB_UDPTABLE_OWNER_PID; + +typedef struct _MIB_UDPROW_OWNER_MODULE +{ + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwOwningPid; + LARGE_INTEGER liCreateTimestamp; + __C89_NAMELESS union + { + __C89_NAMELESS struct + { + int SpecificPortBind:1; + } __C89_NAMELESSSTRUCTNAME; + int dwFlags; + } __C89_NAMELESSUNIONNAME; + ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; +} MIB_UDPROW_OWNER_MODULE, *PMIB_UDPROW_OWNER_MODULE; + +typedef struct _MIB_UDPTABLE_OWNER_MODULE +{ + DWORD dwNumEntries; + MIB_UDPROW_OWNER_MODULE table[1]; +} MIB_UDPTABLE_OWNER_MODULE, *PMIB_UDPTABLE_OWNER_MODULE; + +/* UDP statistics */ + +typedef struct _MIB_UDPSTATS +{ + DWORD dwInDatagrams; + DWORD dwNoPorts; + DWORD dwInErrors; + DWORD dwOutDatagrams; + DWORD dwNumAddrs; +} MIB_UDPSTATS, *PMIB_UDPSTATS; + +#endif /* __WINE_UDPMIB_H */ Propchange: trunk/reactos/include/psdk/udpmib.h ------------------------------------------------------------------------------ svn:eol-style = native
9 years
1
0
0
0
[akhaldi] 70219: [TRANSLATIONS] Simplified Chinese translation update by Henry Tang Ih. CORE-10588
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 30 19:01:56 2015 New Revision: 70219 URL:
http://svn.reactos.org/svn/reactos?rev=70219&view=rev
Log: [TRANSLATIONS] Simplified Chinese translation update by Henry Tang Ih. CORE-10588 Added: trunk/reactos/base/applications/clipbrd/lang/zh-CN.rc (with props) trunk/reactos/base/applications/cmdutils/clip/lang/zh-CN.rc (with props) trunk/reactos/base/applications/cmdutils/reg/lang/zh-CN.rc (with props) trunk/reactos/base/applications/cmdutils/taskkill/lang/zh-CN.rc (with props) trunk/reactos/base/applications/cmdutils/tree/lang/zh-CN.rc (with props) trunk/reactos/base/applications/cmdutils/whoami/lang/zh-CN.rc (with props) trunk/reactos/base/applications/cmdutils/wmic/lang/zh-CN.rc (with props) trunk/reactos/base/applications/cmdutils/xcopy/lang/zh-CN.rc (with props) trunk/reactos/base/applications/network/net/lang/zh-CN.rc (with props) trunk/reactos/base/applications/network/wlanconf/lang/zh-CN.rc (with props) trunk/reactos/base/system/diskpart/lang/zh-CN.rc (with props) trunk/reactos/base/system/services/lang/zh-CN.rc (with props) trunk/reactos/dll/win32/crypt32/lang/crypt32_Zh.rc (with props) trunk/reactos/dll/win32/cryptdlg/lang/cryptdlg_Zh.rc (with props) trunk/reactos/dll/win32/cryptui/lang/cryptui_Zh.rc (with props) trunk/reactos/dll/win32/iccvid/lang/iccvid_Zh.rc (with props) trunk/reactos/dll/win32/jscript/lang/jscript_Zh.rc (with props) trunk/reactos/dll/win32/kernel32/winnls/lang/zh-CN.rc (with props) trunk/reactos/dll/win32/lsasrv/lang/zh-CN.rc (with props) trunk/reactos/dll/win32/mapi32/lang/Zh.rc (with props) trunk/reactos/dll/win32/msrle32/lang/msrle_Zh.rc (with props) trunk/reactos/dll/win32/msvidc32/lang/msvidc32_Zh.rc (with props) trunk/reactos/dll/win32/oleacc/lang/oleacc_Zh.rc (with props) trunk/reactos/dll/win32/rasdlg/lang/zh-CN.rc (with props) trunk/reactos/dll/win32/userenv/lang/zh-CN.rc (with props) trunk/reactos/dll/win32/winmm/lang/winmm_Zh.rc (with props) trunk/reactos/dll/win32/wldap32/lang/wldap32_Zh.rc (with props) Modified: trunk/reactos/base/applications/clipbrd/clipbrd.rc trunk/reactos/base/applications/cmdutils/clip/clip.rc trunk/reactos/base/applications/cmdutils/reg/reg.rc trunk/reactos/base/applications/cmdutils/taskkill/taskkill.rc trunk/reactos/base/applications/cmdutils/tree/tree.rc trunk/reactos/base/applications/cmdutils/whoami/whoami.rc trunk/reactos/base/applications/cmdutils/wmic/wmic.rc trunk/reactos/base/applications/cmdutils/xcopy/xcopy.rc trunk/reactos/base/applications/games/winmine/lang/zh-CN.rc trunk/reactos/base/applications/msconfig_new/lang/zh-CN.rc trunk/reactos/base/applications/network/net/net.rc trunk/reactos/base/applications/network/wlanconf/wlanconf.rc trunk/reactos/base/applications/notepad/lang/zh-CN.rc trunk/reactos/base/shell/cmd/lang/zh-CN.rc trunk/reactos/base/shell/explorer/lang/zh-CN.rc trunk/reactos/base/system/diskpart/diskpart.rc trunk/reactos/base/system/services/services.rc trunk/reactos/dll/cpl/mmsys/lang/zh-CN.rc trunk/reactos/dll/cpl/sysdm/lang/zh-CN.rc trunk/reactos/dll/shellext/deskadp/lang/zh-CN.rc trunk/reactos/dll/shellext/netshell/lang/zh-CN.rc trunk/reactos/dll/win32/browseui/lang/zh-CN.rc trunk/reactos/dll/win32/crypt32/crypt32.rc trunk/reactos/dll/win32/cryptdlg/cryptdlg.rc trunk/reactos/dll/win32/cryptui/cryptui.rc trunk/reactos/dll/win32/iccvid/rsrc.rc trunk/reactos/dll/win32/jscript/rsrc.rc trunk/reactos/dll/win32/kernel32/kernel32.rc trunk/reactos/dll/win32/lsasrv/lsasrv.rc trunk/reactos/dll/win32/mapi32/version.rc trunk/reactos/dll/win32/modemui/lang/zh-CN.rc trunk/reactos/dll/win32/msrle32/rsrc.rc trunk/reactos/dll/win32/msvidc32/rsrc.rc trunk/reactos/dll/win32/oleacc/oleacc.rc trunk/reactos/dll/win32/rasdlg/rasdlg.rc trunk/reactos/dll/win32/shell32/lang/zh-CN.rc trunk/reactos/dll/win32/shimgvw/lang/zh-CN.rc trunk/reactos/dll/win32/syssetup/lang/zh-CN.rc trunk/reactos/dll/win32/userenv/userenv.rc trunk/reactos/dll/win32/winmm/winmm_res.rc trunk/reactos/dll/win32/wldap32/wldap32.rc trunk/reactos/media/themes/lautus.msstyles/lang/zh-CN.rc trunk/reactos/subsystems/mvdm/ntvdm/lang/zh-CN.rc trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc trunk/reactos/win32ss/user/winsrv/consrv_new/frontends/gui/lang/zh-CN.rc [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/base/applications/clipbrd/clipbrd.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
Added: trunk/reactos/base/applications/clipbrd/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
Modified: trunk/reactos/base/applications/cmdutils/clip/clip.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/clip/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/reg/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/cmdutils/reg/reg.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/taskkill/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/cmdutils/taskkill/taskkill.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/tree/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/cmdutils/tree/tree.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/whoami/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/cmdutils/whoami/whoami.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/wmic/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/cmdutils/wmic/wmic.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/xcopy/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/cmdutils/xcopy/xcopy.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/games/winmine/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/wi…
Modified: trunk/reactos/base/applications/msconfig_new/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
Added: trunk/reactos/base/applications/network/net/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
Modified: trunk/reactos/base/applications/network/net/net.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
Added: trunk/reactos/base/applications/network/wlanconf/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
Modified: trunk/reactos/base/applications/network/wlanconf/wlanconf.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
Modified: trunk/reactos/base/applications/notepad/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
Modified: trunk/reactos/base/shell/cmd/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/zh-CN.…
Modified: trunk/reactos/base/shell/explorer/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/lang/z…
Modified: trunk/reactos/base/system/diskpart/diskpart.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/diskp…
Added: trunk/reactos/base/system/diskpart/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/lang/…
Added: trunk/reactos/base/system/services/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/lang/…
Modified: trunk/reactos/base/system/services/services.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
Modified: trunk/reactos/dll/cpl/mmsys/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/lang/zh-CN.r…
Modified: trunk/reactos/dll/cpl/sysdm/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/lang/zh-CN.r…
Modified: trunk/reactos/dll/shellext/deskadp/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/deskadp/lang/…
Modified: trunk/reactos/dll/shellext/netshell/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/netshell/lang…
Modified: trunk/reactos/dll/win32/browseui/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/zh…
Modified: trunk/reactos/dll/win32/crypt32/crypt32.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crypt32.…
Added: trunk/reactos/dll/win32/crypt32/lang/crypt32_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/lang/cry…
Modified: trunk/reactos/dll/win32/cryptdlg/cryptdlg.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptdlg/cryptdl…
Added: trunk/reactos/dll/win32/cryptdlg/lang/cryptdlg_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptdlg/lang/cr…
Modified: trunk/reactos/dll/win32/cryptui/cryptui.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptui/cryptui.…
Added: trunk/reactos/dll/win32/cryptui/lang/cryptui_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptui/lang/cry…
Added: trunk/reactos/dll/win32/iccvid/lang/iccvid_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iccvid/lang/iccv…
Modified: trunk/reactos/dll/win32/iccvid/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iccvid/rsrc.rc?r…
Added: trunk/reactos/dll/win32/jscript/lang/jscript_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/lang/jsc…
Modified: trunk/reactos/dll/win32/jscript/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/rsrc.rc?…
Modified: trunk/reactos/dll/win32/kernel32/kernel32.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
Added: trunk/reactos/dll/win32/kernel32/winnls/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
Added: trunk/reactos/dll/win32/lsasrv/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lang/zh-C…
Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.rc…
Added: trunk/reactos/dll/win32/mapi32/lang/Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/lang/Zh.r…
Modified: trunk/reactos/dll/win32/mapi32/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/version.r…
Modified: trunk/reactos/dll/win32/modemui/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/modemui/lang/zh-…
Added: trunk/reactos/dll/win32/msrle32/lang/msrle_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msrle32/lang/msr…
Modified: trunk/reactos/dll/win32/msrle32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msrle32/rsrc.rc?…
Added: trunk/reactos/dll/win32/msvidc32/lang/msvidc32_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvidc32/lang/ms…
Modified: trunk/reactos/dll/win32/msvidc32/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvidc32/rsrc.rc…
Added: trunk/reactos/dll/win32/oleacc/lang/oleacc_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleacc/lang/olea…
Modified: trunk/reactos/dll/win32/oleacc/oleacc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleacc/oleacc.rc…
Added: trunk/reactos/dll/win32/rasdlg/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rasdlg/lang/zh-C…
Modified: trunk/reactos/dll/win32/rasdlg/rasdlg.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rasdlg/rasdlg.rc…
Modified: trunk/reactos/dll/win32/shell32/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
Modified: trunk/reactos/dll/win32/shimgvw/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/lang/zh-…
Modified: trunk/reactos/dll/win32/syssetup/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/zh…
Added: trunk/reactos/dll/win32/userenv/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/zh-…
Modified: trunk/reactos/dll/win32/userenv/userenv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/userenv.…
Added: trunk/reactos/dll/win32/winmm/lang/winmm_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/lang/winmm…
Modified: trunk/reactos/dll/win32/winmm/winmm_res.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/winmm_res.…
Added: trunk/reactos/dll/win32/wldap32/lang/wldap32_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wldap32/lang/wld…
Modified: trunk/reactos/dll/win32/wldap32/wldap32.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wldap32/wldap32.…
Modified: trunk/reactos/media/themes/lautus.msstyles/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/themes/lautus.msstyl…
Modified: trunk/reactos/subsystems/mvdm/ntvdm/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/lang…
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
Modified: trunk/reactos/win32ss/user/winsrv/consrv_new/frontends/gui/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
9 years
1
0
0
0
[akhaldi] 70218: [TRANSLATIONS] Spanish translation update by Ismael Ferreras Morezuelas. CORE-10613
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 30 18:53:22 2015 New Revision: 70218 URL:
http://svn.reactos.org/svn/reactos?rev=70218&view=rev
Log: [TRANSLATIONS] Spanish translation update by Ismael Ferreras Morezuelas. CORE-10613 Added: trunk/reactos/base/applications/clipbrd/lang/es-ES.rc (with props) trunk/reactos/base/applications/cmdutils/clip/lang/es-ES.rc (with props) Modified: trunk/reactos/base/applications/clipbrd/clipbrd.rc trunk/reactos/base/applications/cmdutils/clip/clip.rc trunk/reactos/base/applications/msconfig_new/lang/es-ES.rc trunk/reactos/base/applications/network/ipconfig/lang/es-ES.rc trunk/reactos/base/applications/notepad/lang/es-ES.rc trunk/reactos/base/applications/osk/lang/es-ES.rc trunk/reactos/base/applications/rapps/lang/es-ES.rc trunk/reactos/base/applications/sndrec32/lang/es-ES.rc trunk/reactos/base/applications/taskmgr/lang/es-ES.rc trunk/reactos/base/applications/winhlp32/lang/Es.rc trunk/reactos/base/setup/usetup/lang/es-ES.h trunk/reactos/base/shell/cmd/lang/es-ES.rc trunk/reactos/dll/cpl/input/lang/es-ES.rc trunk/reactos/dll/cpl/intl/lang/es-ES.rc trunk/reactos/dll/cpl/usrmgr/lang/es-ES.rc trunk/reactos/dll/win32/browseui/lang/es-ES.rc trunk/reactos/dll/win32/devmgr/lang/es-ES.rc trunk/reactos/dll/win32/modemui/lang/es-ES.rc trunk/reactos/dll/win32/shell32/lang/es-ES.rc trunk/reactos/dll/win32/shimgvw/lang/es-ES.rc trunk/reactos/dll/win32/userenv/lang/es-ES.rc trunk/reactos/subsystems/mvdm/ntvdm/lang/es-ES.rc [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/base/applications/clipbrd/clipbrd.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
Added: trunk/reactos/base/applications/clipbrd/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
Modified: trunk/reactos/base/applications/cmdutils/clip/clip.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Added: trunk/reactos/base/applications/cmdutils/clip/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
Modified: trunk/reactos/base/applications/msconfig_new/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
Modified: trunk/reactos/base/applications/network/ipconfig/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
Modified: trunk/reactos/base/applications/notepad/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
Modified: trunk/reactos/base/applications/osk/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/osk/lang…
Modified: trunk/reactos/base/applications/rapps/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
Modified: trunk/reactos/base/applications/sndrec32/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
Modified: trunk/reactos/base/applications/taskmgr/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
Modified: trunk/reactos/base/applications/winhlp32/lang/Es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
Modified: trunk/reactos/base/setup/usetup/lang/es-ES.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/es-…
Modified: trunk/reactos/base/shell/cmd/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/es-ES.…
Modified: trunk/reactos/dll/cpl/input/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/es-ES.r…
Modified: trunk/reactos/dll/cpl/intl/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/es-ES.rc…
Modified: trunk/reactos/dll/cpl/usrmgr/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/lang/es-ES.…
Modified: trunk/reactos/dll/win32/browseui/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/es…
Modified: trunk/reactos/dll/win32/devmgr/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/lang/es-E…
Modified: trunk/reactos/dll/win32/modemui/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/modemui/lang/es-…
Modified: trunk/reactos/dll/win32/shell32/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/es-…
Modified: trunk/reactos/dll/win32/shimgvw/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/lang/es-…
Modified: trunk/reactos/dll/win32/userenv/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/es-…
Modified: trunk/reactos/subsystems/mvdm/ntvdm/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/lang…
9 years
1
0
0
0
[gedmurphy] 70217: [ATL] - Implement CHandle
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon Nov 30 12:07:18 2015 New Revision: 70217 URL:
http://svn.reactos.org/svn/reactos?rev=70217&view=rev
Log: [ATL] - Implement CHandle Modified: trunk/reactos/lib/atl/atlbase.h Modified: trunk/reactos/lib/atl/atlbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlbase.h?rev=7021…
============================================================================== --- trunk/reactos/lib/atl/atlbase.h [iso-8859-1] (original) +++ trunk/reactos/lib/atl/atlbase.h [iso-8859-1] Mon Nov 30 12:07:18 2015 @@ -232,6 +232,80 @@ } }; + +class CHandle +{ +public: + HANDLE m_handle; + +public: + CHandle() : + m_handle(NULL) + { + } + + CHandle(_Inout_ CHandle& handle) : + m_handle(NULL) + { + Attach(handle.Detach()); + } + + explicit CHandle(_In_ HANDLE handle) : + m_handle(handle) + { + } + + ~CHandle() + { + if (m_handle) + { + Close(); + } + } + + CHandle& operator=(_Inout_ CHandle& handle) + { + if (this != &handle) + { + if (m_handle) + { + Close(); + } + Attach(handle.Detach()); + } + + return *this; + } + + operator HANDLE() const + { + return m_handle; + } + + void Attach(_In_ HANDLE handle) + { + ATLASSERT(m_handle == NULL); + m_handle = handle; + } + + HANDLE Detach() + { + HANDLE handle = m_handle; + m_handle = NULL; + return handle; + } + + void Close() + { + if (m_handle) + { + ::CloseHandle(m_handle); + m_handle = NULL; + } + } +}; + + inline BOOL WINAPI InlineIsEqualUnknown(REFGUID rguid1) { return (
9 years
1
0
0
0
[tfaber] 70216: [FASTFAT] - Gracefully handle empty filenames found on disk, and warn about them.
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 30 11:25:14 2015 New Revision: 70216 URL:
http://svn.reactos.org/svn/reactos?rev=70216&view=rev
Log: [FASTFAT] - Gracefully handle empty filenames found on disk, and warn about them. Modified: trunk/reactos/drivers/filesystems/fastfat/create.c trunk/reactos/drivers/filesystems/fastfat/fcb.c Modified: trunk/reactos/drivers/filesystems/fastfat/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Mon Nov 30 11:25:14 2015 @@ -288,6 +288,18 @@ DirContext->DirIndex++; continue; } + if (DirContext->LongNameU.Length == 0 || + DirContext->ShortNameU.Length == 0) + { + DPRINT1("WARNING: File system corruption detected. You may need to run a disk repair utility.\n"); + if (VfatGlobalData->Flags & VFAT_BREAK_ON_CORRUPTION) + { + ASSERT(DirContext->LongNameU.Length != 0 && + DirContext->ShortNameU.Length != 0); + } + DirContext->DirIndex++; + continue; + } if (WildCard) { Found = FsRtlIsNameInExpression(&FileToFindUpcase, &DirContext->LongNameU, TRUE, NULL) || Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Mon Nov 30 11:25:14 2015 @@ -759,6 +759,18 @@ if (!ENTRY_VOLUME(pDeviceExt, &DirContext.DirEntry)) { + if (DirContext.LongNameU.Length == 0 || + DirContext.ShortNameU.Length == 0) + { + DPRINT1("WARNING: File system corruption detected. You may need to run a disk repair utility.\n"); + if (VfatGlobalData->Flags & VFAT_BREAK_ON_CORRUPTION) + { + ASSERT(DirContext.LongNameU.Length != 0 && + DirContext.ShortNameU.Length != 0); + } + DirContext.DirIndex++; + continue; + } FoundLong = RtlEqualUnicodeString(FileToFindU, &DirContext.LongNameU, TRUE); if (FoundLong == FALSE) {
9 years
1
0
0
0
[gedmurphy] 70215: [SHELL32] - Add support for canonical/string verbs when using CMINVOKECOMMANDINFO. This fixes switching views and adding a new folder when using the button in the common dialogs....
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Mon Nov 30 11:17:26 2015 New Revision: 70215 URL:
http://svn.reactos.org/svn/reactos?rev=70215&view=rev
Log: [SHELL32] - Add support for canonical/string verbs when using CMINVOKECOMMANDINFO. This fixes switching views and adding a new folder when using the button in the common dialogs. This really needs to go in a CDefFolderMenu class (which likely inherits the context menu class), but we don't use that design. - Partially implement CDefaultContextMenu::GetCommandString 'while I was there' It's completely untested though. CORE-10089 Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp trunk/reactos/dll/win32/shell32/CNewMenu.cpp trunk/reactos/dll/win32/shell32/precomp.h Modified: trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefault…
============================================================================== --- trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1] Mon Nov 30 11:17:26 2015 @@ -14,6 +14,13 @@ #include "precomp.h" +extern "C" +{ + //fixme: this isn't in wine's shlwapi header, and the definition doesnt match the + // windows headers. When wine's header and lib are fixed this can be removed. + DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen); +}; + WINE_DEFAULT_DEBUG_CHANNEL(dmenu); typedef struct _DynamicShellEntry_ @@ -31,6 +38,26 @@ LPWSTR szClass; struct _StaticShellEntry_ *pNext; } StaticShellEntry, *PStaticShellEntry; + + +// +// verbs for InvokeCommandInfo +// +struct _StaticInvokeCommandMap_ +{ + LPCSTR szStringVerb; + UINT IntVerb; +} g_StaticInvokeCmdMap[] = +{ + { "RunAs", 0 }, // Unimplemented + { "Print", 0 }, // Unimplemented + { "Preview", 0 }, // Unimplemented + { "Open", FCIDM_SHVIEW_OPEN }, + { CMDSTR_NEWFOLDERA, FCIDM_SHVIEW_NEWFOLDER }, + { CMDSTR_VIEWLISTA, FCIDM_SHVIEW_LISTVIEW }, + { CMDSTR_VIEWDETAILSA, FCIDM_SHVIEW_REPORTVIEW } +}; + class CDefaultContextMenu : public CComObjectRootEx<CComMultiThreadModelNoCS>, @@ -69,12 +96,14 @@ HRESULT DoRename(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoProperties(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoFormat(LPCMINVOKECOMMANDINFO lpcmi); + HRESULT DoCreateNewFolder(LPCMINVOKECOMMANDINFO lpici); HRESULT DoDynamicShellExtensions(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoStaticShellExtensions(LPCMINVOKECOMMANDINFO lpcmi); DWORD BrowserFlagsFromVerb(LPCMINVOKECOMMANDINFO lpcmi, PStaticShellEntry pEntry); HRESULT TryToBrowse(LPCMINVOKECOMMANDINFO lpcmi, LPCITEMIDLIST pidl, DWORD wFlags); HRESULT InvokePidl(LPCMINVOKECOMMANDINFO lpcmi, LPCITEMIDLIST pidl, PStaticShellEntry pEntry); PDynamicShellEntry GetDynamicEntry(UINT idCmd); + BOOL MapVerbToCmdId(PVOID Verb, PUINT idCmd, BOOL IsUnicode); public: CDefaultContextMenu(); @@ -1367,6 +1396,67 @@ return S_OK; } +// This code is taken from CNewMenu and should be shared between the 2 classes +HRESULT +CDefaultContextMenu::DoCreateNewFolder( + LPCMINVOKECOMMANDINFO lpici) +{ + WCHAR wszPath[MAX_PATH]; + WCHAR wszName[MAX_PATH]; + WCHAR wszNewFolder[25]; + HRESULT hr; + + /* Get folder path */ + hr = SHGetPathFromIDListW(m_pidlFolder, wszPath); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + if (!LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, _countof(wszNewFolder))) + return E_FAIL; + + /* Create the name of the new directory */ + if (!PathYetAnotherMakeUniqueName(wszName, wszPath, NULL, wszNewFolder)) + return E_FAIL; + + /* Create the new directory and show the appropriate dialog in case of error */ + if (SHCreateDirectory(lpici->hwnd, wszName) != ERROR_SUCCESS) + return E_FAIL; + + /* Show and select the new item in the def view */ + CComPtr<IShellBrowser> lpSB; + CComPtr<IShellView> lpSV; + LPITEMIDLIST pidl; + PITEMID_CHILD pidlNewItem; + + /* Notify the view object about the new item */ + SHChangeNotify(SHCNE_MKDIR, SHCNF_PATHW, (LPCVOID)wszName, NULL); + + /* FIXME: I think that this can be implemented using callbacks to the shell folder */ + + /* Note: CWM_GETISHELLBROWSER returns shell browser without adding reference */ + lpSB = (LPSHELLBROWSER)SendMessageA(lpici->hwnd, CWM_GETISHELLBROWSER, 0, 0); + if (!lpSB) + return E_FAIL; + + hr = lpSB->QueryActiveShellView(&lpSV); + if (FAILED(hr)) + return hr; + + /* Attempt to get the pidl of the new item */ + hr = SHILCreateFromPathW(wszName, &pidl, NULL); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + pidlNewItem = ILFindLastID(pidl); + + hr = lpSV->SelectItem(pidlNewItem, SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | + SVSI_FOCUSED | SVSI_SELECT); + + SHFree(pidl); + + return hr; +} + PDynamicShellEntry CDefaultContextMenu::GetDynamicEntry(UINT idCmd) { PDynamicShellEntry pEntry = m_pDynamicEntries; @@ -1381,6 +1471,42 @@ return NULL; return pEntry; +} + +//FIXME: 260 is correct, but should this be part of the SDK or just MAX_PATH? +#define MAX_VERB 260 + +BOOL +CDefaultContextMenu::MapVerbToCmdId(PVOID Verb, PUINT idCmd, BOOL IsUnicode) +{ + WCHAR UnicodeStr[MAX_VERB]; + + /* Loop through all the static verbs looking for a match */ + for (UINT i = 0; i < _countof(g_StaticInvokeCmdMap); i++) + { + /* We can match both ANSI and unicode strings */ + if (IsUnicode) + { + /* The static verbs are ANSI, get a unicode version before doing the compare */ + SHAnsiToUnicode(g_StaticInvokeCmdMap[i].szStringVerb, UnicodeStr, MAX_VERB); + if (!wcscmp(UnicodeStr, (LPWSTR)Verb)) + { + /* Return the Corresponding Id */ + *idCmd = g_StaticInvokeCmdMap[i].IntVerb; + return TRUE; + } + } + else + { + if (!strcmp(g_StaticInvokeCmdMap[i].szStringVerb, (LPSTR)Verb)) + { + *idCmd = g_StaticInvokeCmdMap[i].IntVerb; + return TRUE; + } + } + } + + return FALSE; } HRESULT @@ -1549,57 +1675,97 @@ CDefaultContextMenu::InvokeCommand( LPCMINVOKECOMMANDINFO lpcmi) { - switch(LOWORD(lpcmi->lpVerb)) - { - case FCIDM_SHVIEW_BIGICON: - case FCIDM_SHVIEW_SMALLICON: - case FCIDM_SHVIEW_LISTVIEW: - case FCIDM_SHVIEW_REPORTVIEW: - case 0x30: /* FIX IDS in resource files */ - case 0x31: - case 0x32: - case 0x33: - case FCIDM_SHVIEW_AUTOARRANGE: - case FCIDM_SHVIEW_SNAPTOGRID: - return NotifyShellViewWindow(lpcmi, FALSE); - case FCIDM_SHVIEW_REFRESH: - return DoRefresh(lpcmi); - case FCIDM_SHVIEW_INSERT: - return DoPaste(lpcmi, FALSE); - case FCIDM_SHVIEW_INSERTLINK: - return DoPaste(lpcmi, TRUE); - case FCIDM_SHVIEW_OPEN: - case FCIDM_SHVIEW_EXPLORE: - return DoOpenOrExplore(lpcmi); - case FCIDM_SHVIEW_COPY: - case FCIDM_SHVIEW_CUT: - return DoCopyOrCut(lpcmi, LOWORD(lpcmi->lpVerb) == FCIDM_SHVIEW_COPY); - case FCIDM_SHVIEW_CREATELINK: - return DoCreateLink(lpcmi); - case FCIDM_SHVIEW_DELETE: - return DoDelete(lpcmi); - case FCIDM_SHVIEW_RENAME: - return DoRename(lpcmi); - case FCIDM_SHVIEW_PROPERTIES: - return DoProperties(lpcmi); - case 0x7ABC: - return DoFormat(lpcmi); - } - - if (m_iIdSHEFirst && m_iIdSHELast) - { - if (LOWORD(lpcmi->lpVerb) >= m_iIdSHEFirst && LOWORD(lpcmi->lpVerb) <= m_iIdSHELast) - return DoDynamicShellExtensions(lpcmi); - } - - if (m_iIdSCMFirst && m_iIdSCMLast) - { - if (LOWORD(lpcmi->lpVerb) >= m_iIdSCMFirst && LOWORD(lpcmi->lpVerb) <= m_iIdSCMLast) - return DoStaticShellExtensions(lpcmi); - } - - FIXME("Unhandled Verb %xl\n", LOWORD(lpcmi->lpVerb)); - return E_UNEXPECTED; + CMINVOKECOMMANDINFO LocalInvokeInfo; + HRESULT Result; + UINT CmdId; + + /* Take a local copy of the fixed members of the + struct as we might need to modify the verb */ + LocalInvokeInfo = *lpcmi; + + /* Check if this is a string verb */ + if (HIWORD(LocalInvokeInfo.lpVerb)) + { + /* Get the ID which corresponds to this verb, and update our local copy */ + if (MapVerbToCmdId((LPVOID)LocalInvokeInfo.lpVerb, &CmdId, FALSE)) + LocalInvokeInfo.lpVerb = MAKEINTRESOURCEA(CmdId); + } + + /* Check if this is a Id */ + switch (LOWORD(LocalInvokeInfo.lpVerb)) + { + case FCIDM_SHVIEW_BIGICON: + case FCIDM_SHVIEW_SMALLICON: + case FCIDM_SHVIEW_LISTVIEW: + case FCIDM_SHVIEW_REPORTVIEW: + case 0x30: /* FIX IDS in resource files */ + case 0x31: + case 0x32: + case 0x33: + case FCIDM_SHVIEW_AUTOARRANGE: + case FCIDM_SHVIEW_SNAPTOGRID: + Result = NotifyShellViewWindow(&LocalInvokeInfo, FALSE); + break; + case FCIDM_SHVIEW_REFRESH: + Result = DoRefresh(&LocalInvokeInfo); + break; + case FCIDM_SHVIEW_INSERT: + Result = DoPaste(&LocalInvokeInfo, FALSE); + break; + case FCIDM_SHVIEW_INSERTLINK: + Result = DoPaste(&LocalInvokeInfo, TRUE); + break; + case FCIDM_SHVIEW_OPEN: + case FCIDM_SHVIEW_EXPLORE: + Result = DoOpenOrExplore(&LocalInvokeInfo); + break; + case FCIDM_SHVIEW_COPY: + case FCIDM_SHVIEW_CUT: + Result = DoCopyOrCut(&LocalInvokeInfo, LOWORD(LocalInvokeInfo.lpVerb) == FCIDM_SHVIEW_COPY); + break; + case FCIDM_SHVIEW_CREATELINK: + Result = DoCreateLink(&LocalInvokeInfo); + break; + case FCIDM_SHVIEW_DELETE: + Result = DoDelete(&LocalInvokeInfo); + break; + case FCIDM_SHVIEW_RENAME: + Result = DoRename(&LocalInvokeInfo); + break; + case FCIDM_SHVIEW_PROPERTIES: + Result = DoProperties(&LocalInvokeInfo); + break; + case 0x7ABC: + Result = DoFormat(&LocalInvokeInfo); + break; + case FCIDM_SHVIEW_NEWFOLDER: + Result = DoCreateNewFolder(&LocalInvokeInfo); + break; + default: + Result = E_UNEXPECTED; + break; + } + + /* Check for ID's we didn't find a handler for */ + if (Result == E_UNEXPECTED) + { + if (m_iIdSHEFirst && m_iIdSHELast) + { + if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdSHEFirst && LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdSHELast) + Result = DoDynamicShellExtensions(&LocalInvokeInfo); + } + + if (m_iIdSCMFirst && m_iIdSCMLast) + { + if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdSCMFirst && LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdSCMLast) + Result = DoStaticShellExtensions(&LocalInvokeInfo); + } + } + + if (Result == E_UNEXPECTED) + FIXME("Unhandled Verb %xl\n", LOWORD(LocalInvokeInfo.lpVerb)); + + return Result; } HRESULT @@ -1611,7 +1777,36 @@ LPSTR lpszName, UINT uMaxNameLen) { - return S_OK; + /* We don't handle the help text yet */ + if (uFlags == GCS_HELPTEXTA || + uFlags == GCS_HELPTEXTW) + { + return E_NOTIMPL; + } + + /* Loop looking for a matching Id */ + for (UINT i = 0; i < _countof(g_StaticInvokeCmdMap); i++) + { + if (g_StaticInvokeCmdMap[i].IntVerb == idCommand) + { + /* Validation just returns S_OK on a match */ + if (uFlags == GCS_VALIDATEA || uFlags == GCS_VALIDATEA) + return S_OK; + + /* Return a copy of the ANSI verb */ + if (uFlags == GCS_VERBA) + return StringCchCopyA(lpszName, uMaxNameLen, g_StaticInvokeCmdMap[i].szStringVerb); + + /* Convert the ANSI verb to unicode and return that */ + if (uFlags == GCS_VERBW) + { + if (SHAnsiToUnicode(g_StaticInvokeCmdMap[i].szStringVerb, (LPWSTR)lpszName, uMaxNameLen)) + return S_OK; + } + } + } + + return E_INVALIDARG; } HRESULT Modified: trunk/reactos/dll/win32/shell32/CNewMenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CNewMenu…
============================================================================== --- trunk/reactos/dll/win32/shell32/CNewMenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CNewMenu.cpp [iso-8859-1] Mon Nov 30 11:17:26 2015 @@ -337,6 +337,7 @@ return hr; } +// Code is duplicated in CDefaultContextMenu HRESULT CNewMenu::CreateNewFolder(LPCMINVOKECOMMANDINFO lpici) { WCHAR wszPath[MAX_PATH]; Modified: trunk/reactos/dll/win32/shell32/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/precomp.…
============================================================================== --- trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] Mon Nov 30 11:17:26 2015 @@ -19,6 +19,7 @@ #include <ddeml.h> #include <shlwapi.h> #include <shlobj.h> +#include <shobjidl.h> #include <recyclebin.h> #include <ndk/rtlfuncs.h> #include <fmifs/fmifs.h>
9 years
1
0
0
0
← Newer
1
2
3
4
...
46
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
Results per page:
10
25
50
100
200