Compare commits

..

1 Commits

Author SHA1 Message Date
The ReactOS Team
0b9b1711a0 This commit was manufactured by cvs2svn to create branch 'FreeLoader'.
svn path=/branches/FreeLoader/; revision=1905
2001-05-15 03:50:25 +00:00
10039 changed files with 8063 additions and 3612705 deletions

0
.gitignore vendored
View File

130
freeldr/FREELDR.INI Normal file
View File

@@ -0,0 +1,130 @@
# FreeLoader by Brian Palmer
# FREELDR.INI - FreeLoader Initialization file
#
# Each line must be less than 1024 characters long
# and must be either a section heading (i.e. [section_name])
# or a setting (i.e. name=value) or a blank line.
# Comments start with a '#' character.
# Background colors can be any one of the following:
# Black
# Blue
# Green
# Cyan
# Red
# Magenta
# Brown
# Gray
# Text colors can be any one of the background
# colors and any of the following:
# DarkGray
# LightBlue
# LightGreen
# LightCyan
# LightRed
# LightMagenta
# Yellow
# White
# [FREELOADER] Section Commands:
#
# MessageBox - displays the specified text in a message box upon bootup
# MessageLine - adds a new line of text to a message box (must come before MessageBox command)
# TitleText - text that is displayed in the title box
# StatusBarColor - color of status bar's background
# StatusBarTextColor - color of status bar's text
# BackdropTextColor - color of the backdrop's fill
# BackdropColor - color of the backdrop's background
# BackdropFillStyle - backdrop fill style - can be Light, Medium, or Dark
# TitleBoxTextColor - title box text color
# TitleBoxColor - title box background color
# MessageBoxTextColor - message box text color
# MessageBoxColor - message box background color
# MenuTextColor - menu text color
# MenuColor - menu color
# TextColor - normal text color
# SelectedTextColor - selected text color
# SelectedColor - selected text background color
# TimeOut - sets the timeout (in seconds) before the first OS listed gets booted automagically
# [OS-General] Section Commands:
#
# BootType - sets the boot type: ReactOS, Linux, BootSector, Partition, Drive
# BootDrive - sets the boot drive: 0 - first floppy, 1 - second floppy, 0x80 - first hard disk, 0x81 - second hard disk
# BootPartition - sets the boot partition
# [BootSector OSType] Section Commands:
#
# BootSector - sets the filename of the bootsector to be loaded
# [ReactOS OSType] Section Commands:
#
# Options - sets the command line options for the kernel being booted
# Kernel - sets the kernel filename
# Driver - sets the name of one or more drivers to be loaded (one entry per driver)
[FREELOADER]
MessageLine=Welcome to FreeLoader!
MessageLine=Copyright (c) 2000 by Brian Palmer <brianp@sginet.com>
MessageLine=
MessageBox=Edit your FREELDR.INI file to change your boot settings.
TitleText=Boot Menu
StatusBarColor=Cyan
StatusBarTextColor=Black
BackdropTextColor=White
BackdropColor=Blue
BackdropFillStyle=Medium
TitleBoxTextColor=White
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
MenuTextColor=White
MenuColor=Blue
TextColor=Yellow
SelectedTextColor=Black
SelectedColor=Gray
#OS=ReactOS
#OS=ReactOS (Debug)
#OS=Linux
OS=3<> Floppy (A:)
OS=Microsoft Windows (C:)
OS=Drive D:
#TimeOut=0
#[ReactOS]
#BootType=ReactOS
#BootDrive=0
#Options=/DEBUGPORT=SCREEN
#Kernel=\NTOSKRNL.EXE
#Driver=\DRIVERS\IDE.SYS
#Driver=\DRIVERS\VFATFS.SYS
#[ReactOS (Debug)]
#BootType=ReactOS
#BootDrive=0
#Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=19200
#Kernel=\NTOSKRNL.EXE
#Driver=\DRIVERS\IDE.SYS
#Driver=\DRIVERS\VFATFS.SYS
#[Linux]
# Linux boot type not implemented yet
#BootType=Partition
#BootDrive=0x80
#BootPartition=2
[3<> Floppy (A:)]
BootType=Drive
BootDrive=0
[Microsoft Windows (C:)]
BootType=Drive
BootDrive=0x80
[Drive D:]
BootType=Partition
BootDrive=0x81
BootPartition=1

View File

@@ -0,0 +1,256 @@
; BOOTSECT.ASM
; FAT12/16 Boot Sector
; Copyright (c) 1998 Brian Palmer
org 7c00h
segment .text
bits 16
start:
jmp short main
nop
OEMName db 'FreeLDR!'
BytesPerSector dw 512
SectsPerCluster db 1
ReservedSectors dw 1
NumberOfFats db 2
MaxRootEntries dw 512
TotalSectors dw 2880
MediaDescriptor db 0f0h
SectorsPerFat dw 9
SectorsPerTrack dw 18
NumberOfHeads dw 2
HiddenSectors dd 0
TotalSectorsBig dd 0
BootDrive db 0
Reserved db 0
ExtendSig db 29h
SerialNumber dd 00000000h
VolumeLabel db 'FreeLoader!'
FileSystem db 'FAT12 '
main:
cli
cld
xor ax,ax
mov ss,ax
mov sp,7c00h ; Setup a stack
mov ax,cs ; Setup segment registers
mov ds,ax ; Make DS correct
mov es,ax ; Make ES correct
sti ; Enable ints now
mov [BootDrive],dl ; Save the boot drive
xor ax,ax ; Zero out AX
; Reset disk controller
int 13h
jnc Continue1
jmp BadBoot ; Reset failed...
Continue1:
; Now we must find our way to the first sector of the root directory
xor ax,ax
xor cx,cx
mov al,[NumberOfFats] ; Number of fats
mul WORD [SectorsPerFat] ; Times sectors per fat
add ax,WORD [HiddenSectors]
adc dx,WORD [HiddenSectors+2] ; Add the number of hidden sectors
add ax,[ReservedSectors] ; Add the number of reserved sectors
adc dx,cx ; Add carry bit
push ax ; Store it on the stack
push dx ; Save 32-bit logical start sector
push ax
push dx ; Save it for later use also
; DX:AX now has the number of the starting sector of the root directory
; Now calculate the size of the root directory
mov ax,0020h ; Size of dir entry
mul WORD [MaxRootEntries] ; Times the number of entries
mov bx,[BytesPerSector]
add ax,bx
dec ax
div bx ; Divided by the size of a sector
; AX now has the number of root directory sectors
xchg ax,cx ; Now CX has number of sectors
pop dx
pop ax ; Restore logical sector start
push cx ; Save for later use
mov bx,7c0h ; We will load the root directory
add bx,20h ; Right after the boot sector in memory
mov es,bx
xor bx,bx ; We will load it to [0000:7e00h]
call ReadSectors ; Read the sectors
jnc Continue2 ; BadBoot on error
jmp BadBoot
Continue2:
; Now we have to find our way through the root directory to
; The OSLOADER.SYS file
mov bx,[MaxRootEntries]; Search entire root directory
mov ax,7e0h ; We loaded at 07e0:0000
mov es,ax
xor di,di
mov si,filename
mov cx,11
rep cmpsb ; Compare filenames
jz FoundFile ; If same we found it
dec bx
jnz FindFile
jmp ErrBoot
FindFile:
mov ax,es ; We didn't find it in the previous dir entry
add ax,2 ; So lets move to the next one
mov es,ax ; And search again
xor di,di
mov si,filename
mov cx,11
rep cmpsb ; Compare filenames
jz FoundFile ; If same we found it
dec bx ; Keep searching till we run out of dir entries
jnz FindFile ; Last entry?
jmp ErrBoot
FoundFile:
xor di,di ; ES:DI has dir entry
xor dx,dx
mov ax,WORD [es:di+1ah] ; Get start cluster
dec ax
dec ax
xor ch,ch
mov cl,BYTE [SectsPerCluster] ; Times sectors per cluster
mul cx
pop cx ; Get number of sectors for root dir
add ax,cx
adc dx,0
pop cx ; Get logical start sector of
pop bx ; Root directory
add ax,bx ; Now we have DX:AX with the logical start
adc dx,cx ; Sector of OSLOADER.SYS
push ax
push dx
mov ax,WORD [es:di+1ch]
mov dx,WORD [es:di+1eh]
mov bx,[BytesPerSector]
dec bx
add ax,bx
adc dx,0
div WORD [BytesPerSector]
xchg ax,cx ; Now CX has number of sectors of OSLOADER.SYS
pop dx
pop ax
mov bx,800h
mov es,bx
xor bx,bx ; Load ROSLDR at 0000:8000h
call ReadSectors ; Load it
jc BadBoot
mov dl,[BootDrive]
xor ax,ax
push ax
mov ax,8000h
push ax ; We will do a far return to 0000:8000h
retf ; Transfer control to ROSLDR
; Reads logical sectors into [ES:BX]
; DX:AX has logical sector number to read
; CX has number of sectors to read
; CarryFlag set on error
ReadSectors:
push ax
push dx
push cx
xchg ax,cx
xchg ax,dx
xor dx,dx
div WORD [SectorsPerTrack]
xchg ax,cx
div WORD [SectorsPerTrack] ; Divide logical by SectorsPerTrack
inc dx ; Sectors numbering starts at 1 not 0
xchg cx,dx
div WORD [NumberOfHeads] ; Number of heads
mov dh,dl ; Head to DH, drive to DL
mov dl,[BootDrive] ; Drive number
mov ch,al ; Cylinder in CX
ror ah,1 ; Low 8 bits of cylinder in CH, high 2 bits
ror ah,1 ; in CL shifted to bits 6 & 7
or cl,ah ; Or with sector number
mov ax,513
int 13h ; DISK - READ SECTORS INTO MEMORY
; AL = number of sectors to read, CH = track, CL = sector
; DH = head, DL = drive, ES:BX -> buffer to fill
; Return: CF set on error, AH = status (see AH=01h), AL = number of sectors read
pop cx
pop dx
pop ax
jc ReadFail
inc ax ;Increment Sector to Read
jnz NoCarry
inc dx
NoCarry:
push bx
mov bx,es
add bx,20h
mov es,bx
pop bx
; Increment read buffer for next sector
loop ReadSectors ; Read next sector
ReadFail:
ret
; Displays a bad boot message
; And reboots
BadBoot:
mov si,msgDiskError ; Bad boot disk message
call PutChars ; Display it
mov si,msgAnyKey ; Press any key message
call PutChars ; Display it
jmp Reboot
; Displays an error message
; And reboots
ErrBoot:
mov si,msgFreeLdr ; FreeLdr not found message
call PutChars ; Display it
mov si,msgAnyKey ; Press any key message
call PutChars ; Display it
Reboot:
xor ax,ax
int 16h ; Wait for a keypress
int 19h ; Reboot
PutChars:
lodsb
or al,al
jz short Done
mov ah,0eh
mov bx,07h
int 10h
jmp short PutChars
Done:
retn
msgDiskError db 'Disk error',0dh,0ah,0
msgFreeLdr db 'FREELDR.SYS not found',0dh,0ah,0
msgAnyKey db 'Press any key to continue.',0dh,0ah,0
filename db 'FREELDR SYS'
times 510-($-$$) db 0 ; Pad to 510 bytes
dw 0aa55h ; BootSector signature

View File

@@ -0,0 +1,351 @@
; BTSECT32.ASM
; FAT32 Boot Sector
; Copyright (c) 1998, 2000 Brian Palmer
org 7c00h
segment .text
bits 16
start:
jmp short main
nop
OEMName db 'FreeLDR!'
BytesPerSector dw 512
SectsPerCluster db 1
ReservedSectors dw 1
NumberOfFats db 2
MaxRootEntries dw 0 ;512 - Always zero for FAT32 volumes
TotalSectors dw 0 ;2880 - Always zero for FAT32 volumes
MediaDescriptor db 0f8h
SectorsPerFat dw 0 ;9 - Always zero for FAT32 volumes
SectorsPerTrack dw 18
NumberOfHeads dw 2
HiddenSectors dd 0
TotalSectorsBig dd 0
; FAT32 Inserted Info
SectorsPerFatBig dd 0
ExtendedFlags dw 0
FSVersion dw 0
RootDirStartCluster dd 0
FSInfoSector dw 0
BackupBootSector dw 6
Reserved1 times 12 db 0
; End FAT32 Inserted Info
BootDrive db 0
Reserved db 0
ExtendSig db 29h
SerialNumber dd 00000000h
VolumeLabel db 'FreeLoader!'
FileSystem db 'FAT32 '
main:
cli
cld
xor ax,ax
mov ss,ax
mov sp,7c00h ; Setup a stack
mov ax,cs ; Setup segment registers
mov ds,ax ; Make DS correct
mov es,ax ; Make ES correct
sti ; Enable ints now
mov [BootDrive],dl ; Save the boot drive
xor ax,ax ; Zero out AX
; Reset disk controller
int 13h
jnc Continue
jmp BadBoot ; Reset failed...
Continue:
; First we have to load our extra boot code at
; sector 14 into memory at [0000:7e00h]
xor dx,dx
mov ax,0eh
add ax,WORD [HiddenSectors]
adc dx,WORD [HiddenSectors+2] ; Add the number of hidden sectors
mov cx,1
mov bx,7e0h
mov es,bx ; Read sector to [0000:7e00h]
xor bx,bx
call ReadSectors
jnc Continue1
jmp BadBoot
Continue1:
; Now we must get the first cluster of the root directory
mov eax,DWORD [RootDirStartCluster]
cmp eax,0ffffff8h ; Check to see if this is the last cluster in the chain
jb Continue2 ; If not continue, if so BadBoot
jmp ErrBoot
Continue2:
mov bx,800h
mov es,bx ; Read cluster to [0000:8000h]
call ReadCluster ; Read the cluster
; Now we have to find our way through the root directory to
; The OSLOADER.SYS file
xor bx,bx
mov bl,[SectsPerCluster]
shl bx,4 ; BX = BX * 512 / 32
mov ax,800h ; We loaded at 0800:0000
mov es,ax
xor di,di
mov si,filename
mov cx,11
rep cmpsb ; Compare filenames
jz FoundFile ; If same we found it
dec bx
jnz FindFile
jmp ErrBoot
FindFile:
mov ax,es ; We didn't find it in the previous dir entry
add ax,2 ; So lets move to the next one
mov es,ax ; And search again
xor di,di
mov si,filename
mov cx,11
rep cmpsb ; Compare filenames
jz FoundFile ; If same we found it
dec bx ; Keep searching till we run out of dir entries
jnz FindFile ; Last entry?
; Get the next root dir cluster and try again until we run out of clusters
mov eax,DWORD [RootDirStartCluster]
call GetFatEntry
mov [RootDirStartCluster],eax
jmp Continue1
FoundFile:
xor di,di ; ES:DI has dir entry
xor dx,dx
mov ax,WORD [es:di+14h] ; Get start cluster high word
shl eax,16
mov ax,WORD [es:di+1ah] ; Get start cluster low word
mov bx,800h
mov es,bx
FoundFile2:
cmp eax,0ffffff8h ; Check to see if this is the last cluster in the chain
jae FoundFile3 ; If so continue, if not then read then next one
push eax
xor bx,bx ; Load ROSLDR starting at 0000:8000h
push es
call ReadCluster
pop es
xor bx,bx
mov bl,[SectsPerCluster]
shl bx,5 ; BX = BX * 512 / 16
mov ax,es ; Increment the load address by
add ax,bx ; The size of a cluster
mov es,ax
pop eax
push es
call GetFatEntry ; Get the next entry
pop es
jmp FoundFile2 ; Load the next cluster (if any)
FoundFile3:
mov dl,[BootDrive]
xor ax,ax
push ax
mov ax,8000h
push ax ; We will do a far return to 0000:8000h
retf ; Transfer control to ROSLDR
; Reads logical sectors into [ES:BX]
; DX:AX has logical sector number to read
; CX has number of sectors to read
; CarryFlag set on error
ReadSectors:
push ax
push dx
push cx
xchg ax,cx
xchg ax,dx
xor dx,dx
div WORD [SectorsPerTrack]
xchg ax,cx
div WORD [SectorsPerTrack] ; Divide logical by SectorsPerTrack
inc dx ; Sectors numbering starts at 1 not 0
xchg cx,dx
div WORD [NumberOfHeads] ; Number of heads
mov dh,dl ; Head to DH, drive to DL
mov dl,[BootDrive] ; Drive number
mov ch,al ; Cylinder in CX
ror ah,1 ; Low 8 bits of cylinder in CH, high 2 bits
ror ah,1 ; in CL shifted to bits 6 & 7
or cl,ah ; Or with sector number
mov ax,513
int 13h ; DISK - READ SECTORS INTO MEMORY
; AL = number of sectors to read, CH = track, CL = sector
; DH = head, DL = drive, ES:BX -> buffer to fill
; Return: CF set on error, AH = status (see AH=01h), AL = number of sectors read
pop cx
pop dx
pop ax
jc ReadFail
inc ax ;Increment Sector to Read
jnz NoCarry
inc dx
NoCarry:
push bx
mov bx,es
add bx,20h
mov es,bx
pop bx
; Increment read buffer for next sector
loop ReadSectors ; Read next sector
ReadFail:
ret
; Displays a bad boot message
; And reboots
BadBoot:
mov si,msgDiskError ; Bad boot disk message
call PutChars ; Display it
mov si,msgAnyKey ; Press any key message
call PutChars ; Display it
jmp Reboot
; Displays an error message
; And reboots
ErrBoot:
mov si,msgFreeLdr ; FreeLdr not found message
call PutChars ; Display it
mov si,msgAnyKey ; Press any key message
call PutChars ; Display it
Reboot:
xor ax,ax
int 16h ; Wait for a keypress
int 19h ; Reboot
PutChars:
lodsb
or al,al
jz short Done
mov ah,0eh
mov bx,07h
int 10h
jmp short PutChars
Done:
retn
msgDiskError db 'Disk error',0dh,0ah,0
msgFreeLdr db 'FREELDR.SYS not found',0dh,0ah,0
msgAnyKey db 'Press any key to continue.',0dh,0ah,0
filename db 'FREELDR SYS'
times 510-($-$$) db 0 ; Pad to 510 bytes
dw 0aa55h ; BootSector signature
; End of bootsector
;
; Now starts the extra boot code that we will store
; at sector 14 on a FAT32 volume
;
; To remain multi-boot compatible with other operating
; systems we must not overwrite anything other than
; the bootsector which means we will have to use
; a different sector like 14 to store our extra boot code
;
; Note: Win2k uses sector 12 for this purpose
; Returns the FAT entry for a given cluster number
; On entry EAX has cluster number
; On return EAX has FAT entry for that cluster
GetFatEntry:
shl eax,2 ; EAX = EAX * 4 (since FAT32 entries are 4 bytes)
mov ecx,eax ; Save this for later in ECX
xor edx,edx
movzx ebx,WORD [BytesPerSector]
push ebx
div ebx ; FAT Sector Number = EAX / BytesPerSector
movzx ebx,WORD [ReservedSectors]
add eax,ebx ; FAT Sector Number += ReservedSectors
movzx ebx,WORD [HiddenSectors]
add eax,ebx ; FAT Sector Number += HiddenSectors
pop ebx
dec ebx
and ecx,ebx ; FAT Offset Within Sector = ECX % BytesPerSector
; EAX holds logical FAT sector number
; ECX holds FAT entry offset
push ecx
ror eax,16
mov dx,ax
ror eax,16
; DX:AX holds logical FAT sector number
mov bx,7000h
mov es,bx
xor bx,bx ; We will load it to [7000:0000h]
mov cx,1
call ReadSectors
jnc GetFatEntry1
jmp BadBoot
GetFatEntry1:
mov bx,7000h
mov es,bx
pop ecx
mov eax,DWORD [es:ecx] ; Get FAT entry
and eax,0fffffffh ; Mask off reserved bits
ret
; Reads cluster number in EAX into [ES:0000]
ReadCluster:
; StartSector = ((Cluster - 2) * SectorsPerCluster) + ReservedSectors + HiddenSectors;
dec eax
dec eax
xor edx,edx
movzx ebx,BYTE [SectsPerCluster]
mul ebx
push eax
xor edx,edx
movzx eax,BYTE [NumberOfFats]
mul DWORD [SectorsPerFatBig]
movzx ebx,WORD [ReservedSectors]
add eax,ebx
add eax,DWORD [HiddenSectors]
pop ebx
add eax,ebx ; EAX now contains the logical sector number of the cluster
ror eax,16
mov dx,ax
ror eax,16
xor bx,bx ; We will load it to [ES:0000], ES loaded before function call
movzx cx,BYTE [SectsPerCluster]
call ReadSectors
jnc ReadCluster1
jmp BadBoot
ReadCluster1:
ret
times 1022-($-$$) db 0 ; Pad to 1022 bytes
dw 0aa55h ; BootSector signature

View File

@@ -0,0 +1,2 @@
nasm -o bootsect.bin -f bin bootsect.asm
nasm -o btsect32.bin -f bin btsect32.asm

View File

@@ -0,0 +1,35 @@
unsigned char data[] = {
0xeb, 0x3c, 0x90, 0x46, 0x72, 0x65, 0x65, 0x4c, 0x44, 0x52, 0x21, 0x00, 0x02, 0x01, 0x01, 0x00,
0x02, 0x00, 0x02, 0x40, 0x0b, 0xf0, 0x09, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x46, 0x72, 0x65, 0x65, 0x4c,
0x6f, 0x61, 0x64, 0x65, 0x72, 0x21, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0xfa, 0xfc,
0x31, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8c, 0xc8, 0x8e, 0xd8, 0x8e, 0xc0, 0xfb, 0x88, 0x16,
0x24, 0x7c, 0x31, 0xc0, 0xcd, 0x13, 0x73, 0x03, 0xe9, 0x0b, 0x01, 0x31, 0xc0, 0x31, 0xc9, 0xa0,
0x10, 0x7c, 0xf7, 0x26, 0x16, 0x7c, 0x03, 0x06, 0x1c, 0x7c, 0x13, 0x16, 0x1e, 0x7c, 0x03, 0x06,
0x0e, 0x7c, 0x11, 0xca, 0x50, 0x52, 0x50, 0x52, 0xb8, 0x20, 0x00, 0xf7, 0x26, 0x11, 0x7c, 0x8b,
0x1e, 0x0b, 0x7c, 0x01, 0xd8, 0x48, 0xf7, 0xf3, 0x91, 0x5a, 0x58, 0x51, 0xbb, 0xc0, 0x07, 0x81,
0xc3, 0x20, 0x00, 0x8e, 0xc3, 0x31, 0xdb, 0xe8, 0x8c, 0x00, 0x73, 0x03, 0xe9, 0xc7, 0x00, 0x8b,
0x1e, 0x11, 0x7c, 0xb8, 0xe0, 0x07, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0xd8, 0x7d, 0xb9, 0x0b, 0x00,
0xf3, 0xa6, 0x74, 0x1f, 0x4b, 0x75, 0x03, 0xe9, 0xbb, 0x00, 0x8c, 0xc0, 0x05, 0x02, 0x00, 0x8e,
0xc0, 0x31, 0xff, 0xbe, 0xd8, 0x7d, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x06, 0x4b, 0x75, 0xea,
0xe9, 0xa2, 0x00, 0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x1a, 0x48, 0x48, 0x30, 0xed, 0x8a,
0x0e, 0x0d, 0x7c, 0xf7, 0xe1, 0x59, 0x01, 0xc8, 0x81, 0xd2, 0x00, 0x00, 0x59, 0x5b, 0x01, 0xd8,
0x11, 0xca, 0x50, 0x52, 0x26, 0x8b, 0x45, 0x1c, 0x26, 0x8b, 0x55, 0x1e, 0x8b, 0x1e, 0x0b, 0x7c,
0x4b, 0x01, 0xd8, 0x81, 0xd2, 0x00, 0x00, 0xf7, 0x36, 0x0b, 0x7c, 0x91, 0x5a, 0x58, 0xbb, 0x00,
0x08, 0x8e, 0xc3, 0x31, 0xdb, 0xe8, 0x0e, 0x00, 0x72, 0x4c, 0x8a, 0x16, 0x24, 0x7c, 0x31, 0xc0,
0x50, 0xb8, 0x00, 0x80, 0x50, 0xcb, 0x50, 0x52, 0x51, 0x91, 0x92, 0x31, 0xd2, 0xf7, 0x36, 0x18,
0x7c, 0x91, 0xf7, 0x36, 0x18, 0x7c, 0x42, 0x87, 0xca, 0xf7, 0x36, 0x1a, 0x7c, 0x88, 0xd6, 0x8a,
0x16, 0x24, 0x7c, 0x88, 0xc5, 0xd0, 0xcc, 0xd0, 0xcc, 0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13,
0x59, 0x5a, 0x58, 0x72, 0x10, 0x40, 0x75, 0x01, 0x42, 0x53, 0x8c, 0xc3, 0x81, 0xc3, 0x20, 0x00,
0x8e, 0xc3, 0x5b, 0xe2, 0xc1, 0xc3, 0xbe, 0x96, 0x7d, 0xe8, 0x1b, 0x00, 0xbe, 0xbb, 0x7d, 0xe8,
0x15, 0x00, 0xe9, 0x0c, 0x00, 0xbe, 0xa3, 0x7d, 0xe8, 0x0c, 0x00, 0xbe, 0xbb, 0x7d, 0xe8, 0x06,
0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07,
0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x2e, 0x53, 0x59, 0x53, 0x20, 0x6e,
0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73,
0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x74,
0x69, 0x6e, 0x75, 0x65, 0x2e, 0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20,
0x53, 0x59, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa
};

View File

@@ -0,0 +1,67 @@
unsigned char data[] = {
0xeb, 0x58, 0x90, 0x46, 0x72, 0x65, 0x65, 0x4c, 0x44, 0x52, 0x21, 0x00, 0x02, 0x01, 0x01, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x46, 0x72, 0x65, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x65,
0x72, 0x21, 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0xfa, 0xfc, 0x31, 0xc0, 0x8e, 0xd0,
0xbc, 0x00, 0x7c, 0x8c, 0xc8, 0x8e, 0xd8, 0x8e, 0xc0, 0xfb, 0x88, 0x16, 0x40, 0x7c, 0x31, 0xc0,
0xcd, 0x13, 0x73, 0x03, 0xe9, 0x05, 0x01, 0x31, 0xd2, 0xb8, 0x0e, 0x00, 0x03, 0x06, 0x1c, 0x7c,
0x13, 0x16, 0x1e, 0x7c, 0xb9, 0x01, 0x00, 0xbb, 0xe0, 0x07, 0x8e, 0xc3, 0x31, 0xdb, 0xe8, 0xab,
0x00, 0x73, 0x03, 0xe9, 0xe6, 0x00, 0x66, 0xa1, 0x2c, 0x7c, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f,
0x72, 0x03, 0xe9, 0xe6, 0x00, 0xbb, 0x00, 0x08, 0x8e, 0xc3, 0xe8, 0xb2, 0x01, 0x31, 0xdb, 0x8a,
0x1e, 0x0d, 0x7c, 0xc1, 0xe3, 0x04, 0xb8, 0x00, 0x08, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0xee, 0x7d,
0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x2a, 0x4b, 0x75, 0x03, 0xe9, 0xbe, 0x00, 0x8c, 0xc0, 0x05,
0x02, 0x00, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0xee, 0x7d, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x11,
0x4b, 0x75, 0xea, 0x66, 0xa1, 0x2c, 0x7c, 0xe8, 0x16, 0x01, 0x66, 0xa3, 0x2c, 0x7c, 0xe9, 0xa5,
0xff, 0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x14, 0x66, 0xc1, 0xe0, 0x10, 0x26, 0x8b, 0x45,
0x1a, 0xbb, 0x00, 0x08, 0x8e, 0xc3, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x73, 0x22, 0x66, 0x50,
0x31, 0xdb, 0x06, 0xe8, 0x49, 0x01, 0x07, 0x31, 0xdb, 0x8a, 0x1e, 0x0d, 0x7c, 0xc1, 0xe3, 0x05,
0x8c, 0xc0, 0x01, 0xd8, 0x8e, 0xc0, 0x66, 0x58, 0x06, 0xe8, 0xd4, 0x00, 0x07, 0xe9, 0xd6, 0xff,
0x8a, 0x16, 0x40, 0x7c, 0x31, 0xc0, 0x50, 0xb8, 0x00, 0x80, 0x50, 0xcb, 0x50, 0x52, 0x51, 0x91,
0x92, 0x31, 0xd2, 0xf7, 0x36, 0x18, 0x7c, 0x91, 0xf7, 0x36, 0x18, 0x7c, 0x42, 0x87, 0xca, 0xf7,
0x36, 0x1a, 0x7c, 0x88, 0xd6, 0x8a, 0x16, 0x40, 0x7c, 0x88, 0xc5, 0xd0, 0xcc, 0xd0, 0xcc, 0x08,
0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x59, 0x5a, 0x58, 0x72, 0x10, 0x40, 0x75, 0x01, 0x42, 0x53,
0x8c, 0xc3, 0x81, 0xc3, 0x20, 0x00, 0x8e, 0xc3, 0x5b, 0xe2, 0xc1, 0xc3, 0xbe, 0xac, 0x7d, 0xe8,
0x1b, 0x00, 0xbe, 0xd1, 0x7d, 0xe8, 0x15, 0x00, 0xe9, 0x0c, 0x00, 0xbe, 0xb9, 0x7d, 0xe8, 0x0c,
0x00, 0xbe, 0xd1, 0x7d, 0xe8, 0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0,
0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x44, 0x69, 0x73, 0x6b,
0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45, 0x45, 0x4c, 0x44, 0x52,
0x2e, 0x53, 0x59, 0x53, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a,
0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74,
0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x2e, 0x0d, 0x0a, 0x00, 0x46, 0x52,
0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa,
0x66, 0xc1, 0xe0, 0x02, 0x66, 0x89, 0xc1, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x1e, 0x0b, 0x7c,
0x66, 0x53, 0x66, 0xf7, 0xf3, 0x66, 0x0f, 0xb7, 0x1e, 0x0e, 0x7c, 0x66, 0x01, 0xd8, 0x66, 0x0f,
0xb7, 0x1e, 0x1c, 0x7c, 0x66, 0x01, 0xd8, 0x66, 0x5b, 0x66, 0x4b, 0x66, 0x21, 0xd9, 0x66, 0x51,
0x66, 0xc1, 0xc8, 0x10, 0x89, 0xc2, 0x66, 0xc1, 0xc8, 0x10, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x31,
0xdb, 0xb9, 0x01, 0x00, 0xe8, 0xf5, 0xfe, 0x73, 0x03, 0xe9, 0x30, 0xff, 0xbb, 0x00, 0x70, 0x8e,
0xc3, 0x66, 0x59, 0x26, 0x66, 0x67, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0xc3, 0x66,
0x48, 0x66, 0x48, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x1e, 0x0d, 0x7c, 0x66, 0xf7, 0xe3, 0x66,
0x50, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x06, 0x10, 0x7c, 0x66, 0xf7, 0x26, 0x24, 0x7c, 0x66,
0x0f, 0xb7, 0x1e, 0x0e, 0x7c, 0x66, 0x01, 0xd8, 0x66, 0x03, 0x06, 0x1c, 0x7c, 0x66, 0x5b, 0x66,
0x01, 0xd8, 0x66, 0xc1, 0xc8, 0x10, 0x89, 0xc2, 0x66, 0xc1, 0xc8, 0x10, 0x31, 0xdb, 0x0f, 0xb6,
0x0e, 0x0d, 0x7c, 0xe8, 0x96, 0xfe, 0x73, 0x03, 0xe9, 0xd1, 0xfe, 0xc3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa
};

View File

@@ -1,31 +1,32 @@
#include <stdio.h>
char in_filename[260];
char out_filename[260];
FILE *in;
FILE *out;
int main(int argc, char *argv[])
int main(void)
{
unsigned char ch;
int cnt = 0;
if (argc < 4)
{
printf("usage: bin2c infile.bin outfile.h array_name\n");
return -1;
}
printf("Enter data filename: ");
scanf("%s", in_filename);
printf("Enter output filename: ");
scanf("%s", out_filename);
if ((in = fopen(argv[1], "rb")) == NULL)
if ((in = fopen(in_filename, "rb")) == NULL)
{
printf("Couldn't open data file.\n");
return -1;
return 0;
}
if ((out = fopen(argv[2], "wb")) == NULL)
if ((out = fopen(out_filename, "wb")) == NULL)
{
printf("Couldn't open output file.\n");
return -1;
return 0;
}
fprintf(out, "unsigned char %s[] = {\n", argv[3]);
fprintf(out, "unsigned char data[] = {\n");
ch = fgetc(in);
while (!feof(in))
@@ -39,10 +40,10 @@ int main(int argc, char *argv[])
ch = fgetc(in);
}
fprintf(out, "\n};\n");
fprintf(out, "\n};");
fclose(in);
fclose(out);
return 0;
}
}

View File

@@ -0,0 +1 @@
debug bootsect.bin < install.src

View File

@@ -0,0 +1,2 @@
w 100 0 0 1
q

View File

@@ -0,0 +1,197 @@
00008000 660FB64610 movzx eax,byte [bp+NumberOfFats]
00008005 668B4E24 mov ecx,[bp+SectorsPerFatBig]
00008009 66F7E1 mul ecx
0000800C 6603461C add eax,[bp+HiddenSectors]
00008010 660FB7560E movzx edx,word [bp+ReservedSectors]
00008015 6603C2 add eax,edx
00008018 668946FC mov [bp-0x4],eax
0000801C 66C746F4FFFFFFFF mov dword [bp-0xc],0xffffffff
00008024 668B462C mov eax,[bp+RootDirStartCluster]
00008028 6683F802 cmp eax,byte +0x2
0000802C 0F82A6FC jc near 0x7cd6
00008030 663DF8FFFF0F cmp eax,0xffffff8
00008036 0F839CFC jnc near 0x7cd6
0000803A 6650 push eax
0000803C 6683E802 sub eax,byte +0x2
00008040 660FB65E0D movzx ebx,byte [bp+SectsPerCluster]
00008045 8BF3 mov si,bx
00008047 66F7E3 mul ebx
0000804A 660346FC add eax,[bp-0x4]
0000804E BB0082 mov bx,0x8200
00008051 8BFB mov di,bx
00008053 B90100 mov cx,0x1
00008056 E887FC call 0x7ce0
00008059 382D cmp [di],ch
0000805B 741E jz 0x807b
0000805D B10B mov cl,0xb
0000805F 56 push si
00008060 BE707D mov si,0x7d70
00008063 F3A6 repe cmpsb
00008065 5E pop si
00008066 741B jz 0x8083
00008068 03F9 add di,cx
0000806A 83C715 add di,byte +0x15
0000806D 3BFB cmp di,bx
0000806F 72E8 jc 0x8059
00008071 4E dec si
00008072 75DA jnz 0x804e
00008074 6658 pop eax
00008076 E86500 call 0x80de
00008079 72BF jc 0x803a
0000807B 83C404 add sp,byte +0x4
0000807E E955FC jmp 0x7cd6
00008081 0020 add [bx+si],ah
00008083 83C404 add sp,byte +0x4
00008086 8B7509 mov si,[di+0x9]
00008089 8B7D0F mov di,[di+0xf]
0000808C 8BC6 mov ax,si
0000808E 66C1E010 shl eax,0x10
00008092 8BC7 mov ax,di
00008094 6683F802 cmp eax,byte +0x2
00008098 0F823AFC jc near 0x7cd6
0000809C 663DF8FFFF0F cmp eax,0xffffff8
000080A2 0F8330FC jnc near 0x7cd6
000080A6 6650 push eax
000080A8 6683E802 sub eax,byte +0x2
000080AC 660FB64E0D movzx ecx,byte [bp+0xd]
000080B1 66F7E1 mul ecx
000080B4 660346FC add eax,[bp-0x4]
000080B8 BB0000 mov bx,0x0
000080BB 06 push es
000080BC 8E068180 mov es,[0x8081]
000080C0 E81DFC call 0x7ce0
000080C3 07 pop es
000080C4 6658 pop eax
000080C6 C1EB04 shr bx,0x4
000080C9 011E8180 add [0x8081],bx
000080CD E80E00 call 0x80de
000080D0 0F830200 jnc near 0x80d6
000080D4 72D0 jc 0x80a6
000080D6 8A5640 mov dl,[bp+0x40]
000080D9 EA00000020 jmp 0x2000:0x0
000080DE 66C1E002 shl eax,0x2
000080E2 E81100 call 0x80f6
000080E5 26668B01 mov eax,[es:bx+di]
000080E9 6625FFFFFF0F and eax,0xfffffff
000080EF 663DF8FFFF0F cmp eax,0xffffff8
000080F5 C3 ret
000080F6 BF007E mov di,0x7e00
000080F9 660FB74E0B movzx ecx,word [bp+0xb]
000080FE 6633D2 xor edx,edx
00008101 66F7F1 div ecx
00008104 663B46F4 cmp eax,[bp-0xc]
00008108 743A jz 0x8144
0000810A 668946F4 mov [bp-0xc],eax
0000810E 6603461C add eax,[bp+0x1c]
00008112 660FB74E0E movzx ecx,word [bp+0xe]
00008117 6603C1 add eax,ecx
0000811A 660FB75E28 movzx ebx,word [bp+0x28]
0000811F 83E30F and bx,byte +0xf
00008122 7416 jz 0x813a
00008124 3A5E10 cmp bl,[bp+0x10]
00008127 0F83ABFB jnc near 0x7cd6
0000812B 52 push dx
0000812C 668BC8 mov ecx,eax
0000812F 668B4624 mov eax,[bp+0x24]
00008133 66F7E3 mul ebx
00008136 6603C1 add eax,ecx
00008139 5A pop dx
0000813A 52 push dx
0000813B 8BDF mov bx,di
0000813D B90100 mov cx,0x1
00008140 E89DFB call 0x7ce0
00008143 5A pop dx
00008144 8BDA mov bx,dx
00008146 C3 ret
00008147 0000 add [bx+si],al
00008149 0000 add [bx+si],al
0000814B 0000 add [bx+si],al
0000814D 0000 add [bx+si],al
0000814F 0000 add [bx+si],al
00008151 0000 add [bx+si],al
00008153 0000 add [bx+si],al
00008155 0000 add [bx+si],al
00008157 0000 add [bx+si],al
00008159 0000 add [bx+si],al
0000815B 0000 add [bx+si],al
0000815D 0000 add [bx+si],al
0000815F 0000 add [bx+si],al
00008161 0000 add [bx+si],al
00008163 0000 add [bx+si],al
00008165 0000 add [bx+si],al
00008167 0000 add [bx+si],al
00008169 0000 add [bx+si],al
0000816B 0000 add [bx+si],al
0000816D 0000 add [bx+si],al
0000816F 0000 add [bx+si],al
00008171 0000 add [bx+si],al
00008173 0000 add [bx+si],al
00008175 0000 add [bx+si],al
00008177 0000 add [bx+si],al
00008179 0000 add [bx+si],al
0000817B 0000 add [bx+si],al
0000817D 0000 add [bx+si],al
0000817F 0000 add [bx+si],al
00008181 0000 add [bx+si],al
00008183 0000 add [bx+si],al
00008185 0000 add [bx+si],al
00008187 0000 add [bx+si],al
00008189 0000 add [bx+si],al
0000818B 0000 add [bx+si],al
0000818D 0000 add [bx+si],al
0000818F 0000 add [bx+si],al
00008191 0000 add [bx+si],al
00008193 0000 add [bx+si],al
00008195 0000 add [bx+si],al
00008197 0000 add [bx+si],al
00008199 0000 add [bx+si],al
0000819B 0000 add [bx+si],al
0000819D 0000 add [bx+si],al
0000819F 0000 add [bx+si],al
000081A1 0000 add [bx+si],al
000081A3 0000 add [bx+si],al
000081A5 0000 add [bx+si],al
000081A7 0000 add [bx+si],al
000081A9 0000 add [bx+si],al
000081AB 0000 add [bx+si],al
000081AD 0000 add [bx+si],al
000081AF 0000 add [bx+si],al
000081B1 0000 add [bx+si],al
000081B3 0000 add [bx+si],al
000081B5 0000 add [bx+si],al
000081B7 0000 add [bx+si],al
000081B9 0000 add [bx+si],al
000081BB 0000 add [bx+si],al
000081BD 0000 add [bx+si],al
000081BF 0000 add [bx+si],al
000081C1 0000 add [bx+si],al
000081C3 0000 add [bx+si],al
000081C5 0000 add [bx+si],al
000081C7 0000 add [bx+si],al
000081C9 0000 add [bx+si],al
000081CB 0000 add [bx+si],al
000081CD 0000 add [bx+si],al
000081CF 0000 add [bx+si],al
000081D1 0000 add [bx+si],al
000081D3 0000 add [bx+si],al
000081D5 0000 add [bx+si],al
000081D7 0000 add [bx+si],al
000081D9 0000 add [bx+si],al
000081DB 0000 add [bx+si],al
000081DD 0000 add [bx+si],al
000081DF 0000 add [bx+si],al
000081E1 0000 add [bx+si],al
000081E3 0000 add [bx+si],al
000081E5 0000 add [bx+si],al
000081E7 0000 add [bx+si],al
000081E9 0000 add [bx+si],al
000081EB 0000 add [bx+si],al
000081ED 0000 add [bx+si],al
000081EF 0000 add [bx+si],al
000081F1 0000 add [bx+si],al
000081F3 0000 add [bx+si],al
000081F5 0000 add [bx+si],al
000081F7 0000 add [bx+si],al
000081F9 0000 add [bx+si],al
000081FB 0000 add [bx+si],al
000081FD 0055AA add [di-0x56],dl

174
freeldr/bootsect/win2k.asm Normal file
View File

@@ -0,0 +1,174 @@
segment .text
bits 16
start:
jmp short main
nop
OEMName db 'FreeLDR!'
BytesPerSector dw 512
SectsPerCluster db 1
ReservedSectors dw 1
NumberOfFats db 2
MaxRootEntries dw 0 ;512 - Always zero for FAT32 volumes
TotalSectors dw 0 ;2880 - Always zero for FAT32 volumes
MediaDescriptor db 0f8h
SectorsPerFat dw 0 ;9 - Always zero for FAT32 volumes
SectorsPerTrack dw 18
NumberOfHeads dw 2
HiddenSectors dd 0
TotalSectorsBig dd 0
; FAT32 Inserted Info
SectorsPerFatBig dd 0
ExtendedFlags dw 0
FSVersion dw 0
RootDirStartCluster dd 0
FSInfoSector dw 0
BackupBootSector dw 6
Reserved1 times 12 db 0
; End FAT32 Inserted Info
BootDrive db 0
Reserved db 0
ExtendSig db 29h
SerialNumber dd 00000000h
VolumeLabel db 'FreeLoader!'
FileSystem db 'FAT12 '
main:
00007C5A 33C9 xor cx,cx
00007C5C 8ED1 mov ss,cx
00007C5E BCF47B mov sp,0x7bf4
00007C61 8EC1 mov es,cx
00007C63 8ED9 mov ds,cx
00007C65 BD007C mov bp,0x7c00
00007C68 884E02 mov [bp+0x2],cl
00007C6B 8A5640 mov dl,[bp+BootDrive]
00007C6E B408 mov ah,0x8
00007C70 CD13 int 0x13 ; Int 13, func 8 - Get Drive Parameters
00007C72 7305 jnc 0x7c79 ; If no error jmp
00007C74 B9FFFF mov cx,0xffff
00007C77 8AF1 mov dh,cl
00007C79 660FB6C6 movzx eax,dh
00007C7D 40 inc ax
00007C7E 660FB6D1 movzx edx,cl
00007C82 80E23F and dl,0x3f
00007C85 F7E2 mul dx
00007C87 86CD xchg cl,ch
00007C89 C0ED06 shr ch,0x6
00007C8C 41 inc cx
00007C8D 660FB7C9 movzx ecx,cx
00007C91 66F7E1 mul ecx
00007C94 668946F8 mov [bp-0x8],eax
00007C98 837E1600 cmp word [bp+TotalSectors],byte +0x0
00007C9C 7538 jnz print_ntldr_error_message
00007C9E 837E2A00 cmp word [bp+FSVersion],byte +0x0
00007CA2 7732 ja print_ntldr_error_message
00007CA4 668B461C mov eax,[bp+0x1c]
00007CA8 6683C00C add eax,byte +0xc
00007CAC BB0080 mov bx,0x8000
00007CAF B90100 mov cx,0x1
00007CB2 E82B00 call read_sectors
00007CB5 E94803 jmp 0x8000
print_disk_error_message:
00007CB8 A0FA7D mov al,[DISK_ERR_offset_from_0x7d00]
putchars:
00007CBB B47D mov ah,0x7d
00007CBD 8BF0 mov si,ax
get_another_char:
00007CBF AC lodsb
00007CC0 84C0 test al,al
00007CC2 7417 jz reboot
00007CC4 3CFF cmp al,0xff
00007CC6 7409 jz print_reboot_message
00007CC8 B40E mov ah,0xe
00007CCA BB0700 mov bx,0x7
00007CCD CD10 int 0x10
00007CCF EBEE jmp short get_another_char
print_reboot_message:
00007CD1 A0FB7D mov al,[RESTART_ERR_offset_from_0x7d00]
00007CD4 EBE5 jmp short putchars
print_ntldr_error_message:
00007CD6 A0F97D mov al,[NTLDR_ERR_offset_from_0x7d00]
00007CD9 EBE0 jmp short putchars
reboot:
00007CDB 98 cbw
00007CDC CD16 int 0x16
00007CDE CD19 int 0x19
read_sectors:
00007CE0 6660 pushad
00007CE2 663B46F8 cmp eax,[bp-0x8]
00007CE6 0F824A00 jc near 0x7d34
00007CEA 666A00 o32 push byte +0x0
00007CED 6650 push eax
00007CEF 06 push es
00007CF0 53 push bx
00007CF1 666810000100 push dword 0x10010
00007CF7 807E0200 cmp byte [bp+0x2],0x0
00007CFB 0F852000 jnz near 0x7d1f
00007CFF B441 mov ah,0x41
00007D01 BBAA55 mov bx,0x55aa
00007D04 8A5640 mov dl,[bp+BootDrive]
00007D07 CD13 int 0x13
00007D09 0F821C00 jc near 0x7d29
00007D0D 81FB55AA cmp bx,0xaa55
00007D11 0F851400 jnz near 0x7d29
00007D15 F6C101 test cl,0x1
00007D18 0F840D00 jz near 0x7d29
00007D1C FE4602 inc byte [bp+0x2]
00007D1F B442 mov ah,0x42
00007D21 8A5640 mov dl,[bp+BootDrive]
00007D24 8BF4 mov si,sp
00007D26 CD13 int 0x13
00007D28 B0F9 mov al,0xf9
00007D2A 6658 pop eax
00007D2C 6658 pop eax
00007D2E 6658 pop eax
00007D30 6658 pop eax
00007D32 EB2A jmp short 0x7d5e
00007D34 6633D2 xor edx,edx
00007D37 660FB74E18 movzx ecx,word [bp+SectorsPerTrack]
00007D3C 66F7F1 div ecx
00007D3F FEC2 inc dl
00007D41 8ACA mov cl,dl
00007D43 668BD0 mov edx,eax
00007D46 66C1EA10 shr edx,0x10
00007D4A F7761A div word [bp+NumberOfHeads]
00007D4D 86D6 xchg dl,dh
00007D4F 8A5640 mov dl,[bp+BootDrive]
00007D52 8AE8 mov ch,al
00007D54 C0E406 shl ah,0x6
00007D57 0ACC or cl,ah
00007D59 B80102 mov ax,0x201
00007D5C CD13 int 0x13
00007D5E 6661 popad
00007D60 0F8254FF jc near print_disk_error_message
00007D64 81C30002 add bx,0x200
00007D68 6640 inc eax
00007D6A 49 dec cx
00007D6B 0F8571FF jnz near read_sectors
00007D6F C3 ret
NTLDR db 'NTLDR '
filler times 49 db 0
NTLDR_ERR db 0dh,0ah,'NTLDR is missing',0ffh
DISK_ERR db 0dh,0ah,'Disk error',0ffh
RESTART_ERR db 0dh,0ah,'Press any key to restart',0dh,0ah
more_filler times 16 db 0
NTLDR_offset_from_0x7d00 db 0
NTLDR_ERR_offset_from_0x7d00 db 0ach
DISK_ERR_offset_from_0x7d00 db 0bfh
RESTART_ERR_offset_from_0x7d00 db 0cch
dw 0
dw 0aa55h

7
freeldr/build.bat Normal file
View File

@@ -0,0 +1,7 @@
cd bootsect
call make.bat
cd..
cd freeldr
make
copy freeldr.sys ..
cd ..

89
freeldr/freeldr/Makefile Normal file
View File

@@ -0,0 +1,89 @@
#
# FreeLoader
# Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
export CC = gcc
export LD = ld
export AR = ar
export RM = cmd /C del
export CP = cmd /C copy
FLAGS = -Wall -nostdinc -fno-builtin
# asmcode.o has to be first in the link line because it contains the startup code
OBJS = asmcode.a asmcode.o ros.o boot.o freeldr.o stdlib.o fs.a fs.o fs_fat.o \
rosboot.o tui.o menu.o miscboot.o options.o linux.o
ASM_OBJS = asmcode.o ros.o boot.o
C_OBJS = freeldr.o stdlib.o fs.a rosboot.o tui.o menu.o miscboot.o options.o linux.o
all: freeldr.sys
freeldr.sys: asmcode.a c_code.a
$(LD) -N -Ttext=0x8000 --oformat=binary -o freeldr.sys asmcode.a c_code.a
asmcode.a: $(ASM_OBJS)
$(LD) -r -o asmcode.a $(ASM_OBJS)
c_code.a: $(C_OBJS)
$(LD) -r -o c_code.a $(C_OBJS)
asmcode.o: asmcode.S asmcode.h Makefile
$(CC) $(FLAGS) -o asmcode.o -c asmcode.S
freeldr.o: freeldr.c freeldr.h stdlib.h fs.h rosboot.h tui.h asmcode.h menu.h miscboot.h Makefile
$(CC) $(FLAGS) -o freeldr.o -c freeldr.c
stdlib.o: stdlib.c freeldr.h stdlib.h Makefile
$(CC) $(FLAGS) -o stdlib.o -c stdlib.c
fs.a: fs.o fs_fat.o Makefile
$(LD) -r -o fs.a fs.o fs_fat.o
fs.o: fs.c freeldr.h fs.h stdlib.h tui.h asmcode.h Makefile
$(CC) $(FLAGS) -o fs.o -c fs.c
fs_fat.o: fs_fat.c freeldr.h fs.h stdlib.h tui.h Makefile
$(CC) $(FLAGS) -o fs_fat.o -c fs_fat.c
rosboot.o: rosboot.c freeldr.h rosboot.h stdlib.h fs.h tui.h Makefile
$(CC) $(FLAGS) -o rosboot.o -c rosboot.c
ros.o: ros.S asmcode.h Makefile
$(CC) $(FLAGS) -o ros.o -c ros.S
tui.o: tui.c freeldr.h stdlib.h tui.h Makefile
$(CC) $(FLAGS) -o tui.o -c tui.c
menu.o: menu.c freeldr.h stdlib.h tui.h menu.h Makefile
$(CC) $(FLAGS) -o menu.o -c menu.c
boot.o: boot.S asmcode.h Makefile
$(CC) $(FLAGS) -o boot.o -c boot.S
miscboot.o: miscboot.c freeldr.h asmcode.h stdlib.h fs.h tui.h miscboot.h Makefile
$(CC) $(FLAGS) -o miscboot.o -c miscboot.c
options.o: options.c freeldr.h stdlib.h tui.h options.h Makefile
$(CC) $(FLAGS) -o options.o -c options.c
linux.o: linux.c freeldr.h stdlib.h tui.h linux.h Makefile
$(CC) $(FLAGS) -o linux.o -c linux.c
clean:
$(RM) $(OBJS)

1177
freeldr/freeldr/asmcode.S Normal file

File diff suppressed because it is too large Load Diff

57
freeldr/freeldr/asmcode.h Normal file
View File

@@ -0,0 +1,57 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Defines needed for switching between real and protected mode */
#define NULL_DESC 0x00 /* NULL descriptor */
#define PMODE_CS 0x08 /* PMode code selector, base 0 limit 4g */
#define PMODE_DS 0x10 /* PMode data selector, base 0 limit 4g */
#define RMODE_CS 0x18 /* RMode code selector, base 0 limit 64k */
#define RMODE_DS 0x20 /* RMode data selector, base 0 limit 64k */
#define KERNEL_BASE 0xC0000000
//#define USER_CS 0x08
//#define USER_DS 0x10
//#define KERNEL_CS 0x20
//#define KERNEL_DS 0x28
#define KERNEL_CS 0x08
#define KERNEL_DS 0x10
#define CR0_PE_SET 0x00000001 /* OR this value with CR0 to enable pmode */
#define CR0_PE_CLR 0xFFFFFFFE /* AND this value with CR0 to disable pmode */
#define NR_TASKS 128 /* Space reserved in the GDT for TSS descriptors */
#define STACK16ADDR 0x7000 /* The 16-bit stack top will be at 0000:7000 */
#define STACK32ADDR 0x60000 /* The 32-bit stack top will be at 6000:0000, or 0x60000 */
#define FILESYSADDR 0x80000 /* The filesystem data address will be at 8000:0000, or 0x80000 */
#define FATCLUSTERBUF 0x60000 /* The fat filesystem's cluster buffer */
#define SCREENBUFFER 0x68000 /* The screen contents will be saved here */
#define FREELDRINIADDR 0x6C000 /* The freeldr.ini load address will be at 6000:C000, or 0x6C000 */
#define SCRATCHSEG 0x7000 /* The 512-byte fixed scratch area will be at 7000:0000, or 0x70000 */
#define SCRATCHOFF 0x0000 /* The 512-byte fixed scratch area will be at 7000:0000, or 0x70000 */
#define SCRATCHAREA 0x70000 /* The 512-byte fixed scratch area will be at 7000:0000, or 0x70000 */
/* Makes "x" a global variable or label */
#define EXTERN(x) .global x; x:

View File

@@ -1,6 +1,6 @@
/*
* FreeLoader
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,13 +17,29 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __BOOTMGR_H
#define __BOOTMGR_H
.text
.code16
#include "asmcode.h"
ULONG GetDefaultOperatingSystem(PCSTR OperatingSystemList[], ULONG OperatingSystemCount);
LONG GetTimeOut(VOID);
BOOLEAN MainBootMenuKeyPressFilter(ULONG KeyPress);
.code32
EXTERN(_JumpToBootCode)
call switch_to_real
.code16
/* Set the boot drive */
movb (_BootDrive),%dl
ljmpl $0x0000,$0x7C00
#endif // #defined __BOOTMGR_H
.code32
EXTERN(_JumpToLinuxBootCode)
call switch_to_real
.code16
/* Set the boot drive */
movb (_BootDrive),%dl
ljmpl $0x0200,$0x9000

734
freeldr/freeldr/freeldr.c Normal file
View File

@@ -0,0 +1,734 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "stdlib.h"
#include "fs.h"
#include "rosboot.h"
#include "tui.h"
#include "asmcode.h"
#include "menu.h"
#include "miscboot.h"
#include "linux.h"
// Variable BootDrive moved to asmcode.S
//unsigned int BootDrive = 0; // BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc.
unsigned int BootPartition = 0; // Boot Partition, 1-4
BOOL bTUILoaded = FALSE; // Tells us if the user interface is loaded
char *pFreeldrIni = (char *)(FREELDRINIADDR); // Load address for freeldr.ini
char *pScreenBuffer = (char *)(SCREENBUFFER); // Save address for screen contents
int nCursorXPos = 0; // Cursor's X Position
int nCursorYPos = 0; // Cursor's Y Position
OSTYPE OSList[16];
int nNumOS = 0;
int nTimeOut = -1; // Time to wait for the user before booting
void BootMain(void)
{
int i;
char name[1024];
char value[1024];
int nOSToBoot;
enable_a20();
SaveScreen(pScreenBuffer);
nCursorXPos = wherex();
nCursorYPos = wherey();
printf("Loading FreeLoader...\n");
if (!ParseIniFile())
{
printf("Press any key to reboot.\n");
getch();
return;
}
clrscr();
hidecursor();
// Draw the backdrop and title box
DrawBackdrop();
bTUILoaded = TRUE;
if (nNumOS == 0)
{
DrawStatusText(" Press ENTER to reboot");
MessageBox("Error: there were no operating systems listed to boot.\nPress ENTER to reboot.");
clrscr();
showcursor();
RestoreScreen(pScreenBuffer);
return;
}
DrawStatusText(" Press ENTER to continue");
// Find all the message box settings and run them
for (i=1; i<=GetNumSectionItems("FREELOADER"); i++)
{
ReadSectionSettingByNumber("FREELOADER", i, name, value);
if (stricmp(name, "MessageBox") == 0)
MessageBox(value);
if (stricmp(name, "MessageLine") == 0)
MessageLine(value);
}
for (;;)
{
nOSToBoot = RunMenu();
LoadAndBootLinux(0x80, 0, "vmlinuz", "");
switch (OSList[nOSToBoot].nOSType)
{
case OSTYPE_REACTOS:
LoadAndBootReactOS(nOSToBoot);
break;
case OSTYPE_LINUX:
MessageBox("Cannot boot this OS type yet!");
break;
case OSTYPE_BOOTSECTOR:
LoadAndBootBootSector(nOSToBoot);
break;
case OSTYPE_PARTITION:
LoadAndBootPartition(nOSToBoot);
break;
case OSTYPE_DRIVE:
LoadAndBootDrive(nOSToBoot);
break;
}
}
MessageBox("Press any key to reboot.");
RestoreScreen(pScreenBuffer);
showcursor();
gotoxy(nCursorXPos, nCursorYPos);
}
BOOL ParseIniFile(void)
{
int i;
char name[1024];
char value[1024];
FILE Freeldr_Ini; // File handle for freeldr.ini
// Open the boot drive for file access
if(!OpenDiskDrive(BootDrive, 0))
{
printf("Error opening boot drive for file access.\n");
return FALSE;
}
// Try to open freeldr.ini or fail
if(!OpenFile("freeldr.ini", &Freeldr_Ini))
{
printf("FREELDR.INI not found.\nYou need to re-install FreeLoader.\n");
return FALSE;
}
// Check and see if freeldr.ini is too big
// if so display a warning
if(GetFileSize(&Freeldr_Ini) > 0x4000)
{
printf("Warning: FREELDR.INI is bigger than 16k.\n");
printf("Only 16k of it will be loaded off the disk.\n");
printf("Press any key to continue.\n");
getch();
}
// Read freeldr.ini off the disk
ReadFile(&Freeldr_Ini, 0x4000, pFreeldrIni);
// Make sure the [FREELOADER] section exists
if(!GetNumSectionItems("FREELOADER"))
{
printf("Section [FREELOADER] not found in FREELDR.INI.\nYou need to re-install FreeLoader.\n");
return FALSE;
}
// Validate the settings in the [FREELOADER] section
for(i=1; i<=GetNumSectionItems("FREELOADER"); i++)
{
ReadSectionSettingByNumber("FREELOADER", i, name, value);
if(!IsValidSetting(name, value))
{
printf("Invalid setting in freeldr.ini.\nName: \"%s\", Value: \"%s\"\n", name, value);
printf("Press any key to continue.\n");
getch();
}
else
SetSetting(name, value);
}
return TRUE;
}
int GetNumSectionItems(char *section)
{
int i;
char str[1024];
char real_section[1024];
int num_items = 0;
int freeldr_ini_offset;
BOOL bFoundSection = FALSE;
// Get the real section name
strcpy(real_section, "[");
strcat(real_section, section);
strcat(real_section, "]");
// Get to the beginning of the file
freeldr_ini_offset = 0;
// Find the section
while(freeldr_ini_offset < 0x4000)
{
// Read a line
for(i=0; i<1024; i++,freeldr_ini_offset++)
{
if((freeldr_ini_offset < 0x4000) && (pFreeldrIni[freeldr_ini_offset] != '\n'))
str[i] = pFreeldrIni[freeldr_ini_offset];
else
{
freeldr_ini_offset++;
break;
}
}
str[i] = '\0';
//fgets(str, 1024, &Freeldr_Ini);
// Get rid of newline & linefeed characters (if any)
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
// Skip comments
if(str[0] == '#')
continue;
// Skip blank lines
if(!strlen(str))
continue;
// If it isn't a section header then continue on
if(str[0] != '[')
continue;
// Check and see if we found it
if(stricmp(str, real_section) == 0)
{
bFoundSection = TRUE;
break;
}
}
// If we didn't find the section then we're outta here
if(!bFoundSection)
return 0;
// Now count how many settings are in this section
while(freeldr_ini_offset < 0x4000)
{
// Read a line
for(i=0; i<1024; i++,freeldr_ini_offset++)
{
if((freeldr_ini_offset < 0x4000) && (pFreeldrIni[freeldr_ini_offset] != '\n'))
str[i] = pFreeldrIni[freeldr_ini_offset];
else
{
freeldr_ini_offset++;
break;
}
}
str[i] = '\0';
//fgets(str, 1024, &Freeldr_Ini);
// Get rid of newline & linefeed characters (if any)
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
// Skip comments
if(str[0] == '#')
continue;
// Skip blank lines
if(!strlen(str))
continue;
// If we hit a new section then we're done
if(str[0] == '[')
break;
num_items++;
}
return num_items;
}
BOOL ReadSectionSettingByNumber(char *section, int num, char *name, char *value)
{
char str[1024];
char real_section[1024];
int num_items = 0;
int i;
int freeldr_ini_offset;
BOOL bFoundSection = FALSE;
// Get the real section name
strcpy(real_section, "[");
strcat(real_section, section);
strcat(real_section, "]");
// Get to the beginning of the file
freeldr_ini_offset = 0;
// Find the section
while(freeldr_ini_offset < 0x4000)
{
// Read a line
for(i=0; i<1024; i++,freeldr_ini_offset++)
{
if((freeldr_ini_offset < 0x4000) && (pFreeldrIni[freeldr_ini_offset] != '\n'))
str[i] = pFreeldrIni[freeldr_ini_offset];
else
{
freeldr_ini_offset++;
break;
}
}
str[i] = '\0';
//fgets(str, 1024, &Freeldr_Ini);
// Get rid of newline & linefeed characters (if any)
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
// Skip comments
if(str[0] == '#')
continue;
// Skip blank lines
if(!strlen(str))
continue;
// If it isn't a section header then continue on
if(str[0] != '[')
continue;
// Check and see if we found it
if(stricmp(str, real_section) == 0)
{
bFoundSection = TRUE;
break;
}
}
// If we didn't find the section then we're outta here
if(!bFoundSection)
return FALSE;
// Now find the setting we are looking for
while(freeldr_ini_offset < 0x4000)
{
// Read a line
for(i=0; i<1024; i++,freeldr_ini_offset++)
{
if((freeldr_ini_offset < 0x4000) && (pFreeldrIni[freeldr_ini_offset] != '\n'))
str[i] = pFreeldrIni[freeldr_ini_offset];
else
{
freeldr_ini_offset++;
break;
}
}
str[i] = '\0';
//fgets(str, 1024, &Freeldr_Ini);
// Get rid of newline & linefeed characters (if any)
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
// Skip comments
if(str[0] == '#')
continue;
// Skip blank lines
if(!strlen(str))
continue;
// If we hit a new section then we're done
if(str[0] == '[')
break;
// Increment setting number
num_items++;
// Check and see if we found the setting
if(num_items == num)
{
for(i=0; i<strlen(str); i++)
{
// Check and see if this character is the separator
if(str[i] == '=')
{
name[i] = '\0';
strcpy(value, str+i+1);
return TRUE;
}
else
name[i] = str[i];
}
}
}
return FALSE;
}
BOOL ReadSectionSettingByName(char *section, char *valuename, char *name, char *value)
{
char str[1024];
char real_section[1024];
char temp[1024];
int i;
int freeldr_ini_offset;
BOOL bFoundSection = FALSE;
// Get the real section name
strcpy(real_section, "[");
strcat(real_section, section);
strcat(real_section, "]");
// Get to the beginning of the file
freeldr_ini_offset = 0;
// Find the section
while(freeldr_ini_offset < 0x4000)
{
// Read a line
for(i=0; i<1024; i++,freeldr_ini_offset++)
{
if((freeldr_ini_offset < 0x4000) && (pFreeldrIni[freeldr_ini_offset] != '\n'))
str[i] = pFreeldrIni[freeldr_ini_offset];
else
{
freeldr_ini_offset++;
break;
}
}
str[i] = '\0';
//fgets(str, 1024, &Freeldr_Ini);
// Get rid of newline & linefeed characters (if any)
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
// Skip comments
if(str[0] == '#')
continue;
// Skip blank lines
if(!strlen(str))
continue;
// If it isn't a section header then continue on
if(str[0] != '[')
continue;
// Check and see if we found it
if(stricmp(str, real_section) == 0)
{
bFoundSection = TRUE;
break;
}
}
// If we didn't find the section then we're outta here
if(!bFoundSection)
return FALSE;
// Now find the setting we are looking for
while(freeldr_ini_offset < 0x4000)
{
// Read a line
for(i=0; i<1024; i++,freeldr_ini_offset++)
{
if((freeldr_ini_offset < 0x4000) && (pFreeldrIni[freeldr_ini_offset] != '\n'))
str[i] = pFreeldrIni[freeldr_ini_offset];
else
{
freeldr_ini_offset++;
break;
}
}
str[i] = '\0';
//fgets(str, 1024, &Freeldr_Ini);
// Get rid of newline & linefeed characters (if any)
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
if((str[strlen(str)-1] == '\n') || (str[strlen(str)-1] == '\r'))
str[strlen(str)-1] = '\0';
// Skip comments
if(str[0] == '#')
continue;
// Skip blank lines
if(!strlen(str))
continue;
// If we hit a new section then we're done
if(str[0] == '[')
break;
// Extract the setting name
for(i=0; i<strlen(str); i++)
{
if(str[i] != '=')
temp[i] = str[i];
else
{
temp[i] = '\0';
break;
}
}
// Check and see if we found the setting
if(stricmp(temp, valuename) == 0)
{
for(i=0; i<strlen(str); i++)
{
// Check and see if this character is the separator
if(str[i] == '=')
{
name[i] = '\0';
strcpy(value, str+i+1);
return TRUE;
}
else
name[i] = str[i];
}
}
}
return FALSE;
}
BOOL IsValidSetting(char *setting, char *value)
{
if(stricmp(setting, "MessageBox") == 0)
return TRUE;
else if(stricmp(setting, "MessageLine") == 0)
return TRUE;
else if(stricmp(setting, "TitleText") == 0)
return TRUE;
else if(stricmp(setting, "StatusBarColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "StatusBarTextColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "BackdropTextColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "BackdropColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "BackdropFillStyle") == 0)
{
if(IsValidFillStyle(value))
return TRUE;
}
else if(stricmp(setting, "TitleBoxTextColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "TitleBoxColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "MessageBoxTextColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "MessageBoxColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "MenuTextColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "MenuColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "TextColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "SelectedTextColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "SelectedColor") == 0)
{
if(IsValidColor(value))
return TRUE;
}
else if(stricmp(setting, "OS") == 0)
return TRUE;
else if(stricmp(setting, "TimeOut") == 0)
return TRUE;
/*else if(stricmp(setting, "") == 0)
return TRUE;
else if(stricmp(setting, "") == 0)
return TRUE;
else if(stricmp(setting, "") == 0)
return TRUE;
else if(stricmp(setting, "") == 0)
return TRUE;
else if(stricmp(setting, "") == 0)
return TRUE;
else if(stricmp(setting, "") == 0)
return TRUE;
else if(stricmp(setting, "") == 0)
return TRUE;*/
return FALSE;
}
void SetSetting(char *setting, char *value)
{
char name[260];
char v[260];
if(stricmp(setting, "TitleText") == 0)
strcpy(szTitleBoxTitleText, value);
else if(stricmp(setting, "StatusBarColor") == 0)
cStatusBarBgColor = TextToColor(value);
else if(stricmp(setting, "StatusBarTextColor") == 0)
cStatusBarFgColor = TextToColor(value);
else if(stricmp(setting, "BackdropTextColor") == 0)
cBackdropFgColor = TextToColor(value);
else if(stricmp(setting, "BackdropColor") == 0)
cBackdropBgColor = TextToColor(value);
else if(stricmp(setting, "BackdropFillStyle") == 0)
cBackdropFillStyle = TextToFillStyle(value);
else if(stricmp(setting, "TitleBoxTextColor") == 0)
cTitleBoxFgColor = TextToColor(value);
else if(stricmp(setting, "TitleBoxColor") == 0)
cTitleBoxBgColor = TextToColor(value);
else if(stricmp(setting, "MessageBoxTextColor") == 0)
cMessageBoxFgColor = TextToColor(value);
else if(stricmp(setting, "MessageBoxColor") == 0)
cMessageBoxBgColor = TextToColor(value);
else if(stricmp(setting, "MenuTextColor") == 0)
cMenuFgColor = TextToColor(value);
else if(stricmp(setting, "MenuColor") == 0)
cMenuBgColor = TextToColor(value);
else if(stricmp(setting, "TextColor") == 0)
cTextColor = TextToColor(value);
else if(stricmp(setting, "SelectedTextColor") == 0)
cSelectedTextColor = TextToColor(value);
else if(stricmp(setting, "SelectedColor") == 0)
cSelectedTextBgColor = TextToColor(value);
else if(stricmp(setting, "OS") == 0)
{
if(nNumOS >= 16)
{
printf("Error: you can only boot to at most 16 different operating systems.\n");
printf("Press any key to continue\n");
getch();
return;
}
if(!GetNumSectionItems(value))
{
printf("Error: OS \"%s\" listed.\n", value);
printf("It does not have it's own [section], or it is empty.\n");
printf("Press any key to continue\n");
getch();
return;
}
strcpy(OSList[nNumOS].name, value);
if (!ReadSectionSettingByName(value, "BootType", name, v))
{
printf("Unknown BootType for OS \"%s\"\n", value);
printf("Press any key to continue\n");
getch();
return;
}
if (stricmp(v, "ReactOS") == 0)
OSList[nNumOS].nOSType = OSTYPE_REACTOS;
else if (stricmp(v, "Linux") == 0)
OSList[nNumOS].nOSType = OSTYPE_LINUX;
else if (stricmp(v, "BootSector") == 0)
OSList[nNumOS].nOSType = OSTYPE_BOOTSECTOR;
else if (stricmp(v, "Partition") == 0)
OSList[nNumOS].nOSType = OSTYPE_PARTITION;
else if (stricmp(v, "Drive") == 0)
OSList[nNumOS].nOSType = OSTYPE_DRIVE;
else
{
printf("Unknown BootType for OS \"%s\"\n", value);
printf("Press any key to continue\n");
getch();
return;
}
nNumOS++;
}
else if(stricmp(setting, "TimeOut") == 0)
nTimeOut = atoi(value);
}

82
freeldr/freeldr/freeldr.h Normal file
View File

@@ -0,0 +1,82 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __FREELDR_H
#define __FREELDR_H
/* just some stuff */
#define VERSION "FreeLoader v0.8"
#define COPYRIGHT "Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>"
#define ROSLDR_MAJOR_VERSION 0
#define ROSLDR_MINOR_VERSION 8
#define ROSLDR_PATCH_VERSION 0
#define size_t unsigned int
#define BOOL int
#define NULL 0
#define TRUE 1
#define FALSE 0
#define BYTE unsigned char
#define WORD unsigned short
#define DWORD unsigned long
#define CHAR char
#define WCHAR unsigned short
#define LONG long
#define ULONG unsigned long
#define PULONG unsigned long *
#define PDWORD DWORD *
#define PWORD WORD *
#define OSTYPE_REACTOS 1
#define OSTYPE_LINUX 2
#define OSTYPE_BOOTSECTOR 3
#define OSTYPE_PARTITION 4
#define OSTYPE_DRIVE 5
typedef struct
{
char name[260];
int nOSType; // ReactOS or Linux or a bootsector, etc.
} OSTYPE;
extern unsigned int BootDrive; // BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc.
extern unsigned int BootPartition; // Boot Partition, 1-4
extern BOOL bTUILoaded; // Tells us if the user interface is loaded
extern char *pFreeldrIni; // Load address for freeldr.ini
extern char *pScreenBuffer; // Save address for screen contents
extern int nCursorXPos; // Cursor's X Position
extern int nCursorYPos; // Cursor's Y Position
extern OSTYPE OSList[16]; // The OS list
extern int nNumOS; // Number of OSes listed
extern int nTimeOut; // Time to wait for the user before booting
void BootMain(void);
BOOL ParseIniFile(void);
int GetNumSectionItems(char *section); // returns the number of items in a particular section (i.e. [FREELOADER])
BOOL ReadSectionSettingByNumber(char *section, int num, char *name, char *value); // Reads the num'th value from section
BOOL ReadSectionSettingByName(char *section, char *valuename, char *name, char *value); // Reads the value named name from section
BOOL IsValidSetting(char *setting, char *value);
void SetSetting(char *setting, char *value);
#endif // defined __FREELDR_H

426
freeldr/freeldr/fs.c Normal file
View File

@@ -0,0 +1,426 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "fs.h"
#include "stdlib.h"
#include "tui.h"
#include "asmcode.h"
#define FS_DO_ERROR(s) \
{ \
if (bTUILoaded) \
MessageBox(s); \
else \
{ \
printf(s); \
printf("\nPress any key\n"); \
getch(); \
} \
}
int nSectorBuffered = -1; // Tells us which sector was read into SectorBuffer[]
BYTE SectorBuffer[512]; // 512 byte buffer space for read operations, ReadOneSector reads to here
int FSType = NULL; // Type of filesystem on boot device, set by OpenDiskDrive()
char *pFileSysData = (char *)(FILESYSADDR); // Load address for filesystem data
char *pFat32FATCacheIndex = (char *)(FILESYSADDR); // Load address for filesystem data
BOOL OpenDiskDrive(int nDrive, int nPartition)
{
int num_bootable_partitions = 0;
int boot_partition = 0;
int partition_type = 0;
int head, sector, cylinder;
int offset;
// Check and see if it is a floppy drive
if (nDrive < 0x80)
{
// Read boot sector
if (!biosdisk(_DISK_READ, nDrive, 0, 0, 1, 1, SectorBuffer))
{
FS_DO_ERROR("Disk Read Error");
return FALSE;
}
// Check for validity
if (*((WORD*)(SectorBuffer + 0x1fe)) != 0xaa55)//(SectorBuffer[0x1FE] != 0x55) || (SectorBuffer[0x1FF] != 0xAA))
{
FS_DO_ERROR("Invalid boot sector magic (0xaa55)");
return FALSE;
}
}
else
{
// Read master boot record
if (!biosdisk(_DISK_READ, nDrive, 0, 0, 1, 1, SectorBuffer))
{
FS_DO_ERROR("Disk Read Error");
return FALSE;
}
// Check for validity
if (*((WORD*)(SectorBuffer + 0x1fe)) != 0xaa55)//(SectorBuffer[0x1FE] != 0x55) || (SectorBuffer[0x1FF] != 0xAA))
{
FS_DO_ERROR("Invalid partition table magic (0xaa55)");
return FALSE;
}
if (nPartition == 0)
{
// Check for bootable partitions
if (SectorBuffer[0x1BE] == 0x80)
num_bootable_partitions++;
if (SectorBuffer[0x1CE] == 0x80)
{
num_bootable_partitions++;
boot_partition = 1;
}
if (SectorBuffer[0x1DE] == 0x80)
{
num_bootable_partitions++;
boot_partition = 2;
}
if (SectorBuffer[0x1EE] == 0x80)
{
num_bootable_partitions++;
boot_partition = 3;
}
// Make sure there was only one bootable partition
if (num_bootable_partitions > 1)
{
FS_DO_ERROR("Too many boot partitions");
return FALSE;
}
offset = 0x1BE + (boot_partition * 0x10);
}
else
offset = 0x1BE + ((nPartition-1) * 0x10);
partition_type = SectorBuffer[offset + 4];
// Check for valid partition
if (partition_type == 0)
{
FS_DO_ERROR("Invalid boot partition");
return FALSE;
}
head = SectorBuffer[offset + 1];
sector = (SectorBuffer[offset + 2] & 0x3F);
cylinder = SectorBuffer[offset + 3];
if (SectorBuffer[offset + 2] & 0x80)
cylinder += 0x200;
if (SectorBuffer[offset + 2] & 0x40)
cylinder += 0x100;
// Read partition boot sector
if (!biosdisk(_DISK_READ, nDrive, head, cylinder, sector, 1, SectorBuffer))
{
FS_DO_ERROR("Disk Read Error");
return FALSE;
}
// Check for validity
if (*((WORD*)(SectorBuffer + 0x1fe)) != 0xaa55)//(SectorBuffer[0x1FE] != 0x55) || (SectorBuffer[0x1FF] != 0xAA))
{
FS_DO_ERROR("Invalid boot sector magic (0xaa55)");
return FALSE;
}
}
// Reset data
nBytesPerSector = 0;
nSectorsPerCluster = 0;
nReservedSectors = 0;
nNumberOfFATs = 0;
nRootDirEntries = 0;
nTotalSectors16 = 0;
nSectorsPerFAT16 = 0;
nSectorsPerTrack = 0;
nNumberOfHeads = 0;
nHiddenSectors = 0;
nTotalSectors32 = 0;
nSectorsPerFAT32 = 0;
nExtendedFlags = 0;
nFileSystemVersion = 0;
nRootDirStartCluster = 0;
nRootDirSectorStart = 0;
nDataSectorStart = 0;
nSectorsPerFAT = 0;
nRootDirSectors = 0;
nTotalSectors = 0;
nNumberOfClusters = 0;
// Get data
memcpy(&nBytesPerSector, SectorBuffer + BPB_BYTESPERSECTOR, 2);
memcpy(&nSectorsPerCluster, SectorBuffer + BPB_SECTORSPERCLUSTER, 1);
memcpy(&nReservedSectors, SectorBuffer + BPB_RESERVEDSECTORS, 2);
memcpy(&nNumberOfFATs, SectorBuffer + BPB_NUMBEROFFATS, 1);
memcpy(&nRootDirEntries, SectorBuffer + BPB_ROOTDIRENTRIES, 2);
memcpy(&nTotalSectors16, SectorBuffer + BPB_TOTALSECTORS16, 2);
memcpy(&nSectorsPerFAT16, SectorBuffer + BPB_SECTORSPERFAT16, 2);
memcpy(&nSectorsPerTrack, SectorBuffer + BPB_SECTORSPERTRACK, 2);
memcpy(&nNumberOfHeads, SectorBuffer + BPB_NUMBEROFHEADS, 2);
memcpy(&nHiddenSectors, SectorBuffer + BPB_HIDDENSECTORS, 4);
memcpy(&nTotalSectors32, SectorBuffer + BPB_TOTALSECTORS32, 4);
memcpy(&nSectorsPerFAT32, SectorBuffer + BPB_SECTORSPERFAT32, 4);
memcpy(&nExtendedFlags, SectorBuffer + BPB_EXTENDEDFLAGS32, 2);
memcpy(&nFileSystemVersion, SectorBuffer + BPB_FILESYSTEMVERSION32, 2);
memcpy(&nRootDirStartCluster, SectorBuffer + BPB_ROOTDIRSTARTCLUSTER32, 4);
// Calc some stuff
if (nTotalSectors16 != 0)
nTotalSectors = nTotalSectors16;
else
nTotalSectors = nTotalSectors32;
if (nSectorsPerFAT16 != 0)
nSectorsPerFAT = nSectorsPerFAT16;
else
nSectorsPerFAT = nSectorsPerFAT32;
nRootDirSectorStart = (nNumberOfFATs * nSectorsPerFAT) + nReservedSectors;
nRootDirSectors = ((nRootDirEntries * 32) + (nBytesPerSector - 1)) / nBytesPerSector;
nDataSectorStart = nReservedSectors + (nNumberOfFATs * nSectorsPerFAT) + nRootDirSectors;
nNumberOfClusters = (nTotalSectors - nDataSectorStart) / nSectorsPerCluster;
// Determine FAT type
if (nNumberOfClusters < 4085)
{
/* Volume is FAT12 */
nFATType = FAT12;
}
else if (nNumberOfClusters < 65525)
{
/* Volume is FAT16 */
nFATType = FAT16;
}
else
{
/* Volume is FAT32 */
nFATType = FAT32;
// Check version
// we only work with version 0
if (*((WORD*)(SectorBuffer + BPB_FILESYSTEMVERSION32)) != 0)
{
FS_DO_ERROR("Error: FreeLoader is too old to work with this FAT32 filesystem.\nPlease update FreeLoader.");
return FALSE;
}
}
FSType = FS_FAT;
// Buffer the FAT table if it is small enough
if ((FSType == FS_FAT) && (nFATType == FAT12))
{
if (!ReadMultipleSectors(nReservedSectors, nSectorsPerFAT, pFileSysData))
return FALSE;
}
else if ((FSType == FS_FAT) && (nFATType == FAT16))
{
if (!ReadMultipleSectors(nReservedSectors, nSectorsPerFAT, pFileSysData))
return FALSE;
}
else if ((FSType == FS_FAT) && (nFATType == FAT32))
{
// The FAT table is too big to be buffered so
// we will initialize our cache and cache it
// on demand
for (offset=0; offset<256; offset++)
((int*)pFat32FATCacheIndex)[offset] = -1;
}
return TRUE;
}
BOOL ReadMultipleSectors(int nSect, int nNumberOfSectors, void *pBuffer)
{
BOOL bRetVal;
int PhysicalSector;
int PhysicalHead;
int PhysicalTrack;
int nNum;
nSect += nHiddenSectors;
while (nNumberOfSectors)
{
PhysicalSector = 1 + (nSect % nSectorsPerTrack);
PhysicalHead = (nSect / nSectorsPerTrack) % nNumberOfHeads;
PhysicalTrack = nSect / (nSectorsPerTrack * nNumberOfHeads);
if (PhysicalSector > 1)
{
if (nNumberOfSectors >= (nSectorsPerTrack - (PhysicalSector - 1)))
nNum = (nSectorsPerTrack - (PhysicalSector - 1));
else
nNum = nNumberOfSectors;
}
else
{
if (nNumberOfSectors >= nSectorsPerTrack)
nNum = nSectorsPerTrack;
else
nNum = nNumberOfSectors;
}
bRetVal = biosdisk(_DISK_READ, BootDrive, PhysicalHead, PhysicalTrack, PhysicalSector, nNum, pBuffer);
if (!bRetVal)
{
FS_DO_ERROR("Disk Error");
return FALSE;
}
pBuffer += (nNum * 512);
nNumberOfSectors -= nNum;
nSect += nNum;
}
return TRUE;
}
BOOL ReadOneSector(int nSect)
{
BOOL bRetVal;
int PhysicalSector;
int PhysicalHead;
int PhysicalTrack;
nSectorBuffered = nSect;
nSect += nHiddenSectors;
PhysicalSector = 1 + (nSect % nSectorsPerTrack);
PhysicalHead = (nSect / nSectorsPerTrack) % nNumberOfHeads;
PhysicalTrack = nSect / (nSectorsPerTrack * nNumberOfHeads);
bRetVal = biosdisk(_DISK_READ, BootDrive, PhysicalHead, PhysicalTrack, PhysicalSector, 1, SectorBuffer);
if (!bRetVal)
{
FS_DO_ERROR("Disk Error");
return FALSE;
}
return TRUE;
}
BOOL OpenFile(char *filename, FILE *pFile)
{
switch(FSType)
{
case FS_FAT:
if(!FATOpenFile(filename, &(pFile->fat)))
return FALSE;
pFile->filesize = pFile->fat.dwSize;
break;
default:
FS_DO_ERROR("Error: Unknown filesystem.");
return FALSE;
break;
}
return TRUE;
}
/*
* ReadFile()
* returns number of bytes read or EOF
*/
int ReadFile(FILE *pFile, int count, void *buffer)
{
switch(FSType)
{
case FS_FAT:
return FATRead(&(pFile->fat), count, buffer);
default:
FS_DO_ERROR("Error: Unknown filesystem.");
return EOF;
}
return 0;
}
DWORD GetFileSize(FILE *pFile)
{
return pFile->filesize;
}
DWORD Rewind(FILE *pFile)
{
switch (FSType)
{
case FS_FAT:
pFile->fat.dwCurrentCluster = pFile->fat.dwStartCluster;
pFile->fat.dwCurrentReadOffset = 0;
break;
default:
FS_DO_ERROR("Error: Unknown filesystem.");
break;
}
return pFile->filesize;
}
int feof(FILE *pFile)
{
switch (FSType)
{
case FS_FAT:
if (pFile->fat.dwCurrentReadOffset >= pFile->fat.dwSize)
return TRUE;
else
return FALSE;
break;
default:
FS_DO_ERROR("Error: Unknown filesystem.");
return TRUE;
break;
}
return TRUE;
}
int fseek(FILE *pFile, DWORD offset)
{
switch (FSType)
{
case FS_FAT:
return FATfseek(&(pFile->fat), offset);
break;
default:
FS_DO_ERROR("Error: Unknown filesystem.");
break;
}
return -1;
}

182
freeldr/freeldr/fs.h Normal file
View File

@@ -0,0 +1,182 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __FS_FAT_H
#define __FS_FAT_H
// Bootsector BPB defines
#define BPB_JMPBOOT 0
#define BPB_OEMNAME 3
#define BPB_BYTESPERSECTOR 11
#define BPB_SECTORSPERCLUSTER 13
#define BPB_RESERVEDSECTORS 14
#define BPB_NUMBEROFFATS 16
#define BPB_ROOTDIRENTRIES 17
#define BPB_TOTALSECTORS16 19
#define BPB_MEDIADESCRIPTOR 21
#define BPB_SECTORSPERFAT16 22
#define BPB_SECTORSPERTRACK 24
#define BPB_NUMBEROFHEADS 26
#define BPB_HIDDENSECTORS 28
#define BPB_TOTALSECTORS32 32
// Fat12/16 extended BPB defines
#define BPB_DRIVENUMBER16 36
#define BPB_RESERVED16_1 37
#define BPB_BOOTSIGNATURE16 38
#define BPB_VOLUMESERIAL16 39
#define BPB_VOLUMELABEL16 43
#define BPB_FILESYSTEMTYPE16 54
// Fat32 extended BPB defines
#define BPB_SECTORSPERFAT32 36
#define BPB_EXTENDEDFLAGS32 40
#define BPB_FILESYSTEMVERSION32 42
#define BPB_ROOTDIRSTARTCLUSTER32 44
#define BPB_FILESYSTEMINFOSECTOR32 48
#define BPB_BACKUPBOOTSECTOR32 50
#define BPB_RESERVED32_1 52
#define BPB_DRIVENUMBER32 64
#define BPB_RESERVED32_2 65
#define BPB_BOOTSIGNATURE32 66
#define BPB_VOLUMESERIAL32 67
#define BPB_VOLUMELABEL32 71
#define BPB_FILESYSTEMTYPE32 82
/*
* Structure of MSDOS directory entry
*/
typedef struct //_DIRENTRY
{
BYTE cFileName[11]; /* Filename + extension */
BYTE cAttr; /* File attributes */
BYTE cReserved[10]; /* Reserved area */
WORD wTime; /* Time last modified */
WORD wData; /* Date last modified */
WORD wCluster; /* First cluster number */
DWORD dwSize; /* File size */
} DIRENTRY, * PDIRENTRY;
/*
* Structure of internal file control block
*/
typedef struct //_FCB
{
BYTE cAttr; /* Open attributes */
BYTE cSector; /* Sector within cluster */
PDIRENTRY pDirptr; /* Pointer to directory entry */
WORD wDirSector; /* Directory sector */
WORD wFirstCluster; /* First cluster in file */
WORD wLastCluster; /* Last cluster read/written */
WORD wNextCluster; /* Next cluster to read/write */
WORD wOffset; /* Read/Write offset within sector */
DWORD dwSize; /* File size */
BYTE cBuffer[512]; /* Data transfer buffer */
} FCB, * PFCB;
typedef struct //_FAT_STRUCT
{
DWORD dwStartCluster; // File's starting cluster
DWORD dwCurrentCluster; // Current read cluster number
DWORD dwSize; // File size
DWORD dwCurrentReadOffset;// Amount of data already read
} FAT_STRUCT, * PFAT_STRUCT;
typedef struct //_FILE
{
//DIRENTRY de;
//FCB fcb;
FAT_STRUCT fat;
unsigned long filesize;
} FILE;
extern int nSectorBuffered; // Tells us which sector was read into SectorBuffer[]
extern BYTE SectorBuffer[512]; // 512 byte buffer space for read operations, ReadOneSector reads to here
extern int nFATType;
extern DWORD nBytesPerSector; // Bytes per sector
extern DWORD nSectorsPerCluster; // Number of sectors in a cluster
extern DWORD nReservedSectors; // Reserved sectors, usually 1 (the bootsector)
extern DWORD nNumberOfFATs; // Number of FAT tables
extern DWORD nRootDirEntries; // Number of root directory entries (fat12/16)
extern DWORD nTotalSectors16; // Number of total sectors on the drive, 16-bit
extern DWORD nSectorsPerFAT16; // Sectors per FAT table (fat12/16)
extern DWORD nSectorsPerTrack; // Number of sectors in a track
extern DWORD nNumberOfHeads; // Number of heads on the disk
extern DWORD nHiddenSectors; // Hidden sectors (sectors before the partition start like the partition table)
extern DWORD nTotalSectors32; // Number of total sectors on the drive, 32-bit
extern DWORD nSectorsPerFAT32; // Sectors per FAT table (fat32)
extern DWORD nExtendedFlags; // Extended flags (fat32)
extern DWORD nFileSystemVersion; // File system version (fat32)
extern DWORD nRootDirStartCluster; // Starting cluster of the root directory (fat32)
extern DWORD nRootDirSectorStart; // Starting sector of the root directory (fat12/16)
extern DWORD nDataSectorStart; // Starting sector of the data area
extern DWORD nSectorsPerFAT; // Sectors per FAT table
extern DWORD nRootDirSectors; // Number of sectors of the root directory (fat32)
extern DWORD nTotalSectors; // Total sectors on the drive
extern DWORD nNumberOfClusters; // Number of clusters on the drive
extern int FSType; // Type of filesystem on boot device, set by OpenDiskDrive()
extern char *pFileSysData; // Load address for filesystem data
extern char *pFat32FATCacheIndex; // Load address for filesystem data
BOOL OpenDiskDrive(int nDrive, int nPartition); // Opens the disk drive device for reading
BOOL ReadMultipleSectors(int nSect, int nNumberOfSectors, void *pBuffer);// Reads a sector from the open device
BOOL ReadOneSector(int nSect); // Reads one sector from the open device
BOOL OpenFile(char *filename, FILE *pFile); // Opens a file
int ReadFile(FILE *pFile, int count, void *buffer); // Reads count bytes from pFile into buffer
DWORD GetFileSize(FILE *pFile);
DWORD Rewind(FILE *pFile); // Rewinds a file and returns it's size
int feof(FILE *pFile);
int fseek(FILE *pFILE, DWORD offset);
BOOL FATLookupFile(char *file, PFAT_STRUCT pFatStruct);
int FATGetNumPathParts(char *name);
BOOL FATGetFirstNameFromPath(char *buffer, char *name);
void FATParseFileName(char *buffer, char *name);
DWORD FATGetFATEntry(DWORD nCluster);
BOOL FATOpenFile(char *szFileName, PFAT_STRUCT pFatStruct);
int FATReadCluster(DWORD nCluster, char *cBuffer);
int FATRead(PFAT_STRUCT pFatStruct, int nNumBytes, char *cBuffer);
int FATfseek(PFAT_STRUCT pFatStruct, DWORD offset);
#define EOF -1
#define ATTR_NORMAL 0x00
#define ATTR_READONLY 0x01
#define ATTR_HIDDEN 0x02
#define ATTR_SYSTEM 0x04
#define ATTR_VOLUMENAME 0x08
#define ATTR_DIRECTORY 0x10
#define ATTR_ARCHIVE 0x20
#define FS_FAT 1
#define FS_NTFS 2
#define FS_EXT2 3
#define FAT12 1
#define FAT16 2
#define FAT32 3
#endif // #defined __FS_FAT_H

541
freeldr/freeldr/fs_fat.c Normal file
View File

@@ -0,0 +1,541 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "fs.h"
#include "stdlib.h"
#include "tui.h"
#include "asmcode.h"
int nFATType = FAT12;
DWORD nBytesPerSector; // Bytes per sector
DWORD nSectorsPerCluster; // Number of sectors in a cluster
DWORD nReservedSectors; // Reserved sectors, usually 1 (the bootsector)
DWORD nNumberOfFATs; // Number of FAT tables
DWORD nRootDirEntries; // Number of root directory entries (fat12/16)
DWORD nTotalSectors16; // Number of total sectors on the drive, 16-bit
DWORD nSectorsPerFAT16; // Sectors per FAT table (fat12/16)
DWORD nSectorsPerTrack; // Number of sectors in a track
DWORD nNumberOfHeads; // Number of heads on the disk
DWORD nHiddenSectors; // Hidden sectors (sectors before the partition start like the partition table)
DWORD nTotalSectors32; // Number of total sectors on the drive, 32-bit
DWORD nSectorsPerFAT32; // Sectors per FAT table (fat32)
DWORD nExtendedFlags; // Extended flags (fat32)
DWORD nFileSystemVersion; // File system version (fat32)
DWORD nRootDirStartCluster; // Starting cluster of the root directory (fat32)
DWORD nRootDirSectorStart; // Starting sector of the root directory (fat12/16)
DWORD nDataSectorStart; // Starting sector of the data area
DWORD nSectorsPerFAT; // Sectors per FAT table
DWORD nRootDirSectors; // Number of sectors of the root directory (fat32)
DWORD nTotalSectors; // Total sectors on the drive
DWORD nNumberOfClusters; // Number of clusters on the drive
BOOL FATReadRootDirectoryEntry(int nDirEntry, void *pDirEntryBuf)
{
DWORD nDirEntrySector;
int nOffsetWithinSector;
nDirEntrySector = nRootDirSectorStart + ((nDirEntry * 32) / nBytesPerSector);
if (!ReadOneSector(nDirEntrySector))
return FALSE;
nOffsetWithinSector = (nDirEntry * 32) % nBytesPerSector;
memcpy(pDirEntryBuf, SectorBuffer + nOffsetWithinSector, 32);
if (*((char *)pDirEntryBuf) == 0x05)
*((char *)pDirEntryBuf) = 0xE5;
return TRUE;
}
BOOL FATReadDirectoryEntry(DWORD nDirStartCluster, int nDirEntry, void *pDirEntryBuf)
{
DWORD nRealDirCluster;
int nSectorWithinCluster;
int nOffsetWithinSector;
int nSectorToRead;
int i;
i = (nDirEntry * 32) / (nSectorsPerCluster * nBytesPerSector);
//if ((nDirEntry * 32) % (nSectorsPerCluster * nBytesPerSector))
// i++;
for (nRealDirCluster = nDirStartCluster; i; i--)
nRealDirCluster = FATGetFATEntry(nRealDirCluster);
nSectorWithinCluster = ((nDirEntry * 32) % (nSectorsPerCluster * nBytesPerSector)) / nBytesPerSector;
nSectorToRead = ((nRealDirCluster - 2) * nSectorsPerCluster) + nDataSectorStart + nSectorWithinCluster;
if (!ReadOneSector(nSectorToRead))
return FALSE;
nOffsetWithinSector = (nDirEntry * 32) % nBytesPerSector;
memcpy(pDirEntryBuf, SectorBuffer + nOffsetWithinSector, 32);
if (*((char *)pDirEntryBuf) == 0x05)
*((char *)pDirEntryBuf) = 0xE5;
return TRUE;
}
/*
* FATLookupFile()
* This function searches the file system for the
* specified filename and fills in a FAT_STRUCT structure
* with info describing the file, etc. returns true
* if the file exists or false otherwise
*/
BOOL FATLookupFile(char *file, PFAT_STRUCT pFatStruct)
{
int i, j;
int numparts;
char filename[12];
BYTE direntry[32];
int nNumDirEntries;
FAT_STRUCT fatstruct;
BOOL bFound;
DWORD cluster;
memset(pFatStruct, 0, sizeof(FAT_STRUCT));
// Check and see if the first character is '\' and remove it if so
if (*file == '\\')
file++;
// Figure out how many sub-directories we are nested in
numparts = FATGetNumPathParts(file);
// Loop once for each part
for (i=0; i<numparts; i++)
{
// Make filename compatible with MSDOS dir entry
if (!FATGetFirstNameFromPath(filename, file))
return FALSE;
// Advance to the next part of the path
for (; (*file != '\\') && (*file != '\0'); file++);
file++;
// If we didn't find the correct sub-directory the fail
if ((i != 0) && !bFound)
return FALSE;
bFound = FALSE;
// Check if we are pulling from the root directory of a fat12/fat16 disk
if ((i == 0) && ((nFATType == FAT12) || (nFATType == FAT16)))
nNumDirEntries = nRootDirEntries;
else if ((i == 0) && (nFATType == FAT32))
{
cluster = nRootDirStartCluster;
fatstruct.dwSize = nSectorsPerCluster * nBytesPerSector;
while((cluster = FATGetFATEntry(cluster)) < 0x0FFFFFF8)
fatstruct.dwSize += nSectorsPerCluster * nBytesPerSector;
fatstruct.dwStartCluster = nRootDirStartCluster;
nNumDirEntries = fatstruct.dwSize / 32;
}
else
nNumDirEntries = fatstruct.dwSize / 32;
// Loop through each directory entry
for (j=0; j<nNumDirEntries; j++)
{
// Read the entry
if ((i == 0) && ((nFATType == FAT12) || (nFATType == FAT16)))
{
if (!FATReadRootDirectoryEntry(j, direntry))
return FALSE;
}
else
{
if (!FATReadDirectoryEntry(fatstruct.dwStartCluster, j, direntry))
return FALSE;
}
if (memcmp(direntry, filename, 11) == 0)
{
fatstruct.dwStartCluster = 0;
fatstruct.dwCurrentCluster = 0;
memcpy(&fatstruct.dwStartCluster, direntry + 26, sizeof(WORD));
memcpy(&fatstruct.dwCurrentCluster, direntry + 20, sizeof(WORD));
fatstruct.dwStartCluster += (fatstruct.dwCurrentCluster * 0x10000);
if (direntry[11] & ATTR_DIRECTORY)
{
fatstruct.dwSize = nSectorsPerCluster * nBytesPerSector;
cluster = fatstruct.dwStartCluster;
switch (nFATType)
{
case FAT12:
while((cluster = FATGetFATEntry(cluster)) < 0xFF8)
fatstruct.dwSize += nSectorsPerCluster * nBytesPerSector;
break;
case FAT16:
while((cluster = FATGetFATEntry(cluster)) < 0xFFF8)
fatstruct.dwSize += nSectorsPerCluster * nBytesPerSector;
break;
case FAT32:
while((cluster = FATGetFATEntry(cluster)) < 0x0FFFFFF8)
fatstruct.dwSize += nSectorsPerCluster * nBytesPerSector;
break;
}
}
// If we have more parts to go and this isn't a directory then fail
if ((i < (numparts-1)) && !(direntry[11] & ATTR_DIRECTORY))
return FALSE;
// If this is supposed to be a file and it is a directory then fail
if ((i == (numparts-1)) && (direntry[11] & ATTR_DIRECTORY))
return FALSE;
bFound = TRUE;
break;
}
}
}
if(!bFound)
return FALSE;
memcpy(&pFatStruct->dwStartCluster, direntry + 26, sizeof(WORD));
memcpy(&pFatStruct->dwCurrentCluster, direntry + 20, sizeof(WORD));
pFatStruct->dwStartCluster += (pFatStruct->dwCurrentCluster * 0x10000);
pFatStruct->dwCurrentCluster = pFatStruct->dwStartCluster;
memcpy(&pFatStruct->dwSize, direntry + 28, sizeof(DWORD));
pFatStruct->dwCurrentReadOffset = 0;
return TRUE;
}
/*
* FATGetNumPathParts()
* This function parses a path in the form of dir1\dir2\file1.ext
* and returns the number of parts it has (i.e. 3 - dir1,dir2,file1.ext)
*/
int FATGetNumPathParts(char *name)
{
int i, num;
for(i=0,num=0; i<(int)strlen(name); i++)
{
if(name[i] == '\\')
num++;
}
num++;
return num;
}
/*
* FATGetFirstNameFromPath()
* This function parses a path in the form of dir1\dir2\file1.ext
* and puts the first name of the path (e.g. "dir1") in buffer
* compatible with the MSDOS directory structure
*/
BOOL FATGetFirstNameFromPath(char *buffer, char *name)
{
int i;
char temp[260];
// Copy all the characters up to the end of the
// string or until we hit a '\' character
// and put them in temp
for(i=0; i<(int)strlen(name); i++)
{
if(name[i] == '\\')
break;
else
temp[i] = name[i];
}
temp[i] = 0;
// If the filename is too long then fail
if(strlen(temp) > 12)
return FALSE;
FATParseFileName(buffer, temp);
return TRUE;
}
/*
* FATParseFileName()
* This function parses "name" which is in the form of file.ext
* and puts it in "buffer" in the form of "FILE EXT" which
* is compatible with the MSDOS directory structure
*/
void FATParseFileName(char *buffer, char *name)
{
int i, j;
i = 0;
j = 0;
while(i < 8)
buffer[i++] = (name[j] && (name[j] != '.')) ? toupper(name[j++]) : ' ';
if(name[j] == '.')
j++;
while(i < 11)
buffer[i++] = name[j] ? toupper(name[j++]) : ' ';
buffer[i] = 0;
}
/*
* FATGetFATEntry()
* returns the FAT entry for a given cluster number
*/
DWORD FATGetFATEntry(DWORD nCluster)
{
DWORD fat;
int FATOffset;
int ThisFATSecNum;
int ThisFATEntOffset;
int Idx;
BOOL bEntryFound;
switch(nFATType)
{
case FAT12:
FATOffset = nCluster + (nCluster / 2);
ThisFATSecNum = (FATOffset / nBytesPerSector);
ThisFATEntOffset = (FATOffset % nBytesPerSector);
fat = *((WORD *) (pFileSysData + (ThisFATSecNum * nBytesPerSector) + ThisFATEntOffset));
if (nCluster & 0x0001)
fat = fat >> 4; /* Cluster number is ODD */
else
fat = fat & 0x0FFF; /* Cluster number is EVEN */
return fat;
break;
case FAT16:
FATOffset = (nCluster * 2);
//ThisFATSecNum = nReservedSectors + (FATOffset / nBytesPerSector);
//ThisFATEntOffset = (FATOffset % nBytesPerSector);
//if (!ReadOneSector(ThisFATSecNum))
// return NULL;
//fat = *((WORD *) &SectorBuffer[ThisFATEntOffset]);
fat = *((WORD *) (pFileSysData + FATOffset));
return fat;
break;
case FAT32:
//if (!ReadOneSector(ThisFATSecNum))
// return NULL;
//fat = *((DWORD *) &SectorBuffer[ThisFATEntOffset]) & 0x0FFFFFFF;
//return fat;
// This code manages the fat32 fat table entry cache
// The cache is at address FILESYSADDR which is 128k in size
// The first two sectors will contain an array of DWORDs that
// Specify what fat sector is cached. The first two DWORDs
// should be zero.
FATOffset = (nCluster * 4);
ThisFATSecNum = nReservedSectors + (FATOffset / nBytesPerSector);
ThisFATEntOffset = (FATOffset % nBytesPerSector);
// Now we go through our cache and see if we already have the sector cached
bEntryFound = FALSE;
for (Idx=2; Idx<256; Idx++)
{
if (((int*)pFat32FATCacheIndex)[Idx] == ThisFATSecNum)
{
bEntryFound = TRUE;
break;
}
}
if (bEntryFound)
{
// Get the fat entry
fat = (*((DWORD *) (pFat32FATCacheIndex +
(Idx * nBytesPerSector) + ThisFATEntOffset))) & 0x0FFFFFFF;
}
else
{
if (!ReadOneSector(ThisFATSecNum))
return NULL;
// Move each sector down in the cache to make room for new sector
for (Idx=255; Idx>2; Idx--)
{
memcpy(pFat32FATCacheIndex + (Idx * nBytesPerSector), pFat32FATCacheIndex + ((Idx - 1) * nBytesPerSector), nBytesPerSector);
((int*)pFat32FATCacheIndex)[Idx] = ((int*)pFat32FATCacheIndex)[Idx - 1];
}
// Insert it into the cache
memcpy(pFat32FATCacheIndex + (2 * nBytesPerSector), SectorBuffer, nBytesPerSector);
((int*)pFat32FATCacheIndex)[2] = ThisFATSecNum;
// Get the fat entry
fat = (*((DWORD *) (pFat32FATCacheIndex +
(2 * nBytesPerSector) + ThisFATEntOffset))) & 0x0FFFFFFF;
}
return fat;
break;
}
return NULL;
}
/*
* FATOpenFile()
* Tries to open the file 'name' and returns true or false
* for success and failure respectively
*/
BOOL FATOpenFile(char *szFileName, PFAT_STRUCT pFatStruct)
{
if(!FATLookupFile(szFileName, pFatStruct))
return FALSE;
/* Fill in file control information */
pFatStruct->dwCurrentCluster = pFatStruct->dwStartCluster;
pFatStruct->dwCurrentReadOffset = 0;
return TRUE;
}
/*
* FATReadCluster()
* Reads the specified cluster into memory
* and returns the number of bytes read
*/
int FATReadCluster(DWORD nCluster, char *cBuffer)
{
int nStartSector;
nStartSector = ((nCluster - 2) * nSectorsPerCluster) + nDataSectorStart;
ReadMultipleSectors(nStartSector, nSectorsPerCluster, cBuffer);
return (nSectorsPerCluster * nBytesPerSector);
}
/*
* FATRead()
* Reads nNumBytes from open file and
* returns the number of bytes read
*/
int FATRead(PFAT_STRUCT pFatStruct, int nNumBytes, char *cBuffer)
{
int nSectorWithinCluster;
int nOffsetWithinSector;
int nOffsetWithinCluster;
int nNum;
int nBytesRead = 0;
// If all the data is read return zero
if (pFatStruct->dwCurrentReadOffset >= pFatStruct->dwSize)
return 0;
// If they are trying to read more than there is to read
// then adjust the amount to read
if ((pFatStruct->dwCurrentReadOffset + nNumBytes) > pFatStruct->dwSize)
nNumBytes = pFatStruct->dwSize - pFatStruct->dwCurrentReadOffset;
while (nNumBytes)
{
// Check and see if the read offset is aligned to a cluster boundary
// if so great, if not then read the rest of the current cluster
if ((pFatStruct->dwCurrentReadOffset % (nSectorsPerCluster * nBytesPerSector)) != 0)
{
nSectorWithinCluster = ((pFatStruct->dwCurrentReadOffset / nBytesPerSector) % nSectorsPerCluster);
nOffsetWithinSector = (pFatStruct->dwCurrentReadOffset % nBytesPerSector);
nOffsetWithinCluster = (pFatStruct->dwCurrentReadOffset % (nSectorsPerCluster * nBytesPerSector));
// Read the cluster into the scratch area
FATReadCluster(pFatStruct->dwCurrentCluster, (char *)FATCLUSTERBUF);
nNum = (nSectorsPerCluster * nBytesPerSector) - (pFatStruct->dwCurrentReadOffset % (nSectorsPerCluster * nBytesPerSector));
if (nNumBytes >= nNum)
{
memcpy(cBuffer, (char *)(FATCLUSTERBUF + nOffsetWithinCluster), nNum);
nBytesRead += nNum;
cBuffer += nNum;
pFatStruct->dwCurrentReadOffset += nNum;
pFatStruct->dwCurrentCluster = FATGetFATEntry(pFatStruct->dwCurrentCluster);
nNumBytes -= nNum;
}
else
{
memcpy(cBuffer, (char *)(FATCLUSTERBUF + nOffsetWithinCluster), nNumBytes);
nBytesRead += nNumBytes;
cBuffer += nNumBytes;
pFatStruct->dwCurrentReadOffset += nNumBytes;
nNumBytes -= nNumBytes;
}
}
else
{
// Read the cluster into the scratch area
FATReadCluster(pFatStruct->dwCurrentCluster, (char *)FATCLUSTERBUF);
nNum = (nSectorsPerCluster * nBytesPerSector);
if (nNumBytes >= nNum)
{
memcpy(cBuffer, (char *)(FATCLUSTERBUF), nNum);
nBytesRead += nNum;
cBuffer += nNum;
pFatStruct->dwCurrentReadOffset += nNum;
pFatStruct->dwCurrentCluster = FATGetFATEntry(pFatStruct->dwCurrentCluster);
nNumBytes -= nNum;
}
else
{
memcpy(cBuffer, (char *)(FATCLUSTERBUF), nNumBytes);
nBytesRead += nNumBytes;
cBuffer += nNumBytes;
pFatStruct->dwCurrentReadOffset += nNumBytes;
nNumBytes -= nNumBytes;
}
}
}
return nBytesRead;
}
int FATfseek(PFAT_STRUCT pFatStruct, DWORD offset)
{
DWORD cluster;
int numclusters;
numclusters = offset / (nSectorsPerCluster * nBytesPerSector);
for (cluster=pFatStruct->dwStartCluster; numclusters > 0; numclusters--)
cluster = FATGetFATEntry(cluster);
pFatStruct->dwCurrentCluster = cluster;
pFatStruct->dwCurrentReadOffset = offset;
return 0;
}

101
freeldr/freeldr/linux.c Normal file
View File

@@ -0,0 +1,101 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "asmcode.h"
#include "miscboot.h"
#include "stdlib.h"
#include "fs.h"
#include "tui.h"
#include "linux.h"
void LoadAndBootLinux(int DriveNum, int Partition, char *vmlinuz, char *cmd_line)
{
FILE file;
char temp[260];
char bootsector[512];
char setup[2048];
int len;
BootDrive = DriveNum;
BootPartition = Partition;
if (!OpenDiskDrive(BootDrive, BootPartition))
{
MessageBox("Failed to open boot drive.");
return;
}
if (!OpenFile(vmlinuz, &file))
{
strcpy(temp, vmlinuz);
strcat(temp, " not found.");
MessageBox(temp);
return;
}
// Read boot sector
if (ReadFile(&file, 512, bootsector) != 512)
{
MessageBox("Disk Read Error");
return;
}
MessageBox("bootsector loaded");
// Read setup code
if (ReadFile(&file, 2048, setup) != 2048)
{
MessageBox("Disk Read Error");
return;
}
MessageBox("setup loaded");
// Read kernel code
len = GetFileSize(&file) - (2048 + 512);
//len = 0x200;
if (ReadFile(&file, len, (void*)0x100000) != len)
{
MessageBox("Disk Read Error");
return;
}
MessageBox("kernel loaded");
// Check for validity
if (*((WORD*)(bootsector + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid boot sector magic (0xaa55)");
return;
}
if (*((DWORD*)(setup + 2)) != 0x53726448)
{
MessageBox("Invalid setup magic (\"HdrS\")");
return;
}
memcpy((void*)0x90000, bootsector, 512);
memcpy((void*)0x90200, setup, 2048);
RestoreScreen(pScreenBuffer);
showcursor();
gotoxy(nCursorXPos, nCursorYPos);
stop_floppy();
JumpToLinuxBootCode();
}

View File

@@ -1,9 +1,6 @@
/*
* ReactOS test program -
*
* wfileio.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,12 +17,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define UNICODE
#define _UNICODE
#include "_tfileio.c"
#ifndef __LINUX_H
#define __LINUX_H
void JumpToLinuxBootCode(void); // Implemented in boot.S
int run_unicode_tests(int test_num)
{
return test_files(test_num, "UNICODE");
}
void LoadAndBootLinux(int DriveNum, int Partition, char *vmlinuz, char *cmd_line);
#endif // defined __LINUX_H

190
freeldr/freeldr/menu.c Normal file
View File

@@ -0,0 +1,190 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "stdlib.h"
#include "tui.h"
#include "menu.h"
#include "options.h"
static int nOSListBoxLeft;
static int nOSListBoxRight;
static int nOSListBoxTop;
static int nOSListBoxBottom;
static int nOSSelected = 0; // Currently selected OS (zero based)
int RunMenu(void)
{
int key;
int second;
BOOL bDone = FALSE;
if (nTimeOut > 0)
nTimeOut++; // Increment the timeout since 0 doesn't count for a second
// Initialise the menu
InitMenu();
// Update the menu
DrawMenu();
second = getsecond();
// Loop
do
{
// Check for a keypress
if (kbhit())
{
// Cancel the timeout
if (nTimeOut != -1)
{
nTimeOut = -1;
DrawMenu();
}
// Get the key
key = getch();
// Is it extended?
if (key == 0)
key = getch(); // Yes - so get the extended key
// Process the key
switch (key)
{
case KEY_UP:
if (nOSSelected)
{
nOSSelected--;
// Update the menu
DrawMenu();
}
break;
case KEY_DOWN:
if (nOSSelected < (nNumOS-1))
{
nOSSelected++;
// Update the menu
DrawMenu();
}
break;
case KEY_ENTER:
bDone = TRUE;
break;
case KEY_F8:
DoOptionsMenu();
DrawBackdrop();
DrawMenu();
break;
}
}
// Update the date & time
UpdateDateTime();
if (nTimeOut > 0)
{
if (getsecond() != second)
{
second = getsecond();
nTimeOut--;
// Update the menu
DrawMenu();
}
}
if (nTimeOut == 0)
bDone = TRUE;
}
while (!bDone);
return nOSSelected;
}
void InitMenu(void)
{
int i;
int height = 1; // Allow room for top & bottom borders
int width = 0;
for(i=0; i<nNumOS; i++)
{
height++;
if(strlen(OSList[i].name) > width)
width = strlen(OSList[i].name);
}
width += 18; // Allow room for left & right borders, plus 8 spaces on each side
// Calculate the OS list box area
nOSListBoxLeft = (nScreenWidth - width) / 2;
nOSListBoxRight = nOSListBoxLeft + width;
nOSListBoxTop = (nScreenHeight - height) / 2 + 1;
nOSListBoxBottom = nOSListBoxTop + height;
}
void DrawMenu(void)
{
int i, j;
char text[260];
char temp[260];
int space, space_left, space_right;
// Update the status bar
DrawStatusText(" Use \x18\x19 to select, ENTER to boot. Press F8 for advanced options.");
DrawBox(nOSListBoxLeft, nOSListBoxTop, nOSListBoxRight, nOSListBoxBottom, D_VERT, D_HORZ, TRUE, TRUE, ATTR(cMenuFgColor, cMenuBgColor));
for(i=0; i<nNumOS; i++)
{
space = (nOSListBoxRight - nOSListBoxLeft - 2) - strlen(OSList[i].name);
space_left = (space / 2) + 1;
space_right = (space - space_left) + 1;
text[0] = '\0';
for(j=0; j<space_left; j++)
strcat(text, " ");
strcat(text, OSList[i].name);
for(j=0; j<space_right; j++)
strcat(text, " ");
if(i == nOSSelected)
{
DrawText(nOSListBoxLeft+1, nOSListBoxTop+1+i, text, ATTR(cSelectedTextColor, cSelectedTextBgColor));
}
else
{
DrawText(nOSListBoxLeft+1, nOSListBoxTop+1+i, text, ATTR(cTextColor, cMenuBgColor));
}
}
if (nTimeOut >= 0)
{
strcpy(text, "[ Time Remaining: ");
itoa(nTimeOut, temp, 10);
strcat(text, temp);
strcat(text, " ]");
DrawText(nOSListBoxRight - strlen(text) - 1, nOSListBoxBottom, text, ATTR(cMenuFgColor, cMenuBgColor));
}
}

View File

@@ -1,6 +1,6 @@
/* $Id$
*
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,11 +17,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#ifndef __MENU_H
#define __MENU_H
VOID
XboxHwDetect(VOID)
{
}
int RunMenu(void);
void InitMenu(void);
void DrawMenu(void);
/* EOF */
#endif // #defined __MENU_H

229
freeldr/freeldr/miscboot.c Normal file
View File

@@ -0,0 +1,229 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "asmcode.h"
#include "miscboot.h"
#include "stdlib.h"
#include "fs.h"
#include "tui.h"
void LoadAndBootBootSector(int nOSToBoot)
{
FILE file;
char name[260];
char value[260];
char szFileName[1024];
int i;
// Find all the message box settings and run them
for (i=1; i<=GetNumSectionItems(OSList[nOSToBoot].name); i++)
{
ReadSectionSettingByNumber(OSList[nOSToBoot].name, i, name, value);
if (stricmp(name, "MessageBox") == 0)
MessageBox(value);
if (stricmp(name, "MessageLine") == 0)
MessageLine(value);
}
if (!ReadSectionSettingByName(OSList[nOSToBoot].name, "BootDrive", name, value))
{
MessageBox("Boot drive not specified for selected OS!");
return;
}
BootDrive = atoi(value);
BootPartition = 0;
if (ReadSectionSettingByName(OSList[nOSToBoot].name, "BootPartition", name, value))
BootPartition = atoi(value);
if (!ReadSectionSettingByName(OSList[nOSToBoot].name, "BootSector", name, value))
{
MessageBox("Boot sector file not specified for selected OS!");
return;
}
if (!OpenDiskDrive(BootDrive, BootPartition))
{
MessageBox("Failed to open boot drive.");
return;
}
strcpy(szFileName, value);
if (!OpenFile(szFileName, &file))
{
strcat(value, " not found.");
MessageBox(value);
return;
}
// Read boot sector
if (ReadFile(&file, 512, (void*)0x7c00) != 512)
{
MessageBox("Disk Read Error");
return;
}
// Check for validity
if (*((WORD*)(0x7c00 + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid boot sector magic (0xaa55)");
return;
}
RestoreScreen(pScreenBuffer);
showcursor();
gotoxy(nCursorXPos, nCursorYPos);
stop_floppy();
JumpToBootCode();
}
void LoadAndBootPartition(int nOSToBoot)
{
char name[260];
char value[260];
int head, sector, cylinder;
int offset;
int i;
// Find all the message box settings and run them
for (i=1; i<=GetNumSectionItems(OSList[nOSToBoot].name); i++)
{
ReadSectionSettingByNumber(OSList[nOSToBoot].name, i, name, value);
if (stricmp(name, "MessageBox") == 0)
MessageBox(value);
if (stricmp(name, "MessageLine") == 0)
MessageLine(value);
}
if (!ReadSectionSettingByName(OSList[nOSToBoot].name, "BootDrive", name, value))
{
MessageBox("Boot drive not specified for selected OS!");
return;
}
BootDrive = atoi(value);
if (!ReadSectionSettingByName(OSList[nOSToBoot].name, "BootPartition", name, value))
{
MessageBox("Boot partition not specified for selected OS!");
return;
}
BootPartition = atoi(value);
if (!biosdisk(_DISK_READ, BootDrive, 0, 0, 1, 1, SectorBuffer))
{
MessageBox("Disk Read Error");
return;
}
// Check for validity
if (*((WORD*)(SectorBuffer + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid partition table magic (0xaa55)");
return;
}
offset = 0x1BE + ((BootPartition-1) * 0x10);
// Check for valid partition
if (SectorBuffer[offset + 4] == 0)
{
MessageBox("Invalid boot partition");
return;
}
head = SectorBuffer[offset + 1];
sector = (SectorBuffer[offset + 2] & 0x3F);
cylinder = SectorBuffer[offset + 3];
if (SectorBuffer[offset + 2] & 0x80)
cylinder += 0x200;
if (SectorBuffer[offset + 2] & 0x40)
cylinder += 0x100;
// Read partition boot sector
if (!biosdisk(_DISK_READ, BootDrive, head, cylinder, sector, 1, (void*)0x7c00))
{
MessageBox("Disk Read Error");
return;
}
// Check for validity
if (*((WORD*)(0x7c00 + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid boot sector magic (0xaa55)");
return;
}
RestoreScreen(pScreenBuffer);
showcursor();
gotoxy(nCursorXPos, nCursorYPos);
stop_floppy();
JumpToBootCode();
}
void LoadAndBootDrive(int nOSToBoot)
{
char name[260];
char value[260];
int i;
// Find all the message box settings and run them
for (i=1; i<=GetNumSectionItems(OSList[nOSToBoot].name); i++)
{
ReadSectionSettingByNumber(OSList[nOSToBoot].name, i, name, value);
if (stricmp(name, "MessageBox") == 0)
MessageBox(value);
if (stricmp(name, "MessageLine") == 0)
MessageLine(value);
}
if (!ReadSectionSettingByName(OSList[nOSToBoot].name, "BootDrive", name, value))
{
MessageBox("Boot drive not specified for selected OS!");
return;
}
BootDrive = atoi(value);
if (!biosdisk(_DISK_READ, BootDrive, 0, 0, 1, 1, (void*)0x7c00))
{
MessageBox("Disk Read Error");
return;
}
// Check for validity
if (*((WORD*)(0x7c00 + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid boot sector magic (0xaa55)");
return;
}
RestoreScreen(pScreenBuffer);
showcursor();
gotoxy(nCursorXPos, nCursorYPos);
stop_floppy();
JumpToBootCode();
}

View File

@@ -1,6 +1,6 @@
/*
* FreeLoader
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,10 +20,10 @@
#ifndef __BOOT_H
#define __BOOT_H
#ifdef __i386__
VOID LoadAndBootBootSector(PCSTR OperatingSystemName);
VOID LoadAndBootPartition(PCSTR OperatingSystemName);
VOID LoadAndBootDrive(PCSTR OperatingSystemName);
#endif /* __i386__ */
void JumpToBootCode(void); // Implemented in boot.S
#endif // defined __BOOT_H
void LoadAndBootBootSector(int nOSToBoot);
void LoadAndBootPartition(int nOSToBoot);
void LoadAndBootDrive(int nOSToBoot);
#endif // defined __BOOT_H

395
freeldr/freeldr/options.c Normal file
View File

@@ -0,0 +1,395 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "stdlib.h"
#include "tui.h"
#include "options.h"
#include "miscboot.h"
void DoOptionsMenu(void)
{
int OptionsMenuItemCount = 1; // Count is 1 because we don't show the "Set ReactOS Boot Flags" menu item yet
char OptionsMenuItems[2][80] = { "Boot Wizard", "Set ReactOS Boot Flags" /* i.e. Safe Mode, Last Known Good Configuration */ };
int OptionsMenuItemSelected = 0;
while (OptionsMenuItemSelected != -1)
{
OptionsMenuItemSelected = RunOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, OptionsMenuItemSelected, "[Advanced Options]");
switch (OptionsMenuItemSelected)
{
case 0:
DoDiskOptionsMenu();
break;
}
}
}
void DoDiskOptionsMenu(void)
{
char DiskMenuItems[25][80];
int DiskMenuItemCount = 0;
int FloppyDiskMenuItemCount = 0;
int HardDiskMenuItemCount = 0;
int DiskMenuItemSelected = 0;
char temp[255];
int i;
FloppyDiskMenuItemCount = (int)*((char *)((0x40 * 16) + 0x10)); // Get number of floppy disks from bios data area 40:10
if (FloppyDiskMenuItemCount & 1)
FloppyDiskMenuItemCount = (FloppyDiskMenuItemCount >> 6) + 1;
else
FloppyDiskMenuItemCount = 0;
HardDiskMenuItemCount = (int)*((char *)((0x40 * 16) + 0x75)); // Get number of hard disks from bios data area 40:75
DiskMenuItemCount = FloppyDiskMenuItemCount + HardDiskMenuItemCount;
for (i=0; i<FloppyDiskMenuItemCount; i++)
{
strcpy(DiskMenuItems[i], "Floppy Disk ");
itoa(i + 1, temp, 10);
strcat(DiskMenuItems[i], temp);
}
for (i=0; i<HardDiskMenuItemCount; i++)
{
strcpy(DiskMenuItems[i + FloppyDiskMenuItemCount], "Hard Disk ");
itoa(i + 1, temp, 10);
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], temp);
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], " (");
itoa((get_heads(i+0x80) * get_cylinders(i+0x80) * get_sectors(i+0x80)) / 2048, temp, 10);
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], temp);
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], " MB)");
}
DiskMenuItemSelected = 0;
while (DiskMenuItemSelected != -1)
{
DiskMenuItemSelected = RunOptionsMenu(DiskMenuItems, DiskMenuItemCount, DiskMenuItemSelected, "[Boot Wizard]");
if (DiskMenuItemSelected != -1)
{
if (DiskMenuItemSelected < FloppyDiskMenuItemCount)
DoBootOptionsMenu(DiskMenuItemSelected, DiskMenuItems[DiskMenuItemSelected]);
else
DoBootOptionsMenu((DiskMenuItemSelected - FloppyDiskMenuItemCount) + 0x80, DiskMenuItems[DiskMenuItemSelected]);
}
}
}
void DoBootOptionsMenu(int BootDriveNum, char *BootDriveText)
{
int BootOptionsMenuItemCount = 2;
char BootOptionsMenuItems[2][80] = { "Boot To ", "Pick A Boot Partition" };
int BootOptionsMenuItemSelected = 0;
strcat(BootOptionsMenuItems[0], BootDriveText);
while (BootOptionsMenuItemSelected != -1)
{
BootOptionsMenuItemSelected = RunOptionsMenu(BootOptionsMenuItems, BootOptionsMenuItemCount, BootOptionsMenuItemSelected, "[Boot Options]");
switch (BootOptionsMenuItemSelected)
{
case 0:
BootDrive = BootDriveNum;
if (!biosdisk(_DISK_READ, BootDrive, 0, 0, 1, 1, (void*)0x7c00))
{
MessageBox("Disk Read Error");
return;
}
// Check for validity
if (*((WORD*)(0x7c00 + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid boot sector magic (0xaa55)");
return;
}
RestoreScreen(pScreenBuffer);
showcursor();
gotoxy(nCursorXPos, nCursorYPos);
stop_floppy();
JumpToBootCode();
break;
case 1:
if (BootDriveNum < 0x80)
{
MessageBox("This option is not available for a floppy disk.");
continue;
}
else
DoBootPartitionOptionsMenu(BootDriveNum);
break;
}
}
}
void DoBootPartitionOptionsMenu(int BootDriveNum)
{
struct
{
int partition_num;
int partition_type;
int head, sector, cylinder;
} BootPartitions[8];
int BootOptionsMenuItemCount = 0;
char BootOptionsMenuItems[8][80];
int BootOptionsMenuItemSelected = 0;
int head, sector, cylinder;
int offset;
int i;
char temp[25];
BootDrive = BootDriveNum;
if (!biosdisk(_DISK_READ, BootDrive, 0, 0, 1, 1, SectorBuffer))
{
MessageBox("Disk Read Error");
return;
}
// Check for validity
if (*((WORD*)(SectorBuffer + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid partition table magic (0xaa55)");
return;
}
offset = 0x1BE;
for (i=0; i<4; i++)
{
// Check for valid partition
if (SectorBuffer[offset + 4] != 0)
{
BootPartitions[BootOptionsMenuItemCount].partition_num = i;
BootPartitions[BootOptionsMenuItemCount].partition_type = SectorBuffer[offset + 4];
BootPartitions[BootOptionsMenuItemCount].head = SectorBuffer[offset + 1];
BootPartitions[BootOptionsMenuItemCount].sector = (SectorBuffer[offset + 2] & 0x3F);
BootPartitions[BootOptionsMenuItemCount].cylinder = SectorBuffer[offset + 3];
if (SectorBuffer[offset + 2] & 0x80)
BootPartitions[BootOptionsMenuItemCount].cylinder += 0x200;
if (SectorBuffer[offset + 2] & 0x40)
BootPartitions[BootOptionsMenuItemCount].cylinder += 0x100;
strcpy(BootOptionsMenuItems[BootOptionsMenuItemCount], "Boot To Partition ");
itoa(i+1, temp, 10);
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], temp);
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], " (Type: 0x");
itoa(BootPartitions[BootOptionsMenuItemCount].partition_type, temp, 16);
if (strlen(temp) < 2)
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], "0");
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], temp);
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], ")");
BootOptionsMenuItemCount++;
}
offset += 0x10;
}
while (BootOptionsMenuItemSelected != -1)
{
BootOptionsMenuItemSelected = RunOptionsMenu(BootOptionsMenuItems, BootOptionsMenuItemCount, BootOptionsMenuItemSelected, "[Boot Partition Options]");
if (BootOptionsMenuItemSelected != -1)
{
head = BootPartitions[BootOptionsMenuItemCount].head;
sector = BootPartitions[BootOptionsMenuItemCount].sector;
cylinder = BootPartitions[BootOptionsMenuItemCount].cylinder;
// Read partition boot sector
if (!biosdisk(_DISK_READ, BootDrive, head, cylinder, sector, 1, (void*)0x7c00))
{
MessageBox("Disk Read Error");
return;
}
// Check for validity
if (*((WORD*)(0x7c00 + 0x1fe)) != 0xaa55)
{
MessageBox("Invalid boot sector magic (0xaa55)");
return;
}
RestoreScreen(pScreenBuffer);
showcursor();
gotoxy(nCursorXPos, nCursorYPos);
stop_floppy();
JumpToBootCode();
}
}
}
int RunOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle)
{
int key;
int second;
BOOL bDone = FALSE;
int nOptionsMenuBoxLeft;
int nOptionsMenuBoxRight;
int nOptionsMenuBoxTop;
int nOptionsMenuBoxBottom;
// Initialise the menu
InitOptionsMenu(&nOptionsMenuBoxLeft, &nOptionsMenuBoxTop, &nOptionsMenuBoxRight, &nOptionsMenuBoxBottom, OptionsMenuItemCount);
DrawBackdrop();
// Update the menu
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
second = getsecond();
// Loop
do
{
// Check for a keypress
if (kbhit())
{
// Cancel the timeout
if (nTimeOut != -1)
{
nTimeOut = -1;
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
}
// Get the key
key = getch();
// Is it extended?
if (key == 0)
key = getch(); // Yes - so get the extended key
// Process the key
switch (key)
{
case KEY_UP:
if (nOptionSelected)
{
nOptionSelected--;
// Update the menu
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
}
break;
case KEY_DOWN:
if (nOptionSelected < (OptionsMenuItemCount - 1))
{
nOptionSelected++;
// Update the menu
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
}
break;
case KEY_ENTER:
//MessageBox("The Advanced Options are still being implemented.");
bDone = TRUE;
break;
case KEY_ESC:
nOptionSelected = -1;
bDone = TRUE;
break;
}
}
// Update the date & time
UpdateDateTime();
if (nTimeOut > 0)
{
if (getsecond() != second)
{
second = getsecond();
nTimeOut--;
// Update the menu
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
}
}
if (nTimeOut == 0)
bDone = TRUE;
}
while (!bDone);
return nOptionSelected;
}
void InitOptionsMenu(int *nOptionsMenuBoxLeft, int *nOptionsMenuBoxTop, int *nOptionsMenuBoxRight, int *nOptionsMenuBoxBottom, int OptionsMenuItemCount)
{
int height = OptionsMenuItemCount;
int width = 20;
height += 1; // Allow room for top & bottom borders
width += 18; // Allow room for left & right borders, plus 8 spaces on each side
// Calculate the OS list box area
*nOptionsMenuBoxLeft = (nScreenWidth - width) / 2;
*nOptionsMenuBoxRight = *nOptionsMenuBoxLeft + width;
*nOptionsMenuBoxTop = (nScreenHeight - height) / 2 + 1;
*nOptionsMenuBoxBottom = *nOptionsMenuBoxTop + height;
}
void DrawOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle, int nOptionsMenuBoxLeft, int nOptionsMenuBoxTop, int nOptionsMenuBoxRight, int nOptionsMenuBoxBottom)
{
int i, j;
char text[260];
int space, space_left, space_right;
// Update the status bar
DrawStatusText(" Use \x18\x19 to select, then press ENTER. Press ESC to go back.");
DrawBox(nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom, D_VERT, D_HORZ, TRUE, TRUE, ATTR(cMenuFgColor, cMenuBgColor));
DrawText(nOptionsMenuBoxLeft + (((nOptionsMenuBoxRight - nOptionsMenuBoxLeft) - strlen(OptionsMenuTitle)) / 2) + 1, nOptionsMenuBoxTop, OptionsMenuTitle, ATTR(cMenuFgColor, cMenuBgColor));
for(i=0; i<OptionsMenuItemCount; i++)
{
space = (nOptionsMenuBoxRight - nOptionsMenuBoxLeft - 2) - strlen(OptionsMenuItems[i]);
space_left = (space / 2) + 1;
space_right = (space - space_left) + 1;
text[0] = '\0';
for(j=0; j<space_left; j++)
strcat(text, " ");
strcat(text, OptionsMenuItems[i]);
for(j=0; j<space_right; j++)
strcat(text, " ");
if(i == nOptionSelected)
{
DrawText(nOptionsMenuBoxLeft+1, nOptionsMenuBoxTop+1+i, text, ATTR(cSelectedTextColor, cSelectedTextBgColor));
}
else
{
DrawText(nOptionsMenuBoxLeft+1, nOptionsMenuBoxTop+1+i, text, ATTR(cTextColor, cMenuBgColor));
}
}
}

View File

@@ -1,6 +1,6 @@
/*
* FreeLoader
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,17 +20,12 @@
#ifndef __OPTIONS_H
#define __OPTIONS_H
VOID DoOptionsMenu(VOID);
void DoOptionsMenu(void);
void DoDiskOptionsMenu(void);
void DoBootOptionsMenu(int BootDriveNum, char *BootDriveText);
void DoBootPartitionOptionsMenu(int BootDriveNum);
int RunOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle);
void InitOptionsMenu(int *nOptionsMenuBoxLeft, int *nOptionsMenuBoxTop, int *nOptionsMenuBoxRight, int *nOptionsMenuBoxBottom, int OptionsMenuItemCount);
void DrawOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle, int nOptionsMenuBoxLeft, int nOptionsMenuBoxTop, int nOptionsMenuBoxRight, int nOptionsMenuBoxBottom);
VOID OptionMenuReboot(VOID);
VOID OptionMenuCustomBoot(VOID);
#ifdef __i386__
VOID OptionMenuCustomBootDisk(VOID);
VOID OptionMenuCustomBootPartition(VOID);
VOID OptionMenuCustomBootBootSectorFile(VOID);
VOID OptionMenuCustomBootReactOS(VOID);
VOID OptionMenuCustomBootLinux(VOID);
#endif /* __i386__ */
#endif // #defined __OPTIONS_H
#endif // #defined __OPTIONS_H

593
freeldr/freeldr/pe.h Normal file
View File

@@ -0,0 +1,593 @@
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
#define IMAGE_SECTION_CHAR_CODE 0x00000020
#define IMAGE_SECTION_CHAR_DATA 0x00000040
#define IMAGE_SECTION_CHAR_BSS 0x00000080
#define IMAGE_SECTION_CHAR_NON_CACHABLE 0x04000000
#define IMAGE_SECTION_CHAR_NON_PAGEABLE 0x08000000
#define IMAGE_SECTION_CHAR_SHARED 0x10000000
#define IMAGE_SECTION_CHAR_EXECUTABLE 0x20000000
#define IMAGE_SECTION_CHAR_READABLE 0x40000000
#define IMAGE_SECTION_CHAR_WRITABLE 0x80000000
#define IMAGE_DOS_MAGIC 0x5a4d
#define IMAGE_PE_MAGIC 0x00004550
typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header
WORD e_magic; // Magic number
WORD e_cblp; // Bytes on last page of file
WORD e_cp; // Pages in file
WORD e_crlc; // Relocations
WORD e_cparhdr; // Size of header in paragraphs
WORD e_minalloc; // Minimum extra paragraphs needed
WORD e_maxalloc; // Maximum extra paragraphs needed
WORD e_ss; // Initial (relative) SS value
WORD e_sp; // Initial SP value
WORD e_csum; // Checksum
WORD e_ip; // Initial IP value
WORD e_cs; // Initial (relative) CS value
WORD e_lfarlc; // File address of relocation table
WORD e_ovno; // Overlay number
WORD e_res[4]; // Reserved words
WORD e_oemid; // OEM identifier (for e_oeminfo)
WORD e_oeminfo; // OEM information; e_oemid specific
WORD e_res2[10]; // Reserved words
LONG e_lfanew; // File address of new exe header
} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
typedef struct _IMAGE_FILE_HEADER {
WORD Machine;
WORD NumberOfSections;
DWORD TimeDateStamp;
DWORD PointerToSymbolTable;
DWORD NumberOfSymbols;
WORD SizeOfOptionalHeader;
WORD Characteristics;
} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
#define IMAGE_SIZEOF_FILE_HEADER 20
#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
#define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
#define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400 // If Image is on removable media, copy and run from the swap file.
#define IMAGE_FILE_NET_RUN_FROM_SWAP 0x0800 // If Image is on Net, copy and run from the swap file.
#define IMAGE_FILE_SYSTEM 0x1000 // System File.
#define IMAGE_FILE_DLL 0x2000 // File is a DLL.
#define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000 // File should only be run on a UP machine
#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
#define IMAGE_FILE_MACHINE_UNKNOWN 0
#define IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
#define IMAGE_FILE_MACHINE_R3000 0x162 // MIPS little-endian, 0x160 big-endian
#define IMAGE_FILE_MACHINE_R4000 0x166 // MIPS little-endian
#define IMAGE_FILE_MACHINE_R10000 0x168 // MIPS little-endian
#define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP
#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC Little-Endian
//
// Directory format.
//
typedef struct _IMAGE_DATA_DIRECTORY {
DWORD VirtualAddress;
DWORD Size;
} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
//
// Optional header format.
//
typedef struct _IMAGE_OPTIONAL_HEADER {
//
// Standard fields.
//
WORD Magic;
BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion;
DWORD SizeOfCode;
DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint;
DWORD BaseOfCode;
DWORD BaseOfData;
//
// NT additional fields.
//
DWORD ImageBase;
DWORD SectionAlignment;
DWORD FileAlignment;
WORD MajorOperatingSystemVersion;
WORD MinorOperatingSystemVersion;
WORD MajorImageVersion;
WORD MinorImageVersion;
WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion;
DWORD Win32VersionValue;
DWORD SizeOfImage;
DWORD SizeOfHeaders;
DWORD CheckSum;
WORD Subsystem;
WORD DllCharacteristics;
DWORD SizeOfStackReserve;
DWORD SizeOfStackCommit;
DWORD SizeOfHeapReserve;
DWORD SizeOfHeapCommit;
DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
#define IMAGE_SUBSYSTEM_UNKNOWN 0
#define IMAGE_SUBSYSTEM_NATIVE 1
#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
#define IMAGE_SUBSYSTEM_OS2_GUI 4
#define IMAGE_SUBSYSTEM_OS2_CUI 5
#define IMAGE_SUBSYSTEM_POSIX_GUI 6
#define IMAGE_SUBSYSTEM_POSIX_CUI 7
#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
typedef struct _IMAGE_NT_HEADERS {
DWORD Signature;
IMAGE_FILE_HEADER FileHeader;
IMAGE_OPTIONAL_HEADER OptionalHeader;
} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
// Directory Entries
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory
#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory
#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory
#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table
#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory
#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String
#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP)
#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory
#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory
#define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11 // Bound Import Directory in headers
#define IMAGE_DIRECTORY_ENTRY_IAT 12 // Import Address
//
// Section header format.
//
#define IMAGE_SIZEOF_SHORT_NAME 8
typedef struct _IMAGE_SECTION_HEADER {
BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
union {
DWORD PhysicalAddress;
DWORD VirtualSize;
} Misc;
DWORD VirtualAddress;
DWORD SizeOfRawData;
DWORD PointerToRawData;
DWORD PointerToRelocations;
DWORD PointerToLinenumbers;
WORD NumberOfRelocations;
WORD NumberOfLinenumbers;
DWORD Characteristics;
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
#define IMAGE_SIZEOF_SECTION_HEADER 40
#define IMAGE_SECTION_CODE (0x20)
#define IMAGE_SECTION_INITIALIZED_DATA (0x40)
#define IMAGE_SECTION_UNINITIALIZED_DATA (0x80)
//
// Export Format
//
typedef struct _IMAGE_EXPORT_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD Name;
DWORD Base;
DWORD NumberOfFunctions;
DWORD NumberOfNames;
PDWORD *AddressOfFunctions;
PDWORD *AddressOfNames;
PWORD *AddressOfNameOrdinals;
} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY;
//
// Import Format
//
typedef struct _IMAGE_IMPORT_BY_NAME {
WORD Hint;
BYTE Name[1];
} IMAGE_IMPORT_BY_NAME, *PIMAGE_IMPORT_BY_NAME;
#define IMAGE_ORDINAL_FLAG 0x80000000
#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
// Predefined resource types ... there may be some more, but I don't have
// the information yet. .....sang cho.....
#define RT_NEWRESOURCE 0x2000
#define RT_ERROR 0x7fff
#define NEWBITMAP (RT_BITMAP|RT_NEWRESOURCE)
#define NEWMENU (RT_MENU|RT_NEWRESOURCE)
#define NEWDIALOG (RT_DIALOG|RT_NEWRESOURCE)
//
// Resource Format.
//
//
// Resource directory consists of two counts, following by a variable length
// array of directory entries. The first count is the number of entries at
// beginning of the array that have actual names associated with each entry.
// The entries are in ascending order, case insensitive strings. The second
// count is the number of entries that immediately follow the named entries.
// This second count identifies the number of entries that have 16-bit integer
// Ids as their name. These entries are also sorted in ascending order.
//
// This structure allows fast lookup by either name or number, but for any
// given resource entry only one form of lookup is supported, not both.
// This is consistant with the syntax of the .RC file and the .RES file.
//
//
// Each directory contains the 32-bit Name of the entry and an offset,
// relative to the beginning of the resource directory of the data associated
// with this directory entry. If the name of the entry is an actual text
// string instead of an integer Id, then the high order bit of the name field
// is set to one and the low order 31-bits are an offset, relative to the
// beginning of the resource directory of the string, which is of type
// IMAGE_RESOURCE_DIRECTORY_STRING. Otherwise the high bit is clear and the
// low-order 16-bits are the integer Id that identify this resource directory
// entry. If the directory entry is yet another resource directory (i.e. a
// subdirectory), then the high order bit of the offset field will be
// set to indicate this. Otherwise the high bit is clear and the offset
// field points to a resource data entry.
//
typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
DWORD Name;
DWORD OffsetToData;
} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY;
typedef struct _IMAGE_RESOURCE_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
WORD NumberOfNamedEntries;
WORD NumberOfIdEntries;
IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[0];
} IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY;
#define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
#define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
//
// For resource directory entries that have actual string names, the Name
// field of the directory entry points to an object of the following type.
// All of these string objects are stored together after the last resource
// directory entry and before the first resource data object. This minimizes
// the impact of these variable length objects on the alignment of the fixed
// size directory entry objects.
//
typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
WORD Length;
CHAR NameString[ 1 ];
} IMAGE_RESOURCE_DIRECTORY_STRING, *PIMAGE_RESOURCE_DIRECTORY_STRING;
typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
WORD Length;
WCHAR NameString[ 1 ];
} IMAGE_RESOURCE_DIR_STRING_U, *PIMAGE_RESOURCE_DIR_STRING_U;
//
// Each resource data entry describes a leaf node in the resource directory
// tree. It contains an offset, relative to the beginning of the resource
// directory of the data for the resource, a size field that gives the number
// of bytes of data at that offset, a CodePage that should be used when
// decoding code point values within the resource data. Typically for new
// applications the code page would be the unicode code page.
//
typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
DWORD OffsetToData;
DWORD Size;
DWORD CodePage;
DWORD Reserved;
} IMAGE_RESOURCE_DATA_ENTRY, *PIMAGE_RESOURCE_DATA_ENTRY;
// Menu Resources ... added by .....sang cho....
// Menu resources are composed of a menu header followed by a sequential list
// of menu items. There are two types of menu items: pop-ups and normal menu
// itmes. The MENUITEM SEPARATOR is a special case of a normal menu item with
// an empty name, zero ID, and zero flags.
typedef struct _IMAGE_MENU_HEADER{
WORD wVersion; // Currently zero
WORD cbHeaderSize; // Also zero
} IMAGE_MENU_HEADER, *PIMAGE_MENU_HEADER;
typedef struct _IMAGE_POPUP_MENU_ITEM{
WORD fItemFlags;
WCHAR szItemText[1];
} IMAGE_POPUP_MENU_ITEM, *PIMAGE_POPUP_MENU_ITEM;
typedef struct _IMAGE_NORMAL_MENU_ITEM{
WORD fItemFlags;
WORD wMenuID;
WCHAR szItemText[1];
} IMAGE_NORMAL_MENU_ITEM, *PIMAGE_NORMAL_MENU_ITEM;
#define MI_GRAYED 0x0001 // GRAYED keyword
#define MI_INACTIVE 0x0002 // INACTIVE keyword
#define MI_BITMAP 0x0004 // BITMAP keyword
#define MI_OWNERDRAW 0x0100 // OWNERDRAW keyword
#define MI_CHECKED 0x0008 // CHECKED keyword
#define MI_POPUP 0x0010 // used internally
#define MI_MENUBARBREAK 0x0020 // MENUBARBREAK keyword
#define MI_MENUBREAK 0x0040 // MENUBREAK keyword
#define MI_ENDMENU 0x0080 // used internally
// Dialog Box Resources .................. added by sang cho.
// A dialog box is contained in a single resource and has a header and
// a portion repeated for each control in the dialog box.
// The item DWORD IStyle is a standard window style composed of flags found
// in WINDOWS.H.
// The default style for a dialog box is:
// WS_POPUP | WS_BORDER | WS_SYSMENU
//
// The itme marked "Name or Ordinal" are :
// If the first word is an 0xffff, the next two bytes contain an ordinal ID.
// Otherwise, the first one or more WORDS contain a double-null-terminated string.
// An empty string is represented by a single WORD zero in the first location.
//
// The WORD wPointSize and WCHAR szFontName entries are present if the FONT
// statement was included for the dialog box. This can be detected by checking
// the entry IStyle. If IStyle & DS_SETFONT ( which is 0x40), then these
// entries will be present.
typedef struct _IMAGE_DIALOG_BOX_HEADER1{
DWORD IStyle;
DWORD IExtendedStyle; // New for Windows NT
WORD nControls; // Number of Controls
WORD x;
WORD y;
WORD cx;
WORD cy;
// N_OR_O MenuName; // Name or Ordinal ID
// N_OR_O ClassName; // Name or Ordinal ID
// WCHAR szCaption[];
// WORD wPointSize; // Only here if FONT set for dialog
// WCHAR szFontName[]; // This too
} IMAGE_DIALOG_HEADER, *PIMAGE_DIALOG_HEADER;
typedef union _NAME_OR_ORDINAL{ // Name or Ordinal ID
struct _ORD_ID{
WORD flgId;
WORD Id;
} ORD_ID;
WCHAR szName[1];
} NAME_OR_ORDINAL, *PNAME_OR_ORDINAL;
// The data for each control starts on a DWORD boundary (which may require
// some padding from the previous control), and its format is as follows:
typedef struct _IMAGE_CONTROL_DATA{
DWORD IStyle;
DWORD IExtendedStyle;
WORD x;
WORD y;
WORD cx;
WORD cy;
WORD wId;
// N_OR_O ClassId;
// N_OR_O Text;
// WORD nExtraStuff;
} IMAGE_CONTROL_DATA, *PIMAGE_CONTROL_DATA;
#define BUTTON 0x80
#define EDIT 0x81
#define STATIC 0x82
#define LISTBOX 0x83
#define SCROLLBAR 0x84
#define COMBOBOX 0x85
// The various statements used in a dialog script are all mapped to these
// classes along with certain modifying styles. The values for these styles
// can be found in WINDOWS.H. All dialog controls have the default styles
// of WS_CHILD and WS_VISIBLE. A list of the default styles used follows:
//
// Statement Default Class Default Styles
// CONTROL None WS_CHILD|WS_VISIBLE
// LTEXT STATIC ES_LEFT
// RTEXT STATIC ES_RIGHT
// CTEXT STATIC ES_CENTER
// LISTBOX LISTBOX WS_BORDER|LBS_NOTIFY
// CHECKBOX BUTTON BS_CHECKBOX|WS_TABSTOP
// PUSHBUTTON BUTTON BS_PUSHBUTTON|WS_TABSTOP
// GROUPBOX BUTTON BS_GROUPBOX
// DEFPUSHBUTTON BUTTON BS_DFPUSHBUTTON|WS_TABSTOP
// RADIOBUTTON BUTTON BS_RADIOBUTTON
// AUTOCHECKBOX BUTTON BS_AUTOCHECKBOX
// AUTO3STATE BUTTON BS_AUTO3STATE
// AUTORADIOBUTTON BUTTON BS_AUTORADIOBUTTON
// PUSHBOX BUTTON BS_PUSHBOX
// STATE3 BUTTON BS_3STATE
// EDITTEXT EDIT ES_LEFT|WS_BORDER|WS_TABSTOP
// COMBOBOX COMBOBOX None
// ICON STATIC SS_ICON
// SCROLLBAR SCROLLBAR None
///
//
// Debug Format
//
typedef struct _IMAGE_DEBUG_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD Type;
DWORD SizeOfData;
DWORD AddressOfRawData;
DWORD PointerToRawData;
} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
#define IMAGE_DEBUG_TYPE_UNKNOWN 0
#define IMAGE_DEBUG_TYPE_COFF 1
#define IMAGE_DEBUG_TYPE_CODEVIEW 2
#define IMAGE_DEBUG_TYPE_FPO 3
#define IMAGE_DEBUG_TYPE_MISC 4
#define IMAGE_DEBUG_TYPE_EXCEPTION 5
#define IMAGE_DEBUG_TYPE_FIXUP 6
#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
typedef struct _IMAGE_DEBUG_MISC {
DWORD DataType; // type of misc data, see defines
DWORD Length; // total length of record, rounded to four
// byte multiple.
BOOL Unicode; // TRUE if data is unicode string
BYTE Reserved[ 3 ];
BYTE Data[ 1 ]; // Actual data
} IMAGE_DEBUG_MISC, *PIMAGE_DEBUG_MISC;
//
// Debugging information can be stripped from an image file and placed
// in a separate .DBG file, whose file name part is the same as the
// image file name part (e.g. symbols for CMD.EXE could be stripped
// and placed in CMD.DBG). This is indicated by the IMAGE_FILE_DEBUG_STRIPPED
// flag in the Characteristics field of the file header. The beginning of
// the .DBG file contains the following structure which captures certain
// information from the image file. This allows a debug to proceed even if
// the original image file is not accessable. This header is followed by
// zero of more IMAGE_SECTION_HEADER structures, followed by zero or more
// IMAGE_DEBUG_DIRECTORY structures. The latter structures and those in
// the image file contain file offsets relative to the beginning of the
// .DBG file.
//
// If symbols have been stripped from an image, the IMAGE_DEBUG_MISC structure
// is left in the image file, but not mapped. This allows a debugger to
// compute the name of the .DBG file, from the name of the image in the
// IMAGE_DEBUG_MISC structure.
//
typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
WORD Signature;
WORD Flags;
WORD Machine;
WORD Characteristics;
DWORD TimeDateStamp;
DWORD CheckSum;
DWORD ImageBase;
DWORD SizeOfImage;
DWORD NumberOfSections;
DWORD ExportedNamesSize;
DWORD DebugDirectorySize;
DWORD SectionAlignment;
DWORD Reserved[2];
} IMAGE_SEPARATE_DEBUG_HEADER, *PIMAGE_SEPARATE_DEBUG_HEADER;
#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
#define IMAGE_SEPARATE_DEBUG_FLAGS_MASK 0x8000
#define IMAGE_SEPARATE_DEBUG_MISMATCH 0x8000 // when DBG was updated, the
// old checksum didn't match.
//
// End Image Format
//
#define SIZE_OF_NT_SIGNATURE sizeof (DWORD)
#define MAXRESOURCENAME 13
/* global macros to define header offsets into file */
/* offset to PE file signature */
#define NTSIGNATURE(a) ((LPVOID)((BYTE *)a + \
((PIMAGE_DOS_HEADER)a)->e_lfanew))
/* DOS header identifies the NT PEFile signature dword
the PEFILE header exists just after that dword */
#define PEFHDROFFSET(a) ((LPVOID)((BYTE *)a + \
((PIMAGE_DOS_HEADER)a)->e_lfanew + \
SIZE_OF_NT_SIGNATURE))
/* PE optional header is immediately after PEFile header */
#define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a + \
((PIMAGE_DOS_HEADER)a)->e_lfanew + \
SIZE_OF_NT_SIGNATURE + \
sizeof (IMAGE_FILE_HEADER)))
/* section headers are immediately after PE optional header */
#define SECHDROFFSET(a) ((LPVOID)((BYTE *)a + \
((PIMAGE_DOS_HEADER)a)->e_lfanew + \
SIZE_OF_NT_SIGNATURE + \
sizeof (IMAGE_FILE_HEADER) + \
sizeof (IMAGE_OPTIONAL_HEADER)))
#define MakePtr( cast, ptr, addValue ) (cast)( (DWORD)(ptr) + (DWORD)(addValue))
typedef struct _IMAGE_IMPORT_MODULE_DIRECTORY
{
DWORD dwRVAFunctionNameList;
DWORD dwUseless1;
DWORD dwUseless2;
DWORD dwRVAModuleName;
DWORD dwRVAFunctionAddressList;
} IMAGE_IMPORT_MODULE_DIRECTORY, *PIMAGE_IMPORT_MODULE_DIRECTORY;
typedef struct _RELOCATION_DIRECTORY
{
DWORD VirtualAddress; /* adresse virtuelle du bloc ou se font les relocations */
DWORD SizeOfBlock; // taille de cette structure + des structures
// relocation_entry qui suivent (ces dernieres sont
// donc au nombre de (SizeOfBlock-8)/2
} RELOCATION_DIRECTORY, *PRELOCATION_DIRECTORY;
typedef struct _RELOCATION_ENTRY
{
WORD TypeOffset;
// (TypeOffset >> 12) est le type
// (TypeOffset&0xfff) est l'offset dans le bloc
} RELOCATION_ENTRY, *PRELOCATION_ENTRY;
#define TYPE_RELOC_ABSOLUTE 0
#define TYPE_RELOC_HIGH 1
#define TYPE_RELOC_LOW 2
#define TYPE_RELOC_HIGHLOW 3
#define TYPE_RELOC_HIGHADJ 4
#define TYPE_RELOC_MIPS_JMPADDR 5

374
freeldr/freeldr/ros.S Normal file
View File

@@ -0,0 +1,374 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
.text
.code16
#include "asmcode.h"
/*
* Needed for enabling the a20 address line
*/
empty_8042:
.word 0x00eb,0x00eb // jmp $+2, jmp $+2
inb $0x64,%al
testb $0x02,%al
jnz empty_8042
ret
/*
* Enable the A20 address line (to allow access to over 1mb)
*/
.code32
EXTERN(_enable_a20)
call switch_to_real
.code16
call empty_8042
movb $0xD1,%al // command write
outb %al,$0x64
call empty_8042
mov $0xDF,%al // A20 on
out %al,$0x60
call empty_8042
call switch_to_prot
.code32
ret
.code16
/*
* Reprogram the PIC because they overlap the Intel defined
* exceptions
*/
reprogram_pic:
movb $0x11,%al // initialization sequence
outb %al,$0x20 // send it to 8259A-1
.word 0x00eb,0x00eb // jmp $+2, jmp $+2
outb %al,$0xA0 // and to 8259A-2
.word 0x00eb,0x00eb
movb $0x40,%al // start of hardware int's (0x20)
outb %al,$0x21
.word 0x00eb,0x00eb
movb $0x48,%al // start of hardware int's 2 (0x28)
outb %al,$0xA1
.word 0x00eb,0x00eb
movb $0x04,%al // 8259-1 is master
outb %al,$0x21
.word 0x00eb,0x00eb
movb $0x02,%al // 8259-2 is slave
outb %al,$0xA1
.word 0x00eb,0x00eb
movb $0x01,%al // 8086 mode for both
outb %al,$0x21
.word 0x00eb,0x00eb
outb %al,$0xA1
.word 0x00eb,0x00eb
movb $0xFF,%al // mask off all interrupts for now
outb %al,$0x21
.word 0x00eb,0x00eb
outb %al,$0xA1
ret
/*
* In: EDI = address
* Out: FS = segment
* DI = base
*/
convert_to_seg:
pushl %eax
movl %edi,%eax
//shrl $16,%eax
//shll $12,%eax
//movw %ax,%fs
shrl $4,%eax
movw %ax,%fs
andl $0xf,%edi
//andl $0xFFFF,%edi
popl %eax
ret
/*
* Here we assume the kernel is loaded at 1mb
* This boots the kernel
*/
.code32
EXTERN(_boot_ros)
call switch_to_real
.code16
/* Save cursor position */
movw $3,%ax //! Reset video mode
int $0x10
movb $10,%bl
movb $12,%ah
int $0x10
movw $0x1112,%ax //! Use 8x8 font
xorb %bl,%bl
int $0x10
movw $0x1200,%ax //! Use alternate print screen
movb $0x20,%bl
int $0x10
movb $1,%ah //! Define cursor (scan lines 6 to 7)
movw $0x0607,%cx
int $0x10
movb $1,%ah
movw $0x600,%cx
int $0x10
MOVb $6,%AH //SCROLL ACTIVE PAGE UP
MOVb $0x32,%AL //CLEAR 25 LINES
MOVw $0,%CX //UPPER LEFT OF SCROLL
MOVw $0x314F,%dx //LOWER RIGHT OF SCROLL
MOVb $(1*0x10+1),%bh //USE NORMAL ATTRIBUTE ON BLANKED LINE
INT $0x10 //VIDEO-IO
movw $0,%dx
movb $0,%dh
movb $2,%ah
movb $0,%bh
int $0x10
movw $0,%dx
movb $0,%dh
movb $2,%ah
movb $0,%bh
int $0x10
cli
// The page tables are setup elsewhere
/*
// Map in the lowmem page table (and reuse it for the identity map)
movl _kernel_page_directory_base,%edi
call convert_to_seg
movl _lowmem_page_table_base,%eax
addl $0x07,%eax
movl %eax,%fs:(%edi)
movl %eax,%fs:0xd00(%edi)//(0xd0000000/(1024*1024))(%edi)
// Map the page tables from the page directory
movl _kernel_page_directory_base,%eax
addl $0x07,%eax
movl %eax,%fs:0xf00(%edi)//(0xf0000000/(1024*1024))(%edi)
// Map in the kernel page table
movl _system_page_table_base,%eax
addl $0x07,%eax
movl %eax,%fs:0xc00(%edi)//(0xc0000000/(1024*1024))(%edi)
// Setup the lowmem page table
movl _lowmem_page_table_base,%edi
call convert_to_seg
movl $0,%ebx
l9:
movl %ebx,%eax
shll $12,%eax // ebx = ebx * 4096
addl $07,%eax // user, rw, present
movl %eax,%fs:(%edi,%ebx,4)
incl %ebx
cmpl $1024,%ebx
jl l9
// Setup the system page table
movl _system_page_table_base,%edi
call convert_to_seg
movl $07,%eax
l8:
movl %eax,%edx
addl _start_kernel,%edx
movl %edx,%fs:(%edi)
addl $4,%edi
addl $0x1000,%eax
cmpl $0x100007,%eax
jl l8
*/
/*
* Load the page directory into cr3
*/
movl _kernel_page_directory_base,%eax
movl %eax,%cr3
/*
* Setup various variables
*/
movw %ds,%bx
movzwl %bx,%eax
shll $4,%eax
addl %eax,kernel_gdtbase
//call enable_a20 // enabled elsewhere
call reprogram_pic
/*
* Load stack
*/
movw %ds,%bx
movzwl %bx,%eax
shll $4,%eax
addl $real_stack_end,%eax
movl %eax,real_stack_base
movl real_stack_base,%esp
movl _boot_param_struct_base,%edx
/*
* load gdt
*/
lgdt kernel_gdtptr
/*
* Enter pmode and clear prefetch queue
*/
movl %cr0,%eax
orl $0x80010001,%eax
/*orl $0x80000001,%eax*/
movl %eax,%cr0
jmp next
next:
/*
* NOTE: This must be position independant (no references to
* non absolute variables)
*/
/*
* Initalize segment registers
*/
movw $KERNEL_DS,%ax
movw %ax,%ds
movw %ax,%ss
movw %ax,%es
movw %ax,%fs
movw %ax,%gs
/*
* Initalize eflags
*/
pushl $0
popfl
/*
* Jump to start of 32 bit code at 0xc0000000 + 0x1000
*/
pushl %edx
pushl $0
ljmpl $KERNEL_CS,$(KERNEL_BASE+0x1000)
.p2align 2 /* force 4-byte alignment */
kernel_gdt:
.word 0 // Zero descriptor
.word 0
.word 0
.word 0
//.word 0x0000 // User code descriptor
//.word 0x0000 // base: 0h limit: 3gb
//.word 0xfa00
//.word 0x00cc
//.word 0x0000 // User data descriptor
//.word 0x0000 // base: 0h limit: 3gb
//.word 0xf200
//.word 0x00cc
//.word 0x0000
//.word 0x0000
//.word 0x0000
//.word 0x0000
.word 0xffff // Kernel code descriptor
.word 0x0000 //
.word 0x9a00 // base 0h limit 4gb
.word 0x00cf
.word 0xffff // Kernel data descriptor
.word 0x0000 //
.word 0x9200 // base 0h limit 4gb
.word 0x00cf
/* TSS space */
//.rept NR_TASKS
//.word 0
//.word 0
//.word 0
//.word 0
//.endr
kernel_gdtptr:
.word (((6+NR_TASKS)*8)-1) /* Limit */
kernel_gdtbase:
.long kernel_gdt /* Base Address */
EXTERN(_boot_param_struct_base)
.long 0
EXTERN(_start_mem)
.long 0
EXTERN(_kernel_page_directory_base)
.long 0
EXTERN(_system_page_table_base)
.long 0
EXTERN(_lowmem_page_table_base)
.long 0
EXTERN(_start_kernel)
.long 0
EXTERN(_load_base)
.long 0
/* boot_param structure */
EXTERN(_boot_parameters)
.long 0 // Magic
.long 0 // Cursor X
.long 0 // Cursor Y
.long 0 // nr_files
.long 0 // start_mem
.long 0 // end_mem
.rept 64
.long 0 // List of module lengths (terminated by a 0)
.endr
.rept 256
.byte 0 // Kernel parameter string
.endr
/* Our initial stack */
real_stack:
.rept 1024
.byte 0
.endr
real_stack_end:
real_stack_base:
.long 0

390
freeldr/freeldr/rosboot.c Normal file
View File

@@ -0,0 +1,390 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "asmcode.h"
#include "rosboot.h"
#include "stdlib.h"
#include "fs.h"
#include "tui.h"
extern boot_param boot_parameters; // Boot parameter structure passed to the kernel
extern int boot_param_struct_base; // Physical address of the boot parameters structure
extern int start_mem; // Start of the continuous range of physical kernel memory
extern int kernel_page_directory_base; // Physical address of the kernel page directory
extern int system_page_table_base; // Physical address of the system page table
extern int lowmem_page_table_base; // Physical address of the low mem page table
extern int start_kernel; // Physical address of the start of kernel code
extern int load_base; // Physical address of the loaded kernel modules
static int next_load_base;
void LoadAndBootReactOS(int nOSToBoot)
{
FILE file;
char name[1024];
char value[1024];
char szFileName[1024];
int i;
int nNumDriverFiles=0;
int nNumFilesLoaded=0;
/*
* Enable a20 so we can load at 1mb and initialize the page tables
*/
//enable_a20(); // enabled in freeldr.c
ReactOSMemInit();
// Setup kernel parameters
boot_param_struct_base = (int)&boot_parameters;
boot_parameters.magic = 0xdeadbeef;
boot_parameters.cursorx = 0;
boot_parameters.cursory = 0;
boot_parameters.nr_files = 0;
boot_parameters.start_mem = start_mem;
boot_parameters.end_mem = load_base;
boot_parameters.kernel_parameters[0] = 0;
next_load_base = load_base;
/*
* Read the optional kernel parameters
*/
if(ReadSectionSettingByName(OSList[nOSToBoot].name, "Options", name, value))
{
strcpy(boot_parameters.kernel_parameters,value);
}
/*
* Find the kernel image name
*/
if(!ReadSectionSettingByName(OSList[nOSToBoot].name, "Kernel", name, value))
{
MessageBox("Kernel image file not specified for selected operating system.");
return;
}
/*
* Get the boot partition
*/
BootPartition = 0;
if (ReadSectionSettingByName(OSList[nOSToBoot].name, "BootPartition", name, value))
BootPartition = atoi(value);
/*
* Make sure the boot drive is set in the .ini file
*/
if(!ReadSectionSettingByName(OSList[nOSToBoot].name, "BootDrive", name, value))
{
MessageBox("Boot drive not specified for selected operating system.");
return;
}
DrawBackdrop();
DrawStatusText(" Loading...");
DrawProgressBar(0);
/*
* Set the boot drive and try to open it
*/
BootDrive = atoi(value);
if (!OpenDiskDrive(BootDrive, BootPartition))
{
MessageBox("Failed to open boot drive.");
return;
}
/*
* Parse the ini file and count the kernel and drivers
*/
for (i=1; i<=GetNumSectionItems(OSList[nOSToBoot].name); i++)
{
/*
* Read the setting and check if it's a driver
*/
ReadSectionSettingByNumber(OSList[nOSToBoot].name, i, name, value);
if ((stricmp(name, "Kernel") == 0) || (stricmp(name, "Driver") == 0))
nNumDriverFiles++;
}
/*
* Parse the ini file and load the kernel and
* load all the drivers specified
*/
for (i=1; i<=GetNumSectionItems(OSList[nOSToBoot].name); i++)
{
/*
* Read the setting and check if it's a driver
*/
ReadSectionSettingByNumber(OSList[nOSToBoot].name, i, name, value);
if ((stricmp(name, "Kernel") == 0) || (stricmp(name, "Driver") == 0))
{
/*
* Set the name and try to open the PE image
*/
strcpy(szFileName, value);
if (!OpenFile(szFileName, &file))
{
strcat(value, " not found.");
MessageBox(value);
return;
}
/*
* Update the status bar with the current file
*/
strcpy(name, " Reading ");
strcat(name, value);
while (strlen(name) < 80)
strcat(name, " ");
DrawStatusText(name);
/*
* Load the driver
*/
ReactOSLoadPEImage(&file);
nNumFilesLoaded++;
DrawProgressBar((nNumFilesLoaded * 100) / nNumDriverFiles);
// Increment the number of files we loaded
boot_parameters.nr_files++;
}
else if (stricmp(name, "MessageBox") == 0)
{
DrawStatusText(" Press ENTER to continue");
MessageBox(value);
}
else if (stricmp(name, "MessageLine") == 0)
MessageLine(value);
else if (stricmp(name, "ReOpenBootDrive") == 0)
{
if (!OpenDiskDrive(BootDrive, BootPartition))
{
MessageBox("Failed to open boot drive.");
return;
}
}
}
/*
* End the list of modules we load with a zero length entry
* and update the end of kernel mem
*/
boot_parameters.module_lengths[boot_parameters.nr_files] = 0;
boot_parameters.end_mem = next_load_base;
/*
* Clear the screen and redraw the backdrop and status bar
*/
DrawBackdrop();
DrawStatusText(" Press any key to boot");
/*
* Wait for user
*/
strcpy(name, "Kernel and Drivers loaded.\nPress any key to boot ");
strcat(name, OSList[nOSToBoot].name);
strcat(name, ".");
//MessageBox(name);
RestoreScreen(pScreenBuffer);
/*
* Now boot the kernel
*/
stop_floppy();
ReactOSBootKernel();
}
void ReactOSMemInit(void)
{
int base;
/* Calculate the start of extended memory */
base = 0x100000;
/* Set the start of the page directory */
kernel_page_directory_base = base;
/*
* Set the start of the continuous range of physical memory
* occupied by the kernel
*/
start_mem = base;
base += 0x1000;
/* Calculate the start of the system page table (0xc0000000 upwards) */
system_page_table_base = base;
base += 0x1000;
/* Calculate the start of the page table to map the first 4mb */
lowmem_page_table_base = base;
base += 0x1000;
/* Set the position for the first module to be loaded */
load_base = base;
/* Set the address of the start of kernel code */
start_kernel = base;
}
void ReactOSBootKernel(void)
{
int i;
int *pPageDirectory = (int *)kernel_page_directory_base;
int *pLowMemPageTable = (int *)lowmem_page_table_base;
int *pSystemPageTable = (int *)system_page_table_base;
/* Zero out the kernel page directory */
for(i=0; i<1024; i++)
pPageDirectory[i] = 0;
/* Map in the lowmem page table */
pPageDirectory[(0x00/4)] = lowmem_page_table_base + 0x07;
/* Map in the lowmem page table (and reuse it for the identity map) */
pPageDirectory[(0xd00/4)] = lowmem_page_table_base + 0x07;
/* Map the page tables from the page directory */
pPageDirectory[(0xf00/4)] = kernel_page_directory_base + 0x07;
/* Map in the kernel page table */
pPageDirectory[(0xc00/4)] = system_page_table_base + 0x07;
/* Setup the lowmem page table */
for(i=0; i<1024; i++)
pLowMemPageTable[i] = (i * 4096) + 0x07;
/* Setup the system page table */
for(i=0; i<1024; i++)
pSystemPageTable[i] = ((i * 4096) + start_kernel) + 0x07;
boot_ros();
}
BOOL ReactOSLoadPEImage(FILE *pImage)
{
unsigned int Idx, ImageBase;
PULONG PEMagic;
PIMAGE_DOS_HEADER PEDosHeader;
PIMAGE_FILE_HEADER PEFileHeader;
PIMAGE_OPTIONAL_HEADER PEOptionalHeader;
PIMAGE_SECTION_HEADER PESectionHeaders;
ImageBase = next_load_base;
boot_parameters.module_lengths[boot_parameters.nr_files] = 0;
/*
* Load the headers
*/
ReadFile(pImage, 0x1000, (void *)next_load_base);
/*
* Get header pointers
*/
PEDosHeader = (PIMAGE_DOS_HEADER) next_load_base;
PEMagic = (PULONG) ((unsigned int) next_load_base +
PEDosHeader->e_lfanew);
PEFileHeader = (PIMAGE_FILE_HEADER) ((unsigned int) next_load_base +
PEDosHeader->e_lfanew + sizeof(ULONG));
PEOptionalHeader = (PIMAGE_OPTIONAL_HEADER) ((unsigned int) next_load_base +
PEDosHeader->e_lfanew + sizeof(ULONG) + sizeof(IMAGE_FILE_HEADER));
PESectionHeaders = (PIMAGE_SECTION_HEADER) ((unsigned int) next_load_base +
PEDosHeader->e_lfanew + sizeof(ULONG) + sizeof(IMAGE_FILE_HEADER) +
sizeof(IMAGE_OPTIONAL_HEADER));
/*
* Check file magic numbers
*/
if(PEDosHeader->e_magic != IMAGE_DOS_MAGIC)
{
MessageBox("Incorrect MZ magic");
return FALSE;
}
if(PEDosHeader->e_lfanew == 0)
{
MessageBox("Invalid lfanew offset");
return 0;
}
if(*PEMagic != IMAGE_PE_MAGIC)
{
MessageBox("Incorrect PE magic");
return 0;
}
if(PEFileHeader->Machine != IMAGE_FILE_MACHINE_I386)
{
MessageBox("Incorrect Architecture");
return 0;
}
/*
* Get header size and bump next_load_base
*/
next_load_base += ROUND_UP(PEOptionalHeader->SizeOfHeaders, PEOptionalHeader->SectionAlignment);
boot_parameters.module_lengths[boot_parameters.nr_files] += ROUND_UP(PEOptionalHeader->SizeOfHeaders, PEOptionalHeader->SectionAlignment);
boot_parameters.end_mem += ROUND_UP(PEOptionalHeader->SizeOfHeaders, PEOptionalHeader->SectionAlignment);
/*
* Copy image sections into virtual section
*/
// memcpy(DriverBase, ModuleLoadBase, PESectionHeaders[0].PointerToRawData);
// CurrentBase = (PVOID) ((DWORD)DriverBase + PESectionHeaders[0].PointerToRawData);
// CurrentSize = 0;
for (Idx = 0; Idx < PEFileHeader->NumberOfSections; Idx++)
{
/*
* Copy current section into current offset of virtual section
*/
if (PESectionHeaders[Idx].Characteristics &
(IMAGE_SECTION_CHAR_CODE | IMAGE_SECTION_CHAR_DATA))
{
//memcpy(PESectionHeaders[Idx].VirtualAddress + DriverBase,
// (PVOID)(ModuleLoadBase + PESectionHeaders[Idx].PointerToRawData),
// PESectionHeaders[Idx].Misc.VirtualSize /*SizeOfRawData*/);
//MessageBox("loading a section");
fseek(pImage, PESectionHeaders[Idx].PointerToRawData);
ReadFile(pImage, PESectionHeaders[Idx].Misc.VirtualSize /*SizeOfRawData*/, (void *)next_load_base);
//printf("PointerToRawData: %x\n", PESectionHeaders[Idx].PointerToRawData);
//printf("bytes at next_load_base: %x\n", *((unsigned long *)next_load_base));
//getch();
}
else
{
//memset(PESectionHeaders[Idx].VirtualAddress + DriverBase,
// '\0', PESectionHeaders[Idx].Misc.VirtualSize /*SizeOfRawData*/);
//MessageBox("zeroing a section");
memset((void *)next_load_base, '\0', PESectionHeaders[Idx].Misc.VirtualSize /*SizeOfRawData*/);
}
PESectionHeaders[Idx].PointerToRawData = next_load_base - ImageBase;
next_load_base += ROUND_UP(PESectionHeaders[Idx].Misc.VirtualSize, PEOptionalHeader->SectionAlignment);
boot_parameters.module_lengths[boot_parameters.nr_files] += ROUND_UP(PESectionHeaders[Idx].Misc.VirtualSize, PEOptionalHeader->SectionAlignment);
boot_parameters.end_mem += ROUND_UP(PESectionHeaders[Idx].Misc.VirtualSize, PEOptionalHeader->SectionAlignment);
//DrawProgressBar((Idx * 100) / PEFileHeader->NumberOfSections);
}
return TRUE;
}

75
freeldr/freeldr/rosboot.h Normal file
View File

@@ -0,0 +1,75 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __ROSBOOT_H
#define __ROSBOOT_H
#include "freeldr.h"
#include "stdlib.h"
#include "pe.h"
#define PACKED __attribute__((packed))
void LoadAndBootReactOS(int nOSToBoot);
void ReactOSMemInit(void);
void ReactOSBootKernel(void);
BOOL ReactOSLoadPEImage(FILE *pImage);
void enable_a20(void);
void boot_ros(void);
// WARNING:
// This structure is prototyped here but allocated in ros.S
// if you change this prototype make sure to update ros.S
typedef struct
{
/*
* Magic value (useless really)
*/
unsigned int magic;
/*
* Cursor position
*/
unsigned int cursorx;
unsigned int cursory;
/*
* Number of files (including the kernel) loaded
*/
unsigned int nr_files;
/*
* Range of physical memory being used by the system
*/
unsigned int start_mem;
unsigned int end_mem;
/*
* List of module lengths (terminated by a 0)
*/
unsigned int module_lengths[64];
/*
* Kernel parameter string
*/
char kernel_parameters[256];
} boot_param PACKED;
#endif // defined __ROSBOOT_H

306
freeldr/freeldr/stdlib.c Normal file
View File

@@ -0,0 +1,306 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "stdlib.h"
/*
* print() - prints unformatted text to stdout
*/
void print(char *str)
{
int i;
for(i=0; i<strlen(str); i++)
putchar(str[i]);
}
/*
* convert_to_ascii() - converts a number to it's ascii equivalent
* from:
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
*/
char *convert_to_ascii(char *buf, int c, ...)
{
unsigned long num = *((&c) + 1), mult = 10;
char *ptr = buf;
if (c == 'x')
mult = 16;
if ((num & 0x80000000uL) && c == 'd')
{
num = (~num)+1;
*(ptr++) = '-';
buf++;
}
do
{
int dig = num % mult;
*(ptr++) = ( (dig > 9) ? dig + 'a' - 10 : '0' + dig );
}
while (num /= mult);
/* reorder to correct direction!! */
{
char *ptr1 = ptr-1;
char *ptr2 = buf;
while (ptr1 > ptr2)
{
int c = *ptr1;
*ptr1 = *ptr2;
*ptr2 = c;
ptr1--;
ptr2++;
}
}
return ptr;
}
/*
* printf() - prints formatted text to stdout
* from:
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
*/
void printf(char *format, ... )
{
int *dataptr = (int *) &format;
char c, *ptr, str[16];
dataptr++;
while ((c = *(format++)))
{
if (c != '%')
putchar(c);
else
switch (c = *(format++))
{
case 'd': case 'u': case 'x':
*convert_to_ascii(str, c, *((unsigned long *) dataptr++)) = 0;
ptr = str;
while (*ptr)
putchar(*(ptr++));
break;
case 'c': putchar((*(dataptr++))&0xff); break;
case 's':
ptr = (char *)(*(dataptr++));
while ((c = *(ptr++)))
putchar(c);
break;
}
}
}
int strlen(char *str)
{
int len;
for(len=0; str[len] != '\0'; len++);
return len;
}
char *itoa(int value, char *string, int radix)
{
if(radix == 16)
*convert_to_ascii(string, 'x', value) = 0;
else
*convert_to_ascii(string, 'd', value) = 0;
return string;
}
int toupper(int c)
{
if((c >= 'a') && (c <= 'z'))
c -= 32;
return c;
}
int tolower(int c)
{
if((c >= 'A') && (c <= 'Z'))
c += 32;
return c;
}
int memcmp(const void *buf1, const void *buf2, size_t count)
{
size_t i;
const char *buffer1 = buf1;
const char *buffer2 = buf2;
for(i=0; i<count; i++)
{
if(buffer1[i] == buffer2[i])
continue;
else
return (buffer1[i] - buffer2[i]);
}
return 0;
}
void *memcpy(void *dest, const void *src, size_t count)
{
size_t i;
char *buf1 = dest;
const char *buf2 = src;
for(i=0; i<count; i++)
buf1[i] = buf2[i];
return dest;
}
void *memset(void *dest, int c, size_t count)
{
size_t i;
char *buf1 = dest;
for(i=0; i<count; i++)
buf1[i] = c;
return dest;
}
char *strcpy(char *dest, char *src)
{
char *ret = dest;
while(*src)
*dest++ = *src++;
*dest = 0;
return ret;
}
char *strcat(char *dest, char *src)
{
char *ret = dest;
while(*dest)
dest++;
while(*src)
*dest++ = *src++;
*dest = 0;
return ret;
}
int strcmp(const char *string1, const char *string2)
{
while(*string1 == *string2)
{
if(*string1 == 0)
return 0;
string1++;
string2++;
}
return *(unsigned const char *)string1 - *(unsigned const char *)(string2);
}
int stricmp(const char *string1, const char *string2)
{
while(tolower(*string1) == tolower(*string2))
{
if(*string1 == 0)
return 0;
string1++;
string2++;
}
return (int)tolower(*string1) - (int)tolower(*string2);
}
char *fgets(char *string, int n, FILE *stream)
{
int i;
for(i=0; i<(n-1); i++)
{
if(feof(stream))
{
i++;
break;
}
ReadFile(stream, 1, string+i);
if(string[i] == '\n')
{
i++;
break;
}
}
string[i] = '\0';
return string;
}
int atoi(char *string)
{
int i, j;
int base;
int result = 0;
char *str;
if((string[0] == '0') && (string[1] == 'x'))
{
base = 16;
str = string + 2;
}
else
{
base = 10;
str = string;
}
for(i=strlen(str)-1,j=1; i>=0; i--)
{
if((str[i] < '0') || (str[i] > '9'))
break;
if(i == (strlen(str)-1))
result += (str[i] - '0');
else
{
result += (str[i] - '0') * (j * base);
j *= base;
}
}
return result;
}

74
freeldr/freeldr/stdlib.h Normal file
View File

@@ -0,0 +1,74 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __STDLIB_H
#define __STDLIB_H
#include "fs.h"
void putchar(int ch); // Implemented in asmcode.S
void clrscr(void); // Implemented in asmcode.S
int kbhit(void); // Implemented in asmcode.S
int getch(void); // Implemented in asmcode.S
void gotoxy(int x, int y); // Implemented in asmcode.S
int getyear(void); // Implemented in asmcode.S
int getday(void); // Implemented in asmcode.S
int getmonth(void); // Implemented in asmcode.S
int gethour(void); // Implemented in asmcode.S
int getminute(void); // Implemented in asmcode.S
int getsecond(void); // Implemented in asmcode.S
void hidecursor(void); // Implemented in asmcode.S
void showcursor(void); // Implemented in asmcode.S
int wherex(void); // Implemented in asmcode.S
int wherey(void); // Implemented in asmcode.S
int strlen(char *str);
char *strcpy(char *dest, char *src);
char *strcat(char *dest, char *src);
int strcmp(const char *string1, const char *string2);
int stricmp(const char *string1, const char *string2);
char *itoa(int value, char *string, int radix);
int toupper(int c);
int tolower(int c);
int memcmp(const void *buf1, const void *buf2, size_t count);
void *memcpy(void *dest, const void *src, size_t count);
void *memset(void *dest, int c, size_t count);
char *fgets(char *string, int n, FILE *stream);
int atoi(char *string);
void print(char *str);
void printf(char *fmt, ...);
int biosdisk(int cmd, int drive, int head, int track, int sector, int nsects, void *buffer); // Implemented in asmcode.S
void stop_floppy(void); // Implemented in asmcode.S
int get_heads(int drive); // Implemented in asmcode.S
int get_cylinders(int drive); // Implemented in asmcode.S
int get_sectors(int drive); // Implemented in asmcode.S
/* Values for biosdisk() */
#define _DISK_RESET 0 // Unimplemented
#define _DISK_STATUS 1 // Unimplemented
#define _DISK_READ 2 // Reads a sector into memory
#define _DISK_WRITE 3 // Unimplemented
#define _DISK_VERIFY 4 // Unimplemented
#define _DISK_FORMAT 5 // Unimplemented
#endif // defined __STDLIB_H

572
freeldr/freeldr/tui.c Normal file
View File

@@ -0,0 +1,572 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "stdlib.h"
#include "tui.h"
int nScreenWidth = 80; // Screen Width
int nScreenHeight = 25; // Screen Height
char cStatusBarFgColor = COLOR_BLACK; // Status bar foreground color
char cStatusBarBgColor = COLOR_CYAN; // Status bar background color
char cBackdropFgColor = COLOR_WHITE; // Backdrop foreground color
char cBackdropBgColor = COLOR_BLUE; // Backdrop background color
char cBackdropFillStyle = MEDIUM_FILL; // Backdrop fill style
char cTitleBoxFgColor = COLOR_WHITE; // Title box foreground color
char cTitleBoxBgColor = COLOR_RED; // Title box background color
char cMessageBoxFgColor = COLOR_WHITE; // Message box foreground color
char cMessageBoxBgColor = COLOR_BLUE; // Message box background color
char cMenuFgColor = COLOR_WHITE; // Menu foreground color
char cMenuBgColor = COLOR_BLUE; // Menu background color
char cTextColor = COLOR_YELLOW; // Normal text color
char cSelectedTextColor = COLOR_BLACK; // Selected text color
char cSelectedTextBgColor = COLOR_GRAY; // Selected text background color
char szTitleBoxTitleText[260] = "Boot Menu"; // Title box's title text
char szMessageBoxLineText[4000] = "";
void DrawBackdrop(void)
{
// Fill in the backdrop
FillArea(0, 0, nScreenWidth-1, nScreenHeight-1, cBackdropFillStyle, ATTR(cBackdropFgColor, cBackdropBgColor));
// Draw the title box
DrawBox(1, 1, nScreenWidth, 5, D_VERT, D_HORZ, TRUE, FALSE, ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
// Draw version
DrawText(3, 2, VERSION, ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
// Draw copyright
DrawText(3, 3, "by Brian Palmer", ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
DrawText(3, 4, "<brianp@sginet.com>", ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
// Draw help text
//DrawText(nScreenWidth-15, 4, /*"F1 for Help"*/"F8 for Options", ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
// Draw title
DrawText((nScreenWidth/2)-(strlen(szTitleBoxTitleText)/2), 3, szTitleBoxTitleText, ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
// Draw date
DrawText(nScreenWidth-9, 2, "01/02/03", ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
// Draw time
DrawText(nScreenWidth-9, 3, "10:12:34", ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
// Draw status bar
DrawStatusText("");
// Update the date & time
UpdateDateTime();
}
/*
* FillArea()
* This function assumes coordinates are zero-based
*/
void FillArea(int nLeft, int nTop, int nRight, int nBottom, char cFillChar, char cAttr /* Color Attributes */)
{
char *screen = (char *)SCREEN_MEM;
int i, j;
for(i=nTop; i<=nBottom; i++)
{
for(j=nLeft; j<=nRight; j++)
{
screen[((i*2)*nScreenWidth)+(j*2)] = cFillChar;
screen[((i*2)*nScreenWidth)+(j*2)+1] = cAttr;
}
}
}
/*
* DrawShadow()
* This function assumes coordinates are zero-based
*/
void DrawShadow(int nLeft, int nTop, int nRight, int nBottom)
{
char *screen = (char *)SCREEN_MEM;
int i;
// Shade the bottom of the area
if(nBottom < (nScreenHeight-1))
{
for(i=nLeft+2; i<=nRight; i++)
screen[(((nBottom+1)*2)*nScreenWidth)+(i*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
}
// Shade the right of the area
if(nRight < (nScreenWidth-1))
{
for(i=nTop+1; i<=nBottom; i++)
screen[((i*2)*nScreenWidth)+((nRight+1)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
}
if(nRight+1 < (nScreenWidth-1))
{
for(i=nTop+1; i<=nBottom; i++)
screen[((i*2)*nScreenWidth)+((nRight+2)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
}
// Shade the bottom right corner
if((nRight < (nScreenWidth-1)) && (nBottom < (nScreenHeight-1)))
screen[(((nBottom+1)*2)*nScreenWidth)+((nRight+1)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
if((nRight+1 < (nScreenWidth-1)) && (nBottom < (nScreenHeight-1)))
screen[(((nBottom+1)*2)*nScreenWidth)+((nRight+2)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
}
/*
* DrawBox()
* This function assumes coordinates are one-based
*/
void DrawBox(int nLeft, int nTop, int nRight, int nBottom, int nVertStyle, int nHorzStyle, int bFill, int bShadow, char cAttr)
{
char cULCorner, cURCorner, cLLCorner, cLRCorner;
char cHorz, cVert;
nLeft--;
nTop--;
nRight--;
nBottom--;
cHorz = nHorzStyle;
cVert = nVertStyle;
if(nHorzStyle == HORZ)
{
if(nVertStyle == VERT)
{
cULCorner = UL;
cURCorner = UR;
cLLCorner = LL;
cLRCorner = LR;
}
else // nVertStyle == D_VERT
{
cULCorner = VD_UL;
cURCorner = VD_UR;
cLLCorner = VD_LL;
cLRCorner = VD_LR;
}
}
else // nHorzStyle == D_HORZ
{
if(nVertStyle == VERT)
{
cULCorner = HD_UL;
cURCorner = HD_UR;
cLLCorner = HD_LL;
cLRCorner = HD_LR;
}
else // nVertStyle == D_VERT
{
cULCorner = D_UL;
cURCorner = D_UR;
cLLCorner = D_LL;
cLRCorner = D_LR;
}
}
// Fill in box background
if(bFill)
FillArea(nLeft, nTop, nRight, nBottom, ' ', cAttr);
// Fill in corners
FillArea(nLeft, nTop, nLeft, nTop, cULCorner, cAttr);
FillArea(nRight, nTop, nRight, nTop, cURCorner, cAttr);
FillArea(nLeft, nBottom, nLeft, nBottom, cLLCorner, cAttr);
FillArea(nRight, nBottom, nRight, nBottom, cLRCorner, cAttr);
// Fill in left line
FillArea(nLeft, nTop+1, nLeft, nBottom-1, cVert, cAttr);
// Fill in top line
FillArea(nLeft+1, nTop, nRight-1, nTop, cHorz, cAttr);
// Fill in right line
FillArea(nRight, nTop+1, nRight, nBottom-1, cVert, cAttr);
// Fill in bottom line
FillArea(nLeft+1, nBottom, nRight-1, nBottom, cHorz, cAttr);
if(bShadow)
DrawShadow(nLeft, nTop, nRight, nBottom);
}
/*
* DrawText()
* This function assumes coordinates are one-based
*/
void DrawText(int nX, int nY, char *text, char cAttr)
{
char *screen = (char *)SCREEN_MEM;
int i, j;
nX--;
nY--;
// Draw the text
for(i=nX, j=0; text[j]; i++,j++)
{
screen[((nY*2)*nScreenWidth)+(i*2)] = text[j];
screen[((nY*2)*nScreenWidth)+(i*2)+1] = cAttr;
}
}
void DrawStatusText(char *text)
{
int i;
DrawText(1, nScreenHeight, text, ATTR(cStatusBarFgColor, cStatusBarBgColor));
for(i=strlen(text)+1; i<=nScreenWidth; i++)
DrawText(i, nScreenHeight, " ", ATTR(cStatusBarFgColor, cStatusBarBgColor));
}
void UpdateDateTime(void)
{
char date[260];
char time[260];
char temp[20];
int hour, minute, second, bPM=FALSE;
switch(getmonth())
{
case 1:
strcpy(date, "January ");
break;
case 2:
strcpy(date, "February ");
break;
case 3:
strcpy(date, "March ");
break;
case 4:
strcpy(date, "April ");
break;
case 5:
strcpy(date, "May ");
break;
case 6:
strcpy(date, "June ");
break;
case 7:
strcpy(date, "July ");
break;
case 8:
strcpy(date, "August ");
break;
case 9:
strcpy(date, "September ");
break;
case 10:
strcpy(date, "October ");
break;
case 11:
strcpy(date, "November ");
break;
case 12:
strcpy(date, "December ");
break;
}
itoa(getday(), temp, 10);
if((getday() == 1) || (getday() == 21) || (getday() == 31))
strcat(temp, "st");
else if((getday() == 2) || (getday() == 22))
strcat(temp, "nd");
else if((getday() == 3) || (getday() == 23))
strcat(temp, "rd");
else
strcat(temp, "th");
strcat(date, temp);
strcat(date, " ");
itoa(getyear(), temp, 10);
strcat(date, temp);
// Draw the date
DrawText(nScreenWidth-strlen(date)-1, 2, date, ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
hour = gethour();
if(hour > 12)
{
hour -= 12;
bPM = TRUE;
}
if (hour == 0)
hour = 12;
minute = getminute();
second = getsecond();
itoa(hour, temp, 10);
strcpy(time, " ");
strcat(time, temp);
strcat(time, ":");
itoa(minute, temp, 10);
if(minute < 10)
strcat(time, "0");
strcat(time, temp);
strcat(time, ":");
itoa(second, temp, 10);
if(second < 10)
strcat(time, "0");
strcat(time, temp);
if(bPM)
strcat(time, " PM");
else
strcat(time, " AM");
// Draw the time
DrawText(nScreenWidth-strlen(time)-1, 3, time, ATTR(cTitleBoxFgColor, cTitleBoxBgColor));
}
void SaveScreen(char *buffer)
{
char *screen = (char *)SCREEN_MEM;
int i;
for(i=0; i < (nScreenWidth * nScreenHeight * 2); i++)
buffer[i] = screen[i];
}
void RestoreScreen(char *buffer)
{
char *screen = (char *)SCREEN_MEM;
int i;
for(i=0; i < (nScreenWidth * nScreenHeight * 2); i++)
screen[i] = buffer[i];
}
void MessageBox(char *text)
{
int width = 8;
int height = 1;
int curline = 0;
int i , j, k;
int x1, x2, y1, y2;
char savebuffer[8000];
char temp[260];
char key;
SaveScreen(savebuffer);
strcat(szMessageBoxLineText, text);
// Find the height
for(i=0; i<strlen(szMessageBoxLineText); i++)
{
if(szMessageBoxLineText[i] == '\n')
height++;
}
// Find the width
for(i=0,j=0,k=0; i<height; i++)
{
while((szMessageBoxLineText[j] != '\n') && (szMessageBoxLineText[j] != 0))
{
j++;
k++;
}
if(k > width)
width = k;
k = 0;
j++;
}
// Calculate box area
x1 = (nScreenWidth - (width+2))/2;
x2 = x1 + width + 3;
y1 = ((nScreenHeight - height - 2)/2) + 1;
y2 = y1 + height + 4;
// Draw the box
DrawBox(x1, y1, x2, y2, D_VERT, D_HORZ, TRUE, TRUE, ATTR(cMessageBoxFgColor, cMessageBoxBgColor));
// Draw the text
for(i=0,j=0; i<strlen(szMessageBoxLineText)+1; i++)
{
if((szMessageBoxLineText[i] == '\n') || (szMessageBoxLineText[i] == 0))
{
temp[j] = 0;
j = 0;
DrawText(x1+2, y1+1+curline, temp, ATTR(cMessageBoxFgColor, cMessageBoxBgColor));
curline++;
}
else
temp[j++] = szMessageBoxLineText[i];
}
// Draw OK button
strcpy(temp, " OK ");
DrawText(x1+((x2-x1)/2)-3, y2-2, temp, ATTR(COLOR_BLACK, COLOR_GRAY));
for(;;)
{
if(kbhit())
{
key = getch();
if(key == KEY_EXTENDED)
key = getch();
if(key == KEY_ENTER)
break;
else if(key == KEY_SPACE)
break;
}
UpdateDateTime();
}
RestoreScreen(savebuffer);
UpdateDateTime();
strcpy(szMessageBoxLineText, "");
}
void MessageLine(char *text)
{
strcat(szMessageBoxLineText, text);
strcat(szMessageBoxLineText, "\n");
}
BOOL IsValidColor(char *color)
{
if(stricmp(color, "Black") == 0)
return TRUE;
else if(stricmp(color, "Blue") == 0)
return TRUE;
else if(stricmp(color, "Green") == 0)
return TRUE;
else if(stricmp(color, "Cyan") == 0)
return TRUE;
else if(stricmp(color, "Red") == 0)
return TRUE;
else if(stricmp(color, "Magenta") == 0)
return TRUE;
else if(stricmp(color, "Brown") == 0)
return TRUE;
else if(stricmp(color, "Gray") == 0)
return TRUE;
else if(stricmp(color, "DarkGray") == 0)
return TRUE;
else if(stricmp(color, "LightBlue") == 0)
return TRUE;
else if(stricmp(color, "LightGreen") == 0)
return TRUE;
else if(stricmp(color, "LightCyan") == 0)
return TRUE;
else if(stricmp(color, "LightRed") == 0)
return TRUE;
else if(stricmp(color, "LightMagenta") == 0)
return TRUE;
else if(stricmp(color, "Yellow") == 0)
return TRUE;
else if(stricmp(color, "White") == 0)
return TRUE;
return FALSE;
}
char TextToColor(char *color)
{
if(stricmp(color, "Black") == 0)
return COLOR_BLACK;
else if(stricmp(color, "Blue") == 0)
return COLOR_BLUE;
else if(stricmp(color, "Green") == 0)
return COLOR_GREEN;
else if(stricmp(color, "Cyan") == 0)
return COLOR_CYAN;
else if(stricmp(color, "Red") == 0)
return COLOR_RED;
else if(stricmp(color, "Magenta") == 0)
return COLOR_MAGENTA;
else if(stricmp(color, "Brown") == 0)
return COLOR_BROWN;
else if(stricmp(color, "Gray") == 0)
return COLOR_GRAY;
else if(stricmp(color, "DarkGray") == 0)
return COLOR_DARKGRAY;
else if(stricmp(color, "LightBlue") == 0)
return COLOR_LIGHTBLUE;
else if(stricmp(color, "LightGreen") == 0)
return COLOR_LIGHTGREEN;
else if(stricmp(color, "LightCyan") == 0)
return COLOR_LIGHTCYAN;
else if(stricmp(color, "LightRed") == 0)
return COLOR_LIGHTRED;
else if(stricmp(color, "LightMagenta") == 0)
return COLOR_LIGHTMAGENTA;
else if(stricmp(color, "Yellow") == 0)
return COLOR_YELLOW;
else if(stricmp(color, "White") == 0)
return COLOR_WHITE;
return COLOR_BLACK;
}
BOOL IsValidFillStyle(char *fill)
{
if(stricmp(fill, "Light") == 0)
return TRUE;
else if(stricmp(fill, "Medium") == 0)
return TRUE;
else if(stricmp(fill, "Dark") == 0)
return TRUE;
return FALSE;
}
char TextToFillStyle(char *fill)
{
if(stricmp(fill, "Light") == 0)
return LIGHT_FILL;
else if(stricmp(fill, "Medium") == 0)
return MEDIUM_FILL;
else if(stricmp(fill, "Dark") == 0)
return DARK_FILL;
return LIGHT_FILL;
}
void DrawProgressBar(int nPos)
{
int left, top, right, bottom;
int width = 50; // Allow for 50 "bars"
int height = 2;
int i;
if(nPos > 100)
nPos = 100;
left = (nScreenWidth - width - 4) / 2;
right = left + width + 3;
top = (nScreenHeight - height - 2) / 2;
top += 4;
bottom = top + height + 1;
// Draw the box
DrawBox(left, top, right, bottom, VERT, HORZ, TRUE, TRUE, ATTR(cMenuFgColor, cMenuBgColor));
// Draw the "Loading..." text
DrawText(70/2, top+1, "Loading...", ATTR(cTextColor, cMenuBgColor));
// Draw the percent complete
for(i=0; i<(nPos/2); i++)
DrawText(left+2+i, top+2, "\xDB", ATTR(cTextColor, cMenuBgColor));
// Draw the rest
for(; i<50; i++)
DrawText(left+2+i, top+2, "\xB2", ATTR(cTextColor, cMenuBgColor));
UpdateDateTime();
}

162
freeldr/freeldr/tui.h Normal file
View File

@@ -0,0 +1,162 @@
/*
* FreeLoader
* Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __TUI_H
#define __TUI_H
#define SCREEN_MEM 0xB8000
extern int nScreenWidth; // Screen Width
extern int nScreenHeight; // Screen Height
extern char cStatusBarFgColor; // Status bar foreground color
extern char cStatusBarBgColor; // Status bar background color
extern char cBackdropFgColor; // Backdrop foreground color
extern char cBackdropBgColor; // Backdrop background color
extern char cBackdropFillStyle; // Backdrop fill style
extern char cTitleBoxFgColor; // Title box foreground color
extern char cTitleBoxBgColor; // Title box background color
extern char cMessageBoxFgColor; // Message box foreground color
extern char cMessageBoxBgColor; // Message box background color
extern char cMenuFgColor; // Menu foreground color
extern char cMenuBgColor; // Menu background color
extern char cTextColor; // Normal text color
extern char cSelectedTextColor; // Selected text color
extern char cSelectedTextBgColor; // Selected text background color
extern char szTitleBoxTitleText[260]; // Title box's title text
// Fills the entire screen with a backdrop
void DrawBackdrop(void);
// Fills the area specified with cFillChar and cAttr
void FillArea(int nLeft, int nTop, int nRight, int nBottom, char cFillChar, char cAttr /* Color Attributes */);
// Draws a shadow on the bottom and right sides of the area specified
void DrawShadow(int nLeft, int nTop, int nRight, int nBottom);
// Draws a box around the area specified
void DrawBox(int nLeft, int nTop, int nRight, int nBottom, int nVertStyle, int nHorzStyle, int bFill, int bShadow, char cAttr);
// Draws text at coordinates specified
void DrawText(int nX, int nY, char *text, char cAttr);
// Draws text at the very bottom line on the screen
void DrawStatusText(char *text);
// Updates the date and time
void UpdateDateTime(void);
// Saves the screen so that it can be restored later
void SaveScreen(char *buffer);
// Restores the screen from a previous save
void RestoreScreen(char *buffer);
// Displays a message box on the screen with an ok button
void MessageBox(char *text);
// Adds a line of text to the message box buffer
void MessageLine(char *text);
// Returns true if color is valid
BOOL IsValidColor(char *color);
// Converts the text color into it's equivalent color value
char TextToColor(char *color);
// Returns true if fill is valid
BOOL IsValidFillStyle(char *fill);
// Converts the text fill into it's equivalent fill value
char TextToFillStyle(char *fill);
// Draws the progress bar showing nPos percent filled
void DrawProgressBar(int nPos);
/*
* Combines the foreground and background colors into a single attribute byte
*/
#define ATTR(cFore, cBack) ((cBack << 4)|cFore)
/*
* Fill styles for DrawBackdrop()
*/
#define LIGHT_FILL 0xB0
#define MEDIUM_FILL 0xB1
#define DARK_FILL 0xB2
/*
* Screen colors
*/
#define COLOR_BLACK 0
#define COLOR_BLUE 1
#define COLOR_GREEN 2
#define COLOR_CYAN 3
#define COLOR_RED 4
#define COLOR_MAGENTA 5
#define COLOR_BROWN 6
#define COLOR_GRAY 7
#define COLOR_DARKGRAY 8
#define COLOR_LIGHTBLUE 9
#define COLOR_LIGHTGREEN 10
#define COLOR_LIGHTCYAN 11
#define COLOR_LIGHTRED 12
#define COLOR_LIGHTMAGENTA 13
#define COLOR_YELLOW 14
#define COLOR_WHITE 15
/* Add COLOR_BLINK to a background to cause blinking */
#define COLOR_BLINK 8
/*
* Defines for IBM box drawing characters
*/
#define HORZ (0xc4) /* Single horizontal line */
#define D_HORZ (0xcd) /* Double horizontal line.*/
#define VERT (0xb3) /* Single vertical line */
#define D_VERT (0xba) /* Double vertical line. */
/* Definitions for corners, depending on HORIZ and VERT */
#define UL (0xda)
#define UR (0xbf) /* HORZ and VERT */
#define LL (0xc0)
#define LR (0xd9)
#define D_UL (0xc9)
#define D_UR (0xbb) /* D_HORZ and D_VERT */
#define D_LL (0xc8)
#define D_LR (0xbc)
#define HD_UL (0xd5)
#define HD_UR (0xb8) /* D_HORZ and VERT */
#define HD_LL (0xd4)
#define HD_LR (0xbe)
#define VD_UL (0xd6)
#define VD_UR (0xb7) /* HORZ and D_VERT */
#define VD_LL (0xd3)
#define VD_LR (0xbd)
// Key codes
#define KEY_EXTENDED 0x00
#define KEY_ENTER 0x0D
#define KEY_SPACE 0x20
#define KEY_UP 0x48
#define KEY_DOWN 0x50
#define KEY_LEFT 0x4B
#define KEY_RIGHT 0x4D
#define KEY_ESC 0x1B
#define KEY_F1 0x3B
#define KEY_F2 0x3C
#define KEY_F3 0x3D
#define KEY_F4 0x3E
#define KEY_F5 0x3F
#define KEY_F6 0x40
#define KEY_F7 0x41
#define KEY_F8 0x42
#define KEY_F9 0x43
#define KEY_F10 0x44
#endif // #defined __TUI_H

5
freeldr/install.bat Normal file
View File

@@ -0,0 +1,5 @@
cd bootsect
call install.bat
cd..
copy freeldr.sys a:\
copy freeldr.ini a:\

18
freeldr/notes.txt Normal file
View File

@@ -0,0 +1,18 @@
FreeLoader notes
To build FreeLoader you will need DJGPP because Mingw32 doesn't support 16-bit code
FreeLoader does not currently work with extended partitions.
Linux booting support needs to be added.
ext2 filesystem support needs to be added.
Current memory layout:
0000:0000 - 0000:0FFF: Interrupt vector table & BIOS data
0000:1000 - 0000:6FFF: Real mode stack area
0000:7000 - xxxx:xxxx: FreeLoader program & data area
xxxx:xxxx - 6000:0000: Protected mode stack area & heap
6000:0000 - 6000:C000: Filesystem data buffer
6000:C000 - 7000:0000: FREELDR.INI loaded here
7000:0000 - 7000:FFFF: scratch area for any function's use (ie sector buffer for biosdisk()) - can be overwritten by any function
8000:0000 - 9000:FFFF: fat table entry buffer
A000:0000 - FFFF:FFFF: reserved

View File

@@ -1,341 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -1,68 +0,0 @@
ReactOS is available thanks to the work of:
Aleksey Bragin <aleksey@studiocerebral.com>
Alex Ionescu <ionucu@videotron.ca>
Andrew Greenwood <lists@silverblade.co.uk>
Andrew Munger <waxdragon@gmail.com>
Arindam Das
Art Yerkes <ayerkes@speakeasy.net>
Ariadne
Brandon Turner (turnerb7@msu.edu)
Brian Palmer <brianp@sginet.com>
Casper S. Hornstrup <chorns@users.sourceforge.net>
Christoph von Wittich (Christoph@ApiViewer.de)
David Welch <welch@cwcom.net>
Emanuele Aliberti <ea@iol.it>
Eric Kohl <ekohl@rz-online.de>
Eugene Ingerman <geneing@myrealbox.com>
Filip Navara <xnavara@volny.cz>
Frederik Leemans
Ge van Geldorp <ge@gse.nl>
Ged Murphy <gedmurphy@gmail.com>
Guido de Jong
Gunnar Andre' Dalsnes <hardon@online.no>
Hans Kremer
Hartmut Birr <hartmut.birr@gmx.de>
Hernan Ochoa
Herve Poussineau <hpoussin@reactos.com>
Iwan Fatahi <i_fatahi@hotmail.com>
James B. Tabor <jimtabor@adsl-64-217-116-74.dsl.hstntx.swbell.net>
Jason Eager
Jason Filby <jasonfilby@yahoo.com>
Jason Weiler
Jean Michault
Jim Noeth
Johannes Anderwald <johannes.anderwald@student.tugraz.at>
Jonathan Wilson <jonwil@tpgi.com.au>
Jurgen van Gael <jurgen.vangael@student.kuleuven.ac.be>
KJK::Hyperion <noog@libero.it>
Klemens R. Friedl <klemens_friedl@gmx.net>
Maarten Bosma <maarten.paul@bosma.de>
Magnus Olsen (magnus@greatlord.com)
Mark Tempel <mtempel@visi.com>
Mark Weaver <mark@npsl.co.uk>
Martin Fuchs <martin-fuchs@gmx.net>
Marty Dill <mdill@uvic.ca>
Matt Pyne
Mike Nordell ("tamlin")
Nathan Woods <npwoods@mess.org>
Pablo Borobia <pborobia@gmail.com>
Paolo Pantaleo <paolopan@freemail.it>
Phillip Susi <phreak@iag.net>
Rex Jolliff <rex@lvcablemodem.com>
Richard Campbell <betam4x@gmail.com>
Robert Bergkvist <fragdance@hotmail.com>
Robert Dickenson <robd@reactos.org>
Royce Mitchell III <royce3@ev1.net>
Saveliy Tretiakov <saveliyt@mail.ru>
Steven Edwards <steven_ed4153@yahoo.com>
Thomas Weidenmueller <w3seek@users.sourceforge.net>
Victor Kirhenshtein <sauros@iname.com>
Vizzini <vizzini@plasmic.com>
Graphic Design from
Mindflyer <mf@mufunyo.net>
Tango Desktop Project (http://tango-project.org)
Everaldo (http://everaldo.com)

View File

@@ -1,211 +0,0 @@
# Doxyfile 1.3.5
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = ReactOS
PROJECT_NUMBER =
OUTPUT_DIRECTORY = doxy-doc
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = .
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = NO
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = NO
WARN_IF_UNDOCUMENTED = NO
WARN_IF_DOC_ERROR = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = hal \
subsys \
services \
regtests \
iface
FILE_PATTERNS = *.c \
*.h
RECURSIVE = YES
EXCLUDE = subsys/win32k \
subsys/system/explorer
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = YES
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = YES
RTF_HYPERLINKS = YES
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = NO
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = include
INCLUDE_FILE_PATTERNS = *.h
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = YES

View File

@@ -1,80 +0,0 @@
1. Build environment
To build the system you need either mingw32 installed on Windows or a mingw32
cross compiler running on unix. You may obtain MinGW binaries that build
ReactOS from http://www.reactos.org/.
2. Building ReactOS
2.1 Building the binaries
To build ReactOS run 'make' (without the quotes) if you are building on Linux
or 'mingw32-make' if you are building on Windows (or ReactOS) from the top
directory. If you are using RosBE, follow on-screen instructions.
2.2 Building a bootable CD image
To build a bootable CD image run 'make bootcd' (without the quotes) if you are
building on Linux or 'mingw32-make bootcd' if you are building on Windows (or
ReactOS) from the top directory. This will create a CD image with a filename,
ReactOS.iso, in the top directory.
3. Installation
ReactOS can only be installed on a machine that has a FAT16 or FAT32 partition
as the active (bootable) partition. The partition on which ReactOS is to be
installed (which may or may not be the bootable partition) must also be
formatted as FAT16 or FAT32. ReactOS Setup can format the partitions if
needed.
ReactOS can be installed from the source distribution or from the bootable CD
distribution. The two ways to install ReactOS are explained below.
3.1 Installation from sources
If you don't have an existing ReactOS installation you want to upgrade, then
build a bootable CD as described above. Burn the CD image, boot from it, and
follow the instructions to install ReactOS.
If you have an existing ReactOS installation you want to upgrade, then to
install ReactOS after building it, type 'make install' or
'mingw32-make install'. This will create the directory 'reactos' in the top
directory. Copy the contents of this directory over the existing installation.
If you don't want to copy the files manually every time you run a
'make install' or 'mingw32-make install', then you can specify the directory
where the files are to be copied to during installation.
Set the ROS_INSTALL environment variable. If you are on Windows this could be
done by:
set ROS_INSTALL=c:\reactos
If you are on Linux this could be done by:
export ROS_INSTALL=/mnt/windows/reactos
Now run 'make install' or 'mingw32-make install' to install the files to the
new location.
3.2 Installation from bootable CD distribution
To install ReactOS from the bootable CD distribution, extract the archive
contents. Then burn the CD image, boot from it, and follow instructions.
5. Help
If you run into problems or have suggestions for making ReactOS better, please
visit the address below. Mailing lists are available for a variety of topics,
bugs should be submitted to bugzilla and general chat takes place in the forums,
or #reactos on freenode
http://www.reactos.org/
ReactOS Development Team

View File

@@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,562 +0,0 @@
# Well-known targets:
#
# all (default target)
# This target builds all of ReactOS.
#
# module
# These targets builds a single module. Replace module with the name of
# the module you want to build.
#
# bootcd
# This target builds an ISO (ReactOS.iso) from which ReactOS can be booted
# and installed.
#
# livecd
# This target builds an ISO (ReactOS-Live.iso) from which ReactOS can be
# booted, but not installed.
#
# install
# This target installs all of ReactOS to a location specified by the
# ROS_INSTALL environment variable.
#
# module_install
# These targets installs a single module to a location specified by the
# ROS_INSTALL environment variable. Replace module with the name of the
# module you want to install.
#
# clean
# This target cleans (deletes) all files that are generated when building
# ReactOS.
#
# module_clean
# These targets cleans (deletes) files that are generated when building a
# single module. Replace module with the name of the module you want to
# clean.
#
# depends
# This target does a complete dependency check of the ReactOS codebase.
# This can require several minutes to complete. If you only need to check
# dependencies for a single or few modules then you can use the
# module_depends targets instead. This target can also repair a damaged or
# missing makefile.auto if needed.
#
# module_depends
# These targets do a dependency check of individual modules. Replace module
# with the name of the module for which you want to check dependencies.
# This is faster than the depends target which does a complete dependency
# check of the ReactOS codebase.
#
#
# Accepted environment variables:
#
# ROS_PREFIX
# This variable specifies the prefix of the MinGW installation. On Windows
# a prefix is usually not needed, but on linux it is usually "mingw32". If
# not present and no executable named "gcc" can be found, then the prefix is
# assumed to be "mingw32". If your gcc is named i386-mingw32-gcc then set
# ROS_PREFIX to i386-mingw32. Don't include the dash (-) before gcc.
#
# ROS_INTERMEDIATE
# This variable controls where to put intermediate files. Intermediate
# files are generated files that are needed to generate the final
# output files. Examples of intermediate files include *.o, *.a, and
# *.coff. N.B. Don't put a path separator at the end. The variable
# defaults to .\obj-i386.
#
# ROS_OUTPUT
# This variable controls where to put output files. Output files are
# generated files that makes up the result of the build process.
# Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't
# put a path separator at the end. The variable defaults to .\output-i386.
#
# ROS_TEMPORARY
# This variable controls where to put temporary files. Temporary files
# are (usually small) generated files that are needed to generate the
# intermediate or final output files. Examples of temporary files include
# *.rci (preprocessed .rc files for wrc), *.tmp, and *.exp. N.B. Don't put
# a path separator at the end. The variable defaults to the current
# directory.
#
# ROS_INSTALL
# This variable controls where to install output files to when using
# 'make install'. N.B. Don't put a path separator at the end. The variable
# defaults to .\reactos.
#
# ROS_BUILDMAP
# This variable controls if map files are to be generated for executable
# output files. Map files have the extension .map. The value can be either
# full (to build map files with assembly code), yes (to build map files
# without source code) or no (to not build any map files). The variable
# defaults to no.
#
# ROS_BUILDNOSTRIP
# This variable controls if non-symbol-stripped versions are to be built
# of executable output files. Non-symbol-stripped executable output files
# have .nostrip added to the filename just before the extension. The value
# can be either yes (to build non-symbol-stripped versions of executable
# output files) or no (to not build non-symbol-stripped versions of
# executable output files). The variable defaults to no.
#
# ROS_LEAN_AND_MEAN
# This variable controls if all binaries should be stripped out of useless
# data added by GCC/LD as well as of RSYM symbol data. Output binary size
# will go from 80 to 40MB, memory usage from 58 to 38MB and the install CD
# from 18 to 13MB. The variable defaults to no.
#
# ROS_RBUILDFLAGS
# Pass parameters to rbuild.
# -v Be verbose.
# -c Clean as you go. Delete generated files as soon as they are not needed anymore.
# -dd Disable automatic dependencies.
# -dm{module} Check only automatic dependencies for this module.
# -mi Let make handle creation of install directories. Rbuild will not generate the directories.
# -ps Generate proxy makefiles in source tree instead of the output tree.
# -ud Disable compilation units.
# -r Input XML
#
# ROS_AUTOMAKE
# Alternate name of makefile.auto
#
# check for versions of make that don't have features we need...
# the function "eval" is only available in 3.80+, which happens to be the minimum
# version that has the features we use...
# THIS CHECK IS BORROWED FROM THE "GMSL" PROJECT, AND IS COVERED BY THE GPL LICENSE
# YOU CAN FIND OUT MORE ABOUT GMSL - A VERY COOL PROJECT - AT:
# http://gmsl.sourceforge.net/
__gmsl_have_eval :=
__gmsl_ignore := $(eval __gmsl_have_eval := T)
ifndef __gmsl_have_eval
$(error ReactOS's makefiles use GNU Make 3.80+ features, you have $(MAKE_VERSION), you MUST UPGRADE in order to build ReactOS - Sorry)
endif
# END of code borrowed from GMSL ( http://gmsl.sourceforge.net/ )
.PHONY: all
.PHONY: clean
.PHONY: world
.PHONY: universe
ifeq ($(ROS_AUTOMAKE),)
ROS_AUTOMAKE=makefile.auto
endif
all: $(ROS_AUTOMAKE)
.SUFFIXES:
ifeq ($(HOST),)
ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32)
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
export OSTYPE = msys
HOST=mingw32-linux
CFLAGS+=-fshort-wchar
CPPFLAGS+=-fshort-wchar
else
HOST=mingw32-windows
endif
else
HOST=mingw32-linux
CFLAGS+=-fshort-wchar
CPPFLAGS+=-fshort-wchar
endif
endif
# Default to half-verbose mode
ifeq ($(VERBOSE),no)
Q = @
HALFVERBOSEECHO = no
BUILDNO_QUIET = -q
else
ifeq ($(VERBOSE),full)
Q =
HALFVERBOSEECHO = no
BUILDNO_QUIET =
else
Q = @
HALFVERBOSEECHO = yes
BUILDNO_QUIET = -q
endif
endif
ifeq ($(HOST),mingw32-linux)
QUOTE = "
else
QUOTE =
endif
ifeq ($(HALFVERBOSEECHO),yes)
ECHO_CP =@echo $(QUOTE)[COPY] $@$(QUOTE)
ECHO_MKDIR =@echo $(QUOTE)[MKDIR] $@$(QUOTE)
ECHO_BUILDNO =@echo $(QUOTE)[BUILDNO] $@$(QUOTE)
ECHO_INVOKE =@echo $(QUOTE)[INVOKE] $<$(QUOTE)
ECHO_PCH =@echo $(QUOTE)[PCH] $@$(QUOTE)
ECHO_CC =@echo $(QUOTE)[CC] $<$(QUOTE)
ECHO_GAS =@echo $(QUOTE)[GAS] $<$(QUOTE)
ECHO_NASM =@echo $(QUOTE)[NASM] $<$(QUOTE)
ECHO_AR =@echo $(QUOTE)[AR] $@$(QUOTE)
ECHO_WINEBLD =@echo $(QUOTE)[WINEBLD] $@$(QUOTE)
ECHO_WRC =@echo $(QUOTE)[WRC] $@$(QUOTE)
ECHO_WIDL =@echo $(QUOTE)[WIDL] $@$(QUOTE)
ECHO_BIN2RES =@echo $(QUOTE)[BIN2RES] $<$(QUOTE)
ECHO_DLLTOOL =@echo $(QUOTE)[DLLTOOL] $@$(QUOTE)
ECHO_LD =@echo $(QUOTE)[LD] $@$(QUOTE)
ECHO_NM =@echo $(QUOTE)[NM] $@$(QUOTE)
ECHO_OBJDUMP =@echo $(QUOTE)[OBJDUMP] $@$(QUOTE)
ECHO_RBUILD =@echo $(QUOTE)[RBUILD] $@$(QUOTE)
ECHO_RSYM =@echo $(QUOTE)[RSYM] $@$(QUOTE)
ECHO_WMC =@echo $(QUOTE)[WMC] $@$(QUOTE)
ECHO_NCI =@echo $(QUOTE)[NCI] $@$(QUOTE)
ECHO_CABMAN =@echo $(QUOTE)[CABMAN] $<$(QUOTE)
ECHO_CDMAKE =@echo $(QUOTE)[CDMAKE] $@$(QUOTE)
ECHO_MKHIVE =@echo $(QUOTE)[MKHIVE] $@$(QUOTE)
ECHO_REGTESTS=@echo $(QUOTE)[REGTESTS] $@$(QUOTE)
ECHO_TEST =@echo $(QUOTE)[TEST] $@$(QUOTE)
ECHO_GENDIB =@echo $(QUOTE)[GENDIB] $@$(QUOTE)
ECHO_STRIP =@echo $(QUOTE)[STRIP] $@$(QUOTE)
else
ECHO_CP =
ECHO_MKDIR =
ECHO_BUILDNO =
ECHO_INVOKE =
ECHO_PCH =
ECHO_CC =
ECHO_GAS =
ECHO_NASM =
ECHO_AR =
ECHO_WINEBLD =
ECHO_WRC =
ECHO_WIDL =
ECHO_BIN2RES =
ECHO_DLLTOOL =
ECHO_LD =
ECHO_NM =
ECHO_OBJDUMP =
ECHO_RBUILD =
ECHO_RSYM =
ECHO_WMC =
ECHO_NCI =
ECHO_CABMAN =
ECHO_CDMAKE =
ECHO_MKHIVE =
ECHO_REGTESTS=
ECHO_TEST =
ECHO_GENDIB =
ECHO_STRIP =
endif
host_gcc = $(Q)gcc
host_gpp = $(Q)g++
host_ld = $(Q)ld
host_ar = $(Q)ar
host_objcopy = $(Q)objcopy
ifeq ($(HOST),mingw32-linux)
export EXEPREFIX = ./
ifeq ($(OSTYPE),msys)
export EXEPOSTFIX = .exe
else
export EXEPOSTFIX =
endif
export SEP = /
mkdir = -$(Q)mkdir -p
gcc = $(Q)$(PREFIX)-gcc
gpp = $(Q)$(PREFIX)-g++
ld = $(Q)$(PREFIX)-ld
nm = $(Q)$(PREFIX)-nm
objdump = $(Q)$(PREFIX)-objdump
ar = $(Q)$(PREFIX)-ar
objcopy = $(Q)$(PREFIX)-objcopy
dlltool = $(Q)$(PREFIX)-dlltool
strip = $(Q)$(PREFIX)-strip
windres = $(Q)$(PREFIX)-windres
rm = $(Q)rm -f
cp = $(Q)cp
NUL = /dev/null
else # mingw32-windows
ifeq ($(OSTYPE),msys)
HOST=mingw32-linux
export EXEPREFIX = ./
export EXEPOSTFIX = .exe
export SEP = /
mkdir = -$(Q)mkdir -p
rm = $(Q)rm -f
cp = $(Q)cp
NUL = /dev/null
else
export EXEPREFIX =
export EXEPOSTFIX = .exe
ROS_EMPTY =
export SEP = \$(ROS_EMPTY)
mkdir = -$(Q)mkdir
rm = $(Q)del /f /q
cp = $(Q)copy /y
NUL = NUL
endif
ifeq ($(ROS_PREFIX),)
gcc = $(Q)gcc
gpp = $(Q)g++
ld = $(Q)ld
nm = $(Q)nm
objdump = $(Q)objdump
ar = $(Q)ar
objcopy = $(Q)objcopy
dlltool = $(Q)dlltool
strip = $(Q)strip
windres = $(Q)windres
else
gcc = $(ROS_PREFIX)-gcc
gpp = $(Q)$(ROS_PREFIX)-g++
ld = $(Q)$(ROS_PREFIX)-ld
nm = $(Q)$(ROS_PREFIX)-nm
objdump = $(Q)$(ROS_PREFIX)-objdump
ar = $(Q)$(ROS_PREFIX)-ar
objcopy = $(Q)$(ROS_PREFIX)-objcopy
dlltool = $(Q)$(ROS_PREFIX)-dlltool
strip = $(Q)$(ROS_PREFIX)-strip
windres = $(Q)$(ROS_PREFIX)-windres
endif
endif
ifneq ($(ROS_INTERMEDIATE),)
INTERMEDIATE := $(ROS_INTERMEDIATE)
else
INTERMEDIATE := obj-i386
endif
INTERMEDIATE_ := $(INTERMEDIATE)$(SEP)
ifneq ($(ROS_OUTPUT),)
OUTPUT := $(ROS_OUTPUT)
else
OUTPUT := output-i386
endif
OUTPUT_ := $(OUTPUT)$(SEP)
ifneq ($(ROS_TEMPORARY),)
TEMPORARY := $(ROS_TEMPORARY)
else
TEMPORARY :=
endif
TEMPORARY_ := $(TEMPORARY)$(SEP)
ifneq ($(ROS_INSTALL),)
INSTALL := $(ROS_INSTALL)
else
INSTALL := reactos
endif
INSTALL_ := $(INSTALL)$(SEP)
$(INTERMEDIATE):
${mkdir} $@
ifneq ($(INTERMEDIATE),$(OUTPUT))
$(OUTPUT):
${mkdir} $@
endif
NTOSKRNL_MC = ntoskrnl$(SEP)ntoskrnl.mc
KERNEL32_MC = dll$(SEP)win32$(SEP)kernel32$(SEP)kernel32.mc
BUILDNO_H = include$(SEP)reactos$(SEP)buildno.h
BUGCODES_H = include$(SEP)reactos$(SEP)bugcodes.h
BUGCODES_RC = ntoskrnl$(SEP)bugcodes.rc
ERRCODES_H = include$(SEP)reactos$(SEP)errcodes.h
ERRCODES_RC = dll$(SEP)win32$(SEP)kernel32$(SEP)errcodes.rc
include lib/lib.mak
include tools/tools.mak
include boot/freeldr/bootsect/bootsect.mak
-include $(ROS_AUTOMAKE)
PREAUTO := \
$(BIN2C_TARGET) \
$(BIN2RES_TARGET) \
$(BUILDNO_H) \
$(BUGCODES_H) \
$(BUGCODES_RC) \
$(ERRCODES_H) \
$(ERRCODES_RC) \
$(NCI_SERVICE_FILES) \
$(GENDIB_DIB_FILES)
$(ROS_AUTOMAKE): $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) mingw
world: all bootcd livecd
universe:
$(MAKE) KDBG=1 DBG=1 \
ROS_AUTOMAKE=makefile-$(ARCH)-kd.auto \
ROS_INSTALL=reactos-$(ARCH)-kd \
ROS_INTERMEDIATE=obj-$(ARCH)-kd \
ROS_OUTPUT=output-$(ARCH)-kd \
world
$(MAKE) KDBG=0 DBG=1 \
ROS_AUTOMAKE=makefile-$(ARCH)-d.auto \
ROS_INSTALL=reactos-$(ARCH)-d \
ROS_INTERMEDIATE=obj-$(ARCH)-d \
ROS_OUTPUT=output-$(ARCH)-d \
world
$(MAKE) KDBG=0 DBG=0 \
ROS_AUTOMAKE=makefile-$(ARCH)-r.auto \
ROS_INSTALL=reactos-$(ARCH)-r \
ROS_INTERMEDIATE=obj-$(ARCH)-r \
ROS_OUTPUT=output-$(ARCH)-r \
world
sysregtest:
-mkdir $(OUTPUT_)cd$(SEP)reactos
$(cp) boot$(SEP)bootdata$(SEP)unattend.inf.sample boot$(SEP)bootdata$(SEP)unattend.inf
$(cp) boot$(SEP)bootdata$(SEP)unattend.inf.sample $(OUTPUT_)cd$(SEP)reactos$(SEP)unattend.inf
$(cp) boot$(SEP)bootdata$(SEP)bootcdregtest$(SEP)testboot.bat.sample boot$(SEP)bootdata$(SEP)bootcdregtest$(SEP)testboot.bat
$(MAKE) dbgprint
$(MAKE) bootcdregtest
$(MAKE) sysreg
$(OUTPUT_)tools$(SEP)sysreg$(SEP)sysreg$(EXEPOSTFIX) tools$(SEP)sysreg$(SEP)txtmode.cfg rosboot
$(OUTPUT_)tools$(SEP)sysreg$(SEP)sysreg$(EXEPOSTFIX) tools$(SEP)sysreg$(SEP)secstage.cfg rosboot
$(OUTPUT_)tools$(SEP)sysreg$(SEP)sysreg$(EXEPOSTFIX) tools$(SEP)sysreg$(SEP)runonce.cfg rosboot
sysregtest_clean:
$(rm) boot$(SEP)bootdata$(SEP)unattend.inf
$(rm) boot$(SEP)bootdata$(SEP)bootcdregtest$(SEP)testboot.bat
$(rm) $(OUTPUT_)cd$(SEP)reactos$(SEP)unattend.inf
regtest:
$(cp) boot$(SEP)bootdata$(SEP)unattend.inf.sample $(OUTPUT_)cd$(SEP)reactos$(SEP)unattend.inf
$(MAKE) bootcdregtest
$(rm) $(OUTPUT_)cd$(SEP)reactos$(SEP)unattend.inf
.PHONY: cb
cb: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) cb
.PHONY: depmap
depmap: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) depmap
.PHONY: msvc
msvc: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) msvc
$(BUGCODES_H) $(BUGCODES_RC): $(WMC_TARGET) $(NTOSKRNL_MC)
$(ECHO_WMC)
$(Q)$(WMC_TARGET) -i -H $(BUGCODES_H) -o $(BUGCODES_RC) $(NTOSKRNL_MC)
$(ERRCODES_H) $(ERRCODES_RC): $(WMC_TARGET) $(KERNEL32_MC)
$(ECHO_WMC)
$(Q)$(WMC_TARGET) -i -U -H $(ERRCODES_H) -o $(ERRCODES_RC) $(KERNEL32_MC)
.PHONY: msvc6
msvc6: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs6.00 -voversionconfiguration msvc
.PHONY: msvc7
msvc7: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -voversionconfiguration msvc
.PHONY: msvc71
msvc71: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -voversionconfiguration msvc
.PHONY: msvc8
msvc8: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -voversionconfiguration msvc
.PHONY: msvc6_clean
msvc6_clean: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc
.PHONY: msvc7_clean
msvc7_clean: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc
.PHONY: msvc71_clean
msvc71_clean: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc
.PHONY: msvc8_clean
msvc8_clean: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs8.00 -voversionconfiguration msvc
.PHONY: msvc_clean
msvc_clean: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c msvc
.PHONY: msvc_clean_all
msvc_clean_all: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs8.10 -voversionconfiguration msvc
.PHONY: msvc7_install_debug
msvc7_install_debug: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcdebug -voversionconfiguration msvc
.PHONY: msvc7_install_release
msvc7_install_release: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcrelease -voversionconfiguration msvc
.PHONY: msvc7_install_speed
msvc7_install_speed: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcspeed -voversionconfiguration msvc
.PHONY: msvc71_install_debug
msvc71_install_debug: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcdebug -voversionconfiguration msvc
.PHONY: msvc71_install_release
msvc71_install_release: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcrelease -voversionconfiguration msvc
.PHONY: msvc71_install_speed
msvc71_install_speed: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcspeed -voversionconfiguration msvc
.PHONY: msvc8_install_debug
msvc8_install_debug: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcdebug -voversionconfiguration msvc
.PHONY: msvc8_install_release
msvc8_install_release: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcrelease -voversionconfiguration msvc
.PHONY: msvc8_install_speed
msvc8_install_speed: $(RBUILD_TARGET)
$(ECHO_RBUILD)
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcspeed -voversionconfiguration msvc
.PHONY: makefile_auto_clean
makefile_auto_clean:
-@$(rm) $(ROS_AUTOMAKE) $(PREAUTO) 2>$(NUL)
.PHONY: clean
clean: makefile_auto_clean
.PHONY: depends
depends:
@-$(rm) makefile.auto
@$(MAKE) $(filter-out depends, $(MAKECMDGOALS))

View File

@@ -1,29 +0,0 @@
========================
ReactOS Version 0.3.x
Updated Dec 16, 2006
========================
1. What is ReactOS?
ReactOS is an Open Source effort to develop a quality operating system
that is compatible with Windows NT applications and drivers.
The ReactOS project, although currently focused on Windows XP/2003
drivers compatibility, is always keeping an eye toward compatibility with
older version of Windows NT family ( NT 4.0, 2000 (NT 5.0)) and new
Windows NT releases (Vista, etc). Applications (Win32 API) compatibility
focus is Windows XP.
More information is available at http://www.reactos.org/.
2. Building ReactOS
See the INSTALL file for more details.
3. More information
See the media\doc subdirectory for some sparse notes.
4. Who is responsible
See the CREDITS file.

View File

@@ -1,94 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<project name="ReactOS" makefile="makefile.ppc" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="config-ppc.rbuild">
<xi:fallback>
<xi:include href="config-ppc.template.rbuild" />
</xi:fallback>
</xi:include>
<xi:include href="baseaddress.rbuild" />
<property name="BOOTPROG_PREPARE" value="ppc-le2be" />
<property name="BOOTPROG_FLATFORMAT" value="-O elf32-powerpc -B powerpc:common" />
<property name="BOOTPROG_LINKFORMAT" value="-melf32ppc --no-omagic -Ttext 0xe00000 -Tdata 0xe10000" />
<property name="BOOTPROG_COPYFORMAT" value="--only-section=.text --only-section=.data --only-section=.bss -O aixcoff-rs6000" />
<define name="_M_PPC" />
<define name="_PPC_" />
<define name="__PowerPC__" />
<define name="_REACTOS_" />
<define name="__MINGW_IMPORT" empty="true" />
<define name="stdcall" empty="true" />
<define name="__stdcall__" empty="true" />
<define name="fastcall" empty="true" />
<define name="cdecl" empty="true" />
<define name="__cdecl__" empty="true" />
<define name="dllimport" empty="true" />
<compilerflag>-v</compilerflag>
<if property="MP" value="1">
<define name="CONFIG_SMP" value="1" />
</if>
<if property="DBG" value="1">
<define name="DBG" value="1" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<if property="DBG" value="0">
<compilerflag>-Os</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
</if>
<if property="KDBG" value="1">
<define name="KDBG" value="1" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<compilerflag>-Wpointer-arith</compilerflag>
<include>.</include>
<include>include</include>
<include>include/reactos</include>
<include>include/libs</include>
<include>include/drivers</include>
<include>include/subsys</include>
<include>include/ndk</include>
<include>include</include>
<include>include/crt</include>
<include>include/ddk</include>
<directory name="base">
<xi:include href="base/base.rbuild" />
</directory>
<directory name="boot">
<xi:include href="boot/boot.rbuild" />
</directory>
<directory name="dll">
<xi:include href="dll/dll.rbuild" />
</directory>
<directory name="drivers">
<xi:include href="drivers/drivers.rbuild" />
</directory>
<directory name="hal">
<xi:include href="hal/hal.rbuild" />
</directory>
<directory name="include">
<xi:include href="include/directory.rbuild" />
</directory>
<directory name="lib">
<xi:include href="lib/lib.rbuild" />
</directory>
<directory name="media">
<xi:include href="media/media.rbuild" />
</directory>
<directory name="modules">
<xi:include href="modules/directory.rbuild" />
</directory>
<directory name="ntoskrnl">
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
</directory>
<directory name="regtests">
<xi:include href="regtests/directory.rbuild" />
</directory>
<directory name="subsystems">
<xi:include href="subsystems/subsystems.rbuild" />
</directory>
</project>

View File

@@ -1,108 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<project name="ReactOS" makefile="makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="config.rbuild">
<xi:fallback>
<xi:include href="config.template.rbuild" />
</xi:fallback>
</xi:include>
<xi:include href="baseaddress.rbuild" />
<define name="_M_IX86" />
<define name="_X86_" />
<define name="__i386__" />
<define name="_REACTOS_" />
<if property="MP" value="1">
<define name="CONFIG_SMP" value="1" />
</if>
<if property="DBG" value="1">
<define name="DBG" value="1" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<if property="KDBG" value="1">
<define name="KDBG" value="1" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<if property="GDB" value="0">
<if property="OPTIMIZE" value="1">
<compilerflag>-Os</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
<compilerflag>-ftracer</compilerflag>
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
</if>
<if property="OPTIMIZE" value="2">
<compilerflag>-Os</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
</if>
<if property="OPTIMIZE" value="3">
<compilerflag>-O1</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
</if>
<if property="OPTIMIZE" value="4">
<compilerflag>-O2</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
</if>
<if property="OPTIMIZE" value="5">
<compilerflag>-O3</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
</if>
</if>
<compilerflag>-Wpointer-arith</compilerflag>
<linkerflag>-enable-stdcall-fixup</linkerflag>
<include>.</include>
<include>include</include>
<include>include/psdk</include>
<include>include/crt</include>
<include>include/ddk</include>
<include>include/GL</include>
<include>include/ndk</include>
<include>include/reactos</include>
<include>include/reactos/libs</include>
<directory name="base">
<xi:include href="base/base.rbuild" />
</directory>
<directory name="boot">
<xi:include href="boot/boot.rbuild" />
</directory>
<directory name="dll">
<xi:include href="dll/dll.rbuild" />
</directory>
<directory name="drivers">
<xi:include href="drivers/drivers.rbuild" />
</directory>
<directory name="hal">
<xi:include href="hal/hal.rbuild" />
</directory>
<directory name="include">
<xi:include href="include/directory.rbuild" />
</directory>
<directory name="lib">
<xi:include href="lib/lib.rbuild" />
</directory>
<directory name="media">
<xi:include href="media/media.rbuild" />
</directory>
<directory name="modules">
<xi:include href="modules/directory.rbuild" />
</directory>
<directory name="ntoskrnl">
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
</directory>
<directory name="regtests">
<xi:include href="regtests/directory.rbuild" />
</directory>
<directory name="subsystems">
<xi:include href="subsystems/subsystems.rbuild" />
</directory>
</project>

View File

@@ -1,29 +0,0 @@
; Format:
; COMPONENT_NAME PATH_TO_COMPONENT_SOURCES
; COMPONENT_NAME - Name of the component. Eg. kernel32.dll.
; PATH_TO_COMPONENT_SOURCES - Relative path to sources (relative to
; where rgenstat is run from).
advapi32.dll reactos/dll/win32/advapi32
crtdll.dll reactos/dll/win32/crtdll
gdi32.dll reactos/dll/win32/gdi32
gdiplus.dll reactos/dll/win32/gdiplus
iphlpapi.dll reactos/dll/win32/iphlpapi
kernel32.dll reactos/dll/win32/kernel32
lz32.dll reactos/dll/win32/lzexpand
msvcrt.dll reactos/dll/win32/msvcrt
rpcrt4.dll reactos/dll/win32/rpcrt4
secur32.dll reactos/dll/win32/secur32
snmpapi.dll reactos/dll/win32/snmpapi
user32.dll reactos/dll/win32/user32
version.dll reactos/dll/win32/version
winspool.dll reactos/dll/win32/winspool
ws2_32.dll reactos/dll/win32/ws2_32
wsock32.dll reactos/dll/win32/wsock32
videoprt.dll reactos/drivers/video/videoprt
ndis.sys reactos/drivers/network/ndis
tdi.sys reactos/drivers/network/tdi
class2.sys reactos/drivers/storage/class2
scsiport.sys reactos/drivers/storage/scsiport
ntoskrnl.exe reactos/ntoskrnl
ntoskrnl.exe reactos/lib/rtl
win32k.sys reactos/subsystems/win32/win32k

View File

@@ -1,98 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group>
<directory name="cacls">
<xi:include href="cacls/cacls.rbuild" />
</directory>
<directory name="calc">
<xi:include href="calc/calc.rbuild" />
</directory>
<directory name="cmdutils">
<xi:include href="cmdutils/cmdutils.rbuild" />
</directory>
<directory name="devmgmt">
<xi:include href="devmgmt/devmgmt.rbuild" />
</directory>
<directory name="devmgr">
<xi:include href="devmgr/devmgr.rbuild" />
</directory>
<directory name="downloader">
<xi:include href="downloader/downloader.rbuild" />
</directory>
<directory name="games">
<xi:include href="games/games.rbuild" />
</directory>
<directory name="getfirefox">
<xi:include href="getfirefox/getfirefox.rbuild" />
</directory>
<directory name="gettype">
<xi:include href="gettype/gettype.rbuild" />
</directory>
<directory name="hostname">
<xi:include href="hostname/hostname.rbuild" />
</directory>
<directory name="ibrowser">
<xi:include href="ibrowser/ibrowser.rbuild" />
</directory>
<directory name="imagesoft">
<xi:include href="imagesoft/imagesoft.rbuild" />
</directory>
<directory name="msconfig">
<xi:include href="msconfig/msconfig.rbuild" />
</directory>
<directory name="network">
<xi:include href="network/network.rbuild" />
</directory>
<directory name="notepad">
<xi:include href="notepad/notepad.rbuild" />
</directory>
<directory name="regedit">
<xi:include href="regedit/regedit.rbuild" />
</directory>
<directory name="reporterror">
<xi:include href="reporterror/reporterror.rbuild" />
</directory>
<directory name="sc">
<xi:include href="sc/sc.rbuild" />
</directory>
<directory name="sm">
<xi:include href="sm/sm.rbuild" />
</directory>
<directory name="screensavers">
<xi:include href="screensavers/screensavers.rbuild" />
</directory>
<directory name="screenshot">
<xi:include href="screenshot/screenshot.rbuild" />
</directory>
<directory name="servman">
<xi:include href="servman/servman.rbuild" />
</directory>
<directory name="shutdown">
<xi:include href="shutdown/shutdown.rbuild" />
</directory>
<directory name="sndvol32">
<xi:include href="sndvol32/sndvol32.rbuild" />
</directory>
<directory name="taskmgr">
<xi:include href="taskmgr/taskmgr.rbuild" />
</directory>
<directory name="testsets">
<xi:include href="testsets/testsets.rbuild" />
</directory>
<directory name="winefile">
<xi:include href="winefile/winefile.rbuild" />
</directory>
<directory name="wordpad">
<xi:include href="wordpad/wordpad.rbuild" />
</directory>
<directory name="control">
<xi:include href="control/control.rbuild" />
</directory>
<directory name="utils">
<xi:include href="utils/utils.rbuild" />
</directory>
<directory name="winver">
<xi:include href="winver/winver.rbuild" />
</directory>
</group>

View File

@@ -1,598 +0,0 @@
/*
* ReactOS Control ACLs Program
* Copyright (C) 2006 Thomas Weidenmueller
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <precomp.h>
static GENERIC_MAPPING FileGenericMapping =
{
FILE_GENERIC_READ,
FILE_GENERIC_WRITE,
FILE_GENERIC_EXECUTE,
FILE_ALL_ACCESS
};
static INT
LengthOfStrResource(IN HINSTANCE hInst,
IN UINT uID)
{
HRSRC hrSrc;
HGLOBAL hRes;
LPWSTR lpName, lpStr;
if (hInst == NULL)
{
hInst = GetModuleHandle(NULL);
}
/* There are always blocks of 16 strings */
lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1);
/* Find the string table block */
hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING);
if (hrSrc)
{
hRes = LoadResource(hInst, hrSrc);
if (hRes)
{
lpStr = LockResource(hRes);
if (lpStr)
{
UINT x;
/* Find the string we're looking for */
uID &= 0xF; /* position in the block, same as % 16 */
for (x = 0; x < uID; x++)
{
lpStr += (*lpStr) + 1;
}
/* Found the string */
return (int)(*lpStr);
}
}
}
return -1;
}
static INT
AllocAndLoadString(OUT LPTSTR *lpTarget,
IN HINSTANCE hInst,
IN UINT uID)
{
INT ln;
ln = LengthOfStrResource(hInst,
uID);
if (ln++ > 0)
{
(*lpTarget) = (LPTSTR)HeapAlloc(GetProcessHeap(),
0,
ln * sizeof(TCHAR));
if ((*lpTarget) != NULL)
{
INT Ret;
Ret = LoadString(hInst,
uID,
*lpTarget,
ln);
if (!Ret)
{
HeapFree(GetProcessHeap(),
0,
*lpTarget);
}
return Ret;
}
}
return 0;
}
static VOID
PrintHelp(VOID)
{
LPTSTR szHelp;
if (AllocAndLoadString(&szHelp,
NULL,
IDS_HELP) != 0)
{
_tprintf(_T("%s"),
szHelp);
HeapFree(GetProcessHeap(),
0,
szHelp);
}
}
static VOID
PrintErrorMessage(IN DWORD dwError)
{
LPTSTR szError;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dwError,
MAKELANGID(LANG_NEUTRAL,
SUBLANG_DEFAULT),
(LPTSTR)&szError,
0,
NULL) != 0)
{
_tprintf(_T("%s"),
szError);
LocalFree((HLOCAL)szError);
}
}
static DWORD
LoadAndPrintString(IN HINSTANCE hInst,
IN UINT uID)
{
TCHAR szTemp[255];
DWORD Len;
Len = (DWORD)LoadString(hInst,
uID,
szTemp,
sizeof(szTemp) / sizeof(szTemp[0]));
if (Len != 0)
{
_tprintf(_T("%s"),
szTemp);
}
return Len;
}
static BOOL
PrintFileDacl(IN LPTSTR FilePath,
IN LPTSTR FileName)
{
SIZE_T Indent;
PSECURITY_DESCRIPTOR SecurityDescriptor;
DWORD SDSize = 0;
TCHAR FullFileName[MAX_PATH + 1];
BOOL Error = FALSE, Ret = FALSE;
Indent = _tcslen(FilePath) + _tcslen(FileName);
if (Indent++ > MAX_PATH - 1)
{
/* file name too long */
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
_tcscpy(FullFileName,
FilePath);
_tcscat(FullFileName,
FileName);
/* find out how much memory we need */
if (!GetFileSecurity(FullFileName,
DACL_SECURITY_INFORMATION,
NULL,
0,
&SDSize) &&
GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
return FALSE;
}
SecurityDescriptor = (PSECURITY_DESCRIPTOR)HeapAlloc(GetProcessHeap(),
0,
SDSize);
if (SecurityDescriptor != NULL)
{
if (GetFileSecurity(FullFileName,
DACL_SECURITY_INFORMATION,
SecurityDescriptor,
SDSize,
&SDSize))
{
PACL Dacl;
BOOL DaclPresent;
BOOL DaclDefaulted;
if (GetSecurityDescriptorDacl(SecurityDescriptor,
&DaclPresent,
&Dacl,
&DaclDefaulted))
{
if (DaclPresent)
{
PACCESS_ALLOWED_ACE Ace;
DWORD AceIndex = 0;
/* dump the ACL */
while (GetAce(Dacl,
AceIndex,
(PVOID*)&Ace))
{
SID_NAME_USE Use;
DWORD NameSize = 0;
DWORD DomainSize = 0;
LPTSTR Name = NULL;
LPTSTR Domain = NULL;
LPTSTR SidString = NULL;
DWORD IndentAccess;
DWORD AccessMask = Ace->Mask;
PSID Sid = (PSID)&Ace->SidStart;
/* attempt to translate the SID into a readable string */
if (!LookupAccountSid(NULL,
Sid,
Name,
&NameSize,
Domain,
&DomainSize,
&Use))
{
if (GetLastError() == ERROR_NONE_MAPPED || NameSize == 0)
{
goto BuildSidString;
}
else
{
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
Error = TRUE;
break;
}
Name = (LPTSTR)HeapAlloc(GetProcessHeap(),
0,
(NameSize + DomainSize) * sizeof(TCHAR));
if (Name == NULL)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
Error = TRUE;
break;
}
Domain = Name + NameSize;
Name[0] = _T('\0');
if (DomainSize != 0)
Domain[0] = _T('\0');
if (!LookupAccountSid(NULL,
Sid,
Name,
&NameSize,
Domain,
&DomainSize,
&Use))
{
HeapFree(GetProcessHeap(),
0,
Name);
Name = NULL;
goto BuildSidString;
}
}
}
else
{
BuildSidString:
if (!ConvertSidToStringSid(Sid,
&SidString))
{
Error = TRUE;
break;
}
}
/* print the file name or space */
_tprintf(_T("%s "),
FullFileName);
/* attempt to map the SID to a user name */
if (AceIndex == 0)
{
DWORD i = 0;
/* overwrite the full file name with spaces so we
only print the file name once */
while (FullFileName[i] != _T('\0'))
FullFileName[i++] = _T(' ');
}
/* print the domain and/or user if possible, or the SID string */
if (Name != NULL && Domain[0] != _T('\0'))
{
_tprintf(_T("%s\\%s:"),
Domain,
Name);
IndentAccess = (DWORD)_tcslen(Domain) + _tcslen(Name);
}
else
{
LPTSTR DisplayString = (Name != NULL ? Name : SidString);
_tprintf(_T("%s:"),
DisplayString);
IndentAccess = (DWORD)_tcslen(DisplayString);
}
/* print the ACE Flags */
if (Ace->Header.AceFlags & CONTAINER_INHERIT_ACE)
{
IndentAccess += LoadAndPrintString(NULL,
IDS_ABBR_CI);
}
if (Ace->Header.AceFlags & OBJECT_INHERIT_ACE)
{
IndentAccess += LoadAndPrintString(NULL,
IDS_ABBR_OI);
}
if (Ace->Header.AceFlags & INHERIT_ONLY_ACE)
{
IndentAccess += LoadAndPrintString(NULL,
IDS_ABBR_IO);
}
IndentAccess += 2;
/* print the access rights */
MapGenericMask(&AccessMask,
&FileGenericMapping);
if (Ace->Header.AceType & ACCESS_DENIED_ACE_TYPE)
{
if (AccessMask == FILE_ALL_ACCESS)
{
LoadAndPrintString(NULL,
IDS_ABBR_NONE);
}
else
{
LoadAndPrintString(NULL,
IDS_DENY);
goto PrintSpecialAccess;
}
}
else
{
if (AccessMask == FILE_ALL_ACCESS)
{
LoadAndPrintString(NULL,
IDS_ABBR_FULL);
}
else if (!(Ace->Mask & (GENERIC_READ | GENERIC_EXECUTE)) &&
AccessMask == (FILE_GENERIC_READ | FILE_EXECUTE))
{
LoadAndPrintString(NULL,
IDS_ABBR_READ);
}
else if (AccessMask == (FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_EXECUTE | DELETE))
{
LoadAndPrintString(NULL,
IDS_ABBR_CHANGE);
}
else if (AccessMask == FILE_GENERIC_WRITE)
{
LoadAndPrintString(NULL,
IDS_ABBR_WRITE);
}
else
{
DWORD x, x2;
static const struct
{
DWORD Access;
UINT uID;
}
AccessRights[] =
{
{FILE_WRITE_ATTRIBUTES, IDS_FILE_WRITE_ATTRIBUTES},
{FILE_READ_ATTRIBUTES, IDS_FILE_READ_ATTRIBUTES},
{FILE_DELETE_CHILD, IDS_FILE_DELETE_CHILD},
{FILE_EXECUTE, IDS_FILE_EXECUTE},
{FILE_WRITE_EA, IDS_FILE_WRITE_EA},
{FILE_READ_EA, IDS_FILE_READ_EA},
{FILE_APPEND_DATA, IDS_FILE_APPEND_DATA},
{FILE_WRITE_DATA, IDS_FILE_WRITE_DATA},
{FILE_READ_DATA, IDS_FILE_READ_DATA},
{FILE_GENERIC_EXECUTE, IDS_FILE_GENERIC_EXECUTE},
{FILE_GENERIC_WRITE, IDS_FILE_GENERIC_WRITE},
{FILE_GENERIC_READ, IDS_FILE_GENERIC_READ},
{GENERIC_ALL, IDS_GENERIC_ALL},
{GENERIC_EXECUTE, IDS_GENERIC_EXECUTE},
{GENERIC_WRITE, IDS_GENERIC_WRITE},
{GENERIC_READ, IDS_GENERIC_READ},
{MAXIMUM_ALLOWED, IDS_MAXIMUM_ALLOWED},
{ACCESS_SYSTEM_SECURITY, IDS_ACCESS_SYSTEM_SECURITY},
{SPECIFIC_RIGHTS_ALL, IDS_SPECIFIC_RIGHTS_ALL},
{STANDARD_RIGHTS_REQUIRED, IDS_STANDARD_RIGHTS_REQUIRED},
{SYNCHRONIZE, IDS_SYNCHRONIZE},
{WRITE_OWNER, IDS_WRITE_OWNER},
{WRITE_DAC, IDS_WRITE_DAC},
{READ_CONTROL, IDS_READ_CONTROL},
{DELETE, IDS_DELETE},
{STANDARD_RIGHTS_ALL, IDS_STANDARD_RIGHTS_ALL},
};
LoadAndPrintString(NULL,
IDS_ALLOW);
PrintSpecialAccess:
LoadAndPrintString(NULL,
IDS_SPECIAL_ACCESS);
/* print the special access rights */
x = sizeof(AccessRights) / sizeof(AccessRights[0]);
while (x-- != 0)
{
if ((Ace->Mask & AccessRights[x].Access) == AccessRights[x].Access)
{
_tprintf(_T("\n%s "),
FullFileName);
for (x2 = 0;
x2 < IndentAccess;
x2++)
{
_tprintf(_T(" "));
}
LoadAndPrintString(NULL,
AccessRights[x].uID);
}
}
_tprintf(_T("\n"));
}
}
_tprintf(_T("\n"));
/* free up all resources */
if (Name != NULL)
{
HeapFree(GetProcessHeap(),
0,
Name);
}
if (SidString != NULL)
{
LocalFree((HLOCAL)SidString);
}
AceIndex++;
}
if (!Error)
Ret = TRUE;
}
else
{
SetLastError(ERROR_NO_SECURITY_ON_OBJECT);
}
}
}
HeapFree(GetProcessHeap(),
0,
SecurityDescriptor);
}
else
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
}
return Ret;
}
int __cdecl _tmain(int argc, const TCHAR *argv[])
{
if (argc < 2)
{
PrintHelp();
return 1;
}
else
{
TCHAR FullPath[MAX_PATH + 1];
TCHAR *FilePart = NULL;
WIN32_FIND_DATA FindData;
HANDLE hFind;
DWORD LastError;
BOOL ContinueAccessDenied = FALSE;
if (argc > 2)
{
/* FIXME - parse arguments */
}
/* get the full path of where we're searching in */
if (GetFullPathName(argv[1],
sizeof(FullPath) / sizeof(FullPath[0]),
FullPath,
&FilePart) != 0)
{
if (FilePart != NULL)
*FilePart = _T('\0');
}
else
goto Error;
/* find the file(s) */
hFind = FindFirstFile(argv[1],
&FindData);
if (hFind != INVALID_HANDLE_VALUE)
{
do
{
if (!(FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
(_tcscmp(FindData.cFileName,
_T(".")) &&
_tcscmp(FindData.cFileName,
_T(".."))))
{
if (argc > 2)
{
/* FIXME - edit or replace the descriptor */
}
else
{
if (!PrintFileDacl(FullPath,
FindData.cFileName))
{
LastError = GetLastError();
if (LastError == ERROR_ACCESS_DENIED &&
ContinueAccessDenied)
{
PrintErrorMessage(LastError);
}
else
break;
}
else
_tprintf(_T("\n"));
}
}
} while (FindNextFile(hFind,
&FindData));
FindClose(hFind);
if (GetLastError() != ERROR_NO_MORE_FILES)
{
goto Error;
}
}
else
{
Error:
PrintErrorMessage(GetLastError());
return 1;
}
}
return 0;
}

View File

@@ -1,15 +0,0 @@
<module name="cacls" type="win32cui" installbase="system32" installname="cacls.exe" unicode="true">
<include base="cacls">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0500</define>
<define name="_WIN32_WINNT">0x0600</define>
<define name="WINVER">0x0600</define>
<library>kernel32</library>
<library>advapi32</library>
<library>ntdll</library>
<library>user32</library>
<library>shell32</library>
<file>cacls.c</file>
<file>lang/cacls.rc</file>
<pch>precomp.h</pch>
</module>

View File

@@ -1,10 +0,0 @@
#include <windows.h>
#include "resource.h"
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Control ACLs Program\0"
#define REACTOS_STR_INTERNAL_NAME "cacls\0"
#define REACTOS_STR_ORIGINAL_FILENAME "cacls.exe\0"
#include <reactos/version.rc>
#include "rsrc.rc"

View File

@@ -1,79 +0,0 @@
/*
* German language file by Daniel Reimer <EmuandCo> 2006-06-15
*/
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
STRINGTABLE DISCARDABLE
{
IDS_HELP, "<22>ndert Datei-ACLs (Access Control List) oder zeigt sie an.\n\n\
CACLS Dateiname [/T] [/E] [/C] [/G Benutzer:Zugriff] [/R Benutzer [...]]\n\
[/P Benutzer:Zugriff [...]] [/D Benutzer [...]]\n\
Dateiname ACLs f<>r angegebene Datei anzeigen.\n\
/T ACLs der angegebenen Datei im aktuellen Verzeichnis\n\
und allen Unterverzeichnissen <20>ndern.\n\
/E ACL bearbeiten anstatt sie zu ersetzen.\n\
/C <20>ndern der ACLs bei Zugriffsverletzung fortsetzen.\n\
/G Benutzer:Zugriff Angegebene Zugriffsarten zulassen.\n\
Zugriff kann sein: R Lesen\n\
W Schreiben\n\
C <20>ndern (Schreiben)\n\
F Vollzugriff\n\
/R Benutzer Zugriffsrechte des Benutzers aufheben (g<>ltig mit /E).\n\
/P Benutzer:Zugriff Zugriffsrechte des Benutzers ersetzen.\n\
Zugriff kann sein: N Kein\n\
R Lesen\n\
W Schreiben\n\
C <20>ndern (Schreiben)\n\
F Vollzugriff\n\
/D Benutzer Zugriff f<>r Benutzer verweigern.\n\
Platzhalterzeichen (Wildcards) werden f<>r Dateiname unterst<73>tzt.\n\
Mehrere Benutzer k<>nnen in einem Befehl angegeben werden.\n\n\
Abk<EFBFBD>rzungen:\n\
CI - Containervererbung.\n\
Der ACE-Eintrag wird von Verzeichnissen geerbt.\n\
OI - Objektvererbung.\n\
Der ACE-Eintrag wird von Dateien geerbt.\n\
IO - Nur vererben.\n\
Der ACE-Eintrag bezieht sich nicht auf\n\
die aktuelle Datei/das aktuelle Verzeichnis.\n"
IDS_ABBR_CI, "(CI)"
IDS_ABBR_OI, "(OI)"
IDS_ABBR_IO, "(IO)"
IDS_ABBR_FULL, "F"
IDS_ABBR_READ, "R"
IDS_ABBR_WRITE, "W"
IDS_ABBR_CHANGE, "C"
IDS_ABBR_NONE, "N"
IDS_ALLOW, ""
IDS_DENY, "(DENY)"
IDS_SPECIAL_ACCESS, "(special access:)"
IDS_GENERIC_READ, "GENERIC_READ"
IDS_GENERIC_WRITE, "GENERIC_WRITE"
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
IDS_GENERIC_ALL, "GENERIC_ALL"
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
IDS_FILE_READ_DATA, "FILE_READ_DATA"
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
IDS_FILE_READ_EA, "FILE_READ_EA"
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
IDS_FILE_EXECUTE, "FILE_EXECUTE"
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
IDS_SYNCHRONIZE, "SYNCHRONIZE"
IDS_WRITE_OWNER, "WRITE_OWNER"
IDS_WRITE_DAC, "WRITE_DAC"
IDS_READ_CONTROL, "READ_CONTROL"
IDS_DELETE, "DELETE"
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
}

View File

@@ -1,74 +0,0 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STRINGTABLE DISCARDABLE
{
IDS_HELP, "Displays or modifies access control lists (ACLs) of files\n\n\
CACLS filename [/T] [/E] [/C] [/G user:perm [...]] [/R user [...]]\n\
[/P user:perm [...]] [/D user [...]]\n\
filename Displays ACLs.\n\
/T Changes ACLs of specified files in\n\
the current directory and all subdirectories.\n\
/E Edit ACL instead of replacing it.\n\
/C Continue on access denied errors.\n\
/G user:perm Grant specified user access rights.\n\
Perm can be: R Read\n\
W Write\n\
C Change (write)\n\
F Full control\n\
/R user Revoke specified user's access rights (only valid with /E).\n\
/P user:perm Replace specified user's access rights.\n\
Perm can be: N None\n\
R Read\n\
W Write\n\
C Change (write)\n\
F Full control\n\
/D user Deny specified user access.\n\
Wildcards can be used to specify more than one file in a command.\n\
You can specify more than one user in a command.\n\n\
Abbreviations:\n\
CI - Container Inherit.\n\
The ACE will be inherited by directories.\n\
OI - Object Inherit.\n\
The ACE will be inherited by files.\n\
IO - Inherit Only.\n\
The ACE does not apply to the current file/directory.\n"
IDS_ABBR_CI, "(CI)"
IDS_ABBR_OI, "(OI)"
IDS_ABBR_IO, "(IO)"
IDS_ABBR_FULL, "F"
IDS_ABBR_READ, "R"
IDS_ABBR_WRITE, "W"
IDS_ABBR_CHANGE, "C"
IDS_ABBR_NONE, "N"
IDS_ALLOW, ""
IDS_DENY, "(DENY)"
IDS_SPECIAL_ACCESS, "(special access:)"
IDS_GENERIC_READ, "GENERIC_READ"
IDS_GENERIC_WRITE, "GENERIC_WRITE"
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
IDS_GENERIC_ALL, "GENERIC_ALL"
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
IDS_FILE_READ_DATA, "FILE_READ_DATA"
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
IDS_FILE_READ_EA, "FILE_READ_EA"
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
IDS_FILE_EXECUTE, "FILE_EXECUTE"
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
IDS_SYNCHRONIZE, "SYNCHRONIZE"
IDS_WRITE_OWNER, "WRITE_OWNER"
IDS_WRITE_DAC, "WRITE_DAC"
IDS_READ_CONTROL, "READ_CONTROL"
IDS_DELETE, "DELETE"
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
}

View File

@@ -1,75 +0,0 @@
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
STRINGTABLE DISCARDABLE
{
IDS_HELP, "Visualizza o modifica le liste di controllo di accesso ai file.\n\
(access control lists ACLs)\n\n\
CACLS nomefile [/T] [/E] [/C] [/G utente:perm [...]] [/R utente [...]]\n\
[/P utente:perm [...]] [/D utente [...]]\n\
nomefile Visualizza ACLs.\n\
/T Modifica la ACLs dei file specificati nella\n\
cartella corrente e in tutte le sottocartelle.\n\
/E Modifica ACL invece di sostituirla.\n\
/C Prosegue in caso di errori di accesso negato.\n\
/G utente:perm Assegna i diritti di accesso per l'utente specificato.\n\
Perm vale: R Lettura\n\
W Scrittura\n\
C Modifica (Scrittura)\n\
F Controllo completo\n\
/R utente Toglie i diritti di accesso all'utente indicato (valido solo con /E).\n\
/P utente:perm Sostituisce i diritti di accesso dell'utente indicato.\n\
Perm vale: N Nessuno\n\
R Lettura\n\
W Scrittura\n\
C Modifica (Scrittura)\n\
F Controllo completo\n\
/D utente Nega l'accesso all'utente indicato.\n\
I caratteri jolly possono essere usati per indicare piu' di un file in un comando.\n\
Si pu<70> indicare piu' di un utente in un comando.\n\n\
Abbreviazioni:\n\
CI - Contenitore eredita.\n\
ACE verr<72> ereditato dalle cartelle.\n\
OI - Oggetto eredita.\n\
ACE verr<72> ereditato dai file.\n\
IO - Solo eredi.\n\
ACE non <20> applicato ai file/cartelle correnti.\n"
IDS_ABBR_CI, "(CI)"
IDS_ABBR_OI, "(OI)"
IDS_ABBR_IO, "(IO)"
IDS_ABBR_FULL, "F"
IDS_ABBR_READ, "R"
IDS_ABBR_WRITE, "W"
IDS_ABBR_CHANGE, "C"
IDS_ABBR_NONE, "N"
IDS_ALLOW, ""
IDS_DENY, "(DENY)"
IDS_SPECIAL_ACCESS, "(special access:)"
IDS_GENERIC_READ, "GENERIC_READ"
IDS_GENERIC_WRITE, "GENERIC_WRITE"
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
IDS_GENERIC_ALL, "GENERIC_ALL"
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
IDS_FILE_READ_DATA, "FILE_READ_DATA"
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
IDS_FILE_READ_EA, "FILE_READ_EA"
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
IDS_FILE_EXECUTE, "FILE_EXECUTE"
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
IDS_SYNCHRONIZE, "SYNCHRONIZE"
IDS_WRITE_OWNER, "WRITE_OWNER"
IDS_WRITE_DAC, "WRITE_DAC"
IDS_READ_CONTROL, "READ_CONTROL"
IDS_DELETE, "DELETE"
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
}

View File

@@ -1,74 +0,0 @@
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
STRINGTABLE DISCARDABLE
{
IDS_HELP, "Viser eller endrer tilgang kontroll lister (ACL) av filer\n\n\
CACLS filnavn [/T] [/E] [/C] [/G bruker:perm [...]] [/R user [...]]\n\
[/P bruker:perm [...]] [/D bruker [...]]\n\
filnavn Viser ACL.\n\
/T Endrer ACL av spesifiserte filer i\n\
n<>v<EFBFBD>rende katalog og alle under-mapper.\n\
/E Rediger ACL isteden for erstatte det.\n\
/C Fortsett p<> tilgang nektet feiler.\n\
/G user:perm Innr<6E>mme spesifiert bruker tilgang rettigheter.\n\
Perm kan bli: L Les\n\
S Skriv\n\
E Endre (skriv)\n\
F Full kontroll\n\
/R bruker Tilbakekalle spesifisert bruker tilgang rettighet (bare gyldig med /E).\n\
/P bruker:perm Erstatte spesifisert bruker tilgang rettighet.\n\
Perm kan bli: I Ingen\n\
L Les\n\
S Skrive\n\
E Endre (skriv)\n\
F Full kontroll\n\
/D bruker Avsl<73> spesifisert bruker tilgang.\n\
Wildcards kan bli brukt for <20> spesifisere mere enn en fil i en kommando.\n\
Du kan spesifisere mere enn en bruker i en kommando.\n\n\
Forkortelse:\n\
CI - Container Inherit.\n\
ACE vil bli inherited av directories.\n\
OI - Object Inherit.\n\
ACE will be inherited by files.\n\
IO - Inherit Only.\n\
ACE gjelder ikke til n<>v<EFBFBD>rende fil/katalog.\n"
IDS_ABBR_CI, "(CI)"
IDS_ABBR_OI, "(OI)"
IDS_ABBR_IO, "(IO)"
IDS_ABBR_FULL, "F"
IDS_ABBR_READ, "R"
IDS_ABBR_WRITE, "W"
IDS_ABBR_CHANGE, "C"
IDS_ABBR_NONE, "N"
IDS_ALLOW, ""
IDS_DENY, "(NEKTE)"
IDS_SPECIAL_ACCESS, "(spesiell tilgang:)"
IDS_GENERIC_READ, "GENERISK_LESE"
IDS_GENERIC_WRITE, "GENERISK_SKRIVE"
IDS_GENERIC_EXECUTE, "GENERISK_KJ<4B>RE"
IDS_GENERIC_ALL, "GENERISK_ALT"
IDS_FILE_GENERIC_EXECUTE, "FIL_GENERISK_KJ<4B>RE"
IDS_FILE_GENERIC_READ, "FIL_GENERISK_LESE"
IDS_FILE_GENERIC_WRITE, "FIL_GENERISK_SKRIVE"
IDS_FILE_READ_DATA, "FIL_LES_DATA"
IDS_FILE_WRITE_DATA, "FIL_SKRIV_DATA"
IDS_FILE_APPEND_DATA, "FIL_TILF<4C>YE_DATA"
IDS_FILE_READ_EA, "FIL_LESE_EA"
IDS_FILE_WRITE_EA, "FIL_SKRIVE_EA"
IDS_FILE_EXECUTE, "FIL_KJ<4B>RE"
IDS_FILE_DELETE_CHILD, "FIL_SLETT_BARN"
IDS_FILE_READ_ATTRIBUTES, "FIL_LESE_ATTRIBUTTER"
IDS_FILE_WRITE_ATTRIBUTES, "FIL_SKRIVE_ATTRIBUTTER"
IDS_MAXIMUM_ALLOWED, "MAKSIMUM_TILATT"
IDS_ACCESS_SYSTEM_SECURITY, "TILGANG_SYSTEM_SIKKERHET"
IDS_SPECIFIC_RIGHTS_ALL, "SPESIFIKT_RETTIGHETER_ALT"
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RETTIGHETER_P<5F>BUDT"
IDS_SYNCHRONIZE, "SYNKRONISERE"
IDS_WRITE_OWNER, "SKRIVE_EIER"
IDS_WRITE_DAC, "SKRIVE_DAC"
IDS_READ_CONTROL, "LESE_KONTROLL"
IDS_DELETE, "SLETT"
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RETTIGHETER_ALT"
}

View File

@@ -1,75 +0,0 @@
LANGUAGE LANG_DUTCH, SUBLANG_DUTCH
STRINGTABLE DISCARDABLE
{
IDS_HELP, "ACL's (Access Control Lists, toegangslijsten) van bestanden weergeven\nof bewerken\n\nCACLS bestandsnaam [/T] [/E] [/C] [/G gebr:toeg] [/R gebruiker [...]]\n\
[/P gebr:toeg [...]] [/D gebruiker [...]]\n\
bestandsnaam ACL's weergeven.\n\
/T ACL's wijzigen van opgegeven bestanden in\n\
de huidige map en alle submappen.\n\
/E ACL bewerken in plaats van vervangen.\n\
/C Doorgaan bij toegang geweigerd.\n\
/G gebr:toeg Opgegeven gebruiker toegangsrechten verlenen.\n\
Toeg kan zijn: R Lezen\n\
W Schrijven\n\
C Wijzigen (schrijven)\n\
F Volledig beheer\n\
/R gebruiker Toegangsrechten van opgegeven gebruiker intrekken.\n\
[alleen geldig met /E].\n\
/P gebr:toeg Toegangsrechten van opgegeven gebruiker vervangen.\n\
Toeg kan zijn: N Geen\n\
R Lezen\n\
W Schrijven\n\
C Wijzigen (schrijven)\n\
F Volledig beheer\n\
/D gebruiker Opgegeven gebruiker toegang weigeren.\n\
U kunt jokertekens gebruiken om meerdere bestanden op te geven in een\n\
opdracht. U kunt meerdere gebruikers opgeven in een opdracht.\n\n\
Afkortingen:\n\
CI - Container Inherit.\n\
De toegangslijst wordt door mappen overgenomen.\n\
OI - Object Inherit.\n\
De toegangslijst wordt door bestanden overgenomen.\n\
IO - Inherit Only.\n\
De toegangslijst is niet van toepassing op het huidige bestand of\n\
de huidige map.\n"
IDS_ABBR_CI, "(CI)"
IDS_ABBR_OI, "(OI)"
IDS_ABBR_IO, "(IO)"
IDS_ABBR_FULL, "F"
IDS_ABBR_READ, "R"
IDS_ABBR_WRITE, "W"
IDS_ABBR_CHANGE, "C"
IDS_ABBR_NONE, "N"
IDS_ALLOW, ""
IDS_DENY, "(DENY)"
IDS_SPECIAL_ACCESS, "(speciale toegang:)"
IDS_GENERIC_READ, "GENERIC_READ"
IDS_GENERIC_WRITE, "GENERIC_WRITE"
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
IDS_GENERIC_ALL, "GENERIC_ALL"
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
IDS_FILE_READ_DATA, "FILE_READ_DATA"
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
IDS_FILE_READ_EA, "FILE_READ_EA"
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
IDS_FILE_EXECUTE, "FILE_EXECUTE"
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
IDS_SYNCHRONIZE, "SYNCHRONIZE"
IDS_WRITE_OWNER, "WRITE_OWNER"
IDS_WRITE_DAC, "WRITE_DAC"
IDS_READ_CONTROL, "READ_CONTROL"
IDS_DELETE, "DELETE"
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
}

View File

@@ -1,75 +0,0 @@
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_HELP, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (ACLs) <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n\
CACLS <20><><EFBFBD>_<EFBFBD><5F><EFBFBD><EFBFBD><EFBFBD> [/T] [/E] [/C] [/G <20><><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD> [...]] [/R <20><><EFBFBD> [...]]\n\
[/P <20><><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD>[...]] [/D <20><><EFBFBD> [...]]\n\
<20><><EFBFBD>_<EFBFBD><5F><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACL.\n\
/T <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACL <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
<20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
/E <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
/C <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
/G <20><><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
<20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: R <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
W <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
C <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)\n\
F <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
/R <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
(<28><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> /E).\n\
/P <20><><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
<20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: N <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
R <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
W <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
C <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)\n\
F <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
/D <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.\n\
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\n\
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n\
CI - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
ACE <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
OI - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
ACE <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
IO - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
ACE <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD>.\n"
IDS_ABBR_CI, "(CI)"
IDS_ABBR_OI, "(OI)"
IDS_ABBR_IO, "(IO)"
IDS_ABBR_FULL, "F"
IDS_ABBR_READ, "R"
IDS_ABBR_WRITE, "W"
IDS_ABBR_CHANGE, "C"
IDS_ABBR_NONE, "N"
IDS_ALLOW, ""
IDS_DENY, "(DENY)"
IDS_SPECIAL_ACCESS, "(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:)"
IDS_GENERIC_READ, "GENERIC_READ"
IDS_GENERIC_WRITE, "GENERIC_WRITE"
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
IDS_GENERIC_ALL, "GENERIC_ALL"
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
IDS_FILE_READ_DATA, "FILE_READ_DATA"
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
IDS_FILE_READ_EA, "FILE_READ_EA"
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
IDS_FILE_EXECUTE, "FILE_EXECUTE"
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
IDS_SYNCHRONIZE, "SYNCHRONIZE"
IDS_WRITE_OWNER, "WRITE_OWNER"
IDS_WRITE_DAC, "WRITE_DAC"
IDS_READ_CONTROL, "READ_CONTROL"
IDS_DELETE, "DELETE"
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
}

View File

@@ -1,10 +0,0 @@
#ifndef _CACLS_PRECOMP_H
#define _CACLS_PRECOMP_H
#include <windows.h>
#include <sddl.h>
#include <tchar.h>
#include <stdio.h>
#include "resource.h"
#endif /* _CACLS_PRECOMP_H */

View File

@@ -1,44 +0,0 @@
#ifndef _CACLS_RESOURCE_H
#define _CACLS_RESOURCE_H
#define IDS_HELP 101
#define IDS_ABBR_CI 102
#define IDS_ABBR_OI 103
#define IDS_ABBR_IO 104
#define IDS_ABBR_FULL 105
#define IDS_ABBR_READ 106
#define IDS_ABBR_WRITE 107
#define IDS_ABBR_CHANGE 108
#define IDS_ABBR_NONE 109
#define IDS_ALLOW 110
#define IDS_DENY 111
#define IDS_SPECIAL_ACCESS 112
#define IDS_GENERIC_READ 113
#define IDS_GENERIC_WRITE 114
#define IDS_GENERIC_EXECUTE 115
#define IDS_GENERIC_ALL 116
#define IDS_FILE_GENERIC_EXECUTE 118
#define IDS_FILE_GENERIC_READ 119
#define IDS_FILE_GENERIC_WRITE 120
#define IDS_FILE_READ_DATA 121
#define IDS_FILE_WRITE_DATA 122
#define IDS_FILE_APPEND_DATA 123
#define IDS_FILE_READ_EA 124
#define IDS_FILE_WRITE_EA 125
#define IDS_FILE_EXECUTE 126
#define IDS_FILE_DELETE_CHILD 127
#define IDS_FILE_READ_ATTRIBUTES 128
#define IDS_FILE_WRITE_ATTRIBUTES 129
#define IDS_MAXIMUM_ALLOWED 130
#define IDS_ACCESS_SYSTEM_SECURITY 131
#define IDS_SPECIFIC_RIGHTS_ALL 132
#define IDS_STANDARD_RIGHTS_REQUIRED 133
#define IDS_SYNCHRONIZE 134
#define IDS_WRITE_OWNER 135
#define IDS_WRITE_DAC 136
#define IDS_READ_CONTROL 137
#define IDS_DELETE 138
#define IDS_STANDARD_RIGHTS_ALL 139
#endif /* _CACLS_RESOURCE_H */

View File

@@ -1,16 +0,0 @@
#include <windows.h>
#include "resource.h"
/* define language neutral resources */
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* include localised resources */
#include "lang/de-DE.rc"
#include "lang/en-US.rc"
#include "lang/it-IT.rc"
#include "lang/nb-NO.rc"
#include "lang/nl-NL.rc"
#include "lang/ru-RU.rc"

View File

@@ -1,16 +0,0 @@
<module name="calc" type="win32gui" installbase="system32" installname="calc.exe">
<include base="calc">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="WINVER">0x0501</define>
<define name="UNICODE" />
<define name="_UNICODE" />
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
<library>comctl32</library>
<file>dialog.c</file>
<file>stats.c</file>
<file>winecalc.c</file>
<file>rsrc.rc</file>
</module>

View File

@@ -1,6 +0,0 @@
/* Do not Make changes here */
#include <windows.h>
#include <reactos/resource.h>
#include "rsrc.rc"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,94 +0,0 @@
/*
* WineCalc (dialog.c)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <tchar.h>
#include "dialog.h"
#include "resource.h"
#include "winecalc.h"
extern HINSTANCE hInstance;
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
HDC hdc;
PAINTSTRUCT ps;
switch( uMsg ) {
case WM_INITDIALOG:
SendMessage (hDlg, WM_SETFONT, (UINT)GetStockObject(DEFAULT_GUI_FONT), TRUE);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDOK:
EndDialog( hDlg, 0 );
return TRUE;
}
break;
case WM_PAINT:
{
HDC hMemDC;
HFONT hFont;
HFONT hFontOrg;
TCHAR c1[CALC_BUF_SIZE];
TCHAR c2[CALC_BUF_SIZE];
TCHAR c3[CALC_BUF_SIZE];
TCHAR c4[CALC_BUF_SIZE];
TCHAR c5[CALC_BUF_SIZE];
hdc = BeginPaint( hDlg, &ps );
hMemDC = CreateCompatibleDC( hdc );
LoadString( hInstance, IDS_COPYRIGHT1, c1, sizeof(c1) / sizeof(c1[0]));
LoadString( hInstance, IDS_COPYRIGHT2, c2, sizeof(c2) / sizeof(c2[0]));
LoadString( hInstance, IDS_COPYRIGHT3, c3, sizeof(c3) / sizeof(c3[0]));
LoadString( hInstance, IDS_COPYRIGHT4, c4, sizeof(c4) / sizeof(c4[0]));
LoadString( hInstance, IDS_COPYRIGHT5, c5, sizeof(c5) / sizeof(c5[0]));
hFont = GetStockObject(DEFAULT_GUI_FONT);
hFontOrg = SelectObject(hdc, hFont);
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, 10, 10, c1, (INT) _tcslen(c1));
TextOut(hdc, 10, 35, c2, (INT) _tcslen(c2));
TextOut(hdc, 10, 50, c3, (INT) _tcslen(c3));
TextOut(hdc, 10, 75, c4, (INT) _tcslen(c4));
TextOut(hdc, 10, 90, c5, (INT) _tcslen(c5));
SelectObject(hdc, hFontOrg);
DeleteDC( hMemDC );
EndPaint( hDlg, &ps );
return 0;
}
case WM_CLOSE:
EndDialog( hDlg, TRUE );
return 0;
}
return FALSE;
}

View File

@@ -1,24 +0,0 @@
/*
* WineCalc (dialog.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );

View File

@@ -1,157 +0,0 @@
/*
* Czech language support
*
* WineCalc (En.rc)
*
* Copyright 2005 Denzil <d3nzil@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Kalkul<75>tor"
IDS_COPYRIGHT1, "Kalkul<75>tor 5.0. Licencov<6F>n pod LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Zp<5A>t"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Neplatn<74> vstup pro funkci."
IDS_ERR_DIVIDE_BY_ZERO, "Nelze d<>lit nulou."
IDS_ERR_UNDEFINED, "V<>sledek funkce nen<65> definov<6F>n."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Editace" {
MENUITEM "&Kop<6F>rovat Ctrl+C", IDM_COPY
MENUITEM "&Vlo<6C>it Ctrl+V", IDM_PASTE
}
POPUP "&Zobrazen<65>" {
MENUITEM "Standartn<74>", IDM_MODE_STANDARD
MENUITEM "V<>deck<63>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Seskupov<6F>n<EFBFBD> <20><>slic", IDM_DIGIT_GROUPING
}
POPUP "&Pomoc" {
MENUITEM "T<>mata n<>pov<6F>dy", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "O Kalkul<75>toru", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Editace" {
MENUITEM "&Kop<6F>rovat Ctrl+C", IDM_COPY
MENUITEM "&Vlo<6C>it Ctrl+V", IDM_PASTE
}
POPUP "&Zobrazen<65>" {
MENUITEM "Standartn<74>", IDM_MODE_STANDARD
MENUITEM "V<>deck<63>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "<22>estn<74>ctkov<6F>\tF5", ID_CALC_NS_HEX
MENUITEM "Des<65>tkov<6F>\tF6", ID_CALC_NS_DEC
MENUITEM "Osmi<6D>kov<6F>\tF7", ID_CALC_NS_OCT
MENUITEM "Dvojkov<6F>\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Stupn<70>\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radi<64>ny\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grady\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Seskupov<6F>n<EFBFBD> <20><>slic", IDM_DIGIT_GROUPING
}
POPUP "&Pomoc" {
MENUITEM "T<>mata n<>pov<6F>dy", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "O Kalkul<75>toru", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Editace" {
MENUITEM "&Kop<6F>rovat Ctrl+C", IDM_COPY
MENUITEM "&Vlo<6C>it Ctrl+V", IDM_PASTE
}
POPUP "&Zobrazen<65>" {
MENUITEM "Standartn<74>", IDM_MODE_STANDARD
MENUITEM "V<>deck<63>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "<22>estn<74>ctkov<6F>\tF5", ID_CALC_NS_HEX
MENUITEM "Des<65>tkov<6F>\tF6", ID_CALC_NS_DEC
MENUITEM "Osmi<6D>kov<6F>\tF7", ID_CALC_NS_OCT
MENUITEM "Dvojkov<6F>\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Seskupov<6F>n<EFBFBD> <20><>slic", IDM_DIGIT_GROUPING
}
POPUP "&Pomoc" {
MENUITEM "T<>mata n<>pov<6F>dy", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "O Kalkul<75>toru", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "O GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "Co je toto?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (DE.rc)
*
* Copyright 2005 Rouven Wessling
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Rechner"
IDS_COPYRIGHT1, "Rechner 5.0. Lizenziert unter der LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "R<>cktaste"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Ung<6E>ltige Eingabe f<>r Funktion."
IDS_ERR_DIVIDE_BY_ZERO, "Teilen durch 0 unm<6E>glich."
IDS_ERR_UNDEFINED, "Das Ergebnis der Funktion ist undefiniert."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Bearbeiten" {
MENUITEM "&Kopieren Ctrl+C", IDM_COPY
MENUITEM "&Einf<6E>gen Ctrl+V", IDM_PASTE
}
POPUP "&Ansicht" {
MENUITEM "&Standard", IDM_MODE_STANDARD
MENUITEM "&Wissenschaftlich", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "&Zifferngruppierung", IDM_DIGIT_GROUPING
}
POPUP "&?" {
MENUITEM "&Hilfethemen", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "&Info", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Bearbeiten" {
MENUITEM "&Kopieren Ctrl+C", IDM_COPY
MENUITEM "&Einf<6E>gen Ctrl+V", IDM_PASTE
}
POPUP "&Anzeige" {
MENUITEM "&Standard", IDM_MODE_STANDARD
MENUITEM "&Wissenschaftlich", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "&Hex\tF5", ID_CALC_NS_HEX
MENUITEM "De&zimal\tF6", ID_CALC_NS_DEC
MENUITEM "O&ktal\tF7", ID_CALC_NS_OCT
MENUITEM "&Bin<69>r\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "&Deg\tF2", ID_CALC_MS_DEGREES
MENUITEM "&Rad\tF3", ID_CALC_MS_RADIANS
MENUITEM "&Grad\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Zifferngr&uppierung", IDM_DIGIT_GROUPING
}
POPUP "&?" {
MENUITEM "&Hilfethemen", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "&Info", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Bearbeiten" {
MENUITEM "&Kopieren Ctrl+C", IDM_COPY
MENUITEM "&Einf<6E>gen Ctrl+V", IDM_PASTE
}
POPUP "&Anzeige" {
MENUITEM "&Standard", IDM_MODE_STANDARD
MENUITEM "&Wissenschaftlich", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "&Hex\tF5", ID_CALC_NS_HEX
MENUITEM "De&zimal\tF6", ID_CALC_NS_DEC
MENUITEM "O&ktal\tF7", ID_CALC_NS_OCT
MENUITEM "&Bin<69>r\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "&Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dw&ord\tF2", ID_CALC_WS_DWORD
MENUITEM "Wo&rd\tF3", ID_CALC_WS_WORD
MENUITEM "&Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "&Zifferngruppierung", IDM_DIGIT_GROUPING
}
POPUP "&?" {
MENUITEM "&Hilfethemen", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "&Info", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "Info <20>ber GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "Was ist das?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistik Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,154 +0,0 @@
/*
* WineCalc (Gr.rc)
*
* Copyright 2006 Dj Apal
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_GREEK, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
IDS_COPYRIGHT1, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
IDS_ERR_DIVIDE_BY_ZERO, "<22><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
IDS_ERR_UNDEFINED, "<22><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+C", IDM_COPY
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+V", IDM_PASTE
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_STANDARD
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_DIGIT_GROUPING
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+C", IDM_COPY
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+V", IDM_PASTE
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_STANDARD
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF5", ID_CALC_NS_HEX
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF6", ID_CALC_NS_DEC
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF7", ID_CALC_NS_OCT
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF2", ID_CALC_MS_DEGREES
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_DIGIT_GROUPING
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+C", IDM_COPY
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+V", IDM_PASTE
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_STANDARD
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF5", ID_CALC_NS_HEX
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF6", ID_CALC_NS_DEC
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF7", ID_CALC_NS_OCT
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF2", ID_CALC_MS_DEGREES
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_DIGIT_GROUPING
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "<22><><EFBFBD><EFBFBD> <20><><EFBFBD> GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "<22><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>;", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (En.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Calculator"
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (Spanish resources)
*
* Copyright 2005 Patricio Mart<72>nez Ros
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Calculadora"
IDS_COPYRIGHT1, "Calculadora 5.0. bajo licencia LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Retroceso"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Entrada no v<>lida para la funci<63>n."
IDS_ERR_DIVIDE_BY_ZERO, "No se puede dividir entre cero."
IDS_ERR_UNDEFINED, "El resultado de esta funci<63>n no est<73> definido."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Editar" {
MENUITEM "&Copiar Ctrl+C", IDM_COPY
MENUITEM "&Pegar Ctrl+V", IDM_PASTE
}
POPUP "&Ver" {
MENUITEM "Est<73>ndar", IDM_MODE_STANDARD
MENUITEM "Cient<6E>fica", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Agrupaci<63>n de d<>gitos", IDM_DIGIT_GROUPING
}
POPUP "Ayuda" {
MENUITEM "Temas de Ayuda", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Acerca de Calculadora", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Editar" {
MENUITEM "&Copiar Ctrl+C", IDM_COPY
MENUITEM "&Pegar Ctrl+V", IDM_PASTE
}
POPUP "&Ver" {
MENUITEM "Est<73>ndar", IDM_MODE_STANDARD
MENUITEM "Cient<6E>fica", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hesadecimal\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binario\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Sexagesimal\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radi<64>n\tF3", ID_CALC_MS_RADIANS
MENUITEM "Centesimal\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Agrupaci<63>n de d<>gitos", IDM_DIGIT_GROUPING
}
POPUP "Ayuda" {
MENUITEM "Temas de Ayuda", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Acerca de Calculadora", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Editar" {
MENUITEM "&Copiar Ctrl+C", IDM_COPY
MENUITEM "&Pegar Ctrl+V", IDM_PASTE
}
POPUP "&Ver" {
MENUITEM "Est<73>ndar", IDM_MODE_STANDARD
MENUITEM "Cient<6E>fica", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hexadecimal\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binario\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Agrupaci<63>n de d<>gitos", IDM_DIGIT_GROUPING
}
POPUP "Ayuda" {
MENUITEM "Temas de Ayuda", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Acerca de Calculadora", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "Acerca de GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "Aceptar", IDOK, 42, 60, 29, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "<22>Qu<51> es esto?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Cuadro de estad<61>sticas"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "Cargar", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,157 +0,0 @@
/*
* WineCalc (Fr.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* Translation made by Jerome Signouret, 2005.
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Calculatrice"
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Effacer"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Entr<74>e incorrecte pour l'op<6F>ration."
IDS_ERR_DIVIDE_BY_ZERO, "Division par z<>ro impossble."
IDS_ERR_UNDEFINED, "R<>sultat non d<>fini."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edition" {
MENUITEM "Co&pier Ctrl+C", IDM_COPY
MENUITEM "C&oller Ctrl+V", IDM_PASTE
}
POPUP "&Affichage" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientifique", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "S<>parateur", IDM_DIGIT_GROUPING
}
POPUP "Ai&de" {
MENUITEM "Somaire", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "A propos", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edition" {
MENUITEM "Co&pier Ctrl+C", IDM_COPY
MENUITEM "C&oller Ctrl+V", IDM_PASTE
}
POPUP "&Affichage" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientifique", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binaire\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degr<67>s\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Gradians\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "S<>parateur", IDM_DIGIT_GROUPING
}
POPUP "Ai&de" {
MENUITEM "Sommaire", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "A propos", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "Co&pier Ctrl+C", IDM_COPY
MENUITEM "C&oller Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientifique", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binaire\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "S<>parateur", IDM_DIGIT_GROUPING
}
POPUP "Ai&de" {
MENUITEM "Sommaire", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "A propos", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "Qu'est-ce ?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "A propos de GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Outils Statistiques Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,156 +0,0 @@
/*
* WineCalc (Hu.rc)
*
* Copyright 2003 James Briggs
* Hungarian translation by Adam Medveczky
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Sz<53>mol<6F>g<EFBFBD>p"
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "gy<67>k"
IDS_ERR_INVALID_INPUT, "Hib<69>s bemenet."
IDS_ERR_DIVIDE_BY_ZERO, "Nem tudok null<6C>val osztani."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Szerkeszt<7A>s" {
MENUITEM "&M<>sol<6F>s Ctrl+C", IDM_COPY
MENUITEM "&Beilleszt<7A>s Ctrl+V", IDM_PASTE
}
POPUP "&N<>zet" {
MENUITEM "Alap", IDM_MODE_STANDARD
MENUITEM "Tudom<6F>nyos", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Sz<53>mjegyek csoportos<6F>t<EFBFBD>sa", IDM_DIGIT_GROUPING
}
POPUP "S<>&g<>" {
MENUITEM "&T<>mak<61>r<EFBFBD>k", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Sz<53>mol<6F>g<EFBFBD>p n<>vjegye", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Szerkeszt<7A>s" {
MENUITEM "&M<>sol<6F>s Ctrl+C", IDM_COPY
MENUITEM "&Beilleszt<7A>s Ctrl+V", IDM_PASTE
}
POPUP "&N<>zet" {
MENUITEM "Alap", IDM_MODE_STANDARD
MENUITEM "Tudom<6F>nyos", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hexadecim<69>lis\tF5", ID_CALC_NS_HEX
MENUITEM "Decim<69>lis\tF6", ID_CALC_NS_DEC
MENUITEM "Okt<6B>lis\tF7", ID_CALC_NS_OCT
MENUITEM "Bin<69>ris\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Fok\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radi<64>n\tF3", ID_CALC_MS_RADIANS
MENUITEM "<22>jfok\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Sz<53>mjegyek csoportos<6F>t<EFBFBD>sa", IDM_DIGIT_GROUPING
}
POPUP "S<>&g<>" {
MENUITEM "&T<>mak<61>r<EFBFBD>k", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Sz<53>mol<6F>g<EFBFBD>p n<>vjegye", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Szerkeszt<7A>s" {
MENUITEM "&M<>sol<6F>s Ctrl+C", IDM_COPY
MENUITEM "&Beilleszt<7A>s Ctrl+V", IDM_PASTE
}
POPUP "&N<>zet" {
MENUITEM "Alap", IDM_MODE_STANDARD
MENUITEM "Tudom<6F>nyos", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hexadecim<69>lis\tF5", ID_CALC_NS_HEX
MENUITEM "Decim<69>lis\tF6", ID_CALC_NS_DEC
MENUITEM "Okt<6B>lis\tF7", ID_CALC_NS_OCT
MENUITEM "Bin<69>ris\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "N<>gyszeres sz<73>\tF12", ID_CALC_WS_QWORD
MENUITEM "Duplasz<73>\tF2", ID_CALC_WS_DWORD
MENUITEM "Sz<53>\tF3", ID_CALC_WS_WORD
MENUITEM "B<>jt\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Sz<53>mjegyek csoportos<6F>t<EFBFBD>sa", IDM_DIGIT_GROUPING
}
POPUP "S<>&g<>" {
MENUITEM "&T<>mak<61>r<EFBFBD>k", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Sz<53>mol<6F>g<EFBFBD>p n<>vjegye", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "GNU winecalc (sz<73>mol<6F>g<EFBFBD>p) n<>vjegye"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "Mi ez?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statisztika"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (It.rc)
*
* Copyright 2006 Gabriel ilardi
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Calcolatrice"
IDS_COPYRIGHT1, "Calcolatrice 5.0. sotto licenza LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Input invalido per la funzione."
IDS_ERR_DIVIDE_BY_ZERO, "Non si pu<70> dividere per zero."
IDS_ERR_UNDEFINED, "Il risultato della funzione <20> indefinito."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Modifica" {
MENUITEM "&Copia Ctrl+C", IDM_COPY
MENUITEM "I&ncolla Ctrl+V", IDM_PASTE
}
POPUP "&Visualizza" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientifica", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Raggruppamento cifre", IDM_DIGIT_GROUPING
}
POPUP "&?" {
MENUITEM "Guida in linea", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Informazioni su Calcolatrice", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Modifica" {
MENUITEM "&Copia Ctrl+C", IDM_COPY
MENUITEM "I&ncolla Ctrl+V", IDM_PASTE
}
POPUP "&Visualizza" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientifica", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Dec\tF6", ID_CALC_NS_DEC
MENUITEM "Oct\tF7", ID_CALC_NS_OCT
MENUITEM "Bin\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Gradi\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radianti\tF3", ID_CALC_MS_RADIANS
MENUITEM "Gradienti\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Raggruppamento cifre", IDM_DIGIT_GROUPING
}
POPUP "&?" {
MENUITEM "Guida in linea", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Informazioni su calcolatrice", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Modifica" {
MENUITEM "&Copia Ctrl+C", IDM_COPY
MENUITEM "I&ncolla Ctrl+V", IDM_PASTE
}
POPUP "&Visualizza" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientifica", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Dec\tF6", ID_CALC_NS_DEC
MENUITEM "Oct\tF7", ID_CALC_NS_OCT
MENUITEM "Bin\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Raggruppamento cifre", IDM_DIGIT_GROUPING
}
POPUP "&?" {
MENUITEM "Guida in linea", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Informazioni su calcolatrice", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "Informazioni su GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistiche"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,202 +0,0 @@
/*
* WineCalc (Ja.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Japanese resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
#ifdef _WIN32
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
//#pragma code_page(932)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
MAIN_MENU MENU
BEGIN
POPUP "<22>ҏW(&E)"
BEGIN
MENUITEM "<22>R<EFBFBD>s<EFBFBD>[(&C) Ctrl+C", IDM_COPY
MENUITEM "<22>\\<5C><><EFBFBD>t<EFBFBD><74>(&P) Ctrl+V", IDM_PASTE
END
POPUP "<22>\\<5C><>(&V)"
BEGIN
MENUITEM "<22><><EFBFBD>ʂ̓d<CC93><64>", IDM_MODE_STANDARD
MENUITEM "<22>֐<EFBFBD><D690>d<EFBFBD><64>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>؂<EFBFBD>", IDM_DIGIT_GROUPING
END
POPUP "<22>w<EFBFBD><77><EFBFBD>v(&H)"
BEGIN
MENUITEM "<22>g<EFBFBD>s<EFBFBD>b<EFBFBD>N<EFBFBD>̌<EFBFBD><CC8C><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22>d<EFBFBD><64><EFBFBD>ɂ‚<C982><C282><EFBFBD>", IDM_ABOUT
END
END
SCIMS_MENU MENU
BEGIN
POPUP "<22>ҏW(&E)"
BEGIN
MENUITEM "<22>R<EFBFBD>s<EFBFBD>[(&C) Ctrl+C", IDM_COPY
MENUITEM "<22>\\<5C><><EFBFBD>t<EFBFBD><74>(&P) Ctrl+V", IDM_PASTE
END
POPUP "<22>\\<5C><>(&V)"
BEGIN
MENUITEM "<22><><EFBFBD>ʂ̓d<CC93><64>", IDM_MODE_STANDARD
MENUITEM "<22>֐<EFBFBD><D690>d<EFBFBD><64>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "16 <20>i\tF5", ID_CALC_NS_HEX
MENUITEM "10 <20>i\tF6", ID_CALC_NS_DEC
MENUITEM "8 <20>i\tF7", ID_CALC_NS_OCT
MENUITEM "2 <20>i\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degree\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radian\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grad\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>؂<EFBFBD>", IDM_DIGIT_GROUPING
END
POPUP "<22>w<EFBFBD><77><EFBFBD>v(&H)"
BEGIN
MENUITEM "<22>g<EFBFBD>s<EFBFBD>b<EFBFBD>N<EFBFBD>̌<EFBFBD><CC8C><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22>d<EFBFBD><64><EFBFBD>ɂ‚<C982><C282><EFBFBD>", IDM_ABOUT
END
END
SCIWS_MENU MENU
BEGIN
POPUP "<22>ҏW(&E)"
BEGIN
MENUITEM "<22>R<EFBFBD>s<EFBFBD>[(&C) Ctrl+C", IDM_COPY
MENUITEM "<22>\\<5C><><EFBFBD>t<EFBFBD><74>(&P) Ctrl+V", IDM_PASTE
END
POPUP "<22>\\<5C><>(&V)"
BEGIN
MENUITEM "<22><><EFBFBD>ʂ̓d<CC93><64>", IDM_MODE_STANDARD
MENUITEM "<22>֐<EFBFBD><D690>d<EFBFBD><64>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "16 <20>i\tF5", ID_CALC_NS_HEX
MENUITEM "10 <20>i\tF6", ID_CALC_NS_DEC
MENUITEM "8 <20>i\tF7", ID_CALC_NS_OCT
MENUITEM "2 <20>i\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>؂<EFBFBD>", IDM_DIGIT_GROUPING
END
POPUP "<22>w<EFBFBD><77><EFBFBD>v(&H)"
BEGIN
MENUITEM "<22>g<EFBFBD>s<EFBFBD>b<EFBFBD>N<EFBFBD>̌<EFBFBD><CC8C><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22>d<EFBFBD><64><EFBFBD>ɂ‚<C982><C282><EFBFBD>", IDM_ABOUT
END
END
WHATS_THIS_MENU MENU
BEGIN
POPUP ""
BEGIN
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD>͉<EFBFBD><CD89>H", IDM_WHATS_THIS
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
DLG_ABOUT DIALOG 12, 0, 120, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "GNU winecalc <20>ɂ‚<C982><C282><EFBFBD>"
BEGIN
DEFPUSHBUTTON "OK",IDOK,42,60,30,14
END
DLG_STATS DIALOG 12, 0, 125, 78
STYLE DS_SETFONT | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "<22><><EFBFBD>v<EFBFBD>{<7B>b<EFBFBD>N<EFBFBD>X"
FONT 9, "Tahoma"
BEGIN
DEFPUSHBUTTON "<22>߂<EFBFBD>(&R)",ID_STATS_RET,4,52,25,13,WS_GROUP
PUSHBUTTON "<22><><EFBFBD>[<5B>h(&L)",ID_STATS_LOAD,34,52,25,13,WS_GROUP
PUSHBUTTON "<22>N<EFBFBD><4E><EFBFBD>A(&C)",ID_STATS_CD,64,52,25,13,WS_GROUP
PUSHBUTTON "<22><><EFBFBD>ׂăN<C483><4E><EFBFBD>A(&A)",ID_STATS_CAD,94,52,25,13,WS_GROUP
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_APPNAME "<22>d<EFBFBD><64>"
IDS_BTN_BACKSPACE "Back"
IDS_BTN_CLEAR_ENTRY "CE"
IDS_BTN_CLEAR_ALL "C"
IDS_ERR_INVALID_INPUT "<22><><EFBFBD><EFBFBD><EFBFBD>Ȓl<C892>ł<EFBFBD><C582>B"
IDS_ERR_DIVIDE_BY_ZERO "0 <20>Ŋ<EFBFBD><C58A><EFBFBD>Ƃ͂ł<CD82><C582>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B"
IDS_ERR_UNDEFINED "<22>֐<EFBFBD><D690>̌<EFBFBD><CC8C>ʂ<EFBFBD><CA82><EFBFBD><EFBFBD>`<60><><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B"
IDS_COPYRIGHT1 "<22>d<EFBFBD><64> 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_MEM_CLEAR "MC"
IDS_BTN_MEM_RECALL "MR"
IDS_BTN_MEM_STORE "MS"
IDS_BTN_MEM_PLUS "+"
IDS_BTN_MEM_STATUS_M "M"
IDS_BTN_SQRT "<22><>"
END
#endif // Japanese resources
/////////////////////////////////////////////////////////////////////////////

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (En.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Kalkulator"
IDS_COPYRIGHT1, "Kalkulator 5.0. Lisensert under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Tilbake"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Ugyldig informasjon for funksjon."
IDS_ERR_DIVIDE_BY_ZERO, "Kan ikke dividere p<> null."
IDS_ERR_UNDEFINED, "Resultatet av funksjoner er ubestemt."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Rediger" {
MENUITEM "&Kopier Ctrl+C", IDM_COPY
MENUITEM "&Lim inn Ctrl+V", IDM_PASTE
}
POPUP "&Vis" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Vitenskapelig", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Siffergruppering", IDM_DIGIT_GROUPING
}
POPUP "&Hjelp" {
MENUITEM "Emner i hjelp", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Om kalkulator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Rediger" {
MENUITEM "&Kopiere Ctrl+C", IDM_COPY
MENUITEM "&Lim inn Ctrl+V", IDM_PASTE
}
POPUP "&Vis" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Vitenskapelig", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Heksadesimalt\tF5", ID_CALC_NS_HEX
MENUITEM "Desimalt\tF6", ID_CALC_NS_DEC
MENUITEM "Oktalt\tF7", ID_CALC_NS_OCT
MENUITEM "Bin<69>rt\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Grader\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radianer\tF3", ID_CALC_MS_RADIANS
MENUITEM "Gradienter\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Siffergruppering", IDM_DIGIT_GROUPING
}
POPUP "&Hjelp" {
MENUITEM "Emner i hjelp", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Om Kalkulator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Rediger" {
MENUITEM "&Kopier Ctrl+C", IDM_COPY
MENUITEM "&Lim inn Ctrl+V", IDM_PASTE
}
POPUP "&Vis" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Vitenskapelig", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Heksadesimalt\tF5", ID_CALC_NS_HEX
MENUITEM "Desimal\tF6", ID_CALC_NS_DEC
MENUITEM "Oktalt\tF7", ID_CALC_NS_OCT
MENUITEM "Bin<69>rt\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Siffergruppering", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Emner i hjelp", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Om Kalkulator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "Om GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "Hva er dette?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (Nl.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_DUTCH, SUBLANG_DUTCH //vertaald door Lionel Lowie
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Rekenmachine"
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Ongeldige invoer voor de functie."
IDS_ERR_DIVIDE_BY_ZERO, "Kan niet delen door nul."
IDS_ERR_UNDEFINED, "Resultaat van de functie is onbepaald."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Bewerken" {
MENUITEM "&Kopi<70>ren Ctrl+C", IDM_COPY
MENUITEM "&Plakken Ctrl+V", IDM_PASTE
}
POPUP "&Beeld" {
MENUITEM "Standaard", IDM_MODE_STANDARD
MENUITEM "Wetenschappelijk", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Cijfergroepering", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help-onderwerpen", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Info", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Bewerken" {
MENUITEM "&Kopi<70>ren Ctrl+C", IDM_COPY
MENUITEM "&Plakken Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standaard", IDM_MODE_STANDARD
MENUITEM "Wetenschappelijk", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimaal\tF6", ID_CALC_NS_DEC
MENUITEM "Octaal\tF7", ID_CALC_NS_OCT
MENUITEM "Binair\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Graden\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radialen\tF3", ID_CALC_MS_RADIANS
MENUITEM "Gradi<64>nten\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Cijfergroepering", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help-onderwerpen", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Info", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Bewerken" {
MENUITEM "&Kopi<70>ren Ctrl+C", IDM_COPY
MENUITEM "&Plakken Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standaard", IDM_MODE_STANDARD
MENUITEM "Wetenschappelijk", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimaal\tF6", ID_CALC_NS_DEC
MENUITEM "Octaal\tF7", ID_CALC_NS_OCT
MENUITEM "Binair\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Cijfergroepering", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help-onderwerpen", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Info", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "Wat is dit?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "Over GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (Pt.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Calculator"
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (Ru.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Calculator"
IDS_COPYRIGHT1, "Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (En.rc)
*
* Copyright 2005 David Nordenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_SWEDISH, SUBLANG_SWEDISH
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "Kalkylatorn"
IDS_COPYRIGHT1, "Kalkylatorn 5.0. Licenserad under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backsteg"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Felaktig indata f<>r funktion."
IDS_ERR_DIVIDE_BY_ZERO, "Kan inte dividera med noll."
IDS_ERR_UNDEFINED, "Funktionens resultat <20>r odefinerat."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Redigera" {
MENUITEM "&Kopiera\tCtrl+C", IDM_COPY
MENUITEM "K&listra in\tCtrl+V", IDM_PASTE
}
POPUP "&Visa" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Vetenskaplig", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Siffergruppering", IDM_DIGIT_GROUPING
}
POPUP "&Hj<48>lp" {
MENUITEM "Hj<48>lpavsnitt", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Om Kalkylatorn", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Redigera" {
MENUITEM "&Kopiera\tCtrl+C", IDM_COPY
MENUITEM "K&listra in\tCtrl+V", IDM_PASTE
}
POPUP "&Visa" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Vetenskaplig", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Oktal\tF7", ID_CALC_NS_OCT
MENUITEM "Bin<69>r\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Grader\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radianer\tF3", ID_CALC_MS_RADIANS
MENUITEM "Gradienter\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Siffergruppering", IDM_DIGIT_GROUPING
}
POPUP "&Hj<48>lp" {
MENUITEM "Hj<48>lpavsnitt", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Om Kalkylatorn", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Redigera" {
MENUITEM "&Kopiera\tCtrl+C", IDM_COPY
MENUITEM "K&listra in\tCtrl+V", IDM_PASTE
}
POPUP "&Visa" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Vetenskaplig", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Oktal\tF7", ID_CALC_NS_OCT
MENUITEM "Bin<69>r\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Siffergruppering", IDM_DIGIT_GROUPING
}
POPUP "&Hj<48>lp" {
MENUITEM "Hj<48>lpavsnitt", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "Om Kalkylatorn", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "Om GNU Kalkylatorn (winecalc)"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "Vad <20>r det h<>r?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistikruta"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,155 +0,0 @@
/*
* WineCalc (Uk.rc)
*
* Copyright 2006 Artem Reznikov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
IDS_COPYRIGHT1, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5.0. ˳<><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "<22><><EFBFBD>-<2D><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
IDS_ERR_DIVIDE_BY_ZERO, "ij<><C4B3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>."
IDS_ERR_UNDEFINED, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+C", IDM_COPY
MENUITEM "<22><><EFBFBD>&<26><><EFBFBD><EFBFBD><EFBFBD> Ctrl+V", IDM_PASTE
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_STANDARD
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "ʳ<><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>", IDM_DIGIT_GROUPING
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+C", IDM_COPY
MENUITEM "<22><><EFBFBD>&<26><><EFBFBD><EFBFBD><EFBFBD> Ctrl+V", IDM_PASTE
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_STANDARD
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "س<><D8B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Hex)\tF5", ID_CALC_NS_HEX
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Dec)\tF6", ID_CALC_NS_DEC
MENUITEM "³<><C2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Oct)\tF7", ID_CALC_NS_OCT
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Bin)\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF2", ID_CALC_MS_DEGREES
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\tF3", ID_CALC_MS_RADIANS
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD>\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "ʳ<><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>", IDM_DIGIT_GROUPING
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+C", IDM_COPY
MENUITEM "<22><><EFBFBD>&<26><><EFBFBD><EFBFBD><EFBFBD> Ctrl+V", IDM_PASTE
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_STANDARD
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "س<><D8B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Hex)\tF5", ID_CALC_NS_HEX
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Dec)\tF6", ID_CALC_NS_DEC
MENUITEM "³<><C2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Oct)\tF7", ID_CALC_NS_OCT
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Bin)\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "ʳ<><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>", IDM_DIGIT_GROUPING
}
POPUP "&<26><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" {
MENUITEM "<22><><EFBFBD><EFBFBD><EFBFBD>", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "<22><><EFBFBD> GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "<22><> <20><>?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View File

@@ -1,70 +0,0 @@
/*
* WineCalc (resource.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* menus */
#define IDM_COPY 1001
#define IDM_PASTE 1002
#define IDM_MODE_STANDARD 1003
#define IDM_MODE_SCIENTIFIC 1004
#define IDM_DIGIT_GROUPING 1005
#define IDM_HELP_TOPICS 1006
#define IDM_ABOUT 1007
#define IDM_SEPARATOR1 1008
#define IDM_SEPARATOR2 1009
#define IDM_SEPARATOR3 1010
#define IDM_WHATS_THIS 1011
#define IDI_CALCICON 1050
/* strings */
#define IDS_APPNAME 1100
#define IDS_BTN_BACKSPACE 1101
#define IDS_BTN_CLEAR_ENTRY 1102
#define IDS_BTN_CLEAR_ALL 1103
#define IDS_BTN_MEM_CLEAR 1104
#define IDS_BTN_MEM_RECALL 1105
#define IDS_BTN_MEM_STORE 1106
#define IDS_BTN_MEM_PLUS 1107
#define IDS_BTN_MEM_STATUS_M 1108
#define IDS_BTN_SQRT 1109
#define IDS_ERR_INVALID_INPUT 1120
#define IDS_ERR_DIVIDE_BY_ZERO 1121
#define IDS_ERR_UNDEFINED 1122
#define IDS_COPYRIGHT1 1130
#define IDS_COPYRIGHT2 1131
#define IDS_COPYRIGHT3 1132
#define IDS_COPYRIGHT4 1133
#define IDS_COPYRIGHT5 1134
/* keys */
#define IDV_HELP 103
/* stats dialog */
#define ID_STATS_RET 3000
#define ID_STATS_LOAD 3001
#define ID_STATS_CD 3002
#define ID_STATS_CAD 3003

View File

@@ -1,42 +0,0 @@
/*
* WineCalc (rsrc.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include "resource.h"
IDI_CALCICON ICON "calculator.ico"
#include "lang/en-US.rc"
#include "lang/cz-CZ.rc"
#include "lang/de-DE.rc"
#include "lang/es-ES.rc"
#include "lang/fr-FR.rc"
#include "lang/it-IT.rc"
#include "lang/ja-JP.rc"
#include "lang/nl-NL.rc"
#include "lang/pt-PT.rc"
#include "lang/ru-RU.rc"
#include "lang/sv-SE.rc"
#include "lang/hu-HU.rc"
#include "lang/uk-UA.rc"
#include "lang/el-GR.rc"
#include "lang/nb-NO.rc"
LANGUAGE LANG_NEUTRAL,SUBLANG_NEUTRAL

View File

@@ -1,132 +0,0 @@
/*
* WineCalc (stats.c)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h> // sprintf
#include <windows.h>
#include <tchar.h>
#include "stats.h"
#include "resource.h"
#include "winecalc.h"
HWND hWndListBox;
extern CALC calc;
extern HWND hWndDlgStats;
BOOL CALLBACK StatsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
HDC hdc;
PAINTSTRUCT ps;
switch( uMsg ) {
case WM_INITDIALOG:
hWndListBox = CreateWindow(
TEXT("LISTBOX"), // pointer to registered class name
TEXT("Listbox"), // pointer to window name
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LBS_NOINTEGRALHEIGHT, // window style
6, // horizontal position of window
6, // vertical position of window
208, // window width
66, // window height
hDlg, // handle to parent or owner window
NULL, // handle to menu or child-window identifier
NULL, // handle to application instance
NULL // pointer to window-creation data
);
ShowWindow(hWndListBox, SW_SHOW);
SendMessage (hWndListBox, WM_SETFONT, (UINT)GetStockObject(DEFAULT_GUI_FONT), TRUE);
// SetFocus(hWndDlgStats);
return TRUE;
case WM_COMMAND:
switch( LOWORD( wParam ) ) {
case ID_STATS_RET:
SetFocus(GetParent(hDlg));
return 0;
case ID_STATS_LOAD:
{
INT i;
i = (INT) SendMessage(hWndListBox, LB_GETCURSEL, 0, 0);
SendMessage(hWndListBox, LB_GETTEXT, i, (LPARAM)calc.buffer);
calc_buffer_display(&calc);
}
return 0;
case ID_STATS_CD:
{
INT i;
i = (INT) SendMessage(hWndListBox, LB_GETCURSEL, 0, 0);
SendMessage(hWndListBox, LB_DELETESTRING, i, 0);
InvalidateRect(hDlg,NULL,TRUE);
UpdateWindow(hDlg);
}
return 0;
case ID_STATS_CAD:
SendMessage(hWndListBox, LB_RESETCONTENT, 0, 0);
InvalidateRect(hDlg,NULL,TRUE);
UpdateWindow(hDlg);
return 0;
}
break;
case WM_PAINT:
{
TCHAR s[CALC_BUF_SIZE];
int lb_count;
HFONT hFont;
HFONT hFontOrg;
hdc = BeginPaint( hDlg, &ps );
hFont = GetStockObject(DEFAULT_GUI_FONT);
hFontOrg = SelectObject(hdc, hFont);
lb_count = SendMessage(hWndListBox, LB_GETCOUNT, 0, 0);
_stprintf(s, TEXT("n=%d"), lb_count);
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, 98, 121, s, _tcslen(s));
SelectObject(hdc, hFontOrg);
EndPaint( hDlg, &ps );
return 0;
}
case WM_CLOSE:
hWndDlgStats = 0; // invalidate stats dialog
SendMessage(GetParent(hDlg), WM_CHAR, TEXT('\x13'), 1); // disable stats related calculator buttons
DestroyWindow( hDlg );
return 0;
}
return FALSE;
}

View File

@@ -1,24 +0,0 @@
/*
* WineCalc (stats.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
BOOL CALLBACK StatsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );

File diff suppressed because it is too large Load Diff

View File

@@ -1,365 +0,0 @@
/*
* WineCalc (winecalc.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//////////////////////////////////////////////////////////////////
// numerics are defined here for easier porting
typedef double calcfloat;
#define FMT_DESC_FLOAT TEXT("%g")
#define FMT_DESC_EXP TEXT("%e")
#define CALC_ATOF(x) atof(x)
#define CONST_PI 3.1415926535897932384626433832795
/////////////////////////////////////////////////////////////////
#define CALC_BUF_SIZE 128
// statistics dialog dimensions
#define CALC_STA_X 235
#define CALC_STA_Y 180
// sentinel for differentiating Return from Ctrl+M events
#define NUMBER_OF_THE_BEAST 666
#define CALC_COLOR_BLUE 0
#define CALC_COLOR_RED 1
#define CALC_COLOR_GRAY 2
#define CALC_COLOR_MAGENTA 3
// gray hilite on rectangle owner-drawn controls RGB(CALC_GRAY, CALC_GRAY, CALC_GRAY)
#define CALC_GRAY 132
// count of buttons needing special toggle states depending on number base
#define TOGGLE_COUNT 23
// there are 3 window menus, standard, decimal measurement system and word size menus
#define COUNT_MENUS 3
#define MENU_STD 0
#define MENU_SCIMS 1
#define MENU_SCIWS 2
// count of buttons
#define CALC_BUTTONS_STANDARD 28
#define CALC_BUTTONS_SCIENTIFIC 73
// winecalc window outer dimensions
#define CALC_STANDARD_WIDTH 260
#define CALC_STANDARD_HEIGHT 252
#define CALC_SCIENTIFIC_WIDTH 480
#define CALC_SCIENTIFIC_HEIGHT 310
// winecalc private ids for events
#define ID_CALC_ZERO 0
#define ID_CALC_ONE 1
#define ID_CALC_TWO 2
#define ID_CALC_THREE 3
#define ID_CALC_FOUR 4
#define ID_CALC_FIVE 5
#define ID_CALC_SIX 6
#define ID_CALC_SEVEN 7
#define ID_CALC_EIGHT 8
#define ID_CALC_NINE 9
#define ID_CALC_BACKSPACE 20
#define ID_CALC_CLEAR_ENTRY 21
#define ID_CALC_CLEAR_ALL 22
#define ID_CALC_MEM_CLEAR 23
#define ID_CALC_DIVIDE 24
#define ID_CALC_SQRT 25
#define ID_CALC_MEM_RECALL 26
#define ID_CALC_MULTIPLY 27
#define ID_CALC_PERCENT 28
#define ID_CALC_MEM_STORE 29
#define ID_CALC_MINUS 30
#define ID_CALC_RECIPROCAL 31
#define ID_CALC_MEM_PLUS 32
#define ID_CALC_SIGN 33
#define ID_CALC_DECIMAL 34
#define ID_CALC_PLUS 35
#define ID_CALC_EQUALS 36
#define ID_CALC_STA 37
#define ID_CALC_FE 38
#define ID_CALC_LEFTPAREN 39
#define ID_CALC_RIGHTPAREN 40
#define ID_CALC_MOD 41
#define ID_CALC_AND 42
#define ID_CALC_OR 43
#define ID_CALC_XOR 44
#define ID_CALC_SUM 45
#define ID_CALC_SIN 46
#define ID_CALC_LOG10 47
#define ID_CALC_LSH 48
#define ID_CALC_NOT 49
#define ID_CALC_S 50
#define ID_CALC_COS 52
#define ID_CALC_FACTORIAL 53
#define ID_CALC_INT 54
#define ID_CALC_DAT 55
#define ID_CALC_TAN 56
#define ID_CALC_SQUARE 57
#define ID_CALC_A 58
#define ID_CALC_B 59
#define ID_CALC_C 60
#define ID_CALC_D 61
#define ID_CALC_E 62
#define ID_CALC_F 63
#define ID_CALC_AVE 64
#define ID_CALC_DMS 65
#define ID_CALC_EXP 66
#define ID_CALC_LN 67
#define ID_CALC_PI 68
#define ID_CALC_CUBE 69
#define ID_CALC_POWER 51
// Number System Radio Buttons
#define CALC_NS_COUNT 4
#define ID_CALC_NS_HEX 2000
#define ID_CALC_NS_DEC 2001
#define ID_CALC_NS_OCT 2002
#define ID_CALC_NS_BIN 2003
#define NBASE_DECIMAL 0
#define NBASE_BINARY 1
#define NBASE_OCTAL 2
#define NBASE_HEX 3
#define CALC_NS_OFFSET_X 15
#define CALC_NS_OFFSET_Y 37
#define SZ_RADIO_NS_X 50
#define SZ_RADIO_NS_Y 15
#define CALC_NS_HEX_LEFT 0
#define CALC_NS_HEX_TOP 0
#define CALC_NS_DEC_LEFT 50
#define CALC_NS_DEC_TOP 0
#define CALC_NS_OCT_LEFT 98
#define CALC_NS_OCT_TOP 0
#define CALC_NS_BIN_LEFT 148
#define CALC_NS_BIN_TOP 0
// Measurement System Radio Buttons
#define CALC_MS_COUNT 3
#define ID_CALC_MS_DEGREES 2010
#define ID_CALC_MS_RADIANS 2011
#define ID_CALC_MS_GRADS 2012
#define TRIGMODE_DEGREES 0
#define TRIGMODE_RADIANS 1
#define TRIGMODE_GRADS 2
#define CALC_MS_OFFSET_X 225
#define CALC_MS_OFFSET_Y 37
#define SZ_RADIO_MS_X 75
#define SZ_RADIO_MS_Y 15
#define CALC_MS_DEGREES_LEFT 0
#define CALC_MS_DEGREES_TOP 0
#define CALC_MS_RADIANS_LEFT 82
#define CALC_MS_RADIANS_TOP 0
#define CALC_MS_GRADS_LEFT 162
#define CALC_MS_GRADS_TOP 0
// Inv and Hyp Checkboxes
#define CALC_CB_COUNT 2
#define ID_CALC_CB_INV 2020
#define ID_CALC_CB_HYP 2021
#define WORDSIZE_BYTE 1
#define WORDSIZE_WORD 2
#define WORDSIZE_DWORD 4
#define WORDSIZE_QWORD 8
#define CALC_CB_OFFSET_X 15
#define CALC_CB_OFFSET_Y 58
#define CALC_CB_INV_LEFT 0
#define CALC_CB_INV_TOP 10
#define SZ_RADIO_CB_X 50
#define SZ_RADIO_CB_Y 14
#define CALC_CB_HYP_LEFT 58
#define CALC_CB_HYP_TOP 10
// Word Size Radio Buttons
#define CALC_WS_COUNT 4
#define ID_CALC_WS_QWORD 2030
#define ID_CALC_WS_DWORD 2031
#define ID_CALC_WS_WORD 2032
#define ID_CALC_WS_BYTE 2033
#define CALC_WS_OFFSET_X CALC_MS_OFFSET_X
#define CALC_WS_OFFSET_Y CALC_MS_OFFSET_Y
#define CALC_WS_QWORD_LEFT 0
#define CALC_WS_QWORD_TOP 0
#define CALC_WS_DWORD_LEFT 57
#define CALC_WS_DWORD_TOP 0
#define CALC_WS_WORD_LEFT 120
#define CALC_WS_WORD_TOP 0
#define CALC_WS_BYTE_LEFT 175
#define CALC_WS_BYTE_TOP 0
#define SZ_RADIO_WS_X 50
#define SZ_RADIO_WS_Y 15
// drawing offsets
#define CALC_EDIT_HEIGHT 20
#define SZ_FILLER_X 32
#define SZ_FILLER_Y 30
#define SZ_BIGBTN_X 62
#define SZ_BIGBTN_Y 30
#define SZ_MEDBTN_X 36
#define SZ_MEDBTN_Y 30
#define MARGIN_LEFT 7
#define MARGIN_SMALL_X 3
#define MARGIN_SMALL_Y 3
#define MARGIN_BIG_X 274
#define MARGIN_STANDARD_BIG_X 11
#define MARGIN_BIG_Y 6
#define SZ_SPACER_X 11
// winecalc results display area
#define WDISPLAY_STANDARD_LEFT MARGIN_LEFT + 4
#define WDISPLAY_STANDARD_TOP 5
#define WDISPLAY_STANDARD_RIGHT 244
#define WDISPLAY_STANDARD_BOTTOM 24
#define CALC_STANDARD_MARGIN_TOP 16
#define WDISPLAY_SCIENTIFIC_LEFT MARGIN_LEFT + 4
#define WDISPLAY_SCIENTIFIC_TOP 5
#define WDISPLAY_SCIENTIFIC_RIGHT 465
#define WDISPLAY_SCIENTIFIC_BOTTOM 24
#define CALC_SCIENTIFIC_MARGIN_TOP 44
typedef struct tagCalcBtn {
int id; // private id
HWND hBtn; // button child window handle
TCHAR label[80]; // text on buttonface
int color; // text color
RECT r; // location
int enable; // 1 = control enbabled, 0 = disabled
}
CALCBTN;
typedef struct tagPos {
int x;
int y;
}
POS;
typedef struct tagCalc {
HINSTANCE hInst; // this HINSTANCE
HWND hWnd; // main window's HWND
POS pos;
int numButtons; // standard = 28, scientific = more
TCHAR buffer [CALC_BUF_SIZE]; // current keyboard buffer
TCHAR display[CALC_BUF_SIZE]; // display buffer before output
calcfloat value; // most recent computer value
calcfloat memory; // most recent stored memory value from display buffer
int paren; // current parentheses level
int sciMode; // standard = 1, scientific = 0
int displayMode; // 0 = float, 1 = scientific exponential notation like 1.0e+10
TCHAR oper; // most recent operator pushed
calcfloat operand; // most recent operand pushed
int newenter; // track multiple =
int next; // binary operation flag
int err; // errror status for divide by zero, infinity, etc.
int init; // starting buffer
int digitGrouping; // no separators = 0, separators = 1
int trigMode; // degrees = 0, radians = 1, grads = 2
int numBase; // 10 = decimal, 2 = binary, 8 = octal, 16 = hex
int wordSize; // 1 = byte, 2 = word, 4 = dword, 8 = qword
int invMode; // INV mode 0 = off, 1 = on
int hypMode; // HYP mode 0 = off, 1 = on
int new; // first time 0 = false, 1 = true
CALCBTN cb[80]; // enough buttons for standard or scientific mode
}
CALC;
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitLuts(void);
void InitMenus(HINSTANCE hInst);
void DestroyMenus();
void InitCalc (CALC *calc);
void DestroyCalc (CALC *calc);
void calc_buffer_format(CALC *calc);
void calc_buffer_display(CALC *calc);
TCHAR *calc_sep(TCHAR *s);
void DrawCalcText (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, int object, TCHAR *s);
void CalcRect (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, int object);
void DrawCalcRectSci(HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, RECT *r);
void DrawCalc (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc);
void calc_setmenuitem_radio(HMENU hMenu, UINT id);
void show_debug(CALC *calc, TCHAR *title, long wParam, long lParam);
calcfloat calc_atof(const TCHAR *s, int base);
void calc_ftoa(CALC *calc, calcfloat r, TCHAR *buf);
long factorial(long n);
calcfloat calc_convert_to_radians(CALC *calc);
calcfloat calc_convert_from_radians(CALC *calc);

View File

@@ -1,8 +0,0 @@
<group>
<directory name="find">
<xi:include href="find/find.rbuild" />
</directory>
<directory name="more">
<xi:include href="more/more.rbuild" />
</directory>
</group>

View File

@@ -1,248 +0,0 @@
/* find.c */
/* Copyright (C) 1994-2002, Jim Hall <jhall@freedos.org> */
/* Adapted for ReactOS */
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* This program locates a string in a text file and prints those lines
* that contain the string. Multiple files are clearly separated.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <io.h>
#include <dos.h>
/* Symbol definition */
#define MAX_STR 1024
/* This function prints out all lines containing a substring. There are some
* conditions that may be passed to the function.
*
* RETURN: If the string was found at least once, returns 1.
* If the string was not found at all, returns 0.
*/
int
find_str (char *sz, FILE *p, int invert_search,
int count_lines, int number_output, int ignore_case)
{
int i, length;
long line_number = 0, total_lines = 0;
char *c, temp_str[MAX_STR], this_line[MAX_STR];
/* Convert to upper if needed */
if (ignore_case)
{
length = strlen (sz);
for (i = 0; i < length; i++)
sz[i] = toupper (sz[i]);
}
/* Scan the file until EOF */
while (fgets (temp_str, MAX_STR, p) != NULL)
{
/* Remove the trailing newline */
length = strlen (temp_str);
if (temp_str[length-1] == '\n')
{
temp_str[length-1] = '\0';
}
/* Increment number of lines */
line_number++;
strcpy (this_line, temp_str);
/* Convert to upper if needed */
if (ignore_case)
{
for (i = 0; i < length; i++)
{
temp_str[i] = toupper (temp_str[i]);
}
}
/* Locate the substring */
/* strstr() returns a pointer to the first occurrence in the
string of the substring */
c = strstr (temp_str, sz);
if ( ((invert_search) ? (c == NULL) : (c != NULL)) )
{
if (!count_lines)
{
if (number_output)
printf ("%ld:", line_number);
/* Print the line of text */
puts (this_line);
}
total_lines++;
} /* long if */
} /* while fgets */
if (count_lines)
{
/* Just show num. lines that contain the string */
printf ("%ld\n", total_lines);
}
/* RETURN: If the string was found at least once, returns 1.
* If the string was not found at all, returns 0.
*/
return (total_lines > 0 ? 1 : 0);
}
/* Show usage */
void
usage (void)
{
fprintf (stderr, "FIND: Prints all lines of a file that contain a string\n");
fprintf (stderr, "FIND [ /C ] [ /I ] [ /N ] [ /V ] \"string\" [ file... ]\n");
fprintf (stderr, " /C Count the number of lines that contain string\n");
fprintf (stderr, " /I Ignore case\n");
fprintf (stderr, " /N Number the displayed lines, starting at 1\n");
fprintf (stderr, " /V Print lines that do not contain the string\n");
}
/* Main program */
int
main (int argc, char **argv)
{
char *opt, *needle = NULL;
int ret = 0;
int invert_search = 0; /* flag to invert the search */
int count_lines = 0; /* flag to whether/not count lines */
int number_output = 0; /* flag to print line numbers */
int ignore_case = 0; /* flag to be case insensitive */
FILE *pfile; /* file pointer */
int hfind; /* search handle */
struct _finddata_t finddata; /* _findfirst, filenext block */
/* Scan the command line */
while ((--argc) && (needle == NULL))
{
if (*(opt = *++argv) == '/')
{
switch (opt[1])
{
case 'c':
case 'C': /* Count */
count_lines = 1;
break;
case 'i':
case 'I': /* Ignore */
ignore_case = 1;
break;
case 'n':
case 'N': /* Number */
number_output = 1;
break;
case 'v':
case 'V': /* Not with */
invert_search = 1;
break;
default:
usage ();
exit (2); /* syntax error .. return error 2 */
break;
}
}
else
{
/* Get the string */
if (needle == NULL)
{
/* Assign the string to find */
needle = *argv;
}
}
}
/* Check for search string */
if (needle == NULL)
{
/* No string? */
usage ();
exit (1);
}
/* Scan the files for the string */
if (argc == 0)
{
ret = find_str (needle, stdin, invert_search, count_lines,
number_output, ignore_case);
}
while (--argc >= 0)
{
hfind = _findfirst (*++argv, &finddata);
if (hfind < 0)
{
/* We were not able to find a file. Display a message and
set the exit status. */
fprintf (stderr, "FIND: %s: No such file\n", *argv);
}
else
{
/* repeat find next file to match the filemask */
do
{
/* We have found a file, so try to open it */
if ((pfile = fopen (finddata.name, "r")) != NULL)
{
printf ("---------------- %s\n", finddata.name);
ret = find_str (needle, pfile, invert_search, count_lines,
number_output, ignore_case);
fclose (pfile);
}
else
{
fprintf (stderr, "FIND: %s: Cannot open file\n",
finddata.name);
}
}
while (_findnext(hfind, &finddata) > 0);
}
_findclose(hfind);
} /* for each argv */
/* RETURN: If the string was found at least once, returns 0.
* If the string was not found at all, returns 1.
* (Note that find_str.c returns the exact opposite values.)
*/
exit ( (ret ? 0 : 1) );
}

View File

@@ -1,8 +0,0 @@
<module name="find" type="win32cui" installbase="system32" installname="find.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>find.c</file>
<file>find.rc</file>
</module>

View File

@@ -1,6 +0,0 @@
/* $Id$ */
#define REACTOS_STR_FILE_DESCRIPTION "W32 find command\0"
#define REACTOS_STR_INTERNAL_NAME "find\0"
#define REACTOS_STR_ORIGINAL_FILENAME "find.exe\0"
#include <reactos/version.rc>

View File

@@ -1,169 +0,0 @@
/* $Id$
*
* MORE.C - external command.
*
* clone from 4nt more command
*
* 26 Sep 1999 - Paolo Pantaleo <paolopan@freemail.it>
* started
* Oct 2003 - Timothy Schepens <tischepe at fastmail dot fm>
* use window size instead of buffer size.
*/
#include <windows.h>
#include <malloc.h>
#include <tchar.h>
DWORD len;
LPTSTR msg = _T("--- continue ---");
/*handle for file and console*/
HANDLE hStdIn;
HANDLE hStdOut;
HANDLE hStdErr;
HANDLE hKeyboard;
static VOID
GetScreenSize (PSHORT maxx, PSHORT maxy)
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo (hStdOut, &csbi);
*maxx = (csbi.srWindow.Right - csbi.srWindow.Left) + 1;
*maxy = (csbi.srWindow.Bottom - csbi.srWindow.Top) - 4;
}
static
VOID ConOutPuts (LPTSTR szText)
{
DWORD dwWritten;
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten, NULL);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten, NULL);
}
static VOID
ConInKey (VOID)
{
INPUT_RECORD ir;
DWORD dwRead;
do
{
ReadConsoleInput (hKeyboard, &ir, 1, &dwRead);
if ((ir.EventType == KEY_EVENT) &&
(ir.Event.KeyEvent.bKeyDown == TRUE))
return;
}
while (TRUE);
}
static VOID
WaitForKey (VOID)
{
DWORD dwWritten;
WriteFile (hStdErr,msg , len, &dwWritten, NULL);
ConInKey();
WriteFile (hStdErr, _T("\n"), 1, &dwWritten, NULL);
// FlushConsoleInputBuffer (hConsoleIn);
}
//INT CommandMore (LPTSTR cmd, LPTSTR param)
int main (int argc, char **argv)
{
SHORT maxx,maxy;
SHORT line_count=0,ch_count=0;
DWORD i, last;
HANDLE hFile = INVALID_HANDLE_VALUE;
TCHAR szFullPath[MAX_PATH];
/*reading/writing buffer*/
TCHAR *buff;
/*bytes written by WriteFile and ReadFile*/
DWORD dwRead,dwWritten;
/*ReadFile() return value*/
BOOL bRet;
len = _tcslen (msg);
hStdIn = GetStdHandle(STD_INPUT_HANDLE);
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
hStdErr = GetStdHandle(STD_ERROR_HANDLE);
if (argc > 1 && _tcsncmp (argv[1], _T("/?"), 2) == 0)
{
ConOutPuts(_T("Help text still missing!!"));
return 0;
}
hKeyboard = CreateFile (_T("CONIN$"), GENERIC_READ,
0,NULL,OPEN_ALWAYS,0,0);
GetScreenSize(&maxx,&maxy);
buff=malloc(4096);
FlushConsoleInputBuffer (hKeyboard);
if(argc > 1)
{
GetFullPathName(argv[1], MAX_PATH, szFullPath, NULL);
hFile = CreateFile (szFullPath, GENERIC_READ,
0,NULL,OPEN_ALWAYS,0,0);
}
do
{
if(hFile != INVALID_HANDLE_VALUE)
{
bRet = ReadFile(hFile,buff,4096,&dwRead,NULL);
}
else
{
bRet = ReadFile(hStdIn,buff,4096,&dwRead,NULL);
}
for(last=i=0;i<dwRead && bRet;i++)
{
ch_count++;
if(buff[i] == _T('\n') || ch_count == maxx)
{
ch_count=0;
line_count++;
if (line_count == maxy)
{
line_count = 0;
WriteFile(hStdOut,&buff[last], i-last+1, &dwWritten, NULL);
last=i+1;
FlushFileBuffers (hStdOut);
WaitForKey ();
}
}
}
if (last<dwRead && bRet)
WriteFile(hStdOut,&buff[last], dwRead-last, &dwWritten, NULL);
}
while(dwRead>0 && bRet);
free (buff);
CloseHandle (hKeyboard);
CloseHandle (hFile);
return 0;
}
/* EOF */

View File

@@ -1,8 +0,0 @@
<module name="more" type="win32cui" installbase="system32" installname="more.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>more.c</file>
<file>more.rc</file>
</module>

View File

@@ -1,6 +0,0 @@
/* $Id$ */
#define REACTOS_STR_FILE_DESCRIPTION "W32 more command\0"
#define REACTOS_STR_INTERNAL_NAME "more\0"
#define REACTOS_STR_ORIGINAL_FILENAME "more.exe\0"
#include <reactos/version.rc>

View File

@@ -1,434 +0,0 @@
/*
* ReactOS
* Copyright (C) 2004 ReactOS Team
* Copyright (C) 2004 GkWare e.K.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id$
*
* PROJECT: ReactOS System Control Panel
* FILE: lib/cpl/system/control.c
* PURPOSE: ReactOS System Control Panel
* PROGRAMMER: Gero Kuehn (reactos.filter@gkware.com)
* UPDATE HISTORY:
* 06-13-2004 Created
*/
#include <windows.h>
#include <commctrl.h>
#include <cpl.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <tchar.h>
#include "resource.h"
//#define CONTROL_DEBUG_ENABLE
#ifdef CONTROL_DEBUG_ENABLE
#define CTL_DEBUG(x) dbgprint x
#else
#define CTL_DEBUG(x)
#endif
#define MYWNDCLASS _T("CTLPANELCLASS")
typedef LONG (CALLBACK *CPLAPPLETFUNC)(HWND hwndCPL, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
typedef struct CPLLISTENTRY
{
TCHAR pszPath[MAX_PATH];
HMODULE hDll;
CPLAPPLETFUNC pFunc;
CPLINFO CplInfo;
int nIndex;
} CPLLISTENTRY, *PCPLLISTENTRY;
HWND hListView;
HINSTANCE hInst;
HWND hMainWnd;
DEVMODE pDevMode;
VOID dbgprint(TCHAR *format,...)
{
TCHAR buf[1000];
va_list va;
va_start(va,format);
_vstprintf(buf,format,va);
OutputDebugString(buf);
va_end(va);
}
VOID PopulateCPLList(HWND hLisCtrl)
{
WIN32_FIND_DATA fd;
HANDLE hFind;
TCHAR pszSearchPath[MAX_PATH];
HIMAGELIST hImgListSmall;
HIMAGELIST hImgListLarge;
int ColorDepth;
HMODULE hDll;
CPLAPPLETFUNC pFunc;
TCHAR pszPath[MAX_PATH];
/* Icon drawing mode */
pDevMode.dmSize = sizeof(DEVMODE);
pDevMode.dmDriverExtra = 0;
EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&pDevMode);
switch (pDevMode.dmBitsPerPel)
{
case 32: ColorDepth = ILC_COLOR32; break;
case 24: ColorDepth = ILC_COLOR24; break;
case 16: ColorDepth = ILC_COLOR16; break;
case 8: ColorDepth = ILC_COLOR8; break;
case 4: ColorDepth = ILC_COLOR4; break;
default: ColorDepth = ILC_COLOR; break;
}
hImgListSmall = ImageList_Create(16,16,ColorDepth | ILC_MASK,5,5);
hImgListLarge = ImageList_Create(32,32,ColorDepth | ILC_MASK,5,5);
GetSystemDirectory(pszSearchPath,MAX_PATH);
_tcscat(pszSearchPath,_T("\\*.cpl"));
hFind = FindFirstFile(pszSearchPath,&fd);
while (hFind != INVALID_HANDLE_VALUE)
{
PCPLLISTENTRY pEntry;
CTL_DEBUG((_T("Found %s\r\n"), fd.cFileName));
_tcscpy(pszPath, pszSearchPath);
*_tcsrchr(pszPath, '\\')=0;
_tcscat(pszPath, _T("\\"));
_tcscat(pszPath, fd.cFileName);
hDll = LoadLibrary(pszPath);
CTL_DEBUG((_T("Handle %08X\r\n"), hDll));
pFunc = (CPLAPPLETFUNC)GetProcAddress(hDll, "CPlApplet");
CTL_DEBUG((_T("CPLFunc %08X\r\n"), pFunc));
if (pFunc && pFunc(hLisCtrl, CPL_INIT, 0, 0))
{
UINT i, uPanelCount;
uPanelCount = (UINT)pFunc(hLisCtrl, CPL_GETCOUNT, 0, 0);
for (i = 0; i < uPanelCount; i++)
{
HICON hIcon;
TCHAR Name[MAX_PATH];
int index;
pEntry = (PCPLLISTENTRY)malloc(sizeof(CPLLISTENTRY));
if (pEntry == NULL)
return;
memset(pEntry, 0, sizeof(CPLLISTENTRY));
pEntry->hDll = hDll;
pEntry->pFunc = pFunc;
_tcscpy(pEntry->pszPath, pszPath);
pEntry->pFunc(hLisCtrl, CPL_INQUIRE, (LPARAM)i, (LPARAM)&pEntry->CplInfo);
hIcon = LoadImage(pEntry->hDll,MAKEINTRESOURCE(pEntry->CplInfo.idIcon),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
index = ImageList_AddIcon(hImgListSmall,hIcon);
DestroyIcon(hIcon);
hIcon = LoadImage(pEntry->hDll,MAKEINTRESOURCE(pEntry->CplInfo.idIcon),IMAGE_ICON,32,32,LR_DEFAULTCOLOR);
ImageList_AddIcon(hImgListLarge,hIcon);
DestroyIcon(hIcon);
if (LoadString(pEntry->hDll, pEntry->CplInfo.idName, Name, MAX_PATH))
{
LV_ITEM lvi;
memset(&lvi,0x00,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
lvi.pszText = Name;
lvi.state = 0;
lvi.iImage = index;
lvi.lParam = (LPARAM)pEntry;
pEntry->nIndex = ListView_InsertItem(hLisCtrl,&lvi);
if (LoadString(pEntry->hDll, pEntry->CplInfo.idInfo, Name, MAX_PATH))
ListView_SetItemText(hLisCtrl, pEntry->nIndex, 1, Name);
}
}
}
if (!FindNextFile(hFind,&fd))
hFind = INVALID_HANDLE_VALUE;
}
(void)ListView_SetImageList(hLisCtrl,hImgListSmall,LVSIL_SMALL);
(void)ListView_SetImageList(hLisCtrl,hImgListLarge,LVSIL_NORMAL);
}
LRESULT CALLBACK MyWindowProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch (uMsg)
{
case WM_CREATE:
{
RECT rect;
LV_COLUMN column;
GetClientRect(hWnd,&rect);
hListView = CreateWindow(WC_LISTVIEW,_T(""),LVS_REPORT | LVS_ALIGNLEFT | LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD | WS_TABSTOP,0,0,rect.right ,rect.bottom,hWnd,NULL,hInst,0);
CTL_DEBUG((_T("Listview Window %08X\r\n"),hListView));
memset(&column,0x00,sizeof(column));
column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
column.fmt = LVCFMT_LEFT;
column.cx = (rect.right - rect.left) / 3;
column.iSubItem = 0;
column.pszText = _T("Name");
(void)ListView_InsertColumn(hListView,0,&column);
column.cx = (rect.right - rect.left) - ((rect.right - rect.left) / 3) - 1;
column.iSubItem = 1;
column.pszText = _T("Comment");
(void)ListView_InsertColumn(hListView,1,&column);
PopulateCPLList(hListView);
(void)ListView_SetColumnWidth(hListView,2,LVSCW_AUTOSIZE_USEHEADER);
(void)ListView_Update(hListView,0);
SetFocus(hListView);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_SIZE:
{
RECT rect;
GetClientRect(hWnd,&rect);
MoveWindow(hListView,0,0,rect.right,rect.bottom,TRUE);
}
break;
case WM_NOTIFY:
{
NMHDR *phdr;
phdr = (NMHDR*)lParam;
switch(phdr->code)
{
case NM_RETURN:
case NM_DBLCLK:
{
int nSelect;
LV_ITEM lvi;
PCPLLISTENTRY pEntry;
nSelect=SendMessage(hListView,LVM_GETNEXTITEM,(WPARAM)-1,LVNI_FOCUSED);
if (nSelect==-1)
{
/* no items */
MessageBox(hWnd,_T("No Items in ListView"),_T("Error"),MB_OK|MB_ICONINFORMATION);
break;
}
CTL_DEBUG((_T("Select %d\r\n"),nSelect));
memset(&lvi,0x00,sizeof(lvi));
lvi.iItem = nSelect;
lvi.mask = LVIF_PARAM;
(void)ListView_GetItem(hListView,&lvi);
pEntry = (PCPLLISTENTRY)lvi.lParam;
CTL_DEBUG((_T("Listview DblClk Entry %08X\r\n"),pEntry));
if (pEntry)
{
CTL_DEBUG((_T("Listview DblClk Entry Func %08X\r\n"),pEntry->pFunc));
}
if (pEntry && pEntry->pFunc)
pEntry->pFunc(hListView,CPL_DBLCLK,pEntry->CplInfo.lData,0);
}
}
}
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDM_LARGEICONS:
SetWindowLong(hListView,GWL_STYLE,LVS_ICON | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break;
case IDM_SMALLICONS:
SetWindowLong(hListView,GWL_STYLE,LVS_SMALLICON | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break;
case IDM_LIST:
SetWindowLong(hListView,GWL_STYLE,LVS_LIST | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break;
case IDM_DETAILS:
SetWindowLong(hListView,GWL_STYLE,LVS_REPORT | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break;
case IDM_CLOSE:
DestroyWindow(hWnd);
break;
case IDM_ABOUT:
MessageBox(hWnd,_T("Simple Control Panel (not Shell-namespace based)\rCopyright 2004 GkWare e.K.\rhttp://www.gkware.com\rReleased under the GPL"),_T("About the Control Panel"),MB_OK | MB_ICONINFORMATION);
break;
}
break;
default:
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
return 0;
}
static INT
RunControlPanelWindow(int nCmdShow)
{
MSG msg;
WNDCLASS wc;
memset(&wc,0x00,sizeof(wc));
wc.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_MAINICON));
wc.lpszClassName = MYWNDCLASS;
wc.lpszMenuName = _T("MAINMENU");
wc.lpfnWndProc = MyWindowProc;
RegisterClass(&wc);
InitCommonControls();
hMainWnd = CreateWindowEx(WS_EX_CLIENTEDGE,
MYWNDCLASS,
_T("Control Panel"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
LoadMenu(hInst, MAKEINTRESOURCE(IDM_MAINMENU)),
hInst,
0);
if (!hMainWnd)
{
CTL_DEBUG((_T("Unable to create window\r\n")));
return -1;
}
ShowWindow(hMainWnd, nCmdShow);
while (GetMessage(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
static INT
RunControlPanel(LPCTSTR lpName, UINT uIndex)
{
CPLINFO CplInfo;
HMODULE hDll;
CPLAPPLETFUNC pFunc;
UINT uPanelCount;
hDll = LoadLibrary(lpName);
if (hDll == 0)
{
return -1;
}
CTL_DEBUG((_T("Handle %08X\r\n"), hDll));
pFunc = (CPLAPPLETFUNC)GetProcAddress(hDll, "CPlApplet");
if (pFunc == NULL)
{
FreeLibrary(hDll);
return -1;
}
CTL_DEBUG((_T("CPLFunc %08X\r\n"), pFunc));
if (!pFunc(NULL, CPL_INIT, 0, 0))
{
FreeLibrary(hDll);
return -1;
}
uPanelCount = (UINT)pFunc(NULL, CPL_GETCOUNT, 0, 0);
if (uIndex >= uPanelCount)
{
FreeLibrary(hDll);
return -1;
}
pFunc(NULL, CPL_INQUIRE, (LPARAM)uIndex, (LPARAM)&CplInfo);
pFunc(NULL, CPL_DBLCLK, CplInfo.lData, 0);
FreeLibrary(hDll);
return 0;
}
int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
LPTSTR lpCommandLine;
LPTSTR lpParam;
hInst = hInstance;
CTL_DEBUG((_T("My Control Panel\r\n")));
lpCommandLine = GetCommandLine();
CTL_DEBUG((_T("CommandLine: %s\n"), lpCommandLine));
lpParam = _tcschr(lpCommandLine, _T(' '));
if (lpParam == NULL)
{
/* No argument on the command line */
return RunControlPanelWindow(nCmdShow);
}
lpParam++;
if (_tcsicmp(lpParam, _T("desktop")) == 0)
{
return RunControlPanel(_T("desk.cpl"), 0);
}
else if (_tcsicmp(lpParam, _T("date/time")) == 0)
{
return RunControlPanel(_T("timedate.cpl"), 0);
}
else if (_tcsicmp(lpParam, _T("international")) == 0)
{
return RunControlPanel(_T("intl.cpl"), 0);
}
else if (_tcsicmp(lpParam, _T("mouse")) == 0)
{
return RunControlPanel(_T("main.cpl"), 0);
}
else if (_tcsicmp(lpParam, _T("keyboard")) == 0)
{
return RunControlPanel(_T("main.cpl"), 1);
}
return 0;
}

View File

@@ -1,137 +0,0 @@
# Microsoft Developer Studio Project File - Name="control" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=control - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "control.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "control.mak" CFG="control - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "control - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "control - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "control - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "../../../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG" /d "MS_COMPILER"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build
TargetDir=.\Release
TargetName=control
InputPath=.\Release\control.exe
InputName=control
SOURCE="$(InputPath)"
"C:\reactos\reactos\$(InputName).EXE" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(TargetDir)\$(TargetName).EXE C:\reactos\reactos
# End Custom Build
!ELSEIF "$(CFG)" == "control - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG" /d "MS_COMPILER"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# Begin Custom Build
TargetDir=.\Debug
TargetName=control
InputPath=.\Debug\control.exe
InputName=control
SOURCE="$(InputPath)"
"C:\reactos\reactos\$(InputName).EXE" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(TargetDir)\$(TargetName).EXE C:\reactos\reactos
# End Custom Build
!ENDIF
# Begin Target
# Name "control - Win32 Release"
# Name "control - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\control.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\config.ico
# End Source File
# Begin Source File
SOURCE=.\control.rc
# End Source File
# End Group
# End Target
# End Project

View File

@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "control"=.\control.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

Some files were not shown because too many files have changed in this diff Show More