79520275

Date: 2025-03-19 13:04:25
Score: 1.5
Natty:
Report link

I haven't got the rep to respond to @Mark Brackett's answer, I had to change a .ToInt32() to .TonInt64() which stopped the OverflowException I was getting with the example code.

This line

var pCurrentSessionInfo = new IntPtr(pSessionInfo.ToInt32() + (NativeMethods.SESSION_INFO_502.SIZE_OF * i));

Becomes

var pCurrentSessionInfo = new IntPtr(pSessionInfo.ToInt64() + (NativeMethods.SESSION_INFO_502.SIZE_OF * i));
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Mark
  • Low reputation (1):
Posted by: Whoo