-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
69 lines (64 loc) · 1.34 KB
/
main.c
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <hal/debug.h>
#include <hal/video.h>
#include <hal/xbox.h>
#include <nxdk/mount.h>
#include <windows.h>
void Remove_Directory(LPCSTR lpPathName)
{
if (!nxMountDrive('E', "\\Device\\Harddisk0\\Partition1\\"))
{
debugPrint("Failed to mount E: drive!\n");
return;
}
if (RemoveDirectory(lpPathName))
{
debugPrint("Directory removed successfully\n");
}
else
{
DWORD error = GetLastError();
switch (error)
{
case ERROR_DIR_NOT_EMPTY:
debugPrint("The directory is not empty.");
break;
case ERROR_PATH_NOT_FOUND:
debugPrint("The system cannot find the path specified.");
break;
default:
debugPrint("error: %lx\n", error);
}
}
}
void Delete_File(LPCSTR lpFileName)
{
if (!nxMountDrive('E', "\\Device\\Harddisk0\\Partition1\\"))
{
debugPrint("Failed to mount E: drive!\n");
return;
}
if (DeleteFile(lpFileName))
{
debugPrint("File deleted successfully\n");
}
else
{
DWORD error = GetLastError();
switch (error)
{
default:
debugPrint("error: %lx\n", error);
}
}
}
int main(void)
{
VIDEO_MODE xmode;
void *p = NULL;
while (XVideoListModes(&xmode, 0, 0, &p)) { }
XVideoSetMode(xmode.width, xmode.height, xmode.bpp, xmode.refresh);
// Remove_Directory();
// Delete_File("E:\\Apps\\hello\\ ");
XReboot();
return 0;
}