简体   繁体   English

创建与Windows Service通信的非托管DLL(在C ++中)?

[英]Creating an unmanaged DLL (in C++) which communicates with Windows Service?

I had created a dll file(using C++) which captures password changes. 我创建了一个dll文件(使用C ++)来捕获密码更改。 Now I need to send it to a Windows service(created by me using C#) which uses WCF service. 现在,我需要将其发送到使用WCF服务的Windows服务(由我使用C#创建)。 How to communicate with the service? 如何与服务沟通?

(the dll is primitive,without classes,and uses _stdcall as it needs to called by Windows OS) (dll是原始的,没有类,并且在Windows操作系统需要时使用_stdcall)

Or are there any other ways to do it? 还是有其他方法可以做到? Can the dll itself can be written in C#?(unmanaged) dll本身可以用C#编写吗?(非托管)

I was in a similar situation as you and I found a much easier solution. 当您遇到类似的情况时,我发现了一个更简单的解决方案。 The sourceforge project passwdhk gives you a pre-made native DLL that implements the password filter interface. sourceforge项目passwdhk为您提供了一个预制的本机DLL,它实现了密码过滤器接口。 That DLL then will launch a external program (which you can write entirely in C#) and passing the username and password information in as arguments. 然后,该DLL将启动一个外部程序(您可以完全用C#编写),并将用户名和密码信息作为参数传递。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM