Author: gedmurphy
Date: Thu Sep 27 00:34:08 2007
New Revision: 29219
URL:
http://svn.reactos.org/svn/reactos?rev=29219&view=rev
Log:
- generate the netcard status information and populate the dialog with it
- patch by Gregor Brunmar <gregor.brunmar - home - se>
Modified:
trunk/reactos/dll/cpl/ncpa/lang/bg-BG.rc
trunk/reactos/dll/cpl/ncpa/lang/cs-CZ.rc
trunk/reactos/dll/cpl/ncpa/lang/da-DK.rc
trunk/reactos/dll/cpl/ncpa/lang/de-DE.rc
trunk/reactos/dll/cpl/ncpa/lang/el-GR.rc
trunk/reactos/dll/cpl/ncpa/lang/en-US.rc
trunk/reactos/dll/cpl/ncpa/lang/es-ES.rc
trunk/reactos/dll/cpl/ncpa/lang/fr-FR.rc
trunk/reactos/dll/cpl/ncpa/lang/hu-HU.rc
trunk/reactos/dll/cpl/ncpa/lang/id-ID.rc
trunk/reactos/dll/cpl/ncpa/lang/it-IT.rc
trunk/reactos/dll/cpl/ncpa/lang/ja-JP.rc
trunk/reactos/dll/cpl/ncpa/lang/nb-NO.rc
trunk/reactos/dll/cpl/ncpa/lang/nl-NL.rc
trunk/reactos/dll/cpl/ncpa/lang/pl-PL.rc
trunk/reactos/dll/cpl/ncpa/lang/ru-RU.rc
trunk/reactos/dll/cpl/ncpa/lang/sv-SE.rc
trunk/reactos/dll/cpl/ncpa/lang/uk-UA.rc
trunk/reactos/dll/cpl/ncpa/ncpa.c
trunk/reactos/dll/cpl/ncpa/ncpa.h
trunk/reactos/dll/cpl/ncpa/resource.h
Modified: trunk/reactos/dll/cpl/ncpa/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/bg-BG.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/bg-BG.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/bg-BG.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Ñâîéñòâà", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Èçêëþ÷âàíå", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -119,4 +122,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Íåäîñòèã íà ïàìåò"
IDS_CANNOT_SAVE_CHANGES "Ñúõðàíÿâàíåòî íà íàïðàâåíèòå îò âàñ íàñòðîéêè å
íåâúçìîæíî"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/cs-CZ.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/cs-CZ.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/cs-CZ.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Vlastnosti", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Zakázat", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,4 +123,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/da-DK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/da-DK.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/da-DK.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/da-DK.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 134, 115, 44, 8
PUSHBUTTON "&Egenskaber", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Deaktiver", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,4 +123,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/de-DE.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/de-DE.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/de-DE.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "E&igenschaften", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Deaktivieren", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -119,4 +122,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Property sheet kann nicht erstellt werden"
IDS_OUT_OF_MEMORY "Nicht genug Arbeitsspeicher"
IDS_CANNOT_SAVE_CHANGES "Änderungen können nicht gespeichert werden"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/el-GR.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/el-GR.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/el-GR.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Éäéüôçôåò", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Áðåíåñãïðïßçóç", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -119,4 +122,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Äåí Þôáí äõíáôÞ ç áðïèÞêåõóç ôùí áëëáãþí óáò"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/en-US.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/en-US.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/en-US.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Properties", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Disable", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -119,4 +122,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/es-ES.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/es-ES.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/es-ES.rc Thu Sep 27 00:34:08 2007
@@ -56,6 +56,9 @@
RTEXT "00.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Propiedades", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Desabilitar", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -125,4 +128,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/fr-FR.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/fr-FR.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/fr-FR.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Propriétés", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Désactiver", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,4 +123,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Impossible de créer la page de propriétés"
IDS_OUT_OF_MEMORY "Plus de mémoire"
IDS_CANNOT_SAVE_CHANGES "Impossible de sauvegarder les changements"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/hu-HU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/hu-HU.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/hu-HU.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/hu-HU.rc Thu Sep 27 00:34:08 2007
@@ -53,6 +53,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Tulajdonságok", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Letiltás", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -121,4 +124,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/id-ID.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/id-ID.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/id-ID.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Properti", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Dimatikan", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,4 +123,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Tidak bisa membuat lembar properti"
IDS_OUT_OF_MEMORY "Kekurangan memori"
IDS_CANNOT_SAVE_CHANGES "Tidak bisa menyimpan perubahan yang anda buat"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/it-IT.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/it-IT.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/it-IT.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Proprietà", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Disabilita", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,4 +123,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Impossibile creare la pagina delle proprietà"
IDS_OUT_OF_MEMORY "Memoria esaurita"
IDS_CANNOT_SAVE_CHANGES "Impossibile salvare le modifiche effettuate"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/ja-JP.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/ja-JP.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/ja-JP.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "vpeB(&P)", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "³øÉ·é(&D)", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,4 +123,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/nb-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/nb-NO.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/nb-NO.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/nb-NO.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Properties", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Disable", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -119,4 +122,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/nl-NL.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/nl-NL.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/nl-NL.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Eigenschappen", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Uitschakelen", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,5 +123,15 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
+
Modified: trunk/reactos/dll/cpl/ncpa/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/pl-PL.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/pl-PL.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/pl-PL.rc Thu Sep 27 00:34:08 2007
@@ -54,6 +54,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&W³aciwoci", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Od³¹cz", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -116,4 +119,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Nie mo¿na utworzyæ przegl¹du ustawieñ"
IDS_OUT_OF_MEMORY "Brak wolnej pamiêci"
IDS_CANNOT_SAVE_CHANGES "Nie mo¿na zapisaæ dokonanych zmian!"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/ru-RU.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/ru-RU.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/ru-RU.rc Thu Sep 27 00:34:08 2007
@@ -52,6 +52,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Ñâîéñòâà", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Îòêëþ÷èòü", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -120,4 +123,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Íåâîçìîæíî ñîçäàòü ëèñò íàñòðîåê"
IDS_OUT_OF_MEMORY "Ïàìÿòü ïåðåïîëíåíà"
IDS_CANNOT_SAVE_CHANGES "Íåâîçìîæíî ñîõðàíèòü ñäåëàííûå èçìåíåíèÿ"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/sv-SE.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/sv-SE.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/sv-SE.rc Thu Sep 27 00:34:08 2007
@@ -54,6 +54,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "&Egenskaper", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "&Inaktivera", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -122,4 +125,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Unable to create property sheet"
IDS_OUT_OF_MEMORY "Out of memory"
IDS_CANNOT_SAVE_CHANGES "Unable to save the changes you made"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/lang/uk-UA.rc…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/lang/uk-UA.rc (original)
+++ trunk/reactos/dll/cpl/ncpa/lang/uk-UA.rc Thu Sep 27 00:34:08 2007
@@ -60,6 +60,9 @@
RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8
PUSHBUTTON "Âëàñ&òèâîñò³", IDC_PROPERTIES, 10, 150, 50, 14
PUSHBUTTON "Âè&ìêíóòè", IDC_ENDISABLE, 66, 150, 50, 14
+ RTEXT "",IDC_STATUS,83,20,98,8
+ RTEXT "",IDC_DURATION,83,34,98,8
+ RTEXT "",IDC_SPEED,83,48,98,8
END
IDD_CARDSUPPORT DIALOG DISCARDABLE 0, 0, 200,180
@@ -128,4 +131,13 @@
IDS_CANNOT_CREATE_PROPSHEET "Íåìîæëèâî ñòâîðèòè â³êíî âëàñòèâîñòåé"
IDS_OUT_OF_MEMORY "Íåäîñòàòíüî ïàì'ÿò³"
IDS_CANNOT_SAVE_CHANGES "Íåìîæëèâî çáåðåãòè âíåñåí³ çì³íè"
+ IDS_STATUS_NON_OPERATIONAL "Non-operational"
+ IDS_STATUS_UNREACHABLE "No WAN adapter found"
+ IDS_STATUS_DISCONNECTED "Disconnected"
+ IDS_STATUS_CONNECTING "Connecting"
+ IDS_STATUS_CONNECTED "Connected"
+ IDS_STATUS_OPERATIONAL "Connected"
+ IDS_SPEED_MBPS "%d Mbps"
+ IDS_DURATION_DAY "%d day %s"
+ IDS_DURATION_DAYS "%d days %s"
END
Modified: trunk/reactos/dll/cpl/ncpa/ncpa.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/ncpa.c?rev=29…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/ncpa.c (original)
+++ trunk/reactos/dll/cpl/ncpa/ncpa.c Thu Sep 27 00:34:08 2007
@@ -243,22 +243,27 @@
static INT_PTR CALLBACK
NICPropertyPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- PROPSHEETPAGE *pPage = (PROPSHEETPAGE *)GetWindowLongPtr(hwndDlg,GWL_USERDATA);
+ PGLOBAL_NCPA_DATA pGlobalData = (PGLOBAL_NCPA_DATA)GetWindowLongPtr(hwndDlg,
DWLP_USER);
+
switch(uMsg)
{
case WM_INITDIALOG:
{
- TCHAR *tpszCfgInstanceID;
DWORD dwType,dwSize;
TCHAR tpszSubKey[MAX_PATH];
TCHAR tpszDisplayName[MAX_PATH];
HKEY hKey;
- pPage = (PROPSHEETPAGE *)lParam;
- tpszCfgInstanceID = (TCHAR*)pPage->lParam;
- if(!FindNICClassKeyForCfgInstance(tpszCfgInstanceID,tpszSubKey))
+
+ pGlobalData = (PGLOBAL_NCPA_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
+ if (pGlobalData == NULL)
+ return FALSE;
+
+ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
+
+ if(!FindNICClassKeyForCfgInstance(pGlobalData->CurrentAdapterName, tpszSubKey))
{
MessageBox(hwndDlg,_T("NIC Entry not found"),_T("Registry
error"),MB_ICONSTOP);
- MessageBox(hwndDlg,tpszCfgInstanceID,tpszSubKey,MB_ICONSTOP);
+ MessageBox(hwndDlg,pGlobalData->CurrentAdapterName,tpszSubKey,MB_ICONSTOP);
}
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,tpszSubKey,0,KEY_QUERY_VALUE,&hKey)!=ERROR_SUCCESS)
@@ -272,7 +277,6 @@
SetDlgItemText(hwndDlg,IDC_NETCARDNAME,tpszDisplayName);
EnableWindow(GetDlgItem(hwndDlg,IDC_CONFIGURE),FALSE);
- SetWindowLongPtr(hwndDlg,GWL_USERDATA,(DWORD_PTR)lParam);
//SetDlgItemTextA(hwndDlg,IDC_NETCARDNAME,Info[pPage->lParam].Description);
EnumRegKeys(NICPropertyProtocolCallback,hwndDlg,HKEY_LOCAL_MACHINE,_T("System\\CurrentControlSet\\Control\\Network\\{4D36E975-E325-11CE-BFC1-08002BE10318}"));
@@ -312,62 +316,14 @@
// drop though
case IDC_PROPERTIES:
{
- TCHAR *tpszSubKey = NULL;
- TCHAR tpszNDIKey[MAX_PATH];
- TCHAR tpszClsIDText[MAX_PATH];
- TCHAR *tpszTCPIPClsID = _T("{A907657F-6FDF-11D0-8EFB-00C04FD912B2}");
- HKEY hNDIKey;
- DWORD dwType,dwSize;
- HWND hListBox = GetDlgItem(hwndDlg,IDC_COMPONENTSLIST);
- int iListBoxIndex = (int) SendMessage(hListBox,LB_GETCURSEL,0,0);
- if(iListBoxIndex != LB_ERR)
- tpszSubKey = (TCHAR*)SendMessage(hListBox,LB_GETITEMDATA,iListBoxIndex,0);
- if(!tpszSubKey)
- break;
- _stprintf(tpszNDIKey,_T("%s\\Ndi"),tpszSubKey);
-
- RegOpenKeyEx(HKEY_LOCAL_MACHINE,tpszNDIKey,0,KEY_QUERY_VALUE,&hNDIKey);
- dwSize = sizeof(tpszClsIDText);
- if(RegQueryValueEx(hNDIKey,_T("ClsId"),NULL,&dwType,(BYTE*)tpszClsIDText,&dwSize)!=
ERROR_SUCCESS || dwType != REG_SZ)
- ;//return;
- RegCloseKey(hNDIKey);
-
- if(_tcscmp(tpszTCPIPClsID,tpszClsIDText)==0)
+ if(pGlobalData->pCurrentAdapterInfo)
{
- IP_ADAPTER_INFO Adapters[64];
- IP_ADAPTER_INFO *pAdapter;
- TCHAR *tpszCfgInstanceID;
- ULONG ulSize = sizeof(Adapters);
- memset(&Adapters,0x00,sizeof(Adapters));
- if(GetAdaptersInfo(Adapters,&ulSize)!=ERROR_SUCCESS)
- break;;
- pAdapter = Adapters;
- tpszCfgInstanceID = (TCHAR*)pPage->lParam;
- while(pAdapter)
- {
- TCHAR tpszAdapterName[MAX_PATH];
- swprintf(tpszAdapterName,L"%S",pAdapter->AdapterName);
- DPRINT("IPHLPAPI returned: %S\n", tpszAdapterName);
- if(_tcscmp(tpszAdapterName,tpszCfgInstanceID)==0)
- {
- DisplayTCPIPProperties(hwndDlg,pAdapter);
- break;
- } else
- {
- DPRINT("... which is not the TCPIP property sheet\n");
- }
- pAdapter = pAdapter->Next;
- if(!pAdapter)
- {
- MessageBox(NULL,_T("If you see this, then the IPHLPAPI.DLL probably needs
more work because GetAdaptersInfo did not return the expected
data."),_T("Error"),MB_ICONSTOP);
- }
- }
-
- } else
+ DisplayTCPIPProperties(hwndDlg, pGlobalData->pCurrentAdapterInfo);
+ }
+ else
{
- MessageBox(NULL,_T("This control panel is incomplete.\r\nUsually, the
\"Notify Object\" for this Network component should be invoked here. Reactos
lacks the infrastructure to do this right now.\r\n- C++\r\n- DDK Headers for notify
objects\r\n- clean header structure, that allow Windows-Compatible COM C++
Code"),_T("Error"),MB_ICONSTOP);
- }
-
+ MessageBox(NULL,_T("If you see this, then the IPHLPAPI.DLL probably needs more
work because GetAdaptersInfo did not return the expected
data."),_T("Error"),MB_ICONSTOP);
+ }
}
break;
}
@@ -378,7 +334,7 @@
static void
-DisplayNICProperties(HWND hParent,TCHAR *tpszCfgInstanceID)
+DisplayNICProperties(HWND hParent, GLOBAL_NCPA_DATA* pGlobalData)
{
PROPSHEETPAGE psp[1];
PROPSHEETHEADER psh;
@@ -387,6 +343,13 @@
DWORD dwType = REG_SZ;
TCHAR tpszName[MAX_PATH];
DWORD dwSize = sizeof(tpszName);
+ TCHAR tpszCfgInstanceID[MAX_ADAPTER_NAME_LENGTH];
+
+#ifndef _UNICODE
+ WideCharToMultiByte(CP_UTF8, 0, pGlobalData->CurrentAdapterName, -1,
tpszCfgInstanceID, MAX_ADAPTER_NAME_LENGTH, 0, 0);
+#else
+ wcscpy(tpszCfgInstanceID, pGlobalData->CurrentAdapterName);
+#endif
// Get the "Name" for this Connection
_stprintf(tpszSubKey,_T("System\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection"),tpszCfgInstanceID);
@@ -412,21 +375,286 @@
psh.pfnCallback = NULL;
- InitPropSheetPage(&psp[0], IDD_NETPROPERTIES,
NICPropertyPageProc,(LPARAM)tpszCfgInstanceID);
+ InitPropSheetPage(&psp[0], IDD_NETPROPERTIES, NICPropertyPageProc,
(LPARAM)pGlobalData);
PropertySheet(&psh);
return;
}
+void RefreshNICInfo(HWND hwndDlg, PGLOBAL_NCPA_DATA pGlobalData)
+{
+ ULONG BufferSize;
+ DWORD ErrRet = 0;
+
+ if (pGlobalData->pFirstAdapterInfo)
+ HeapFree(GetProcessHeap(), 0, pGlobalData->pFirstAdapterInfo);
+
+ BufferSize = sizeof(IP_ADAPTER_INFO);
+ pGlobalData->pFirstAdapterInfo = (PIP_ADAPTER_INFO) HeapAlloc(GetProcessHeap(), 0,
BufferSize);
+
+ if (GetAdaptersInfo(pGlobalData->pFirstAdapterInfo, &BufferSize) ==
ERROR_BUFFER_OVERFLOW)
+ {
+ HeapFree(GetProcessHeap(), 0, pGlobalData->pFirstAdapterInfo);
+ pGlobalData->pFirstAdapterInfo = (PIP_ADAPTER_INFO) HeapAlloc(GetProcessHeap(),
0, BufferSize);
+ }
+
+ if ((ErrRet = GetAdaptersInfo(pGlobalData->pFirstAdapterInfo, &BufferSize)) !=
NO_ERROR)
+ {
+ MessageBox(hwndDlg, _T("error adapterinfo")
,_T("ncpa.cpl"),MB_ICONSTOP);
+
+ if (pGlobalData->pFirstAdapterInfo)
+ HeapFree(GetProcessHeap(), 0, pGlobalData->pFirstAdapterInfo);
+ }
+}
+
+void UpdateCurrentAdapterInfo(HWND hwndDlg, PGLOBAL_NCPA_DATA pGlobalData)
+{
+ PIP_INTERFACE_INFO pInfo;
+ ULONG BufferSize = 0;
+ DWORD dwRetVal = 0;
+
+ if (!pGlobalData->pCurrentAdapterInfo)
+ return;
+
+ BufferSize = sizeof(IP_INTERFACE_INFO);
+ pInfo = (PIP_INTERFACE_INFO) HeapAlloc(GetProcessHeap(), 0, BufferSize);
+ if (ERROR_INSUFFICIENT_BUFFER == GetInterfaceInfo(pInfo, &BufferSize))
+ {
+ HeapFree(GetProcessHeap(), 0, pInfo);
+ pInfo = (PIP_INTERFACE_INFO) HeapAlloc(GetProcessHeap(), 0, BufferSize);
+ }
+
+ dwRetVal = GetInterfaceInfo(pInfo, &BufferSize);
+ if (NO_ERROR == dwRetVal)
+ {
+ DWORD i;
+
+ for (i = 0; i < pInfo->NumAdapters; i++)
+ {
+ if (0 == wcscmp(pGlobalData->CurrentAdapterName, pInfo->Adapter[i].Name))
+ {
+ if (pInfo->Adapter[i].Index != pGlobalData->pCurrentAdapterInfo->Index)
+ {
+ RefreshNICInfo(hwndDlg, pGlobalData);
+
+ pGlobalData->pCurrentAdapterInfo = pGlobalData->pFirstAdapterInfo;
+ while (pGlobalData->pCurrentAdapterInfo)
+ {
+ if (pGlobalData->pCurrentAdapterInfo->Index == pInfo->Adapter[i].Index)
+ return;
+
+ pGlobalData->pCurrentAdapterInfo =
pGlobalData->pCurrentAdapterInfo->Next;
+ }
+ }
+ }
+ }
+ }
+ else if (ERROR_NO_DATA == dwRetVal)
+ DPRINT("There are no network adapters with IPv4 enabled on the local
system\n");
+ else
+ DPRINT1("GetInterfaceInfo failed.\n");
+}
+
+static VOID
+UpdateNICStatusData(HWND hwndDlg, PGLOBAL_NCPA_DATA pGlobalData)
+{
+ DWORD dwRet = NO_ERROR;
+
+ if (pGlobalData->pCurrentAdapterInfo)
+ {
+ if (NULL == pGlobalData->pIfTable)
+ {
+ pGlobalData->IfTableSize = sizeof(MIB_IFTABLE);
+ pGlobalData->pIfTable = (PMIB_IFTABLE)HeapAlloc(GetProcessHeap(), 0,
pGlobalData->IfTableSize);
+ if (NULL == pGlobalData->pIfTable)
+ {
+ static BOOL firstError = TRUE;
+ if (firstError)
+ {
+ firstError = FALSE;
+ DPRINT1("Out of memory - could not allocate MIB_IFTABLE(1)");
+ return;
+ }
+ }
+ }
+
+ /* Call GetIfTable once to see if we have a large enough buffer */
+ dwRet = GetIfTable(pGlobalData->pIfTable, &pGlobalData->IfTableSize, FALSE);
+ if (ERROR_INSUFFICIENT_BUFFER == dwRet)
+ {
+ HeapFree(GetProcessHeap(), 0, pGlobalData->pIfTable);
+
+ pGlobalData->pIfTable = (PMIB_IFTABLE)HeapAlloc(GetProcessHeap(), 0,
pGlobalData->IfTableSize);
+ if (NULL == pGlobalData->pIfTable)
+ {
+ static BOOL firstError = TRUE;
+ if (firstError)
+ {
+ firstError = FALSE;
+ DPRINT1("Out of memory - could not allocate MIB_IFTABLE(2)");
+ }
+
+ pGlobalData->IfTableSize = 0;
+ return;
+ }
+
+ dwRet = GetIfTable(pGlobalData->pIfTable, &pGlobalData->IfTableSize,
FALSE);
+ if (NO_ERROR != dwRet)
+ {
+ HeapFree(GetProcessHeap(), 0, pGlobalData->pIfTable);
+ pGlobalData->pIfTable = NULL;
+ pGlobalData->IfTableSize = 0;
+ return;
+ }
+ }
+ }
+
+ if (NO_ERROR == dwRet)
+ {
+ DWORD i;
+ DWORD PktsOut = 0;
+ DWORD PktsIn = 0;
+ DWORD Mbps = 0;
+ DWORD OperStatus = IF_OPER_STATUS_DISCONNECTED;
+ PMIB_IFROW pIfRow = NULL;
+ TCHAR Buffer[256], LocBuffer[256];
+ SYSTEMTIME TimeConnected;
+
+ memset(&TimeConnected, 0, sizeof(TimeConnected));
+
+ if (pGlobalData->pCurrentAdapterInfo)
+ {
+ UpdateCurrentAdapterInfo(hwndDlg, pGlobalData);
+
+ for (i = 0; i < pGlobalData->pIfTable->dwNumEntries; i++)
+ {
+ pIfRow = (PMIB_IFROW)&pGlobalData->pIfTable->table[i];
+
+ if (pIfRow->dwIndex == pGlobalData->pCurrentAdapterInfo->Index)
+ {
+ DWORD DurationSeconds;
+ SYSTEMTIME SystemTime;
+ FILETIME SystemFileTime;
+ ULARGE_INTEGER LargeSystemTime;
+
+ PktsOut = pIfRow->dwOutUcastPkts;
+ PktsIn = pIfRow->dwInUcastPkts;
+ Mbps = pIfRow->dwSpeed;
+ OperStatus = pIfRow->dwOperStatus;
+
+ /* TODO: For some unknown reason, this doesn't correspond to the Windows
duration */
+ GetSystemTime(&SystemTime);
+ SystemTimeToFileTime(&SystemTime, &SystemFileTime);
+ LargeSystemTime = *(ULARGE_INTEGER *)&SystemFileTime;
+ LargeSystemTime.QuadPart /= 100000ULL;
+ DurationSeconds = ((LargeSystemTime.LowPart - pIfRow->dwLastChange) / 100);
+ TimeConnected.wSecond = (DurationSeconds % 60);
+ TimeConnected.wMinute = (DurationSeconds / 60) % 60;
+ TimeConnected.wHour = (DurationSeconds / (60 * 60)) % 24;
+ TimeConnected.wDay = DurationSeconds / (60 * 60 * 24);
+
+ break;
+ }
+ }
+ }
+
+ _stprintf(Buffer, L"%u", PktsOut);
+ GetNumberFormat(LOCALE_USER_DEFAULT, 0, Buffer, NULL, LocBuffer, sizeof(LocBuffer) /
sizeof(LocBuffer[0]));
+ SendDlgItemMessage(hwndDlg, IDC_SEND, WM_SETTEXT, 0, (LPARAM)LocBuffer);
+
+ _stprintf(Buffer, L"%u", PktsIn);
+ GetNumberFormat(LOCALE_USER_DEFAULT, 0, Buffer, NULL, LocBuffer, sizeof(LocBuffer) /
sizeof(LocBuffer[0]));
+ SendDlgItemMessage(hwndDlg, IDC_RECEIVED, WM_SETTEXT, 0, (LPARAM)LocBuffer);
+
+ switch (OperStatus)
+ {
+ case IF_OPER_STATUS_NON_OPERATIONAL:
+ OperStatus = IDS_STATUS_NON_OPERATIONAL;
+ break;
+
+ case IF_OPER_STATUS_UNREACHABLE:
+ OperStatus = IDS_STATUS_UNREACHABLE;
+ break;
+
+ case IF_OPER_STATUS_DISCONNECTED:
+ OperStatus = IDS_STATUS_DISCONNECTED;
+ break;
+
+ case IF_OPER_STATUS_CONNECTING:
+ OperStatus = IDS_STATUS_CONNECTING;
+ break;
+
+ case IF_OPER_STATUS_CONNECTED:
+ OperStatus = IDS_STATUS_CONNECTED;
+ break;
+
+ case IF_OPER_STATUS_OPERATIONAL:
+ /* TODO: Find sub status, waiting for DHCP address, etc. */
+ OperStatus = IDS_STATUS_OPERATIONAL;
+ break;
+
+ default:
+ DPRINT1("Unknown operation status: %d\n", OperStatus);
+ OperStatus = IDS_STATUS_OPERATIONAL;
+ break;
+ }
+ LoadString(hApplet, OperStatus, LocBuffer, sizeof(LocBuffer) / sizeof(LocBuffer[0]));
+ SendDlgItemMessage(hwndDlg, IDC_STATUS, WM_SETTEXT, 0, (LPARAM)LocBuffer);
+
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &TimeConnected,
L"HH':'mm':'ss", LocBuffer, sizeof(LocBuffer) /
sizeof(LocBuffer[0]));
+ if (0 == TimeConnected.wDay)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_DURATION, WM_SETTEXT, 0, (LPARAM)LocBuffer);
+ }
+ else
+ {
+ TCHAR DayBuffer[256];
+ if (1 == TimeConnected.wDay)
+ {
+ LoadString(hApplet, IDS_DURATION_DAY, DayBuffer, sizeof(DayBuffer) /
sizeof(DayBuffer[0]));
+ }
+ else
+ {
+ LoadString(hApplet, IDS_DURATION_DAYS, DayBuffer, sizeof(DayBuffer) /
sizeof(DayBuffer[0]));
+ }
+ _sntprintf(Buffer, 256, DayBuffer, TimeConnected.wDay, LocBuffer);
+ SendDlgItemMessage(hwndDlg, IDC_DURATION, WM_SETTEXT, 0, (LPARAM)Buffer);
+ }
+
+ LoadString(hApplet, IDS_SPEED_MBPS, LocBuffer, sizeof(LocBuffer) /
sizeof(LocBuffer[0]));
+ _sntprintf(Buffer, 256, LocBuffer, Mbps / 1000000);
+ SendDlgItemMessage(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)Buffer);
+ }
+ else
+ {
+ static BOOL firstError = TRUE;
+ if (firstError)
+ {
+ firstError = FALSE;
+ DPRINT1("GetIfTable failed with error code: %d\n", dwRet);
+ return;
+ }
+ }
+}
+
static INT_PTR CALLBACK
NICStatusPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ PGLOBAL_NCPA_DATA pGlobalData;
+ pGlobalData = (PGLOBAL_NCPA_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
+
switch(uMsg)
{
case WM_INITDIALOG:
{
- PROPSHEETPAGE *psp= (PROPSHEETPAGE *)lParam;
+ pGlobalData = (PGLOBAL_NCPA_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
+ if (pGlobalData == NULL)
+ return FALSE;
+
+ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
+
EnableWindow(GetDlgItem(hwndDlg,IDC_ENDISABLE),FALSE);
- SetWindowLongPtr(hwndDlg,DWL_USER,(DWORD_PTR)psp->lParam);
+ pGlobalData->hStatsUpdateTimer = SetTimer(hwndDlg, 1, 1000, NULL);
+ UpdateNICStatusData(hwndDlg, pGlobalData);
}
break;
case WM_COMMAND:
@@ -434,11 +662,27 @@
{
case IDC_PROPERTIES:
{
- TCHAR *tpszCfgInstance;
- tpszCfgInstance = (TCHAR*)GetWindowLong(hwndDlg,DWL_USER);
- DisplayNICProperties(hwndDlg,tpszCfgInstance);
- }
- break;
+ DisplayNICProperties(hwndDlg, pGlobalData);
+ }
+ break;
+ }
+ break;
+ case WM_TIMER:
+ {
+ UpdateNICStatusData(hwndDlg, pGlobalData);
+ }
+ break;
+ case WM_DESTROY:
+ {
+ KillTimer(hwndDlg, pGlobalData->hStatsUpdateTimer);
+ pGlobalData->hStatsUpdateTimer = 0;
+
+ if (pGlobalData->pIfTable)
+ {
+ HeapFree(GetProcessHeap(), 0, pGlobalData->pIfTable);
+ pGlobalData->pIfTable = NULL;
+ pGlobalData->IfTableSize = 0;
+ }
}
break;
}
@@ -448,57 +692,36 @@
static INT_PTR CALLBACK
NICSupportPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
-
+ PGLOBAL_NCPA_DATA pGlobalData;
+ pGlobalData = (PGLOBAL_NCPA_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
+
switch(uMsg)
{
case WM_INITDIALOG:
- {
- TCHAR Buffer[64];
-
- PIP_ADAPTER_INFO pAdapterInfo = NULL;
- ULONG adaptOutBufLen;
-
- DWORD ErrRet = 0;
-
- pAdapterInfo = (IP_ADAPTER_INFO *) malloc( sizeof(IP_ADAPTER_INFO) );
- adaptOutBufLen = sizeof(IP_ADAPTER_INFO);
-
- if (GetAdaptersInfo( pAdapterInfo, &adaptOutBufLen) == ERROR_BUFFER_OVERFLOW)
- {
- free(pAdapterInfo);
- pAdapterInfo = (IP_ADAPTER_INFO *) malloc (adaptOutBufLen);
- }
-
- if ((ErrRet = GetAdaptersInfo(pAdapterInfo, &adaptOutBufLen)) != NO_ERROR)
- {
- MessageBox(hwndDlg, _T("error adapterinfo")
,_T("ncpa.cpl"),MB_ICONSTOP);
-
- if (pAdapterInfo) free(pAdapterInfo);
+ {
+ pGlobalData = (PGLOBAL_NCPA_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
+ if (pGlobalData == NULL)
return FALSE;
- }
-
- if (pAdapterInfo)
- {
- /*FIXME: select the correct adapter info!!*/
-
- if (pAdapterInfo->DhcpEnabled)
+
+ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
+
+ if (pGlobalData->pCurrentAdapterInfo)
+ {
+ TCHAR Buffer[64];
+
+ if (pGlobalData->pCurrentAdapterInfo->DhcpEnabled)
LoadString(hApplet, IDS_ASSIGNED_DHCP, Buffer, sizeof(Buffer) / sizeof(TCHAR));
else
LoadString(hApplet, IDS_ASSIGNED_MANUAL, Buffer, sizeof(Buffer) / sizeof(TCHAR));
SendDlgItemMessage(hwndDlg, IDC_DETAILSTYPE, WM_SETTEXT, 0, (LPARAM)Buffer);
- _stprintf(Buffer, _T("%S"),
pAdapterInfo->IpAddressList.IpAddress.String);
+ _stprintf(Buffer, _T("%S"),
pGlobalData->pCurrentAdapterInfo->IpAddressList.IpAddress.String);
SendDlgItemMessage(hwndDlg, IDC_DETAILSIP, WM_SETTEXT, 0, (LPARAM)Buffer);
- _stprintf(Buffer, _T("%S"), pAdapterInfo->IpAddressList.IpMask.String);
+ _stprintf(Buffer, _T("%S"),
pGlobalData->pCurrentAdapterInfo->IpAddressList.IpMask.String);
SendDlgItemMessage(hwndDlg, IDC_DETAILSSUBNET, WM_SETTEXT, 0, (LPARAM)Buffer);
- _stprintf(Buffer, _T("%S"),
pAdapterInfo->GatewayList.IpAddress.String);
+ _stprintf(Buffer, _T("%S"),
pGlobalData->pCurrentAdapterInfo->GatewayList.IpAddress.String);
SendDlgItemMessage(hwndDlg, IDC_DETAILSGATEWAY, WM_SETTEXT, 0, (LPARAM)Buffer);
-
- free(pAdapterInfo);
- }
-
-
-
+ }
}
break;
case WM_COMMAND:
@@ -530,6 +753,17 @@
DWORD dwType = REG_SZ;
TCHAR tpszName[MAX_PATH];
DWORD dwSize = sizeof(tpszName);
+ PGLOBAL_NCPA_DATA pGlobalData;
+ PIP_ADAPTER_INFO pInfo;
+ WCHAR wcsAdapterName[MAX_ADAPTER_NAME];
+
+ pGlobalData = (PGLOBAL_NCPA_DATA)GetWindowLongPtr(hParent, DWLP_USER);
+
+#ifndef _UNICODE
+ MultiByteToWideChar(CP_UTF8, 0, tpszCfgInstanceID, -1,
pGlobalData->CurrentAdapterName, MAX_ADAPTER_NAME);
+#else
+ wcscpy(pGlobalData->CurrentAdapterName, tpszCfgInstanceID);
+#endif
// Get the "Name" for this Connection
_stprintf(tpszSubKey,_T("System\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection"),tpszCfgInstanceID);
@@ -555,9 +789,25 @@
psh.nStartPage = 0;
psh.ppsp = psp;
psh.pfnCallback = NULL;
-
- InitPropSheetPage(&psp[0], IDD_CARDPROPERTIES, NICStatusPageProc,
(LPARAM)tpszCfgInstanceID);
- InitPropSheetPage(&psp[1], IDD_CARDSUPPORT, NICSupportPageProc,
(LPARAM)tpszCfgInstanceID);
+
+ RefreshNICInfo(hParent, pGlobalData);
+
+ pGlobalData->pCurrentAdapterInfo = NULL;
+ pInfo = pGlobalData->pFirstAdapterInfo;
+ while (pInfo)
+ {
+ MultiByteToWideChar(CP_UTF8, 0, pInfo->AdapterName, -1, wcsAdapterName,
MAX_ADAPTER_NAME);
+ if (0 == wcscmp(wcsAdapterName, pGlobalData->CurrentAdapterName))
+ {
+ pGlobalData->pCurrentAdapterInfo = pInfo;
+ break;
+ }
+
+ pInfo = pInfo->Next;
+ }
+
+ InitPropSheetPage(&psp[0], IDD_CARDPROPERTIES, NICStatusPageProc,
(LPARAM)pGlobalData);
+ InitPropSheetPage(&psp[1], IDD_CARDSUPPORT, NICSupportPageProc,
(LPARAM)pGlobalData);
PropertySheet(&psh);
return;
@@ -682,9 +932,15 @@
{
case WM_INITDIALOG:
{
+ PGLOBAL_NCPA_DATA pGlobalData =
(PGLOBAL_NCPA_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
+ if (pGlobalData == NULL)
+ return FALSE;
+
+ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
+
EnableWindow(GetDlgItem(hwndDlg,IDC_ADD),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_REMOVE),FALSE);
-
+
EnumAdapters(hwndDlg);
SendDlgItemMessage(hwndDlg,IDC_NETCARDLIST,LB_SETCURSEL,0,0);
}
@@ -738,11 +994,17 @@
static LONG CALLBACK
DisplayApplet(VOID)
{
+ PGLOBAL_NCPA_DATA pGlobalData;
PROPSHEETPAGE psp[1];
PROPSHEETHEADER psh = {0};
TCHAR Caption[1024];
+ int Ret;
LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
+
+ pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_NCPA_DATA));
+ if (pGlobalData == NULL)
+ return 0;
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPSHEETPAGE;
@@ -755,9 +1017,13 @@
psh.ppsp = psp;
psh.pfnCallback = NULL;
- InitPropSheetPage(&psp[0], IDD_PROPPAGENETWORK, NetworkPageProc,0);
-
- return (LONG)(PropertySheet(&psh) != -1);
+ InitPropSheetPage(&psp[0], IDD_PROPPAGENETWORK, NetworkPageProc,
(LPARAM)pGlobalData);
+
+ Ret = PropertySheet(&psh);
+
+ HeapFree(GetProcessHeap(), 0, pGlobalData);
+
+ return (LONG)(Ret != -1);
}
/* Control Panel Callback */
@@ -814,3 +1080,4 @@
}
+
Modified: trunk/reactos/dll/cpl/ncpa/ncpa.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/ncpa.h?rev=29…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/ncpa.h (original)
+++ trunk/reactos/dll/cpl/ncpa/ncpa.h Thu Sep 27 00:34:08 2007
@@ -11,6 +11,16 @@
CPLAPPLET_PROC AppletProc;
} APPLET, *PAPPLET;
+typedef struct
+{
+ WCHAR CurrentAdapterName[MAX_ADAPTER_NAME];
+ UINT_PTR hStatsUpdateTimer;
+ PMIB_IFTABLE pIfTable;
+ DWORD IfTableSize;
+ PIP_ADAPTER_INFO pFirstAdapterInfo;
+ PIP_ADAPTER_INFO pCurrentAdapterInfo;
+} GLOBAL_NCPA_DATA, *PGLOBAL_NCPA_DATA;
+
extern HINSTANCE hApplet;
extern ULONG DbgPrint(PCCH Fmt, ...);
Modified: trunk/reactos/dll/cpl/ncpa/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/ncpa/resource.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/ncpa/resource.h (original)
+++ trunk/reactos/dll/cpl/ncpa/resource.h Thu Sep 27 00:34:08 2007
@@ -35,6 +35,15 @@
#define IDS_CANNOT_CREATE_PROPSHEET 3005
#define IDS_OUT_OF_MEMORY 3006
#define IDS_CANNOT_SAVE_CHANGES 3007
+#define IDS_STATUS_NON_OPERATIONAL 4001
+#define IDS_STATUS_UNREACHABLE 4002
+#define IDS_STATUS_DISCONNECTED 4003
+#define IDS_STATUS_CONNECTING 4004
+#define IDS_STATUS_CONNECTED 4005
+#define IDS_STATUS_OPERATIONAL 4006
+#define IDS_SPEED_MBPS 4007
+#define IDS_DURATION_DAY 4008
+#define IDS_DURATION_DAYS 4009
/* controls */
@@ -69,6 +78,9 @@
#define IDC_DETAILSTYPE 127
#define IDC_DETAILSSUBNET 128
#define IDC_DETAILSGATEWAY 129
+#define IDC_STATUS 130
+#define IDC_DURATION 131
+#define IDC_SPEED 132
#endif /* __CPL_RESOURCE_H */
/* EOF */