bearcattom Posted February 8, 2005 Report Posted February 8, 2005 Hello, I am trying to write a .NET Windows Service that consumes FSUIPC for messaging FS data. When I call FSUIPC_Open (included in SDK), I am unable to return the FSUIPC or FS versions. I turned on logging in FSUIPC and it yielded the following: 345827 IPC ERROR: Cannot OpenFileMapping 346027 IPC ERROR: Cannot OpenFileMapping 346228 IPC ERROR: Cannot OpenFileMapping 346428 IPC ERROR: Cannot OpenFileMapping 346628 IPC ERROR: Cannot OpenFileMapping I assume this is a security issue with the shared file mapping created by CreateFileMapping(). Any suggestions to fix this issue are much appreciated. Tom
Pete Dowson Posted February 8, 2005 Report Posted February 8, 2005 I am trying to write a .NET Windows Service that consumes FSUIPC for messaging FS data. What language is that written in? Are you using any of the sources, libraries or wrappers in the SDK? I'm afraid the only one I know about is the C language one. 345827 IPC ERROR: Cannot OpenFileMapping Hmmm. I've never seen that error come up before. All it means is that this call to Windows returned zero (which indicates an error): hMap = OpenFileMapping(FILE_MAP_WRITE, FALSE, chId); The only reason that I know of that this may fail is that the filename is not one of an existing memory file. The "FILE_MAP_WRITE" access requested requires an existing file, and provides read and write access to it. The "chId" here is a pointer to a zero-terminated ASCIIZ string which must have been pre-registered in Windows and identified with an Atom ID. It is the Atom ID passed by the SendMessageTimeout in your program which is used in FSUIPC to retrieve the string from Windows. This method of passing the memory-mapped filename is used because it is not possible to supply strings themselves between separate processes, and pointers to them are meaningless because they refer to different virtual memories. If you are using one of the packages in the SDK exactly as supplied, with no modifications of your own, then possibly there's a bug in the one you are using. But no one has mentioned anything and there have been no changes to any of them for some time now. The first thing to do is to check you are using the correct package and actually identify the language you are using. Possibly the original author may then be able to help, or someone else using the same language. Failing that you would need to use the Debugger associated with the language you are using in order to track down the problem up to the SendMessageTimeout (or equivalent) call. All the sources are provided, so this should be possible. Regards, Pete
bearcattom Posted February 9, 2005 Author Report Posted February 9, 2005 Pete, Thanks to your pointers, I have determined the problem. According to this MSDN Article... http://msdn.microsoft.com/library/defauations.asp “The Windows Service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows Service must interact with other stations, you will need to access the unmanaged Windows API.” Thus, I'll have to figure out how to access the interactive station (same one FSUIPC is accessing). Tom
Pete Dowson Posted February 9, 2005 Report Posted February 9, 2005 Thanks to your pointers, I have determined the problem. Well done. I must say I didn't understand a word of the explanation though. I think I'm really still embedded in the world of DOS and only recently got to terms with Win98. Most of the stuff in the current Microsoft spectrum just bewilders me. Regards Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now