summaryrefslogtreecommitdiffhomepage
path: root/dev/DDK/KernelDev.c
blob: a04f59861d892f536806f249df13c0e0c378659d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* -------------------------------------------

	Copyright ZKA Technologies.

	Purpose: DDK Text I/O.

------------------------------------------- */

#include <DDK/KernelDev.h>
#include <DDK/KernelString.h>

/// @brief Open a new binary device from path.
DK_EXTERN KERNEL_DEVICE_PTR KernelOpenDevice(const char* devicePath)
{
	if (!devicePath)
		return nil;

	return KernelCall("ZkOpenDevice", 1, (void*)devicePath, KernelStringLength(devicePath));
}

/// @brief Close any device.
/// @param device valid device.
DK_EXTERN void KernelCloseDevice(KERNEL_DEVICE_PTR device)
{
	if (!device)
		return;

	KernelCall("ZkCloseDevice", 1, device, sizeof(KERNEL_DEVICE));
}