Thread: \\.\pipe\WinUAE
View Single Post
Old 21 October 2015, 21:22   #7
chaos
Registered User

chaos's Avatar
 
Join Date: Mar 2013
Location: Slovenia
Posts: 131
Hi,

I tried this myself (might come handy someday!), here's what I came up with:

- you should use win32file module (part of Python Win32 extensions), since using plain open() on a named pipe doesn't work so well (it does open, but windows being windows, the named pipe is 'special', not like in unix)
- win32file API: http://docs.activestate.com/activepy...win32file.html
- use ipctester.cpp & uaeipc.cpp as a guide
- the ipc_restore, ipc_quit, ipc_debug and ipc_event commands work
- none of the events or config options I tried to set were recognized (I got a 404 response), I don't know why
- I successfully used the debug commands, those work OK

Here's the code snippets, if it's any help:

- import win32file module:
Code:
from win32file import *
- open the WinUAE pipe (the syntax is basically copied from ipctester.cpp):
Code:
up = CreateFile(r'\\.\pipe\WinUAE', GENERIC_READ | GENERIC_WRITE, 0, None, OPEN_EXISTING, 0, None)
- write into pipe:
Code:
WriteFile(up, 'ipc_restore\0', None)
- read return status (reads are blocking, careful)
Code:
ReadFile(up, 4096)
# or to directly print the result:
print ReadFile(up, 4096)[1]
- close pipe:
Code:
CloseHandle(up)
So, debug stuff works:
Code:
WriteFile(up, 'DBG ea\0')
print ReadFile(up, 4096)[1]
but not much else ... for now ...

toni: what is the proper syntax of ipc message to, for example, set config value nr_floppies?

I tried lots of variations like 'CFG nr_floppies=1', but I always get a 404 response.

Last edited by TCD; 23 October 2015 at 11:01. Reason: Back-to-back posts merged.
chaos is online now  
 
Page generated in 0.05199 seconds with 9 queries