Subversion Repositories Kolibri OS

Rev

Rev 616 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 616 Rev 763
Line 1... Line 1...
1
unit Windows;
1
unit Windows;
Line -... Line 2...
-
 
2
 
-
 
3
{$mode objfpc}
-
 
4
 
2
 
5
 
Line -... Line 6...
-
 
6
interface
-
 
7
 
-
 
8
 
-
 
9
type
-
 
10
  WinBool = LongBool;
-
 
11
  Bool    = WinBool;
-
 
12
  Handle  = System.THandle;
-
 
13
  THandle = Handle;
-
 
14
 
-
 
15
  OVERLAPPED = record
-
 
16
    Internal : DWORD;
-
 
17
    InternalHigh : DWORD;
-
 
18
    Offset : DWORD;
-
 
19
    OffsetHigh : DWORD;
-
 
20
    hEvent : HANDLE;
-
 
21
  end;
-
 
22
  LPOVERLAPPED = ^OVERLAPPED;
-
 
23
  _OVERLAPPED = OVERLAPPED;
-
 
24
  TOVERLAPPED = OVERLAPPED;
-
 
25
  POVERLAPPED = ^OVERLAPPED;
-
 
26
 
-
 
27
 
-
 
28
 
-
 
29
function GetStdHandle(nStdHandle: DWord): Handle;
-
 
30
{function SetStdHandle(nStdHandle:DWORD; hHandle:HANDLE): WinBool;}
-
 
31
 
-
 
32
function WriteFile(hFile: THandle; const Buffer; nNumberOfBytesToWrite: DWord; var lpNumberOfBytesWritten: DWord; lpOverlapped: POverlapped): Bool;
-
 
33
 
-
 
34
function Std_Input_Handle: DWord;
-
 
35
function Std_Output_Handle: DWord;
-
 
36
function Std_Error_Handle: DWord;
-
 
37
 
-
 
38
function GetTickCount: DWord;
-
 
39
function QueryPerformanceCounter(var lpPerformanceCount: Int64): WinBool;
-
 
40
function QueryPerformanceFrequency(var lpFrequency: Int64): WinBool;
-
 
41
 
-
 
42
function AllocConsole: WinBool;
-
 
43
{function FreeConsole: WinBool;}
3
interface
44
 
Line -... Line 45...
-
 
45
 
-
 
46
implementation
-
 
47
 
-
 
48
 
-
 
49
function GetStdHandle(nStdHandle: DWord): Handle;
-
 
50
begin
-
 
51
  Result := 0;
-
 
52
end;
-
 
53
 
-
 
54
function Std_Input_Handle: DWord;
-
 
55
begin
-
 
56
  Result := 0;
-
 
57
end;
-
 
58
 
-
 
59
function Std_Output_Handle: DWord;
-
 
60
begin
-
 
61
  Result := 1;
-
 
62
end;
-
 
63
 
-
 
64
function Std_Error_Handle: DWord;
-
 
65
begin
-
 
66
  Result := 2;
-
 
67
end;
-
 
68
 
-
 
69
 
-
 
70
function WriteFile(hFile: THandle; const Buffer; nNumberOfBytesToWrite: DWord; var lpNumberOfBytesWritten: DWord; lpOverlapped: POverlapped): Bool;
-
 
71
begin
-
 
72
  Result := True;
-
 
73
end;
-
 
74
 
-
 
75
 
-
 
76
function GetTickCount: DWord;
-
 
77
begin
-
 
78
  Result := kos_timecounter() * 10;
-
 
79
end;
-
 
80
 
-
 
81
function QueryPerformanceCounter(var lpPerformanceCount: Int64): WinBool;
-
 
82
begin
-
 
83
  lpPerformanceCount := kos_timecounter();
-
 
84
  Result := True
-
 
85
end;
-
 
86
 
-
 
87
function QueryPerformanceFrequency(var lpFrequency: Int64): WinBool;
-
 
88
begin
-
 
89
  lpFrequency := 100;
-
 
90
  Result := True
-
 
91
end;
-
 
92
 
-
 
93
 
-
 
94
function AllocConsole: WinBool;
-
 
95
begin
-
 
96
  Result := True;
4
 
97
end;