first, Thank you read this 🙂
I use DLL shared Memory and using interlocked~ functions. (Win 7)
DLL loaded by service exe and user app exe.
you know, service session is 0, user session is 1 so different.
if DLL’s shared memory value changed by user app exe, not reflected service’s DLL shared memory value.
is there a way to sync service and user app’s DLL shared memory?
Shared sections don’t work across session boundaries any more. Microsoft considered this a security problem and deliberately broke the feature, quite some time ago if memory serves. I believe each session now sees its own private copy of the section.
However memory mapped files (MMFs) work fine, and I use this in place of shared sections now. The only downer is that globally-available MMFs have to be created with high privilege, so I use a service to create the MMF.