Platform.icl 438 Bytes
Newer Older
Mart Lubbers's avatar
Mart Lubbers committed
1
implementation module Platform
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

getDevices :: !*World -> !*([String], !*World)
getDevices w
	# (ph, w) = getProcessheap w
	# (ptr, w) = heapAlloc ph 0 4096 w
	# (ret, w) = realQDD 0 ptr 4096 w
	| ret == 0 = abort "error in QueryDosDevice"
	# res = derefString ptr
	# (ok, w) = heapFree ph 0 ptr w
	= split "\0" res

realQDD :: !Pointer !Pointer !Int !*env -> !*(Int, !*env)
realQDD _ _ _ _ =
	= code {
		ccall QueryDosDevice "ppI:I:A"
	}