Questions tagged [psapi]

The Microsoft process status application programming interface (PSAPI) is a helper library that makes it easier for you to obtain information about processes and device drivers.

The process status API (PSAPI) provides sets of functions for retrieving the following information:

  • Process Information
  • Module Information
  • Device Driver Information
  • Process Memory Usage Information
  • Working Set Information
  • Memory-Mapped File Information

PSAPI Functions

29 questions
9
votes
1 answer

How to get Windows window names with ctypes in python

I try to get Windows window title names and pids through handles with long objects. My code works but there is something wrong with it. I get only 4 window titles when I should get 10 or more. Can anyone help and tell me how to fix this code? I…
Gunnm
  • 974
  • 3
  • 10
  • 21
2
votes
0 answers

PSRCCODEINFO obtained with SymEnumLine has Address with few extra bytes

I'm following this article on Windows Debugging and end up with something like this: #include #include #include #include #include #include std::string get_last_error_message() { …
Moonslate
  • 51
  • 5
2
votes
1 answer

Why does the compiler throw "undefined reference to ..." despite providing all needed libraries in the arguments

I'm working on a program that will monitor the usage of chosen programs and will log it into a .csv file. That way, I can determine what programs use up the most of a certain resource while I run a game in full-screen. I have included the psapi…
Jamesthe1
  • 107
  • 14
2
votes
1 answer

Kotlin: Create and refer true Java arrays (for JNA)

I am trying to use JNA with Kotlin and I've ran into a problem. Caused by: java.lang.IllegalArgumentException: class [Lcom.sun.jna.platform.win32.WinDef$HMODULE; is not a supported argument type (in method EnumProcessModulesEx in class…
Jire
  • 9,680
  • 14
  • 52
  • 87
1
vote
1 answer

What is the equivalent of POSIX's group ID on Windows?

When analyzing the process tree in C++, POSIX allows you to prune it using group ID. Several processes may be added to a particular group. Eg. see the following POSIX function. add my process to a group Does Windows have an equivalent of the…
The Vivandiere
  • 3,059
  • 3
  • 28
  • 50
1
vote
0 answers

" 'LPVOID' does not name a type" when including Psapi.h for C++ in CodeBlocks

I'm trying to include psapi.h in a Code::Blocks C++ console project, but it does not allow me to use it. From the informations I've been able to gather in 3 hours of googling, I need to include a Library(it seems to be psapi.lib) in the project by…
David
  • 123
  • 1
  • 10
1
vote
2 answers

Why does Windows deny access to some processes' names?

i wanted to try to build a little program which can read the memory of other programs and dump it into a text file(if it has access obviously). But the access seems to be a problem right beforehand to me. I first tried a bit around and wanted to…
Yastanub
  • 1,227
  • 8
  • 19
1
vote
2 answers

Why does changing the order of including psapi.h gives compilation erros?(Indentifier BOOL is undefined)

I am using Visual Studio Community 2017 to code c++. When I run the following code everything works fine. #include "pch.h" #include #include #include #include int main() { std::cout << "Really!! How do…
Chief A
  • 510
  • 10
  • 24
1
vote
0 answers

Why does any value from Process Memory Counter is not similar to the memory used value shown in the task manager?

Process Memory Counter is defined structure available in the psapi (Process Status API). Its structure is defined as, typedef struct _PROCESS_MEMORY_COUNTERS { DWORD cb; DWORD PageFaultCount; SIZE_T PeakWorkingSetSize; SIZE_T…
kowsikbabu
  • 499
  • 1
  • 6
  • 23
1
vote
1 answer

C++ Windows - How to get process path from its PID (error)

I want to use pid to get the full path of the process. #include HANDLE processHandle = NULL; TCHAR filename[MAX_PATH]; processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, nPID); if (processHandle != NULL) { …
areum
  • 93
  • 3
  • 14
1
vote
0 answers

Why is the committed memory reported by PSAPI smaller than the used physical memory?

This question concerns the PERFORMANCE_INFORMATION struct from the Process Status API (PSAPI) on Windows. From the documentation, I would assume that CommitTotal >= (PhysicalTotal - PhysicalAvailable) since CommitTotal also includes the page file in…
user1824468
1
vote
1 answer

Java JNA - Base Address Finding

I am currently attempting to read/write to memory through the use of JNA for Java. For the past week I have tried a multitude of solutions, mostly from [similar projects][1] I have found online, but nothing has resolved my problem. I know I am…
user3570967
1
vote
0 answers

Unresolved external symbol GetProcessMemoryInfo

I'm trying to compile an Apache HTTP server module. One of the steps involves compiling from source. The problem is that I'm getting wsgi_memory.obj : error LNK2019: unresolved external symbol GetProcessMemoryInfo referenced in function get…
Julio Cáceres
  • 141
  • 2
  • 7
1
vote
1 answer

Using string without CRT library? Any workarounds?

Here's a little code I'm working on: http://pastebin.com/92Nzc6pG I basically inject code into a running process, but the problem is, that CRT library is no longer valid, so I can't use strings for example. Is there any workarounds for that? Rest of…
user5203771
0
votes
0 answers

Run windows app under WINE. Function GetModuleInformation return error code 5

I try to run my windows app on Linux using Wine, but it fail with error "Access denied". I have found the cause of my problem is function GetModuleInformation. It return the error code 5. I use Astra Linux Special Edition; version 1.7.4.11 Wine…
1
2