In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the reason for WinIO initialization failure", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "What is the reason for WinIO initialization failure"!
WinIO is a library that opens up some of the operating system IO privileges, simply by loading some drivers. The port can be accessed directly through the loaded driver. In industrial control, we can use this library to directly manipulate the address of the IO card. For example, I have recently done a CNC drilling and milling machine IO card and motion control card is a very old card, in WIN98 below the normal work, but in the NT core will appear illegal command call problem. These illegal commands come from direct address access to IO cards and motion control cards at the bottom. In the 98 era, these operations were not protected, and protection problems occurred under NT core. After testing, after WinIO initialization load driver and then IO card direct access, very successful.
However, when it was applied, there were some inexplicable problems. To apply WinIO, you only need to call two functions InitializeWinIo() and finally ShutdownWinIo(). InitializeWinIo() returns a bool value indicating the initialization result. This is the function that causes a lot of trouble.
The first trouble is that in a debug, initialization often fails, and once successful, it always succeeds. At first I thought it was caused by InitializeWinIo() without ShutdownWinIoI(), but later I read WinIO's C Example to prove that just writing InitializeWinIo() can be the same as once the process ends, the resources initialized by InitializeWinIo naturally end. So there's nothing about the last run that affects this run. Then suddenly found that WinIO related dll,vxd,sys is actually green. Green in Windows XP represents files that are EFS encrypted. For the sake of project confidentiality, I have encrypted all project catalogues with EFS. EFS encryption affects disk performance because of the encryption and decryption process. But here is very strange, may be intermittent EFS decryption speed did not keep up with WinIO load driver speed, resulting in reading sys and vxd device driver is confusing, eventually leading to load failure. Cancel EFS encryption, problem solved.
The second time around I wrote a dllimport in C#and called it, it always returned false. Very confused, WinIO related files are put together, how is it still like this? The VS2005 unit test also failed. The reason is still the problem of the path. Analyzing the WinIO source code, you can see that InitializeWinIo() calls a GetDriverPath function:
bool GetDriverPath(){PSTR pszSlash;if (! GetModuleFileName(GetModuleHandle(NULL), szWinIoDriverPath, sizeof(szWinIoDriverPath)))return false;pszSlash = strrchr(szWinIoDriverPath, '\');if (pszSlash)pszSlash[1] = 0;elsereturn false;strcat(szWinIoDriverPath, "winio.sys");return true;}
It's pretty clear what the situation is. Notice where winio.sys is stored to initialize it properly.
In fact, you can print out the execution process of each step in InitializeWinIo() in more detail, so that it is easier to determine where the problem occurs.
Let's write here first. WinIO is a very good, very powerful, very yellow and violent library ~~~
At this point, I believe that everyone has a deeper understanding of "what is the reason for WinIO initialization failure". Let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.