Git Product home page Git Product logo

Comments (30)

peterberbec avatar peterberbec commented on June 3, 2024 1

BTW: You're the best. Just thought the world should know that.

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024 1

I rolled back to v1.0.0 on client and server, and it still functioned fine. It seems:

  1. all the juggling hasn't broken things irredemably
  2. DLLs can be changed on the fly. Once MSTSC crashes, if I overwrite the dll file with another version, that one loads. Same with the exe on the server. Quitting and starting a new one leads to version match.

This will speed up debugging because I don't have to keep rebooting both machines.

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

I'm on a Surface Pro & have never owned a laptop with more than one battery, so I'll need your knowledge to help.

In your native battery manager, how is the battery status displayed (e.g. are there two battery icons, or does the power meter show the combination of the two batteries' total charge remaining)?

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

Single battery icon in the system tray:
bat1
Two batteries if expanded:
bat2
bat3

Let me know how i can help.

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

If there is some test program you want me to run, I would be more than willing. Something to check the battery API and send you debug logs.

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

It would help me if you can post the output to the following PowerShell script:

Get-WmiObject -query "Select * from win32_Battery" 

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Make sure you remove any personal info before posting (computer name etc)

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024
__CLASS                     : Win32_Battery
__SUPERCLASS                : CIM_Battery
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_Battery.DeviceID="11241SANYO45N1773"
__PROPERTY_COUNT            : 33
__DERIVATION                : {CIM_Battery, CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                    : LAPPY2010
__NAMESPACE                 : root\cimv2
__PATH                      : \\LAPPY2010\root\cimv2:Win32_Battery.DeviceID="11241SANYO45N1773"
Availability                : 
BatteryRechargeTime         : 
BatteryStatus               : 
Caption                     : Internal Battery
Chemistry                   : 6
ConfigManagerErrorCode      : 
ConfigManagerUserConfig     : 
CreationClassName           : Win32_Battery
Description                 : Internal Battery
DesignCapacity              : 
DesignVoltage               : 12303
DeviceID                    : 11241SANYO45N1773
ErrorCleared                : 
ErrorDescription            : 
EstimatedChargeRemaining    : 99
EstimatedRunTime            : 71582788
ExpectedBatteryLife         : 
ExpectedLife                : 
FullChargeCapacity          : 
InstallDate                 : 
LastErrorCode               : 
MaxRechargeTime             : 
Name                        : 45N1773
PNPDeviceID                 : 
PowerManagementCapabilities : {1}
PowerManagementSupported    : False
SmartBatteryVersion         : 
Status                      : 
StatusInfo                  : 
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : LAPPY2010
TimeOnBattery               : 
TimeToFullCharge            : 
PSComputerName              : LAPPY2010

__GENUS                     : 2
__CLASS                     : Win32_Battery
__SUPERCLASS                : CIM_Battery
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_Battery.DeviceID="17403LGC45N1127"
__PROPERTY_COUNT            : 33
__DERIVATION                : {CIM_Battery, CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                    : LAPPY2010
__NAMESPACE                 : root\cimv2
__PATH                      : \\LAPPY2010\root\cimv2:Win32_Battery.DeviceID="17403LGC45N1127"
Availability                : 3
BatteryRechargeTime         : 
BatteryStatus               : 1
Caption                     : Internal Battery
Chemistry                   : 6
ConfigManagerErrorCode      : 
ConfigManagerUserConfig     : 
CreationClassName           : Win32_Battery
Description                 : Internal Battery
DesignCapacity              : 
DesignVoltage               : 11149
DeviceID                    : 17403LGC45N1127
ErrorCleared                : 
ErrorDescription            : 
EstimatedChargeRemaining    : 48
EstimatedRunTime            : 55
ExpectedBatteryLife         : 
ExpectedLife                : 
FullChargeCapacity          : 
InstallDate                 : 
LastErrorCode               : 
MaxRechargeTime             : 
Name                        : 45N1127
PNPDeviceID                 : 
PowerManagementCapabilities : {1}
PowerManagementSupported    : False
SmartBatteryVersion         : 
Status                      : OK
StatusInfo                  : 
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : LAPPY2010
TimeOnBattery               : 
TimeToFullCharge            : 
PSComputerName              : LAPPY2010

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Great thanks!

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

And what does your total battery percentage say right now? Want to see if I can replicate it using the data above.

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Nvm I think I can just do (batt1+batt2)/200

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Please try release v1.0.1 and let me know if it works for you.

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

As of right now, it does not. It crashes MSTSC.exe. I will try rebooting and test again.

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Also make sure that the old version of the RDS_Server_TrayApp_BattMon.exe isn't still running in your
detached terminal server session. You can temporarily move or rename the client add-in file to get it to connect if you need to terminate that exe first.

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

Renaming and rebooting the server machine too.

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

Nope. It crashes even after both machines are rebooted. Any logs I can send?

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024
- <System>
  <Provider Name="Windows Error Reporting" /> 
  <EventID Qualifiers="0">1001</EventID> 
  <Level>4</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2018-03-06T02:40:53.652294500Z" /> 
  <EventRecordID>30097</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>Lappy2010</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>1203824740160883411</Data> 
  <Data>5</Data> 
  <Data>CLR20r3</Data> 
  <Data>Not available</Data> 
  <Data>0</Data> 
  <Data>mstsc.exe</Data> 
  <Data>10.0.16299.15</Data> 
  <Data>3a40081f</Data> 
  <Data>RDS_Client_Addin_BattMon</Data> 
  <Data>1.0.0.0</Data> 
  <Data>5a9df887</Data> 
  <Data>2a</Data> 
  <Data>20</Data> 
  <Data>System.NullReferenceException</Data> 
  <Data /> 
  <Data>\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERAC5D.tmp.mdmp \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB3E1.tmp.WERInternalMetadata.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB3EF.tmp.csv \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB42E.tmp.txt \\?\C:\Users\Peter Berbec\AppData\Local\Temp\WERC17F.tmp.appcompat.txt \\?\C:\Users\Peter Berbec\AppData\Local\Temp\WERC1AE.tmp.WERDataCollectionStatus.txt</Data> 
  <Data>C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_mstsc.exe_40dce5c8e820f6eec814409721988ad8237b26f4_2d2465bf_0f95c1e9</Data> 
  <Data /> 
  <Data>0</Data> 
  <Data>cced80bb-9f01-4488-bc77-710bb6c172cc</Data> 
  <Data>2147487752</Data> 
  <Data>7f4d22beda2c3bd7f0b4d839191dcad3</Data> 
  </EventData>
  </Event>

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Hmm. I'm still trying to get the logger to work, but check Event Viewer->Application log anyway. Maybe it logged something useful.

Ah -- looks like you beat me to it.

Let me give you a debug build that might give more detail (like the line # it's crashing on). That log is only telling me that it's a NullReferenceException, but not where.

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Try these -- make sure you keep the .pdb files in the same folder; they will provide the line # debugging information.

Client (v1.0.1 Debug).zip
Server (v1.0.1 Debug).zip

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Even better -- this version has logging enabled on the client side. It should capture the exception you're getting with the stack trace. Again, please be sure to keep the .pdb file in the same folder as the DLL.

Client (v1.0.1.2 Debug).zip
Server (v1.0.1.2 Debug).zip

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

Is the new information still in the event log?

- <System>
  <Provider Name="Application Error" /> 
  <EventID Qualifiers="0">1000</EventID> 
  <Level>2</Level> 
  <Task>100</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2018-03-06T03:30:51.244440700Z" /> 
  <EventRecordID>30233</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>Lappy2010</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>mstsc.exe</Data> 
  <Data>10.0.16299.15</Data> 
  <Data>3a40081f</Data> 
  <Data>unknown</Data> 
  <Data>0.0.0.0</Data> 
  <Data>00000000</Data> 
  <Data>c0000005</Data> 
  <Data>00007ffb0c193629</Data> 
  <Data>36b4</Data> 
  <Data>01d3b4fb6ebb9a9a</Data> 
  <Data>C:\Windows\system32\mstsc.exe</Data> 
  <Data>unknown</Data> 
  <Data>89bfb725-a930-4e09-afe4-3840451c4c99</Data> 
  <Data /> 
  <Data /> 
  </EventData>
  </Event>

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024
- <System>
  <Provider Name=".NET Runtime" /> 
  <EventID Qualifiers="0">1026</EventID> 
  <Level>2</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2018-03-06T03:30:49.916300500Z" /> 
  <EventRecordID>30232</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>Lappy2010</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>Application: mstsc.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException at FieldEffect.Classes.Win32BatteryManagementObjectSearcher.GetAllBatteries() at FieldEffect.Models.BatteryDataReporter._clientAddIn_DataChannelEvent(System.Object, FieldEffect.VCL.Client.DataChannelEventArgs) at FieldEffect.VCL.Client.RdpClientVirtualChannel.OnDataChannelEvent(FieldEffect.VCL.Client.DataChannelEventArgs) at FieldEffect.VCL.Client.RdpClientVirtualChannel.VirtualChannelOpenEvent(Int32, FieldEffect.VCL.Client.WtsApi32.ChannelEvents, Byte[], Int32, UInt32, FieldEffect.VCL.Client.WtsApi32.ChannelFlags)</Data> 
  </EventData>
  </Event>

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

Those were from 1.0.1 debug. loading 1.0.2 now

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

1.0.1.2:

- <System>
  <Provider Name="Windows Error Reporting" /> 
  <EventID Qualifiers="0">1001</EventID> 
  <Level>4</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2018-03-06T03:38:22.594850200Z" /> 
  <EventRecordID>30242</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>Lappy2010</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>1833787917323518067</Data> 
  <Data>5</Data> 
  <Data>CLR20r3</Data> 
  <Data>Not available</Data> 
  <Data>0</Data> 
  <Data>mstsc.exe</Data> 
  <Data>10.0.16299.15</Data> 
  <Data>3a40081f</Data> 
  <Data>RDS_Client_Addin_BattMon</Data> 
  <Data>1.0.1.0</Data> 
  <Data>5a9e0ad3</Data> 
  <Data>2b</Data> 
  <Data>68</Data> 
  <Data>System.NullReferenceException</Data> 
  <Data /> 
  <Data>\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER2B8A.tmp.mdmp \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER34A4.tmp.WERInternalMetadata.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER34B1.tmp.csv \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER34F1.tmp.txt \\?\C:\Users\Peter Berbec\AppData\Local\Temp\WER4280.tmp.appcompat.txt \\?\C:\Users\Peter Berbec\AppData\Local\Temp\WER42A0.tmp.WERDataCollectionStatus.txt</Data> 
  <Data>C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_mstsc.exe_3edcc19b72aba3b85e9781e9c4bda1e80e62e59_2d2465bf_15dc42da</Data> 
  <Data /> 
  <Data>0</Data> 
  <Data>ffe79c66-7891-4e97-a06e-aa69ea2fc2f9</Data> 
  <Data>2147487752</Data> 
  <Data>9792ade44c9760f5f972ec651d78c073</Data> 
  </EventData>
  </Event>

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Application Error" /> 
  <EventID Qualifiers="0">1000</EventID> 
  <Level>2</Level> 
  <Task>100</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2018-03-06T03:38:16.126011400Z" /> 
  <EventRecordID>30241</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>Lappy2010</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>mstsc.exe</Data> 
  <Data>10.0.16299.15</Data> 
  <Data>3a40081f</Data> 
  <Data>unknown</Data> 
  <Data>0.0.0.0</Data> 
  <Data>00000000</Data> 
  <Data>c0000005</Data> 
  <Data>00007ffb0c14bff9</Data> 
  <Data>e0c</Data> 
  <Data>01d3b4fc844c4599</Data> 
  <Data>C:\Windows\system32\mstsc.exe</Data> 
  <Data>unknown</Data> 
  <Data>ffe79c66-7891-4e97-a06e-aa69ea2fc2f9</Data> 
  <Data /> 
  <Data /> 
  </EventData>
  </Event>


- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name=".NET Runtime" /> 
  <EventID Qualifiers="0">1026</EventID> 
  <Level>2</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2018-03-06T03:38:14.704141900Z" /> 
  <EventRecordID>30240</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>Lappy2010</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>Application: mstsc.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException at FieldEffect.Classes.Win32BatteryManagementObjectSearcher.GetAllBatteries() at FieldEffect.Models.BatteryDataReporter._clientAddIn_DataChannelEvent(System.Object, FieldEffect.VCL.Client.DataChannelEventArgs) at FieldEffect.VCL.Client.RdpClientVirtualChannel.OnDataChannelEvent(FieldEffect.VCL.Client.DataChannelEventArgs) at FieldEffect.VCL.Client.RdpClientVirtualChannel.VirtualChannelOpenEvent(Int32, FieldEffect.VCL.Client.WtsApi32.ChannelEvents, Byte[], Int32, UInt32, FieldEffect.VCL.Client.WtsApi32.ChannelFlags)</Data> 
  </EventData>
  </Event>

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

The referenced wer file. Hope this doesn't contain anything too bad.

Report.wer.txt

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Can you please try this version & see if the crash goes away?

Client (v1.0.1.3 Debug).zip
Server (v1.0.1.3 Debug).zip

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

Not crashing anymore.

batmon

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Well, it's a start... 😄

from rdp-battmon.

peterberbec avatar peterberbec commented on June 3, 2024

:)

from rdp-battmon.

transistor1 avatar transistor1 commented on June 3, 2024

Created a new issue for this problem

from rdp-battmon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.