aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Hjortshoej <hoej@northwolfprod.com>2018-01-24 07:26:29 +0100
committerMikkel Hjortshoej <hoej@northwolfprod.com>2018-01-24 07:26:29 +0100
commit4c3e65791e43c60592ec76456754f1118aa2dd88 (patch)
tree6f567782490947d29e302aed46a76a53bdda5795
parenta9c8031b613d7da7a03ab42a06078818afb5a5ad (diff)
added stuff to windows.odin
-rw-r--r--core/sys/windows.odin60
1 files changed, 59 insertions, 1 deletions
diff --git a/core/sys/windows.odin b/core/sys/windows.odin
index 55b131d16..053d1d31b 100644
--- a/core/sys/windows.odin
+++ b/core/sys/windows.odin
@@ -124,7 +124,33 @@ Security_Attributes :: struct {
inherit_handle: Bool,
}
-
+Process_Information :: struct {
+ process: Handle,
+ thread: Handle,
+ process_id: u32,
+ thread_id: u32
+}
+
+Startup_Info :: struct {
+ cb : u32,
+ reserved : ^u16,
+ desktop : ^u16,
+ title : ^u16,
+ x : u32,
+ y : u32,
+ x_size : u32,
+ y_size : u32,
+ x_count_chars : u32,
+ y_count_chars : u32,
+ fill_attribute : u32,
+ flags : u32,
+ show_window : u16,
+ _ : u16,
+ _ : ^byte,
+ stdin : Handle,
+ stdout : Handle,
+ stderr : Handle,
+}
Pixel_Format_Descriptor :: struct {
size,
@@ -429,9 +455,38 @@ GET_FILEEX_INFO_LEVELS :: i32;
GetFileExInfoStandard: GET_FILEEX_INFO_LEVELS : 0;
GetFileExMaxInfoLevel: GET_FILEEX_INFO_LEVELS : 1;
+STARTF_USESHOWWINDOW :: 0x00000001;
+STARTF_USESIZE :: 0x00000002;
+STARTF_USEPOSITION :: 0x00000004;
+STARTF_USECOUNTCHARS :: 0x00000008;
+STARTF_USEFILLATTRIBUTE :: 0x00000010;
+STARTF_RUNFULLSCREEN :: 0x00000020; // ignored for non-x86 platforms
+STARTF_FORCEONFEEDBACK :: 0x00000040;
+STARTF_FORCEOFFFEEDBACK :: 0x00000080;
+STARTF_USESTDHANDLES :: 0x00000100;
+STARTF_USEHOTKEY :: 0x00000200;
+STARTF_TITLEISLINKNAME :: 0x00000800;
+STARTF_TITLEISAPPID :: 0x00001000;
+STARTF_PREVENTPINNING :: 0x00002000;
+STARTF_UNTRUSTEDSOURCE :: 0x00008000;
+
+
+MOVEFILE_REPLACE_EXISTING :: 0x00000001;
+MOVEFILE_COPY_ALLOWED :: 0x00000002;
+MOVEFILE_DELAY_UNTIL_REBOOT :: 0x00000004;
+MOVEFILE_WRITE_THROUGH :: 0x00000008;
+MOVEFILE_CREATE_HARDLINK :: 0x00000010;
+MOVEFILE_FAIL_IF_NOT_TRACKABLE :: 0x00000020;
+
@(default_calling_convention = "std")
foreign kernel32 {
@(link_name="GetLastError") get_last_error :: proc() -> i32 ---;
+ @(link_name="CreateProcessA") create_process_a :: proc(application_name, command_line: ^byte,
+ process_attributes, thread_attributes: ^Security_Attributes,
+ inherit_handle: Bool, creation_flags: u32, environment: rawptr,
+ current_direcotry: ^byte, startup_info : ^Startup_Info,
+ process_information : ^Process_Information) -> Bool ---;
+ @(link_name="GetExitCodeProcess") get_exit_code_process :: proc(process: Handle, exit: ^u32) -> Bool ---;
@(link_name="ExitProcess") exit_process :: proc(exit_code: u32) ---;
@(link_name="GetModuleHandleA") get_module_handle_a :: proc(module_name: ^byte) -> Hinstance ---;
@(link_name="GetModuleHandleW") get_module_handle_w :: proc(module_name: ^u16) -> Hinstance ---;
@@ -466,6 +521,8 @@ foreign kernel32 {
@(link_name="GetFileAttributesExA") get_file_attributes_ex_a :: proc(filename: ^byte, info_level_id: GET_FILEEX_INFO_LEVELS, file_info: rawptr) -> Bool ---;
@(link_name="GetFileInformationByHandle") get_file_information_by_handle :: proc(file_handle: Handle, file_info: ^By_Handle_File_Information) -> Bool ---;
+ @(link_name="CreateDirectoryA") create_directory_a :: proc(path: ^byte, security_attributes: ^Security_Attributes) -> Bool ---;
+
@(link_name="GetFileType") get_file_type :: proc(file_handle: Handle) -> u32 ---;
@(link_name="SetFilePointer") set_file_pointer :: proc(file_handle: Handle, distance_to_move: i32, distance_to_move_high: ^i32, move_method: u32) -> u32 ---;
@@ -475,6 +532,7 @@ foreign kernel32 {
@(link_name="FindNextFileA") find_next_file_a :: proc(file : Handle, data : ^Find_Data) -> Bool ---;
@(link_name="FindClose") find_close :: proc(file : Handle) -> Bool ---;
+ @(link_name="MoveFileExA") move_file_ex_a :: proc(existing, new: ^byte, flags: u32) -> Bool ---;
@(link_name="HeapAlloc") heap_alloc :: proc(h: Handle, flags: u32, bytes: int) -> rawptr ---;
@(link_name="HeapReAlloc") heap_realloc :: proc(h: Handle, flags: u32, memory: rawptr, bytes: int) -> rawptr ---;