

Which seems to imply that the text for every window that exists is accessible without a context switch. This means that GetWindowText got the window name without performing a context switch. I used a usermode debugger so I certainly didn't end up in kernelmode while stepping without realizing it. None of these API calls seem to be able to read a string in memory not owned by the calling process. WCSToMBEx (which is basically WideCharToMultiByte).GetWindowThreadProcessId (in GetWindowLong).

I attached a debugger and stepped through the GetWindowTextA call, manually stepping through everything except these API calls (in order): HWND winmine = FindWindow(NULL,"Minesweeper") MessageBox(0,"Attach debugger and set bp","on GetWindowTextA",0) int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) I wrote a simple program to call GetWindowText with a handle to a window in a different process. I wanted to figure out what the syscalls behind GetWindowText are.
