Skip to content

权限问题?Windows api error, error_code: 0X5 #16

@fatinghenji

Description

@fatinghenji

报错:

Exception in thread Thread-5 (start_server):
Traceback (most recent call last):
  File "D:\FFXIV\FFDraw\nylib\utils\win32\injection.py", line 20, in get_python_base_address
    return process.get_module_by_name(handle, python_dll_name).lpBaseOfDll
  File "D:\FFXIV\FFDraw\nylib\utils\win32\process.py", line 63, in get_module_by_name
    raise KeyError(module_name)
KeyError: b'python310.dll'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "G:\ailearning\anaconda\envs\FFDraw\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "G:\ailearning\anaconda\envs\FFDraw\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "D:\FFXIV\FFDraw\nylib\utils\win32\inject_rpc.py", line 66, in start_server
    res = injection.exec_shell_code(self.process_handle, shell_code.encode('utf-8'), True)
  File "D:\FFXIV\FFDraw\nylib\utils\win32\injection.py", line 29, in exec_shell_code
    return process.remote_call(handle, get_python_base_address(handle, auto_inject) + pyfunc_offset(b'PyRun_SimpleString'), shell_code)
  File "D:\FFXIV\FFDraw\nylib\utils\win32\injection.py", line 23, in get_python_base_address
    base = process.inject_dll(handle, python_dll_info.filename)
  File "D:\FFXIV\FFDraw\nylib\utils\win32\process.py", line 69, in inject_dll
    return remote_call(handle, load_library_a_address, filepath)
  File "D:\FFXIV\FFDraw\nylib\utils\win32\process.py", line 233, in remote_call
    start_thread(handle, code_address)
  File "D:\FFXIV\FFDraw\nylib\utils\win32\process.py", line 110, in start_thread
    raise exception.WinAPIError()
nylib.utils.win32.exception.WinAPIError: Windows api error, error_code: 0X5

这个错误是由于程序无法找到名为 python310.dll 的模块而引发的。您可以检查一下您的系统中是否安装了 Python 3.10,以及该文件是否存在于您的系统中。此外,错误代码 0X5 表示您没有足够的权限来执行某些操作。您可以尝试以管理员身份运行程序,看看是否能解决问题。

  • 使用的是conda创建的虚拟环境,在conda的虚拟环境路径中存在python310.dll
    image
  • 使用管理员身份运行powershell,激活虚拟环境,使用 python main_cn.py运行程序。
  • python版本:3.10.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions