Windows Vista: Unable to load DLL 'x.dll': Invalid access to memory location. (DllNotFoundException)

狂风中的少年 提交于 2019-11-29 11:38:50
Wilka

@Martín

The reason you were not getting the UAC prompt is because UAC can only change how a process is started, once the process is running it must stay at the same elevation level. The UAC will prompt will happen if:

  • Vista thinks it's an installer (lots of rules here, the simplest one is if it's called "setup.exe"),
  • If it's flagged as "Run as Administrator" (you can edit this by changing the properties of the shortcut or the exe), or
  • If the exe contains a manifest requesting admin privileges.

The first two options are workarounds for 'legacy' applications that were around before UAC, the correct way to do it for new applications is to embed a manifest resource asking for the privileges that you need.

Some program, such as Process Explorer appear to elevate a running process (when you choose "Show details for all process" in the file menu in this case) but what they really do is start a new instance, and it's that new instance that gets elevated - not the one that was originally running. This is the recommend way of doing it if only some parts of your application need elevation (e.g. a special 'admin options' dialog).

Unable to load DLL 'HardwareID.dll': Invalid access to memory location. (Exception from HRESULT: 0x800703E6)

The name of DllNotFoundException is confusing you - this isn't a problem with finding or loading the DLL file, the problem is that when the DLL is loaded, it does an illegal memory access which causes the loading process to fail.

Like another poster here, I think this is a DEP problem, and that your UAC, etc, changes have finally allowed you to disable DEP for this application.

Is the machine you have the code deployed on a 64-bit machine? You could also be running into a DEP issue.

Edit

This is a 1st gen Macbook Pro with a 1st gen Core Duo 2 Intel processor. Far from 64 bits.

I mentioned 64 bit, because at low levels structs from 32 bit to 64 bit do not get properly handled. Since the machines aren't 64bit, then more than likely disabling DEP would be a good logical next step. Vista did get more secure than XP SP2.

Well, I've just turned DEP globally off to no avail. Same error.

Well, I also read that people were getting this error after updating a machine to Vista SP1. Do these Vista installs have SP1 on them?

Turns out to be something completely different. Just for the sake of testing, I've disabled de UAC (note: I was not getting any prompt).

Great, I was actually going to suggest that, but I figured you probably tried it already.

Have you made a support request to the vendor? Perhaps there's something about the MacBook Pro hardware that prevents the product from working.

Given that the exception is a DllNotFoundException, you might want to try checking the HardwareID.dll with Dependency Walker BEFORE installing any dev tools on the Vista install to see if there is in fact a dependency missing.

In addition to allowing full control to "Everyone" does the location also allow processes with a medium integrity level to write?

How do I check that ? I am new to Vista, I don't like it too much, it's too slow inside a VM for daily work and for VStudio usage inside a Virtual Machine, it doesn't bring anything new.

From a command prompt to you can execute:

icacls C:\Folder

If you see a line such as "Mandatory Label\High Mandatory Level" then the folder is only accessible to a high integrity process. If there is no such line then medium integrity processes can access it provided there are no other ACLs denying access (based on user for example).

EDIT: Forgot to mention you can use the /setintegritylevel switch to actually change the required integrity level for accessing the object.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!