问题描述
我编写了一个可以在Windows XP上运行多年的应用程序,没有任何问题.
现在,我必须将其移植到Win7.
该应用程序包括我用C语言编写的Windows服务.该服务在LOCAL SYSTEM帐户下运行,并使用DLL,我的其他一些应用程序也使用了该DLL.
有些应用程序是用C编写的,而有些则是用VB编写的. DLL使用CreateFileMapping()
为所有客户端创建一个共享内存区域.在Windows XP上,所有客户端都可以看到共享内存区域的相同副本,以便一个应用程序可以更改变量的值,而所有其他应用程序可以看到新值.
现在,在Windows 7中,客户端似乎无法看到与ServiceApp相同的共享内存区域.就像ServiceApp拥有自己的共享内存专用副本一样.
这可能与Microsoft更改Vista和Win7的会话ID"行为的方式有关吗?我的ServiceApp的会话ID = 0,客户端的会话ID = 1.
在XP上,它们都是Session ID = 0.
有什么简单的方法可以解决此限制.
I wrote an app that has been running on Windows XP for years with no issues.
Now I have to port it over to Win7.
The app includes a Windows Service that I wrote in C. The service runs under the LOCAL SYSTEM account and uses a DLL that is also used by some of my other apps.
Some of the apps are written in C and some in VB. The DLL creates a shared memory area for all clients using CreateFileMapping()
. On Windows XP all clients can see the same copy of the shared memory area so that one app can change a variable''s value and all other apps can see the new value.
Now with Windows 7 the clients don''t seem to be able to see the same shared memory area that the ServiceApp sees. It is as if the ServiceApp has its own private copy of the shared memory.
Could this be related to the way Microsoft changed the "Session ID" behavior for Vista and Win7? My ServiceApp has Session ID=0 and the clients are Session ID=1.
On XP they were all Session ID=0.
Is there an easy way around this restriction.
推荐答案
这篇关于Windows 7中的DLL共享内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!