Click here to Skip to main content
16,004,686 members

Comments by chiselca (Top 4 by date)

chiselca 27-Sep-12 10:41am View    
Yes it works as a regular user in XP, Win7 32 bit and Win7 64 bit, that was a requirement. I wish I could help you more. I will tell you that I never had a problem that frustrated me so much. I fought it for weeks and was very close to giving up and redesigning my app when I figured out the MessageBox issue. My advice would be, keep plugging away. It works. It's very easy to convince yourself that it works for everyone but you. It doesn't. It works for everybody if you do everything right. You're probably missing something simple.
chiselca 27-Sep-12 8:57am View    
It's been 2 years but I remember that my main problem was I had MessageBox calls that were executing and stopping the thread before the code that sets up the file mapping even ran. You can't use MessageBox calls in the process that is running in Session 0 because the user will not see them and therefore cannot dismiss them, so they pause the thread forever. Other than that I followed the advice on this forum thread and got it working. Here is some of my code, hope it helps:

// Attempt to create a named file mapping object.
hMapObject = CreateFileMapping(
(HANDLE) 0xFFFFFFFF, // use paging file
&sa, // specific security attributes
PAGE_READWRITE, // read/write access
0, // size: high 32-bits
sizeof(TsharedMem), // size: low 32-bits
"Global\\MyFileMap"); // name of map object

sa is defined as --

TCHAR * szSD = TEXT("D:") // Discretionary ACL
TEXT("(D;OICI;GA;;;BG)") // Deny access to built-in guests
TEXT("(A;OICI;GA;;;BA)") // Allow SDDL_GENERIC_ALL (GA) to administrators (BA)
TEXT("(A;OICI;FA;;;BU)"); // Allow FILE_ALL_ACCESS (FA) to built-in Users (BU)


ConvertStringSecurityDescriptorToSecurityDescriptor(
szSD,
SDDL_REVISION_1,
&(sa->lpSecurityDescriptor),
NULL);
chiselca 16-Nov-10 6:58am View    
On the 64 bit machine I am watching my service's registry keys under the "WOW6432Node". They don't update until the service is stopped. Likewise, on the 32 bit VM I monitor my keys under "HKLM\Software" and they also do not update until the service is stopped. Where else could the service possibly be writing to? On Windows XP the registry keys are updated immediately while the service is running. Also, with regards to 'Reflection', from what I have read Reflection is disabled in Windows 7.
chiselca 15-Nov-10 14:37pm View    
Dave, Yes, it IS a 32 bit app, but see my further explanations below regarding 32 bit and 64 bit Windows. And yes, I am aware, but only recently, about the Wow6432Node registry key. On my x64 machine that node is not getting updated until the service is stopped.