【问题标题】:Accessing the fan under Windows 7Windows 7下访问风扇
【发布时间】:2011-12-14 21:17:31
【问题描述】:

我尝试在 64 位 Windows 7 操作系统上从 WinIO 编译示例“DumbPort”,但是当我运行程序时,我总是收到此错误,用户权限不足。我已将 winIO64.dll 和 winIO64.sys 放在同一个目录中,例如 DumbPort。在示例的源代码中,错误消息不是很有帮助,因为这意味着找到了 WinIo 库但无法对其进行初始化。我正在使用 Visual Studio 8,但我不确定如何调试它。代码如下:

 private void Form1_Load(object sender, EventArgs e)
    {
        // Check if this is a 32 bit or 64 bit system
        if (IntPtr.Size == 4)
        {
            hMod = LoadLibrary("WinIo32.dll");

        }
        else if (IntPtr.Size == 8)
        {
            hMod = LoadLibrary("WinIo64.dll");
        }

        if (hMod == IntPtr.Zero)
        {
            MessageBox.Show("Can't find WinIo dll.\nMake sure the WinIo library files are located in the same directory as your executable file.", "DumpPort", MessageBoxButtons.OK, MessageBoxIcon.Error);
            this.Close();
        }

        IntPtr pFunc = GetProcAddress(hMod, "InitializeWinIo");

        if (pFunc != IntPtr.Zero)
        {
            InitializeWinIoType InitializeWinIo = (InitializeWinIoType)Marshal.GetDelegateForFunctionPointer(pFunc, typeof(InitializeWinIoType));
            bool Result = InitializeWinIo();

            if (!Result)
            {
                MessageBox.Show("Error returned from InitializeWinIo.\nMake sure you are running with administrative privileges and that the WinIo library files are located in the same directory as your executable file.", "DumpPort", MessageBoxButtons.OK, MessageBoxIcon.Error);
                FreeLibrary(hMod);
                this.Close();
            }
        }

【问题讨论】:

  • 您在提升的权限下运行?
  • 是的。我正在使用 Windows Home 7。
  • 过去我只是使用 WinRing0 并取得了巨大的成功。同样,这一切都取决于主板上的芯片以及您可以做什么。可能就像我的情况,很多逆向工程。
  • 那家伙需要资金,下载链接坏了:winring0.com-about.com/download.html
  • sourceforge.net/projects/winring0 不起作用存档为空。这个项目死了吗?

标签: c# windows io hardware


【解决方案1】:

到目前为止,我已经解决了 winring0 的问题:http://www.chihoang.de/code-schnipsel/amilo-xa-3530/fsc-xa-3530-fan-control-v01-windows.html。目前我正在尝试编写一个内核驱动程序和一个系统托盘程序来控制它。

【讨论】:

    猜你喜欢
    • 2023-03-29
    • 1970-01-01
    • 2010-11-21
    • 1970-01-01
    • 2011-04-29
    • 1970-01-01
    • 1970-01-01
    • 2017-04-19
    • 1970-01-01
    相关资源
    最近更新 更多