winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2008
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
944 discussions
Start a n
N
ew thread
Alex Villacís Lasso : richedit: Revert patch that introduced a test that fails on all platforms.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 163e9d1d02bdef36a63b31122939787f146f9ca0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=163e9d1d02bdef36a63b31122…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Tue Jun 24 13:25:52 2008 -0500 richedit: Revert patch that introduced a test that fails on all platforms. --- dlls/riched20/paint.c | 9 ++------- dlls/riched20/tests/editor.c | 10 ---------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 88576f6..95befbc 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -674,14 +674,9 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) si.fMask |= SIF_DISABLENOSCROLL; si.nMin = 0; + si.nMax = editor->nTotalLength; - if (ME_GetTextLength(editor) > 0) - { - si.nMax = editor->nTotalLength; - si.nPage = editor->sizeWindow.cy; - } else { - si.nMax = si.nPage = 0; - } + si.nPage = editor->sizeWindow.cy; TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage); SetScrollInfo(hWnd, SB_VERT, &si, TRUE); diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 68e1d7e..bbdba4d 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -2038,16 +2038,6 @@ static void test_EM_SCROLL(void) int expr; /* expected return value */ HWND hwndRichEdit = new_richedit(NULL); int y_before, y_after; /* units of lines of text */ - SCROLLINFO si; - - /* Empty richedit should have scroll range of 0 */ - si.cbSize = sizeof(si); - si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; - GetScrollInfo(hwndRichEdit, SB_VERT, &si); - ok(si.nMin == 0, "si.nMin == %d, expected 0\n", si.nMin); - ok(si.nMax == 0, "si.nMax == %d, expected 0\n", si.nMax); - ok(si.nPos == 0, "si.nPos == %d, expected 0\n", si.nPos); - ok(si.nPage == 0, "si.nPage == %d, expected 0\n", si.nPage); /* test a richedit box containing a single line of text */ SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "a");/* one line of text */
1
0
0
0
Juan Lang : inetmib1: Support the MIB2 IP address table.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: ea20d6b793039753d0cd9c3f9bca894bb8e68a47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea20d6b793039753d0cd9c3f9…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:57:51 2008 -0700 inetmib1: Support the MIB2 IP address table. --- dlls/inetmib1/main.c | 166 ++++++++++++++++++++++++++++++++++++++++++++ dlls/inetmib1/tests/main.c | 57 +++++++++++++++ 2 files changed, 223 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ea20d6b793039753d0cd9…
1
0
0
0
Juan Lang : inetmib1: Support the MIB2 ICMP statistics.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 7d85506a9d9a688a4bbef1ab2cbd960c47522b6e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d85506a9d9a688a4bbef1ab2…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:55:52 2008 -0700 inetmib1: Support the MIB2 ICMP statistics. --- dlls/inetmib1/main.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 96 insertions(+), 0 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index 1aff74d..deefc7a 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -408,11 +408,107 @@ static BOOL mib2IpStatsQuery(BYTE bPduType, SnmpVarBind *pVarBind, 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: + if (!SnmpUtilOidNCmp(&pVarBind->name, &myOid, myOid.idLength) && + pVarBind->name.idLength == myOid.idLength + 1) + { + item = pVarBind->name.ids[pVarBind->name.idLength - 1]; + *pErrorStatus = mapStructEntryToValue(mib2IcmpMap, + DEFINE_SIZEOF(mib2IcmpMap), &icmpStats, item, bPduType, + pVarBind); + } + else + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + break; + case SNMP_PDU_GETNEXT: + if (!SnmpUtilOidCmp(&pVarBind->name, &myOid) || + SnmpUtilOidNCmp(&pVarBind->name, &myOid, myOid.idLength) < 0) + item = 1; + else if (!SnmpUtilOidNCmp(&pVarBind->name, &myOid, myOid.idLength) && + pVarBind->name.idLength == myOid.idLength + 1) + item = pVarBind->name.ids[pVarBind->name.idLength - 1] + 1; + else + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + if (item) + { + *pErrorStatus = mapStructEntryToValue(mib2IcmpMap, + DEFINE_SIZEOF(mib2IcmpMap), &icmpStats, item, bPduType, + pVarBind); + if (!*pErrorStatus) + { + AsnObjectIdentifier oid; + + SnmpUtilOidCpy(&pVarBind->name, &myOid); + oid.idLength = 1; + oid.ids = &item; + SnmpUtilOidAppend(&pVarBind->name, &oid); + } + } + 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(mib2Icmp), mib2IcmpInit, mib2IcmpQuery }, }; static UINT minSupportedIDLength;
1
0
0
0
Juan Lang : inetmib1: Support the MIB2 IP statistics.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: b77719c7fb01064d9b42395b3b1d49d39b483b4b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b77719c7fb01064d9b42395b3…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:55:20 2008 -0700 inetmib1: Support the MIB2 IP statistics. --- dlls/inetmib1/main.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 93 insertions(+), 0 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index edf80f4..1aff74d 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -316,10 +316,103 @@ static BOOL mib2IfEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind, 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: + if (!SnmpUtilOidNCmp(&pVarBind->name, &myOid, myOid.idLength) && + pVarBind->name.idLength == myOid.idLength + 1) + { + item = pVarBind->name.ids[pVarBind->name.idLength - 1]; + *pErrorStatus = mapStructEntryToValue(mib2IpMap, + DEFINE_SIZEOF(mib2IpMap), &ipStats, item, bPduType, pVarBind); + } + else + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + break; + case SNMP_PDU_GETNEXT: + if (!SnmpUtilOidCmp(&pVarBind->name, &myOid) || + SnmpUtilOidNCmp(&pVarBind->name, &myOid, myOid.idLength) < 0) + item = 1; + else if (!SnmpUtilOidNCmp(&pVarBind->name, &myOid, myOid.idLength) && + pVarBind->name.idLength == myOid.idLength + 1) + item = pVarBind->name.ids[pVarBind->name.idLength - 1] + 1; + else + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + if (item) + { + *pErrorStatus = mapStructEntryToValue(mib2IpMap, + DEFINE_SIZEOF(mib2IpMap), &ipStats, item, bPduType, pVarBind); + if (!*pErrorStatus) + { + AsnObjectIdentifier oid; + + SnmpUtilOidCpy(&pVarBind->name, &myOid); + oid.idLength = 1; + oid.ids = &item; + SnmpUtilOidAppend(&pVarBind->name, &oid); + } + } + else + *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME; + 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 }, }; static UINT minSupportedIDLength;
1
0
0
0
Juan Lang : inetmib1: Support the MIB2 interface table.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: c531c117340a43dbe8668189a32e6dd27f091ce4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c531c117340a43dbe8668189a…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:54:34 2008 -0700 inetmib1: Support the MIB2 interface table. --- dlls/inetmib1/main.c | 192 +++++++++++++++++++++++++++++++++++++++++++- dlls/inetmib1/tests/main.c | 102 +++++++++++++++++++++++ 2 files changed, 293 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c531c117340a43dbe8668…
1
0
0
0
Juan Lang : inetmib1: Support querying the MIB2 number of interfaces.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: f913252ea2d94bc9cf732b716419b126a8361f27 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f913252ea2d94bc9cf732b716…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:53:17 2008 -0700 inetmib1: Support querying the MIB2 number of interfaces. --- dlls/inetmib1/main.c | 53 +++++++++++++++++++++++++++++++++++++++++++- dlls/inetmib1/tests/main.c | 2 - 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index 5e87b8c..be2d3b9 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -48,6 +48,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } +/** + * Utility functions + */ +static void copyInt(AsnAny *value, void *src) +{ + value->asnType = ASN_INTEGER; + value->asnValue.number = *(DWORD *)src; +} + static UINT mib2[] = { 1,3,6,1,2,1 }; static UINT mib2System[] = { 1,3,6,1,2,1,1 }; @@ -76,9 +85,51 @@ static void mib2IfNumberInit(void) } } +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; +} + /* This list MUST BE lexicographically sorted */ static struct mibImplementation supportedIDs[] = { - { DEFINE_OID(mib2IfNumber), mib2IfNumberInit }, + { DEFINE_OID(mib2IfNumber), mib2IfNumberInit, mib2IfNumberQuery }, }; static UINT minSupportedIDLength; diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c index 6e4627e..71bf141 100644 --- a/dlls/inetmib1/tests/main.c +++ b/dlls/inetmib1/tests/main.c @@ -132,11 +132,9 @@ static void testQuery(void) moreData = TRUE; ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); - todo_wine { ok(error == SNMP_ERRORSTATUS_NOERROR, "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); ok(index == 0, "expected index 0, got %d\n", index); - } vars[0].name.idLength = sizeof(mib2If) / sizeof(mib2If[0]); vars[0].name.ids = mib2If; ok(!SnmpUtilOidNCmp(&vars2[0].name, &vars[0].name, vars[0].name.idLength),
1
0
0
0
Juan Lang : inetmib1: Implement SnmpExtensionQuery.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: dedff1329fe051f4f40f52da5dcc239b6ec65564 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dedff1329fe051f4f40f52da5…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:52:39 2008 -0700 inetmib1: Implement SnmpExtensionQuery. --- dlls/inetmib1/main.c | 89 ++++++++++++++++++++++++++++++++++++++++++- dlls/inetmib1/tests/main.c | 5 +- 2 files changed, 88 insertions(+), 6 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index 2ee0ba9..5e87b8c 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -19,7 +19,7 @@ #include "config.h" #include <stdarg.h> - +#include <limits.h> #include "windef.h" #include "winbase.h" #include "snmp.h" @@ -51,10 +51,14 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 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 }; @@ -72,9 +76,11 @@ static void mib2IfNumberInit(void) } } +/* This list MUST BE lexicographically sorted */ static struct mibImplementation supportedIDs[] = { { DEFINE_OID(mib2IfNumber), mib2IfNumberInit }, }; +static UINT minSupportedIDLength; BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion) @@ -85,14 +91,47 @@ BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, 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) { @@ -109,8 +148,52 @@ BOOL WINAPI SnmpExtensionQuery(BYTE bPduType, SnmpVarBindList *pVarBindList, if (!SnmpUtilOidNCmp(&pVarBindList->list[i].name, &mib2oid, mib2oid.idLength)) { - FIXME("%s: stub\n", SnmpUtilOidToA(&pVarBindList->list[i].name)); - error = SNMP_ERRORSTATUS_NOSUCHNAME; + 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; diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c index 8667995..6e4627e 100644 --- a/dlls/inetmib1/tests/main.c +++ b/dlls/inetmib1/tests/main.c @@ -117,7 +117,6 @@ static void testQuery(void) ok(error == SNMP_ERRORSTATUS_NOSUCHNAME, "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error); /* The index is 1-based rather than 0-based */ - todo_wine ok(index == 1, "expected index 1, got %d\n", index); /* Even though SnmpExtensionInit says this DLL supports the MIB2 system @@ -133,13 +132,13 @@ static void testQuery(void) moreData = TRUE; ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); - todo_wine + todo_wine { ok(error == SNMP_ERRORSTATUS_NOERROR, "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); ok(index == 0, "expected index 0, got %d\n", index); + } vars[0].name.idLength = sizeof(mib2If) / sizeof(mib2If[0]); vars[0].name.ids = mib2If; - todo_wine ok(!SnmpUtilOidNCmp(&vars2[0].name, &vars[0].name, vars[0].name.idLength), "expected 1.3.6.1.2.1.2, got %s\n", SnmpUtilOidToA(&vars2[0].name)); SnmpUtilVarBindFree(&vars2[0]);
1
0
0
0
Juan Lang : inetmib1: Add initialization function for getting the MIB2 number of interfaces.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: f28cd51d0d864c087b942c0e60db6e41e9422e9a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f28cd51d0d864c087b942c0e6…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:52:00 2008 -0700 inetmib1: Add initialization function for getting the MIB2 number of interfaces. --- dlls/inetmib1/Makefile.in | 1 + dlls/inetmib1/main.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/inetmib1/Makefile.in b/dlls/inetmib1/Makefile.in index cb27cc2..3998f00 100644 --- a/dlls/inetmib1/Makefile.in +++ b/dlls/inetmib1/Makefile.in @@ -4,6 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = inetmib1.dll IMPORTS = snmpapi kernel32 +DELAYIMPORTS = iphlpapi C_SRCS = \ main.c diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index 454ae0c..2ee0ba9 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -23,6 +23,7 @@ #include "windef.h" #include "winbase.h" #include "snmp.h" +#include "iphlpapi.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(inetmib1); @@ -56,7 +57,23 @@ struct mibImplementation void (*init)(void); }; +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 struct mibImplementation supportedIDs[] = { + { DEFINE_OID(mib2IfNumber), mib2IfNumberInit }, }; BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference,
1
0
0
0
Juan Lang : inetmib1: Add a mechanism for initializing supported OIDs, and use it in SnmpExtensionInit.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 709a0a46e227be30ddad313f33edc0711f8d1480 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=709a0a46e227be30ddad313f3…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:51:30 2008 -0700 inetmib1: Add a mechanism for initializing supported OIDs, and use it in SnmpExtensionInit. --- dlls/inetmib1/main.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index c74d6ad..454ae0c 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -50,14 +50,27 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) static UINT mib2[] = { 1,3,6,1,2,1 }; static UINT mib2System[] = { 1,3,6,1,2,1,1 }; +struct mibImplementation +{ + AsnObjectIdentifier name; + void (*init)(void); +}; + +static struct mibImplementation supportedIDs[] = { +}; + BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion) { AsnObjectIdentifier myOid = DEFINE_OID(mib2System); + UINT i; - FIXME("(%d, %p, %p): stub\n", dwUptimeReference, phSubagentTrapEvent, + TRACE("(%d, %p, %p)\n", dwUptimeReference, phSubagentTrapEvent, pFirstSupportedRegion); + for (i = 0; i < sizeof(supportedIDs) / sizeof(supportedIDs[0]); i++) + if (supportedIDs[i].init) + supportedIDs[i].init(); *phSubagentTrapEvent = NULL; SnmpUtilOidCpy(pFirstSupportedRegion, &myOid); return TRUE;
1
0
0
0
Juan Lang : inetmib1: Improve SnmpExtensionQuery stub.
by Alexandre Julliard
25 Jun '08
25 Jun '08
Module: wine Branch: master Commit: 50f4bd16f68147b743f92a7eb79485e0d1fd3c3e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=50f4bd16f68147b743f92a7eb…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue May 20 20:50:45 2008 -0700 inetmib1: Improve SnmpExtensionQuery stub. --- dlls/inetmib1/main.c | 22 ++++++++++++++++++++-- dlls/inetmib1/tests/main.c | 10 ++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index 7e7450b..c74d6ad 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -47,6 +47,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } +static UINT mib2[] = { 1,3,6,1,2,1 }; static UINT mib2System[] = { 1,3,6,1,2,1,1 }; BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, @@ -65,7 +66,24 @@ BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, BOOL WINAPI SnmpExtensionQuery(BYTE bPduType, SnmpVarBindList *pVarBindList, AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex) { - FIXME("(0x%02x, %p, %p, %p): stub\n", bPduType, pVarBindList, + 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); - return FALSE; + + for (i = 0; !error && i < pVarBindList->len; i++) + { + /* Ignore any OIDs not in MIB2 */ + if (!SnmpUtilOidNCmp(&pVarBindList->list[i].name, &mib2oid, + mib2oid.idLength)) + { + FIXME("%s: stub\n", SnmpUtilOidToA(&pVarBindList->list[i].name)); + error = SNMP_ERRORSTATUS_NOSUCHNAME; + } + } + *pErrorStatus = error; + *pErrorIndex = errorIndex; + return TRUE; } diff --git a/dlls/inetmib1/tests/main.c b/dlls/inetmib1/tests/main.c index b9eac11..8667995 100644 --- a/dlls/inetmib1/tests/main.c +++ b/dlls/inetmib1/tests/main.c @@ -81,12 +81,10 @@ static void testQuery(void) error = 0xdeadbeef; index = 0xdeadbeef; ret = pQuery(SNMP_PDU_GET, &list, &error, &index); - todo_wine { ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(error == SNMP_ERRORSTATUS_NOERROR, "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); ok(index == 0, "expected index 0, got %d\n", index); - } /* Oddly enough, this "succeeds," even though the OID is clearly * unsupported. @@ -100,12 +98,10 @@ static void testQuery(void) error = 0xdeadbeef; index = 0xdeadbeef; ret = pQuery(SNMP_PDU_GET, &list, &error, &index); - todo_wine { ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(error == SNMP_ERRORSTATUS_NOERROR, "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); ok(index == 0, "expected index 0, got %d\n", index); - } /* The OID isn't changed either: */ ok(!strcmp("1.2.3.4", SnmpUtilOidToA(&vars[0].name)), "expected 1.2.3.4, got %s\n", SnmpUtilOidToA(&vars[0].name)); @@ -117,13 +113,12 @@ static void testQuery(void) error = 0xdeadbeef; index = 0xdeadbeef; ret = pQuery(SNMP_PDU_GET, &list, &error, &index); - todo_wine { ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(error == SNMP_ERRORSTATUS_NOSUCHNAME, "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error); /* The index is 1-based rather than 0-based */ + todo_wine ok(index == 1, "expected index 1, got %d\n", index); - } /* Even though SnmpExtensionInit says this DLL supports the MIB2 system * variables, the first variable it returns a value for is the first @@ -137,12 +132,11 @@ static void testQuery(void) list.list = vars2; moreData = TRUE; ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); - todo_wine { ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); + todo_wine ok(error == SNMP_ERRORSTATUS_NOERROR, "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); ok(index == 0, "expected index 0, got %d\n", index); - } vars[0].name.idLength = sizeof(mib2If) / sizeof(mib2If[0]); vars[0].name.ids = mib2If; todo_wine
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
95
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200