Skip to content
/ GTerm Public

[BUG] 32-bit executable dies if launched via explorer #4

@artemking4

Description

@artemking4

https://github.com/Earu/GTerm/blob/master/Program.cs#L56

Unhandled exception. System.ComponentModel.Win32Exception (299): A 32 bit processes cannot access modules of a 64 bit process.
   at System.Diagnostics.NtProcessManager.GetModules(Int32 processId, Boolean firstModuleOnly)
   at System.Diagnostics.NtProcessManager.GetFirstModule(Int32 processId)
   at System.Diagnostics.Process.get_MainModule()
   at GTerm.Program.Main(String[] args)

Activity

Earu

Earu commented on Dec 22, 2025

@Earu
Owner

@artemking4 you should use the x64 executable in the releases. Because as the error says a x86 process cannot access information of a x64 one. It's not so much a bug as a limitation really.

artemking4

artemking4 commented on Dec 22, 2025

@artemking4
Author

Yeah but in the october 2024 release you state the x64 version must be used for the x86-64 version of the game, and the x32 for others. I am currently limited to the x32 version, and, when trying x64, it didnt seem to find my gmod process or something.

Image

Contrary to the release note, should gterm64 work for main-branch gmod?

Earu

Earu commented on Dec 22, 2025

@Earu
Owner

Should be fixed in e9976c3.

There were two issues:

  • A 32 bit processes cannot access modules of a 64 bit process., I believe this is when using mismatched versions of gterm and garrysmod. Nonetheless I made this check more resilient and fail silently if that happens again because it's not a critical part of gterm.

  • Could not find Gmod directory: length ('-1') must be a non-negative value. (Parameter 'length') Actual value was -1.. The issue was that when running the default version of garrysmod the process path did not have the GarrysMod/bin sub-string, whereas when running the x64 branch it does, this resulted in an breaking error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Earu@artemking4

      Issue actions