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
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
June 2008
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
435 discussions
Start a n
N
ew thread
[pschweitzer] 34136: Activated ext2 use in usetup. That allows formatting and installing with ext2. It doesn't work right now.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri Jun 27 12:39:33 2008 New Revision: 34136 URL:
http://svn.reactos.org/svn/reactos?rev=34136&view=rev
Log: Activated ext2 use in usetup. That allows formatting and installing with ext2. It doesn't work right now. Modified: branches/pierre-fsd/base/setup/usetup/native/fslist.c Modified: branches/pierre-fsd/base/setup/usetup/native/fslist.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/base/setup/usetup/na…
============================================================================== --- branches/pierre-fsd/base/setup/usetup/native/fslist.c [iso-8859-1] (original) +++ branches/pierre-fsd/base/setup/usetup/native/fslist.c [iso-8859-1] Fri Jun 27 12:39:33 2008 @@ -10,7 +10,7 @@ IN PFILE_SYSTEM_LIST List) { FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk); - //FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk); + FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk); return TRUE; }
16 years, 4 months
1
0
0
0
[dchapyshev] 34135: - Add fontext.dll
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Fri Jun 27 12:34:08 2008 New Revision: 34135 URL:
http://svn.reactos.org/svn/reactos?rev=34135&view=rev
Log: - Add fontext.dll Added: trunk/reactos/dll/shellext/fontext/ trunk/reactos/dll/shellext/fontext/fontext.c (with props) trunk/reactos/dll/shellext/fontext/fontext.def (with props) trunk/reactos/dll/shellext/fontext/fontext.h (with props) trunk/reactos/dll/shellext/fontext/fontext.rbuild (with props) trunk/reactos/dll/shellext/fontext/fontext.rc (with props) trunk/reactos/dll/shellext/fontext/lang/ trunk/reactos/dll/shellext/fontext/lang/en-US.rc (with props) trunk/reactos/dll/shellext/fontext/regsvr.c (with props) trunk/reactos/dll/shellext/fontext/resource.h (with props) trunk/reactos/dll/shellext/fontext/rsrc.rc (with props) Modified: trunk/reactos/dll/shellext/shellext.rbuild Added: trunk/reactos/dll/shellext/fontext/fontext.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/fonte…
============================================================================== --- trunk/reactos/dll/shellext/fontext/fontext.c (added) +++ trunk/reactos/dll/shellext/fontext/fontext.c [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,45 @@ +/* + * + * PROJECT: fontext.dll + * FILE: dll/shellext/fontext/fontext.c + * PURPOSE: fontext.dll + * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) + * UPDATE HISTORY: + * 10-06-2008 Created + */ + +#include "fontext.h" + +static HINSTANCE hInstance; + +HRESULT WINAPI +DllCanUnloadNow(VOID) +{ + DPRINT1("DllCanUnloadNow() stubs\n"); + return S_OK; +} + +HRESULT WINAPI +DllGetClassObject(REFCLSID rclsid, + REFIID riid, + LPVOID *ppv) +{ + DPRINT1("DllGetClassObject() stubs\n"); + return S_OK; +} + +BOOL STDCALL +DllMain(HINSTANCE hinstDLL, + DWORD dwReason, + LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + hInstance = hinstDLL; + DisableThreadLibraryCalls(hInstance); + break; + } + + return TRUE; +} Propchange: trunk/reactos/dll/shellext/fontext/fontext.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/fontext.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/fonte…
============================================================================== --- trunk/reactos/dll/shellext/fontext/fontext.def (added) +++ trunk/reactos/dll/shellext/fontext/fontext.def [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,6 @@ +LIBRARY fontext.dll +EXPORTS +DllCanUnloadNow +DllGetClassObject +DllRegisterServer +DllUnregisterServer Propchange: trunk/reactos/dll/shellext/fontext/fontext.def ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/fontext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/fonte…
============================================================================== --- trunk/reactos/dll/shellext/fontext/fontext.h (added) +++ trunk/reactos/dll/shellext/fontext/fontext.h [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,12 @@ +#ifndef __FONTEXT__H +#define __FONTEXT__H + +#define COBJMACROS +#include <windows.h> +#include <tchar.h> +#include <stdio.h> +#include <shlobj.h> + +#include <debug.h> + +#endif /* __FONTEXT__H */ Propchange: trunk/reactos/dll/shellext/fontext/fontext.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/fontext.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/fonte…
============================================================================== --- trunk/reactos/dll/shellext/fontext/fontext.rbuild (added) +++ trunk/reactos/dll/shellext/fontext/fontext.rbuild [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,21 @@ +<module name="fontext" type="win32dll" baseaddress="${BASEADDRESS_FONTEXT}" installbase="system32" installname="fontext.dll" unicode="yes"> + <importlibrary definition="fontext.def" /> + <include base="fontext">.</include> + <define name="_WIN32_IE">0x0500</define> + <define name="_WIN32_WINNT">0x0600</define> + <define name="WINVER">0x0600</define> + <library>ntdll</library> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <library>ole32</library> + <library>uuid</library> + <library>msvcrt</library> + <library>shlwapi</library> + <library>lz32</library> + <library>advapi32</library> + <library>setupapi</library> + <file>fontext.c</file> + <file>regsvr.c</file> + <file>fontext.rc</file> +</module> Propchange: trunk/reactos/dll/shellext/fontext/fontext.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/fontext.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/fonte…
============================================================================== --- trunk/reactos/dll/shellext/fontext/fontext.rc (added) +++ trunk/reactos/dll/shellext/fontext/fontext.rc [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,10 @@ +#include <windows.h> +#include "resource.h" + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Font Folder\0" +#define REACTOS_STR_INTERNAL_NAME "fontext\0" +#define REACTOS_STR_ORIGINAL_FILENAME "fontext.dll\0" +#include <reactos/version.rc> + +#include "rsrc.rc" Propchange: trunk/reactos/dll/shellext/fontext/fontext.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/lang/…
============================================================================== --- trunk/reactos/dll/shellext/fontext/lang/en-US.rc (added) +++ trunk/reactos/dll/shellext/fontext/lang/en-US.rc [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,9 @@ +// Don't translate this file at current time + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +STRINGTABLE +BEGIN + IDS_REACTOS_FONTS_FOLDER "ReactOS Font Folder" +END + Propchange: trunk/reactos/dll/shellext/fontext/lang/en-US.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/regsv…
============================================================================== --- trunk/reactos/dll/shellext/fontext/regsvr.c (added) +++ trunk/reactos/dll/shellext/fontext/regsvr.c [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,38 @@ +/* + * + * PROJECT: fontext.dll + * FILE: dll/shellext/fontext/regsvr.c + * PURPOSE: fontext.dll + * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) + * UPDATE HISTORY: + * 10-06-2008 Created + */ + +#include <windows.h> +#include <ole2.h> + +#include <fontext.h> + +static HRESULT +REGSVR_RegisterServer() +{ + return S_OK; +} + +static HRESULT +REGSVR_UnregisterServer() +{ + return S_OK; +} + +HRESULT WINAPI +DllRegisterServer(VOID) +{ + return REGSVR_RegisterServer(); +} + +HRESULT WINAPI +DllUnregisterServer(VOID) +{ + return REGSVR_UnregisterServer(); +} Propchange: trunk/reactos/dll/shellext/fontext/regsvr.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/resou…
============================================================================== --- trunk/reactos/dll/shellext/fontext/resource.h (added) +++ trunk/reactos/dll/shellext/fontext/resource.h [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,6 @@ +#ifndef __RESOURCE__H +#define __RESOURCE__H + +#define IDS_REACTOS_FONTS_FOLDER 151 + +#endif /* __RESOURCE__H */ Propchange: trunk/reactos/dll/shellext/fontext/resource.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/shellext/fontext/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/fontext/rsrc.…
============================================================================== --- trunk/reactos/dll/shellext/fontext/rsrc.rc (added) +++ trunk/reactos/dll/shellext/fontext/rsrc.rc [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -1,0 +1,4 @@ +#include <windows.h> +#include "resource.h" + +#include "lang/en-US.rc" Propchange: trunk/reactos/dll/shellext/fontext/rsrc.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/shellext/shellext.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/shellext.rbui…
============================================================================== --- trunk/reactos/dll/shellext/shellext.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/shellext.rbuild [iso-8859-1] Fri Jun 27 12:34:08 2008 @@ -10,6 +10,9 @@ <directory name="devcpux"> <xi:include href="devcpux/devcpux.rbuild" /> </directory> + <directory name="fontext"> + <xi:include href="fontext/fontext.rbuild" /> + </directory> <directory name="slayer"> <xi:include href="slayer/slayer.rbuild" /> </directory>
16 years, 4 months
1
0
0
0
[fireball] 34134: - NDK fix: ImageUsesLargePages in PEB appeared in Windows 2003 already (confirmed with SP1 though).
by fireball@svn.reactos.org
Author: fireball Date: Fri Jun 27 12:26:10 2008 New Revision: 34134 URL:
http://svn.reactos.org/svn/reactos?rev=34134&view=rev
Log: - NDK fix: ImageUsesLargePages in PEB appeared in Windows 2003 already (confirmed with SP1 though). Modified: trunk/reactos/include/ndk/pstypes.h Modified: trunk/reactos/include/ndk/pstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/pstypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/pstypes.h [iso-8859-1] Fri Jun 27 12:26:10 2008 @@ -575,13 +575,17 @@ UCHAR InheritedAddressSpace; UCHAR ReadImageFileExecOptions; UCHAR BeingDebugged; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) +#if (NTDDI_VERSION >= NTDDI_WS03) struct { UCHAR ImageUsesLargePages:1; + #if (NTDDI_VERSION >= NTDDI_LONGHORN) UCHAR IsProtectedProcess:1; UCHAR IsLegacyProcess:1; UCHAR SpareBits:5; + #else + UCHAR SpareBits:7; + #endif }; #else BOOLEAN SpareBool;
16 years, 4 months
1
0
0
0
[janderwald] 34133: - display default icon in file property dialog
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jun 27 12:23:24 2008 New Revision: 34133 URL:
http://svn.reactos.org/svn/reactos?rev=34133&view=rev
Log: - display default icon in file property dialog Modified: trunk/reactos/dll/win32/shell32/fprop.c Modified: trunk/reactos/dll/win32/shell32/fprop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/fprop.c?…
============================================================================== --- trunk/reactos/dll/win32/shell32/fprop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/fprop.c [iso-8859-1] Fri Jun 27 12:23:24 2008 @@ -152,6 +152,49 @@ { lvalue = lname = MAX_PATH; result = RegEnumValueW(hKey,0, name, &lname, NULL, NULL, (LPBYTE)value, &lvalue); + } + lname = MAX_PATH; + if (RegGetValueW(hKey, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, name, &lname) == ERROR_SUCCESS) + { + UINT IconIndex; + WCHAR szBuffer[MAX_PATH]; + WCHAR * Offset; + HICON hIcon = 0; + HRSRC hResource; + LPVOID pResource = NULL; + HGLOBAL hGlobal; + HANDLE hLibrary; + + Offset = wcsrchr(name, L','); + if (Offset) + { + IconIndex = _wtoi(Offset + 2); + *Offset = L'\0'; + if (ExpandEnvironmentStringsW(name, szBuffer, MAX_PATH)) + { + szBuffer[MAX_PATH] = L'\0'; + hLibrary = LoadLibraryExW(szBuffer, NULL, LOAD_LIBRARY_AS_DATAFILE); + if (hLibrary) + { + hResource = FindResourceW(hLibrary, MAKEINTRESOURCEW(IconIndex), (LPCWSTR)RT_ICON); + if (hResource) + { + hGlobal = LoadResource(shell32_hInstance, hResource); + if (hGlobal) + { + pResource = LockResource(hGlobal); + if (pResource != NULL) + { + hIcon = CreateIconFromResource(pResource, SizeofResource(shell32_hInstance, hResource), TRUE, 0x00030000); + TRACE("hIcon %p,- szBuffer %s IconIndex %u error %u icon %p hResource %p pResource %p\n", hIcon, debugstr_w(szBuffer), IconIndex, MAKEINTRESOURCEW(IconIndex), hResource, pResource); + SendDlgItemMessageW(hwndDlg, 14000, STM_SETICON, (WPARAM)hIcon, 0); + } + } + } + FreeLibrary(hLibrary); + } + } + } } RegCloseKey(hKey); }
16 years, 4 months
1
0
0
0
[dchapyshev] 34132: - Add inetmib1 to bootcd - Add some defines to snmp.h
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Fri Jun 27 12:12:18 2008 New Revision: 34132 URL:
http://svn.reactos.org/svn/reactos?rev=34132&view=rev
Log: - Add inetmib1 to bootcd - Add some defines to snmp.h Modified: trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/include/psdk/snmp.h Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Fri Jun 27 12:12:18 2008 @@ -254,6 +254,7 @@ dll\win32\imagehlp\imagehlp.dll 1 dll\win32\imm32\imm32.dll 1 dll\win32\inetcomm\inetcomm.dll 1 +dll\win32\inetmib1\inetmib1.dll 1 dll\win32\iphlpapi\iphlpapi.dll 1 dll\win32\kernel32\kernel32.dll 1 dll\win32\lsasrv\lsasrv.dll 1 Modified: trunk/reactos/include/psdk/snmp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/snmp.h?rev=34…
============================================================================== --- trunk/reactos/include/psdk/snmp.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/snmp.h [iso-8859-1] Fri Jun 27 12:12:18 2008 @@ -135,6 +135,11 @@ #define SNMP_AUTHAPI_INVALID_MSG_TYPE 31 #define SNMP_AUTHAPI_TRIV_AUTH_FAILED 32 +#define DEFINE_SIZEOF(x) (sizeof(x)/sizeof((x)[0])) +#define DEFINE_OID(x) { DEFINE_SIZEOF(x),(x) } +#define DEFINE_NULLOID() { 0, NULL } +#define DEFINE_NULLOCTENTS() { NULL, 0, FALSE } + #ifndef RC_INVOKED typedef INT SNMPAPI;
16 years, 4 months
1
0
0
0
[dchapyshev] 34131: - Add baseaddress for inetmib1 and fontext.dll - Add information about inetmib1 to README.WINE
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Fri Jun 27 12:10:18 2008 New Revision: 34131 URL:
http://svn.reactos.org/svn/reactos?rev=34131&view=rev
Log: - Add baseaddress for inetmib1 and fontext.dll - Add information about inetmib1 to README.WINE Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=341…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Fri Jun 27 12:10:18 2008 @@ -41,6 +41,7 @@ <property name="BASEADDRESS_APPWIZ" value="0x65100000" /> <property name="BASEADDRESS_MLANG" value="0x65140000" /> <property name="BASEADDRESS_ACCESS" value="0x65180000" /> + <property name="BASEADDRESS_INETMIB1" value="0x666f0000" /> <property name="BASEADDRESS_WSHTCPIP" value="0x677b0000" /> <property name="BASEADDRESS_CRYPT32" value="0x67ab0000" /> <property name="BASEADDRESS_HID" value="0x688f0000" /> @@ -75,6 +76,7 @@ <property name="BASEADDRESS_SCHANNEL" value="0x6e360000" /> <property name="BASEADDRESS_COMPSTUI" value="0x6ec10000" /> <property name="BASEADDRESS_CLB" value="0x6f2b0000" /> + <property name="BASEADDRESS_FONTEXT" value="0x6f7b0000" /> <property name="BASEADDRESS_CARDS" value="0x701a0000" /> <property name="BASEADDRESS_WININET" value="0x70200000" /> <property name="BASEADDRESS_WINHTTP" value="0x70c60000" /> Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Jun 27 12:10:18 2008 @@ -52,6 +52,7 @@ reactos/dll/win32/imm32 # Autosync reactos/dll/win32/imagehlp # Patches for BindImage need review and submission to winehq. reactos/dll/win32/inetcomm # Autosync +reactos/dll/win32/inetmib1 # Autosync reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/lz32 # Autosync reactos/dll/win32/mapi32 # Autosync
16 years, 4 months
1
0
0
0
[dchapyshev] 34130: - Add inetmib1.dll from Wine - Small update snmpapi.def
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Fri Jun 27 12:08:01 2008 New Revision: 34130 URL:
http://svn.reactos.org/svn/reactos?rev=34130&view=rev
Log: - Add inetmib1.dll from Wine - Small update snmpapi.def Added: trunk/reactos/dll/win32/inetmib1/ trunk/reactos/dll/win32/inetmib1/inetmib1.rbuild (with props) trunk/reactos/dll/win32/inetmib1/inetmib1.spec (with props) trunk/reactos/dll/win32/inetmib1/main.c (with props) Modified: trunk/reactos/dll/win32/snmpapi/snmpapi.def trunk/reactos/dll/win32/win32.rbuild Added: trunk/reactos/dll/win32/inetmib1/inetmib1.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetmib1/inetmib…
============================================================================== --- trunk/reactos/dll/win32/inetmib1/inetmib1.rbuild (added) +++ trunk/reactos/dll/win32/inetmib1/inetmib1.rbuild [iso-8859-1] Fri Jun 27 12:08:01 2008 @@ -1,0 +1,17 @@ +<module name="inetmib1" type="win32dll" baseaddress="${BASEADDRESS_INETMIB1}" installbase="system32" installname="inetmib1.dll" allowwarnings="true" entrypoint="0"> + <importlibrary definition="inetmib1.spec.def" /> + <include base="inetmib1">.</include> + <include base="ReactOS">include/reactos/wine</include> + <define name="__WINESRC__" /> + <define name="__USE_W32API" /> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <define name="WINVER">0x501</define> + <library>wine</library> + <library>snmpapi</library> + <library>kernel32</library> + <library>iphlpapi</library> + <library>ntdll</library> + <file>main.c</file> + <file>inetmib1.spec</file> +</module> Propchange: trunk/reactos/dll/win32/inetmib1/inetmib1.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/inetmib1/inetmib1.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetmib1/inetmib…
============================================================================== --- trunk/reactos/dll/win32/inetmib1/inetmib1.spec (added) +++ trunk/reactos/dll/win32/inetmib1/inetmib1.spec [iso-8859-1] Fri Jun 27 12:08:01 2008 @@ -1,0 +1,4 @@ +@ stdcall SnmpExtensionInit(long ptr ptr) +@ stub SnmpExtensionInitEx +@ stdcall SnmpExtensionQuery(long ptr ptr ptr) +@ stub SnmpExtensionTrap Propchange: trunk/reactos/dll/win32/inetmib1/inetmib1.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: 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 (added) +++ trunk/reactos/dll/win32/inetmib1/main.c [iso-8859-1] Fri Jun 27 12:08:01 2008 @@ -1,0 +1,1171 @@ +/* + * Copyright 2008 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 + */ + +#include "config.h" +#include <assert.h> +#include <stdarg.h> +#include <stdlib.h> +#include <limits.h> +#include "windef.h" +#include "winbase.h" +#include "snmp.h" +#include "iphlpapi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(inetmib1); + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + + switch (fdwReason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + case DLL_PROCESS_DETACH: + break; + default: + break; + } + + return TRUE; +} + +/** + * Utility functions + */ +static void copyInt(AsnAny *value, void *src) +{ + value->asnType = ASN_INTEGER; + value->asnValue.number = *(DWORD *)src; +} + +static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str) +{ + AsnAny strValue; + + strValue.asnType = type; + strValue.asnValue.string.stream = str; + strValue.asnValue.string.length = len; + strValue.asnValue.string.dynamic = TRUE; + SnmpUtilAsnAnyCpy(value, &strValue); +} + +static void copyLengthPrecededString(AsnAny *value, void *src) +{ + DWORD len = *(DWORD *)src; + + setStringValue(value, ASN_OCTETSTRING, len, (BYTE *)src + sizeof(DWORD)); +} + +typedef void (*copyValueFunc)(AsnAny *value, void *src); + +struct structToAsnValue +{ + size_t offset; + copyValueFunc copy; +}; + +static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, + UINT mapLen, void *record, UINT id, BYTE bPduType, SnmpVarBind *pVarBind) +{ + /* OIDs are 1-based */ + if (!id) + return SNMP_ERRORSTATUS_NOSUCHNAME; + --id; + if (id >= mapLen) + return SNMP_ERRORSTATUS_NOSUCHNAME; + if (!map[id].copy) + return SNMP_ERRORSTATUS_NOSUCHNAME; + map[id].copy(&pVarBind->value, (BYTE *)record + map[id].offset); + return SNMP_ERRORSTATUS_NOERROR; +} + +static void copyIpAddr(AsnAny *value, void *src) +{ + setStringValue(value, ASN_IPADDRESS, sizeof(DWORD), src); +} + +static UINT mib2[] = { 1,3,6,1,2,1 }; +static UINT mib2System[] = { 1,3,6,1,2,1,1 }; + +typedef BOOL (*varqueryfunc)(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus); + +struct mibImplementation +{ + AsnObjectIdentifier name; + void (*init)(void); + varqueryfunc query; +}; + +static UINT mib2IfNumber[] = { 1,3,6,1,2,1,2,1 }; +static PMIB_IFTABLE ifTable; + +static void mib2IfNumberInit(void) +{ + DWORD size = 0, ret = GetIfTable(NULL, &size, FALSE); + + if (ret == ERROR_INSUFFICIENT_BUFFER) + { + ifTable = HeapAlloc(GetProcessHeap(), 0, size); + if (ifTable) + GetIfTable(ifTable, &size, FALSE); + } +} + +static BOOL mib2IfNumberQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier numberOid = DEFINE_OID(mib2IfNumber); + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + if ((bPduType == SNMP_PDU_GET && + !SnmpUtilOidNCmp(&pVarBind->name, &numberOid, numberOid.idLength)) + || SnmpUtilOidNCmp(&pVarBind->name, &numberOid, numberOid.idLength) + < 0) + { + DWORD numIfs = ifTable ? ifTable->dwNumEntries : 0; + + copyInt(&pVarBind->value, &numIfs); + if (bPduType == SNMP_PDU_GETNEXT) + SnmpUtilOidCpy(&pVarBind->name, &numberOid); + *pErrorStatus = SNMP_ERRORSTATUS_NOERROR; + } + else + { + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + /* Caller deals with OID if bPduType == SNMP_PDU_GETNEXT, so don't + * need to set it here. + */ + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static void copyOperStatus(AsnAny *value, void *src) +{ + value->asnType = ASN_INTEGER; + /* The IPHlpApi definition of operational status differs from the MIB2 one, + * so map it to the MIB2 value. + */ + switch (*(DWORD *)src) + { + case MIB_IF_OPER_STATUS_OPERATIONAL: + value->asnValue.number = MIB_IF_ADMIN_STATUS_UP; + break; + case MIB_IF_OPER_STATUS_CONNECTING: + case MIB_IF_OPER_STATUS_CONNECTED: + value->asnValue.number = MIB_IF_ADMIN_STATUS_TESTING; + break; + default: + value->asnValue.number = MIB_IF_ADMIN_STATUS_DOWN; + }; +} + +/* Given an OID and a base OID that it must begin with, finds the item and + * integer instance from the OID. E.g., given an OID foo.1.2 and a base OID + * foo, returns item 1 and instance 2. + * If bPduType is not SNMP_PDU_GETNEXT and either the item or instance is + * missing, returns SNMP_ERRORSTATUS_NOSUCHNAME. + * If bPduType is SNMP_PDU_GETNEXT, returns the successor to the item and + * instance, or item 1, instance 1 if either is missing. + */ +static AsnInteger32 getItemAndIntegerInstanceFromOid(AsnObjectIdentifier *oid, + AsnObjectIdentifier *base, BYTE bPduType, UINT *item, UINT *instance) +{ + AsnInteger32 ret = SNMP_ERRORSTATUS_NOERROR; + + switch (bPduType) + { + case SNMP_PDU_GETNEXT: + if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0) + { + *item = 1; + *instance = 1; + } + else if (!SnmpUtilOidNCmp(oid, base, base->idLength)) + { + if (oid->idLength == base->idLength || + oid->idLength == base->idLength + 1) + { + /* Either the table or an item within the table is specified, + * but the instance is not. Get the first instance. + */ + *instance = 1; + if (oid->idLength == base->idLength + 1) + *item = oid->ids[base->idLength]; + else + *item = 1; + } + else + { + *item = oid->ids[base->idLength]; + *instance = oid->ids[base->idLength + 1] + 1; + } + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + break; + default: + if (!SnmpUtilOidNCmp(oid, base, base->idLength)) + { + if (oid->idLength == base->idLength || + oid->idLength == base->idLength + 1) + { + /* Either the table or an item within the table is specified, + * but the instance is not. + */ + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + else + { + *item = oid->ids[base->idLength]; + *instance = oid->ids[base->idLength + 1]; + } + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return ret; +} + +/* Given an OID and a base OID that it must begin with, finds the item from the + * OID. E.g., given an OID foo.1 and a base OID foo, returns item 1. + * If bPduType is not SNMP_PDU_GETNEXT and the item is missing, returns + * SNMP_ERRORSTATUS_NOSUCHNAME. + * If bPduType is SNMP_PDU_GETNEXT, returns the successor to the item, or item + * 1 if the item is missing. + */ +static AsnInteger32 getItemFromOid(AsnObjectIdentifier *oid, + AsnObjectIdentifier *base, BYTE bPduType, UINT *item) +{ + AsnInteger32 ret = SNMP_ERRORSTATUS_NOERROR; + + switch (bPduType) + { + case SNMP_PDU_GETNEXT: + if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0) + *item = 1; + else if (!SnmpUtilOidNCmp(oid, base, base->idLength)) + { + if (oid->idLength == base->idLength) + { + /* The item is missing, assume the first item */ + *item = 1; + } + else + *item = oid->ids[base->idLength] + 1; + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + break; + default: + if (!SnmpUtilOidNCmp(oid, base, base->idLength)) + { + if (oid->idLength == base->idLength) + { + /* The item is missing */ + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + else + { + *item = oid->ids[base->idLength]; + if (!*item) + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return ret; +} + +struct GenericTable +{ + DWORD numEntries; + BYTE entries[1]; +}; + +static DWORD oidToIpAddr(AsnObjectIdentifier *oid) +{ + assert(oid && oid->idLength >= 4); + /* Map the IDs to an IP address in little-endian order */ + return (BYTE)oid->ids[3] << 24 | (BYTE)oid->ids[2] << 16 | + (BYTE)oid->ids[1] << 8 | (BYTE)oid->ids[0]; +} + +typedef void (*oidToKeyFunc)(AsnObjectIdentifier *oid, void *dst); +typedef int (*compareFunc)(const void *key, const void *value); + +static UINT findValueInTable(AsnObjectIdentifier *oid, + struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, + compareFunc compare) +{ + UINT index = 0; + void *key = HeapAlloc(GetProcessHeap(), 0, tableEntrySize); + + if (key) + { + void *value; + + makeKey(oid, key); + value = bsearch(key, table->entries, table->numEntries, tableEntrySize, + compare); + if (value) + index = ((BYTE *)value - (BYTE *)table->entries) / tableEntrySize + + 1; + HeapFree(GetProcessHeap(), 0, key); + } + return index; +} + +/* Given an OID and a base OID that it must begin with, finds the item and + * element of the table whose IP address matches the instance from the OID. + * E.g., given an OID foo.1.2.3.4.5 and a base OID foo, returns item 1 and the + * index of the entry in the table whose IP address is 2.3.4.5. + * If bPduType is not SNMP_PDU_GETNEXT and either the item or instance is + * missing, returns SNMP_ERRORSTATUS_NOSUCHNAME. + * If bPduType is SNMP_PDU_GETNEXT, returns the successor to the item and + * instance, or item 1, instance 1 if either is missing. + */ +static AsnInteger32 getItemAndIpAddressInstanceFromOid(AsnObjectIdentifier *oid, + AsnObjectIdentifier *base, BYTE bPduType, struct GenericTable *table, + size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare, + UINT *item, UINT *instance) +{ + AsnInteger32 ret = SNMP_ERRORSTATUS_NOERROR; + + if (!table) + return SNMP_ERRORSTATUS_NOSUCHNAME; + + switch (bPduType) + { + case SNMP_PDU_GETNEXT: + if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0) + { + /* Return the first item and instance from the table */ + *item = 1; + *instance = 1; + } + else if (!SnmpUtilOidNCmp(oid, base, base->idLength) && + oid->idLength < base->idLength + 5) + { + /* Either the table or an item is specified, but the instance is + * not. + */ + *instance = 1; + if (oid->idLength >= base->idLength + 1) + { + *item = oid->ids[base->idLength]; + if (!*item) + *item = 1; + } + else + *item = 1; + } + else if (!SnmpUtilOidNCmp(oid, base, base->idLength) && + oid->idLength == base->idLength + 5) + { + *item = oid->ids[base->idLength]; + if (!*item) + { + *instance = 1; + *item = 1; + } + else + { + AsnObjectIdentifier ipOid = { 4, oid->ids + base->idLength + 1 + }; + + *instance = findValueInTable(&ipOid, table, tableEntrySize, + makeKey, compare) + 1; + if (*instance > table->numEntries) + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + break; + default: + if (!SnmpUtilOidNCmp(oid, base, base->idLength) && + oid->idLength == base->idLength + 5) + { + *item = oid->ids[base->idLength]; + if (!*item) + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + else + { + AsnObjectIdentifier ipOid = { 4, oid->ids + base->idLength + 1 + }; + + *instance = findValueInTable(&ipOid, table, tableEntrySize, + makeKey, compare); + if (!*instance) + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return ret; +} + +static void setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, + UINT item) +{ + UINT id; + AsnObjectIdentifier oid; + + SnmpUtilOidCpy(dst, base); + oid.idLength = 1; + oid.ids = &id; + id = item; + SnmpUtilOidAppend(dst, &oid); +} + +static void setOidWithItemAndIpAddr(AsnObjectIdentifier *dst, + AsnObjectIdentifier *base, UINT item, DWORD addr) +{ + UINT id; + BYTE *ptr; + AsnObjectIdentifier oid; + + setOidWithItem(dst, base, item); + oid.idLength = 1; + oid.ids = &id; + for (ptr = (BYTE *)&addr; ptr < (BYTE *)&addr + sizeof(DWORD); ptr++) + { + id = *ptr; + SnmpUtilOidAppend(dst, &oid); + } +} + +static void setOidWithItemAndInteger(AsnObjectIdentifier *dst, + AsnObjectIdentifier *base, UINT item, UINT instance) +{ + AsnObjectIdentifier oid; + + setOidWithItem(dst, base, item); + oid.idLength = 1; + oid.ids = &instance; + SnmpUtilOidAppend(dst, &oid); +} + +static struct structToAsnValue mib2IfEntryMap[] = { + { FIELD_OFFSET(MIB_IFROW, dwIndex), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyLengthPrecededString }, + { FIELD_OFFSET(MIB_IFROW, dwType), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwMtu), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen), copyLengthPrecededString }, + { FIELD_OFFSET(MIB_IFROW, dwAdminStatus), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwOperStatus), copyOperStatus }, + { FIELD_OFFSET(MIB_IFROW, dwLastChange), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwInOctets), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwInUcastPkts), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwInNUcastPkts), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwInDiscards), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwInErrors), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwInUnknownProtos), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwOutOctets), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwOutUcastPkts), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwOutNUcastPkts), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwOutDiscards), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwOutErrors), copyInt }, + { FIELD_OFFSET(MIB_IFROW, dwOutQLen), copyInt }, +}; + +static UINT mib2IfEntry[] = { 1,3,6,1,2,1,2,2,1 }; + +static BOOL mib2IfEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier entryOid = DEFINE_OID(mib2IfEntry); + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + if (!ifTable) + { + /* There is no interface present, so let the caller deal + * with finding the successor. + */ + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + else + { + UINT tableIndex = 0, item = 0; + + *pErrorStatus = getItemAndIntegerInstanceFromOid(&pVarBind->name, + &entryOid, bPduType, &item, &tableIndex); + if (!*pErrorStatus) + { + assert(tableIndex); + assert(item); + if (tableIndex > ifTable->dwNumEntries) + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + else + { + *pErrorStatus = mapStructEntryToValue(mib2IfEntryMap, + DEFINE_SIZEOF(mib2IfEntryMap), + &ifTable->table[tableIndex - 1], item, bPduType, + pVarBind); + if (bPduType == SNMP_PDU_GETNEXT) + setOidWithItemAndInteger(&pVarBind->name, &entryOid, + item, tableIndex); + } + } + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static UINT mib2Ip[] = { 1,3,6,1,2,1,4 }; +static MIB_IPSTATS ipStats; + +static void mib2IpStatsInit(void) +{ + GetIpStatistics(&ipStats); +} + +static struct structToAsnValue mib2IpMap[] = { + { FIELD_OFFSET(MIB_IPSTATS, dwForwarding), copyInt }, /* 1 */ + { FIELD_OFFSET(MIB_IPSTATS, dwDefaultTTL), copyInt }, /* 2 */ + { FIELD_OFFSET(MIB_IPSTATS, dwInReceives), copyInt }, /* 3 */ + { FIELD_OFFSET(MIB_IPSTATS, dwInHdrErrors), copyInt }, /* 4 */ + { FIELD_OFFSET(MIB_IPSTATS, dwInAddrErrors), copyInt }, /* 5 */ + { FIELD_OFFSET(MIB_IPSTATS, dwForwDatagrams), copyInt }, /* 6 */ + { FIELD_OFFSET(MIB_IPSTATS, dwInUnknownProtos), copyInt }, /* 7 */ + { FIELD_OFFSET(MIB_IPSTATS, dwInDiscards), copyInt }, /* 8 */ + { FIELD_OFFSET(MIB_IPSTATS, dwInDelivers), copyInt }, /* 9 */ + { FIELD_OFFSET(MIB_IPSTATS, dwOutRequests), copyInt }, /* 10 */ + { FIELD_OFFSET(MIB_IPSTATS, dwOutDiscards), copyInt }, /* 11 */ + { FIELD_OFFSET(MIB_IPSTATS, dwOutNoRoutes), copyInt }, /* 12 */ + { FIELD_OFFSET(MIB_IPSTATS, dwReasmTimeout), copyInt }, /* 13 */ + { FIELD_OFFSET(MIB_IPSTATS, dwReasmReqds), copyInt }, /* 14 */ + { FIELD_OFFSET(MIB_IPSTATS, dwReasmOks), copyInt }, /* 15 */ + { FIELD_OFFSET(MIB_IPSTATS, dwReasmFails), copyInt }, /* 16 */ + { FIELD_OFFSET(MIB_IPSTATS, dwFragOks), copyInt }, /* 17 */ + { FIELD_OFFSET(MIB_IPSTATS, dwFragFails), copyInt }, /* 18 */ + { FIELD_OFFSET(MIB_IPSTATS, dwFragCreates), copyInt }, /* 19 */ + { 0, NULL }, /* 20: not used, IP addr table */ + { 0, NULL }, /* 21: not used, route table */ + { 0, NULL }, /* 22: not used, net to media (ARP) table */ + { FIELD_OFFSET(MIB_IPSTATS, dwRoutingDiscards), copyInt }, /* 23 */ +}; + +static BOOL mib2IpStatsQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2Ip); + UINT item = 0; + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType, + &item); + if (!*pErrorStatus) + { + *pErrorStatus = mapStructEntryToValue(mib2IpMap, + DEFINE_SIZEOF(mib2IpMap), &ipStats, item, bPduType, pVarBind); + if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT) + setOidWithItem(&pVarBind->name, &myOid, item); + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static UINT mib2IpAddr[] = { 1,3,6,1,2,1,4,20,1 }; +static PMIB_IPADDRTABLE ipAddrTable; + +static struct structToAsnValue mib2IpAddrMap[] = { + { FIELD_OFFSET(MIB_IPADDRROW, dwAddr), copyIpAddr }, + { FIELD_OFFSET(MIB_IPADDRROW, dwIndex), copyInt }, + { FIELD_OFFSET(MIB_IPADDRROW, dwMask), copyIpAddr }, + { FIELD_OFFSET(MIB_IPADDRROW, dwBCastAddr), copyInt }, + { FIELD_OFFSET(MIB_IPADDRROW, dwReasmSize), copyInt }, +}; + +static void mib2IpAddrInit(void) +{ + DWORD size = 0, ret = GetIpAddrTable(NULL, &size, TRUE); + + if (ret == ERROR_INSUFFICIENT_BUFFER) + { + ipAddrTable = HeapAlloc(GetProcessHeap(), 0, size); + if (ipAddrTable) + GetIpAddrTable(ipAddrTable, &size, TRUE); + } +} + +static void oidToIpAddrRow(AsnObjectIdentifier *oid, void *dst) +{ + MIB_IPADDRROW *row = dst; + + row->dwAddr = oidToIpAddr(oid); +} + +static int compareIpAddrRow(const void *a, const void *b) +{ + const MIB_IPADDRROW *key = a, *value = b; + + return key->dwAddr - value->dwAddr; +} + +static BOOL mib2IpAddrQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2IpAddr); + UINT tableIndex = 0, item = 0; + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + *pErrorStatus = getItemAndIpAddressInstanceFromOid(&pVarBind->name, + &myOid, bPduType, (struct GenericTable *)ipAddrTable, + sizeof(MIB_IPADDRROW), oidToIpAddrRow, compareIpAddrRow, &item, + &tableIndex); + if (!*pErrorStatus) + { + assert(tableIndex); + assert(item); + *pErrorStatus = mapStructEntryToValue(mib2IpAddrMap, + DEFINE_SIZEOF(mib2IpAddrMap), + &ipAddrTable->table[tableIndex - 1], item, bPduType, pVarBind); + if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT) + setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item, + ipAddrTable->table[tableIndex - 1].dwAddr); + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static UINT mib2IpRoute[] = { 1,3,6,1,2,1,4,21,1 }; +static PMIB_IPFORWARDTABLE ipRouteTable; + +static struct structToAsnValue mib2IpRouteMap[] = { + { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardDest), copyIpAddr }, + { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardIfIndex), copyInt }, + { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric1), copyInt }, + { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric2), copyInt }, + { 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, dwForwardAge), copyInt }, + { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMask), copyIpAddr }, + { FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric5), copyInt }, +}; + +static void mib2IpRouteInit(void) +{ + DWORD size = 0, ret = GetIpForwardTable(NULL, &size, TRUE); + + if (ret == ERROR_INSUFFICIENT_BUFFER) + { + ipRouteTable = HeapAlloc(GetProcessHeap(), 0, size); + if (ipRouteTable) + GetIpForwardTable(ipRouteTable, &size, TRUE); + } +} + +static void oidToIpForwardRow(AsnObjectIdentifier *oid, void *dst) +{ + MIB_IPFORWARDROW *row = dst; + + row->dwForwardDest = oidToIpAddr(oid); +} + +static int compareIpForwardRow(const void *a, const void *b) +{ + const MIB_IPFORWARDROW *key = a, *value = b; + + return key->dwForwardDest - value->dwForwardDest; +} + +static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2IpRoute); + UINT tableIndex = 0, item = 0; + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + *pErrorStatus = getItemAndIpAddressInstanceFromOid(&pVarBind->name, + &myOid, bPduType, (struct GenericTable *)ipRouteTable, + sizeof(MIB_IPFORWARDROW), oidToIpForwardRow, compareIpForwardRow, + &item, &tableIndex); + if (!*pErrorStatus) + { + assert(tableIndex); + assert(item); + *pErrorStatus = mapStructEntryToValue(mib2IpRouteMap, + DEFINE_SIZEOF(mib2IpRouteMap), + &ipRouteTable->table[tableIndex - 1], item, bPduType, pVarBind); + if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT) + setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item, + ipRouteTable->table[tableIndex - 1].dwForwardDest); + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static UINT mib2IpNet[] = { 1,3,6,1,2,1,4,22,1 }; +static PMIB_IPNETTABLE ipNetTable; + +static struct structToAsnValue mib2IpNetMap[] = { + { FIELD_OFFSET(MIB_IPNETROW, dwIndex), copyInt }, + { FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyLengthPrecededString }, + { FIELD_OFFSET(MIB_IPNETROW, dwAddr), copyIpAddr }, + { FIELD_OFFSET(MIB_IPNETROW, dwType), copyInt }, +}; + +static void mib2IpNetInit(void) +{ + DWORD size = 0, ret = GetIpNetTable(NULL, &size, FALSE); + + if (ret == ERROR_INSUFFICIENT_BUFFER) + { + ipNetTable = HeapAlloc(GetProcessHeap(), 0, size); + if (ipNetTable) + GetIpNetTable(ipNetTable, &size, FALSE); + } +} + +static BOOL mib2IpNetQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2IpNet); + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + if (!ipNetTable) + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + else + { + UINT tableIndex = 0, item = 0; + + *pErrorStatus = getItemAndIntegerInstanceFromOid(&pVarBind->name, + &myOid, bPduType, &item, &tableIndex); + if (!*pErrorStatus) + { + assert(tableIndex); + assert(item); + if (tableIndex > ipNetTable->dwNumEntries) + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + else + { + *pErrorStatus = mapStructEntryToValue(mib2IpNetMap, + DEFINE_SIZEOF(mib2IpNetMap), + &ipNetTable[tableIndex - 1], item, bPduType, pVarBind); + if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT) + setOidWithItemAndInteger(&pVarBind->name, &myOid, item, + tableIndex); + } + } + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static UINT mib2Icmp[] = { 1,3,6,1,2,1,5 }; +static MIB_ICMP icmpStats; + +static void mib2IcmpInit(void) +{ + GetIcmpStatistics(&icmpStats); +} + +static struct structToAsnValue mib2IcmpMap[] = { + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwMsgs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwErrors), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwDestUnreachs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwTimeExcds), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwParmProbs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwSrcQuenchs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwRedirects), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwEchos), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwEchoReps), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwTimestamps), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwTimestampReps), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwAddrMasks), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwAddrMaskReps), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwMsgs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwErrors), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwDestUnreachs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwTimeExcds), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwParmProbs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwSrcQuenchs), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwRedirects), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwEchos), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwEchoReps), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwTimestamps), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwTimestampReps), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwAddrMasks), copyInt }, + { FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwAddrMaskReps), copyInt }, +}; + +static BOOL mib2IcmpQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2Icmp); + UINT item = 0; + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType, + &item); + if (!*pErrorStatus) + { + *pErrorStatus = mapStructEntryToValue(mib2IcmpMap, + DEFINE_SIZEOF(mib2IcmpMap), &icmpStats, item, bPduType, + pVarBind); + if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT) + setOidWithItem(&pVarBind->name, &myOid, item); + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static UINT mib2Tcp[] = { 1,3,6,1,2,1,6 }; +static MIB_TCPSTATS tcpStats; + +static void mib2TcpInit(void) +{ + GetTcpStatistics(&tcpStats); +} + +static struct structToAsnValue mib2TcpMap[] = { + { FIELD_OFFSET(MIB_TCPSTATS, dwRtoAlgorithm), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwRtoMin), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwRtoMax), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwMaxConn), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwActiveOpens), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwPassiveOpens), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwAttemptFails), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwEstabResets), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwCurrEstab), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwInSegs), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwOutSegs), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwRetransSegs), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwInErrs), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwOutRsts), copyInt }, + { FIELD_OFFSET(MIB_TCPSTATS, dwNumConns), copyInt }, +}; + +static BOOL mib2TcpQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2Tcp); + UINT item = 0; + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType, + &item); + if (!*pErrorStatus) + { + *pErrorStatus = mapStructEntryToValue(mib2TcpMap, + DEFINE_SIZEOF(mib2TcpMap), &tcpStats, item, bPduType, pVarBind); + if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT) + setOidWithItem(&pVarBind->name, &myOid, item); + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +static UINT mib2Udp[] = { 1,3,6,1,2,1,7 }; +static MIB_UDPSTATS udpStats; + +static void mib2UdpInit(void) +{ + GetUdpStatistics(&udpStats); +} + +static struct structToAsnValue mib2UdpMap[] = { + { FIELD_OFFSET(MIB_UDPSTATS, dwInDatagrams), copyInt }, + { FIELD_OFFSET(MIB_UDPSTATS, dwNoPorts), copyInt }, + { FIELD_OFFSET(MIB_UDPSTATS, dwInErrors), copyInt }, + { FIELD_OFFSET(MIB_UDPSTATS, dwOutDatagrams), copyInt }, +}; + +static BOOL mib2UdpQuery(BYTE bPduType, SnmpVarBind *pVarBind, + AsnInteger32 *pErrorStatus) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2Udp); + UINT item; + + TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name), + pErrorStatus); + + switch (bPduType) + { + case SNMP_PDU_GET: + case SNMP_PDU_GETNEXT: + *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType, + &item); + if (!*pErrorStatus) + { + *pErrorStatus = mapStructEntryToValue(mib2UdpMap, + DEFINE_SIZEOF(mib2UdpMap), &udpStats, item, bPduType, pVarBind); + if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT) + setOidWithItem(&pVarBind->name, &myOid, item); + } + break; + case SNMP_PDU_SET: + *pErrorStatus = SNMP_ERRORSTATUS_READONLY; + break; + default: + FIXME("0x%02x: unsupported PDU type\n", bPduType); + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + } + return TRUE; +} + +/* This list MUST BE lexicographically sorted */ +static struct mibImplementation supportedIDs[] = { + { DEFINE_OID(mib2IfNumber), mib2IfNumberInit, mib2IfNumberQuery }, + { DEFINE_OID(mib2IfEntry), NULL, mib2IfEntryQuery }, + { DEFINE_OID(mib2Ip), mib2IpStatsInit, mib2IpStatsQuery }, + { DEFINE_OID(mib2IpAddr), mib2IpAddrInit, mib2IpAddrQuery }, + { DEFINE_OID(mib2IpRoute), mib2IpRouteInit, mib2IpRouteQuery }, + { DEFINE_OID(mib2IpNet), mib2IpNetInit, mib2IpNetQuery }, + { DEFINE_OID(mib2Icmp), mib2IcmpInit, mib2IcmpQuery }, + { DEFINE_OID(mib2Tcp), mib2TcpInit, mib2TcpQuery }, + { DEFINE_OID(mib2Udp), mib2UdpInit, mib2UdpQuery }, +}; +static UINT minSupportedIDLength; + +BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, + HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion) +{ + AsnObjectIdentifier myOid = DEFINE_OID(mib2System); + UINT i; + + TRACE("(%d, %p, %p)\n", dwUptimeReference, phSubagentTrapEvent, + pFirstSupportedRegion); + + minSupportedIDLength = UINT_MAX; + for (i = 0; i < sizeof(supportedIDs) / sizeof(supportedIDs[0]); i++) + { + if (supportedIDs[i].init) + supportedIDs[i].init(); + if (supportedIDs[i].name.idLength < minSupportedIDLength) + minSupportedIDLength = supportedIDs[i].name.idLength; + } + *phSubagentTrapEvent = NULL; + SnmpUtilOidCpy(pFirstSupportedRegion, &myOid); + return TRUE; +} + +static struct mibImplementation *findSupportedQuery(UINT *ids, UINT idLength, + UINT *matchingIndex) +{ + int indexHigh = DEFINE_SIZEOF(supportedIDs) - 1, indexLow = 0, i; + struct mibImplementation *impl = NULL; + AsnObjectIdentifier oid1 = { idLength, ids}; + + if (!idLength) + return NULL; + for (i = (indexLow + indexHigh) / 2; !impl && indexLow <= indexHigh; + i = (indexLow + indexHigh) / 2) + { + INT cmp; + + cmp = SnmpUtilOidNCmp(&oid1, &supportedIDs[i].name, idLength); + if (!cmp) + { + impl = &supportedIDs[i]; + *matchingIndex = i; + } + else if (cmp > 0) + indexLow = i + 1; + else + indexHigh = i - 1; + } + return impl; +} + +BOOL WINAPI SnmpExtensionQuery(BYTE bPduType, SnmpVarBindList *pVarBindList, + AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex) +{ + AsnObjectIdentifier mib2oid = DEFINE_OID(mib2); + AsnInteger32 error = SNMP_ERRORSTATUS_NOERROR, errorIndex = 0; + UINT i; + + TRACE("(0x%02x, %p, %p, %p)\n", bPduType, pVarBindList, + pErrorStatus, pErrorIndex); + + for (i = 0; !error && i < pVarBindList->len; i++) + { + /* Ignore any OIDs not in MIB2 */ + if (!SnmpUtilOidNCmp(&pVarBindList->list[i].name, &mib2oid, + mib2oid.idLength)) + { + struct mibImplementation *impl = NULL; + UINT len, matchingIndex = 0; + + TRACE("%s\n", SnmpUtilOidToA(&pVarBindList->list[i].name)); + /* Search for an implementation matching as many octets as possible + */ + for (len = pVarBindList->list[i].name.idLength; + len >= minSupportedIDLength && !impl; len--) + impl = findSupportedQuery(pVarBindList->list[i].name.ids, len, + &matchingIndex); + if (impl && impl->query) + impl->query(bPduType, &pVarBindList->list[i], &error); + else + error = SNMP_ERRORSTATUS_NOSUCHNAME; + if (error == SNMP_ERRORSTATUS_NOSUCHNAME && + bPduType == SNMP_PDU_GETNEXT) + { + /* GetNext is special: it finds the successor to the given OID, + * so we have to continue until an implementation handles the + * query or we exhaust the table of supported OIDs. + */ + for (; error == SNMP_ERRORSTATUS_NOSUCHNAME && + matchingIndex < DEFINE_SIZEOF(supportedIDs); + matchingIndex++) + { + error = SNMP_ERRORSTATUS_NOERROR; + impl = &supportedIDs[matchingIndex]; + if (impl->query) + impl->query(bPduType, &pVarBindList->list[i], &error); + else + error = SNMP_ERRORSTATUS_NOSUCHNAME; + } + /* If the query still isn't resolved, set the OID to the + * successor to the last entry in the table. + */ + if (error == SNMP_ERRORSTATUS_NOSUCHNAME) + { + SnmpUtilOidFree(&pVarBindList->list[i].name); + SnmpUtilOidCpy(&pVarBindList->list[i].name, + &supportedIDs[matchingIndex - 1].name); + pVarBindList->list[i].name.ids[ + pVarBindList->list[i].name.idLength - 1] += 1; + } + } + if (error) + errorIndex = i + 1; + } + } + *pErrorStatus = error; + *pErrorIndex = errorIndex; + return TRUE; +} Propchange: trunk/reactos/dll/win32/inetmib1/main.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/snmpapi/snmpapi.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/snmpapi/snmpapi.…
============================================================================== --- trunk/reactos/dll/win32/snmpapi/snmpapi.def [iso-8859-1] (original) +++ trunk/reactos/dll/win32/snmpapi/snmpapi.def [iso-8859-1] Fri Jun 27 12:08:01 2008 @@ -14,7 +14,7 @@ SnmpTfxOpen SnmpTfxQuery SnmpUtilAnsiToUnicode -SnmpUtilAsnAnyCpy +SnmpUtilAsnAnyCpy@8 SnmpUtilAsnAnyFree SnmpUtilDbgPrint SnmpUtilIdsToA @@ -25,12 +25,12 @@ SnmpUtilOctetsCpy SnmpUtilOctetsFree SnmpUtilOctetsNCmp -SnmpUtilOidAppend +SnmpUtilOidAppend@8 SnmpUtilOidCmp -SnmpUtilOidCpy -SnmpUtilOidFree -SnmpUtilOidNCmp -SnmpUtilOidToA +SnmpUtilOidCpy@8 +SnmpUtilOidFree@4 +SnmpUtilOidNCmp@12 +SnmpUtilOidToA@4 SnmpUtilPrintAsnAny SnmpUtilPrintOid SnmpUtilUTF8ToUnicode Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Fri Jun 27 12:08:01 2008 @@ -115,6 +115,9 @@ <directory name="inetcomm"> <xi:include href="inetcomm/inetcomm.rbuild" /> </directory> +<directory name="inetmib1"> + <xi:include href="inetmib1/inetmib1.rbuild" /> +</directory> <directory name="iphlpapi"> <xi:include href="iphlpapi/iphlpapi.rbuild" /> </directory>
16 years, 4 months
1
0
0
0
[jmorlan] 34129: Miscellaneous console bugfixes. See Bug 3267 for details.
by jmorlan@svn.reactos.org
Author: jmorlan Date: Fri Jun 27 07:34:08 2008 New Revision: 34129 URL:
http://svn.reactos.org/svn/reactos?rev=34129&view=rev
Log: Miscellaneous console bugfixes. See Bug 3267 for details. Modified: trunk/reactos/dll/win32/kernel32/misc/console.c trunk/reactos/subsystems/win32/csrss/win32csr/conio.c Modified: trunk/reactos/dll/win32/kernel32/misc/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/co…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] Fri Jun 27 07:34:08 2008 @@ -1646,6 +1646,7 @@ return FALSE; } + NtCurrentPeb()->ProcessParameters->ConsoleHandle = NULL; return TRUE; } @@ -3215,6 +3216,7 @@ } } } + SetLastError(ERROR_INVALID_PARAMETER); return(FALSE); } @@ -3843,6 +3845,7 @@ { /* buffer is not large enough, return the required size */ RtlLeaveCriticalSection(&ConsoleLock); + SetLastError(ERROR_BUFFER_OVERFLOW); return lenName + 1; } Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] Fri Jun 27 07:34:08 2008 @@ -27,11 +27,14 @@ #define ConioIsRectEmpty(Rect) \ (((Rect)->left > (Rect)->right) || ((Rect)->top > (Rect)->bottom)) +#define ConsoleInputUnicodeCharToAnsiChar(Console, dChar, sWChar) \ + WideCharToMultiByte((Console)->CodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL) + #define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \ - WideCharToMultiByte((Console)->CodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL) + WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL) #define ConsoleAnsiCharToUnicodeChar(Console, sWChar, dChar) \ - MultiByteToWideChar((Console)->CodePage, 0, (dChar), 1, (sWChar), 1) + MultiByteToWideChar((Console)->OutputCodePage, 0, (dChar), 1, (sWChar), 1) /* FUNCTIONS *****************************************************************/ @@ -398,20 +401,20 @@ static VOID FASTCALL ConioNextLine(PCSRSS_SCREEN_BUFFER Buff, RECT *UpdateRect, UINT *ScrolledLines) { - /* slide the viewable screen */ - if (((Buff->CurrentY - Buff->ShowY + Buff->MaxY) % Buff->MaxY) == (ULONG)Buff->MaxY - 1) + if (++Buff->CurrentY == Buff->MaxY) + { + Buff->CurrentY = 0; + } + /* If we hit bottom, slide the viewable screen */ + if (Buff->CurrentY == Buff->ShowY) { if (++Buff->ShowY == Buff->MaxY) { Buff->ShowY = 0; } (*ScrolledLines)++; - } - if (++Buff->CurrentY == Buff->MaxY) - { - Buff->CurrentY = 0; - } - ClearLineBuffer(Buff); + ClearLineBuffer(Buff); + } UpdateRect->left = 0; UpdateRect->right = Buff->MaxX - 1; if (UpdateRect->top == (LONG)Buff->CurrentY) @@ -510,6 +513,7 @@ while (Buff->CurrentX < EndX) { Buff->Buffer[Offset] = ' '; + Buff->Buffer[Offset + 1] = Buff->DefaultAttrib; Offset += 2; Buff->CurrentX++; } @@ -726,14 +730,6 @@ } } -BOOLEAN __inline ConioIsEqualRect( - RECT *Rect1, - RECT *Rect2) -{ - return ((Rect1->left == Rect2->left) && (Rect1->right == Rect2->right) && - (Rect1->top == Rect2->top) && (Rect1->bottom == Rect2->bottom)); -} - BOOLEAN __inline ConioGetIntersection( RECT *Intersection, RECT *Rect1, @@ -793,138 +789,65 @@ return TRUE; } -BOOLEAN __inline ConioSubtractRect( - RECT *Subtraction, - RECT *Rect1, - RECT *Rect2) -{ - RECT tmp; - - if (ConioIsRectEmpty(Rect1)) - { - ConioInitRect(Subtraction, 0, -1, 0, -1); - return FALSE; - } - *Subtraction = *Rect1; - if (ConioGetIntersection(&tmp, Rect1, Rect2)) - { - if (ConioIsEqualRect(&tmp, Subtraction)) - { - ConioInitRect(Subtraction, 0, -1, 0, -1); - return FALSE; - } - if ((tmp.top == Subtraction->top) && (tmp.bottom == Subtraction->bottom)) - { - if (tmp.left == Subtraction->left) - { - Subtraction->left = tmp.right; - } - else if (tmp.right == Subtraction->right) - { - Subtraction->right = tmp.left; - } - } - else if ((tmp.left == Subtraction->left) && (tmp.right == Subtraction->right)) - { - if (tmp.top == Subtraction->top) - { - Subtraction->top = tmp.bottom; - } - else if (tmp.bottom == Subtraction->bottom) - { - Subtraction->bottom = tmp.top; - } - } - } - - return TRUE; -} - +/* Move from one rectangle to another. We must be careful about the order that + * this is done, to avoid overwriting parts of the source before they are moved. */ static VOID FASTCALL -ConioCopyRegion(PCSRSS_SCREEN_BUFFER ScreenBuffer, +ConioMoveRegion(PCSRSS_SCREEN_BUFFER ScreenBuffer, RECT *SrcRegion, - RECT *DstRegion) -{ - SHORT SrcY, DstY; - DWORD SrcOffset; - DWORD DstOffset; - DWORD BytesPerLine; - LONG i; - - DstY = DstRegion->top; - BytesPerLine = ConioRectWidth(DstRegion) * 2; - - SrcY = (SrcRegion->top + ScreenBuffer->ShowY) % ScreenBuffer->MaxY; - DstY = (DstRegion->top + ScreenBuffer->ShowY) % ScreenBuffer->MaxY; - SrcOffset = (SrcY * ScreenBuffer->MaxX + SrcRegion->left + ScreenBuffer->ShowX) * 2; - DstOffset = (DstY * ScreenBuffer->MaxX + DstRegion->left + ScreenBuffer->ShowX) * 2; - - for (i = SrcRegion->top; i <= SrcRegion->bottom; i++) - { - RtlCopyMemory( - &ScreenBuffer->Buffer[DstOffset], - &ScreenBuffer->Buffer[SrcOffset], - BytesPerLine); - - if (++DstY == ScreenBuffer->MaxY) - { - DstY = 0; - DstOffset = (DstRegion->left + ScreenBuffer->ShowX) * 2; - } - else - { - DstOffset += ScreenBuffer->MaxX * 2; - } - - if (++SrcY == ScreenBuffer->MaxY) - { - SrcY = 0; - SrcOffset = (SrcRegion->left + ScreenBuffer->ShowX) * 2; - } - else - { - SrcOffset += ScreenBuffer->MaxX * 2; - } - } -} - -static VOID FASTCALL -ConioFillRegion(PCSRSS_CONSOLE Console, - PCSRSS_SCREEN_BUFFER ScreenBuffer, - RECT *Region, - CHAR_INFO *CharInfo, - BOOL bUnicode) -{ - SHORT X, Y; - DWORD Offset; - DWORD Delta; - LONG i; - CHAR Char; - - if(bUnicode) - ConsoleUnicodeCharToAnsiChar(Console, &Char, &CharInfo->Char.UnicodeChar); - else - Char = CharInfo->Char.AsciiChar; - - Y = (Region->top + ScreenBuffer->ShowY) % ScreenBuffer->MaxY; - Offset = (Y * ScreenBuffer->MaxX + Region->left + ScreenBuffer->ShowX) * 2; - Delta = (ScreenBuffer->MaxX - ConioRectWidth(Region)) * 2; - - for (i = Region->top; i <= Region->bottom; i++) - { - for (X = Region->left; X <= Region->right; X++) - { - SET_CELL_BUFFER(ScreenBuffer, Offset, Char, CharInfo->Attributes); - } - if (++Y == ScreenBuffer->MaxY) - { - Y = 0; - Offset = (Region->left + ScreenBuffer->ShowX) * 2; - } - else - { - Offset += Delta; - } + RECT *DstRegion, + RECT *ClipRegion, + WORD Fill) +{ + int Width = ConioRectWidth(SrcRegion); + int Height = ConioRectHeight(SrcRegion); + int SX, SY; + int DX, DY; + int XDelta, YDelta; + int i, j; + + SY = SrcRegion->top; + DY = DstRegion->top; + YDelta = 1; + if (SY < DY) + { + /* Moving down: work from bottom up */ + SY = SrcRegion->bottom; + DY = DstRegion->bottom; + YDelta = -1; + } + for (i = 0; i < Height; i++) + { + PWORD SRow = (PWORD)&ScreenBuffer->Buffer[((SY + ScreenBuffer->ShowY) % ScreenBuffer->MaxY) * ScreenBuffer->MaxX * 2]; + PWORD DRow = (PWORD)&ScreenBuffer->Buffer[((DY + ScreenBuffer->ShowY) % ScreenBuffer->MaxY) * ScreenBuffer->MaxX * 2]; + + SX = SrcRegion->left; + DX = DstRegion->left; + XDelta = 1; + if (SX < DX) + { + /* Moving right: work from right to left */ + SX = SrcRegion->right; + DX = DstRegion->right; + XDelta = -1; + } + for (j = 0; j < Width; j++) + { + WORD Cell = SRow[SX]; + if (SX >= ClipRegion->left && SX <= ClipRegion->right + && SY >= ClipRegion->top && SY <= ClipRegion->bottom) + { + SRow[SX] = Fill; + } + if (DX >= ClipRegion->left && DX <= ClipRegion->right + && DY >= ClipRegion->top && DY <= ClipRegion->bottom) + { + DRow[DX] = Cell; + } + SX += XDelta; + DX += XDelta; + } + SY += YDelta; + DY += YDelta; } } @@ -935,9 +858,9 @@ { WCHAR UnicodeChar = InputEvent->Event.KeyEvent.uChar.UnicodeChar; InputEvent->Event.KeyEvent.uChar.UnicodeChar = 0; - ConsoleUnicodeCharToAnsiChar(Console, - &InputEvent->Event.KeyEvent.uChar.AsciiChar, - &UnicodeChar); + ConsoleInputUnicodeCharToAnsiChar(Console, + &InputEvent->Event.KeyEvent.uChar.AsciiChar, + &UnicodeChar); } } @@ -974,14 +897,14 @@ if(Request->Data.WriteConsoleRequest.Unicode) { - Length = WideCharToMultiByte(Console->CodePage, 0, + Length = WideCharToMultiByte(Console->OutputCodePage, 0, (PWCHAR)Request->Data.WriteConsoleRequest.Buffer, Request->Data.WriteConsoleRequest.NrCharactersToWrite, NULL, 0, NULL, NULL); Buffer = RtlAllocateHeap(GetProcessHeap(), 0, Length); if (Buffer) { - WideCharToMultiByte(Console->CodePage, 0, + WideCharToMultiByte(Console->OutputCodePage, 0, (PWCHAR)Request->Data.WriteConsoleRequest.Buffer, Request->Data.WriteConsoleRequest.NrCharactersToWrite, Buffer, Length, NULL, NULL); @@ -1585,14 +1508,14 @@ { if(Request->Data.WriteConsoleOutputCharRequest.Unicode) { - Length = WideCharToMultiByte(Console->CodePage, 0, + Length = WideCharToMultiByte(Console->OutputCodePage, 0, (PWCHAR)Request->Data.WriteConsoleOutputCharRequest.String, Request->Data.WriteConsoleOutputCharRequest.Length, NULL, 0, NULL, NULL); tmpString = String = RtlAllocateHeap(GetProcessHeap(), 0, Length); if (String) { - WideCharToMultiByte(Console->CodePage, 0, + WideCharToMultiByte(Console->OutputCodePage, 0, (PWCHAR)Request->Data.WriteConsoleOutputCharRequest.String, Request->Data.WriteConsoleOutputCharRequest.Length, String, Length, NULL, NULL); @@ -2257,14 +2180,14 @@ if (! NT_SUCCESS(Status)) { ConioUnlockConsole(Console); - return Request->Status; + return Request->Status = Status; } if (Buff == Console->ActiveBuffer) { ConioUnlockScreenBuffer(Buff); ConioUnlockConsole(Console); - return STATUS_SUCCESS; + return Request->Status = STATUS_SUCCESS; } /* drop reference to old buffer, maybe delete */ @@ -2528,15 +2451,15 @@ RECT ScreenBuffer; RECT SrcRegion; RECT DstRegion; - RECT FillRegion; + RECT UpdateRegion; RECT ScrollRectangle; RECT ClipRectangle; NTSTATUS Status; - BOOLEAN DoFill; HANDLE ConsoleHandle; BOOLEAN UseClipRectangle; COORD DestinationOrigin; CHAR_INFO Fill; + CHAR FillChar; DPRINT("CsrScrollConsoleScreenBuffer\n"); @@ -2567,10 +2490,6 @@ ScrollRectangle.top = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Top; ScrollRectangle.right = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Right; ScrollRectangle.bottom = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Bottom; - ClipRectangle.left = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Left; - ClipRectangle.top = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Top; - ClipRectangle.right = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Right; - ClipRectangle.bottom = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Bottom; /* Make sure source rectangle is inside the screen buffer */ ConioInitRect(&ScreenBuffer, 0, 0, Buff->MaxY - 1, Buff->MaxX - 1); @@ -2581,63 +2500,60 @@ { ConioUnlockConsole(Console); } - return Request->Status = STATUS_INVALID_PARAMETER; - } - - if (UseClipRectangle && ! ConioGetIntersection(&SrcRegion, &SrcRegion, &ClipRectangle)) - { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } - ConioUnlockScreenBuffer(Buff); return Request->Status = STATUS_SUCCESS; } + /* If the source was clipped on the left or top, adjust the destination accordingly */ + if (ScrollRectangle.left < 0) + { + DestinationOrigin.X -= ScrollRectangle.left; + } + if (ScrollRectangle.top < 0) + { + DestinationOrigin.Y -= ScrollRectangle.top; + } + + if (UseClipRectangle) + { + ClipRectangle.left = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Left; + ClipRectangle.top = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Top; + ClipRectangle.right = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Right; + ClipRectangle.bottom = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Bottom; + if (!ConioGetIntersection(&ClipRectangle, &ClipRectangle, &ScreenBuffer)) + { + if (NULL != Console) + { + ConioUnlockConsole(Console); + } + ConioUnlockScreenBuffer(Buff); + return Request->Status = STATUS_SUCCESS; + } + } + else + { + ClipRectangle = ScreenBuffer; + } ConioInitRect(&DstRegion, DestinationOrigin.Y, DestinationOrigin.X, - DestinationOrigin.Y + ConioRectHeight(&ScrollRectangle) - 1, - DestinationOrigin.X + ConioRectWidth(&ScrollRectangle) - 1); - - /* Make sure destination rectangle is inside the screen buffer */ - if (! ConioGetIntersection(&DstRegion, &DstRegion, &ScreenBuffer)) - { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } - ConioUnlockScreenBuffer(Buff); - return Request->Status = STATUS_INVALID_PARAMETER; - } - - ConioCopyRegion(Buff, &SrcRegion, &DstRegion); - - /* Get the region that should be filled with the specified character and attributes */ - - DoFill = FALSE; - - ConioGetUnion(&FillRegion, &SrcRegion, &DstRegion); - - if (ConioSubtractRect(&FillRegion, &FillRegion, &DstRegion)) - { - /* FIXME: The subtracted rectangle is off by one line */ - FillRegion.top += 1; - - ConioFillRegion(Console, Buff, &FillRegion, &Fill, Request->Data.ScrollConsoleScreenBufferRequest.Unicode); - DoFill = TRUE; - } + DestinationOrigin.Y + ConioRectHeight(&SrcRegion) - 1, + DestinationOrigin.X + ConioRectWidth(&SrcRegion) - 1); + + if (Request->Data.ScrollConsoleScreenBufferRequest.Unicode) + ConsoleUnicodeCharToAnsiChar(Console, &FillChar, &Fill.Char.UnicodeChar); + else + FillChar = Fill.Char.AsciiChar; + + ConioMoveRegion(Buff, &SrcRegion, &DstRegion, &ClipRectangle, Fill.Attributes << 8 | (BYTE)FillChar); if (NULL != Console && Buff == Console->ActiveBuffer) { - /* Draw destination region */ - ConioDrawRegion(Console, &DstRegion); - - if (DoFill) - { - /* Draw filled region */ - ConioDrawRegion(Console, &FillRegion); + ConioGetUnion(&UpdateRegion, &SrcRegion, &DstRegion); + if (ConioGetIntersection(&UpdateRegion, &UpdateRegion, &ClipRectangle)) + { + /* Draw update region */ + ConioDrawRegion(Console, &UpdateRegion); } }
16 years, 4 months
1
0
0
0
[jimtabor] 34128: Path needed some love Phase II: - Fixed path coordinate problem by enabling old code and fixing arc move to issues. See that code that everyone thought that had no real use was usefull after all. - Found more image and region problems, see bug 3402.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Jun 27 05:58:11 2008 New Revision: 34128 URL:
http://svn.reactos.org/svn/reactos?rev=34128&view=rev
Log: Path needed some love Phase II: - Fixed path coordinate problem by enabling old code and fixing arc move to issues. See that code that everyone thought that had no real use was usefull after all. - Found more image and region problems, see bug 3402. Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c trunk/reactos/subsystems/win32/win32k/objects/line.c trunk/reactos/subsystems/win32/win32k/objects/path.c trunk/reactos/subsystems/win32/win32k/objects/region.c Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Fri Jun 27 05:58:11 2008 @@ -1,4 +1,3 @@ - #include <w32k.h> #define NDEBUG @@ -259,8 +258,7 @@ if (arctype == GdiTypeArcTo) { - dc->ptlDCOrig.x = EfCx; - dc->ptlDCOrig.y = EfCy; + IntGdiMoveToEx(dc, EfCx, EfCy, NULL); } return Ret; @@ -306,12 +304,7 @@ if (result) { - POINT point; - point.x=x2; - point.y=y2; -// CoordLPtoDP ( pDC, &point ); - pDC->ptlDCOrig.x = point.x; - pDC->ptlDCOrig.y = point.y; + IntGdiMoveToEx(pDC, x2, y2, NULL); } return result; } Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] Fri Jun 27 05:58:11 2008 @@ -102,7 +102,7 @@ if (PATH_IsPathOpen(dc->DcLevel)) { Ret = PATH_LineTo(dc, XEnd, YEnd); -#if 0 +//#if 0 if (Ret) { // FIXME - PATH_LineTo should maybe do this... @@ -112,7 +112,7 @@ CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); } -#endif +//#endif return Ret; } else Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] Fri Jun 27 05:58:11 2008 @@ -123,32 +123,32 @@ xform = dc->DcLevel.xformWorld2Wnd; /* Set MM_TEXT */ - IntGdiSetMapMode( dc, MM_TEXT ); - Dc_Attr->ptlViewportOrg.x = 0; - Dc_Attr->ptlViewportOrg.y = 0; - Dc_Attr->ptlWindowOrg.x = 0; - Dc_Attr->ptlWindowOrg.y = 0; +// IntGdiSetMapMode( dc, MM_TEXT ); +// Dc_Attr->ptlViewportOrg.x = 0; +// Dc_Attr->ptlViewportOrg.y = 0; +// Dc_Attr->ptlWindowOrg.x = 0; +// Dc_Attr->ptlWindowOrg.y = 0; graphicsMode = Dc_Attr->iGraphicsMode; - Dc_Attr->iGraphicsMode = GM_ADVANCED; - IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY ); - Dc_Attr->iGraphicsMode = graphicsMode; +// Dc_Attr->iGraphicsMode = GM_ADVANCED; +// IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY ); +// Dc_Attr->iGraphicsMode = graphicsMode; /* Paint the region */ IntGdiPaintRgn( dc, hrgn ); NtGdiDeleteObject( hrgn ); /* Restore the old mapping mode */ - IntGdiSetMapMode( dc, mapMode ); - Dc_Attr->szlViewportExt = ptViewportExt; - Dc_Attr->ptlViewportOrg = ptViewportOrg; - Dc_Attr->szlWindowExt = ptWindowExt; - Dc_Attr->ptlWindowOrg = ptWindowOrg; +// IntGdiSetMapMode( dc, mapMode ); +// Dc_Attr->szlViewportExt = ptViewportExt; +// Dc_Attr->ptlViewportOrg = ptViewportOrg; +// Dc_Attr->szlWindowExt = ptWindowExt; +// Dc_Attr->ptlWindowOrg = ptWindowOrg; /* Go to GM_ADVANCED temporarily to restore the world transform */ graphicsMode = Dc_Attr->iGraphicsMode; - Dc_Attr->iGraphicsMode = GM_ADVANCED; - IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 ); - Dc_Attr->iGraphicsMode = graphicsMode; +// Dc_Attr->iGraphicsMode = GM_ADVANCED; +// IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 ); +// Dc_Attr->iGraphicsMode = graphicsMode; return TRUE; } return FALSE; Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Fri Jun 27 05:58:11 2008 @@ -1959,7 +1959,7 @@ BOOL FASTCALL REGION_LPTODP( - HDC hdc, + PDC dc, HRGN hDest, HRGN hSrc) { @@ -1967,7 +1967,6 @@ PROSRGNDATA srcObj = NULL; PROSRGNDATA destObj = NULL; - DC * dc = DC_LockDc(hdc); RECT tmpRect; BOOL ret = FALSE; PDC_ATTR Dc_Attr; @@ -2027,7 +2026,6 @@ REGION_UnlockRgn(destObj); done: - DC_UnlockDc(dc); return ret; } @@ -2878,8 +2876,7 @@ HRGN hRgn ) { - //RECT box; - HRGN tmpVisRgn; //, prevVisRgn; + HRGN tmpVisRgn; PROSRGNDATA visrgn; CLIPOBJ* ClipRegion; BOOL bRet = FALSE; @@ -2889,36 +2886,26 @@ BITMAPOBJ *BitmapObj; PDC_ATTR Dc_Attr; - if (!dc) - return FALSE; + if (!dc) return FALSE; Dc_Attr = dc->pDc_Attr; if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))) - { - DC_UnlockDc(dc); + if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))) return FALSE; + + // Transform region into device co-ords + if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) || + NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR) + { + NtGdiDeleteObject(tmpVisRgn); return FALSE; } - /* ei enable later - // Transform region into device co-ords - if (!REGION_LPTODP(hDC, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR) - { + NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->w.hGCClipRgn, RGN_AND); + + visrgn = REGION_LockRgn(tmpVisRgn); + if (visrgn == NULL) + { NtGdiDeleteObject(tmpVisRgn); - DC_UnlockDc(dc); - return FALSE; - } - */ - /* enable when clipping is implemented - NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->w.hGCClipRgn, RGN_AND); - */ - - //visrgn = REGION_LockRgn(tmpVisRgn); - visrgn = REGION_LockRgn(hRgn); - if (visrgn == NULL) - { - NtGdiDeleteObject(tmpVisRgn); - DC_UnlockDc(dc); return FALSE; }
16 years, 4 months
1
0
0
0
[fireball] 34127: - Add an initial breakpoint for usermode process startup, this makes usermode gdb debugging working. Spotted and tested by Yury Sidorov.
by fireball@svn.reactos.org
Author: fireball Date: Fri Jun 27 04:50:52 2008 New Revision: 34127 URL:
http://svn.reactos.org/svn/reactos?rev=34127&view=rev
Log: - Add an initial breakpoint for usermode process startup, this makes usermode gdb debugging working. Spotted and tested by Yury Sidorov. Modified: trunk/reactos/dll/ntdll/ldr/startup.c Modified: trunk/reactos/dll/ntdll/ldr/startup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/startup.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] Fri Jun 27 04:50:52 2008 @@ -484,6 +484,10 @@ ZwTerminateProcess(NtCurrentProcess(), STATUS_INVALID_IMAGE_FORMAT); } } + + /* Break into debugger */ + if (Peb->BeingDebugged) DbgBreakPoint(); + /* attach the thread */ RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock); LdrpAttachThread();
16 years, 4 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
44
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
Results per page:
10
25
50
100
200