From da25b896fd4440ce520d1bd35758491b7fe4061f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 24 Jul 2008 08:10:16 +0000 Subject: [PATCH 001/388] Fix Implicit declaration warnings. code->commit->????->profit! svn path=/branches/ros-amd64-bringup/; revision=34730 --- reactos/tools/wmc/mcy.tab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/tools/wmc/mcy.tab.c b/reactos/tools/wmc/mcy.tab.c index 1db76c8691d..30ec1a57284 100644 --- a/reactos/tools/wmc/mcy.tab.c +++ b/reactos/tools/wmc/mcy.tab.c @@ -118,7 +118,7 @@ #include #include #include - +#include #include "utils.h" #include "wmc.h" #include "lang.h" From 61f395c536cda7ec5cbc2e1d40cd6022333b1446 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 10:26:15 +0000 Subject: [PATCH 002/388] - create 512 2 MB pages first, so we have a max of 1 GB available memory. This gets us much further through hardware detection. the setup screen loads and then it stops with "failed to load the ANSI codepage file" svn path=/branches/ros-amd64-bringup/; revision=34733 --- .../boot/freeldr/freeldr/arch/amd64/arch.S | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S index 466dabf5f9e..d8d13e8f839 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S @@ -92,8 +92,8 @@ x86_16_EnableA20: /* - * We defines one 2MB page at the start of memory, so we can access the first - * 2MBs as if paging was disabled + * We define 512 2MB pages at the start of memory, so we can access the first + * 1 GB as if paging was disabled */ #define PML4_PAGENUM 60 // Put it high enough so it doesn't interfere with freeldr @@ -115,29 +115,33 @@ x86_16_BuildPageTables: xor di, di /* One entry in the PML4 pointing to PDP */ - mov ax, ((PDP_PAGENUM << 12) & 0xffff) | 0x00f - stosw - mov ax, (PDP_PAGENUM >> 4) - stosw + mov eax, (PDP_PAGENUM << 12) | 0x00f + stosd xor ax,ax mov cx, 0x07fe rep stosw /* One entry in the PDP pointing to PD */ - mov ax, ((PD_PAGENUM << 12) & 0xffff) | 0x00f - stosw - mov ax, (PD_PAGENUM >> 4) - stosw - xor ax,ax - mov cx, 0x07fe - rep stosw + mov eax, (PD_PAGENUM << 12) | 0x00f + stosd - /* One entry in the PD defining a 2MB page */ - mov ax, 0x018f - stosw - xor ax,ax - mov cx,0x07ff - rep stosw + xor eax, eax + mov ecx, 0x03ff + rep stosd + + /* 512 entries in the PD defining a 2MB page each */ + mov ecx, 512 + mov eax, 0x008f + +Bpt2: + mov es: [di], eax + mov dword ptr es: [di + 4], 0 + add eax, 512 << 12 // add 512 4k pages + add di, 8 + + /* Loop it */ + dec cx + jnz Bpt2 /* Return */ pop es @@ -258,6 +262,7 @@ BeReal: ret + /** Some data *****************************************************************/ .code64 From 040bc2a3c6c65b896ba6cc5169d67b95da6b3776 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 11:32:40 +0000 Subject: [PATCH 003/388] - mark special pages - move some definitions to arch/amd64.h svn path=/branches/ros-amd64-bringup/; revision=34735 --- .../boot/freeldr/freeldr/arch/amd64/arch.S | 27 +++-------- reactos/boot/freeldr/freeldr/include/arch.h | 33 ++----------- .../freeldr/include/arch/amd64/amd64.h | 47 +++++++++++++++++++ reactos/boot/freeldr/freeldr/mm/meminit.c | 5 +- 4 files changed, 61 insertions(+), 51 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S index d8d13e8f839..5ddc4eb8610 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S @@ -2,10 +2,10 @@ .text .code16 -//.org 0x8000 +#define ASM +#include -#define STACK16ADDR 0x7000 /* The 16-bit stack top will be at 0000:7000 */ -#define STACK64ADDR 0x74000 /* The 64-bit stack top will be at 0x74000 */ +//.org 0x8000 .global RealEntryPoint RealEntryPoint: @@ -95,16 +95,6 @@ x86_16_EnableA20: * We define 512 2MB pages at the start of memory, so we can access the first * 1 GB as if paging was disabled */ - -#define PML4_PAGENUM 60 // Put it high enough so it doesn't interfere with freeldr - -#define PAGESIZE 4096 -#define PDP_PAGENUM (PML4_PAGENUM + 1) -#define PD_PAGENUM (PDP_PAGENUM + 1) -#define PML4_ADDRESS (PML4_PAGENUM * PAGESIZE) -#define PDP_ADDRESS (PDP_PAGENUM * PAGESIZE) -#define PML4_SEG (PML4_ADDRESS / 16) - x86_16_BuildPageTables: pusha push es @@ -117,9 +107,9 @@ x86_16_BuildPageTables: /* One entry in the PML4 pointing to PDP */ mov eax, (PDP_PAGENUM << 12) | 0x00f stosd - xor ax,ax - mov cx, 0x07fe - rep stosw + xor eax, eax + mov cx, 0x03ff + rep stosd /* One entry in the PDP pointing to PD */ mov eax, (PD_PAGENUM << 12) | 0x00f @@ -149,11 +139,6 @@ Bpt2: ret -#define LMODE_CS 0x08 -#define LMODE_DS 0x10 -#define RMODE_CS 0x18 /* RMode code selector, base 0 limit 64k */ -#define RMODE_DS 0x20 /* RMode data selector, base 0 limit 64k */ - //.global x86_16_SwitchToLong x86_16_SwitchToLong: cli diff --git a/reactos/boot/freeldr/freeldr/include/arch.h b/reactos/boot/freeldr/freeldr/include/arch.h index 18a44864cdd..ed1189fbb83 100644 --- a/reactos/boot/freeldr/freeldr/include/arch.h +++ b/reactos/boot/freeldr/freeldr/include/arch.h @@ -21,6 +21,10 @@ #ifndef __ARCH_H #define __ARCH_H +#ifdef _M_AMD64 +#include +#endif + /* 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 */ @@ -55,35 +59,6 @@ extern PVOID FsStaticBufferDisk, FsStaticBufferData; #ifndef ASM #include -#ifdef _M_AMD64 -typedef struct -{ - unsigned long rax; - unsigned long rbx; - unsigned long rcx; - unsigned long rdx; - - unsigned long rsi; - unsigned long rdi; - - unsigned long r8; - unsigned long r9; - unsigned long r10; - unsigned long r11; - unsigned long r12; - unsigned long r13; - unsigned long r14; - unsigned long r15; - - unsigned short ds; - unsigned short es; - unsigned short fs; - unsigned short gs; - - unsigned long rflags; - -} QWORDREGS; -#endif typedef struct { unsigned long eax; diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index d398b180255..e4509016e98 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -21,7 +21,54 @@ #ifndef __AMD64_AMD64_H_ #define __AMD64_AMD64_H_ +#define STACK64ADDR 0x74000 /* The 64-bit stack top will be at 0x74000 */ +#define LMODE_CS 0x08 +#define LMODE_DS 0x10 + +/* Where we put out initial page tables */ +#define PML4_PAGENUM 60 // Put it high enough so it doesn't interfere with freeldr + +#define PAGESIZE 4096 +#define PDP_PAGENUM (PML4_PAGENUM + 1) +#define PD_PAGENUM (PDP_PAGENUM + 1) +#define PML4_ADDRESS (PML4_PAGENUM * PAGESIZE) +#define PDP_ADDRESS (PDP_PAGENUM * PAGESIZE) +#define PML4_SEG (PML4_ADDRESS / 16) +#define PML4_PAGES 3 +#define PAGETABLE_SIZE PML4_PAGES * PAGESIZE + +#if 0 +#ifndef ASM +typedef struct +{ + unsigned long long rax; + unsigned long long rbx; + unsigned long long rcx; + unsigned long long rdx; + + unsigned long long rsi; + unsigned long long rdi; + + unsigned long long r8; + unsigned long long r9; + unsigned long long r10; + unsigned long long r11; + unsigned long long r12; + unsigned long long r13; + unsigned long long r14; + unsigned long long r15; + + unsigned short ds; + unsigned short es; + unsigned short fs; + unsigned short gs; + + unsigned long long rflags; + +} QWORDREGS; +#endif /* ! ASM */ +#endif #endif /* __AMD64_AMD64_H_ */ diff --git a/reactos/boot/freeldr/freeldr/mm/meminit.c b/reactos/boot/freeldr/freeldr/mm/meminit.c index 079bf4dbde8..0b41dd7b1fe 100644 --- a/reactos/boot/freeldr/freeldr/mm/meminit.c +++ b/reactos/boot/freeldr/freeldr/mm/meminit.c @@ -97,7 +97,7 @@ BOOLEAN MmInitializeMemoryManager(VOID) MmUpdateLastFreePageHint(PageLookupTableAddress, TotalPagesInLookupTable); // Add machine-dependent stuff -#ifdef __i386__ +#if defined (__i386__) || defined (_M_AMD64) MmMarkPagesInLookupTable(PageLookupTableAddress, 0x00, 1, LoaderFirmwarePermanent); // realmode int vectors MmMarkPagesInLookupTable(PageLookupTableAddress, 0x01, 7, LoaderFirmwareTemporary); // freeldr stack + cmdline MmMarkPagesInLookupTable(PageLookupTableAddress, 0x08, 0x70, LoaderLoadedProgram); // freeldr image (roughly max. 0x64 pages) @@ -106,6 +106,9 @@ BOOLEAN MmInitializeMemoryManager(VOID) MmMarkPagesInLookupTable(PageLookupTableAddress, 0x90, 0x10, LoaderOsloaderHeap); // Disk read buffer for int 13h. DISKREADBUFFER MmMarkPagesInLookupTable(PageLookupTableAddress, 0xA0, 0x60, LoaderFirmwarePermanent); // ROM / Video MmMarkPagesInLookupTable(PageLookupTableAddress, 0xFFF, 1, LoaderSpecialMemory); // unusable memory +#if defined (_M_AMD64) + MmMarkPagesInLookupTable(PageLookupTableAddress, PML4_PAGENUM, PML4_PAGES, LoaderSpecialMemory); // the page table +#endif #elif __arm__ MmMarkPagesInLookupTable(PageLookupTableAddress, 0x00, 1, LoaderFirmwarePermanent); // arm exception handlers MmMarkPagesInLookupTable(PageLookupTableAddress, 0x01, 7, LoaderFirmwareTemporary); // arm board block + freeldr stack + cmdline From a9c16275170393ec3c71e4554cf66f6348f40dfd Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 12:27:40 +0000 Subject: [PATCH 004/388] - add some files, I forgot to commit - add media directory to build now we load some files and then stop due to missing fastfat.sys svn path=/branches/ros-amd64-bringup/; revision=34738 --- reactos/ReactOS-amd64.rbuild | 4 +- reactos/boot/bootdata/hivecls_amd64.inf | 827 +++++++++++++++++ reactos/boot/bootdata/hivedef_amd64.inf | 282 ++++++ reactos/boot/bootdata/hivesft_amd64.inf | 1076 ++++++++++++++++++++++ reactos/boot/bootdata/hivesys_amd64.inf | 1095 +++++++++++++++++++++++ 5 files changed, 3282 insertions(+), 2 deletions(-) create mode 100644 reactos/boot/bootdata/hivecls_amd64.inf create mode 100644 reactos/boot/bootdata/hivedef_amd64.inf create mode 100644 reactos/boot/bootdata/hivesft_amd64.inf create mode 100644 reactos/boot/bootdata/hivesys_amd64.inf diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 373b3f5d73b..70c865c9081 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -113,9 +113,9 @@ - + diff --git a/reactos/boot/bootdata/hivecls_amd64.inf b/reactos/boot/bootdata/hivecls_amd64.inf new file mode 100644 index 00000000000..b15f6def132 --- /dev/null +++ b/reactos/boot/bootdata/hivecls_amd64.inf @@ -0,0 +1,827 @@ +[Version] +Signature="$ReactOS$ + +[AddReg] +HKLM,"SOFTWARE\Classes",,0x00000010 + + +; Default key +HKCR,"*","",0x00000000,"" +HKCR,"*\shellex\ContextMenuHandlers\Open With","",0x00000000,"{09799AFB-AD67-11d1-ABCD-00C04FC30936}" + +; Folders +HKCR,"Folder","",0x00000000,"Folder" +;HKCR,"Folder\Defaulticon","",0x00000000,"%SystemRoot%\system32\shell32.dll,-4" +HKCR,"Folder\shell\open\command","",0x00000000,"explorer.exe ""%1""" +HKCR,"Folder\shell\explore\command","",0x00000000,"explorer.exe /e,""%1""" +HKCR,"Folder\shell\rootexplore","",0x00000000,"Explore from here" +HKCR,"Folder\shell\rootexplore\command","",0x00000000,"explorer.exe /e,/root,""%1""" + +; Drive property page +HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}","",0x00000000,"Drive Property Page Extension" +HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; New Object Service +HKCR,"CLSID\{D969A300-E7FF-11d0-A93B-00A0C90F2719}","",0x00000000,"ReactOS New Object Service" +HKCR,"CLSID\{D969A300-E7FF-11d0-A93B-00A0C90F2719}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{D969A300-E7FF-11d0-A93B-00A0C90F2719}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; Rich Text Files +HKCR,".rtf","",0x00000000,"rtffile" +HKCR,".rtf\shellnew","",0x00000000,"" +HKCR,".rtf\shellnew","Data",0x00020000,"{\rtf1}" +HKCR,"rtffile","",0x00000000,"Rich Text Document" +HKCR,"rtffile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\wordpad.exe,-1404" +HKCR,"rtffile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-2" +HKCR,"rtffile\shell\open","",0x00000000,"Open" +HKCR,"rtffile\shell\open\command","",0x00020000,"%SystemRoot%\system32\wordpad.exe %1" + +; Virtual Device Drivers +HKCR,".386","",0x00000000,"vxdfile" +HKCR,".vxd","",0x00000000,"vxdfile" +HKCR,"vxdfile","",0x00000000,"Virtual Device Driver" +HKCR,"vxdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-157" + +; Animated Cursors +HKCR,".ani","",0x00000000,"anifile" +HKCR,"anifile","",0x00000000,"Animated Cursor" +HKCR,"anifile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\main.cpl,-1039" +HKCR,"anifile\DefaultIcon","",0x00000000,"%1" + +; DOS Batch-Files +HKCR,".bat","",0x00000000,"batfile" +HKCR,"batfile","",0x00000000,"DOS Batch File" +HKCR,"batfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-158" +HKCR,"batfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-153" +HKCR,"batfile\shell\edit\command","",0x00020000,"%SystemRoot%\system32\notepad.exe %1" +HKCR,"batfile\shell\open\command","",0x00000000,"""%1"" %*" + +HKCR,".cmd","",0x00000000,"cmdfile" +HKCR,"cmdfile","",0x00000000,"ReactOS Command Script" +HKCR,"cmdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-159" +HKCR,"cmdfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-153" +HKCR,"cmdfile\shell\edit\command","",0x00020000,"%SystemRoot%\system32\notepad.exe %1" +HKCR,"cmdfile\shell\open\command","",0x00000000,"""%1"" %*" + +; Get DOS Applications a Icon +HKCR,".com","",0x00000000,"comfile" +HKCR,"comfile","",0x00000000,"DOS Application" +HKCR,"comfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-160" +HKCR,"comfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-3" + +; Control Panel extensions +HKCR,".cpl","",0x00000000,"cplfile" +HKCR,"cplfile","",0x00000000,"Control Panel Extension" +HKCR,"cplfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-161" +HKCR,"cplfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-154" +HKCR,"cplfile\shell\cplopen","",0x00000000,"Open with Control Panel" +HKCR,"cplfile\shell\cplopen\command","",0x00020000,"%SystemRoot%\system32\rundll32.exe shell32.dll,Control_RunDLL %1,%*" + +; Cursors +HKCR,".cur","",0x00000000,"curfile" +HKCR,"curfile","",0x00000000,"Cursor" +HKCR,"curfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-162" +HKCR,"curfile\DefaultIcon","",0x00000000,"%1" + +; Dynamic Link Libraries +HKCR,".dll","",0x00000000,"dllfile" +HKCR,"dllfile","",0x00000000,"Dynamic Link Library" +HKCR,"dllfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-163" +HKCR,"dllfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-154" + +; Device Drivers +HKCR,".drv","",0x00000000,"drvfile" +HKCR,"drvfile","",0x00000000,"Device Driver" +HKCR,"drvfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-164" + +; Applicatons +HKCR,".exe","",0x00000000,"exefile" +HKCR,"exefile","",0x00000000,"ReactOS Application" +HKCR,"exefile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-165" +HKCR,"exefile\Defaulticon","",0x00000000,"%1" +HKCR,"exefile\shell\open\command","",0x00000000,"""%1"" %*" + +; Fonts +HKCR,".fon","",0x00000000,"fonfile" +HKCR,"fonfile","",0x00000000,"Font File" +HKCR,"fonfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-166" +HKCR,"fonfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-155" + +HKCR,".ttf","",0x00000000,"ttffile" +HKCR,"ttffile","",0x00000000,"TrueType Font File" +HKCR,"ttffile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-156" +HKCR,"ttffile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-167" +HKCR,"ttffile\shell\open\command","",0x00020000,"%SystemRoot%\system32\fontview.exe %1" + +; Help Files +HKCR,".hlp","",0x00000000,"hlpfile" +HKCR,"hlpfile","",0x00000000,"Help File" +HKCR,"fonfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-168" +HKCR,"hlpfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-24" + +; set MIME type for .html and .htm because Tiny webserver needs it +HKCR,".htm","",0x00000000,"html" +HKCR,".htm","Content Type",0x00000000,"text/html" + +HKCR,".html","",0x00000000,"html" +HKCR,".html","Content Type",0x00000000,"text/html" + +; Icons +HKCR,".ico","",0x00000000,"icofile" +HKCR,"icofile","",0x00000000,"Icon" +HKCR,"icofile\DefaultIcon","",0x00000000,"%1" + +; JPEG Images +HKCR,".jpg","",0x00000000,"jpegfile" +HKCR,".jpeg","",0x00000000,"jpegfile" +HKCR,"jpegfile","",0x00000000,"JPEG Image" +HKCR,"jpegfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shimgvw.dll,-1" +HKCR,"jpegfile\shell\open\command","",0x00020000,"rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1" + +; Bitmap Images +HKCR,".bmp","",0x00000000,"bmpfile" +HKCR,"bmpfile","",0x00000000,"Bitmap Image" +HKCR,"bmpfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shimgvw.dll,-1" +HKCR,"bmpfile\shell\open\command","",0x00020000,"rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1" + +; PNG Images +HKCR,".png","",0x00000000,"pngfile" +HKCR,"pngfile","",0x00000000,"PNG Image" +HKCR,"pngfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shimgvw.dll,-1" +HKCR,"pngfile\shell\open\command","",0x00020000,"rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1" + +; GIF Images +HKCR,".gif","",0x00000000,"giffile" +HKCR,"giffile","",0x00000000,"GIF Image" +HKCR,"giffile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shimgvw.dll,-1" +HKCR,"giffile\shell\open\command","",0x00020000,"rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1" + +; Configuration Files +HKCR,".ini","",0x00000000,"inifile" +HKCR,"inifile","",0x00000000,"Configuration Settings" +HKCR,"inifile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-169" +HKCR,"inifile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-151" +HKCR,"inifile\shell\open\command","",0x00000000,"notepad.exe ""%1""" + +; Setup Information Files +HKCR,".inf","",0x00000000,"inffile" +HKCR,"inffile","",0x00000000,"Setup Information" +HKCR,"inffile\FriendlyTypeName","",0x00020000,"%SystemRoot%\system32\setupapi.dll,-2001" +HKCR,"inffile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-151" +HKCR,"inffile\shell\open\command","",0x00000000,"notepad.exe ""%1""" +HKCR,"inffile\shell\Install","",0x00000000,"Install" +HKCR,"inffile\shell\Install\command","",0x00020000,"%SystemRoot%\system32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1" + +; Show icons for shortcuts in shell views (lnkfile is handled specially in shell32) +; Don't display extension for shortcuts +HKCR,".lnk","",0x00000000,"lnkfile" +HKCR,".lnk\shellnew","",0x00000000,"" +HKCR,".lnk\shellnew","command",0x00020000,"%SystemRoot%\system32\rundll32.exe appwiz.cpl,NewLinkHere %1" +HKCR,"lnkfile","",0x00000000,"Shortcut" +HKCR,"lnkfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-170" +HKCR,"lnkfile","NeverShowExt",0x00000000,"" +HKCR,"lnkfile","IsShortcut",0x00000000,"yes" +HKCR,"lnkfile\CLSID","",0x00000000,"{00021401-0000-0000-C000-000000000046}" +HKCR,"lnkfile\shellex\IconHandler","",0x00000000,"{00021401-0000-0000-C000-000000000046}" +HKCR,"lnkfile\shellex\ContextMenuHandlers\{00021401-0000-0000-C000-000000000046}","",0x00000000,"" + +; Text Documents +HKCR,".log","",0x00000000,"txtfile" +HKCR,".txt","",0x00000000,"txtfile" +HKCR,".c","",0x00000000,"txtfile" +HKCR,".cpp","",0x00000000,"txtfile" +HKCR,".h","",0x00000000,"txtfile" +HKCR,".hpp","",0x00000000,"txtfile" +HKCR,".txt\shellnew","",0x00000000,"" +HKCR,".txt\shellnew","NullFile",0x00020000,"" +HKCR,"txtfile","",0x00000000,"Text Document" +HKCR,".txt","Content Type",0x00000000,"text/plain" +HKCR,"txtfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-152" +HKCR,"txtfile\shell\open\command","",0x00020000,"%SystemRoot%\system32\notepad.exe %1" + +; XML Documents +HKCR,".xml","",0x00000000,"xmlfile" +HKCR,"xmlfile","",0x00000000,"XML Document" +HKCR,".xml","Content Type",0x00000000,"text/xml" +HKCR,"xmlfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-151" +HKCR,"xmlfile\shell\open\command","",0x00020000,"%SystemRoot%\system32\notepad.exe %1" + +; MSI files +HKCR,".msi","",0x00000000,"MSI.Package" +HKCR,"Msi.Package\DefaultIcon","",0x00000000,"msiexec.exe" +HKCR,"Msi.Package\shell\Open\command","",0x00020000,"%SystemRoot%\system32\msiexec /i %1" +HKCR,"Msi.Package\shell\Repair\command","",0x00020000,"%SystemRoot%\system32\msiexec /f %1" +HKCR,"Msi.Package\shell\Uninstall\command","",0x00020000,"%SystemRoot%\system32\msiexec /x %1" + +HKCR,".pif","",0x00000000,"piffile" + +; Registration Entries +HKCR,".reg","",0x00000000,"regfile" +HKCR,"regfile","",0x00000000,"Registration Entries" +HKCR,"regfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-170" +HKCR,"regfile\DefaultIcon","",0x00020000,"%SystemRoot%\regedit.exe,1" +HKCR,"regfile\shell\edit\command","",0x00020000,"%SystemRoot%\system32\notepad.exe %1" +HKCR,"regfile\shell\open","",0x00000000,"Merge" +HKCR,"regfile\shell\open\command","",0x00000000,"regedit.exe ""%1""" + +; Screen Savers +HKCR,".scr","",0x00000000,"scrfile" +HKCR,"scrfile","",0x00000000,"Screen Saver" +HKCR,"scrfile\Defaulticon","",0x00000000,"%1" +HKCR,"scrfile\shell\config","",0x00000000,"Configure" +HKCR,"scrfile\shell\config\command","",0x00000000,"""%1""" +HKCR,"scrfile\shell\install","",0x00000000,"Install" +HKCR,"scrfile\shell\install\command","",0x00000000,"rundll32.exe desk.cpl,InstallScreenSaver %l" +HKCR,"scrfile\shell\open","",0x00000000,"Test" +HKCR,"scrfile\shell\open\command","",0x00000000,"""%1"" /S" + +; shell command files (e.g. "Show Desktop" in quicklaunch bar) +HKCR,".scf","",0x00000000,"SHCmdFile" +HKCR,"SHCmdFile","NeverShowExt",0x00000000,"" +HKCR,"SHCmdFile","IsShortcut",0x00000000,"yes" +HKCR,"SHCmdFile\shell\open\command","",0x00000000,"explorer.exe ""%1""" +HKCR,"SHCmdFile\CLSID","",0x00000000,"{57651662-CE3E-11D0-8D77-00C04FC99D61}" +HKCR,"SHCmdFile\shellex\IconHandler","",0x00000000,"{57651662-CE3E-11D0-8D77-00C04FC99D61}" + +; System-Files +HKCR,".sys","",0x00000000,"sysfile" +HKCR,"sysfile","",0x00000000,"System File" +HKCR,"regfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-171" +HKCR,"sysfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-154" + +; URL shortcuts (e.g. used in favorites folder of IExplorer) +HKCR,".url","",0x00000000,"InternetShortcut" +HKCR,"InternetShortcut","NeverShowExt",0x00000000,"" +HKCR,"InternetShortcut","IsShortcut",0x00000000,"yes" +HKCR,"InternetShortcut\shell\open\command","",0x00000000,"rundll32.exe shdocvw.dll,OpenURL %l" +HKCR,"InternetShortcut\DefaultIcon","",0x00020000,"%SystemRoot%\system32\url.dll,0" + +; Wave Sounds +HKCR,".wav","",0x00000000,"SoundRec" +HKCR,"SoundRec","",0x00000000,"Wave Sound" +HKCR,"SoundRec\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-225" + +HKCR,"CLSID",,0x00000012 + +; For Shell32.dll +HKCR,"CLSID\{00021400-0000-0000-C000-000000000046}","",0x00000000,"Desktop" +HKCR,"CLSID\{00021400-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{00021400-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{00021401-0000-0000-C000-000000000046}","",0x00000000,"Shortcut" +HKCR,"CLSID\{00021401-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{00021401-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{00021401-0000-0000-C000-000000000046}\shellex\MayChangeDefaultMenu","",0x00000000,"" +HKCR,"CLSID\{000214E6-0000-0000-C000-000000000046}","",0x00000000,"Shellfolder" +HKCR,"CLSID\{000214E6-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{000214E6-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{000214EE-0000-0000-C000-000000000046}","",0x00000000,"IShellLinkA" +HKCR,"CLSID\{000214EE-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{000214EE-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{000214F9-0000-0000-C000-000000000046}","",0x00000000,"IShellLinkW" +HKCR,"CLSID\{000214F9-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{000214F9-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}","",0x00000000,"Computer Search Results Folder" +HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}","LocalizedString",0x00020000,"@%SystemRoot%\system32\shell32.dll,-30521" +HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-135" +HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}\InProcServer32","",0x00020000,"%SystemRoot%\system32\shell32.dll" +HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{1F4DE370-D627-11D1-BA4F-00A0C91EEDBA}\ShellFolder","Attributes",0x00010001,0x20180000 + +HKCR,"CLSID\{4657278A-411B-11d2-839A-00C04FD918D0}","",0x00000000,"Shell Drag and Drop helper" +HKCR,"CLSID\{4657278A-411B-11d2-839A-00C04FD918D0}\InProcServer32","",0x00020000,"%SystemRoot%\system32\shell32.dll" +HKCR,"CLSID\{4657278A-411B-11d2-839A-00C04FD918D0}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; Folder Options CPL +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}","",0x00000000,"Folder Options" +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}","LocalizedString",0x00020000,"@%SystemRoot%\system32\shell32.dll,-150" +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-210" +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\shell\Open\command","",0x00000000,"rundll32.exe shell32.dll,Options_RunDLL 0" +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\shell\RunAs\command","",0x00000000,"rundll32.exe shell32.dll,Options_RunDLL 0" +HKCR,"CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}\ShellFolder","Attributes",0x00010001,0x00000000 + +; Open With shell extension +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}","",0x00000000,"Open With Context Menu Handler" +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","",0x00000000,"shell32.dll" +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{09799AFB-AD67-11d1-ABCD-00C04FC30936}\shellex\MayChangeDefaultMenu","",0x00000000,"" +HKCR,"SystemFileAssociations","",0x00000000,"" +HKCR,"Applications","",0x00000000,"" + +; Recycle bin is not implemented +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","",0x00000000,"Recycle Bin" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","LocalizedString",0x00020000,"@%SystemRoot%\system32\shell32.dll,-8964" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","InfoTip",0x00020000,"@%SystemRoot%\system32\shell32.dll,-22915" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","IntroText",0x00020000,"@%SystemRoot%\system32\shell32.dll,-31748" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}","SortOrderIndex",0x00010001,0x00000060 +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,31" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\DefaultIcon","Empty",0x00020000,"%SystemRoot%\system32\shell32.dll,31" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\DefaultIcon","Full",0x00020000,"%SystemRoot%\system32\shell32.dll,32" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\InProcServer32","",0x00020000,"%SystemRoot%\system32\shell32.dll" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ShellFolder","Attributes",0x00010001,0x20000140 +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ShellFolder","CallForAttributes",0x00010001,0x00000040 +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shellex\ContextMenuHandlers\{645FF040-5081-101B-9F08-00AA002F954E}","",0x00000000,"" +;HKCR,"CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shellex\PropertySheetHandlers\{645FF040-5081-101B-9F08-00AA002F954E}","",0x00000000,"" + +HKCR,"CLSID\{00000320-0000-0000-C000-000000000046}","",0x00000000,"PSFactoryBuffer" +HKCR,"CLSID\{00000320-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"ole32.dll" +HKCR,"CLSID\{00000320-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Both" + +; StdGlobalInterfaceTable from winedefault.reg +;HKCR,"CLSID\{00000323-0000-0000-C000-000000000046}","",0x00000000,"StdGlobalInterfaceTable" +;HKCR,"CLSID\{00000323-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"ole32.dll" +;HKCR,"CLSID\{00000323-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; deskadp.dll shell extension +HKCR,"CLSID\{42071712-76d4-11d1-8b24-00a0c9068ff3}","",0x00000000,"Display Adapter CPL Extension" +HKCR,"CLSID\{42071712-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","",0x00020000,"%SystemRoot%\system32\deskadp.dll" +HKCR,"CLSID\{42071712-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; deskmon.dll shell extension +HKCR,"CLSID\{42071713-76d4-11d1-8b24-00a0c9068ff3}","",0x00000000,"Display Monitor CPL Extension" +HKCR,"CLSID\{42071713-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","",0x00020000,"%SystemRoot%\system32\deskmon.dll" +HKCR,"CLSID\{42071713-76d4-11d1-8b24-00a0c9068ff3}\InProcServer32","ThreadingModel",0x00000000,"Apartment" + +; For comcat.dll +HKCR,"CLSID\{0002E005-0000-0000-C000-000000000046}","",0x00000000,"StdComponentCategoriesMgr" +HKCR,"CLSID\{0002E005-0000-0000-C000-000000000046}\InProcServer32","",0x00000000,"comcat.dll" +HKCR,"CLSID\{0002E005-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel",0x00000000,"Both" + +; For TCPIP Protocol property page +HKCR,"CLSID\{A907657F-6FDF-11D0-8EFB-00C04FD912B2}","",0x00000000,"TCP/IP Configuration Notify Object" +HKCR,"CLSID\{A907657F-6FDF-11D0-8EFB-00C04FD912B2}\InProcServer32","",0x00000000,"netcfgx.dll" +HKCR,"CLSID\{A907657F-6FDF-11D0-8EFB-00C04FD912B2}\InProcServer32","ThreadingModel",0x00000000,"Both" + +; For dxdiagn.dll +HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}","",0x00000000,"DxDiagProvider Class" +HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\InProcServer32","",0x00000000,"%SystemRoot%\system32\dxdiagn.dll" +HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\InProcServer32","ThreadingModel",0x00000000,"Apartment" +HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\ProgID","",0x00000000,"DxDiag.DxDiagProvider.1" +HKCR,"CLSID\{A65B8071-3BFE-4213-9A5B-491DA4461CA7}\VersionIndependentProgID","",0x00000000,"DxDiag.DxDiagProvider" + +HKCR,"Interface",,0x00000012 + +; For Ole32.dll +HKCR,"Interface\{00000000-0000-0000-C000-000000000046}","",0x00000000,"IUnknown" +HKCR,"Interface\{00000000-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"" +HKCR,"Interface\{00000000-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"3" +HKCR,"Interface\{00000000-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000001-0000-0000-C000-000000000046}","",0x00000000,"IClassFactory" +HKCR,"Interface\{00000001-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"5" +HKCR,"Interface\{00000001-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000002-0000-0000-C000-000000000046}}","",0x00000000,"IMalloc" +HKCR,"Interface\{00000002-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" + +HKCR,"Interface\{00000003-0000-0000-C000-000000000046}","",0x00000000,"IMarshal" +HKCR,"Interface\{00000003-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" + +HKCR,"Interface\{00000004-0000-0000-C000-000000000046}","",0x00000000,"IRpcChannel" +HKCR,"Interface\{00000004-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" + +HKCR,"Interface\{00000005-0000-0000-C000-000000000046}","",0x00000000,"IRpcStub" +HKCR,"Interface\{00000005-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"8" + +HKCR,"Interface\{00000006-0000-0000-C000-000000000046}","",0x00000000,"IStubManager" + +HKCR,"Interface\{00000007-0000-0000-C000-000000000046}","",0x00000000,"IRpcProxy" +HKCR,"Interface\{00000007-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"5" + +HKCR,"Interface\{00000008-0000-0000-C000-000000000046}","",0x00000000,"IProxyManager" + +HKCR,"Interface\{00000009-0000-0000-C000-000000000046}","",0x00000000,"IPSFactory" +HKCR,"Interface\{00000009-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"5" + +HKCR,"Interface\{0000000A-0000-0000-C000-000000000046}","",0x00000000,"ILockBytes" +HKCR,"Interface\{0000000A-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"10" +HKCR,"Interface\{0000000A-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000000B-0000-0000-C000-000000000046}","",0x00000000,"IStorage" +HKCR,"Interface\{0000000B-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"18" +HKCR,"Interface\{0000000B-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000000C-0000-0000-C000-000000000046}","",0x00000000,"IStream" +HKCR,"Interface\{0000000C-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"14" +HKCR,"Interface\{0000000C-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000000D-0000-0000-C000-000000000046}","",0x00000000,"IEnumSTATSTG" +HKCR,"Interface\{0000000D-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{0000000D-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000000E-0000-0000-C000-000000000046}","",0x00000000,"IBindCtx" +HKCR,"Interface\{0000000E-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"13" +HKCR,"Interface\{0000000E-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000000F-0000-0000-C000-000000000046}","",0x00000000,"IMoniker" +HKCR,"Interface\{0000000F-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{00000109-0000-0000-C000-000000000046}" +HKCR,"Interface\{0000000F-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"23" +HKCR,"Interface\{0000000F-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000010-0000-0000-C000-000000000046}","",0x00000000,"IRunningObjectTable" +HKCR,"Interface\{00000010-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"10" +HKCR,"Interface\{00000010-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000011-0000-0000-C000-000000000046}","",0x00000000,"IInternalMoniker" + +HKCR,"Interface\{00000012-0000-0000-C000-000000000046}","",0x00000000,"IRootStorage" +HKCR,"Interface\{00000012-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"4" +HKCR,"Interface\{00000012-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000013-0000-0000-C000-000000000046}","",0x00000000,"IDfReserved1" + +HKCR,"Interface\{00000014-0000-0000-C000-000000000046}","",0x00000000,"IDfReserved2" + +HKCR,"Interface\{00000015-0000-0000-C000-000000000046}","",0x00000000,"IDfReserved3" + +HKCR,"Interface\{00000016-0000-0000-C000-000000000046}","",0x00000000,"IMessageFilter" +HKCR,"Interface\{00000016-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"6" + +HKCR,"Interface\{00000018-0000-0000-C000-000000000046}","",0x00000000,"IStdMarshalInfo" +HKCR,"Interface\{00000018-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"4" + +HKCR,"Interface\{00000100-0000-0000-C000-000000000046}","",0x00000000,"IEnumUnknown" +HKCR,"Interface\{00000100-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{00000100-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000101-0000-0000-C000-000000000046}","",0x00000000,"IEnumString" +HKCR,"Interface\{00000101-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{00000101-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000102-0000-0000-C000-000000000046}","",0x00000000,"IEnumMoniker" +HKCR,"Interface\{00000102-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{00000102-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000103-0000-0000-C000-000000000046}","",0x00000000,"IEnumFORMATETC" +HKCR,"Interface\{00000103-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{00000103-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000104-0000-0000-C000-000000000046}","",0x00000000,"IEnumOLEVERB" +HKCR,"Interface\{00000104-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{00000104-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000105-0000-0000-C000-000000000046}","",0x00000000,"IEnumSTATDATA" +HKCR,"Interface\{00000105-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{00000105-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000106-0000-0000-C000-000000000046}","",0x00000000,"IEnumGeneric" + +HKCR,"Interface\{00000107-0000-0000-C000-000000000046}","",0x00000000,"IEnumHolder" + +HKCR,"Interface\{00000108-0000-0000-C000-000000000046}","",0x00000000,"IEnumCallback" + +HKCR,"Interface\{00000109-0000-0000-C000-000000000046}","",0x00000000,"IPersistStream" + +HKCR,"Interface\{00000109-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{0000010C-0000-0000-C000-000000000046}" +HKCR,"Interface\{00000109-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"8" + +HKCR,"Interface\{00000109-0000-0000-C000-000000000046}\OLEViewerIViewerCLSID","",0x00000000,"{7CE551EB-F85C-11CE-9059-080036F12502}" +HKCR,"Interface\{00000109-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000010A-0000-0000-C000-000000000046}","",0x00000000,"IPersistStorage" +HKCR,"Interface\{0000010A-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{0000010C-0000-0000-C000-000000000046}" +HKCR,"Interface\{0000010A-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"10" +HKCR,"Interface\{0000010A-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000010B-0000-0000-C000-000000000046}","",0x00000000,"IPersistFile" +HKCR,"Interface\{0000010B-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{0000010C-0000-0000-C000-000000000046}" +HKCR,"Interface\{0000010B-0000-0000-C000-000000000046}\Distributor","",0x00000000,"{e436ebb7-524f-11ce-9f53-0020af0ba770}" +HKCR,"Interface\{0000010B-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" +HKCR,"Interface\{0000010B-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000010C-0000-0000-C000-000000000046}","",0x00000000,"IPersist" +HKCR,"Interface\{0000010C-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"4" +HKCR,"Interface\{0000010C-0000-0000-C000-000000000046}\OLEViewerIViewerCLSID","",0x00000000,"{7CE551EB-F85C-11CE-9059-080036F12502}" +HKCR,"Interface\{0000010C-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000010D-0000-0000-C000-000000000046}","",0x00000000,"IViewObject" +HKCR,"Interface\{0000010D-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" +HKCR,"Interface\{0000010D-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000010E-0000-0000-C000-000000000046}","",0x00000000,"IDataObject" +HKCR,"Interface\{0000010E-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"12" +HKCR,"Interface\{0000010E-0000-0000-C000-000000000046}\OLEViewerIViewerCLSID","",0x00000000,"{28D8ABA0-4B78-11CE-B27D-00AA001F73C1}" +HKCR,"Interface\{0000010E-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000010F-0000-0000-C000-000000000046}","",0x00000000,"IAdviseSink" +HKCR,"Interface\{0000010F-0000-0000-C000-000000000046}\AsynchronousInterface","",0x00000000,"{00000150-0000-0000-C000-000000000046}" +HKCR,"Interface\{0000010F-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"8" +HKCR,"Interface\{0000010F-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000110-0000-0000-C000-000000000046}","",0x00000000,"IDataAdviseHolder" +HKCR,"Interface\{00000110-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" + +HKCR,"Interface\{00000111-0000-0000-C000-000000000046}","",0x00000000,"IOleAdviseHolder" +HKCR,"Interface\{00000111-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" + +HKCR,"Interface\{00000112-0000-0000-C000-000000000046}","",0x00000000,"IOleObject" +HKCR,"Interface\{00000112-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"24" +HKCR,"Interface\{00000112-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000113-0000-0000-C000-000000000046}","",0x00000000,"IOleInPlaceObject" + +HKCR,"Interface\{00000113-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{00000114-0000-0000-C000-000000000046}" +HKCR,"Interface\{00000113-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" +HKCR,"Interface\{00000113-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000114-0000-0000-C000-000000000046}","",0x00000000,"IOleWindow" +HKCR,"Interface\{00000114-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"5" +HKCR,"Interface\{00000114-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000115-0000-0000-C000-000000000046}","",0x00000000,"IOleInPlaceUIWindow" +HKCR,"Interface\{00000115-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{00000114-0000-0000-C000-000000000046}" +HKCR,"Interface\{00000115-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" +HKCR,"Interface\{00000115-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000116-0000-0000-C000-000000000046}","",0x00000000,"IOleInPlaceFrame" +HKCR,"Interface\{00000116-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"15" +HKCR,"Interface\{00000116-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000117-0000-0000-C000-000000000046}","",0x00000000,"IOleInPlaceActiveObject" +HKCR,"Interface\{00000117-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{00000114-0000-0000-C000-000000000046}" +HKCR,"Interface\{00000117-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"10" +HKCR,"Interface\{00000117-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000118-0000-0000-C000-000000000046}","",0x00000000,"IOleClientSite" +HKCR,"Interface\{00000118-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" +HKCR,"Interface\{00000118-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{00000119-0000-0000-C000-000000000046}","",0x00000000,"IOleInPlaceSite" +HKCR,"Interface\{00000119-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{00000114-0000-0000-C000-000000000046}" +HKCR,"Interface\{00000119-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"15" +HKCR,"Interface\{00000119-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000011A-0000-0000-C000-000000000046}","",0x00000000,"IParseDisplayName" +HKCR,"Interface\{0000011A-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"4" +HKCR,"Interface\{0000011A-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000011B-0000-0000-C000-000000000046}","",0x00000000,"IOleContainer" +HKCR,"Interface\{0000011B-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{0000011A-0000-0000-C000-000000000046}" +HKCR,"Interface\{0000011B-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"6" +HKCR,"Interface\{0000011B-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000011C-0000-0000-C000-000000000046}","",0x00000000,"IOleItemContainer" +HKCR,"Interface\{0000011C-0000-0000-C000-000000000046}\BaseInterface","",0x00000000,"{0000011B-0000-0000-C000-000000000046}" +HKCR,"Interface\{0000011C-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"9" +HKCR,"Interface\{0000011C-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000011D-0000-0000-C000-000000000046}","",0x00000000,"IOleLink" +HKCR,"Interface\{0000011D-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"14" +HKCR,"Interface\{0000011D-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000011E-0000-0000-C000-000000000046}","",0x00000000,"IOleCache" +HKCR,"Interface\{0000011E-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"8" +HKCR,"Interface\{0000011E-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"Interface\{0000011F-0000-0000-C000-000000000046}","",0x00000000,"IOleManager" + +HKCR,"Interface\{00000120-0000-0000-C000-000000000046}","",0x00000000,"IOlePresObj" + +HKCR,"Interface\{00000121-0000-0000-C000-000000000046}","",0x00000000,"IDropSource" +HKCR,"Interface\{00000121-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"5" + +HKCR,"Interface\{00000122-0000-0000-C000-000000000046}","",0x00000000,"IDropTarget" +HKCR,"Interface\{00000122-0000-0000-C000-000000000046}\NumMethods","",0x00000000,"7" +HKCR,"Interface\{00000122-0000-0000-C000-000000000046}\ProxyStubClsid32","",0x00000000,"{00000320-0000-0000-C000-000000000046}" + +HKCR,"NDS\Clsid","",0x00000002,"{323991f0-7bad-11cf-b03d-00aa006e0975}" + +HKCR,"WinNT\Clsid","",0x00000002,"{8b20cd60-0f29-11cf-abc4-02608c9e7553}" + + +; For language support: + +HKCR,"MIME",,0x00000012 +HKCR,"MIME\Database",,0x00000012 +HKCR,"MIME\Database\Rfc1766",,0x00000012 +HKCR,"MIME\Database\Rfc1766","0436",0x00000000,"af;Afrikaans" +HKCR,"MIME\Database\Rfc1766","041C",0x00000000,"sq;Albanian" +HKCR,"MIME\Database\Rfc1766","0001",0x00000000,"ar;Arabic" +HKCR,"MIME\Database\Rfc1766","0401",0x00000000,"ar-sa;Arabic (Saudi Arabia)" +HKCR,"MIME\Database\Rfc1766","0801",0x00000000,"ar-iq;Arabic (Iraq)" +HKCR,"MIME\Database\Rfc1766","0C01",0x00000000,"ar-eg;Arabic (Egypt)" +HKCR,"MIME\Database\Rfc1766","1001",0x00000000,"ar-ly;Arabic (Libya)" +HKCR,"MIME\Database\Rfc1766","1401",0x00000000,"ar-dz;Arabic (Algeria)" +HKCR,"MIME\Database\Rfc1766","1801",0x00000000,"ar-ma;Arabic (Morocco)" +HKCR,"MIME\Database\Rfc1766","1C01",0x00000000,"ar-tn;Arabic (Tunisia)" +HKCR,"MIME\Database\Rfc1766","2001",0x00000000,"ar-om;Arabic (Oman)" +HKCR,"MIME\Database\Rfc1766","2401",0x00000000,"ar-ye;Arabic (Yemen)" +HKCR,"MIME\Database\Rfc1766","2801",0x00000000,"ar-sy;Arabic (Syria)" +HKCR,"MIME\Database\Rfc1766","2C01",0x00000000,"ar-jo;Arabic (Jordan)" +HKCR,"MIME\Database\Rfc1766","3001",0x00000000,"ar-lb;Arabic (Lebanon)" +HKCR,"MIME\Database\Rfc1766","3401",0x00000000,"ar-kw;Arabic (Kuwait)" +HKCR,"MIME\Database\Rfc1766","3801",0x00000000,"ar-ae;Arabic (U.A.E.)" +HKCR,"MIME\Database\Rfc1766","3C01",0x00000000,"ar-bh;Arabic (Bahrain)" +HKCR,"MIME\Database\Rfc1766","4001",0x00000000,"ar-qa;Arabic (Qatar)" +HKCR,"MIME\Database\Rfc1766","042D",0x00000000,"eu;Basque" +HKCR,"MIME\Database\Rfc1766","0402",0x00000000,"bg;Bulgarian" +HKCR,"MIME\Database\Rfc1766","0423",0x00000000,"be;Belarusian" +HKCR,"MIME\Database\Rfc1766","0403",0x00000000,"ca;Catalan" +HKCR,"MIME\Database\Rfc1766","0004",0x00000000,"zh;Chinese" +HKCR,"MIME\Database\Rfc1766","0404",0x00000000,"zh-tw;Chinese (Taiwan)" +HKCR,"MIME\Database\Rfc1766","0804",0x00000000,"zh-cn;Chinese (China)" +HKCR,"MIME\Database\Rfc1766","0C04",0x00000000,"zh-hk;Chinese (Hong Kong SAR)" +HKCR,"MIME\Database\Rfc1766","1004",0x00000000,"zh-sg;Chinese (Singapore)" +HKCR,"MIME\Database\Rfc1766","041A",0x00000000,"hr;Croatian" +HKCR,"MIME\Database\Rfc1766","0405",0x00000000,"cs;Czech" +HKCR,"MIME\Database\Rfc1766","0406",0x00000000,"da;Danish" +HKCR,"MIME\Database\Rfc1766","0413",0x00000000,"nl;Dutch (Netherlands)" +HKCR,"MIME\Database\Rfc1766","0813",0x00000000,"nl-be;Dutch (Belgium)" +HKCR,"MIME\Database\Rfc1766","0009",0x00000000,"en;English" +HKCR,"MIME\Database\Rfc1766","0409",0x00000000,"en-us;English (United States)" +HKCR,"MIME\Database\Rfc1766","0809",0x00000000,"en-gb;English (United Kingdom)" +HKCR,"MIME\Database\Rfc1766","0C09",0x00000000,"en-au;English (Australia)" +HKCR,"MIME\Database\Rfc1766","1009",0x00000000,"en-ca;English (Canada)" +HKCR,"MIME\Database\Rfc1766","1409",0x00000000,"en-nz;English (New Zealand)" +HKCR,"MIME\Database\Rfc1766","1809",0x00000000,"en-ie;English (Ireland)" +HKCR,"MIME\Database\Rfc1766","1C09",0x00000000,"en-za;English (South Africa)" +HKCR,"MIME\Database\Rfc1766","2009",0x00000000,"en-jm;English (Jamaica)" +HKCR,"MIME\Database\Rfc1766","2809",0x00000000,"en-bz;English (Belize)" +HKCR,"MIME\Database\Rfc1766","2C09",0x00000000,"en-tt;English (Trinidad)" +HKCR,"MIME\Database\Rfc1766","0425",0x00000000,"et;Estonian" +HKCR,"MIME\Database\Rfc1766","0438",0x00000000,"fo;Faeroese" +HKCR,"MIME\Database\Rfc1766","0429",0x00000000,"fa;Farsi" +HKCR,"MIME\Database\Rfc1766","040B",0x00000000,"fi;Finnish" +HKCR,"MIME\Database\Rfc1766","040C",0x00000000,"fr;French (France)" +HKCR,"MIME\Database\Rfc1766","080C",0x00000000,"fr-be;French (Belgium)" +HKCR,"MIME\Database\Rfc1766","0C0C",0x00000000,"fr-ca;French (Canada)" +HKCR,"MIME\Database\Rfc1766","100C",0x00000000,"fr-ch;French (Switzerland)" +HKCR,"MIME\Database\Rfc1766","140C",0x00000000,"fr-lu;French (Luxembourg)" +HKCR,"MIME\Database\Rfc1766","043C",0x00000000,"gd;Gaelic" +HKCR,"MIME\Database\Rfc1766","0407",0x00000000,"de;German (Germany)" +HKCR,"MIME\Database\Rfc1766","0807",0x00000000,"de-ch;German (Switzerland)" +HKCR,"MIME\Database\Rfc1766","0C07",0x00000000,"de-at;German (Austria)" +HKCR,"MIME\Database\Rfc1766","1007",0x00000000,"de-lu;German (Luxembourg)" +HKCR,"MIME\Database\Rfc1766","1407",0x00000000,"de-li;German (Liechtenstein)" +HKCR,"MIME\Database\Rfc1766","0408",0x00000000,"el;Greek" +HKCR,"MIME\Database\Rfc1766","040D",0x00000000,"he;Hebrew" +HKCR,"MIME\Database\Rfc1766","0439",0x00000000,"hi;Hindi" +HKCR,"MIME\Database\Rfc1766","040E",0x00000000,"hu;Hungarian" +HKCR,"MIME\Database\Rfc1766","040F",0x00000000,"is;Icelandic" +HKCR,"MIME\Database\Rfc1766","0421",0x00000000,"in;Indonesian" +HKCR,"MIME\Database\Rfc1766","0410",0x00000000,"it;Italian (Italy)" +HKCR,"MIME\Database\Rfc1766","0810",0x00000000,"it-ch;Italian (Switzerland)" +HKCR,"MIME\Database\Rfc1766","0411",0x00000000,"ja;Japanese" +HKCR,"MIME\Database\Rfc1766","0412",0x00000000,"ko;Korean" +HKCR,"MIME\Database\Rfc1766","0426",0x00000000,"lv;Latvian" +HKCR,"MIME\Database\Rfc1766","0427",0x00000000,"lt;Lithuanian" +HKCR,"MIME\Database\Rfc1766","042F",0x00000000,"mk;FYRO Macedonian" +HKCR,"MIME\Database\Rfc1766","043E",0x00000000,"ms;Malay (Malaysia)" +HKCR,"MIME\Database\Rfc1766","043A",0x00000000,"mt;Maltese" +HKCR,"MIME\Database\Rfc1766","0414",0x00000000,"no;Norwegian (Bokmal)" +HKCR,"MIME\Database\Rfc1766","0814",0x00000000,"no;Norwegian (Nynorsk)" +HKCR,"MIME\Database\Rfc1766","0415",0x00000000,"pl;Polish" +HKCR,"MIME\Database\Rfc1766","0416",0x00000000,"pt-br;Portuguese (Brazil)" +HKCR,"MIME\Database\Rfc1766","0816",0x00000000,"pt;Portuguese (Portugal)" +HKCR,"MIME\Database\Rfc1766","0417",0x00000000,"rm;Rhaeto-Romanic" +HKCR,"MIME\Database\Rfc1766","0418",0x00000000,"ro;Romanian" +HKCR,"MIME\Database\Rfc1766","0818",0x00000000,"ro-mo;Romanian (Moldova)" +HKCR,"MIME\Database\Rfc1766","0419",0x00000000,"ru;Russian" +HKCR,"MIME\Database\Rfc1766","0819",0x00000000,"ru-mo;Russian (Moldova)" +HKCR,"MIME\Database\Rfc1766","0C1A",0x00000000,"sr;Serbian (Cyrillic)" +HKCR,"MIME\Database\Rfc1766","081A",0x00000000,"sr;Serbian (Latin)" +HKCR,"MIME\Database\Rfc1766","041B",0x00000000,"sk;Slovak" +HKCR,"MIME\Database\Rfc1766","0424",0x00000000,"sl;Slovenian" +HKCR,"MIME\Database\Rfc1766","042E",0x00000000,"sb;Sorbian" +HKCR,"MIME\Database\Rfc1766","040A",0x00000000,"es;Spanish (Traditional Sort)" +HKCR,"MIME\Database\Rfc1766","080A",0x00000000,"es-mx;Spanish (Mexico)" +HKCR,"MIME\Database\Rfc1766","0C0A",0x00000000,"es;Spanish (International Sort)" +HKCR,"MIME\Database\Rfc1766","100A",0x00000000,"es-gt;Spanish (Guatemala)" +HKCR,"MIME\Database\Rfc1766","140A",0x00000000,"es-cr;Spanish (Costa Rica)" +HKCR,"MIME\Database\Rfc1766","180A",0x00000000,"es-pa;Spanish (Panama)" +HKCR,"MIME\Database\Rfc1766","1C0A",0x00000000,"es-do;Spanish (Dominican Republic)" +HKCR,"MIME\Database\Rfc1766","200A",0x00000000,"es-ve;Spanish (Venezuela)" +HKCR,"MIME\Database\Rfc1766","240A",0x00000000,"es-co;Spanish (Colombia)" +HKCR,"MIME\Database\Rfc1766","280A",0x00000000,"es-pe;Spanish (Peru)" +HKCR,"MIME\Database\Rfc1766","2C0A",0x00000000,"es-ar;Spanish (Argentina)" +HKCR,"MIME\Database\Rfc1766","300A",0x00000000,"es-ec;Spanish (Ecuador)" +HKCR,"MIME\Database\Rfc1766","340A",0x00000000,"es-cl;Spanish (Chile)" +HKCR,"MIME\Database\Rfc1766","380A",0x00000000,"es-uy;Spanish (Uruguay)" +HKCR,"MIME\Database\Rfc1766","3C0A",0x00000000,"es-py;Spanish (Paraguay)" +HKCR,"MIME\Database\Rfc1766","400A",0x00000000,"es-bo;Spanish (Bolivia)" +HKCR,"MIME\Database\Rfc1766","440A",0x00000000,"es-sv;Spanish (El Salvador)" +HKCR,"MIME\Database\Rfc1766","480A",0x00000000,"es-hn;Spanish (Honduras)" +HKCR,"MIME\Database\Rfc1766","4C0A",0x00000000,"es-ni;Spanish (Nicaragua)" +HKCR,"MIME\Database\Rfc1766","500A",0x00000000,"es-pr;Spanish (Puerto Rico)" +HKCR,"MIME\Database\Rfc1766","0430",0x00000000,"sx;Sutu" +HKCR,"MIME\Database\Rfc1766","041D",0x00000000,"sv;Swedish" +HKCR,"MIME\Database\Rfc1766","081D",0x00000000,"sv-fi;Swedish (Finland)" +HKCR,"MIME\Database\Rfc1766","041E",0x00000000,"th;Thai" +HKCR,"MIME\Database\Rfc1766","0431",0x00000000,"ts;Tsonga" +HKCR,"MIME\Database\Rfc1766","0432",0x00000000,"tn;Tswana" +HKCR,"MIME\Database\Rfc1766","041F",0x00000000,"tr;Turkish" +HKCR,"MIME\Database\Rfc1766","0422",0x00000000,"uk;Ukrainian" +HKCR,"MIME\Database\Rfc1766","0420",0x00000000,"ur;Urdu" +HKCR,"MIME\Database\Rfc1766","042A",0x00000000,"vi;Vietnamese" +HKCR,"MIME\Database\Rfc1766","0434",0x00000000,"xh;Xhosa" +HKCR,"MIME\Database\Rfc1766","043D",0x00000000,"ji;Yiddish" +HKCR,"MIME\Database\Rfc1766","0435",0x00000000,"zu;Zulu" + +HKCR,"CLSID\{FBF23B42-E3F0-101B-8488-00AA003E56F8}",,,"Internet Explorer(Ver 1.0)" +HKCR,"CLSID\{FBF23B42-E3F0-101B-8488-00AA003E56F8}\LocalServer32",,,"iexplore.exe" +HKCR,"CLSID\{FBF23B42-E3F0-101B-8488-00AA003E56F8}\ProgID",,,"InternetExplorer.Application.1" +HKCR,"CLSID\{FBF23B42-E3F0-101B-8488-00AA003E56F8}\VersionIndependentProgID",,,"InternetExplorer.Application" +HKCR,"InternetExplorer.Application",,,"Internet Explorer(Ver 1.0)" +HKCR,"InternetExplorer.Application\CLSID",,,"{FBF23B42-E3F0-101B-8488-00AA003E56F8}" +HKCR,"InternetExplorer.Application\CurVer",,,"InternetExplorer.Application.1" +HKCR,"InternetExplorer.Application.1",,,"Internet Explorer(Ver 1.0)" +HKCR,"InternetExplorer.Application.1\CLSID",,,"{FBF23B42-E3F0-101B-8488-00AA003E56F8}" + +;HKCR,"CLSID\%CLSID_SearchAssistantOC%",,,"SearchAssistantOC" +;HKCR,"CLSID\%CLSID_SearchAssistantOC%\InProcServer32",,,"shdocvw.dll" +;HKCR,"CLSID\%CLSID_SearchAssistantOC%\InProcServer32","ThreadingModel",,"Apartment" +;HKCR,"CLSID\%CLSID_SearchAssistantOC%\ProgID",,,"SearchAssistantOC.SearchAssistantOC.1" +;HKCR,"CLSID\%CLSID_SearchAssistantOC%\VersionIndependentProgID",,,"SearchAssistantOC.SearchAssistantOC" +;HKCR,"SearchAssistantOC.SearchAssistantOC",,,"" +;HKCR,"SearchAssistantOC.SearchAssistantOC\CLSID",,,"%CLSID_SearchAssistantOC%" +;HKCR,"SearchAssistantOC.SearchAssistantOC\CurVer",,,"SearchAssistantOC.SearchAssistantOC.1" +;HKCR,"SearchAssistantOC.SearchAssistantOC.1",,,"" +;HKCR,"SearchAssistantOC.SearchAssistantOC.1\CLSID",,,"%CLSID_SearchAssistantOC%" + +HKCR,"CLSID\{55136805-B2DE-11D1-B9F2-00A0C98BC547}",,,"Shell Name Space" +HKCR,"CLSID\{55136805-B2DE-11D1-B9F2-00A0C98BC547}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{55136805-B2DE-11D1-B9F2-00A0C98BC547}\InProcServer32","ThreadingModel",,"Apartment" +HKCR,"CLSID\{55136805-B2DE-11D1-B9F2-00A0C98BC547}\ProgID",,,"ShellNameSpace.ShellNameSpace.1" +HKCR,"CLSID\{55136805-B2DE-11D1-B9F2-00A0C98BC547}\VersionIndependentProgID",,,"ShellNameSpace.ShellNameSpace" + +HKCR,"CLSID\{3C374A40-BAE4-11CF-BF7D-00AA006946EE}",,,"Microsoft Url History Service" +HKCR,"CLSID\{3C374A40-BAE4-11CF-BF7D-00AA006946EE}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{3C374A40-BAE4-11CF-BF7D-00AA006946EE}\InProcServer32","ThreadingModel",,"Apartment" + +;HKCR,"CLSID\%CLSID_MruLongList%",,,"MruLongList" +;HKCR,"CLSID\%CLSID_MruLongList%\InProcServer32",,,"shdocvw.dll" +;HKCR,"CLSID\%CLSID_MruLongList%\InProcServer32","ThreadingModel",,"Apartment" + +;HKCR,"CLSID\%CLSID_ShellShellNameSpace%",,,"Shell Name Space" +;HKCR,"CLSID\%CLSID_ShellShellNameSpace%\InProcServer32",,,"shdocvw.dll" +;HKCR,"CLSID\%CLSID_ShellShellNameSpace%\InProcServer32","ThreadingModel",,"Apartment" +;HKCR,"CLSID\%CLSID_ShellShellNameSpace%\ProgID",,,"ShellNameSpace.ShellNameSpace.1" +;HKCR,"CLSID\%CLSID_ShellShellNameSpace%\VersionIndependentProgID",,,"ShellNameSpace.ShellNameSpace" + +HKCR,"CLSID\{729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1}",,,"Microsoft Shell UI Helper" +HKCR,"CLSID\{729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1}\InProcServer32","ThreadingModel",,"Apartment" +HKCR,"CLSID\{729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1}\ProgID",,,"Shell.UIHelper.1" +HKCR,"Shell.UIHelper",,,"Microsoft Shell UI Helper" +HKCR,"Shell.UIHelper\CLSID",,,"{729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1}" +HKCR,"Shell.UIHelper\CurVer",,,"Shell.UIHelper.2" +HKCR,"Shell.UIHelper.1",,,"" +HKCR,"Shell.UIHelper.1\CLSID",,,"{729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1}" + +HKCR,"CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}",,,"Internet Explorer" +HKCR,"CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\InProcServer32","ThreadingModel",,"Apartment" +HKCR,"CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\ShellFolder",,2,"0x24" + +HKCR,"CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}",,,"Microsoft Web Browser" +HKCR,"CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\InProcServer32","ThreadingModel",,"Apartment" +HKCR,"CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\ProgID",,,"Shell.Explorer.2" +HKCR,"CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\VersionIndependentProgID",,,"Shell.Explorer" +HKCR,"Shell.Explorer",,,"Microsoft Web Browser" +HKCR,"Shell.Explorer\CLSID",,,"{8856F961-340A-11D0-A96B-00C04FD705A2}" +HKCR,"Shell.Explorer\CurVer",,,"Shell.Explorer.2" +HKCR,"Shell.Explorer.2",,,"" +HKCR,"Shell.Explorer.2\CLSID",,,"{8856F961-340A-11D0-A96B-00C04FD705A2}" + +HKCR,"CLSID\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}",,,"ShellWindows" +HKCR,"CLSID\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}\InProcServer32","ThreadingModel",,"Apartment" + +;HKCR,"CLSID\%CLSID_MicrosoftBrowserArchitecture%",,,"Microsoft Browser Architecture" +;HKCR,"CLSID\%CLSID_MicrosoftBrowserArchitecture%\InProcServer32",,,"shdocvw.dll" +;HKCR,"CLSID\%CLSID_MicrosoftBrowserArchitecture%\InProcServer32","ThreadingModel",,"Apartment" + +;HKCR,"CLSID\%CLSID_ShellSearchAssistantOC%",,,"SearchAssistantOC" +;HKCR,"CLSID\%CLSID_ShellSearchAssistantOC%\InProcServer32",,,"shdocvw.dll" +;HKCR,"CLSID\%CLSID_ShellSearchAssistantOC%\InProcServer32","ThreadingModel",,"Apartment" +;HKCR,"CLSID\%CLSID_ShellSearchAssistantOC%\ProgID",,,"SearchAssistantOC.SearchAssistantOC.1" +;HKCR,"CLSID\%CLSID_ShellSearchAssistantOC%\VersionIndependentProgID",,,"SearchAssistantOC.SearchAssistantOC" + +HKCR,"CLSID\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B0}",,,"Microsoft Web Browser Version 1" +HKCR,"CLSID\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B0}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B0}\InProcServer32","ThreadingModel",,"Apartment" +HKCR,"CLSID\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B0}\ProgID",,,"Shell.Explorer.1" +HKCR,"CLSID\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B0}\VersionIndependentProgID",,,"Shell.Explorer" +HKCR,"Shell.Explorer.1",,,"" +HKCR,"Shell.Explorer.1\CLSID",,,"{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B0}" +HKCR,"CLSID\{FBF23B40-E3F0-101B-8488-00AA003E56F8}",,,"Internet Shortcut" +HKCR,"CLSID\{FBF23B40-E3F0-101B-8488-00AA003E56F8}\InProcServer32",,,"shdocvw.dll" +HKCR,"CLSID\{FBF23B40-E3F0-101B-8488-00AA003E56F8}\InProcServer32","ThreadingModel",,"Apartment" +HKCR,"CLSID\{FBF23B40-E3F0-101B-8488-00AA003E56F8}\ProgID",,,"InternetShortcut" +HKCR,"CLSID\{FBF23B40-E3F0-101B-8488-00AA003E56F8}\shellex\MayChangeDefaultMenu",,, +HKCR,"InternetShortcut",,,"Internet Shortcut" +HKCR,"InternetShortcut","EditFlags",2,"2" +HKCR,"InternetShortcut","IsShortcut",, +HKCR,"InternetShortcut","NeverShowExt",, +;HKCR,"InternetShortcut\CLSID",,,"%CLSID_InteretShortcut%" +HKCR,"InternetShortcut\DefaultIcon",,,"url.dll,0" +HKCR,"InternetShortcut\shell\open\command",,,"rundll32.exe shdocvw.dll,OpenURL %l" +HKCR,"InternetShortcut\shell\print\command",,,"rundll32.exe mshtml.dll,PrintHTML \"%1\"" +HKCR,"InternetShortcut\shell\printto\command",,,"rundll32.exe mshtml.dll,PrintHTML \"%1\" \"%2\" \"%3\" \"%4\"" + +; EOF diff --git a/reactos/boot/bootdata/hivedef_amd64.inf b/reactos/boot/bootdata/hivedef_amd64.inf new file mode 100644 index 00000000000..6a05c2d462f --- /dev/null +++ b/reactos/boot/bootdata/hivedef_amd64.inf @@ -0,0 +1,282 @@ +[Version] +Signature="$ReactOS$ + +[AddReg] + +HKCU,"Control Panel",,0x00000012 +HKCU,"Control Panel\Appearance",,0x00000012 +HKCU,"Control Panel\Mouse","MouseTrails",0x00010001,0x00000000 +HKCU,"Control Panel\Mouse","SnapToDefaultButton",0x00010001,0x00000000 +HKCU,"Control Panel\Mouse","MouseSpeed",0x00010001,0x00000001 +HKCU,"Control Panel\Mouse","MouseThreshold1",0x00010001,0x00000006 +HKCU,"Control Panel\Mouse","MouseThreshold2",0x00010001,0x0000000A +HKCU,"Control Panel\Mouse","DoubleClickSpeed",0x00010001,0x000001E0 +HKCU,"Control Panel\Mouse","SwapMouseButtons",0x00010001,0x00000000 + +HKCU,"Control Panel\Desktop","AutoEndTasks",0x00000002,"0" +HKCU,"Control Panel\Desktop","CursorBlinkRate",0x00000002,"530" +HKCU,"Control Panel\Desktop","DragFullWindows",0x00000002,"0" +HKCU,"Control Panel\Desktop","PaintDesktopVersion",0x00010001,"0" +HKCU,"Control Panel\Desktop","HungAppTimeout",0x00000002,"5000" +HKCU,"Control Panel\Desktop","SCRNSAVE.EXE",0x00000000,"" +HKCU,"Control Panel\Desktop","WaitToKillAppTimeout",0x00000002,"20000" +HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,"" +HKCU,"Control Panel\International",,0x00000012 +HKCU,"Control Panel\International","Locale",0x00000000,"0409" +HKCU,"Control Panel\International\Geo","Nation",0x00000000,"1" + +;Cursors Schemes +HKCU,"Control Panel\Cursors",,,"ReactOS Default" +HKCU,"Control Panel\Cursors","Scheme Source",0x00010001,0x00000002 + +;PowerCfg +HKCU,"Control Panel\PowerCfg","CurrentPowerPolicy",0x00000002,"0" +HKCU,"Control Panel\PowerCfg\GlobalPowerPolicy","Policies",0x00000001,01,00,00,00,03,\ +00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,03,00,00,00,00,00,00,00,02,00,00,00,03,\ +00,00,00,00,00,00,00,02,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,\ +00,00,80,00,00,00,00,01,00,00,00,00,00,00,80,01,00,00,00,03,00,00,00,02,00,00,00,04,\ +00,00,c0,01,00,00,00,04,00,00,00,01,00,00,00,0a,00,00,00,00,00,00,00,03,00,00,00,01,\ +00,01,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,00,16,\ +00,00,00 +HKCU,"Control Panel\PowerCfg\PowerPolicies\0","Name",0x00020000,"Home/Office Desk" +HKCU,"Control Panel\PowerCfg\PowerPolicies\0","Description",0x00020000,"This scheme is suited to most home or desktop computers that are left plugged in all the time." +HKCU,"Control Panel\PowerCfg\PowerPolicies\0","Policies",0x00000001,01,00,00,00,02,\ +00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,2c,\ +01,00,00,32,32,00,03,04,00,00,00,04,00,00,00,00,00,00,00,00,00,00,00,b0,04,00,00,2c,\ +01,00,00,00,00,00,00,58,02,00,00,01,01,64,50,64,64,00,00 + +; Color schemes +HKCU,"Control Panel\Current","Color Schemes",0x00020000,"ReactOS Standard" +HKCU,"Control Panel\Appearance","Current",0x00020000,"ReactOS Standard" +HKCU,"Control Panel\Appearance","NewCurrent",0x00020000,"ReactOS Standard" +HKCU,"Control Panel\Appearance\New Schemes","SelectedStyle",0x00020000,"0" +; ReactOS Standard +HKCU,"Control Panel\Appearance\New Schemes\0","DisplayName",0x00020000,"@themeui.dll,-883" +HKCU,"Control Panel\Appearance\New Schemes\0","SelectedSize",0x00020000,"0" +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","DisplayName",0x00020000,"@themeui.dll,-2019" +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Flat Menus",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Font #0",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,00,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,61,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Font #1",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,00,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,61,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Font #2",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,61,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Font #4",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,61,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Font #5",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,61,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Font #3",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,61,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #0",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #1",0x00010001,0x00a56e3a +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #2",0x00010001,0x006a240a +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #3",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #4",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #5",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #6",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #7",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #8",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #9",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #10",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #11",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #12",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #13",0x00010001,0x006a240a +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #14",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #15",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #16",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #17",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #18",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #19",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #20",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #21",0x00010001,0x00404040 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #22",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #23",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #24",0x00010001,0x00e1ffff +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #25",0x00010001,0x00b5b5b5 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #26",0x00010001,0x00800000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #27",0x00010001,0x00f0caa6 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #28",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #29",0x00010001,0x006a240a +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Color #30",0x00010001,0x00c8d0d4 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","Contrast",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\0\Sizes\0","LegacyName",0x00020000,"ReactOS Standard" +; ReactOS Classic +HKCU,"Control Panel\Appearance\New Schemes\1","DisplayName",0x00020000,"@themeui.dll,-880" +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","DisplayName",0x00020000,"@themeui.dll,-2019" +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Flat Menus",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Font #0",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,00,00,00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,\ +00,6f,00,66,00,74,00,20,00,53,00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,00,00,fc,\ +7f,22,14,fc,7f,b0,fe,12,00,00,00,00,00,00,00,00,00,98,23,eb,77 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Font #1",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,00,00,00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,\ +00,6f,00,66,00,74,00,20,00,53,00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,00,00,f0,\ +77,00,20,14,00,00,00,00,10,80,05,14,00,f0,1f,14,00,00,00,14,00 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Font #2",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,\ +00,6f,00,66,00,74,00,20,00,53,00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,00,00,14,\ +00,88,fb,e8,77,02,02,00,00,ac,b9,f0,77,00,00,00,00,20,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Font #4",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,\ +00,6f,00,66,00,74,00,20,00,53,00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,7c,6b,e8,77,00,00,00,00 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Font #5",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,\ +00,6f,00,66,00,74,00,20,00,53,00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,00,00,00,\ +00,06,00,00,00,18,00,00,00,ff,ff,ff,ff,f0,4b,21,fc,00,c4,f0,77 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Font #3",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,\ +00,6f,00,66,00,74,00,20,00,53,00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,00,00,14,\ +00,0b,00,00,00,00,ff,12,00,50,00,00,00,c0,fe,12,00,0c,10,00,01 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #0",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #1",0x00010001,0x00a56e3a +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #2",0x00010001,0x00800000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #3",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #4",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #5",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #6",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #7",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #8",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #9",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #10",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #11",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #12",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #13",0x00010001,0x00800000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #14",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #15",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #16",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #17",0x00010001,0x00808080 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #18",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #19",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #20",0x00010001,0x00ffffff +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #21",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #22",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #23",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #24",0x00010001,0x00e1ffff +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #25",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #26",0x00010001,0x00800000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #27",0x00010001,0x00d08410 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #28",0x00010001,0x00b5b5b5 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #29",0x00010001,0x00800000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Color #30",0x00010001,0x00c0c0c0 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","Contrast",0x00010001,0x00000000 +HKCU,"Control Panel\Appearance\New Schemes\1\Sizes\0","LegacyName",0x00020000,"ReactOS Classic" + +HKCU,"Environment",,0x00000012 +HKCU,"Environment","TEMP",0x00020000,"%USERPROFILE%\Local Settings\Temp" +HKCU,"Environment","TMP",0x00020000,"%USERPROFILE%\Local Settings\Temp" + +HKCU,"SOFTWARE",,0x00000012 +HKCU,"SOFTWARE\Microsoft",,0x00000012 + +; DirectX version report as DirectX 9.0 +HKCU,"SOFTWARE\Microsoft\DirectX","Debug",0x00010001,0x00000000 +HKCU,"SOFTWARE\Microsoft\DirectX","InstalledVersion",0x00000001,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00 +HKCU,"SOFTWARE\Microsoft\DirectX","InstallMDX",0x00010001,0x00000001 +HKCU,"SOFTWARE\Microsoft\DirectX","RC",0x00010001,0x00000000 +HKCU,"SOFTWARE\Microsoft\DirectX","Version",0x00000000,"5.03.2600.2180" + +; Open With settings +HKCU,"SOFTWARE\Classes",,0x00000012 +HKCU,"SOFTWARE\Classes\Applications",,0x00000012 + +; Current user shell folder settings +HKCU,"SOFTWARE\Microsoft\Windows",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu","{208D2C60-3AEA-1069-A2D7-08002B30309D}",0x00010001,0x00000000 +HKCU,"Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",,0x00000012 + + +HKCU,"SOFTWARE\Microsoft\Windows NT",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion",,0x00000012 + +; application compatibility settings for Windows 95 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN95","MajorVersion",0x00010001,0x00000004 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN95","MinorVersion",0x00010001,0x0000000A +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN95","BuildNumber",0x00010001,0x000003B6 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN95","PlatformId",0x00010001,0x00000001 +; application compatibility settings for Windows 98/ME +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN98","MajorVersion",0x00010001,0x00000004 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN98","MinorVersion",0x00010001,0x00000000 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN98","BuildNumber",0x00010001,0x000008AE +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN98","PlatformId",0x00010001,0x00000001 +; application compatibility settings for Windows NT 4 Service Pack 5 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\NT4SP5","MajorVersion",0x00010001,0x00000004 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\NT4SP5","MinorVersion",0x00010001,0x00000000 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\NT4SP5","BuildNumber",0x00010001,0x00000565 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\NT4SP5","PlatformId",0x00010001,0x00000002 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\NT4SP5","SPMajorVersion",0x00010001,0x00000005 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\NT4SP5","SPMinorVersion",0x00010001,0x00000000 +; application compatibility settings for Windows 2000 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN2000","MajorVersion",0x00010001,0x00000005 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN2000","MinorVersion",0x00010001,0x00000000 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN2000","BuildNumber",0x00010001,0x00000893 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN2000","PlatformId",0x00010001,0x00000002 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN2000","SPMajorVersion",0x00010001,0x00000003 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WIN2000","SPMinorVersion",0x00010001,0x00000000 +; application compatibility settings for Windows XP +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WINXP","MajorVersion",0x00010001,0x00000005 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WINXP","MinorVersion",0x00010001,0x00000001 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WINXP","BuildNumber",0x00010001,0x00000A28 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WINXP","PlatformId",0x00010001,0x00000002 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WINXP","SPMajorVersion",0x00010001,0x00000001 +HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\WINXP","SPMinorVersion",0x00010001,0x00000000 + +; DEBUG: Windows Messages SPY configuration +HKCU,"SOFTWARE\ReactOS\Debug","SpyInclude",0x00020000,"INCLUDEALL" +;HKCU,"SOFTWARE\ReactOS\Debug","SpyExclude",0x00020000,"" +;HKCU,"SOFTWARE\ReactOS\Debug","SpyExcludeDWP",0x00020000,"" + +; GUI Setup + +HKCU, "Control Panel\Desktop\WindowMetrics","CaptionFont",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,01,00,00,00,00,54,00,61,00,68,00,6f,00,6d,\ +00,61,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU, "Control Panel\Desktop\WindowMetrics","IconFont",0x00000001,f5,ff,ff,ff,00,00,00,00,\ +00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,01,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,\ +61,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU, "Control Panel\Desktop\WindowMetrics","MenuFont",0x00000001,f5,ff,ff,ff,00,00,00,00,\ +00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,01,00,00,00,00,54,00,61,00,68,00,6f,00,6d,00,\ +61,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU, "Control Panel\Desktop\WindowMetrics","MessageFont",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,01,00,00,00,00,54,00,61,00,68,00,6f,00,6d,\ +00,61,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU, "Control Panel\Desktop\WindowMetrics","SmCaptionFont",0x00000001,f5,ff,ff,ff,00,00,\ +00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,01,00,00,00,00,54,00,61,00,68,00,6f,00,\ +6d,00,61,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 +HKCU, "Control Panel\Desktop\WindowMetrics","StatusFont",0x00000001,f5,ff,ff,ff,00,00,00,\ +00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,01,00,00,00,00,54,00,61,00,68,00,6f,00,6d,\ +00,61,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ +00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 + +; Internet Explorer + +HKCU,"Software\Microsoft\Internet Explorer\Main","Start Page",,"http://www.reactos.org" +HKCU,"Software\Microsoft\Internet Explorer\Main","Search Page",,"http://www.google.com" + + +; EOF diff --git a/reactos/boot/bootdata/hivesft_amd64.inf b/reactos/boot/bootdata/hivesft_amd64.inf new file mode 100644 index 00000000000..fea8b84e020 --- /dev/null +++ b/reactos/boot/bootdata/hivesft_amd64.inf @@ -0,0 +1,1076 @@ +[Version] +Signature="$ReactOS$ + +[AddReg] + +; Internet Explorer +HKLM,"Software\Microsoft\Internet Explorer","Version",,"6.0.2900.2180" + +; DirectX +HKLM,"SOFTWARE\Microsoft\DirectX","Version",0x00000000,"4.09.00.0904" + +; RPC +HKLM,Software\Microsoft\Rpc\SecurityService,1,2,"secur32.dll" +HKLM,Software\Microsoft\Rpc\SecurityService,10,2,"secur32.dll" +HKLM,Software\Microsoft\Rpc\SecurityService,14,2,"schannel.dll" +HKLM,Software\Microsoft\Rpc\SecurityService,16,2,"secur32.dll" +HKLM,Software\Microsoft\Rpc\SecurityService,18,2,"secur32.dll" +HKLM,Software\Microsoft\Rpc\SecurityService,68,2,"netlogon.dll" +HKLM,Software\Microsoft\Rpc\SecurityService,9,2,"secur32.dll" + +; HTML Help +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},,2,"HTML Help" +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"ComponentID",2,"HTMLHelp" +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"IsInstalled",2,1 +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Locale",2,"*" +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Version",2,"4,74,9273,0" + +; Common shell folders +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,0x00000012 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",,0x00000012 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu","{208D2C60-3AEA-1069-A2D7-08002B30309D}",0x00010001,0x00000000 + +; CMD Settings +HKLM,"SOFTWARE\Microsoft\Command Processor","AutoRun",0x00020000,"" + +; Uninstall Application list +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",,0x00000010 + +HKLM,"SOFTWARE\Microsoft\Rpc",,0x00000012 + +; Version Information +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","CurrentVersion",0x00020000,"5.0" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion",0x00020000,"Service Pack 3" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","CurrentBuildNumber",0x00020000,"2195" + + +; Image File Execution Options (NtGlobalFlag with FLG_SHOW_LDR_SNAPS set for loadlib.exe) +HKLM,"Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\loadlib.exe","GlobalFlag",0x00000000,"0x00000002" +;HKLM,"Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\loaddll.exe","GlobalFlag",0x00000000,"0x00000002" +;HKLM,"Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\soffice.exe","GlobalFlag",0x00000000,"0x00000002" +;HKLM,"Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\tlstest.exe","GlobalFlag",0x00000000,"0x00000002" + +; MME - TODO: Should not require full paths! +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","midimapper",0x00000000,"c:\reactos\system32\midimap.dll" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","wavemapper",0x00000000,"c:\reactos\system32\msacm32.dll" +;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","wave",0x00000000,"sndblst.dll" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","midi",0x00000000,"c:\reactos\system32\beepmidi.dll" + +; Mesa OpenGL Driver +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers","DefaultDriver",0x00000000,"Mesa" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\Mesa","Version",0x00010001,0x00000002 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\Mesa","Dll",0x00000000,"mesa32" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\Mesa","DriverVersion",0x00010001,0x00000010 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\Mesa","Flags",0x00010001,0x00000001 + +; User Profile List +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList",,0x00000012 +;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList","ProfilesDirectory",0x00020000,"%SystemDrive%\Documents and Settings" + +; Font substitutes +; SysFontSubstitutes are also returned by EnumFontFamilies, FontSubstitutes aren't +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SysFontSubstitutes",,0x00000012 + +; Time zone settings +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones",,0x00000012 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones","IndexMapping",0x00010000,\ + "409", "4",\ + "1009", "4",\ + "2809", "20",\ + "80a", "30",\ + "440a", "30",\ + "480a", "30",\ + "4c0a", "30",\ + "140a", "30",\ + "100a", "33",\ + "c0c", "35",\ + "2009", "35",\ + "240a", "45",\ + "280a", "45",\ + "300a", "45",\ + "180a", "45",\ + "500a", "50",\ + "2409", "50",\ + "1c0a", "50",\ + "2c09", "50",\ + "200a", "55",\ + "3c0a", "55",\ + "400a", "55",\ + "340a", "56",\ + "416", "65",\ + "2c0a", "70",\ + "380a", "70",\ + "438", "85",\ + "809", "85",\ + "816", "85",\ + "1809", "85",\ + "40f", "90",\ + "1801", "90",\ + "41c", "95",\ + "405", "95",\ + "40e", "95",\ + "424", "95",\ + "41b", "95",\ + "81a", "95",\ + "c1a", "95",\ + "415", "100",\ + "1401", "100",\ + "41a", "100",\ + "42f", "100",\ + "140c", "100",\ + "180c", "100",\ + "1c01", "100",\ + "403", "105",\ + "406", "105",\ + "813", "105",\ + "827", "105",\ + "40a", "105",\ + "40c", "105",\ + "42d", "105",\ + "80c", "105",\ + "c0a", "105",\ + "407", "110",\ + "410", "110",\ + "413", "110",\ + "414", "110",\ + "807", "110",\ + "810", "110",\ + "814", "110",\ + "1007", "110",\ + "1407", "110",\ + "41d", "110",\ + "c07", "110",\ + "100c", "110",\ + "1001", "115",\ + "2801", "115",\ + "3001", "115",\ + "43e", "115",\ + "2c01", "115",\ + "423", "115",\ + "c01", "120",\ + "425", "125",\ + "426", "125",\ + "40b", "125",\ + "81d", "125",\ + "422", "125",\ + "402", "125",\ + "427", "125",\ + "408", "130",\ + "41f", "130",\ + "418", "130",\ + "40d", "135",\ + "436", "140",\ + "3009", "140",\ + "1c09", "140",\ + "419", "145",\ + "401", "150",\ + "4001", "150",\ + "3c01", "150",\ + "3401", "150",\ + "441", "155",\ + "801", "158",\ + "2401", "158",\ + "429", "160",\ + "2001", "165",\ + "3801", "165",\ + "420", "185",\ + "439", "190",\ + "421", "205",\ + "41e", "205",\ + "42a", "205",\ + "804", "210",\ + "c04", "210",\ + "1404", "210",\ + "83e", "210",\ + "1004", "215",\ + "404", "220",\ + "3409", "220",\ + "412", "230",\ + "812", "230",\ + "411", "235",\ + "c09", "255",\ + "1409", "290" + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Dateline Standard Time","Display",0x00000000,"(GMT-12:00) International Date Line West" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Dateline Standard Time","Dlt",0x00000000,"Dateline Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Dateline Standard Time","Std",0x00000000,"Dateline Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Dateline Standard Time","Index",0x00010001,0 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Dateline Standard Time","TZI",0x00000001,\ +0xd0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Samoa Standard Time","Display",0x00000000,"(GMT-11:00) Midway Island, Samoa" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Samoa Standard Time","Dlt",0x00000000,"Samoa Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Samoa Standard Time","Std",0x00000000,"Samoa Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Samoa Standard Time","Index",0x00010001,1 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Samoa Standard Time","TZI",0x00000001,\ +0x94,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Hawaiian Standard Time","Display",0x00000000,"(GMT-10:00) Hawaii" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Hawaiian Standard Time","Dlt",0x00000000,"Hawaiian Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Hawaiian Standard Time","Std",0x00000000,"Hawaiian Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Hawaiian Standard Time","Index",0x00010001,2 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Hawaiian Standard Time","TZI",0x00000001,\ +0x58,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Alaskan Standard Time","Display",0x00000000,"(GMT-09:00) Alaska" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Alaskan Standard Time","Dlt",0x00000000,"Alaskan Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Alaskan Standard Time","Std",0x00000000,"Alaskan Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Alaskan Standard Time","Index",0x00010001,3 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Alaskan Standard Time","TZI",0x00000001,\ +0x1c,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time","Display",0x00000000,"(GMT-08:00) Pacific Time (US & Canada)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time","Dlt",0x00000000,"Pacific Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time","Std",0x00000000,"Pacific Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time","Index",0x00010001,4 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time","TZI",0x00000001,\ +0xe0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time","Display",0x00000000,"(GMT-07:00) Mountain Time (US & Canada)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time","Dlt",0x00000000,"Mountain Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time","Std",0x00000000,"Mountain Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time","Index",0x00010001,10 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time","TZI",0x00000001,\ +0xa4,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time (Mexico)","Display",0x00000000,"(GMT-07:00) Chihuahua, La Paz, Mazatlan" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time (Mexico)","Dlt",0x00000000,"Mountain Daylight Time (Mexico)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time (Mexico)","Std",0x00000000,"Mountain Standard Time (Mexico)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time (Mexico)","Index",0x00010001,13 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time (Mexico)","TZI",0x00000001,\ +0xa4,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time","Display",0x00000000,"(GMT-07:00) Arizona" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time","Dlt",0x00000000,"US Mountain Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time","Std",0x00000000,"US Mountain Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time","Index",0x00010001,15 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Mountain Standard Time","TZI",0x00000001,\ +0xa4,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time","Display",0x00000000,"(GMT-06:00) Central Time (US & Canada)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time","Dlt",0x00000000,"Central Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time","Std",0x00000000,"Central Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time","Index",0x00010001,20 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time","TZI",0x00000001,\ +0x68,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Canada Central Standard Time","Display",0x00000000,"(GMT-06:00) Saskatchewan" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Canada Central Standard Time","Dlt",0x00000000,"Canada Central Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Canada Central Standard Time","Std",0x00000000,"Canada Central Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Canada Central Standard Time","Index",0x00010001,25 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Canada Central Standard Time","TZI",0x00000001,\ +0x68,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time (Mexico)","Display",0x00000000,"(GMT-06:00) Guadalajara, Mexico City, Monterrey" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time (Mexico)","Dlt",0x00000000,"Central Daylight Time (Mexico)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time (Mexico)","Std",0x00000000,"Central Standard Time (Mexico)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time (Mexico)","Index",0x00010001,30 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time (Mexico)","TZI",0x00000001,\ +0x68,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central America Standard Time","Display",0x00000000,"(GMT-06:00) Central America" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central America Standard Time","Dlt",0x00000000,"Central America Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central America Standard Time","Std",0x00000000,"Central America Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central America Standard Time","Index",0x00010001,33 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central America Standard Time","TZI",0x00000001,\ +0x68,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time","Display",0x00000000,"(GMT-05:00) Eastern Time (US & Canada)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time","Dlt",0x00000000,"Eastern Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time","Std",0x00000000,"Eastern Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time","Index",0x00010001,35 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time","TZI",0x00000001,\ +0x2c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time","Display",0x00000000,"(GMT-05:00) Indiana (East)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time","Dlt",0x00000000,"US Eastern Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time","Std",0x00000000,"US Eastern Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time","Index",0x00010001,40 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\US Eastern Standard Time","TZI",0x00000001,\ +0x2c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Pacific Standard Time","Display",0x00000000,"(GMT-05:00) Bogota, Lima, Quito, Rio Branco" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Pacific Standard Time","Dlt",0x00000000,"SA Pacific Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Pacific Standard Time","Std",0x00000000,"SA Pacific Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Pacific Standard Time","Index",0x00010001,45 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Pacific Standard Time","TZI",0x00000001,\ +0x2c,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Atlantic Standard Time","Display",0x00000000,"(GMT-04:00) Atlantic Time (Canada)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Atlantic Standard Time","Dlt",0x00000000,"Atlantic Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Atlantic Standard Time","Std",0x00000000,"Atlantic Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Atlantic Standard Time","Index",0x00010001,50 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Atlantic Standard Time","TZI",0x00000001,\ +0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Western Standard Time","Display",0x00000000,"(GMT-04:00) La Paz" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Western Standard Time","Dlt",0x00000000,"SA Western Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Western Standard Time","Std",0x00000000,"SA Western Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Western Standard Time","Index",0x00010001,55 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Western Standard Time","TZI",0x00000001,\ +0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific SA Standard Time","Display",0x00000000,"(GMT-04:00) Santiago" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific SA Standard Time","Dlt",0x00000000,"Pacific SA Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific SA Standard Time","Std",0x00000000,"Pacific SA Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific SA Standard Time","Index",0x00010001,56 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific SA Standard Time","TZI",0x00000001,\ +0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x03,0x00,0x06,0x00,0x02,0x00,0x17,0x00,0x3b,0x00,0x3b,0x00,0xe7,0x03,\ +0x00,0x00,0x0a,0x00,0x06,0x00,0x02,0x00,0x17,0x00,0x3b,0x00,0x3b,0x00,0xe7,0x03 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Newfoundland Standard Time","Display",0x00000000,"(GMT-03:30) Newfoundland" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Newfoundland Standard Time","Dlt",0x00000000,"Newfoundland Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Newfoundland Standard Time","Std",0x00000000,"Newfoundland Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Newfoundland Standard Time","Index",0x00010001,60 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Newfoundland Standard Time","TZI",0x00000001,\ +0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time","Display",0x00000000,"(GMT-03:00) Brasilia" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time","Dlt",0x00000000,"E. South America Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time","Std",0x00000000,"E. South America Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time","Index",0x00010001,65 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time","TZI",0x00000001,\ +0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Eastern Standard Time","Display",0x00000000,"(GMT-03:00) Buenos Aires, Georgetown" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Eastern Standard Time","Dlt",0x00000000,"SA Eastern Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Eastern Standard Time","Std",0x00000000,"SA Eastern Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Eastern Standard Time","Index",0x00010001,70 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Eastern Standard Time","TZI",0x00000001,\ +0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenland Standard Time","Display",0x00000000,"(GMT-03:00) Greenland" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenland Standard Time","Dlt",0x00000000,"Greenland Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenland Standard Time","Std",0x00000000,"Greenland Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenland Standard Time","Index",0x00010001,73 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenland Standard Time","TZI",0x00000001,\ +0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mid-Atlantic Standard Time","Display",0x00000000,"(GMT-02:00) Mid-Atlantic" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mid-Atlantic Standard Time","Dlt",0x00000000,"Mid-Atlantic Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mid-Atlantic Standard Time","Std",0x00000000,"Mid-Atlantic Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mid-Atlantic Standard Time","Index",0x00010001,75 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mid-Atlantic Standard Time","TZI",0x00000001,\ +0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x09,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Azores Standard Time","Display",0x00000000,"(GMT-01:00) Azores" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Azores Standard Time","Dlt",0x00000000,"Azores Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Azores Standard Time","Std",0x00000000,"Azores Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Azores Standard Time","Index",0x00010001,80 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Azores Standard Time","TZI",0x00000001,\ +0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cape Verde Standard Time","Display",0x00000000,"(GMT-01:00) Cape Verde Is." +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cape Verde Standard Time","Dlt",0x00000000,"Cape Verde Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cape Verde Standard Time","Std",0x00000000,"Cape Verde Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cape Verde Standard Time","Index",0x00010001,83 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cape Verde Standard Time","TZI",0x00000001,\ +0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GMT Standard Time","Display",0x00000000,"(GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GMT Standard Time","Dlt",0x00000000,"GMT Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GMT Standard Time","Std",0x00000000,"GMT Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GMT Standard Time","Index",0x00010001,85 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GMT Standard Time","TZI",0x00000001,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenwich Standard Time","Display",0x00000000,"(GMT) Casablanca, Monrovia, Reykjavik" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenwich Standard Time","Dlt",0x00000000,"Greenwich Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenwich Standard Time","Std",0x00000000,"Greenwich Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenwich Standard Time","Index",0x00010001,90 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenwich Standard Time","TZI",0x00000001,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Europe Standard Time","Display",0x00000000,"(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Europe Standard Time","Dlt",0x00000000,"Central Europe Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Europe Standard Time","Std",0x00000000,"Central Europe Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Europe Standard Time","Index",0x00010001,95 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Europe Standard Time","TZI",0x00000001,\ +0xc4,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central European Standard Time","Display",0x00000000,"(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central European Standard Time","Dlt",0x00000000,"Central European Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central European Standard Time","Std",0x00000000,"Central European Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central European Standard Time","Index",0x00010001,100 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central European Standard Time","TZI",0x00000001,\ +0xc4,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Romance Standard Time","Display",0x00000000,"(GMT+01:00) Brussels, Copenhagen, Madrid, Paris" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Romance Standard Time","Dlt",0x00000000,"Romance Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Romance Standard Time","Std",0x00000000,"Romance Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Romance Standard Time","Index",0x00010001,105 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Romance Standard Time","TZI",0x00000001,\ +0xc4,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Europe Standard Time","Display",0x00000000,"(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Europe Standard Time","Dlt",0x00000000,"W. Europe Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Europe Standard Time","Std",0x00000000,"W. Europe Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Europe Standard Time","Index",0x00010001,110 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Europe Standard Time","TZI",0x00000001,\ +0xc4,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Europe Standard Time","Display",0x00000000,"(GMT+02:00) Minsk" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Europe Standard Time","Dlt",0x00000000,"E. Europe Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Europe Standard Time","Std",0x00000000,"E. Europe Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Europe Standard Time","Index",0x00010001,115 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Europe Standard Time","TZI",0x00000001,\ +0x88,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Egypt Standard Time","Display",0x00000000,"(GMT+02:00) Cairo" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Egypt Standard Time","Dlt",0x00000000,"Egypt Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Egypt Standard Time","Std",0x00000000,"Egypt Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Egypt Standard Time","Index",0x00010001,120 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Egypt Standard Time","TZI",0x00000001,\ +0x88,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x09,0x00,0x04,0x00,0x05,0x00,0x17,0x00,0x3b,0x00,0x3b,0x00,0x00,0x00,\ +0x00,0x00,0x04,0x00,0x04,0x00,0x05,0x00,0x17,0x00,0x3b,0x00,0x3b,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\FLE Standard Time","Display",0x00000000,"(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\FLE Standard Time","Dlt",0x00000000,"FLE Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\FLE Standard Time","Std",0x00000000,"FLE Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\FLE Standard Time","Index",0x00010001,125 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\FLE Standard Time","TZI",0x00000001,\ +0x88,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GTB Standard Time","Display",0x00000000,"(GMT+02:00) Athens, Bucharest, Istanbul" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GTB Standard Time","Dlt",0x00000000,"GTB Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GTB Standard Time","Std",0x00000000,"GTB Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GTB Standard Time","Index",0x00010001,130 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GTB Standard Time","TZI",0x00000001,\ +0x88,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time","Display",0x00000000,"(GMT+02:00) Jerusalem" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time","Dlt",0x00000000,"Israel Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time","Std",0x00000000,"Israel Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time","Index",0x00010001,135 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time","TZI",0x00000001,\ +0x88,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x05,0x00,0x05,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x05,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\South Africa Standard Time","Display",0x00000000,"(GMT+02:00) Harare, Pretoria" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\South Africa Standard Time","Dlt",0x00000000,"South Africa Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\South Africa Standard Time","Std",0x00000000,"South Africa Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\South Africa Standard Time","Index",0x00010001,140 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\South Africa Standard Time","TZI",0x00000001,\ +0x88,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Russian Standard Time","Display",0x00000000,"(GMT+03:00) Moscow, St. Petersburg, Volgograd" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Russian Standard Time","Dlt",0x00000000,"Russian Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Russian Standard Time","Std",0x00000000,"Russian Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Russian Standard Time","Index",0x00010001,145 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Russian Standard Time","TZI",0x00000001,\ +0x4c,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arab Standard Time","Display",0x00000000,"(GMT+03:00) Kuwait, Riyadh" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arab Standard Time","Dlt",0x00000000,"Arab Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arab Standard Time","Std",0x00000000,"Arab Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arab Standard Time","Index",0x00010001,150 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arab Standard Time","TZI",0x00000001,\ +0x4c,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Africa Standard Time","Display",0x00000000,"(GMT+03:00) Nairobi" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Africa Standard Time","Dlt",0x00000000,"E. Africa Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Africa Standard Time","Std",0x00000000,"E. Africa Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Africa Standard Time","Index",0x00010001,155 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Africa Standard Time","TZI",0x00000001,\ +0x4c,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabic Standard Time","Display",0x00000000,"(GMT+03:00) Baghdad" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabic Standard Time","Dlt",0x00000000,"Arabic Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabic Standard Time","Std",0x00000000,"Arabic Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabic Standard Time","Index",0x00010001,158 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabic Standard Time","TZI",0x00000001,\ +0x4c,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time","Display",0x00000000,"(GMT+03:30) Tehran" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time","Dlt",0x00000000,"Iran Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time","Std",0x00000000,"Iran Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time","Index",0x00010001,160 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time","TZI",0x00000001,\ +0x2e,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabian Standard Time","Display",0x00000000,"(GMT+04:00) Abu Dhabi, Muscat" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabian Standard Time","Dlt",0x00000000,"Arabian Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabian Standard Time","Std",0x00000000,"Arabian Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabian Standard Time","Index",0x00010001,165 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Arabian Standard Time","TZI",0x00000001,\ +0x10,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Caucasus Standard Time","Display",0x00000000,"(GMT+04:00) Caucasus Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Caucasus Standard Time","Dlt",0x00000000,"Caucasus Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Caucasus Standard Time","Std",0x00000000,"Caucasus Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Caucasus Standard Time","Index",0x00010001,170 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Caucasus Standard Time","TZI",0x00000001,\ +0x10,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Afghanistan Standard Time","Display",0x00000000,"(GMT+04:30) Kabul" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Afghanistan Standard Time","Dlt",0x00000000,"Afghanistan Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Afghanistan Standard Time","Std",0x00000000,"Afghanistan Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Afghanistan Standard Time","Index",0x00010001,175 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Afghanistan Standard Time","TZI",0x00000001,\ +0xf2,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Ekaterinburg Standard Time","Display",0x00000000,"(GMT+05:00) Ekaterinburg" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Ekaterinburg Standard Time","Dlt",0x00000000,"Ekaterinburg Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Ekaterinburg Standard Time","Std",0x00000000,"Ekaterinburg Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Ekaterinburg Standard Time","Index",0x00010001,180 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Ekaterinburg Standard Time","TZI",0x00000001,\ +0xd4,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Asia Standard Time","Display",0x00000000,"(GMT+05:00) Islamabad, Karachi, Tashkent" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Asia Standard Time","Dlt",0x00000000,"West Asia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Asia Standard Time","Std",0x00000000,"West Asia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Asia Standard Time","Index",0x00010001,185 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Asia Standard Time","TZI",0x00000001,\ +0xd4,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\India Standard Time","Display",0x00000000,"(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\India Standard Time","Dlt",0x00000000,"India Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\India Standard Time","Std",0x00000000,"India Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\India Standard Time","Index",0x00010001,190 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\India Standard Time","TZI",0x00000001,\ +0xb6,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Nepal Standard Time","Display",0x00000000,"(GMT+05:45) Kathmandu" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Nepal Standard Time","Dlt",0x00000000,"Nepal Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Nepal Standard Time","Std",0x00000000,"Nepal Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Nepal Standard Time","Index",0x00010001,193 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Nepal Standard Time","TZI",0x00000001,\ +0xa7,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Sri Lanka Standard Time","Display",0x00000000,"(GMT+05:30) Sri Jayawardenepura" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Sri Lanka Standard Time","Dlt",0x00000000,"Sri Lanka Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Sri Lanka Standard Time","Std",0x00000000,"Sri Lanka Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Sri Lanka Standard Time","Index",0x00010001,194 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Sri Lanka Standard Time","TZI",0x00000001,\ +0xb6,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Asia Standard Time","Display",0x00000000,"(GMT+06:00) Astana, Dhaka" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Asia Standard Time","Dlt",0x00000000,"Central Asia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Asia Standard Time","Std",0x00000000,"Central Asia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Asia Standard Time","Index",0x00010001,195 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Asia Standard Time","TZI",0x00000001,\ +0x98,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\N. Central Asia Standard Time","Display",0x00000000,"(GMT+06:00) Almaty, Novosibirsk" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\N. Central Asia Standard Time","Dlt",0x00000000,"N. Central Asia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\N. Central Asia Standard Time","Std",0x00000000,"N. Central Asia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\N. Central Asia Standard Time","Index",0x00010001,201 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\N. Central Asia Standard Time","TZI",0x00000001,\ +0x98,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Myanmar Standard Time","Display",0x00000000,"(GMT+06:30) Yangon (Rangoon)" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Myanmar Standard Time","Dlt",0x00000000,"Myanmar Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Myanmar Standard Time","Std",0x00000000,"Myanmar Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Myanmar Standard Time","Index",0x00010001,203 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Myanmar Standard Time","TZI",0x00000001,\ +0x7a,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SE Asia Standard Time","Display",0x00000000,"(GMT+07:00) Bangkok, Hanoi, Jakarta" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SE Asia Standard Time","Dlt",0x00000000,"SE Asia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SE Asia Standard Time","Std",0x00000000,"SE Asia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SE Asia Standard Time","Index",0x00010001,205 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SE Asia Standard Time","TZI",0x00000001,\ +0x5c,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia Standard Time","Display",0x00000000,"(GMT+07:00) Krasnoyarsk" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia Standard Time","Dlt",0x00000000,"North Asia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia Standard Time","Std",0x00000000,"North Asia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia Standard Time","Index",0x00010001,207 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia Standard Time","TZI",0x00000001,\ +0x5c,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time","Display",0x00000000,"(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time","Dlt",0x00000000,"China Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time","Std",0x00000000,"China Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time","Index",0x00010001,210 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time","TZI",0x00000001,\ +0x20,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Singapore Standard Time","Display",0x00000000,"(GMT+08:00) Kuala Lumpur, Singapore" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Singapore Standard Time","Dlt",0x00000000,"Singapore Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Singapore Standard Time","Std",0x00000000,"Singapore Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Singapore Standard Time","Index",0x00010001,215 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Singapore Standard Time","TZI",0x00000001,\ +0x20,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Taipei Standard Time","Display",0x00000000,"(GMT+08:00) Taipei" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Taipei Standard Time","Dlt",0x00000000,"Taipei Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Taipei Standard Time","Std",0x00000000,"Taipei Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Taipei Standard Time","Index",0x00010001,220 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Taipei Standard Time","TZI",0x00000001,\ +0x20,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Australia Standard Time","Display",0x00000000,"(GMT+08:00) Perth" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Australia Standard Time","Dlt",0x00000000,"W. Australia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Australia Standard Time","Std",0x00000000,"W. Australia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Australia Standard Time","Index",0x00010001,225 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Australia Standard Time","TZI",0x00000001,\ +0x20,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia East Standard Time","Display",0x00000000,"(GMT+08:00) Irkutsk, Ulaan Bataar" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia East Standard Time","Dlt",0x00000000,"North Asia East Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia East Standard Time","Std",0x00000000,"North Asia East Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia East Standard Time","Index",0x00010001,227 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\North Asia East Standard Time","TZI",0x00000001,\ +0x20,0xfe,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Korea Standard Time","Display",0x00000000,"(GMT+09:00) Seoul" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Korea Standard Time","Dlt",0x00000000,"Korea Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Korea Standard Time","Std",0x00000000,"Korea Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Korea Standard Time","Index",0x00010001,230 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Korea Standard Time","TZI",0x00000001,\ +0xe4,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tokyo Standard Time","Display",0x00000000,"(GMT+09:00) Osaka, Sapporo, Tokyo" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tokyo Standard Time","Dlt",0x00000000,"Tokyo Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tokyo Standard Time","Std",0x00000000,"Tokyo Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tokyo Standard Time","Index",0x00010001,235 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tokyo Standard Time","TZI",0x00000001,\ +0xe4,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Yakutsk Standard Time","Display",0x00000000,"(GMT+09:00) Yakutsk" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Yakutsk Standard Time","Dlt",0x00000000,"Yakutsk Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Yakutsk Standard Time","Std",0x00000000,"Yakutsk Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Yakutsk Standard Time","Index",0x00010001,240 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Yakutsk Standard Time","TZI",0x00000001,\ +0xe4,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Central Standard Time","Display",0x00000002,"(GMT+09:30) Darwin" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Central Standard Time","Dlt",0x00000002,"AUS Central Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Central Standard Time","Std",0x00000002,"AUS Central Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Central Standard Time","Index",0x00010001,245 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Central Standard Time","TZI",0x00000001,\ +0xc6,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cen. Australia Standard Time","Display",0x00000000,"(GMT+09:30) Adelaide" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cen. Australia Standard Time","Dlt",0x00000000,"Cen. Australia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cen. Australia Standard Time","Std",0x00000000,"Cen. Australia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cen. Australia Standard Time","Index",0x00010001,250 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cen. Australia Standard Time","TZI",0x00000001,\ +0xc6,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Eastern Standard Time","Display",0x00000000,"(GMT+10:00) Canberra, Melbourne, Sydney" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Eastern Standard Time","Dlt",0x00000000,"AUS Eastern Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Eastern Standard Time","Std",0x00000000,"AUS Eastern Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Eastern Standard Time","Index",0x00010001,255 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Eastern Standard Time","TZI",0x00000001,\ +0xa8,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Australia Standard Time","Display",0x00000000,"(GMT+10:00) Brisbane" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Australia Standard Time","Dlt",0x00000000,"E. Australia Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Australia Standard Time","Std",0x00000000,"E. Australia Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Australia Standard Time","Index",0x00010001,260 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Australia Standard Time","TZI",0x00000001,\ +0xa8,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tasmania Standard Time","Display",0x00000000,"(GMT+10:00) Hobart" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tasmania Standard Time","Dlt",0x00000000,"Tasmania Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tasmania Standard Time","Std",0x00000000,"Tasmania Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tasmania Standard Time","Index",0x00010001,265 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tasmania Standard Time","TZI",0x00000001,\ +0xa8,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Vladivostok Standard Time","Display",0x00000000,"(GMT+10:00) Vladivostok" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Vladivostok Standard Time","Dlt",0x00000000,"Vladivostok Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Vladivostok Standard Time","Std",0x00000000,"Vladivostok Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Vladivostok Standard Time","Index",0x00010001,270 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Vladivostok Standard Time","TZI",0x00000001,\ +0xa8,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Pacific Standard Time","Display",0x00000000,"(GMT+10:00) Guam, Port Moresby" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Pacific Standard Time","Dlt",0x00000000,"West Pacific Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Pacific Standard Time","Std",0x00000000,"West Pacific Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Pacific Standard Time","Index",0x00010001,275 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\West Pacific Standard Time","TZI",0x00000001,\ +0xa8,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Pacific Standard Time","Display",0x00000000,"(GMT+11:00) Magadan, Solomon Is., New Caledonia" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Pacific Standard Time","Dlt",0x00000000,"Central Pacific Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Pacific Standard Time","Std",0x00000000,"Central Pacific Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Pacific Standard Time","Index",0x00010001,280 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Pacific Standard Time","TZI",0x00000001,\ +0x6c,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Fiji Standard Time","Display",0x00000000,"(GMT+12:00) Fiji, Kamchatka, Marshall Is." +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Fiji Standard Time","Dlt",0x00000000,"Fiji Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Fiji Standard Time","Std",0x00000000,"Fiji Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Fiji Standard Time","Index",0x00010001,285 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Fiji Standard Time","TZI",0x00000001,\ +0x30,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\New Zealand Standard Time","Display",0x00000000,"(GMT+12:00) Auckland, Wellington" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\New Zealand Standard Time","Dlt",0x00000000,"New Zealand Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\New Zealand Standard Time","Std",0x00000000,"New Zealand Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\New Zealand Standard Time","Index",0x00010001,290 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\New Zealand Standard Time","TZI",0x00000001,\ +0x30,0xfd,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x09,0x00,0x00,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tonga Standard Time","Display",0x00000000,"(GMT+13:00) Nuku'alofa" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tonga Standard Time","Dlt",0x00000000,"Tonga Daylight Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tonga Standard Time","Std",0x00000000,"Tonga Standard Time" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tonga Standard Time","Index",0x00010001,300 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tonga Standard Time","TZI",0x00000001,\ +0xf4,0xfc,0xff,0xff,0x00,0x00,0x00,0x00,0xc4,0xff,0xff,0xff,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +; Available file systems +HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FAT",0x00000000,"ufat.dll" +HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FAT32",0x00000000,"ufat.dll" +HKLM,"SOFTWARE\ReactOS\ReactOS\CurrentVersion\IFS","FATX",0x00000000,"ufatx.dll" + +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","ConsoleShell",0x00020000,"%SystemRoot%\system32\cmd.exe" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","StartServices",0x00010001,0x00000001 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","StartLsass",0x00010001,0x00000001 +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","Userinit",0x00020000,"%SystemRoot%\system32\userinit.exe" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon",0x00000000,"1" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultUserName",0x00000000,"Administrator" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultPassword",0x00000000,"Secret" + +;Time Zone Servers +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","1",0x00000000,"pool.ntp.org" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","2",0x00000000,"asia.pool.ntp.org" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","3",0x00000000,"europe.pool.ntp.org" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","4",0x00000000,"north-america.pool.ntp.org" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","5",0x00000000,"oceania.pool.ntp.org" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","6",0x00000000,"south-america.pool.ntp.org" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","7",0x00000000,"time.windows.com" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers","8",0x00000000,"time.nist.gov" + +; Country Codes +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List",,0x00000012 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List","CountryListVersion",0x00010001,0x00000019 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\1","CountryCode",0x00010001,0x00000001 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\1","Name",0x00000000,"United States of America" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\106","CountryCode",0x00010001,0x0000006A +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\106","Name",0x00000000,"British Virgin Islands" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\107","CountryCode",0x00010001,0x0000006B +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\107","Name",0x00000000,"Canada" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\109","CountryCode",0x00010001,0x0000006D +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\109","Name",0x00000000,"Dominica" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\110","CountryCode",0x00010001,0x0000006E +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\110","Name",0x00000000,"Dominican Republic" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\20","CountryCode",0x00010001,0x00000014 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\20","Name",0x00000000,"Egypt" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\268","CountryCode",0x00010001,0x0000010c +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\268","Name",0x00000000,"Swaziland" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\27","CountryCode",0x00010001,0x0000001b +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\27","Name",0x00000000,"South Africa" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\30","CountryCode",0x00010001,0x0000001e +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\30","Name",0x00000000,"Greece" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\31","CountryCode",0x00010001,0x0000001f +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\31","Name",0x00000000,"Netherlands" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\32","CountryCode",0x00010001,0x00000020 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\32","Name",0x00000000,"Belgium" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\33","CountryCode",0x00010001,0x00000021 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\33","Name",0x00000000,"France" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\34","CountryCode",0x00010001,0x00000022 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\34","Name",0x00000000,"Spain" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\351","CountryCode",0x00010001,0x0000015f +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\351","Name",0x00000000,"Portugal" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\352","CountryCode",0x00010001,0x00000160 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\352","Name",0x00000000,"Luxembourg" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\353","CountryCode",0x00010001,0x00000161 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\353","Name",0x00000000,"Ireland" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\354","CountryCode",0x00010001,0x00000162 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\354","Name",0x00000000,"Iceland" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\355","CountryCode",0x00010001,0x00000163 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\355","Name",0x00000000,"Albania" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\358","CountryCode",0x00010001,0x00000166 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\358","Name",0x00000000,"Finland" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\359","CountryCode",0x00010001,0x00000167 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\359","Name",0x00000000,"Bulgaria" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\36","CountryCode",0x00010001,0x00000024 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\36","Name",0x00000000,"Hungary" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\370","CountryCode",0x00010001,0x00000172 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\370","Name",0x00000000,"Lithuania" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\371","CountryCode",0x00010001,0x00000173 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\371","Name",0x00000000,"Latvia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\372","CountryCode",0x00010001,0x00000174 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\372","Name",0x00000000,"Estonia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\373","CountryCode",0x00010001,0x00000175 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\373","Name",0x00000000,"Moldova" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\374","CountryCode",0x00010001,0x00000176 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\374","Name",0x00000000,"Armenia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\380","CountryCode",0x00010001,0x0000017c +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\380","Name",0x00000000,"Ukraine" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\381","CountryCode",0x00010001,0x0000017d +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\381","Name",0x00000000,"Yugoslavia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\385","CountryCode",0x00010001,0x00000181 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\385","Name",0x00000000,"Croatia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\386","CountryCode",0x00010001,0x00000182 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\386","Name",0x00000000,"Slovenia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\387","CountryCode",0x00010001,0x00000183 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\387","Name",0x00000000,"Bosnia and Herzegovina" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\39","CountryCode",0x00010001,0x00000027 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\39","Name",0x00000000,"Italy" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\40","CountryCode",0x00010001,0x00000028 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\40","Name",0x00000000,"Romania" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\41","CountryCode",0x00010001,0x00000029 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\41","Name",0x00000000,"Switzerland" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\420","CountryCode",0x00010001,0x000001a4 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\420","Name",0x00000000,"Czech Republic" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\421","CountryCode",0x00010001,0x000001a5 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\421","Name",0x00000000,"Slovakia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\423","CountryCode",0x00010001,0x000001a7 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\423","Name",0x00000000,"Liechtenstein" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\43","CountryCode",0x00010001,0x0000002b +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\43","Name",0x00000000,"Austria" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\44","CountryCode",0x00010001,0x0000002c +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\44","Name",0x00000000,"United Kingdom" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\46","CountryCode",0x00010001,0x0000002e +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\46","Name",0x00000000,"Sweden" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\47","CountryCode",0x00010001,0x0000002f +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\47","Name",0x00000000,"Norway" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\48","CountryCode",0x00010001,0x00000030 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\48","Name",0x00000000,"Poland" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\49","CountryCode",0x00010001,0x00000031 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\49","Name",0x00000000,"Germany" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\52","CountryCode",0x00010001,0x00000034 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\52","Name",0x00000000,"Mexico" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\54","CountryCode",0x00010001,0x00000036 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\54","Name",0x00000000,"Argentina" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\55","CountryCode",0x00010001,0x00000037 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\55","Name",0x00000000,"Brazil" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\56","CountryCode",0x00010001,0x00000038 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\56","Name",0x00000000,"Chile" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\57","CountryCode",0x00010001,0x00000039 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\57","Name",0x00000000,"Colombia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\58","CountryCode",0x00010001,0x0000003a +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\58","Name",0x00000000,"Venezuela" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\60","CountryCode",0x00010001,0x0000003c +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\60","Name",0x00000000,"Malaysia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\61","CountryCode",0x00010001,0x0000003d +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\61","Name",0x00000000,"Australia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\62","CountryCode",0x00010001,0x0000003e +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\62","Name",0x00000000,"Indonesia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\63","CountryCode",0x00010001,0x0000003f +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\63","Name",0x00000000,"Philippines" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\64","CountryCode",0x00010001,0x00000040 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\64","Name",0x00000000,"New Zealand" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\7","CountryCode",0x00010001,0x00000007 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\7","Name",0x00000000,"Russia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\705","CountryCode",0x00010001,0x000002C1 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\705","Name",0x00000000,"Kazakhstan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\708","CountryCode",0x00010001,0x000002C4 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\708","Name",0x00000000,"Tajikistan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\81","CountryCode",0x00010001,0x00000051 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\81","Name",0x00000000,"Japan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\82","CountryCode",0x00010001,0x00000052 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\82","Name",0x00000000,"Korea (Republic of)" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\850","CountryCode",0x00010001,0x00000352 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\850","Name",0x00000000,"Korea (North)" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\86","CountryCode",0x00010001,0x00000056 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\86","Name",0x00000000,"China" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\886","CountryCode",0x00010001,0x00000376 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\886","Name",0x00000000,"Taiwan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\90","CountryCode",0x00010001,0x0000005a +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\90","Name",0x00000000,"Turkey" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\91","CountryCode",0x00010001,0x0000005b +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\91","Name",0x00000000,"India" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\93","CountryCode",0x00010001,0x0000005d +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\93","Name",0x00000000,"Afghanistan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\960","CountryCode",0x00010001,0x000003c0 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\960","Name",0x00000000,"Maldives" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\964","CountryCode",0x00010001,0x000003c4 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\964","Name",0x00000000,"Iraq" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\966","CountryCode",0x00010001,0x000003c6 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\966","Name",0x00000000,"Saudi Arabia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\971","CountryCode",0x00010001,0x000003cb +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\971","Name",0x00000000,"United Arab Emirates" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\972","CountryCode",0x00010001,0x000003cc +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\972","Name",0x00000000,"Israel" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\974","CountryCode",0x00010001,0x000003ce +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\974","Name",0x00000000,"Qatar" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\976","CountryCode",0x00010001,0x000003d0 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\976","Name",0x00000000,"Mongolia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\977","CountryCode",0x00010001,0x000003d1 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\977","Name",0x00000000,"Nepal" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\98","CountryCode",0x00010001,0x00000062 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\98","Name",0x00000000,"Iran" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\993","CountryCode",0x00010001,0x000003e1 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\993","Name",0x00000000,"Turkmenistan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\994","CountryCode",0x00010001,0x000003e2 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\994","Name",0x00000000,"Azerbaijan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\995","CountryCode",0x00010001,0x000003e3 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\995","Name",0x00000000,"Georgia" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\996","CountryCode",0x00010001,0x000003e4 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\996","Name",0x00000000,"Kyrgyzstan" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\998","CountryCode",0x00010001,0x000003e6 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\998","Name",0x00000000,"Uzbekistan" + +;Cursors Schemes +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Schemes","ReactOS Default",0x00020000,"\",,,,,,,,,,,,,\"" + +;PowerCfg +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg","LastID",0x00000002,"0" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg","DiskSpinDownMax",0x00000002,"3600" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg","DiskSpinDownMin",0x00000002,"3" + +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\GlobalPowerPolicy","Policies",0x00000001,\ +01,00,00,00,01,00,00,00,01,00,00,00,03,00,00,00 + +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\0","Policies",0x00000001,\ +01,00,00,00,02,00,00,00,04,00,00,00,02,00,00,00,02,00,00,00,00,00,00,00,84,03,00,00,00,00,00,00,84,03,\ +00,00,32,32,00,00,02,00,00,00,04,00,00,c0,00,00,00,00,02,00,00,00,04,00,00,c0,00,00,00,00 + +; deskadp.dll shell extension +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\Device\shellex\PropertySheetHandlers\Display Adapter CPL Extension","",0x00000000,"{42071712-76d4-11d1-8b24-00a0c9068ff3}" + +; deskmon.dll shell extension +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\Device\shellex\PropertySheetHandlers\Display Monitor CPL Extension","",0x00000000,"{42071713-76d4-11d1-8b24-00a0c9068ff3}" + +; Where to download the Mozilla ActiveX control +HKLM,"SOFTWARE\ReactOS\shdocvw","MozillaUrl",0x00000000,"http://links.reactos.org/mozactivex" + +; Keyboard layout switcher +;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","kbswitch",0x00000000,"kbswitch.exe" + +; EOF diff --git a/reactos/boot/bootdata/hivesys_amd64.inf b/reactos/boot/bootdata/hivesys_amd64.inf new file mode 100644 index 00000000000..dc907b5e224 --- /dev/null +++ b/reactos/boot/bootdata/hivesys_amd64.inf @@ -0,0 +1,1095 @@ +[Version] +Signature = "$ReactOS$" + +[AddReg] + +; Device classes (this list is incomplete... and should be generated from .inf files during installation) +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Client" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetClient" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}","Icon",0x00000000,"-7" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}","Installer32",0x00000000,"NetCfgx.dll,NetClassInstaller" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}","NoDisplayClass",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E973-E325-11CE-BFC1-08002BE10318}","NoInstallClass",0x00000000,"1" + +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E974-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Service" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E974-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetService" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E974-E325-11CE-BFC1-08002BE10318}","Icon",0x00000000,"-7" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E974-E325-11CE-BFC1-08002BE10318}","Installer32",0x00000000,"NetCfgx.dll,NetClassInstaller" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E974-E325-11CE-BFC1-08002BE10318}","NoDisplayClass",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E974-E325-11CE-BFC1-08002BE10318}","NoInstallClass",0x00000000,"1" + +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Protocol" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetTrans" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","Icon",0x00000000,"-6" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","Installer32",0x00000000,"NetCfgx.dll,NetClassInstaller" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","NoDisplayClass",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","NoInstallClass",0x00000000,"1" + +; Default computer name settings +HKLM,"SYSTEM\CurrentControlSet\Control\ComputerName",,0x00000012 +HKLM,"SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName",0x00000002,"COMPUTERNAME" + +; Device classes key +HKLM,"SYSTEM\CurrentControlSet\Control\DeviceClasses",,0x00000012 + +; Hardware profile settings +HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB",,0x00000012 +HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB","CurrentConfig",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB\Hardware Profiles\0000","FriendlyName",0x00000000,"New Hardware Profile" + +; Keyboard Layouts +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000401","Layout File",0x00000000,"kbda1.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000401","Layout Text",0x00000000,"Arabic (101)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000401","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5084" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010401","Layout File",0x00000000,"kbda2.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010401","Layout Text",0x00000000,"Arabic (102)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010401","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5085" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020401","Layout File",0x00000000,"kbda3.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020401","Layout Text",0x00000000,"Arabic (102) AZERTY" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020401","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5086" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000402","Layout File",0x00000000,"kbdbgm.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000402","Layout Text",0x00000000,"Bulgarian BDS 5237-1978" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000402","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5136" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020402","Layout File",0x00000000,"kbdbgt.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020402","Layout Text",0x00000000,"Bulgarian phonetic classic" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020402","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5134" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030402","Layout File",0x00000000,"kbdbga.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030402","Layout Text",0x00000000,"Bulgarian phonetic BDS 5237-2006" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030402","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5135" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000406","Layout File",0x00000000,"kbdda.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000406","Layout Text",0x00000000,"Danish" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000406","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5007" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030407","Layout File",0x00000000,"kbdgerg.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030407","Layout Text",0x00000000,"German (de_ergo)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030407","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5139" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020407","Layout File",0x00000000,"kbdgneo.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020407","Layout Text",0x00000000,"German (NEO-1.1)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020407","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5138" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010407","Layout File",0x00000000,"kbdgrist.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010407","Layout Text",0x00000000,"German (RISTOME)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010407","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5137" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000407","Layout File",0x00000000,"kbdgr.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000407","Layout Text",0x00000000,"German" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000407","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5011" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000807","Layout File",0x00000000,"kbdsg.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000807","Layout Text",0x00000000,"Swiss (German)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000807","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5024" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000408","Layout File",0x00000000,"kbdhe.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000408","Layout Text",0x00000000,"Greek" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000408","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5046" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000409","Layout File",0x00000000,"kbdus.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000409","Layout Text",0x00000000,"United States" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000409","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5000" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000809","Layout File",0x00000000,"kbduk.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000809","Layout Text",0x00000000,"United Kingdom" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000809","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5025" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409","Layout File",0x00000000,"kbddv.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409","Layout Id", 0x00000000,"0002" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409","Layout Text",0x00000000,"US-Dvorak" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5092" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409","Layout File",0x00000000,"kbdusx.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409","Layout Id", 0x00000000,"0001" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409","Layout Text",0x00000000,"US International" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5026" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409","Layout File",0x00000000,"kbdusl.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409","Layout Id", 0x00000000,"001A" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409","Layout Text",0x00000000,"US Dvorak for left hand" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5027" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409","Layout File",0x00000000,"kbdusr.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409","Layout Id", 0x00000000,"001B" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409","Layout Text",0x00000000,"US Dvorak for right hand" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5028" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00050409","Layout File",0x00000000,"kbdusa.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00050409","Layout Id", 0x00000000,"000B" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00050409","Layout Text",0x00000000,"US English (IBM Arabic 238_L)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00050409","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5123" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00001809","Layout File",0x00000000,"kbdir.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00001809","Layout Text",0x00000000,"Irish" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00001809","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5014" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040a","Layout File",0x00000000,"kbdes.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040a","Layout Text",0x00000000,"Spanish" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040a","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5020" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000080a","Layout File",0x00000000,"kbdla.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000080a","Layout Text",0x00000000,"Latin American" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000080a","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5017" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040b","Layout File",0x00000000,"kbdfi.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040b","Layout Text",0x00000000,"Finnish" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040b","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5009" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040c","Layout File",0x00000000,"kbdfr.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040c","Layout Text",0x00000000,"French" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040c","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5010" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040d","Layout File",0x00000000,"kbdheb.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040d","Layout Text",0x00000000,"Hebrew" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040d","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5083" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040f","Layout File",0x00000000,"kbdic.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040f","Layout Text",0x00000000,"Icelandic" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000040f","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5013" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000410","Layout File",0x00000000,"kbdit.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000410","Layout Text",0x00000000,"Italian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000410","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5015" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000411","Layout File",0x00000000,"kbdja.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000411","Layout Text",0x00000000,"Japanese" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000411","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5061" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041c","Layout File",0x00000000,"kbdal.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041c","Layout Text",0x00000000,"Albanian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041c","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5029" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041f","Layout File",0x00000000,"kbdtuq.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041f","Layout Text",0x00000000,"Turkish Q" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041f","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5060" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041f","Layout File",0x00000000,"kbdtuf.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041f","Layout Text",0x00000000,"Turkish F" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041f","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5059" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041f","Layout Id",0x00000000,"0014" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000080c","Layout File",0x00000000,"kbdbe.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000080c","Layout Text",0x00000000,"Belgian (French)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000080c","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5002" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000413","Layout File",0x00000000,"kbdne.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000413","Layout Text",0x00000000,"Dutch" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000413","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5008" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000813","Layout File",0x00000000,"kbdbe.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000813","Layout Text",0x00000000,"Belgian (Dutch)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000813","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5001" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000415","Layout File",0x00000000,"kbdpl1.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000415","Layout Text",0x00000000,"Polish (Programmers)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000415","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5035" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010416","Layout File",0x00000000,"kbdbr.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010416","Layout Text",0x00000000,"Portuguese (Brazilian ABNT2)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010416","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5126" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000816","Layout File",0x00000000,"kbdpo.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000816","Layout Text",0x00000000,"Portuguese (Portugal)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000816","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5019" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000418","Layout File",0x00000000,"kbdro.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000418","Layout Text",0x00000000,"Romanian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000418","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5037" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000419","Layout File",0x00000000,"kbdru.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000419","Layout Text",0x00000000,"Russian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000419","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5055" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010419","Layout File",0x00000000,"kbdru1.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010419","Layout Text",0x00000000,"Russian (Typewriter)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010419","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5056" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041a","Layout File",0x00000000,"kbdcr.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041a","Layout Text",0x00000000,"Croatian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041a","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5030" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041b","Layout File",0x00000000,"kbdsk.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041b","Layout Text",0x00000000,"Slovak" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041b","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5039" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041b","Layout File",0x00000000,"kbdsk1.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041b","Layout Text",0x00000000,"Slovak (QWERTY)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041b","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5040" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041d","Layout File",0x00000000,"kbdsw.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041d","Layout Text",0x00000000,"Swedish" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041d","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5022" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041e","Layout File",0x00000000,"kbdth0.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041e","Layout Text",0x00000000,"Thai Kedmanee" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000041e","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5079" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041e","Layout File",0x00000000,"kbdth1.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041e","Layout Text",0x00000000,"Thai Pattachote" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001041e","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5080" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0002041e","Layout File",0x00000000,"kbdth2.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0002041e","Layout Text",0x00000000,"Thai Kedmanee (non-ShiftLock)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0002041e","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5081" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0003041e","Layout File",0x00000000,"kbdth3.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0003041e","Layout Text",0x00000000,"Thai Pattachote (non-ShiftLock)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0003041e","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5082" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000422","Layout File",0x00000000,"kbdur.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000422","Layout Text",0x00000000,"Ukrainian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000422","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5058" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010422","Layout File",0x00000000,"kbdurs.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010422","Layout Text",0x00000000,"Ukrainian (Student)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010422","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5141" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000423","Layout File",0x00000000,"kbdblr.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000423","Layout Text",0x00000000,"Belarusian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000423","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5052" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000425","Layout File",0x00000000,"kbdest.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000425","Layout Text",0x00000000,"Estonian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000425","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5042" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000426","Layout File",0x00000000,"kbdlv.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000426","Layout Text",0x00000000,"Latvian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000426","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5043" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000427","Layout File",0x00000000,"kbdlt.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000427","Layout Text",0x00000000,"Lithuanian IBM" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000427","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5045" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042a","Layout File",0x00000000,"kbdvntc.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042a","Layout Text",0x00000000,"Vietnamese" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042a","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5118" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042b","Layout File",0x00000000,"kbdarme.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042b","Layout Text",0x00000000,"Armenian Eastern" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042b","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5120" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001042b","Layout File",0x00000000,"kbdarmw.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001042b","Layout Text",0x00000000,"Armenian Eastern" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001042b","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5121" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042c","Layout File",0x00000000,"kbdazel.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042c","Layout Text",0x00000000,"Azeri Latin" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042c","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5117" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000082c","Layout File",0x00000000,"kbdaze.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000082c","Layout Text",0x00000000,"Azeri Cyrillic" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000082c","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5115" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042f","Layout File",0x00000000,"kbdmac.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042f","Layout Text",0x00000000,"Macedonian (FYRO)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042f","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5109" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000437","Layout File",0x00000000,"kbdgeo.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000437","Layout Text",0x00000000,"Georgian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000437","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5119" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000439","Layout File",0x00000000,"kbdindev.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000439","Layout Text",0x00000000,"Devanagari - INSCRIPT" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000439","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5096" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000043f","Layout File",0x00000000,"kbdkaz.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000043f","Layout Text",0x00000000,"Kazakh" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000043f","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5113" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000843","Layout File",0x00000000,"kbduzb.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000843","Layout Text",0x00000000,"Uzbek (Cyrillic)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000843","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5114" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000444","Layout File",0x00000000,"kbdtat.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000444","Layout Text",0x00000000,"Tatar" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000444","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5116" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000445","Layout File",0x00000000,"kbdinben.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000445","Layout Text",0x00000000,"Bengali" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000445","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5135" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000447","Layout File",0x00000000,"kbdinguj.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000447","Layout Text",0x00000000,"Gujarati" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000447","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5097" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000044c","Layout File",0x00000000,"kbdinmal.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000044c","Layout Text",0x00000000,"Malayalam" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000044c","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5139" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000044d","Layout File",0x00000000,"kbdinasa.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000044d","Layout Text",0x00000000,"ASSAMESE - INSCRIPT" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000044d","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5177" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000455","Layout File",0x00000000,"kbdbur.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000455","Layout Text",0x00000000,"Burmese" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000455","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5140" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000414","Layout File",0x00000000,"kbdno.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000414","Layout Text",0x00000000,"Norwegian" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000414","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5018" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000405","Layout File",0x00000000,"kbdcz1.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000405","Layout Text",0x00000000,"Czech (QWERTY)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000405","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5031" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00011009","Layout File",0x00000000,"kbdcan.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00011009","Layout Id", 0x00000000,"0020" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00011009","Layout Text",0x00000000,"Canadian Multilingual Standard" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00011009","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5110" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000c0c","Layout File",0x00000000,"kbdfc.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000c0c","Layout Text",0x00000000,"Canadian French (Legacy)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000c0c","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5005" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000c1a","Layout File",0x00000000,"kbdycc.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000c1a","Layout Text",0x00000000,"Serbian (Cyrillic)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000c1a","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5057" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000081a","Layout File",0x00000000,"kbdycl.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000081a","Layout Text",0x00000000,"Serbian (Latin)" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000081a","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5038" + +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000412","Layout File",0x00000000,"kbdko.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000412","Layout Text",0x00000000,"Korean" +HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000412","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5063" + +; Network +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Adapters" +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"Net" +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E973-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Client" +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E973-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetClient" +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E974-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Service" +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E974-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetService" +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E975-E325-11CE-BFC1-08002BE10318}",,0x00000000,"Network Protocol" +HKLM,"SYSTEM\CurrentControlSet\Control\Network\{4D36E975-E325-11CE-BFC1-08002BE10318}","Class",0x00000000,"NetTrans" + +; NLS Files +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","37",0x00000000,"c_037.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","424",0x00000000,"c_424.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","437",0x00000000,"c_437.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","500",0x00000000,"c_500.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","737",0x00000000,"c_737.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","775",0x00000000,"c_775.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","850",0x00000000,"c_850.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","852",0x00000000,"c_852.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","855",0x00000000,"c_855.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","856",0x00000000,"c_856.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","857",0x00000000,"c_857.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","860",0x00000000,"c_860.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","861",0x00000000,"c_861.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","862",0x00000000,"c_862.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","863",0x00000000,"c_863.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","864",0x00000000,"c_864.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","865",0x00000000,"c_865.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","866",0x00000000,"c_866.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","869",0x00000000,"c_869.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","874",0x00000000,"c_874.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","875",0x00000000,"c_875.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","878",0x00000000,"c_878.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","932",0x00000000,"c_932.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","936",0x00000000,"c_936.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","949",0x00000000,"c_949.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","950",0x00000000,"c_950.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1006",0x00000000,"c_1006.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1026",0x00000000,"c_1026.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1250",0x00000000,"c_1250.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1251",0x00000000,"c_1251.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1252",0x00000000,"c_1252.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1253",0x00000000,"c_1253.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1254",0x00000000,"c_1254.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1255",0x00000000,"c_1255.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1256",0x00000000,"c_1256.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1257",0x00000000,"c_1257.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","1258",0x00000000,"c_1258.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","10000",0x00000000,"c_10000.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","10006",0x00000000,"c_10006.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","10007",0x00000000,"c_10007.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","10029",0x00000000,"c_10029.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","10079",0x00000000,"c_10079.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","10081",0x00000000,"c_10081.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","20866",0x00000000,"c_20866.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28591",0x00000000,"c_28591.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28592",0x00000000,"c_28592.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28593",0x00000000,"c_28593.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28594",0x00000000,"c_28594.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28595",0x00000000,"c_28595.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28596",0x00000000,"c_28596.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28597",0x00000000,"c_28597.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28598",0x00000000,"c_28598.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","28599",0x00000000,"c_28599.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","ACP",0x00000000,"1252" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","OEMCP",0x00000000,"437" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","MACCP",0x00000000,"10000" + +; NLS Language settings +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0402",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0403",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0404",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0804",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0405",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0406",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0407",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0807",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0c07",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","1407",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0408",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0409",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0809",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0c09",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","1009",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","1409",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","1809",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","1c09",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","2009",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","3009",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","3409",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","040a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","080a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0c0a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","100a",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","140a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","180a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","1c0a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","200a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","240a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","280a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","2c0a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","300a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","340a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","380a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","3c0a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","400a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","440a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","480a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","4c0a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","500a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","040b",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","040c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","080c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0c0c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","100c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","140c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","180c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","040d",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","040e",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","040f",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0410",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0810",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0411",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0412",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0413",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0414",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0813",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0414",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0814",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0415",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0416",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0816",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0418",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0419",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","041a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","081a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0c1a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","041b",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","041c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","041d",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","081d",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","041e",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","041f",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0420",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0421",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0422",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0423",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0424",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0425",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0426",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0427",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0429",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","042a",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","042b",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","042c",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","082c",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","042d",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","042f",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0436",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0437",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0438",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0439",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","043e",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","083e",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","043f",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0440",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0441",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0443",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0843",0x00000000,"l_intl.nls" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0455",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","0456",0x00000000,"l_intl.nls" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","Default",0x00000000,"0409" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","InstallLanguage",0x00000000,"0409" + +; Supported and installed locales +; If you add/uncomment an entry here, please also add the appropriate Language +; in the previous section. +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale",,0x00000012 +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000402",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000403",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000404",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000804",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000405",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000406",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000407",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000807",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000c07",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00001407",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000408",0x00000000,"4" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000409",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000809",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000c09",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00001009",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00001409",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00001809",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00001c09",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00002009",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00003009",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00003409",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000040a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000080a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000c0a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000100a",0x00000000,"1" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000140a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000180a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00001c0a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000200a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000240a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000280a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00002c0a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000300a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000340a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000380a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00003c0a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000400a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000440a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000480a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00004c0a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000500a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000040b",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000040c",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000080c",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000c0c",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000100c",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000140c",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000180c",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000040d",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000040e",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000040f",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000410",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000810",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000411",0x00000000,"7" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000412",0x00000000,"8" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000413",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000813",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000414",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000814",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000415",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000416",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000816",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000418",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000419",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000041a",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000081a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000c1a",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000041b",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000041c",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000041d",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000081d",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000041e",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000041f",0x00000000,"6" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000420",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000421",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000422",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000423",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000424",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000425",0x00000000,"3" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000426",0x00000000,"3" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000427",0x00000000,"3" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000429",0x00000000,"" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000042a",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000042b",0x00000000,"" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000042c",0x00000000,"6" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000082c",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000042d",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000042f",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000436",0x00000000,"1" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000437",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000438",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000439",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000043e",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000083e",0x00000000,"1" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","0000043f",0x00000000,"5" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000440",0x00000000,"5" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000441",0x00000000,"1" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000443",0x00000000,"6" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000843",0x00000000,"5" +;HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000455",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale","00000456",0x00000000,"1" + +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","1",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","2",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","3",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","4",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","5",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","6",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","7",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","8",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","9",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","10",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","11",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","a",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","b",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","c",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","d",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","e",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language Groups","f",0x00000000,"1" + +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00010407",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","0001040e",0x00000000,"2" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00010437",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00020804",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00021004",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00021404",0x00000000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00030404",0x00000000,"" + +; Some installers check for SP6 +HKLM,"SYSTEM\CurrentControlSet\Control\Windows","CSDVersion",0x00010001,0x00000600 + +; Service groups +HKLM,"SYSTEM\CurrentControlSet\Control\ServiceGroupOrder","List",0x00010000, \ + "Boot Bus Extender", \ + "System Bus Extender", \ + "SCSI Port", \ + "SCSI Miniport", \ + "Primary Disk", \ + "SCSI Class Helper", \ + "SCSI Class", \ + "Boot File System", \ + "Base", \ + "Pointer Port", \ + "Keyboard Port", \ + "Pointer Class", \ + "Keyboard Class", \ + "Debug", \ + "Video Init", \ + "Video", \ + "Video Save", \ + "File System", \ + "Event log", \ + "NDIS", \ + "PNP_TDI", \ + "TDI", \ + "PlugPlay", \ + "Extended Base" + +; Set the timeout for directx/ReactX graphic surface lock see _EDD_DIRECTDRAW_GLOBAL struct for more info +HKLM,"SYSTEM\CurrentControlSet\Control\GraphicsDrivers\DCI","Timeout",0x00010001,0x00000007 + +; Group order, the first DWORD is the count of entries, +; the following dwords are the tag entries for the load order. +HKLM,"SYSTEM\CurrentControlSet\Control\GroupOrderList","Video Save", 0x00000001, \ + 0x02, 0x00, 0x00, 0x00, \ + 0x01, 0x00, 0x00, 0x00, \ + 0x02, 0x00, 0x00, 0x00 +HKLM,"SYSTEM\CurrentControlSet\Control\GroupOrderList","SCSI Miniport", 0x00000001, \ + 0x02, 0x00, 0x00, 0x00, \ + 0x10, 0x00, 0x00, 0x00, \ + 0x20, 0x00, 0x00, 0x00 + +; Session Manager stuff +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","BootExecute", 0x00010000, \ + "autocheck autochk *" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","ObjectDirectories",0x00010000, \ + "\Windows", \ + "\RPC Control" + +; DOS devices +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","AUX",0x00000000,"\DosDevices\COM1" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","MAILSLOT",0x00000000,"\Device\MailSlot" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","NUL",0x00000000,"\Device\Null" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","PIPE",0x00000000,"\Device\NamedPipe" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","PRN",0x00000000,"\DosDevices\LPT1" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","UNC",0x00000000,"\Device\Mup" + +; System environment settings +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","ComSpec",0x00020000,"%SystemRoot%\system32\cmd.exe" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","OS",0x00020000,"ReactOS" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","Path",0x00020000,"%SystemRoot%\bin;%SystemRoot%\system32;%SystemRoot%" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","windir",0x00020000,"%SystemRoot%" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TEMP",0x00020000,"%SystemDrive%\TEMP" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TMP",0x00020000,"%SystemDrive%\TEMP" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00020000,".COM;.EXE;.BAT;.CMD" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PROCESSOR_ARCHITECTURE",0x00020000,"x86" + + +; Known DLLs +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\KnownDlls","DllDirectory",0x00020000,"%SystemRoot%\system32" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\KnownDlls","advapi32",0x00000000,"advapi32.dll" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\KnownDlls","kernel32",0x00000000,"kernel32.dll" + +; Pagefile settings +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management","PagingFiles",0x00010000, \ + "C:\pagefile.sys" + +; Subsystems +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Debug",0x00020000,"" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Kmode",0x00020000,"%SystemRoot%\system32\win32k.sys" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Optional",0x00010000,"Posix","Os2","Vms" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Os2",0x00020000,"%SystemRoot%\system32\csr.exe ObjectDirectory=\OS2 SharedSection=128 Windows=Off SubSystemType=Text ServerDll=os2srv,1 ProfileControl=Off RequestThreads=2 MaxRequestThreads=2 Sessions=Off" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Posix",0x00020000,"%SystemRoot%\system32\csr.exe ObjectDirectory=\POSIX SharedSection=128 Windows=Off SubSystemType=Text ServerDll=psxsrv,1 ProfileControl=Off RequestThreads=2 MaxRequestThreads=2 Sessions=Off" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Required",0x00010000,"Debug","Windows" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Vms",0x00020000,"%SystemRoot%\system32\csr.exe ObjectDirectory=\VMS SharedSection=128 Windows=Off SubSystemType=Text ServerDll=vmssrv,1 ProfileControl=Off RequestThreads=2 MaxRequestThreads=2 Sessions=Off" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.exe" + +; WOW Support +HKLM,"SYSTEM\CurrentControlSet\Control\Wow","",0x00000000,"" + +; PNP Root device +HKLM,"SYSTEM\CurrentControlSet\Enum\HTREE\ROOT\0","",0x00000000,"" + +; Afd driver +HKLM,"SYSTEM\CurrentControlSet\Services\Afd","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Afd","Group",0x00000000,"TDI" +HKLM,"SYSTEM\CurrentControlSet\Services\Afd","ImagePath",0x00020000,"system32\drivers\afd.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Afd","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Afd","Type",0x00010001,0x00000001 + +; Atapi miniport driver +HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","Group",0x00000000,"SCSI Miniport" +HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","ImagePath",0x00020000,"system32\drivers\atapi.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","Tag",0x00010001,0x00000010 + +; Audio Service +HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","DisplayName",0x00000000,"Audio Service" +HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Description",0x00000000,"Provides audio facilities to applications" +HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Group",0x00000000,"Audio" +HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ImagePath",0x00020000,"%SystemRoot%\system32\audiosrv.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Start",0x00010001,0x00000003 +HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Type",0x00010001,0x00000010 + +; BusLogic 958 miniport driver +HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","Group",0x00000000,"SCSI Miniport" +HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","ImagePath",0x00020000,"system32\drivers\buslogic.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","Tag",0x00010001,0x00000020 + +; Beep device driver +HKLM,"SYSTEM\CurrentControlSet\Services\Beep","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Group",0x00000000,"Base" +HKLM,"SYSTEM\CurrentControlSet\Services\Beep","ImagePath",0x00020000,"system32\drivers\beep.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Beep","Type",0x00010001,0x00000001 + +; BlueScreen device driver +HKLM,"SYSTEM\CurrentControlSet\Services\Blue","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Blue","Group",0x00000000,"Video Init" +HKLM,"SYSTEM\CurrentControlSet\Services\Blue","ImagePath",0x00020000,"system32\drivers\blue.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Blue","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Blue","Type",0x00010001,0x00000001 + +; Cdfs (ISO96660) filesystem driver +HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","Group",0x00000000,"File System" +HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","ImagePath",0x00020000,"system32\drivers\cdfs.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Cdfs","Type",0x00010001,0x00000002 + +; Cdrom class driver +HKLM,"SYSTEM\CurrentControlSet\Services\Cdrom","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Cdrom","Group",0x00000000,"SCSI Class" +HKLM,"SYSTEM\CurrentControlSet\Services\Cdrom","ImagePath",0x00020000,"system32\drivers\cdrom.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Cdrom","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Cdrom","Type",0x00010001,0x00000001 + +; Class2 driver +HKLM,"SYSTEM\CurrentControlSet\Services\Class2","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Class2","Group",0x00000000,"SCSI Class Helper" +HKLM,"SYSTEM\CurrentControlSet\Services\Class2","ImagePath",0x00020000,"system32\drivers\class2.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Class2","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Class2","Type",0x00010001,0x00000001 + +; Debug output driver +HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","Group",0x00000000,"Debug" +HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","ImagePath",0x00020000,"system32\drivers\debugout.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","Type",0x00010001,0x00000001 + +; Disk class driver +HKLM,"SYSTEM\CurrentControlSet\Services\Disk","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Disk","Group",0x00000000,"SCSI Class" +HKLM,"SYSTEM\CurrentControlSet\Services\Disk","ImagePath",0x00020000,"system32\drivers\disk.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Disk","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Disk","Type",0x00010001,0x00000001 + +; DHCP client service +HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","DisplayName",0x00000000,"DHCP Client" +HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Description",0x00000000,"Attempts to obtain network settings automatically from an available DHCP server" +HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Group",0x00000000,"Network" +HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ImagePath",0x00020000,"%SystemRoot%\system32\dhcp.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Start",0x00010001,0x00000002 +HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Type",0x00010001,0x00000010 + +; Event logging service +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog",,0x00000010 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","DisplayName",0x00000000,"Event Logger" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Description",0x00000000,"Logs events or messages sent by the operating system in a database accessible via the event log viewer" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Group",0x00000000,"Event log" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","ImagePath",0x00020000,"%SystemRoot%\system32\eventlog.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Start",0x00010001,0x00000002 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Type",0x00010001,0x00000010 + +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application",,0x00000010 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","File",0x00020000,"%SystemRoot%\system32\config\AppEvent.Evt" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security",,0x00000010 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","File",0x00020000,"%SystemRoot%\system32\config\SecEvent.Evt" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System",,0x00000010 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","File",0x00020000,"%SystemRoot%\system32\config\SysEvent.Evt" + +; Floppy driver +HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","Group",0x00000000,"Primary Disk" +HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","ImagePath",0x00020000,"system32\drivers\floppy.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","Type",0x00010001,0x00000001 + +; Filesystem recognizer driver +HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","Group",0x00000000,"Boot file system" +HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","ImagePath",0x00020000,"system32\drivers\fs_rec.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Fs_Rec","Type",0x00010001,0x00000008 + +; i8042 port driver +HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt","Group",0x00000000,"Keyboard Port" +HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt","ImagePath",0x00020000,"system32\drivers\i8042prt.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\i8042prt\Parameters","BreakOnSysRq",0x00010001,0x00000001 + +; Kernel-Mode Tests +;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","ErrorControl",0x00010001,0x00000000 +;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","Group",0x00000000,"Base" +;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","ImagePath",0x00020000,"system32\drivers\kmtest.sys" +;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","Start",0x00010001,0x00000001 +;HKLM,"SYSTEM\CurrentControlSet\Services\Kmtest","Type",0x00010001,0x00000001 + +; Keyboard class driver +HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","Group",0x00000000,"Keyboard Class" +HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","ImagePath",0x00020000,"system32\drivers\kbdclass.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\kbdclass\Parameters","ConnectMultiplePorts",0x00010001,1 +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318}","UpperFilters",0x00010000,"kbdclass" + +; SB16 driver +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","Group",0x00000000,"Base" +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","ServiceType",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst","ImagePath",0x00020000,"system32\drivers\sndblst.sys" +;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst\Parameters\Device0","DmaChannel",0x00010001,0x00000001 +;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst\Parameters\Device0","DmaChannel16",0x00010001,0x00000005 +;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst\Parameters\Device0","Port",0x00010001,0x00000220 +;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst\Parameters\Device0","Interrupt",0x00010001,0x00000005 +;HKLM,"SYSTEM\CurrentControlSet\Services\sndblst\Parameters\Device0","DSP Version",0x00010001,0x00000401 +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst\Parameters\Device0\Devices","SBWaveIn0",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\sndblst\Parameters\Device0\Devices","SBWaveOut0",0x00010001,0x00000002 + +; MPU-401 MIDI driver +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Group",0x00000000,"Base" +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","ServiceType",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","ImagePath",0x00020000,"system32\drivers\mpu401.sys" + +; Mouse class driver +HKLM,"SYSTEM\CurrentControlSet\Services\mouclass","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\mouclass","Group",0x00000000,"Pointer Class" +HKLM,"SYSTEM\CurrentControlSet\Services\mouclass","ImagePath",0x00020000,"system32\drivers\mouclass.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\mouclass","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\mouclass","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}","UpperFilters",0x00010000,"mouclass" + +; Mailslot filesystem driver +HKLM,"SYSTEM\CurrentControlSet\Services\Msfs","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Msfs","Group",0x00000000,"File System" +HKLM,"SYSTEM\CurrentControlSet\Services\Msfs","ImagePath",0x00020000,"system32\drivers\msfs.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Msfs","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Msfs","Type",0x00010001,0x00000002 + +; NDIS driver - the only boot-start network driver +HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Group",0x00000000,"NDIS" +HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","ImagePath",0x00020000,"system32\drivers\ndis.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Ndis","Type",0x00010001,0x00000001 + +; NetLogon +HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","DisplayName",0x00000000,"Net Logon" +HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","Description",0x00000000,"Sets up a secure channel to a domain controller for domain authentication" +HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Netlogon","ImagePath",0x00020000,"%SystemRoot%\system32\lsass.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\NetLogon","Start",0x00010001,0x00000003 +HKLM,"SYSTEM\CurrentControlSet\Services\Netlogon","Type",0x00010001,0x00000020 + +; Named Pipe filesystem driver +HKLM,"SYSTEM\CurrentControlSet\Services\Npfs","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Npfs","Group",0x00000000,"File System" +HKLM,"SYSTEM\CurrentControlSet\Services\Npfs","ImagePath",0x00020000,"system32\drivers\npfs.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Npfs","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Npfs","Type",0x00010001,0x00000002 + +; NTFS filesystem driver +HKLM,"SYSTEM\CurrentControlSet\Services\Ntfs","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Ntfs","Group",0x00000000,"File System" +HKLM,"SYSTEM\CurrentControlSet\Services\Ntfs","ImagePath",0x00020000,"system32\drivers\ntfs.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Ntfs","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Ntfs","Type",0x00010001,0x00000002 + +; Null device driver +HKLM,"SYSTEM\CurrentControlSet\Services\Null","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Null","Group",0x00000000,"Base" +HKLM,"SYSTEM\CurrentControlSet\Services\Null","ImagePath",0x00020000,"system32\drivers\null.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Null","Start",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Null","Type",0x00010001,0x00000001 + +; Packet driver +HKLM,"SYSTEM\CurrentControlSet\Services\Packet","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Packet","Group",0x00000000,"PNP_TDI" +HKLM,"SYSTEM\CurrentControlSet\Services\Packet","ImagePath",0x00020000,"system32\drivers\packet.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Packet","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Packet","Type",0x00010001,0x00000001 + +; Plug and Play manager +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","DisplayName",0x00000000,"Plug and Play" +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Description",0x00000000,"Detects hardware changes and installs needed software if possible" +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Group",0x00000000,"PlugPlay" +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","ImagePath",0x00020000,"%SystemRoot%\system32\umpnpmgr.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\PlugPlay","Type",0x00010001,0x00000010 + +; RPC service +HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","DisplayName",0x00000000,"Remote Procedure Call" +HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Description",0x00000000,"RPC subsystem which is responsible for Remote procedure Calls on the local machine" +HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Group",0x00000000," RPC Service" +HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","ImagePath",0x00020000,"%SystemRoot%\system32\rpcss.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Type",0x00010001,0x00000010 + +; Scsiport driver +HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","Group",0x00000000,"SCSI Port" +HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","ImagePath",0x00020000,"system32\drivers\scsiport.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","Type",0x00010001,0x00000001 + +; Simple TCP services +HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Description",0x00000000,"Supports the following TCP/IP services: Chargen, Daytime, Discard, Echo, QOTD" +HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","DisplayName",0x00000000,"Simple TCP/IP Services" +HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Group",0x00000000,"Network" +HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ImagePath",0x00020000,"%SystemRoot%\system32\tcpsvcs.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Start",0x00010001,0x00000003 +HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Type",0x00010001,0x00000020 + +; Virtual FAT filesystem driver +HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Group",0x00000000,"Boot File System" +HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","ImagePath",0x00020000,"system32\drivers\fastfat.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Type",0x00010001,0x00000002 + +; EXT2 Filesystem driver +HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","Group",0x00000000,"Boot File System" +HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","ImagePath",0x00020000,"system32\drivers\ext2.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","Type",0x00010001,0x00000002 + +; VBE SVGA driver +HKLM,"SYSTEM\CurrentControlSet\Services\VBE","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\VBE","Group",0x00000000,"Video Save" +HKLM,"SYSTEM\CurrentControlSet\Services\VBE","ImagePath",0x00020000,"system32\drivers\vbemp.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\VBE","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\VBE","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\VBE","Tag",0x00010001,0x00000001 + +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","InstalledDisplayDrivers",0x00010000,"framebuf" +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.VRefresh",0x00010001,1 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.BitsPerPel",0x00010001,8 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.XResolution",0x00010001,640 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","DefaultSettings.YResolution",0x00010001,480 + +; VGA miniport driver +HKLM,"SYSTEM\CurrentControlSet\Services\Vga","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Vga","Group",0x00000000,"Video Save" +HKLM,"SYSTEM\CurrentControlSet\Services\Vga","ImagePath",0x00020000,"system32\drivers\vgamp.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\Vga","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Vga","Type",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Vga","Tag",0x00010001,0x00000002 + +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\Vga\Device0","InstalledDisplayDrivers",0x00010000,"vgaddi" +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\Vga\Device0","DefaultSettings.VRefresh",0x00010001,1 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\Vga\Device0","DefaultSettings.BitsPerPel",0x00010001,8 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\Vga\Device0","DefaultSettings.XResolution",0x00010001,640 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\Vga\Device0","DefaultSettings.YResolution",0x00010001,480 + +; USB uhci/ehci driver +;HKLM,"SYSTEM\CurrentControlSet\Services\usbdriver","ErrorControl",0x00010001,0x00000000 +;HKLM,"SYSTEM\CurrentControlSet\Services\usbdriver","Group",0x00000000,"Base" +;HKLM,"SYSTEM\CurrentControlSet\Services\usbdriver","ImagePath",0x00020000,"system32\drivers\usbdriver.sys" +;HKLM,"SYSTEM\CurrentControlSet\Services\usbdriver","Start",0x00010001,0x00000001 +;HKLM,"SYSTEM\CurrentControlSet\Services\usbdriver","Type",0x00010001,0x00000001 + +; Windows Installer Service +HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","DisplayName",0x00000000,"ReactOS Installer" +HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Description",0x00000000,"Controls installation, maintenance, and removal of software packaged as an msi (Windows Installer)" +HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Group",0x00000000,"Windows Installer" +HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ImagePath",0x00020000,"system32\msiexec.exe /V" +HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Start",0x00010001,0x00000003 +HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Type",0x00010001,0x00000020 + +; ControlSet selection settings +HKLM,"SYSTEM\Select","Current",0x00010001,0x00000001 +HKLM,"SYSTEM\Select","Default",0x00010001,0x00000001 +HKLM,"SYSTEM\Select","Failed",0x00010001,0x00000000 +HKLM,"SYSTEM\Select","LastKnownGood",0x00010001,0x00000000 + +; System setup settings +HKLM,"SYSTEM\Setup","CmdLine",0x00000000,"setup -newsetup" +HKLM,"SYSTEM\Setup","OsLoaderPath",0x00000000,"\" +HKLM,"SYSTEM\Setup","SetupType",0x00010001,0x00000001 +HKLM,"SYSTEM\Setup","SystemPartition",0x00000000,"\Device\Harddisk0\Partition1" +HKLM,"SYSTEM\Setup","SystemSetupInProgress",0x00010001,0x00000001 + +; Debug channels +;HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","DEBUGCHANNEL",0x00020000,"+ole,+rpc" + +; EOF From 7ccff652ba5fdf9b86f76ea7b800e977f140053f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 13:03:31 +0000 Subject: [PATCH 005/388] ddk: update AMD64 intrinsic Interlocked functions svn path=/branches/ros-amd64-bringup/; revision=34739 --- reactos/include/ddk/winddk.h | 42 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 9ff8acb224d..5e59690f878 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5730,9 +5730,7 @@ InterlockedExchangeAdd( * IN OUT PVOID VOLATILE *Target, * IN PVOID Value) */ -#if defined (_M_AMD64) -#define InterlockedExchangePointer _InterlockedExchangePointer -#else +#if !defined (_M_AMD64) #define InterlockedExchangePointer(Target, Value) \ ((PVOID) InterlockedExchange((PLONG) Target, (LONG) Value)) #endif @@ -5744,16 +5742,48 @@ InterlockedExchangeAdd( * IN PVOID Exchange, * IN PVOID Comparand) */ -#if defined (_M_AMD64) -#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer -#else +#if !defined (_M_AMD64) #define InterlockedCompareExchangePointer(Destination, Exchange, Comparand) \ ((PVOID) InterlockedCompareExchange((PLONG) Destination, (LONG) Exchange, (LONG) Comparand)) #endif +#if defined (_M_AMD64) #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd((LONG *)a, b) #define InterlockedIncrementSizeT(a) InterlockedIncrement((LONG *)a) #define InterlockedDecrementSizeT(a) InterlockedDecrement((LONG *)a) +#define InterlockedAnd _InterlockedAnd +#define InterlockedOr _InterlockedOr +#define InterlockedXor _InterlockedXor +#define InterlockedIncrement _InterlockedIncrement +#define InterlockedDecrement _InterlockedDecrement +#define InterlockedAdd _InterlockedAdd +#define InterlockedExchange _InterlockedExchange +#define InterlockedExchangeAdd _InterlockedExchangeAdd +#define InterlockedCompareExchange _InterlockedCompareExchange +#define InterlockedAnd64 _InterlockedAnd64 +#define InterlockedOr64 _InterlockedOr64 +#define InterlockedXor64 _InterlockedXor64 +#define InterlockedIncrement64 _InterlockedIncrement64 +#define InterlockedDecrement64 _InterlockedDecrement64 +#define InterlockedAdd64 _InterlockedAdd64 +#define InterlockedExchange64 _InterlockedExchange64 +#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 +#define InterlockedCompareExchange64 _InterlockedCompareExchange64 +#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer +#define InterlockedExchangePointer _InterlockedExchangePointer + +#define ExInterlockedPopEntrySList(Head, Lock) ExpInterlockedPopEntrySList(Head) +#define ExInterlockedPushEntrySList(Head, Entry, Lock) ExpInterlockedPushEntrySList(Head, Entry) +#define ExInterlockedFlushSList(Head) ExpInterlockedFlushSList(Head) + +#if !defined(_WINBASE_) +#define InterlockedPopEntrySList(Head) ExpInterlockedPopEntrySList(Head) +#define InterlockedPushEntrySList(Head, Entry) ExpInterlockedPushEntrySList(Head, Entry) +#define InterlockedFlushSList(Head) ExpInterlockedFlushSList(Head) +#define QueryDepthSList(Head) ExQueryDepthSList(Head) +#endif // !defined(_WINBASE_ + +#endif // defined (_WIN64) #endif /* !__INTERLOCKED_DECLARED */ From af63b172fe5f070f9fd9794e7d7b718e4ed9b256 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 13:32:59 +0000 Subject: [PATCH 006/388] strip off stdcall decoration from amd64 entry points svn path=/branches/ros-amd64-bringup/; revision=34740 --- reactos/tools/rbuild/module.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index 6e1947d1485..3097a23a1e6 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -1316,6 +1316,14 @@ Module::GetEntryPoint(bool leadingUnderscore) const result = "_"; result += entrypoint; + + if (Environment::GetArch() == "amd64") + { + size_t at_index = result.find_last_of( '@' ); + if ( at_index != result.npos ) + return result.substr (0, at_index ); + } + return result; } From 0088ce62be6bdbd46b0c196a5be3bcc8dcfec6b0 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 14:15:12 +0000 Subject: [PATCH 007/388] - make bootvid build for PLATFORM=PC instead of ARCH=i386 to share the files between i386 and amd64 - fix ULONG <-> pointer casts - add bootvid_amd64.def svn path=/branches/ros-amd64-bringup/; revision=34741 --- reactos/drivers/base/bootvid/bootvid.rbuild | 4 ++-- reactos/drivers/base/bootvid/bootvid_amd64.def | 15 +++++++++++++++ reactos/drivers/base/bootvid/i386/bootvid.c | 2 +- reactos/drivers/base/bootvid/i386/vga.c | 10 +++++----- 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 reactos/drivers/base/bootvid/bootvid_amd64.def diff --git a/reactos/drivers/base/bootvid/bootvid.rbuild b/reactos/drivers/base/bootvid/bootvid.rbuild index fcd44ebb09c..4a733a2f947 100644 --- a/reactos/drivers/base/bootvid/bootvid.rbuild +++ b/reactos/drivers/base/bootvid/bootvid.rbuild @@ -6,7 +6,7 @@ . ntoskrnl hal - + bootvid.c bootdata.c @@ -14,7 +14,7 @@ - + bootvid.c bootdata.c diff --git a/reactos/drivers/base/bootvid/bootvid_amd64.def b/reactos/drivers/base/bootvid/bootvid_amd64.def new file mode 100644 index 00000000000..7d3aacc1367 --- /dev/null +++ b/reactos/drivers/base/bootvid/bootvid_amd64.def @@ -0,0 +1,15 @@ +LIBRARY BOOTVID.DLL + +EXPORTS +VidBitBlt +VidBufferToScreenBlt +VidCleanUp +VidDisplayString +VidDisplayStringXY +VidInitialize +VidResetDisplay +VidScreenToBufferBlt +VidSetScrollRegion +VidSetTextColor +VidSolidColorFill + diff --git a/reactos/drivers/base/bootvid/i386/bootvid.c b/reactos/drivers/base/bootvid/i386/bootvid.c index aaf11a38f9b..1ade54a4fd1 100644 --- a/reactos/drivers/base/bootvid/i386/bootvid.c +++ b/reactos/drivers/base/bootvid/i386/bootvid.c @@ -355,7 +355,7 @@ BOOLEAN NTAPI VidInitialize(IN BOOLEAN SetMode) { - ULONG Context = 0; + ULONG_PTR Context = 0; PHYSICAL_ADDRESS TranslatedAddress; PHYSICAL_ADDRESS NullAddress = {{0}}; ULONG AddressSpace = 1; diff --git a/reactos/drivers/base/bootvid/i386/vga.c b/reactos/drivers/base/bootvid/i386/vga.c index 83405ee13a9..6ace318acf5 100644 --- a/reactos/drivers/base/bootvid/i386/vga.c +++ b/reactos/drivers/base/bootvid/i386/vga.c @@ -314,8 +314,8 @@ VgaScroll(ULONG Scroll) do { /* Write value in the new position so that we can do the scroll */ - WRITE_REGISTER_UCHAR((PUCHAR)j, - READ_REGISTER_UCHAR((PUCHAR)j + i)); + WRITE_REGISTER_UCHAR(UlongToPtr(j), + READ_REGISTER_UCHAR(UlongToPtr(j + i))); /* Move to the next memory location to write to */ j++; @@ -1192,7 +1192,7 @@ VidSolidColorFill(IN ULONG Left, __outpw(0x3CE, 7); /* Calculate pixel position for the read */ - Offset = VgaBase + (Top * 80) + (PUCHAR)LeftOffset; + Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)LeftOffset; /* Select the bitmask register and write the mask */ __outpw(0x3CE, (USHORT)lMask); @@ -1216,7 +1216,7 @@ VidSolidColorFill(IN ULONG Left, if (Distance) { /* Calculate new pixel position */ - Offset = VgaBase + (Top * 80) + (PUCHAR)RightOffset; + Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)RightOffset; Distance--; /* Select the bitmask register and write the mask */ @@ -1242,7 +1242,7 @@ VidSolidColorFill(IN ULONG Left, if (Distance) { /* Calculate new pixel position */ - Offset = VgaBase + (Top * 80) + (PUCHAR)(LeftOffset + 1); + Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)(LeftOffset + 1); /* Set the bitmask to 0xFF for all 4 planes */ __outpw(0x3CE, 0xFF08); From 01f51087d5dcbec91e128a2f0c966913d6bdeef6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 14:17:43 +0000 Subject: [PATCH 008/388] add a stubbed version of kdcom for amd64 svn path=/branches/ros-amd64-bringup/; revision=34742 --- reactos/drivers/base/kdcom/amd64/kdbg.c | 360 ++++++++++++++++++++++++ reactos/drivers/base/kdcom/kdcom.rbuild | 7 +- 2 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 reactos/drivers/base/kdcom/amd64/kdbg.c diff --git a/reactos/drivers/base/kdcom/amd64/kdbg.c b/reactos/drivers/base/kdcom/amd64/kdbg.c new file mode 100644 index 00000000000..faf27be6e47 --- /dev/null +++ b/reactos/drivers/base/kdcom/amd64/kdbg.c @@ -0,0 +1,360 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: drivers/base/kdcom/kdbg.c + * PURPOSE: Serial i/o functions for the kernel debugger. + * PROGRAMMER: Alex Ionescu + * Hervé Poussineau + */ + +/* INCLUDES *****************************************************************/ + +#define NOEXTAPI +#include +#define NDEBUG +#include +#include +#include +#include "arc/arc.h" +#include "windbgkd.h" +#include +#include /* port intrinsics */ + +typedef struct _KD_PORT_INFORMATION +{ + ULONG ComPort; + ULONG BaudRate; + ULONG BaseAddress; +} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION; + +BOOLEAN +NTAPI +KdPortInitializeEx( + IN PKD_PORT_INFORMATION PortInformation, + IN ULONG Unknown1, + IN ULONG Unknown2); + +BOOLEAN +NTAPI +KdPortGetByteEx( + IN PKD_PORT_INFORMATION PortInformation, + OUT PUCHAR ByteReceived); + +BOOLEAN +NTAPI +KdPortPollByteEx( + IN PKD_PORT_INFORMATION PortInformation, + OUT PUCHAR ByteReceived); + +VOID +NTAPI +KdPortPutByteEx( + IN PKD_PORT_INFORMATION PortInformation, + IN UCHAR ByteToSend); + +#define DEFAULT_BAUD_RATE 19200 + +#ifdef _M_IX86 +const ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; +#elif defined(_M_PPC) +const ULONG BaseArray[2] = {0, 0x800003f8}; +#elif defined(_M_MIPS) +const ULONG BaseArray[3] = {0, 0x80006000, 0x80007000}; +#elif defined(_M_ARM) +const ULONG BaseArray[2] = {0, 0xF1012000}; +#elif defined(_M_AMD64) +const ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; +#else +#error Unknown architecture +#endif + +/* MACROS *******************************************************************/ + +#define SER_RBR(x) ((PUCHAR)(x)+0) +#define SER_THR(x) ((PUCHAR)(x)+0) +#define SER_DLL(x) ((PUCHAR)(x)+0) +#define SER_IER(x) ((PUCHAR)(x)+1) +#define SR_IER_ERDA 0x01 +#define SR_IER_ETHRE 0x02 +#define SR_IER_ERLSI 0x04 +#define SR_IER_EMS 0x08 +#define SR_IER_ALL 0x0F +#define SER_DLM(x) ((PUCHAR)(x)+1) +#define SER_IIR(x) ((PUCHAR)(x)+2) +#define SER_FCR(x) ((PUCHAR)(x)+2) +#define SR_FCR_ENABLE_FIFO 0x01 +#define SR_FCR_CLEAR_RCVR 0x02 +#define SR_FCR_CLEAR_XMIT 0x04 +#define SER_LCR(x) ((PUCHAR)(x)+3) +#define SR_LCR_CS5 0x00 +#define SR_LCR_CS6 0x01 +#define SR_LCR_CS7 0x02 +#define SR_LCR_CS8 0x03 +#define SR_LCR_ST1 0x00 +#define SR_LCR_ST2 0x04 +#define SR_LCR_PNO 0x00 +#define SR_LCR_POD 0x08 +#define SR_LCR_PEV 0x18 +#define SR_LCR_PMK 0x28 +#define SR_LCR_PSP 0x38 +#define SR_LCR_BRK 0x40 +#define SR_LCR_DLAB 0x80 +#define SER_MCR(x) ((PUCHAR)(x)+4) +#define SR_MCR_DTR 0x01 +#define SR_MCR_RTS 0x02 +#define SR_MCR_OUT1 0x04 +#define SR_MCR_OUT2 0x08 +#define SR_MCR_LOOP 0x10 +#define SER_LSR(x) ((PUCHAR)(x)+5) +#define SR_LSR_DR 0x01 +#define SR_LSR_TBE 0x20 +#define SER_MSR(x) ((PUCHAR)(x)+6) +#define SR_MSR_CTS 0x10 +#define SR_MSR_DSR 0x20 +#define SER_SCR(x) ((PUCHAR)(x)+7) + + +/* GLOBAL VARIABLES *********************************************************/ + +/* STATIC VARIABLES *********************************************************/ + +//static KD_PORT_INFORMATION DefaultPort = { 0, 0, 0 }; + +/* The com port must only be initialized once! */ +//static BOOLEAN PortInitialized = FALSE; + + +/* STATIC FUNCTIONS *********************************************************/ + +/* +static BOOLEAN +KdpDoesComPortExist( + IN ULONG BaseAddress) +{ + UNIMPLEMENTED; + return FALSE; +} +*/ + +/* FUNCTIONS ****************************************************************/ + +NTSTATUS +DriverEntry( + IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPath) +{ + return STATUS_SUCCESS; +} + +/* HAL.KdPortInitialize */ +BOOLEAN +NTAPI +KdPortInitialize( + IN PKD_PORT_INFORMATION PortInformation, + IN ULONG Unknown1, + IN ULONG Unknown2) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* HAL.KdPortInitializeEx */ +BOOLEAN +NTAPI +KdPortInitializeEx( + IN PKD_PORT_INFORMATION PortInformation, + IN ULONG Unknown1, + IN ULONG Unknown2) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* HAL.KdPortGetByte */ +BOOLEAN +NTAPI +KdPortGetByte( + OUT PUCHAR ByteReceived) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* HAL.KdPortGetByteEx */ +BOOLEAN +NTAPI +KdPortGetByteEx( + IN PKD_PORT_INFORMATION PortInformation, + OUT PUCHAR ByteReceived) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* HAL.KdPortPollByte */ +BOOLEAN +NTAPI +KdPortPollByte( + OUT PUCHAR ByteReceived) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* HAL.KdPortPollByteEx */ +BOOLEAN +NTAPI +KdPortPollByteEx( + IN PKD_PORT_INFORMATION PortInformation, + OUT PUCHAR ByteReceived) +{ + UNIMPLEMENTED; + return FALSE; +} + +/* HAL.KdPortPutByte */ +VOID +NTAPI +KdPortPutByte( + IN UCHAR ByteToSend) +{ + UNIMPLEMENTED; + return; +} + +/* HAL.KdPortPutByteEx */ +VOID +NTAPI +KdPortPutByteEx( + IN PKD_PORT_INFORMATION PortInformation, + IN UCHAR ByteToSend) +{ + UNIMPLEMENTED; + return; +} + + +/* HAL.KdPortRestore */ +VOID +NTAPI +KdPortRestore(VOID) +{ + UNIMPLEMENTED; +} + + +/* HAL.KdPortSave */ +VOID +NTAPI +KdPortSave(VOID) +{ + UNIMPLEMENTED; +} + + +/* HAL.KdPortDisableInterrupts */ +BOOLEAN +NTAPI +KdPortDisableInterrupts(VOID) +{ + UNIMPLEMENTED; + return FALSE; +} + + + +/* HAL.KdPortEnableInterrupts */ +BOOLEAN +NTAPI +KdPortEnableInterrupts(VOID) +{ + UNIMPLEMENTED; + return FALSE; +} + + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +KdDebuggerInitialize0( + IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +KdDebuggerInitialize1( + IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +KdSave( + IN BOOLEAN SleepTransition) +{ + /* Nothing to do on COM ports */ + return STATUS_SUCCESS; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +KdRestore( + IN BOOLEAN SleepTransition) +{ + /* Nothing to do on COM ports */ + return STATUS_SUCCESS; +} + +/* + * @unimplemented + */ +VOID +NTAPI +KdSendPacket( + IN ULONG PacketType, + IN PSTRING MessageHeader, + IN PSTRING MessageData, + IN OUT PKD_CONTEXT Context) +{ + UNIMPLEMENTED; + return; +} + +/* + * @unimplemented + */ +KDSTATUS +NTAPI +KdReceivePacket( + IN ULONG PacketType, + OUT PSTRING MessageHeader, + OUT PSTRING MessageData, + OUT PULONG DataLength, + IN OUT PKD_CONTEXT Context) +{ + UNIMPLEMENTED; + return 0; +} + +/* EOF */ diff --git a/reactos/drivers/base/kdcom/kdcom.rbuild b/reactos/drivers/base/kdcom/kdcom.rbuild index 062fafc9211..bb6a2f676a2 100644 --- a/reactos/drivers/base/kdcom/kdcom.rbuild +++ b/reactos/drivers/base/kdcom/kdcom.rbuild @@ -12,7 +12,12 @@ - + + kdbg.c + + + + kdbg.c From fdcebd514369fb66c0fcbb453e9800841f03d7f7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 14:26:53 +0000 Subject: [PATCH 009/388] hal: fix HalRequestIpi prototype, comment out IO access functions for amd64, add hal_amd64.def and a tiny amd64/hal_generic.c svn path=/branches/ros-amd64-bringup/; revision=34743 --- reactos/hal/hal.rbuild | 5 ++ reactos/hal/hal/hal.c | 5 +- reactos/hal/hal/hal_amd64.def | 69 +++++++++++++++++++++++++ reactos/hal/halamd64/hal_generic.c | 34 ++++++++++++ reactos/hal/halamd64/hal_generic.rbuild | 11 ++++ 5 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 reactos/hal/hal/hal_amd64.def create mode 100644 reactos/hal/halamd64/hal_generic.c create mode 100644 reactos/hal/halamd64/hal_generic.rbuild diff --git a/reactos/hal/hal.rbuild b/reactos/hal/hal.rbuild index b2f85e41607..34a2e86248b 100644 --- a/reactos/hal/hal.rbuild +++ b/reactos/hal/hal.rbuild @@ -24,4 +24,9 @@ + + + + + diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index 8d09ee9981f..1e963ec8dfa 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -466,7 +466,7 @@ HalReportResourceUsage(VOID) VOID NTAPI HalRequestIpi( - ULONG Unknown) + KAFFINITY TargetSet) { UNIMPLEMENTED; } @@ -932,7 +932,7 @@ KfReleaseSpinLock( UNIMPLEMENTED; } - +#if !defined(_M_AMD64) VOID NTAPI READ_PORT_BUFFER_UCHAR( @@ -1058,6 +1058,7 @@ WRITE_PORT_USHORT( { UNIMPLEMENTED; } +#endif KIRQL FASTCALL diff --git a/reactos/hal/hal/hal_amd64.def b/reactos/hal/hal/hal_amd64.def new file mode 100644 index 00000000000..27f67d97045 --- /dev/null +++ b/reactos/hal/hal/hal_amd64.def @@ -0,0 +1,69 @@ +; Hardware Abstraction Layer - ReactOS Operating System + +LIBRARY hal.dll + +EXPORTS +HalAcquireDisplayOwnership +HalAdjustResourceList +HalAllProcessorsStarted +HalAllocateAdapterChannel +HalAllocateCommonBuffer +HalAllocateCrashDumpRegisters +HalAssignSlotResources +HalCalibratePerformanceCounter +;HalCallBios +HalClearSoftwareInterrupt +HalDisableSystemInterrupt +HalDisplayString +HalEnableSystemInterrupt +HalFlushCommonBuffer +HalFreeCommonBuffer +HalGetAdapter +HalGetBusData +HalGetBusDataByOffset +HalGetEnvironmentVariable +HalGetInterruptVector +;HalHandleMcheck +HalHandleNMI +HalInitSystem +HalInitializeProcessor +;HalIsHyperThreadingEnabled +HalMakeBeep +HalProcessorIdle +HalQueryDisplayParameters +HalQueryRealTimeClock +HalReadDmaCounter +HalReportResourceUsage +HalRequestIpi +HalRequestSoftwareInterrupt +HalReturnToFirmware +;HalSendNMI +;HalSendSoftwareInterrupt +HalSetBusData +HalSetBusDataByOffset +HalSetDisplayParameters +HalSetEnvironmentVariable +HalSetProfileInterval +HalSetRealTimeClock +HalSetTimeIncrement +HalStartNextProcessor +HalStartProfileInterrupt +HalStopProfileInterrupt +HalSystemVectorDispatchEntry +HalTranslateBusAddress +;IoAssignDriveLetters +IoFlushAdapterBuffers +IoFreeAdapterChannel +IoFreeMapRegisters +IoMapTransfer +;IoReadPartitionTable +;IoSetPartitionInformation +;IoWritePartitionTable +;KdComPortInUse +KeFlushWriteBuffer +KeQueryPerformanceCounter +KeStallExecutionProcessor +;x86BiosExecuteInterrupt +;x86BiosInitializeBiosEx +;x86BiosTranslateAddress +;DllEntryPoint diff --git a/reactos/hal/halamd64/hal_generic.c b/reactos/hal/halamd64/hal_generic.c new file mode 100644 index 00000000000..a5aa4488c65 --- /dev/null +++ b/reactos/hal/halamd64/hal_generic.c @@ -0,0 +1,34 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: GPL - See COPYING in the top level directory + * FILE: hal/halamd64/ + * PURPOSE: I/O HAL Routines for Disk Access + * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +/* FUNCTIONS *****************************************************************/ + + + + +NTSTATUS +NTAPI +HalpSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG PartitionNumber, + IN ULONG PartitionType) +{ + /* Call the kernel */ + return IoSetPartitionInformation(DeviceObject, + SectorSize, + PartitionNumber, + PartitionType); +} + + diff --git a/reactos/hal/halamd64/hal_generic.rbuild b/reactos/hal/halamd64/hal_generic.rbuild new file mode 100644 index 00000000000..1e0fdc00088 --- /dev/null +++ b/reactos/hal/halamd64/hal_generic.rbuild @@ -0,0 +1,11 @@ + + + + + include + include + + + hal_generic.c + + From 9e84c59b5c1750262b9f96948fcaedeb9cdfda9b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 14:31:35 +0000 Subject: [PATCH 010/388] add ntoskrnl_amd64.def. For some reason amd64 kernel does not export KeQuerySystemTime and atm I don't know what else should be used, so I added it to the def. svn path=/branches/ros-amd64-bringup/; revision=34744 --- reactos/ntoskrnl/ntoskrnl.rbuild | 1 + reactos/ntoskrnl/ntoskrnl_amd64.def | 1519 +++++++++++++++++++++++++++ 2 files changed, 1520 insertions(+) create mode 100644 reactos/ntoskrnl/ntoskrnl_amd64.def diff --git a/reactos/ntoskrnl/ntoskrnl.rbuild b/reactos/ntoskrnl/ntoskrnl.rbuild index 495a44410c8..a63382207e4 100644 --- a/reactos/ntoskrnl/ntoskrnl.rbuild +++ b/reactos/ntoskrnl/ntoskrnl.rbuild @@ -3,5 +3,6 @@ + diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def new file mode 100644 index 00000000000..6fa7363a8ba --- /dev/null +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -0,0 +1,1519 @@ +; reactos/ntoskrnl/ntoskrnl.def +; +; ReactOS Operating System +; +EXPORTS +; +KeQuerySystemTime +; +; original: +CcCanIWrite +CcCopyRead +CcCopyWrite +CcDeferWrite +CcFastCopyRead +CcFastCopyWrite +CcFastMdlReadWait +CcFastReadNotPossible +CcFastReadWait +CcFlushCache +CcGetDirtyPages +CcGetFileObjectFromBcb +CcGetFileObjectFromSectionPtrs +CcGetFlushedValidData +CcGetLsnForFileObject +CcInitializeCacheMap +CcIsThereDirtyData +CcMapData +CcMdlRead +CcMdlReadComplete +CcMdlWriteAbort +CcMdlWriteComplete +CcPinMappedData +CcPinRead +CcPrepareMdlWrite +CcPreparePinWrite +CcPurgeCacheSection +CcRemapBcb +CcRepinBcb +CcScheduleReadAhead +CcSetAdditionalCacheAttributes +CcSetBcbOwnerPointer +CcSetDirtyPageThreshold +CcSetDirtyPinnedData +CcSetFileSizes +CcSetLogHandleForFile +CcSetReadAheadGranularity +CcUninitializeCacheMap +CcUnpinData +CcUnpinDataForThread +CcUnpinRepinnedBcb +CcWaitForCurrentLazyWriterActivity +CcZeroData +CmRegisterCallback +CmUnRegisterCallback +DbgBreakPoint +DbgBreakPointWithStatus +DbgCommandString +DbgLoadImageSymbols +DbgPrint +DbgPrintEx +DbgPrintReturnControlC +DbgPrompt +DbgQueryDebugFilterState +DbgSetDebugFilterState +ExAcquireFastMutex +ExAcquireFastMutexUnsafe +ExAcquireResourceExclusiveLite +ExAcquireResourceSharedLite +ExAcquireRundownProtection +ExAcquireRundownProtectionCacheAware +ExAcquireRundownProtectionCacheAwareEx +ExAcquireRundownProtectionEx +ExAcquireSharedStarveExclusive +ExAcquireSharedWaitForExclusive +ExAllocateCacheAwareRundownProtection +ExAllocateFromPagedLookasideList +ExAllocatePool +ExAllocatePoolWithQuota +ExAllocatePoolWithQuotaTag +ExAllocatePoolWithTag +ExAllocatePoolWithTagPriority +ExConvertExclusiveToSharedLite +ExCreateCallback +ExDeleteNPagedLookasideList +ExDeletePagedLookasideList +ExDeleteResourceLite +ExDesktopObjectType +ExDisableResourceBoostLite +ExEnterCriticalRegionAndAcquireFastMutexUnsafe +ExEnterCriticalRegionAndAcquireResourceExclusive +ExEnterCriticalRegionAndAcquireResourceShared +ExEnterCriticalRegionAndAcquireSharedWaitForExclusive +ExEnumHandleTable +ExEventObjectType +ExExtendZone +ExFreeCacheAwareRundownProtection +ExFreePool +ExFreePoolWithTag +ExFreeToPagedLookasideList +ExGetCurrentProcessorCounts +ExGetCurrentProcessorCpuUsage +ExGetExclusiveWaiterCount +ExGetPreviousMode +ExGetSharedWaiterCount +ExInitializeNPagedLookasideList +ExInitializePagedLookasideList +ExInitializeResourceLite +ExInitializeRundownProtection +ExInitializeRundownProtectionCacheAware +ExInitializeZone +ExInterlockedAddLargeInteger +ExInterlockedAddUlong +ExInterlockedExtendZone +ExInterlockedInsertHeadList +ExInterlockedInsertTailList +ExInterlockedPopEntryList +ExInterlockedPushEntryList +ExInterlockedRemoveHeadList +ExIsProcessorFeaturePresent +ExIsResourceAcquiredExclusiveLite +ExIsResourceAcquiredSharedLite +ExLocalTimeToSystemTime +ExNotifyCallback +ExQueryDepthSList +ExQueryPoolBlockSize +ExQueueWorkItem +ExRaiseAccessViolation +ExRaiseDatatypeMisalignment +ExRaiseException +ExRaiseHardError +ExRaiseStatus +ExReInitializeRundownProtection +ExReInitializeRundownProtectionCacheAware +ExRegisterCallback +ExReinitializeResourceLite +ExReleaseFastMutex +ExReleaseFastMutexUnsafe +ExReleaseFastMutexUnsafeAndLeaveCriticalRegion +ExReleaseResourceAndLeaveCriticalRegion +ExReleaseResourceForThreadLite +ExReleaseResourceLite +ExReleaseRundownProtection +ExReleaseRundownProtectionCacheAware +ExReleaseRundownProtectionCacheAwareEx +ExReleaseRundownProtectionEx +ExRundownCompleted +ExRundownCompletedCacheAware +ExSemaphoreObjectType +ExSetResourceOwnerPointer +ExSetTimerResolution +ExSizeOfRundownProtectionCacheAware +ExSystemExceptionFilter +ExSystemTimeToLocalTime +ExTryToAcquireFastMutex +ExUnregisterCallback +ExUuidCreate +ExVerifySuite +ExWaitForRundownProtectionRelease +ExWaitForRundownProtectionReleaseCacheAware +ExWindowStationObjectType +ExfAcquirePushLockExclusive +ExfAcquirePushLockShared +ExfReleasePushLock +ExfReleasePushLockExclusive +ExfReleasePushLockShared +ExfTryToWakePushLock +ExfUnblockPushLock +ExpInterlockedFlushSList +ExpInterlockedPopEntrySList +ExpInterlockedPushEntrySList +FsRtlAcquireFileExclusive +FsRtlAddBaseMcbEntry +FsRtlAddLargeMcbEntry +FsRtlAddMcbEntry +FsRtlAddToTunnelCache +FsRtlAllocateFileLock +FsRtlAllocatePool +FsRtlAllocatePoolWithQuota +FsRtlAllocatePoolWithQuotaTag +FsRtlAllocatePoolWithTag +FsRtlAllocateResource +FsRtlAreNamesEqual +FsRtlBalanceReads +FsRtlCheckLockForReadAccess +FsRtlCheckLockForWriteAccess +FsRtlCheckOplock +FsRtlCopyRead +FsRtlCopyWrite +FsRtlCreateSectionForDataScan +FsRtlCurrentBatchOplock +FsRtlDeleteKeyFromTunnelCache +FsRtlDeleteTunnelCache +FsRtlDeregisterUncProvider +FsRtlDissectDbcs +FsRtlDissectName +FsRtlDoesDbcsContainWildCards +FsRtlDoesNameContainWildCards +FsRtlFastCheckLockForRead +FsRtlFastCheckLockForWrite +FsRtlFastUnlockAll +FsRtlFastUnlockAllByKey +FsRtlFastUnlockSingle +FsRtlFindInTunnelCache +FsRtlFreeFileLock +FsRtlGetFileSize +FsRtlGetNextBaseMcbEntry +FsRtlGetNextFileLock +FsRtlGetNextLargeMcbEntry +FsRtlGetNextMcbEntry +FsRtlIncrementCcFastReadNoWait +FsRtlIncrementCcFastReadNotPossible +FsRtlIncrementCcFastReadResourceMiss +FsRtlIncrementCcFastReadWait +FsRtlInitializeBaseMcb +FsRtlInitializeFileLock +FsRtlInitializeLargeMcb +FsRtlInitializeMcb +FsRtlInitializeOplock +FsRtlInitializeTunnelCache +FsRtlInsertPerFileObjectContext +FsRtlInsertPerStreamContext +FsRtlIsDbcsInExpression +FsRtlIsFatDbcsLegal +FsRtlIsHpfsDbcsLegal +FsRtlIsNameInExpression +FsRtlIsNtstatusExpected +FsRtlIsPagingFile +FsRtlIsTotalDeviceFailure +FsRtlLegalAnsiCharacterArray +FsRtlLookupBaseMcbEntry +FsRtlLookupLargeMcbEntry +FsRtlLookupLastBaseMcbEntry +FsRtlLookupLastBaseMcbEntryAndIndex +FsRtlLookupLastLargeMcbEntry +FsRtlLookupLastLargeMcbEntryAndIndex +FsRtlLookupLastMcbEntry +FsRtlLookupMcbEntry +FsRtlLookupPerFileObjectContext +FsRtlLookupPerStreamContextInternal +FsRtlMdlRead +FsRtlMdlReadComplete +FsRtlMdlReadCompleteDev +FsRtlMdlReadDev +FsRtlMdlWriteComplete +FsRtlMdlWriteCompleteDev +FsRtlNormalizeNtstatus +FsRtlNotifyChangeDirectory +FsRtlNotifyCleanup +FsRtlNotifyFilterChangeDirectory +FsRtlNotifyFilterReportChange +FsRtlNotifyFullChangeDirectory +FsRtlNotifyFullReportChange +FsRtlNotifyInitializeSync +FsRtlNotifyReportChange +FsRtlNotifyUninitializeSync +FsRtlNotifyVolumeEvent +FsRtlNumberOfRunsInBaseMcb +FsRtlNumberOfRunsInLargeMcb +FsRtlNumberOfRunsInMcb +FsRtlOplockFsctrl +FsRtlOplockIsFastIoPossible +FsRtlPostPagingFileStackOverflow +FsRtlPostStackOverflow +FsRtlPrepareMdlWrite +FsRtlPrepareMdlWriteDev +FsRtlPrivateLock +FsRtlProcessFileLock +FsRtlRegisterFileSystemFilterCallbacks +FsRtlRegisterUncProvider +FsRtlReleaseFile +FsRtlRemoveBaseMcbEntry +FsRtlRemoveLargeMcbEntry +FsRtlRemoveMcbEntry +FsRtlRemovePerFileObjectContext +FsRtlRemovePerStreamContext +FsRtlResetBaseMcb +FsRtlResetLargeMcb +FsRtlSplitBaseMcb +FsRtlSplitLargeMcb +FsRtlSyncVolumes +FsRtlTeardownPerStreamContexts +FsRtlTruncateBaseMcb +FsRtlTruncateLargeMcb +FsRtlTruncateMcb +FsRtlUninitializeBaseMcb +FsRtlUninitializeFileLock +FsRtlUninitializeLargeMcb +FsRtlUninitializeMcb +FsRtlUninitializeOplock +HalDispatchTable +HalExamineMBR +HalPrivateDispatchTable +HeadlessDispatch +InbvAcquireDisplayOwnership +InbvCheckDisplayOwnership +InbvDisplayString +InbvEnableBootDriver +InbvEnableDisplayString +InbvInstallDisplayStringFilter +InbvIsBootDriverInstalled +InbvNotifyDisplayOwnershipLost +InbvResetDisplay +InbvSetScrollRegion +InbvSetTextColor +InbvSolidColorFill +InitSafeBootMode +InitializeSListHead +IoAcquireCancelSpinLock +IoAcquireRemoveLockEx +IoAcquireVpbSpinLock +IoAdapterObjectType +IoAllocateAdapterChannel +IoAllocateController +IoAllocateDriverObjectExtension +IoAllocateErrorLogEntry +IoAllocateIrp +IoAllocateMdl +IoAllocateWorkItem +IoAssignDriveLetters +IoAssignResources +IoAttachDevice +IoAttachDeviceByPointer +IoAttachDeviceToDeviceStack +IoAttachDeviceToDeviceStackSafe +IoBuildAsynchronousFsdRequest +IoBuildDeviceIoControlRequest +IoBuildPartialMdl +IoBuildSynchronousFsdRequest +IoCallDriver +IoCancelFileOpen +IoCancelIrp +IoCheckDesiredAccess +IoCheckEaBufferValidity +IoCheckFunctionAccess +IoCheckQuerySetFileInformation +IoCheckQuerySetVolumeInformation +IoCheckQuotaBufferValidity +IoCheckShareAccess +IoCompleteRequest +IoConnectInterrupt +IoCreateController +IoCreateDevice +IoCreateDisk +IoCreateDriver +IoCreateFile +IoCreateFileSpecifyDeviceObjectHint +IoCreateNotificationEvent +IoCreateStreamFileObject +IoCreateStreamFileObjectEx +IoCreateStreamFileObjectLite +IoCreateSymbolicLink +IoCreateSynchronizationEvent +IoCreateUnprotectedSymbolicLink +IoCsqInitialize +IoCsqInitializeEx +IoCsqInsertIrp +IoCsqInsertIrpEx +IoCsqRemoveIrp +IoCsqRemoveNextIrp +IoDeleteController +IoDeleteDevice +IoDeleteDriver +IoDeleteSymbolicLink +IoDetachDevice +IoDeviceHandlerObjectSize +IoDeviceHandlerObjectType +IoDeviceObjectType +IoDisconnectInterrupt +IoDriverObjectType +IoEnqueueIrp +IoEnumerateDeviceObjectList +IoEnumerateRegisteredFiltersList +IoFastQueryNetworkAttributes +IoFileObjectType +IoForwardAndCatchIrp +IoForwardIrpSynchronously +IoFreeController +IoFreeErrorLogEntry +IoFreeIrp +IoFreeMdl +IoFreeWorkItem +IoGetAttachedDevice +IoGetAttachedDeviceReference +IoGetBaseFileSystemDeviceObject +IoGetBootDiskInformation +IoGetConfigurationInformation +IoGetCurrentProcess +IoGetDeviceAttachmentBaseRef +IoGetDeviceInterfaceAlias +IoGetDeviceInterfaces +IoGetDeviceObjectPointer +IoGetDeviceProperty +IoGetDeviceToVerify +IoGetDiskDeviceObject +IoGetDmaAdapter +IoGetDriverObjectExtension +IoGetFileObjectGenericMapping +IoGetInitialStack +IoGetLowerDeviceObject +IoGetPagingIoPriority +IoGetRelatedDeviceObject +IoGetRequestorProcess +IoGetRequestorProcessId +IoGetRequestorSessionId +IoGetStackLimits +IoGetTopLevelIrp +IoInitializeIrp +IoInitializeRemoveLockEx +IoInitializeTimer +IoInvalidateDeviceRelations +IoInvalidateDeviceState +IoIs32bitProcess +IoIsFileOriginRemote +IoIsOperationSynchronous +IoIsSystemThread +IoIsValidNameGraftingBuffer +IoIsWdmVersionAvailable +IoMakeAssociatedIrp +IoOpenDeviceInterfaceRegistryKey +IoOpenDeviceRegistryKey +IoPageRead +IoPnPDeliverServicePowerNotification +IoQueryDeviceDescription +IoQueryFileDosDeviceName +IoQueryFileInformation +IoQueryVolumeInformation +IoQueueThreadIrp +IoQueueWorkItem +IoRaiseHardError +IoRaiseInformationalHardError +IoReadDiskSignature +IoReadOperationCount +IoReadPartitionTable +IoReadPartitionTableEx +IoReadTransferCount +IoRegisterBootDriverReinitialization +IoRegisterDeviceInterface +IoRegisterDriverReinitialization +IoRegisterFileSystem +IoRegisterFsRegistrationChange +IoRegisterLastChanceShutdownNotification +IoRegisterPlugPlayNotification +IoRegisterShutdownNotification +IoReleaseCancelSpinLock +IoReleaseRemoveLockAndWaitEx +IoReleaseRemoveLockEx +IoReleaseVpbSpinLock +IoRemoveShareAccess +IoReportDetectedDevice +IoReportHalResourceUsage +IoReportResourceForDetection +IoReportResourceUsage +IoReportTargetDeviceChange +IoReportTargetDeviceChangeAsynchronous +IoRequestDeviceEject +IoReuseIrp +IoSetCompletionRoutineEx +IoSetDeviceInterfaceState +IoSetDeviceToVerify +IoSetFileOrigin +IoSetHardErrorOrVerifyDevice +IoSetInformation +IoSetIoCompletion +IoSetPartitionInformation +IoSetPartitionInformationEx +IoSetShareAccess +IoSetStartIoAttributes +IoSetSystemPartition +IoSetThreadHardErrorMode +IoSetTopLevelIrp +IoStartNextPacket +IoStartNextPacketByKey +IoStartPacket +IoStartTimer +IoStatisticsLock +IoStopTimer +IoSynchronousInvalidateDeviceRelations +IoSynchronousPageWrite +IoThreadToProcess +IoTranslateBusAddress +IoUnregisterFileSystem +IoUnregisterFsRegistrationChange +IoUnregisterPlugPlayNotification +IoUnregisterShutdownNotification +IoUpdateShareAccess +IoValidateDeviceIoControlAccess +IoVerifyPartitionTable +IoVerifyVolume +IoVolumeDeviceToDosName +IoWMIAllocateInstanceIds +IoWMIDeviceObjectToInstanceName +IoWMIDeviceObjectToProviderId +IoWMIExecuteMethod +IoWMIHandleToInstanceName +IoWMIOpenBlock +IoWMIQueryAllData +IoWMIQueryAllDataMultiple +IoWMIQuerySingleInstance +IoWMIQuerySingleInstanceMultiple +IoWMIRegistrationControl +IoWMISetNotificationCallback +IoWMISetSingleInstance +IoWMISetSingleItem +IoWMISuggestInstanceName +IoWMIWriteEvent +IoWriteErrorLogEntry +IoWriteOperationCount +IoWritePartitionTable +IoWritePartitionTableEx +IoWriteTransferCount +IofCallDriver +IofCompleteRequest +KdChangeOption +KdDebuggerEnabled +KdDebuggerNotPresent +KdDisableDebugger +KdEnableDebugger +KdEnteredDebugger +KdPollBreakIn +KdPowerTransition +KdRefreshDebuggerNotPresent +KdSystemDebugControl +KeAcquireGuardedMutex +KeAcquireGuardedMutexUnsafe +KeAcquireInStackQueuedSpinLock +KeAcquireInStackQueuedSpinLockAtDpcLevel +KeAcquireInStackQueuedSpinLockForDpc +KeAcquireInStackQueuedSpinLockRaiseToSynch +KeAcquireInterruptSpinLock +KeAcquireQueuedSpinLock +KeAcquireQueuedSpinLockRaiseToSynch +KeAcquireSpinLockAtDpcLevel +KeAcquireSpinLockForDpc +KeAcquireSpinLockRaiseToDpc +KeAcquireSpinLockRaiseToSynch +KeAddSystemServiceTable +KeAreAllApcsDisabled +KeAreApcsDisabled +KeAttachProcess +KeBugCheck +KeBugCheckEx +KeCancelTimer +KeCapturePersistentThreadState +KeClearEvent +KeConnectInterrupt +KeDelayExecutionThread +KeDeregisterBugCheckCallback +KeDeregisterBugCheckReasonCallback +KeDeregisterNmiCallback +KeDetachProcess +KeDisconnectInterrupt +KeEnterCriticalRegion +KeEnterGuardedRegion +KeEnterKernelDebugger +KeExpandKernelStackAndCallout +KeFindConfigurationEntry +KeFindConfigurationNextEntry +KeFlushEntireTb +KeFlushQueuedDpcs +KeGenericCallDpc +KeGetCurrentIrql +KeGetCurrentThread +KeGetRecommendedSharedDataAlignment +KeInitializeApc +KeInitializeCrashDumpHeader +KeInitializeDeviceQueue +KeInitializeDpc +KeInitializeEvent +KeInitializeGuardedMutex +KeInitializeInterrupt +KeInitializeMutant +KeInitializeMutex +KeInitializeQueue +KeInitializeSemaphore +KeInitializeThreadedDpc +KeInitializeTimer +KeInitializeTimerEx +KeInsertByKeyDeviceQueue +KeInsertDeviceQueue +KeInsertHeadQueue +KeInsertQueue +KeInsertQueueApc +KeInsertQueueDpc +KeInvalidateAllCaches +KeIpiGenericCall +KeIsAttachedProcess +KeIsWaitListEmpty +KeLastBranchMSR +KeLeaveCriticalRegion +KeLeaveGuardedRegion +KeLoaderBlock +KeLowerIrql +KeNumberProcessors +KeProfileInterruptWithSource +KePulseEvent +KeQueryActiveProcessors +KeQueryMultiThreadProcessorSet +KeQueryPrcbAddress +KeQueryPriorityThread +KeQueryRuntimeThread +KeQueryTimeIncrement +KeRaiseIrqlToDpcLevel +KeRaiseUserException +KeReadStateEvent +KeReadStateMutant +KeReadStateMutex +KeReadStateQueue +KeReadStateSemaphore +KeReadStateTimer +KeRegisterBugCheckCallback +KeRegisterBugCheckReasonCallback +KeRegisterNmiCallback +KeReleaseGuardedMutex +KeReleaseGuardedMutexUnsafe +KeReleaseInStackQueuedSpinLock +KeReleaseInStackQueuedSpinLockForDpc +KeReleaseInStackQueuedSpinLockFromDpcLevel +KeReleaseInterruptSpinLock +KeReleaseMutant +KeReleaseMutex +KeReleaseQueuedSpinLock +KeReleaseSemaphore +KeReleaseSpinLock +KeReleaseSpinLockForDpc +KeReleaseSpinLockFromDpcLevel +KeRemoveByKeyDeviceQueue +KeRemoveByKeyDeviceQueueIfBusy +KeRemoveDeviceQueue +KeRemoveEntryDeviceQueue +KeRemoveQueue +KeRemoveQueueDpc +KeRemoveSystemServiceTable +KeResetEvent +KeRestoreFloatingPointState +KeRevertToUserAffinityThread +KeRundownQueue +KeSaveFloatingPointState +KeSaveStateForHibernate +KeServiceDescriptorTable +KeSetAffinityThread +KeSetBasePriorityThread +KeSetDmaIoCoherency +KeSetEvent +KeSetEventBoostPriority +KeSetIdealProcessorThread +KeSetImportanceDpc +KeSetKernelStackSwapEnable +KeSetPriorityThread +KeSetProfileIrql +KeSetSystemAffinityThread +KeSetTargetProcessorDpc +KeSetTimeIncrement +KeSetTimer +KeSetTimerEx +KeSignalCallDpcDone +KeSignalCallDpcSynchronize +KeStackAttachProcess +KeSynchronizeExecution +KeTerminateThread +KeTestSpinLock +KeTryToAcquireGuardedMutex +KeTryToAcquireQueuedSpinLock +KeTryToAcquireQueuedSpinLockRaiseToSynch +KeTryToAcquireSpinLockAtDpcLevel +KeUnstackDetachProcess +KeUpdateRunTime +KeUpdateSystemTime +KeUserModeCallback +KeWaitForMultipleObjects +KeWaitForMutexObject +KeWaitForSingleObject +KfRaiseIrql +KiBugCheckData +KiCheckForKernelApcDelivery +KiCpuId +LdrAccessResource +LdrEnumResources +LdrFindResourceDirectory_U +LdrFindResource_U +LpcPortObjectType +LpcRequestPort +LpcRequestWaitReplyPort +LsaCallAuthenticationPackage +LsaDeregisterLogonProcess +LsaFreeReturnBuffer +LsaLogonUser +LsaLookupAuthenticationPackage +LsaRegisterLogonProcess +Mm64BitPhysicalAddress +MmAddPhysicalMemory +MmAddVerifierThunks +MmAdjustWorkingSetSize +MmAdvanceMdl +MmAllocateContiguousMemory +MmAllocateContiguousMemorySpecifyCache +MmAllocateMappingAddress +MmAllocateNonCachedMemory +MmAllocatePagesForMdl +MmAllocatePagesForMdlEx +MmBuildMdlForNonPagedPool +MmCanFileBeTruncated +MmCommitSessionMappedView +MmCreateMdl +MmCreateMirror +MmCreateSection +MmDisableModifiedWriteOfSection +MmFlushImageSection +MmForceSectionClosed +MmFreeContiguousMemory +MmFreeContiguousMemorySpecifyCache +MmFreeMappingAddress +MmFreeNonCachedMemory +MmFreePagesFromMdl +MmGetPhysicalAddress +MmGetPhysicalMemoryRanges +MmGetSystemRoutineAddress +MmGetVirtualForPhysical +MmGrowKernelStack +MmHighestUserAddress +MmIsAddressValid +MmIsDriverVerifying +MmIsIoSpaceActive +MmIsNonPagedSystemAddressValid +MmIsRecursiveIoFault +MmIsThisAnNtAsSystem +MmIsVerifierEnabled +MmLockPagableDataSection +MmLockPagableImageSection +MmLockPagableSectionByHandle +MmMapIoSpace +MmMapLockedPages +MmMapLockedPagesSpecifyCache +MmMapLockedPagesWithReservedMapping +MmMapMemoryDumpMdl +MmMapUserAddressesToPage +MmMapVideoDisplay +MmMapViewInSessionSpace +MmMapViewInSystemSpace +MmMapViewOfSection +MmMarkPhysicalMemoryAsBad +MmMarkPhysicalMemoryAsGood +MmPageEntireDriver +MmPrefetchPages +MmProbeAndLockPages +MmProbeAndLockProcessPages +MmProbeAndLockSelectedPages +MmProtectMdlSystemAddress +MmQuerySystemSize +MmRemovePhysicalMemory +MmResetDriverPaging +MmSectionObjectType +MmSecureVirtualMemory +MmSetAddressRangeModified +MmSetBankedSection +MmSizeOfMdl +MmSystemRangeStart +MmTrimAllSystemPagableMemory +MmUnlockPagableImageSection +MmUnlockPages +MmUnmapIoSpace +MmUnmapLockedPages +MmUnmapReservedMapping +MmUnmapVideoDisplay +MmUnmapViewInSessionSpace +MmUnmapViewInSystemSpace +MmUnmapViewOfSection +MmUnsecureVirtualMemory +MmUserProbeAddress +NlsAnsiCodePage +NlsLeadByteInfo +NlsMbCodePageTag +NlsMbOemCodePageTag +NlsOemCodePage +NlsOemLeadByteInfo +NtAddAtom +NtAdjustPrivilegesToken +NtAllocateLocallyUniqueId +NtAllocateUuids +NtAllocateVirtualMemory +NtBuildNumber +NtClose +NtConnectPort +NtCreateEvent +NtCreateFile +NtCreateSection +NtDeleteAtom +NtDeleteFile +NtDeviceIoControlFile +NtDuplicateObject +NtDuplicateToken +NtFindAtom +NtFreeVirtualMemory +NtFsControlFile +NtGlobalFlag +NtLockFile +NtMakePermanentObject +NtMapViewOfSection +NtNotifyChangeDirectoryFile +NtOpenFile +NtOpenProcess +NtOpenProcessToken +NtOpenProcessTokenEx +NtOpenThread +NtOpenThreadToken +NtOpenThreadTokenEx +NtQueryDirectoryFile +NtQueryEaFile +NtQueryInformationAtom +NtQueryInformationFile +NtQueryInformationProcess +NtQueryInformationThread +NtQueryInformationToken +NtQueryQuotaInformationFile +NtQuerySecurityObject +NtQuerySystemInformation +NtQueryVolumeInformationFile +NtReadFile +NtRequestPort +NtRequestWaitReplyPort +NtSetEaFile +NtSetEvent +NtSetInformationFile +NtSetInformationProcess +NtSetInformationThread +NtSetQuotaInformationFile +NtSetSecurityObject +NtSetVolumeInformationFile +NtShutdownSystem +NtTraceEvent +NtUnlockFile +NtVdmControl +NtWaitForSingleObject +NtWriteFile +ObAssignSecurity +ObCheckCreateObjectAccess +ObCheckObjectAccess +ObCloseHandle +ObCreateObject +ObCreateObjectType +ObDeleteCapturedInsertInfo +ObDereferenceObject +ObDereferenceSecurityDescriptor +ObFindHandleForObject +ObGetObjectSecurity +ObInsertObject +ObLogSecurityDescriptor +ObMakeTemporaryObject +ObOpenObjectByName +ObOpenObjectByPointer +ObQueryNameString +ObQueryObjectAuditingByHandle +ObReferenceObjectByHandle +ObReferenceObjectByName +ObReferenceObjectByPointer +ObReferenceSecurityDescriptor +ObReleaseObjectSecurity +ObSetHandleAttributes +ObSetSecurityDescriptorInfo +ObSetSecurityObjectByPointer +ObfDereferenceObject +ObfReferenceObject +PfxFindPrefix +PfxInitialize +PfxInsertPrefix +PfxRemovePrefix +PoCallDriver +PoCancelDeviceNotify +PoQueueShutdownWorkItem +PoRegisterDeviceForIdleDetection +PoRegisterDeviceNotify +PoRegisterSystemState +PoRequestPowerIrp +PoRequestShutdownEvent +PoSetHiberRange +PoSetPowerState +PoSetSystemState +PoShutdownBugCheck +PoStartNextPowerIrp +PoUnregisterSystemState +ProbeForRead +ProbeForWrite +PsAssignImpersonationToken +PsChargePoolQuota +PsChargeProcessNonPagedPoolQuota +PsChargeProcessPagedPoolQuota +PsChargeProcessPoolQuota +PsCreateSystemProcess +PsCreateSystemThread +PsDereferenceImpersonationToken +PsDereferencePrimaryToken +PsDisableImpersonation +PsEstablishWin32Callouts +PsGetContextThread +PsGetCurrentProcess +PsGetCurrentProcessId +PsGetCurrentProcessSessionId +PsGetCurrentProcessWin32Process +PsGetCurrentProcessWow64Process +PsGetCurrentThread +PsGetCurrentThreadId +PsGetCurrentThreadPreviousMode +PsGetCurrentThreadProcess +PsGetCurrentThreadProcessId +PsGetCurrentThreadStackBase +PsGetCurrentThreadStackLimit +PsGetCurrentThreadTeb +PsGetCurrentThreadWin32Thread +PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion +PsGetJobLock +PsGetJobSessionId +PsGetJobUIRestrictionsClass +PsGetProcessCreateTimeQuadPart +PsGetProcessDebugPort +PsGetProcessExitProcessCalled +PsGetProcessExitStatus +PsGetProcessExitTime +PsGetProcessId +PsGetProcessImageFileName +PsGetProcessInheritedFromUniqueProcessId +PsGetProcessJob +PsGetProcessPeb +PsGetProcessPriorityClass +PsGetProcessSectionBaseAddress +PsGetProcessSecurityPort +PsGetProcessSessionId +PsGetProcessSessionIdEx +PsGetProcessWin32Process +PsGetProcessWin32WindowStation +PsGetProcessWow64Process +PsGetThreadFreezeCount +PsGetThreadHardErrorsAreDisabled +PsGetThreadId +PsGetThreadProcess +PsGetThreadProcessId +PsGetThreadSessionId +PsGetThreadTeb +PsGetThreadWin32Thread +PsGetVersion +PsImpersonateClient +PsInitialSystemProcess +PsIsProcessBeingDebugged +PsIsSystemProcess +PsIsSystemThread +PsIsThreadImpersonating +PsIsThreadTerminating +PsJobType +PsLookupProcessByProcessId +PsLookupProcessThreadByCid +PsLookupThreadByThreadId +PsProcessType +PsReferenceImpersonationToken +PsReferencePrimaryToken +PsRemoveCreateThreadNotifyRoutine +PsRemoveLoadImageNotifyRoutine +PsRestoreImpersonation +PsReturnPoolQuota +PsReturnProcessNonPagedPoolQuota +PsReturnProcessPagedPoolQuota +PsRevertThreadToSelf +PsRevertToSelf +PsSetContextThread +PsSetCreateProcessNotifyRoutine +PsSetCreateThreadNotifyRoutine +PsSetJobUIRestrictionsClass +PsSetLegoNotifyRoutine +PsSetLoadImageNotifyRoutine +PsSetProcessPriorityByClass +PsSetProcessPriorityClass +PsSetProcessSecurityPort +PsSetProcessWin32Process +PsSetProcessWindowStation +PsSetThreadHardErrorsAreDisabled +PsSetThreadWin32Thread +PsTerminateSystemThread +PsThreadType +PsWrapApcWow64Thread +RtlAbsoluteToSelfRelativeSD +RtlAddAccessAllowedAce +RtlAddAccessAllowedAceEx +RtlAddAce +RtlAddAtomToAtomTable +RtlAddRange +RtlAllocateHeap +RtlAnsiCharToUnicodeChar +RtlAnsiStringToUnicodeSize +RtlAnsiStringToUnicodeString +RtlAppendAsciizToString +RtlAppendStringToString +RtlAppendUnicodeStringToString +RtlAppendUnicodeToString +RtlAreAllAccessesGranted +RtlAreAnyAccessesGranted +RtlAreBitsClear +RtlAreBitsSet +RtlAssert +RtlCaptureContext +RtlCaptureStackBackTrace +RtlCharToInteger +RtlCheckRegistryKey +RtlClearAllBits +RtlClearBit +RtlClearBits +RtlCompareMemory +RtlCompareMemoryUlong +RtlCompareString +RtlCompareUnicodeString +RtlCompressBuffer +RtlCompressChunks +RtlConvertSidToUnicodeString +RtlCopyLuid +RtlCopyMemory +RtlCopyMemoryNonTemporal +RtlCopyRangeList +RtlCopySid +RtlCopyString +RtlCopyUnicodeString +RtlCreateAcl +RtlCreateAtomTable +RtlCreateHeap +RtlCreateRegistryKey +RtlCreateSecurityDescriptor +RtlCreateSystemVolumeInformationFolder +RtlCreateUnicodeString +RtlCustomCPToUnicodeN +RtlDecompressBuffer +RtlDecompressChunks +RtlDecompressFragment +RtlDelete +RtlDeleteAce +RtlDeleteAtomFromAtomTable +RtlDeleteElementGenericTable +RtlDeleteElementGenericTableAvl +RtlDeleteNoSplay +RtlDeleteOwnersRanges +RtlDeleteRange +RtlDeleteRegistryValue +RtlDescribeChunk +RtlDestroyAtomTable +RtlDestroyHeap +RtlDowncaseUnicodeString +RtlEmptyAtomTable +RtlEnumerateGenericTable +RtlEnumerateGenericTableAvl +RtlEnumerateGenericTableLikeADirectory +RtlEnumerateGenericTableWithoutSplaying +RtlEnumerateGenericTableWithoutSplayingAvl +RtlEqualLuid +RtlEqualSid +RtlEqualString +RtlEqualUnicodeString +RtlFillMemory +RtlFindClearBits +RtlFindClearBitsAndSet +RtlFindClearRuns +RtlFindFirstRunClear +RtlFindLastBackwardRunClear +RtlFindLeastSignificantBit +RtlFindLongestRunClear +RtlFindMessage +RtlFindMostSignificantBit +RtlFindNextForwardRunClear +RtlFindRange +RtlFindSetBits +RtlFindSetBitsAndClear +RtlFindUnicodePrefix +RtlFormatCurrentUserKeyPath +RtlFreeAnsiString +RtlFreeHeap +RtlFreeOemString +RtlFreeRangeList +RtlFreeUnicodeString +RtlGUIDFromString +RtlGenerate8dot3Name +RtlGetAce +RtlGetCallersAddress +RtlGetCompressionWorkSpaceSize +RtlGetDaclSecurityDescriptor +RtlGetDefaultCodePage +RtlGetElementGenericTable +RtlGetElementGenericTableAvl +RtlGetFirstRange +RtlGetGroupSecurityDescriptor +RtlGetNextRange +RtlGetNtGlobalFlags +RtlGetOwnerSecurityDescriptor +RtlGetSaclSecurityDescriptor +RtlGetSetBootStatusData +RtlGetVersion +RtlHashUnicodeString +RtlImageDirectoryEntryToData +RtlImageNtHeader +RtlInitAnsiString +RtlInitAnsiStringEx +RtlInitCodePageTable +RtlInitString +RtlInitUnicodeString +RtlInitUnicodeStringEx +RtlInitializeBitMap +RtlInitializeGenericTable +RtlInitializeGenericTableAvl +RtlInitializeRangeList +RtlInitializeSid +RtlInitializeUnicodePrefix +RtlInsertElementGenericTable +RtlInsertElementGenericTableAvl +RtlInsertElementGenericTableFull +RtlInsertElementGenericTableFullAvl +RtlInsertUnicodePrefix +RtlInt64ToUnicodeString +RtlIntegerToChar +RtlIntegerToUnicode +RtlIntegerToUnicodeString +RtlInvertRangeList +RtlIpv4AddressToStringA +RtlIpv4AddressToStringExA +RtlIpv4AddressToStringExW +RtlIpv4AddressToStringW +RtlIpv4StringToAddressA +RtlIpv4StringToAddressExA +RtlIpv4StringToAddressExW +RtlIpv4StringToAddressW +RtlIpv6AddressToStringA +RtlIpv6AddressToStringExA +RtlIpv6AddressToStringExW +RtlIpv6AddressToStringW +RtlIpv6StringToAddressA +RtlIpv6StringToAddressExA +RtlIpv6StringToAddressExW +RtlIpv6StringToAddressW +RtlIsGenericTableEmpty +RtlIsGenericTableEmptyAvl +RtlIsNameLegalDOS8Dot3 +RtlIsRangeAvailable +RtlIsValidOemCharacter +RtlLengthRequiredSid +RtlLengthSecurityDescriptor +RtlLengthSid +RtlLockBootStatusData +RtlLookupAtomInAtomTable +RtlLookupElementGenericTable +RtlLookupElementGenericTableAvl +RtlLookupElementGenericTableFull +RtlLookupElementGenericTableFullAvl +RtlLookupFunctionEntry +RtlMapGenericMask +RtlMapSecurityErrorToNtStatus +RtlMergeRangeLists +RtlMoveMemory +RtlMultiByteToUnicodeN +RtlMultiByteToUnicodeSize +RtlNextUnicodePrefix +RtlNtStatusToDosError +RtlNtStatusToDosErrorNoTeb +RtlNumberGenericTableElements +RtlNumberGenericTableElementsAvl +RtlNumberOfClearBits +RtlNumberOfSetBits +RtlOemStringToCountedUnicodeString +RtlOemStringToUnicodeSize +RtlOemStringToUnicodeString +RtlOemToUnicodeN +RtlPcToFileHeader +RtlPinAtomInAtomTable +RtlPrefetchMemoryNonTemporal +RtlPrefixString +RtlPrefixUnicodeString +RtlQueryAtomInAtomTable +RtlQueryRegistryValues +RtlQueryTimeZoneInformation +RtlRaiseException +RtlRandom +RtlRandomEx +RtlRealPredecessor +RtlRealSuccessor +RtlRemoveUnicodePrefix +RtlReserveChunk +RtlRestoreContext +RtlSecondsSince1970ToTime +RtlSecondsSince1980ToTime +RtlSelfRelativeToAbsoluteSD +RtlSelfRelativeToAbsoluteSD2 +RtlSetAllBits +RtlSetBit +RtlSetBits +RtlSetDaclSecurityDescriptor +RtlSetGroupSecurityDescriptor +RtlSetOwnerSecurityDescriptor +RtlSetSaclSecurityDescriptor +RtlSetTimeZoneInformation +RtlSizeHeap +RtlSplay +RtlStringFromGUID +RtlSubAuthorityCountSid +RtlSubAuthoritySid +RtlSubtreePredecessor +RtlSubtreeSuccessor +RtlTestBit +RtlTimeFieldsToTime +RtlTimeToElapsedTimeFields +RtlTimeToSecondsSince1970 +RtlTimeToSecondsSince1980 +RtlTimeToTimeFields +RtlTraceDatabaseAdd +RtlTraceDatabaseCreate +RtlTraceDatabaseDestroy +RtlTraceDatabaseEnumerate +RtlTraceDatabaseFind +RtlTraceDatabaseLock +RtlTraceDatabaseUnlock +RtlTraceDatabaseValidate +RtlUnicodeStringToAnsiSize +RtlUnicodeStringToAnsiString +RtlUnicodeStringToCountedOemString +RtlUnicodeStringToInteger +RtlUnicodeStringToOemSize +RtlUnicodeStringToOemString +RtlUnicodeToCustomCPN +RtlUnicodeToMultiByteN +RtlUnicodeToMultiByteSize +RtlUnicodeToOemN +RtlUnlockBootStatusData +RtlUnwind +RtlUnwindEx +RtlUpcaseUnicodeChar +RtlUpcaseUnicodeString +RtlUpcaseUnicodeStringToAnsiString +RtlUpcaseUnicodeStringToCountedOemString +RtlUpcaseUnicodeStringToOemString +RtlUpcaseUnicodeToCustomCPN +RtlUpcaseUnicodeToMultiByteN +RtlUpcaseUnicodeToOemN +RtlUpperChar +RtlUpperString +RtlValidRelativeSecurityDescriptor +RtlValidSecurityDescriptor +RtlValidSid +RtlVerifyVersionInfo +RtlVirtualUnwind +RtlVolumeDeviceToDosName +RtlWalkFrameChain +RtlWriteRegistryValue +RtlZeroHeap +RtlZeroMemory +RtlxAnsiStringToUnicodeSize +RtlxOemStringToUnicodeSize +RtlxUnicodeStringToAnsiSize +RtlxUnicodeStringToOemSize +SeAccessCheck +SeAppendPrivileges +SeAssignSecurity +SeAssignSecurityEx +SeAuditHardLinkCreation +SeAuditingFileEvents +SeAuditingFileEventsWithContext +SeAuditingFileOrGlobalEvents +SeAuditingHardLinkEvents +SeAuditingHardLinkEventsWithContext +SeCaptureSecurityDescriptor +SeCaptureSubjectContext +SeCloseObjectAuditAlarm +SeCreateAccessState +SeCreateClientSecurity +SeCreateClientSecurityFromSubjectContext +SeDeassignSecurity +SeDeleteAccessState +SeDeleteObjectAuditAlarm +SeExports +SeFilterToken +SeFreePrivileges +SeImpersonateClient +SeImpersonateClientEx +SeLockSubjectContext +SeMarkLogonSessionForTerminationNotification +SeOpenObjectAuditAlarm +SeOpenObjectForDeleteAuditAlarm +SePrivilegeCheck +SePrivilegeObjectAuditAlarm +SePublicDefaultDacl +SeQueryAuthenticationIdToken +SeQueryInformationToken +SeQuerySecurityDescriptorInfo +SeQuerySessionIdToken +SeRegisterLogonSessionTerminatedRoutine +SeReleaseSecurityDescriptor +SeReleaseSubjectContext +SeReportSecurityEvent +SeSetAccessStateGenericMapping +SeSetAuditParameter +SeSetSecurityDescriptorInfo +SeSetSecurityDescriptorInfoEx +SeSinglePrivilegeCheck +SeSystemDefaultDacl +SeTokenImpersonationLevel +SeTokenIsAdmin +SeTokenIsRestricted +SeTokenObjectType +SeTokenType +SeUnlockSubjectContext +SeUnregisterLogonSessionTerminatedRoutine +SeValidSecurityDescriptor +VerSetConditionMask +VfFailDeviceNode +VfFailDriver +VfFailSystemBIOS +VfIsVerificationEnabled +WmiFlushTrace +WmiGetClock +WmiQueryTrace +WmiQueryTraceInformation +WmiStartTrace +WmiStopTrace +WmiTraceFastEvent +WmiTraceMessage +WmiTraceMessageVa +WmiUpdateTrace +XIPDispatch +ZwAccessCheckAndAuditAlarm +ZwAddBootEntry +ZwAddDriverEntry +ZwAdjustPrivilegesToken +ZwAlertThread +ZwAllocateVirtualMemory +ZwAssignProcessToJobObject +ZwCancelIoFile +ZwCancelTimer +ZwClearEvent +ZwClose +ZwCloseObjectAuditAlarm +ZwConnectPort +ZwCreateDirectoryObject +ZwCreateEvent +ZwCreateFile +ZwCreateJobObject +ZwCreateKey +ZwCreateSection +ZwCreateSymbolicLinkObject +ZwCreateTimer +ZwDeleteBootEntry +ZwDeleteDriverEntry +ZwDeleteFile +ZwDeleteKey +ZwDeleteValueKey +ZwDeviceIoControlFile +ZwDisplayString +ZwDuplicateObject +ZwDuplicateToken +ZwEnumerateBootEntries +ZwEnumerateDriverEntries +ZwEnumerateKey +ZwEnumerateValueKey +ZwFlushInstructionCache +ZwFlushKey +ZwFlushVirtualMemory +ZwFreeVirtualMemory +ZwFsControlFile +ZwInitiatePowerAction +ZwIsProcessInJob +ZwLoadDriver +ZwLoadKey +ZwMakeTemporaryObject +ZwMapViewOfSection +ZwModifyBootEntry +ZwModifyDriverEntry +ZwNotifyChangeKey +ZwOpenDirectoryObject +ZwOpenEvent +ZwOpenFile +ZwOpenJobObject +ZwOpenKey +ZwOpenProcess +ZwOpenProcessToken +ZwOpenProcessTokenEx +ZwOpenSection +ZwOpenSymbolicLinkObject +ZwOpenThread +ZwOpenThreadToken +ZwOpenThreadTokenEx +ZwOpenTimer +ZwPowerInformation +ZwPulseEvent +ZwQueryBootEntryOrder +ZwQueryBootOptions +ZwQueryDefaultLocale +ZwQueryDefaultUILanguage +ZwQueryDirectoryFile +ZwQueryDirectoryObject +ZwQueryDriverEntryOrder +ZwQueryEaFile +ZwQueryFullAttributesFile +ZwQueryInformationFile +ZwQueryInformationJobObject +ZwQueryInformationProcess +ZwQueryInformationThread +ZwQueryInformationToken +ZwQueryInstallUILanguage +ZwQueryKey +ZwQueryObject +ZwQuerySection +ZwQuerySecurityObject +ZwQuerySymbolicLinkObject +ZwQuerySystemInformation +ZwQueryValueKey +ZwQueryVolumeInformationFile +ZwReadFile +ZwReplaceKey +ZwRequestWaitReplyPort +ZwResetEvent +ZwRestoreKey +ZwSaveKey +ZwSaveKeyEx +ZwSecureConnectPort +ZwSetBootEntryOrder +ZwSetBootOptions +ZwSetDefaultLocale +ZwSetDefaultUILanguage +ZwSetDriverEntryOrder +ZwSetEaFile +ZwSetEvent +ZwSetInformationFile +ZwSetInformationJobObject +ZwSetInformationObject +ZwSetInformationProcess +ZwSetInformationThread +ZwSetSecurityObject +ZwSetSystemInformation +ZwSetSystemTime +ZwSetTimer +ZwSetValueKey +ZwSetVolumeInformationFile +ZwTerminateJobObject +ZwTerminateProcess +ZwTranslateFilePath +ZwUnloadDriver +ZwUnloadKey +ZwUnmapViewOfSection +ZwWaitForMultipleObjects +ZwWaitForSingleObject +ZwWriteFile +ZwYieldExecution +__C_specific_handler +__chkstk +__misaligned_access +_itoa +_itow +_local_unwind +_purecall +_setjmp +_setjmpex +_snprintf +_snwprintf +_stricmp +_strlwr +_strnicmp +_strnset +_strrev +_strset +_strupr +_vsnprintf +_vsnwprintf +_wcsicmp +_wcslwr +_wcsnicmp +_wcsnset +_wcsrev +_wcsupr +atoi +atol +isdigit +islower +isprint +isspace +isupper +isxdigit +longjmp +mbstowcs +mbtowc +memchr +memcmp +memcpy +memmove +memset +qsort +rand +sprintf +srand +strcat +strchr +strcmp +strcpy +strlen +strncat +strncmp +strncpy +strrchr +strspn +strstr +swprintf +tolower +toupper +towlower +towupper +vDbgPrintEx +vDbgPrintExWithPrefix +vsprintf +wcscat +wcschr +wcscmp +wcscpy +wcscspn +wcslen +wcsncat +wcsncmp +wcsncpy +wcsrchr +wcsspn +wcsstr +wcstombs +wctomb +KiSystemStartup From 222bbb2c4a66396ad6811450f2ffb16c8c78c02e Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 24 Jul 2008 14:32:35 +0000 Subject: [PATCH 011/388] libwine: -use InterlockedExchangeAdd instead of interlocked_xchg_add libxml2: -WINSOCKETAPI already defined in config.h no need to redefine mingw_base: -rework _fmode refernces to allow ros64 programs to work on win64. -temporarily hack _wenviron to allow programs to work on win64. -aling stack to 16bytes oskit: -remove inline asm per suggestion by arty svn path=/branches/ros-amd64-bringup/; revision=34745 --- reactos/lib/3rdparty/3rdparty.rbuild | 6 ---- reactos/lib/3rdparty/bzip2/bzip2.rbuild | 1 - reactos/lib/3rdparty/libwine/debug.c | 2 +- reactos/lib/3rdparty/libxml2/libxml2.rbuild | 1 - reactos/lib/3rdparty/mingw/crt1.c | 15 +++----- reactos/lib/3rdparty/mingw/wcrt1.c | 17 ++++----- reactos/lib/drivers/directory.rbuild | 2 -- .../include/freebsd/src/sys/machine/endian.h | 36 ------------------- 8 files changed, 12 insertions(+), 68 deletions(-) diff --git a/reactos/lib/3rdparty/3rdparty.rbuild b/reactos/lib/3rdparty/3rdparty.rbuild index d5a8055c731..75bb1d1f154 100644 --- a/reactos/lib/3rdparty/3rdparty.rbuild +++ b/reactos/lib/3rdparty/3rdparty.rbuild @@ -4,30 +4,24 @@ - - - diff --git a/reactos/lib/3rdparty/bzip2/bzip2.rbuild b/reactos/lib/3rdparty/bzip2/bzip2.rbuild index 3437902a950..e5e172cd2a6 100644 --- a/reactos/lib/3rdparty/bzip2/bzip2.rbuild +++ b/reactos/lib/3rdparty/bzip2/bzip2.rbuild @@ -5,7 +5,6 @@ ntoskrnl - hal bzlib.c randtable.c crctable.c diff --git a/reactos/lib/3rdparty/libwine/debug.c b/reactos/lib/3rdparty/libwine/debug.c index 4dff5eae48c..b8e8c9ecb09 100644 --- a/reactos/lib/3rdparty/libwine/debug.c +++ b/reactos/lib/3rdparty/libwine/debug.c @@ -256,7 +256,7 @@ static char *get_temp_buffer( size_t size ) char *ret; int idx; - idx = interlocked_xchg_add( &pos, 1 ) % (sizeof(list)/sizeof(list[0])); + idx = InterlockedExchangeAdd( &pos, 1 ) % (sizeof(list)/sizeof(list[0])); if ((ret = realloc( list[idx], size ))) list[idx] = ret; return ret; } diff --git a/reactos/lib/3rdparty/libxml2/libxml2.rbuild b/reactos/lib/3rdparty/libxml2/libxml2.rbuild index 60ba9d42d09..327c3e6acc3 100644 --- a/reactos/lib/3rdparty/libxml2/libxml2.rbuild +++ b/reactos/lib/3rdparty/libxml2/libxml2.rbuild @@ -7,7 +7,6 @@ - include . diff --git a/reactos/lib/3rdparty/mingw/crt1.c b/reactos/lib/3rdparty/mingw/crt1.c index a4fb015d1e4..dec13337fb6 100644 --- a/reactos/lib/3rdparty/mingw/crt1.c +++ b/reactos/lib/3rdparty/mingw/crt1.c @@ -47,14 +47,6 @@ __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ -/* Global _fmode for this .exe, not the one in msvcrt.dll, - The default is set in txtmode.o in libmingw32.a */ -/* Override the dllimport'd declarations in stdlib.h */ -#undef _fmode -extern int _fmode; -#ifdef __MSVCRT__ -extern int* __p__fmode(void); /* To access the dll _fmode */ -#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -68,7 +60,7 @@ _mingw32_init_fmode (void) /* Don't set the std file mode if the user hasn't set any value for it. */ if (_CRT_fmode) { - _fmode = _CRT_fmode; + *_imp___fmode = _CRT_fmode; /* * This overrides the default file mode settings for stdin, @@ -93,7 +85,7 @@ _mingw32_init_fmode (void) /* Now sync the dll _fmode to the one for this .exe. */ #ifdef __MSVCRT__ - *__p__fmode() = _fmode; + *_imp___fmode = _fmode; #else *_imp___fmode_dll = _fmode; #endif @@ -224,6 +216,9 @@ __mingw_CRTStartup (void) /* Align the stack to 16 bytes for the sake of SSE ops in main or in functions inlined into main. */ asm __volatile__ ("andl $-16, %%esp" : : : "%esp"); +#elif defined(__x86_64__) + /* Align the stack to 16 bytes */ + asm __volatile__ ("andq $-16, %%rsp" : : : "%rsp"); #elif defined(__mips__) /* Align the stack to 16 bytes */ asm __volatile__ ("andi %sp,%sp,-16" : : : "%sp"); diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c index df1cec8e3b2..28e933ba76b 100644 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ b/reactos/lib/3rdparty/mingw/wcrt1.c @@ -45,14 +45,6 @@ extern int wmain (int, wchar_t **, wchar_t **); __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ -/* Global _fmode for this .exe, not the one in msvcrt.dll, - The default is set in txtmode.o in libmingw32.a */ -/* Override the dllimport'd declarations in stdlib.h */ -#undef _fmode -extern int _fmode; -#ifdef __MSVCRT__ -extern int* __p__fmode(void); /* To access the dll _fmode */ -#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -66,7 +58,7 @@ _mingw32_init_fmode (void) /* Don't set the std file mode if the user hasn't set any value for it. */ if (_CRT_fmode) { - _fmode = _CRT_fmode; + *_imp___fmode = _CRT_fmode; /* * This overrides the default file mode settings for stdin, @@ -91,7 +83,7 @@ _mingw32_init_fmode (void) /* Now sync the dll _fmode to the one for this .exe. */ #ifdef __MSVCRT__ - *__p__fmode() = _fmode; + *_imp___fmode = _fmode; #else *_imp___fmode_dll = _fmode; #endif @@ -222,6 +214,9 @@ __mingw_wCRTStartup (void) /* Align the stack to 16 bytes for the sake of SSE ops in main or in functions inlined into main. */ asm __volatile__ ("andl $-16, %%esp" : : : "%esp"); +#elif defined(__x86_64__) + /* Align the stack to 16 bytes */ + asm __volatile__ ("andq $-16, %%rsp" : : : "%rsp"); #elif defined(__mips__) /* Align the stack to 16 bytes */ asm __volatile__ ("andi %sp,%sp,-16" : : : "%sp"); @@ -238,7 +233,7 @@ __mingw_wCRTStartup (void) * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ - nRet = wmain (_argc, _wargv, _wenviron); + nRet = wmain (_argc, _wargv, NULL); /* * Perform exit processing for the C library. This means diff --git a/reactos/lib/drivers/directory.rbuild b/reactos/lib/drivers/directory.rbuild index c6a2b469c66..de283ec2cf0 100644 --- a/reactos/lib/drivers/directory.rbuild +++ b/reactos/lib/drivers/directory.rbuild @@ -4,14 +4,12 @@ - diff --git a/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/machine/endian.h b/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/machine/endian.h index bf687d22af2..1912a479109 100644 --- a/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/machine/endian.h +++ b/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/machine/endian.h @@ -56,7 +56,6 @@ #include #endif -#ifdef _MSC_VER static inline unsigned long __byte_swap_long ( unsigned long i ) { char dst[4]; @@ -76,41 +75,6 @@ static inline unsigned short __byte_swap_word ( unsigned short i ) dst[1] = src[0]; return *(unsigned short*)&dst[0]; } -#else/*_MSC_VER*/ -#define __word_swap_long(x) \ -({ register u_long __X = (x); \ - __asm ("rorl $16, %1" \ - : "=r" (__X) \ - : "0" (__X)); \ - __X; }) -#if __GNUC__ >= 2 -#define __byte_swap_long(x) \ -__extension__ ({ register u_long __X = (x); \ - __asm ("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1" \ - : "=q" (__X) \ - : "0" (__X)); \ - __X; }) -#define __byte_swap_word(x) \ -__extension__ ({ register u_short __X = (x); \ - __asm ("xchgb %h1, %b1" \ - : "=q" (__X) \ - : "0" (__X)); \ - __X; }) -#else /* __GNUC__ >= 2 */ -#define __byte_swap_long(x) \ -({ register u_long __X = (x); \ - __asm ("rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1" \ - : "=r" (__X) \ - : "0" (__X)); \ - __X; }) -#define __byte_swap_word(x) \ -({ register u_short __X = (x); \ - __asm ("rorw $8, %w1" \ - : "=r" (__X) \ - : "0" (__X)); \ - __X; }) -#endif /* __GNUC__ >= 2 */ -#endif /* _MSC_VER */ /* * Macros for network/external number representation conversion. From 3a0c3db1e0856e48118bd1625fd39cb88c34e2fe Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 16:44:01 +0000 Subject: [PATCH 012/388] convert external debug output from message boxes to real debug output on serial svn path=/branches/ros-amd64-bringup/; revision=34747 --- .../boot/freeldr/freeldr/reactos/reactos.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c index 2e56a7ed1d1..ac5b9a10fd0 100644 --- a/reactos/boot/freeldr/freeldr/reactos/reactos.c +++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c @@ -874,6 +874,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) } #undef DbgPrint +#if 0 ULONG DbgPrint(const char *Format, ...) { @@ -903,5 +904,39 @@ DbgPrint(const char *Format, ...) va_end(ap); return 0; } +#else +VOID DebugPrintChar(UCHAR Character); +ULONG +DbgPrint(const char *Format, ...) +{ + va_list ap; + CHAR Buffer[512]; + ULONG Length; + char *ptr = Buffer; + + va_start(ap, Format); + + /* Construct a string */ + Length = _vsnprintf(Buffer, 512, Format, ap); + + /* Check if we went past the buffer */ + if (Length == -1) + { + /* Terminate it if we went over-board */ + Buffer[sizeof(Buffer) - 1] = '\n'; + + /* Put maximum */ + Length = sizeof(Buffer); + } + + while (*ptr) + { + DebugPrintChar(*ptr++); + } + + va_end(ap); + return 0; +} +#endif /* EOF */ From bacef6a882e6056e56aab23eb2c35dd40dce2cee Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 19:09:03 +0000 Subject: [PATCH 013/388] - remove ip and oskittcp from build - add fastfat to build - add PLATFORM property "PC" also to i386 rbuild file to allow sharing of related code between i386 and amd64 - disable a few debug channels in freeldr - winnt.h: add IMAGE_REL_BASED_MIPS_JMPADDR16, IMAGE_REL_BASED_IA64_IMM64 and IMAGE_REL_BASED_DIR64, the latter used for PE64 relocation - rtl: implement case IMAGE_REL_BASED_DIR64 in LdrProcessRelocationBlockLongLong - rtl: add SWAPQ macro for _PPC and fix macros SWAP macros for other architectures (remember: always put a macro argument in brackets) Status: setupldr now loads a few files and finally wants to load fastfat.sys. But it fails when it comes to imports from ntoskrnl, no wonder we don't have an ntoskrnl yet... svn path=/branches/ros-amd64-bringup/; revision=34748 --- reactos/ReactOS-amd64.rbuild | 9 +++++++-- reactos/ReactOS-i386.rbuild | 1 + reactos/boot/freeldr/freeldr/debug.c | 9 +++++---- reactos/include/psdk/winnt.h | 3 +++ reactos/lib/drivers/directory.rbuild | 2 ++ reactos/lib/rtl/image.c | 6 ++++++ reactos/lib/rtl/rtlp.h | 6 ++++-- 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 70c865c9081..58d98f28158 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -90,7 +90,7 @@ - + diff --git a/reactos/ReactOS-i386.rbuild b/reactos/ReactOS-i386.rbuild index e3d45283b02..ab188d6887c 100644 --- a/reactos/ReactOS-i386.rbuild +++ b/reactos/ReactOS-i386.rbuild @@ -14,6 +14,7 @@ + -Os diff --git a/reactos/boot/freeldr/freeldr/debug.c b/reactos/boot/freeldr/freeldr/debug.c index 84b01079559..3f84b507000 100644 --- a/reactos/boot/freeldr/freeldr/debug.c +++ b/reactos/boot/freeldr/freeldr/debug.c @@ -23,10 +23,10 @@ #ifdef DBG -#define DEBUG_ALL +//#define DEBUG_ALL //#define DEBUG_INIFILE //#define DEBUG_REACTOS -//#define DEBUG_CUSTOM +#define DEBUG_CUSTOM //#define DEBUG_NONE #if defined (DEBUG_ALL) @@ -38,8 +38,9 @@ ULONG DebugPrintMask = DPRINT_INIFILE; #elif defined (DEBUG_REACTOS) ULONG DebugPrintMask = DPRINT_REACTOS | DPRINT_REGISTRY; #elif defined (DEBUG_CUSTOM) -ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | - DPRINT_REACTOS | DPRINT_WINDOWS | DPRINT_HWDETECT; +ULONG DebugPrintMask = DPRINT_WARNING | + DPRINT_UI | DPRINT_CACHE | DPRINT_REACTOS | + DPRINT_LINUX; #else //#elif defined (DEBUG_NONE) ULONG DebugPrintMask = 0; #endif diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 63fd6e92ae9..968da0d9cf3 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -1539,6 +1539,9 @@ typedef enum #define IMAGE_REL_BASED_HIGHLOW 3 #define IMAGE_REL_BASED_HIGHADJ 4 #define IMAGE_REL_BASED_MIPS_JMPADDR 5 +#define IMAGE_REL_BASED_MIPS_JMPADDR16 9 +#define IMAGE_REL_BASED_IA64_IMM64 9 +#define IMAGE_REL_BASED_DIR64 10 #define IMAGE_ARCHIVE_START_SIZE 8 #define IMAGE_ARCHIVE_START "!\n" #define IMAGE_ARCHIVE_END "`\n" diff --git a/reactos/lib/drivers/directory.rbuild b/reactos/lib/drivers/directory.rbuild index de283ec2cf0..c6a2b469c66 100644 --- a/reactos/lib/drivers/directory.rbuild +++ b/reactos/lib/drivers/directory.rbuild @@ -4,12 +4,14 @@ + diff --git a/reactos/lib/rtl/image.c b/reactos/lib/rtl/image.c index 5f79b7e3aa0..030028c5121 100644 --- a/reactos/lib/rtl/image.c +++ b/reactos/lib/rtl/image.c @@ -175,6 +175,7 @@ LdrProcessRelocationBlockLongLong( USHORT i; PUSHORT ShortPtr; PULONG LongPtr; + PULONGLONG LongLongPtr; for (i = 0; i < Count; i++) { @@ -212,6 +213,11 @@ LdrProcessRelocationBlockLongLong( *LongPtr = SWAPD(*LongPtr) + (ULONG)Delta; break; + case IMAGE_REL_BASED_DIR64: + LongLongPtr = (PUINT64)RVA(Address, Offset); + *LongLongPtr = SWAPQ(*LongLongPtr) + Delta; + break; + case IMAGE_REL_BASED_HIGHADJ: case IMAGE_REL_BASED_MIPS_JMPADDR: default: diff --git a/reactos/lib/rtl/rtlp.h b/reactos/lib/rtl/rtlp.h index 845f625cbee..8ca48e890c3 100644 --- a/reactos/lib/rtl/rtlp.h +++ b/reactos/lib/rtl/rtlp.h @@ -19,9 +19,11 @@ extern VOID FASTCALL CHECK_PAGED_CODE_RTL(char *file, int line); #ifdef _PPC_ #define SWAPD(x) ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)>>8)&0xff00)|(((x)>>24)&0xff)) #define SWAPW(x) ((((x)&0xff)<<8)|(((x)>>8)&0xff)) +#define SWAPQ(x) ((SWAPD((x)&0xffffffff) << 32) | (SWAPD((x)>>32))) #else -#define SWAPD(x) x -#define SWAPW(x) x +#define SWAPD(x) (x) +#define SWAPW(x) (x) +#define SWAPQ(x) (x) #endif VOID From 9661a46df54e2629236d24d513cb10e15c89bddc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 19:22:16 +0000 Subject: [PATCH 014/388] add _InterlockedExchange64 to intin_x86.h svn path=/branches/ros-amd64-bringup/; revision=34749 --- reactos/include/psdk/intrin_x86.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index e1d41c83fa6..f83b9a343e1 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -121,6 +121,15 @@ static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volat return __sync_lock_test_and_set(Target, Value); } +#if defined(_M_AMD64) +static __inline__ __attribute__((always_inline)) long long _InterlockedExchange64(volatile long long * const Target, const long long Value) +{ + /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ + __sync_synchronize(); + return __sync_lock_test_and_set(Target, Value); +} +#endif + static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) { /* NOTE: ditto */ From acd486b2e799f85b59cfecbc062ca5937eed886b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 19:36:04 +0000 Subject: [PATCH 015/388] add ExpChangePushlock macro for _WIN64 svn path=/branches/ros-amd64-bringup/; revision=34750 --- reactos/ntoskrnl/include/internal/ex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index 65df7d70e30..6f173ded0af 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -465,6 +465,7 @@ ExDoCallBack(IN OUT PEX_CALLBACK Callback, #ifdef _WIN64 #define ExpChangeRundown(x, y, z) InterlockedCompareExchange64((PLONGLONG)x, y, z) +#define ExpChangePushlock(lock, new, old) InterlockedCompareExchangePointer((PVOID*)lock, (PVOID)new, (PVOID)old) #define ExpSetRundown(x, y) InterlockedExchange64((PLONGLONG)x, y) #else #define ExpChangeRundown(x, y, z) InterlockedCompareExchange((PLONG)x, PtrToLong(y), PtrToLong(z)) From dc58f19c9ae851c964885a1768f0aa01ecd83ff9 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 20:02:31 +0000 Subject: [PATCH 016/388] add KeGetCurrentThread prototype to winddk svn path=/branches/ros-amd64-bringup/; revision=34752 --- reactos/include/ddk/winddk.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 5e59690f878..0cf6228cb02 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5500,6 +5500,12 @@ typedef struct _KFLOATING_SAVE { ULONG Dummy; } KFLOATING_SAVE, *PKFLOATING_SAVE; +NTKERNELAPI +PRKTHREAD +NTAPI +KeGetCurrentThread( + VOID); + #elif defined(__PowerPC__) typedef ULONG PFN_NUMBER, *PPFN_NUMBER; From efc2458c66a4088c992b0d686d809371222b25a3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 20:07:30 +0000 Subject: [PATCH 017/388] - add ntoskrnl to the build again, as we will need it now. - add ke.h, mm.h and intrin_i.h for amd64 currently copied from i386 - remove Interlocked funtions from private ntoskrnl header that don't belong there, this will probably break x86 build, but who cares ;-) At least the header compiles now... svn path=/branches/ros-amd64-bringup/; revision=34753 --- .../include/internal/amd64/intrin_i.h | 415 ++++++++++++++++++ reactos/ntoskrnl/include/internal/amd64/ke.h | 141 ++++++ reactos/ntoskrnl/include/internal/amd64/mm.h | 31 ++ .../ntoskrnl/include/internal/arch/intrin_i.h | 2 + reactos/ntoskrnl/include/internal/arch/ke.h | 2 + reactos/ntoskrnl/include/internal/arch/mm.h | 2 + reactos/ntoskrnl/include/internal/ntoskrnl.h | 50 +-- reactos/ntoskrnl/ntoskrnl.rbuild | 3 +- 8 files changed, 599 insertions(+), 47 deletions(-) create mode 100644 reactos/ntoskrnl/include/internal/amd64/intrin_i.h create mode 100644 reactos/ntoskrnl/include/internal/amd64/ke.h create mode 100644 reactos/ntoskrnl/include/internal/amd64/mm.h diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h new file mode 100644 index 00000000000..7da484c15f9 --- /dev/null +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -0,0 +1,415 @@ +#ifndef _INTRIN_INTERNAL_ +#define _INTRIN_INTERNAL_ + +#ifdef CONFIG_SMP +#define LOCK "lock ; " +#else +#define LOCK "" +#endif + +#if defined(__GNUC__) + +#define Ke386SetInterruptDescriptorTable(X) \ + __asm__("lidt %0\n\t" \ + : /* no outputs */ \ + : "m" (X)); + +#define Ke386GetInterruptDescriptorTable(X) \ + __asm__("sidt %0\n\t" \ + : /* no outputs */ \ + : "m" (X)); + +#define Ke386SetGlobalDescriptorTable(X) \ + __asm__("lgdt %0\n\t" \ + : /* no outputs */ \ + : "m" (X)); + +#define Ke386GetGlobalDescriptorTable(X) \ + __asm__("sgdt %0\n\t" \ + : /* no outputs */ \ + : "m" (X)); + +#define Ke386GetLocalDescriptorTable(X) \ + __asm__("sldt %0\n\t" \ + : /* no outputs */ \ + : "m" (X)); + +#define Ke386SetLocalDescriptorTable(X) \ + __asm__("lldt %w0\n\t" \ + : /* no outputs */ \ + : "q" (X)); + +#define Ke386SetTr(X) __asm__ __volatile__("ltr %%ax" : :"a" (X)); + +#define Ke386GetTr(X) \ + __asm__("str %0\n\t" \ + : /* no outputs */ \ + : "m" (X)); + +#define Ke386SaveFlags(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */) +#define Ke386RestoreFlags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") + +#define _Ke386GetSeg(N) ({ \ + unsigned int __d; \ + __asm__("movl %%" #N ",%0\n\t" :"=r" (__d)); \ + __d; \ + }) + +#define _Ke386SetSeg(N,X) __asm__ __volatile__("movl %0,%%" #N : :"r" (X)); + +#define _Ke386GetDr(N) ({ \ + unsigned int __d; \ + __asm__("movl %%dr" #N ",%0\n\t" :"=r" (__d)); \ + __d; \ + }) + +#define _Ke386SetDr(N,X) __asm__ __volatile__("movl %0,%%dr" #N : :"r" (X)); + + +static inline void Ki386Cpuid(ULONG Op, PULONG Eax, PULONG Ebx, PULONG Ecx, PULONG Edx) +{ + __asm__("cpuid" + : "=a" (*Eax), "=b" (*Ebx), "=c" (*Ecx), "=d" (*Edx) + : "0" (Op)); +} + +#define Ke386Rdmsr(msr,val1,val2) __asm__ __volatile__("rdmsr" : "=a" (val1), "=d" (val2) : "c" (msr)) +#define Ke386Wrmsr(msr,val1,val2) __asm__ __volatile__("wrmsr" : /* no outputs */ : "c" (msr), "a" (val1), "d" (val2)) + +#define Ke386HaltProcessor() __asm__("hlt\n\t"); + +#define Ke386FnInit() __asm__("fninit\n\t"); + + +// +// CR Macros +// +#define Ke386SetCr2(X) __asm__ __volatile__("movl %0,%%cr2" : :"r" (X)); + +// +// DR Macros +// +#define Ke386GetDr0() _Ke386GetDr(0) +#define Ke386GetDr1() _Ke386GetDr(1) +#define Ke386SetDr0(X) _Ke386SetDr(0,X) +#define Ke386SetDr1(X) _Ke386SetDr(1,X) +#define Ke386GetDr2() _Ke386GetDr(2) +#define Ke386SetDr2(X) _Ke386SetDr(2,X) +#define Ke386GetDr3() _Ke386GetDr(3) +#define Ke386SetDr3(X) _Ke386SetDr(3,X) +#define Ke386GetDr4() _Ke386GetDr(4) +#define Ke386SetDr4(X) _Ke386SetDr(4,X) +#define Ke386GetDr6() _Ke386GetDr(6) +#define Ke386SetDr6(X) _Ke386SetDr(6,X) +#define Ke386GetDr7() _Ke386GetDr(7) +#define Ke386SetDr7(X) _Ke386SetDr(7,X) + +// +// Segment Macros +// +#define Ke386GetSs() _Ke386GetSeg(ss) +#define Ke386GetFs() _Ke386GetSeg(fs) +#define Ke386SetFs(X) _Ke386SetSeg(fs, X) +#define Ke386SetDs(X) _Ke386SetSeg(ds, X) +#define Ke386SetEs(X) _Ke386SetSeg(es, X) + +#elif defined(_MSC_VER) + +VOID +FORCEINLINE +Ke386Wrmsr(IN ULONG Register, + IN ULONG Var1, + IN ULONG Var2) +{ + __asm mov eax, Var1; + __asm mov edx, Var2; + __asm wrmsr; +} + +ULONGLONG +FORCEINLINE +Ke386Rdmsr(IN ULONG Register, + IN ULONG Var1, + IN ULONG Var2) +{ + __asm mov eax, Var1; + __asm mov edx, Var2; + __asm rdmsr; +} + +VOID +FORCEINLINE +Ki386Cpuid(IN ULONG Operation, + OUT PULONG Var1, + OUT PULONG Var2, + OUT PULONG Var3, + OUT PULONG Var4) +{ + __asm mov eax, Operation; + __asm cpuid; + __asm mov [Var1], eax; + __asm mov [Var2], ebx; + __asm mov [Var3], ecx; + __asm mov [Var4], edx; +} + +VOID +FORCEINLINE +Ke386FnInit(VOID) +{ + __asm fninit; +} + +VOID +FORCEINLINE +Ke386HaltProcessor(VOID) +{ + __asm hlt; +} + +VOID +FORCEINLINE +Ke386GetInterruptDescriptorTable(OUT KDESCRIPTOR Descriptor) +{ + __asm sidt Descriptor; +} + +VOID +FORCEINLINE +Ke386SetInterruptDescriptorTable(IN KDESCRIPTOR Descriptor) +{ + __asm lidt Descriptor; +} + +VOID +FORCEINLINE +Ke386GetGlobalDescriptorTable(OUT KDESCRIPTOR Descriptor) +{ + __asm sgdt Descriptor; +} + +VOID +FORCEINLINE +Ke386SetGlobalDescriptorTable(IN KDESCRIPTOR Descriptor) +{ + __asm lgdt Descriptor; +} + +VOID +FORCEINLINE +Ke386GetLocalDescriptorTable(OUT USHORT Descriptor) +{ + __asm sldt Descriptor; +} + +VOID +FORCEINLINE +Ke386SetLocalDescriptorTable(IN USHORT Descriptor) +{ + __asm lldt Descriptor; +} + +VOID +FORCEINLINE +Ke386SaveFlags(IN ULONG Flags) +{ + __asm pushf; + __asm pop Flags; +} + +VOID +FORCEINLINE +Ke386RestoreFlags(IN ULONG Flags) +{ + __asm push Flags; + __asm popf; +} + +VOID +FORCEINLINE +Ke386SetTr(IN USHORT Tr) +{ + __asm ltr Tr; +} + +USHORT +FORCEINLINE +Ke386GetTr(IN USHORT Tr) +{ + __asm str Tr; +} + +// +// CR Macros +// +VOID +FORCEINLINE +Ke386SetCr2(IN ULONG Value) +{ + __asm mov eax, Value; + __asm mov cr2, eax; +} + +// +// DR Macros +// +ULONG +FORCEINLINE +Ke386GetDr0(VOID) +{ + __asm mov eax, dr0; +} + +ULONG +FORCEINLINE +Ke386GetDr1(VOID) +{ + __asm mov eax, dr1; +} + +ULONG +FORCEINLINE +Ke386GetDr2(VOID) +{ + __asm mov eax, dr2; +} + +ULONG +FORCEINLINE +Ke386GetDr3(VOID) +{ + __asm mov eax, dr3; +} + +ULONG +FORCEINLINE +Ke386GetDr6(VOID) +{ + __asm mov eax, dr6; +} + +ULONG +FORCEINLINE +Ke386GetDr7(VOID) +{ + __asm mov eax, dr7; +} + +VOID +FORCEINLINE +Ke386SetDr0(IN ULONG Value) +{ + __asm mov eax, Value; + __asm mov dr0, eax; +} + +VOID +FORCEINLINE +Ke386SetDr1(IN ULONG Value) +{ + __asm mov eax, Value; + __asm mov dr1, eax; +} + +VOID +FORCEINLINE +Ke386SetDr2(IN ULONG Value) +{ + __asm mov eax, Value; + __asm mov dr2, eax; +} + +VOID +FORCEINLINE +Ke386SetDr3(IN ULONG Value) +{ + __asm mov eax, Value; + __asm mov dr3, eax; +} + +VOID +FORCEINLINE +Ke386SetDr6(IN ULONG Value) +{ + __asm mov eax, Value; + __asm mov dr6, eax; +} + +VOID +FORCEINLINE +Ke386SetDr7(IN ULONG Value) +{ + __asm mov eax, Value; + __asm mov dr7, eax; +} + +// +// Segment Macros +// +USHORT +FORCEINLINE +Ke386GetSs(VOID) +{ + __asm mov ax, ss; +} + +USHORT +FORCEINLINE +Ke386GetFs(VOID) +{ + __asm mov ax, fs; +} + +USHORT +FORCEINLINE +Ke386GetDs(VOID) +{ + __asm mov ax, ds; +} + +USHORT +FORCEINLINE +Ke386GetEs(VOID) +{ + __asm mov ax, es; +} + +VOID +FORCEINLINE +Ke386SetSs(IN USHORT Value) +{ + __asm mov ax, Value; + __asm mov ss, ax; +} + +VOID +FORCEINLINE +Ke386SetFs(IN USHORT Value) +{ + __asm mov ax, Value; + __asm mov fs, ax; +} + +VOID +FORCEINLINE +Ke386SetDs(IN USHORT Value) +{ + __asm mov ax, Value; + __asm mov ds, ax; +} + +VOID +FORCEINLINE +Ke386SetEs(IN USHORT Value) +{ + __asm mov ax, Value; + __asm mov es, ax; +} + +#else +#error Unknown compiler for inline assembler +#endif + +#endif + +/* EOF */ diff --git a/reactos/ntoskrnl/include/internal/amd64/ke.h b/reactos/ntoskrnl/include/internal/amd64/ke.h new file mode 100644 index 00000000000..7b6aaf012e2 --- /dev/null +++ b/reactos/ntoskrnl/include/internal/amd64/ke.h @@ -0,0 +1,141 @@ +#ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H +#define __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#define X86_EFLAGS_TF 0x00000100 /* Trap flag */ +#define X86_EFLAGS_IF 0x00000200 /* Interrupt Enable flag */ +#define X86_EFLAGS_IOPL 0x00003000 /* I/O Privilege Level bits */ +#define X86_EFLAGS_NT 0x00004000 /* Nested Task flag */ +#define X86_EFLAGS_RF 0x00010000 /* Resume flag */ +#define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */ +#define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ + +#define X86_CR0_PE 0x00000001 /* enable Protected Mode */ +#define X86_CR0_NE 0x00000020 /* enable native FPU error reporting */ +#define X86_CR0_TS 0x00000008 /* enable exception on FPU instruction for task switch */ +#define X86_CR0_EM 0x00000004 /* enable FPU emulation (disable FPU) */ +#define X86_CR0_MP 0x00000002 /* enable FPU monitoring */ +#define X86_CR0_WP 0x00010000 /* enable Write Protect (copy on write) */ +#define X86_CR0_PG 0x80000000 /* enable Paging */ + +#define X86_CR4_PAE 0x00000020 /* enable physical address extensions */ +#define X86_CR4_PGE 0x00000080 /* enable global pages */ +#define X86_CR4_OSFXSR 0x00000200 /* enable FXSAVE/FXRSTOR instructions */ +#define X86_CR4_OSXMMEXCPT 0x00000400 /* enable #XF exception */ + +#define X86_FEATURE_VME 0x00000002 /* Virtual 8086 Extensions are present */ +#define X86_FEATURE_TSC 0x00000010 /* time stamp counters are present */ +#define X86_FEATURE_PAE 0x00000040 /* physical address extension is present */ +#define X86_FEATURE_CX8 0x00000100 /* CMPXCHG8B instruction present */ +#define X86_FEATURE_SYSCALL 0x00000800 /* SYSCALL/SYSRET support present */ +#define X86_FEATURE_PGE 0x00002000 /* Page Global Enable */ +#define X86_FEATURE_MMX 0x00800000 /* MMX extension present */ +#define X86_FEATURE_FXSR 0x01000000 /* FXSAVE/FXRSTOR instructions present */ +#define X86_FEATURE_SSE 0x02000000 /* SSE extension present */ +#define X86_FEATURE_SSE2 0x04000000 /* SSE2 extension present */ +#define X86_FEATURE_HT 0x10000000 /* Hyper-Threading present */ + +#define X86_EXT_FEATURE_SSE3 0x00000001 /* SSE3 extension present */ +#define X86_EXT_FEATURE_3DNOW 0x40000000 /* 3DNOW! extension present */ + +#define FRAME_EDITED 0xFFF8 + +#ifndef __ASM__ + +//#include "intrin_i.h" + +#define KeArchFnInit() Ke386FnInit() +#define KeArchHaltProcessor() Ke386HaltProcessor() + +extern ULONG Ke386CacheAlignment; + +struct _KPCR; +VOID +KiInitializeGdt(struct _KPCR* Pcr); +VOID +Ki386ApplicationProcessorInitializeTSS(VOID); + +VOID +FASTCALL +Ki386InitializeTss( + IN PKTSS Tss, + IN PKIDTENTRY Idt, + IN PKGDTENTRY Gdt +); + +VOID +KiGdtPrepareForApplicationProcessorInit(ULONG Id); +VOID +Ki386InitializeLdt(VOID); +VOID +Ki386SetProcessorFeatures(VOID); + +VOID +NTAPI +KiSetCR0Bits(VOID); + +VOID +NTAPI +KiGetCacheInformation(VOID); + +BOOLEAN +NTAPI +KiIsNpxPresent( + VOID +); + +BOOLEAN +NTAPI +KiIsNpxErrataPresent( + VOID +); + +VOID +NTAPI +KiSetProcessorType(VOID); + +ULONG +NTAPI +KiGetFeatureBits(VOID); + +ULONG KeAllocateGdtSelector(ULONG Desc[2]); +VOID KeFreeGdtSelector(ULONG Entry); +VOID +NtEarlyInitVdm(VOID); +VOID +KeApplicationProcessorInitDispatcher(VOID); +VOID +KeCreateApplicationProcessorIdleThread(ULONG Id); + +typedef +VOID +(NTAPI*PKSYSTEM_ROUTINE)(PKSTART_ROUTINE StartRoutine, + PVOID StartContext); + +VOID +NTAPI +Ke386InitThreadWithContext(PKTHREAD Thread, + PKSYSTEM_ROUTINE SystemRoutine, + PKSTART_ROUTINE StartRoutine, + PVOID StartContext, + PCONTEXT Context); +#define KeArchInitThreadWithContext(Thread,SystemRoutine,StartRoutine,StartContext,Context) \ + Ke386InitThreadWithContext(Thread,SystemRoutine,StartRoutine,StartContext,Context) + +#ifdef _NTOSKRNL_ /* FIXME: Move flags above to NDK instead of here */ +VOID +NTAPI +KiThreadStartup(PKSYSTEM_ROUTINE SystemRoutine, + PKSTART_ROUTINE StartRoutine, + PVOID StartContext, + BOOLEAN UserThread, + KTRAP_FRAME TrapFrame); +#endif + +#endif +#endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H */ + +/* EOF */ diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h new file mode 100644 index 00000000000..44867629e4b --- /dev/null +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -0,0 +1,31 @@ +/* + * Lowlevel memory managment definitions + */ + +#ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H +#define __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H + +struct _EPROCESS; +PULONG MmGetPageDirectory(VOID); + +#define PAGE_MASK(x) ((x)&(~0xfff)) +#define PAE_PAGE_MASK(x) ((x)&(~0xfffLL)) + +/* Base addresses of PTE and PDE */ +#define PAGETABLE_MAP (0xc0000000) +#define PAGEDIRECTORY_MAP (0xc0000000 + (PAGETABLE_MAP / (1024))) + +/* Converting address to a corresponding PDE or PTE entry */ +#define MiAddressToPde(x) \ + ((PMMPTE)(((((ULONG)(x)) >> 22) << 2) + PAGEDIRECTORY_MAP)) +#define MiAddressToPte(x) \ + ((PMMPTE)(((((ULONG)(x)) >> 12) << 2) + PAGETABLE_MAP)) + +#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE)) +#define ADDR_TO_PDE_OFFSET(v) ((((ULONG)(v)) / (1024 * PAGE_SIZE))) +#define ADDR_TO_PTE_OFFSET(v) ((((ULONG)(v)) % (1024 * PAGE_SIZE)) / PAGE_SIZE) + +/* Easy accessing PFN in PTE */ +#define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber) + +#endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H */ diff --git a/reactos/ntoskrnl/include/internal/arch/intrin_i.h b/reactos/ntoskrnl/include/internal/arch/intrin_i.h index 18b4c6c7197..a4e689cb276 100644 --- a/reactos/ntoskrnl/include/internal/arch/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/arch/intrin_i.h @@ -27,6 +27,8 @@ #include "../mips/intrin_i.h" #elif defined(_M_ARM) #include "../arm/intrin_i.h" +#elif defined(_M_AMD64) +#include "../amd64/intrin_i.h" #else #error "Unknown processor" #endif diff --git a/reactos/ntoskrnl/include/internal/arch/ke.h b/reactos/ntoskrnl/include/internal/arch/ke.h index 5a1b053f23f..1d2e3a006e3 100644 --- a/reactos/ntoskrnl/include/internal/arch/ke.h +++ b/reactos/ntoskrnl/include/internal/arch/ke.h @@ -27,6 +27,8 @@ #include "../mips/ke.h" #elif defined(_M_ARM) #include "../arm/ke.h" +#elif defined(_M_AMD64) +#include "../amd64/ke.h" #else #error "Unknown processor" #endif diff --git a/reactos/ntoskrnl/include/internal/arch/mm.h b/reactos/ntoskrnl/include/internal/arch/mm.h index ebbe5917061..92f2c20cc6d 100644 --- a/reactos/ntoskrnl/include/internal/arch/mm.h +++ b/reactos/ntoskrnl/include/internal/arch/mm.h @@ -27,6 +27,8 @@ #include #elif defined(_M_ARM) #include +#elif defined(_M_AMD64) +#include #else #error "Unknown processor" #endif diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 8c2400e1b8a..cf72757836c 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -17,7 +17,7 @@ #ifdef _NTOSKRNL_ -#ifndef _ARM_ +#if !defined (_ARM_) && !defined (_M_AMD64) #define KeGetCurrentThread _KeGetCurrentThread #define KeGetPreviousMode _KeGetPreviousMode #endif @@ -34,7 +34,7 @@ #define InterlockedExchange _InterlockedExchange #define InterlockedExchangeAdd _InterlockedExchangeAdd -#include "ke.h" +//#include "ke.h" #include "i386/mm.h" #include "i386/fpu.h" #include "i386/v86m.h" @@ -102,49 +102,6 @@ RtlpLogException(IN PEXCEPTION_RECORD ExceptionRecord, IN PVOID ContextData, IN ULONG Size); -/* FIXME: Interlocked functions that need to be made into a public header */ -#ifdef __GNUC__ -FORCEINLINE -LONG -InterlockedAnd(IN OUT LONG volatile *Target, - IN LONG Set) -{ - LONG i; - LONG j; - - j = *Target; - do { - i = j; - j = InterlockedCompareExchange((PLONG)Target, - i & Set, - i); - - } while (i != j); - - return j; -} - -FORCEINLINE -LONG -InterlockedOr(IN OUT LONG volatile *Target, - IN LONG Set) -{ - LONG i; - LONG j; - - j = *Target; - do { - i = j; - j = InterlockedCompareExchange((PLONG)Target, - i | Set, - i); - - } while (i != j); - - return j; -} -#endif - /* * generic information class probing code */ @@ -309,6 +266,7 @@ DefaultQueryInfoBufferCheck(ULONG Class, #endif +#ifndef _WIN64 C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemCall) == 0x300); C_ASSERT(FIELD_OFFSET(KTHREAD, InitialStack) == KTHREAD_INITIAL_STACK); C_ASSERT(FIELD_OFFSET(KTHREAD, Teb) == KTHREAD_TEB); @@ -322,6 +280,8 @@ C_ASSERT(FIELD_OFFSET(KTHREAD, ApcState.Process) == KTHREAD_APCSTATE_PROCESS); C_ASSERT(FIELD_OFFSET(KPROCESS, DirectoryTableBase) == KPROCESS_DIRECTORY_TABLE_BASE); //C_ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST); //C_ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF); +#endif + #ifdef _M_IX86 C_ASSERT(FIELD_OFFSET(KPCR, IRR) == KPCR_IRR); C_ASSERT(FIELD_OFFSET(KPCR, IDR) == KPCR_IDR); diff --git a/reactos/ntoskrnl/ntoskrnl.rbuild b/reactos/ntoskrnl/ntoskrnl.rbuild index a63382207e4..b8d4defb8f4 100644 --- a/reactos/ntoskrnl/ntoskrnl.rbuild +++ b/reactos/ntoskrnl/ntoskrnl.rbuild @@ -2,7 +2,6 @@ - - + From e5056878c6c2da3f3e45cb3c00205eea15b84ea6 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 24 Jul 2008 20:15:36 +0000 Subject: [PATCH 018/388] Fix passing of command line args so it works on win64 too. svn path=/branches/ros-amd64-bringup/; revision=34754 --- reactos/lib/3rdparty/mingw/crt1.c | 6 +++++- reactos/lib/3rdparty/mingw/wcrt1.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/lib/3rdparty/mingw/crt1.c b/reactos/lib/3rdparty/mingw/crt1.c index dec13337fb6..e5795642a8a 100644 --- a/reactos/lib/3rdparty/mingw/crt1.c +++ b/reactos/lib/3rdparty/mingw/crt1.c @@ -47,6 +47,10 @@ __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ +#ifndef __initenv +extern char ***_imp____initenv; +#define __initenv (*_imp____initenv) +#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -235,7 +239,7 @@ __mingw_CRTStartup (void) * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ - nRet = main (_argc, _argv, _environ); + nRet = main (_argc, _argv, __initenv); /* * Perform exit processing for the C library. This means diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c index 28e933ba76b..4edbbdcfe16 100644 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ b/reactos/lib/3rdparty/mingw/wcrt1.c @@ -45,6 +45,10 @@ extern int wmain (int, wchar_t **, wchar_t **); __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ +#ifndef __winitenv +extern wchar_t ***_imp____winitenv; +#define __winitenv (*_imp____winitenv) +#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -233,7 +237,7 @@ __mingw_wCRTStartup (void) * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ - nRet = wmain (_argc, _wargv, NULL); + nRet = wmain (_argc, _wargv, __winitenv); /* * Perform exit processing for the C library. This means From a44aeaaeec9274bdfd07f92749c2fd7d9ae00eac Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 21:08:31 +0000 Subject: [PATCH 019/388] ntoskrnl: for now comment out all files that don't compile, the linker now get's a "-Wl,--file-alignment,0x1000" that it does not like, let's see what we can do about that svn path=/branches/ros-amd64-bringup/; revision=34756 --- reactos/ntoskrnl/ntoskrnl-generic.rbuild | 206 +++++++++++------------ 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index 7d9a3b16940..b2f487670a4 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -87,30 +87,30 @@ ctxhelp.S - apc.c - balmgr.c - bug.c - clock.c + + + + config.c devqueue.c - dpc.c + eventobj.c - except.c - freeldr.c - gate.c - gmutex.c + + + + ipi.c - krnlinit.c - mutex.c - procobj.c - profobj.c - queue.c - semphobj.c + + + + + + spinlock.c - thrdschd.c - thrdobj.c - timerobj.c - wait.c + + + + cacheman.c @@ -145,9 +145,9 @@ cmdata.c cmdelay.c cmindex.c - cminit.c + cmhook.c - cmkcbncb.c + cmkeydel.c cmlazy.c cmmapvw.c @@ -155,18 +155,18 @@ cmparse.c cmse.c cmsecach.c - cmsysini.c + cmvalue.c cmvalche.c cmwraprs.c - ntapi.c + - dbgkutil.c - dbgkobj.c + + - zw.S + @@ -176,35 +176,35 @@ ioport.S - atom.c + callback.c dbgctrl.c efi.c - event.c - evtpair.c + + exintrin.c fastinterlck.c fmutex.c - handle.c - harderr.c + + hdlsterm.c - init.c + keyedevt.c - locale.c - lookas.c - mutant.c - pushlock.c - profile.c - resource.c + + + + + + rundown.c - sem.c + shutdown.c - sysinfo.c - time.c - timer.c - uuid.c + + + + win32k.c - work.c + xipdisp.c zone.c @@ -244,13 +244,13 @@ deviface.c driver.c drvrlist.c - error.c - file.c - iocomp.c + + + ioevent.c - iofunc.c + iomdl.c - iomgr.c + iorsrce.c iotimer.c iowork.c @@ -259,12 +259,12 @@ ramdisk.c rawfs.c remlock.c - util.c + symlink.c - volume.c + - plugplay.c + pnpdma.c pnpmgr.c pnpnotify.c @@ -287,19 +287,19 @@ - kdb.c - kdb_cli.c - kdb_expr.c + + + kdb_keyboard.c - kdb_serial.c + - kdb_symbols.c + - bochs.c + gdbstub.c @@ -310,7 +310,7 @@ kdinit.c kdio.c - kdmain.c + @@ -326,13 +326,13 @@ close.c - complete.c - connect.c - create.c + + + listen.c port.c - reply.c - send.c + + @@ -351,37 +351,37 @@ page.c - anonmem.c + aspace.c balance.c - cont.c + drvlck.c freelist.c - iospace.c + kmap.c marea.c - mdlsup.c - mm.c - mminit.c - mpw.c - ncache.c - npool.c - pagefile.c + + + + + + + pageop.c pager.c pagfault.c paging.c pe.c physical.c - pool.c - ppool.c - procsup.c - region.c + + + + rmap.c - section.c - sysldr.c + + verifier.c - virtual.c + wset.c elf32.c @@ -389,20 +389,20 @@ - obdir.c - obinit.c - obhandle.c + + + obname.c oblife.c obref.c - obsdcach.c + obsecure.c - oblink.c - obwait.c + + power.c - events.c + @@ -415,18 +415,18 @@ psctx.c - debug.c - job.c - kill.c + + + psnotify.c - process.c - psmgr.c - query.c + + + quota.c - security.c - state.c - thread.c - win32.c + + + + @@ -434,20 +434,20 @@ rtlexcpt.c - libsupp.c + misc.c strtok.c access.c acl.c - audit.c - lsa.c + + priv.c - sd.c + semgr.c sid.c - token.c + From 0c493a626f6530154b4f99cb935212c789108794 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 24 Jul 2008 21:32:08 +0000 Subject: [PATCH 020/388] Fix cast from pointer to integer of different size svn path=/branches/ros-amd64-bringup/; revision=34758 --- reactos/base/setup/welcome/welcome.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/setup/welcome/welcome.c b/reactos/base/setup/welcome/welcome.c index 87d11d7090e..b6a8167c193 100755 --- a/reactos/base/setup/welcome/welcome.c +++ b/reactos/base/setup/welcome/welcome.c @@ -179,7 +179,7 @@ _tWinMain(HINSTANCE hInst, rcRightPanel.left = rcLeftPanel.right; rcRightPanel.right = ulInnerWidth - 1; - if (!LoadString(hInstance, (UINT)MAKEINTRESOURCE(IDS_APPTITLE), szAppTitle, 80)) + if (!LoadString(hInstance, (UINT_PTR)MAKEINTRESOURCE(IDS_APPTITLE), szAppTitle, 80)) _tcscpy(szAppTitle, TEXT("ReactOS Welcome")); /* Create main window */ From 649302655019917a9b5a0b0478ce41283f4e16f5 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 24 Jul 2008 21:39:03 +0000 Subject: [PATCH 021/388] Make notepad compile warning free. svn path=/branches/ros-amd64-bringup/; revision=34760 --- reactos/base/applications/notepad/dialog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/base/applications/notepad/dialog.c b/reactos/base/applications/notepad/dialog.c index 4385f99b8c9..4dea2329882 100644 --- a/reactos/base/applications/notepad/dialog.c +++ b/reactos/base/applications/notepad/dialog.c @@ -475,7 +475,7 @@ VOID DIALOG_FileSaveAs(VOID) OFN_HIDEREADONLY | OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK; saveas.lpstrDefExt = szDefaultExt; saveas.lpTemplateName = MAKEINTRESOURCE(DIALOG_ENCODING); - saveas.lpfnHook = DIALOG_FileSaveAs_Hook; + saveas.lpfnHook = (LPOFNHOOKPROC)DIALOG_FileSaveAs_Hook; if (GetSaveFileName(&saveas)) { SetFileName(szPath); @@ -851,7 +851,7 @@ VOID DIALOG_GoTo(VOID) } nLine = DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(DIALOG_GOTO), - Globals.hMainWnd, DIALOG_GoTo_DialogProc, nLine); + Globals.hMainWnd, (DLGPROC)DIALOG_GoTo_DialogProc, nLine); if (nLine >= 1) { @@ -981,7 +981,7 @@ VOID DIALOG_HelpAboutWine(VOID) VOID DIALOG_FilePageSetup(void) { DialogBox(Globals.hInstance, MAKEINTRESOURCE(DIALOG_PAGESETUP), - Globals.hMainWnd, DIALOG_PAGESETUP_DlgProc); + Globals.hMainWnd, (DLGPROC)DIALOG_PAGESETUP_DlgProc); } From 17257b1c5225426f3f0ce2443c367b0a75750e8b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 21:45:27 +0000 Subject: [PATCH 022/388] - add ntoskrnl-amd64.lnk based on i386 one, but target pei-x86-64 - remove some unsupported ntoskrnl linkerflags from rbuild file Now we can see all those unresolved references... sigh svn path=/branches/ros-amd64-bringup/; revision=34761 --- reactos/ReactOS-amd64.rbuild | 2 +- reactos/ntoskrnl/ntoskrnl_amd64.lnk | 105 ++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 reactos/ntoskrnl/ntoskrnl_amd64.lnk diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 58d98f28158..46715ae83b9 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -17,7 +17,7 @@ - + -enable-stdcall-fixup diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.lnk b/reactos/ntoskrnl/ntoskrnl_amd64.lnk new file mode 100644 index 00000000000..3db23c91f0a --- /dev/null +++ b/reactos/ntoskrnl/ntoskrnl_amd64.lnk @@ -0,0 +1,105 @@ +OUTPUT_FORMAT(pei-x86-64) +ENTRY(_mainCRTStartup) +SECTIONS +{ + .text __image_base__ + __section_alignment__ : + { + __text_start__ = .; + *(.init) + *(.text) + *(SORT(.text$*)) + *(.glue_7t) + *(.glue_7) + ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + LONG (-1); *(.ctors); *(.ctor); LONG (0); + ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + LONG (-1); *(.dtors); *(.dtor); LONG (0); + *(.fini) + /* ??? Why is .gcc_exc here? */ + *(.gcc_exc) + __text_end__ = .; + *(.gcc_except_table) + } + init BLOCK(__section_alignment__) : + { + __init_start__ = . ; + *(init) + __init_end__ = . ; + } + /* The Cygwin32 library uses a section to avoid copying certain data + on fork. This used to be named ".data". The linker used + to include this between __data_start__ and __data_end__, but that + breaks building the cygwin32 dll. Instead, we name the section + ".data_cygwin_nocopy" and explictly include it after __data_end__. */ + .data BLOCK(__section_alignment__) : + { + __data_start__ = . ; + *(.data) + *(.data2) + *(SORT(.data$*)) + __data_end__ = . ; + *(.data_cygwin_nocopy) + } + .rdata BLOCK(__section_alignment__) : + { + *(.rdata) + *(SORT(.rdata$*)) + *(.eh_frame) + } + .edata BLOCK(__section_alignment__) : + { + *(.edata) + } + /DISCARD/ : + { + *(.debug$S) + *(.debug$T) + *(.debug$F) + *(.drectve) + } + + .idata BLOCK(__section_alignment__) : + { + /* This cannot currently be handled with grouped sections. + See pe.em:sort_sections. */ + SORT(*)(.idata$2) + SORT(*)(.idata$3) + /* These zeroes mark the end of the import list. */ + LONG (0); LONG (0); LONG (0); LONG (0); LONG (0); + SORT(*)(.idata$4) + SORT(*)(.idata$5) + SORT(*)(.idata$6) + SORT(*)(.idata$7) + } + .CRT BLOCK(__section_alignment__) : + { + *(SORT(.CRT$*)) + } + .rsrc BLOCK(__section_alignment__) : + { + *(.rsrc) + *(SORT(.rsrc$*)) + } + .bss BLOCK(__section_alignment__) : + { + __bss_start__ = . ; + *(.bss) + *(COMMON) + __bss_end__ = . ; + } + .reloc BLOCK(__section_alignment__) : + { + *(.reloc) + /* These zeroes mark the end of the reloc section. */ + LONG (0); LONG (0); LONG (0); LONG (0); LONG (0); + } + .stab BLOCK(__section_alignment__) (NOLOAD) : + { + [ .stab ] + } + .stabstr BLOCK(__section_alignment__) (NOLOAD) : + { + [ .stabstr ] + } +} + From 9983f446cee909a5f690b655e6aa75b637dcde16 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 24 Jul 2008 23:04:22 +0000 Subject: [PATCH 023/388] - add ke/amd64/boot.S containing KiSystemStartup - add ke/amd64/kiinit.c, stubbed out - allow warnings for now, so we can compile a lot more files svn path=/branches/ros-amd64-bringup/; revision=34765 --- reactos/ntoskrnl/ke/amd64/boot.S | 86 +++ reactos/ntoskrnl/ke/amd64/kiinit.c | 785 +++++++++++++++++++++++ reactos/ntoskrnl/ntoskrnl-generic.rbuild | 112 ++-- reactos/ntoskrnl/ntoskrnl.rbuild | 2 +- 4 files changed, 931 insertions(+), 54 deletions(-) create mode 100644 reactos/ntoskrnl/ke/amd64/boot.S create mode 100644 reactos/ntoskrnl/ke/amd64/kiinit.c diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S new file mode 100644 index 00000000000..82e0b054b4c --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -0,0 +1,86 @@ +/* + * FILE: ntoskrnl/ke/i386/boot.S + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: FreeLDR Wrapper Bootstrap Code and Bootstrap Trampoline + * PROGRAMMERs: Alex Ionescu (alex@relsoft.net) + * Thomas Weidenmueller + */ + +/* INCLUDES ******************************************************************/ + +#include +.intel_syntax noprefix +.code64 + +/* GLOBALS *******************************************************************/ + +.bss +.align 16 + +/* Kernel Boot Stack */ +.globl _P0BootStack +.space KERNEL_STACK_SIZE +_P0BootStack: + +/* Kernel Double-Fault and Temporary DPC Stack */ +.globl _KiDoubleFaultStack +.space KERNEL_STACK_SIZE +_KiDoubleFaultStack: + +/* FUNCTIONS *****************************************************************/ +.global _KiSystemStartup +.text +.func KiSystemStartup +_KiSystemStartup: + + /* NTLDR Boot: Call the main kernel initialization */ + test rcx, 0x80000000 + jnz _KiSystemStartupReal + + /* FREELDR Boot: Cal the FreeLDR wrapper */ + jmp _KiRosPrepareForSystemStartup +.endfunc + +/** + * VOID + * KiSetupStackAndInitializeKernel( + * esp+4 = ? -> rcx + * esp+8 = ? -> rdx + * PVOID pNewstack // esp+12 = new stack -> r8 + * esp+16 -> r9 + * esp+20 -> rsp + 8 + * esp+24 -> rsp + 16? + */ +.globl _KiSetupStackAndInitializeKernel +.func KiSetupStackAndInitializeKernel +_KiSetupStackAndInitializeKernel: + + /* Save current stack */ + mov rsi, rsp + + /* Setup the new stack */ + mov rsp, r8 + sub rsp, NPX_FRAME_LENGTH + KTRAP_FRAME_ALIGN + KTRAP_FRAME_LENGTH + push CR0_EM + CR0_TS + CR0_MP + + /* Copy stack parameters to the new stack */ + push [rsi + 16] + push [rsi + 8] + xor rbp, rbp + call _KiInitializeKernel + + /* Set the priority of this thread to 0 */ + mov rbx, PCR[KPCR_CURRENT_THREAD] + mov byte ptr [rbx+KTHREAD_PRIORITY], 0 + + /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ + sti + mov rcx, DISPATCH_LEVEL + call _KfLowerIrql + + /* Set the right wait IRQL */ + mov byte ptr [rbx+KTHREAD_WAIT_IRQL], DISPATCH_LEVEL; + + /* Jump into the idle loop */ + jmp _KiIdleLoop +.endfunc diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c new file mode 100644 index 00000000000..b2ed5f6910f --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -0,0 +1,785 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/i386/kiinit.c + * PURPOSE: Kernel Initialization for x86 CPUs + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +/* Spinlocks used only on X86 */ +KSPIN_LOCK KiFreezeExecutionLock; +KSPIN_LOCK Ki486CompatibilityLock; + +/* BIOS Memory Map. Not NTLDR-compliant yet */ +extern ULONG KeMemoryMapRangeCount; +extern ADDRESS_RANGE KeMemoryMap[64]; + +/* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +KiInitMachineDependent(VOID) +{ +#if 0 + ULONG Protect; + ULONG CpuCount; + BOOLEAN FbCaching = FALSE; + NTSTATUS Status; + ULONG ReturnLength; + ULONG i, Affinity, Sample = 0; + PFX_SAVE_AREA FxSaveArea; + ULONG MXCsrMask = 0xFFBF; + ULONG Dummy[4]; + KI_SAMPLE_MAP Samples[4]; + PKI_SAMPLE_MAP CurrentSample = Samples; + + /* Check for large page support */ + if (KeFeatureBits & KF_LARGE_PAGE) + { + /* FIXME: Support this */ + DPRINT1("Large Page support detected but not yet taken advantage of!\n"); + } + + /* Check for global page support */ + if (KeFeatureBits & KF_GLOBAL_PAGE) + { + /* Do an IPI to enable it on all CPUs */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableGlobalPage, (ULONG_PTR)&CpuCount); + } + + /* Check for PAT and/or MTRR support */ + if (KeFeatureBits & (KF_PAT | KF_MTRR)) + { + /* Query the HAL to make sure we can use it */ + Status = HalQuerySystemInformation(HalFrameBufferCachingInformation, + sizeof(BOOLEAN), + &FbCaching, + &ReturnLength); + if ((NT_SUCCESS(Status)) && (FbCaching)) + { + /* We can't, disable it */ + KeFeatureBits &= ~(KF_PAT | KF_MTRR); + } + } + + /* Check for PAT support and enable it */ + if (KeFeatureBits & KF_PAT) KiInitializePAT(); + + /* Assume no errata for now */ + SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_PRECISION_ERRATA] = 0; + + /* Check if we have an NPX */ + if (KeI386NpxPresent) + { + /* Loop every CPU */ + i = KeActiveProcessors; + for (Affinity = 1; i; Affinity <<= 1) + { + /* Check if this is part of the set */ + if (i & Affinity) + { + /* Run on this CPU */ + i &= ~Affinity; + KeSetSystemAffinityThread(Affinity); + + /* Detect FPU errata */ + if (KiIsNpxErrataPresent()) + { + /* Disable NPX support */ + KeI386NpxPresent = FALSE; + SharedUserData-> + ProcessorFeatures[PF_FLOATING_POINT_PRECISION_ERRATA] = + TRUE; + break; + } + } + } + } + + /* If there's no NPX, then we're emulating the FPU */ + SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_EMULATED] = + !KeI386NpxPresent; + + /* Check if there's no NPX, so that we can disable associated features */ + if (!KeI386NpxPresent) + { + /* Remove NPX-related bits */ + KeFeatureBits &= ~(KF_XMMI64 | KF_XMMI | KF_FXSR | KF_MMX); + + /* Disable kernel flags */ + KeI386FxsrPresent = KeI386XMMIPresent = FALSE; + + /* Disable processor features that might've been set until now */ + SharedUserData->ProcessorFeatures[PF_FLOATING_POINT_PRECISION_ERRATA] = + SharedUserData->ProcessorFeatures[PF_XMMI64_INSTRUCTIONS_AVAILABLE] = + SharedUserData->ProcessorFeatures[PF_XMMI_INSTRUCTIONS_AVAILABLE] = + SharedUserData->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = + SharedUserData->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] = 0; + } + + /* Check for CR4 support */ + if (KeFeatureBits & KF_CR4) + { + /* Do an IPI call to enable the Debug Exceptions */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableDE, (ULONG_PTR)&CpuCount); + } + + /* Check if FXSR was found */ + if (KeFeatureBits & KF_FXSR) + { + /* Do an IPI call to enable the FXSR */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableFxsr, (ULONG_PTR)&CpuCount); + + /* Check if XMM was found too */ + if (KeFeatureBits & KF_XMMI) + { + /* Do an IPI call to enable XMMI exceptions */ + CpuCount = KeNumberProcessors; + KeIpiGenericCall(Ki386EnableXMMIExceptions, (ULONG_PTR)&CpuCount); + + /* FIXME: Implement and enable XMM Page Zeroing for Mm */ + + /* Patch the RtlPrefetchMemoryNonTemporal routine to enable it */ + Protect = MmGetPageProtect(NULL, RtlPrefetchMemoryNonTemporal); + MmSetPageProtect(NULL, + RtlPrefetchMemoryNonTemporal, + Protect | PAGE_IS_WRITABLE); + *(PCHAR)RtlPrefetchMemoryNonTemporal = 0x90; + MmSetPageProtect(NULL, RtlPrefetchMemoryNonTemporal, Protect); + } + } + + /* Check for, and enable SYSENTER support */ + KiRestoreFastSyscallReturnState(); + + /* Loop every CPU */ + i = KeActiveProcessors; + for (Affinity = 1; i; Affinity <<= 1) + { + /* Check if this is part of the set */ + if (i & Affinity) + { + /* Run on this CPU */ + i &= ~Affinity; + KeSetSystemAffinityThread(Affinity); + + /* Reset MHz to 0 for this CPU */ + KeGetCurrentPrcb()->MHz = 0; + + /* Check if we can use RDTSC */ + if (KeFeatureBits & KF_RDTSC) + { + /* Start sampling loop */ + for (;;) + { + /* Do a dummy CPUID to start the sample */ + CPUID(Dummy, 0); + + /* Fill out the starting data */ + CurrentSample->PerfStart = KeQueryPerformanceCounter(NULL); + CurrentSample->TSCStart = __rdtsc(); + CurrentSample->PerfFreq.QuadPart = -50000; + + /* Sleep for this sample */ + KeDelayExecutionThread(KernelMode, + FALSE, + &CurrentSample->PerfFreq); + + /* Do another dummy CPUID */ + CPUID(Dummy, 0); + + /* Fill out the ending data */ + CurrentSample->PerfEnd = + KeQueryPerformanceCounter(&CurrentSample->PerfFreq); + CurrentSample->TSCEnd = __rdtsc(); + + /* Calculate the differences */ + CurrentSample->PerfDelta = CurrentSample->PerfEnd.QuadPart - + CurrentSample->PerfStart.QuadPart; + CurrentSample->TSCDelta = CurrentSample->TSCEnd - + CurrentSample->TSCStart; + + /* Compute CPU Speed */ + CurrentSample->MHz = (ULONG)((CurrentSample->TSCDelta * + CurrentSample-> + PerfFreq.QuadPart + 500000) / + (CurrentSample->PerfDelta * + 1000000)); + + /* Check if this isn't the first sample */ + if (Sample) + { + /* Check if we got a good precision within 1MHz */ + if ((CurrentSample->MHz == CurrentSample[-1].MHz) || + (CurrentSample->MHz == CurrentSample[-1].MHz + 1) || + (CurrentSample->MHz == CurrentSample[-1].MHz - 1)) + { + /* We did, stop sampling */ + break; + } + } + + /* Move on */ + CurrentSample++; + Sample++; + + if (Sample == sizeof(Samples) / sizeof(Samples[0])) + { + /* Restart */ + CurrentSample = Samples; + Sample = 0; + } + } + + /* Save the CPU Speed */ + KeGetCurrentPrcb()->MHz = CurrentSample[-1].MHz; + } + + /* Check if we have MTRR */ + if (KeFeatureBits & KF_MTRR) + { + /* Then manually initialize MTRR for the CPU */ + KiInitializeMTRR(i ? FALSE : TRUE); + } + + /* Check if we have AMD MTRR and initialize it for the CPU */ + if (KeFeatureBits & KF_AMDK6MTRR) KiAmdK6InitializeMTRR(); + + /* Check if this is a buggy Pentium and apply the fixup if so */ + if (KiI386PentiumLockErrataPresent) KiI386PentiumLockErrataFixup(); + + /* Check if the CPU supports FXSR */ + if (KeFeatureBits & KF_FXSR) + { + /* Get the current thread NPX state */ + FxSaveArea = (PVOID) + ((ULONG_PTR)KeGetCurrentThread()->InitialStack - + NPX_FRAME_LENGTH); + + /* Clear initial MXCsr mask */ + FxSaveArea->U.FxArea.MXCsrMask = 0; + + /* Save the current NPX State */ +#ifdef __GNUC__ + asm volatile("fxsave %0\n\t" : "=m" (*FxSaveArea)); +#else + __asm fxsave [FxSaveArea] +#endif + /* Check if the current mask doesn't match the reserved bits */ + if (FxSaveArea->U.FxArea.MXCsrMask != 0) + { + /* Then use whatever it's holding */ + MXCsrMask = FxSaveArea->U.FxArea.MXCsrMask; + } + + /* Check if nobody set the kernel-wide mask */ + if (!KiMXCsrMask) + { + /* Then use the one we calculated above */ + KiMXCsrMask = MXCsrMask; + } + else + { + /* Was it set to the same value we found now? */ + if (KiMXCsrMask != MXCsrMask) + { + /* No, something is definitely wrong */ + KEBUGCHECKEX(MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED, + KF_FXSR, + KiMXCsrMask, + MXCsrMask, + 0); + } + } + + /* Now set the kernel mask */ + KiMXCsrMask &= MXCsrMask; + } + } + } + + /* Return affinity back to where it was */ + KeRevertToUserAffinityThread(); + + /* NT allows limiting the duration of an ISR with a registry key */ + if (KiTimeLimitIsrMicroseconds) + { + /* FIXME: TODO */ + DPRINT1("ISR Time Limit not yet supported\n"); + } +#endif +} + +VOID +NTAPI +KiInitializePcr(IN ULONG ProcessorNumber, + IN PKIPCR Pcr, + IN PKIDTENTRY Idt, + IN PKGDTENTRY Gdt, + IN PKTSS Tss, + IN PKTHREAD IdleThread, + IN PVOID DpcStack) +{ +#if 0 + /* Setup the TIB */ + Pcr->NtTib.ExceptionList = EXCEPTION_CHAIN_END; + Pcr->NtTib.StackBase = 0; + Pcr->NtTib.StackLimit = 0; + Pcr->NtTib.Self = NULL; + + /* Set the Current Thread */ + Pcr->PrcbData.CurrentThread = IdleThread; + + /* Set pointers to ourselves */ + Pcr->Self = (PKPCR)Pcr; + Pcr->Prcb = &Pcr->PrcbData; + + /* Set the PCR Version */ + Pcr->MajorVersion = PCR_MAJOR_VERSION; + Pcr->MinorVersion = PCR_MINOR_VERSION; + + /* Set the PCRB Version */ + Pcr->PrcbData.MajorVersion = 1; + Pcr->PrcbData.MinorVersion = 1; + + /* Set the Build Type */ + Pcr->PrcbData.BuildType = 0; +#ifndef CONFIG_SMP + Pcr->PrcbData.BuildType |= PRCB_BUILD_UNIPROCESSOR; +#endif +#ifdef DBG + Pcr->PrcbData.BuildType |= PRCB_BUILD_DEBUG; +#endif + + /* Set the Processor Number and current Processor Mask */ + Pcr->PrcbData.Number = (UCHAR)ProcessorNumber; + Pcr->PrcbData.SetMember = 1 << ProcessorNumber; + + /* Set the PRCB for this Processor */ + KiProcessorBlock[ProcessorNumber] = Pcr->Prcb; + + /* Start us out at PASSIVE_LEVEL */ + Pcr->Irql = PASSIVE_LEVEL; + + /* Set the GDI, IDT, TSS and DPC Stack */ + Pcr->GDT = (PVOID)Gdt; + Pcr->IDT = Idt; + Pcr->TSS = Tss; + Pcr->TssCopy = Tss; + Pcr->PrcbData.DpcStack = DpcStack; + + /* Setup the processor set */ + Pcr->PrcbData.MultiThreadProcessorSet = Pcr->PrcbData.SetMember; +#endif +} + +VOID +NTAPI +KiInitializeKernel(IN PKPROCESS InitProcess, + IN PKTHREAD InitThread, + IN PVOID IdleStack, + IN PKPRCB Prcb, + IN CCHAR Number, + IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ +#if 0 + BOOLEAN NpxPresent; + ULONG FeatureBits; + LARGE_INTEGER PageDirectory; + PVOID DpcStack; + ULONG Vendor[3]; + + /* Detect and set the CPU Type */ + KiSetProcessorType(); + + /* Set CR0 features based on detected CPU */ + KiSetCR0Bits(); + + /* Check if an FPU is present */ + NpxPresent = KiIsNpxPresent(); + + /* Initialize the Power Management Support for this PRCB */ + PoInitializePrcb(Prcb); + + /* Bugcheck if this is a 386 CPU */ + if (Prcb->CpuType == 3) KeBugCheckEx(0x5D, 0x386, 0, 0, 0); + + /* Get the processor features for the CPU */ + FeatureBits = KiGetFeatureBits(); + + /* Set the default NX policy (opt-in) */ + SharedUserData->NXSupportPolicy = NX_SUPPORT_POLICY_OPTIN; + + /* Check if NPX is always on */ + if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSON")) + { + /* Set it always on */ + SharedUserData->NXSupportPolicy = NX_SUPPORT_POLICY_ALWAYSON; + FeatureBits |= KF_NX_ENABLED; + } + else if (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTOUT")) + { + /* Set it in opt-out mode */ + SharedUserData->NXSupportPolicy = NX_SUPPORT_POLICY_OPTOUT; + FeatureBits |= KF_NX_ENABLED; + } + else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=OPTIN")) || + (strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE"))) + { + /* Set the feature bits */ + FeatureBits |= KF_NX_ENABLED; + } + else if ((strstr(KeLoaderBlock->LoadOptions, "NOEXECUTE=ALWAYSOFF")) || + (strstr(KeLoaderBlock->LoadOptions, "EXECUTE"))) + { + /* Set disabled mode */ + SharedUserData->NXSupportPolicy = NX_SUPPORT_POLICY_ALWAYSOFF; + FeatureBits |= KF_NX_DISABLED; + } + + /* Save feature bits */ + Prcb->FeatureBits = FeatureBits; + + /* Save CPU state */ + KiSaveProcessorControlState(&Prcb->ProcessorState); + + /* Get cache line information for this CPU */ + KiGetCacheInformation(); + + /* Initialize spinlocks and DPC data */ + KiInitSpinLocks(Prcb, Number); + + /* Check if this is the Boot CPU */ + if (!Number) + { + /* Set Node Data */ + KeNodeBlock[0] = &KiNode0; + Prcb->ParentNode = KeNodeBlock[0]; + KeNodeBlock[0]->ProcessorMask = Prcb->SetMember; + + /* Set boot-level flags */ + KeI386NpxPresent = NpxPresent; + KeI386CpuType = Prcb->CpuType; + KeI386CpuStep = Prcb->CpuStep; + KeProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL; + KeProcessorLevel = (USHORT)Prcb->CpuType; + if (Prcb->CpuID) KeProcessorRevision = Prcb->CpuStep; + KeFeatureBits = FeatureBits; + KeI386FxsrPresent = (KeFeatureBits & KF_FXSR) ? TRUE : FALSE; + KeI386XMMIPresent = (KeFeatureBits & KF_XMMI) ? TRUE : FALSE; + + /* Detect 8-byte compare exchange support */ + if (!(KeFeatureBits & KF_CMPXCHG8B)) + { + /* Copy the vendor string */ + RtlCopyMemory(Vendor, Prcb->VendorString, sizeof(Vendor)); + + /* Bugcheck the system. Windows *requires* this */ + KeBugCheckEx(0x5D, + (1 << 24 ) | (Prcb->CpuType << 16) | Prcb->CpuStep, + Vendor[0], + Vendor[1], + Vendor[2]); + } + + /* Set the current MP Master KPRCB to the Boot PRCB */ + Prcb->MultiThreadSetMaster = Prcb; + + /* Lower to APC_LEVEL */ + KeLowerIrql(APC_LEVEL); + + /* Initialize some spinlocks */ + KeInitializeSpinLock(&KiFreezeExecutionLock); + KeInitializeSpinLock(&Ki486CompatibilityLock); + + /* Initialize portable parts of the OS */ + KiInitSystem(); + + /* Initialize the Idle Process and the Process Listhead */ + InitializeListHead(&KiProcessListHead); + PageDirectory.QuadPart = 0; + KeInitializeProcess(InitProcess, + 0, + 0xFFFFFFFF, + &PageDirectory, + FALSE); + InitProcess->QuantumReset = MAXCHAR; + } + else + { + /* FIXME */ + DPRINT1("SMP Boot support not yet present\n"); + } + + /* Setup the Idle Thread */ + KeInitializeThread(InitProcess, + InitThread, + NULL, + NULL, + NULL, + NULL, + NULL, + IdleStack); + InitThread->NextProcessor = Number; + InitThread->Priority = HIGH_PRIORITY; + InitThread->State = Running; + InitThread->Affinity = 1 << Number; + InitThread->WaitIrql = DISPATCH_LEVEL; + InitProcess->ActiveProcessors = 1 << Number; + + /* HACK for MmUpdatePageDir */ + ((PETHREAD)InitThread)->ThreadsProcess = (PEPROCESS)InitProcess; + + /* Set basic CPU Features that user mode can read */ + SharedUserData->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] = + (KeFeatureBits & KF_MMX) ? TRUE: FALSE; + SharedUserData->ProcessorFeatures[PF_COMPARE_EXCHANGE_DOUBLE] = + (KeFeatureBits & KF_CMPXCHG8B) ? TRUE: FALSE; + SharedUserData->ProcessorFeatures[PF_XMMI_INSTRUCTIONS_AVAILABLE] = + ((KeFeatureBits & KF_FXSR) && (KeFeatureBits & KF_XMMI)) ? TRUE: FALSE; + SharedUserData->ProcessorFeatures[PF_XMMI64_INSTRUCTIONS_AVAILABLE] = + ((KeFeatureBits & KF_FXSR) && (KeFeatureBits & KF_XMMI64)) ? TRUE: FALSE; + SharedUserData->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = + (KeFeatureBits & KF_3DNOW) ? TRUE: FALSE; + SharedUserData->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = + (KeFeatureBits & KF_RDTSC) ? TRUE: FALSE; + + /* Set up the thread-related fields in the PRCB */ + Prcb->CurrentThread = InitThread; + Prcb->NextThread = NULL; + Prcb->IdleThread = InitThread; + + /* Initialize the Kernel Executive */ + ExpInitializeExecutive(Number, LoaderBlock); + + /* Only do this on the boot CPU */ + if (!Number) + { + /* Calculate the time reciprocal */ + KiTimeIncrementReciprocal = + KiComputeReciprocal(KeMaximumIncrement, + &KiTimeIncrementShiftCount); + + /* Update DPC Values in case they got updated by the executive */ + Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth; + Prcb->MinimumDpcRate = KiMinimumDpcRate; + Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold; + + /* Allocate the DPC Stack */ + DpcStack = MmCreateKernelStack(FALSE, 0); + if (!DpcStack) KeBugCheckEx(NO_PAGES_AVAILABLE, 1, 0, 0, 0); + Prcb->DpcStack = DpcStack; + + /* Allocate the IOPM save area. */ + Ki386IopmSaveArea = ExAllocatePoolWithTag(PagedPool, + PAGE_SIZE * 2, + TAG('K', 'e', ' ', ' ')); + if (!Ki386IopmSaveArea) + { + /* Bugcheck. We need this for V86/VDM support. */ + KeBugCheckEx(NO_PAGES_AVAILABLE, 2, PAGE_SIZE * 2, 0, 0); + } + } + + /* Raise to Dispatch */ + KfRaiseIrql(DISPATCH_LEVEL); + + /* Set the Idle Priority to 0. This will jump into Phase 1 */ + KeSetPriorityThread(InitThread, 0); + + /* If there's no thread scheduled, put this CPU in the Idle summary */ + KiAcquirePrcbLock(Prcb); + if (!Prcb->NextThread) KiIdleSummary |= 1 << Number; + KiReleasePrcbLock(Prcb); + + /* Raise back to HIGH_LEVEL and clear the PRCB for the loader block */ + KfRaiseIrql(HIGH_LEVEL); + LoaderBlock->Prcb = 0; +#endif +} + +VOID +FASTCALL +KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, + IN PKIDTENTRY *Idt, + IN PKIPCR *Pcr, + IN PKTSS *Tss) +{ +#if 0 + KDESCRIPTOR GdtDescriptor = {0}, IdtDescriptor = {0}; + KGDTENTRY TssSelector, PcrSelector; + USHORT Tr = 0, Fs; + + /* Get GDT and IDT descriptors */ + Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&GdtDescriptor.Limit); + Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&IdtDescriptor.Limit); + + /* Save IDT and GDT */ + *Gdt = (PKGDTENTRY)GdtDescriptor.Base; + *Idt = (PKIDTENTRY)IdtDescriptor.Base; + + /* Get TSS and FS Selectors */ + Ke386GetTr(Tr); + if (Tr != KGDT_TSS) Tr = KGDT_TSS; // FIXME: HACKHACK + Fs = Ke386GetFs(); + + /* Get PCR Selector, mask it and get its GDT Entry */ + PcrSelector = *(PKGDTENTRY)((ULONG_PTR)*Gdt + (Fs & ~RPL_MASK)); + + /* Get the KPCR itself */ + *Pcr = (PKIPCR)(ULONG_PTR)(PcrSelector.BaseLow | + PcrSelector.HighWord.Bytes.BaseMid << 16 | + PcrSelector.HighWord.Bytes.BaseHi << 24); + + /* Get TSS Selector, mask it and get its GDT Entry */ + TssSelector = *(PKGDTENTRY)((ULONG_PTR)*Gdt + (Tr & ~RPL_MASK)); + + /* Get the KTSS itself */ + *Tss = (PKTSS)(ULONG_PTR)(TssSelector.BaseLow | + TssSelector.HighWord.Bytes.BaseMid << 16 | + TssSelector.HighWord.Bytes.BaseHi << 24); +#endif +} + +VOID +NTAPI +KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ +#if 0 + ULONG Cpu; + PKTHREAD InitialThread; + ULONG InitialStack; + PKGDTENTRY Gdt; + PKIDTENTRY Idt; + KIDTENTRY NmiEntry, DoubleFaultEntry; + PKTSS Tss; + PKIPCR Pcr; + + /* Save the loader block and get the current CPU */ + KeLoaderBlock = LoaderBlock; + Cpu = KeNumberProcessors; + if (!Cpu) + { + /* If this is the boot CPU, set FS and the CPU Number*/ + Ke386SetFs(KGDT_R0_PCR); + __writefsdword(KPCR_PROCESSOR_NUMBER, Cpu); + + /* Set the initial stack and idle thread as well */ + LoaderBlock->KernelStack = (ULONG_PTR)P0BootStack; + LoaderBlock->Thread = (ULONG_PTR)&KiInitialThread; + } + + /* Save the initial thread and stack */ + InitialStack = LoaderBlock->KernelStack; + InitialThread = (PKTHREAD)LoaderBlock->Thread; + + /* Clean the APC List Head */ + InitializeListHead(&InitialThread->ApcState.ApcListHead[KernelMode]); + + /* Initialize the machine type */ + KiInitializeMachineType(); + + /* Skip initial setup if this isn't the Boot CPU */ + if (Cpu) goto AppCpuInit; + + /* Get GDT, IDT, PCR and TSS pointers */ + KiGetMachineBootPointers(&Gdt, &Idt, &Pcr, &Tss); + + /* Setup the TSS descriptors and entries */ + Ki386InitializeTss(Tss, Idt, Gdt); + + /* Initialize the PCR */ + RtlZeroMemory(Pcr, PAGE_SIZE); + KiInitializePcr(Cpu, + Pcr, + Idt, + Gdt, + Tss, + InitialThread, + KiDoubleFaultStack); + + /* Set us as the current process */ + InitialThread->ApcState.Process = &KiInitialProcess.Pcb; + + /* Clear DR6/7 to cleanup bootloader debugging */ + __writefsdword(KPCR_TEB, 0); + __writefsdword(KPCR_DR6, 0); + __writefsdword(KPCR_DR7, 0); + + /* Setup the IDT */ + KeInitExceptions(); + + /* Load Ring 3 selectors for DS/ES */ + Ke386SetDs(KGDT_R3_DATA | RPL_MASK); + Ke386SetEs(KGDT_R3_DATA | RPL_MASK); + + /* Save NMI and double fault traps */ + RtlCopyMemory(&NmiEntry, &Idt[2], sizeof(KIDTENTRY)); + RtlCopyMemory(&DoubleFaultEntry, &Idt[8], sizeof(KIDTENTRY)); + + /* Copy kernel's trap handlers */ + RtlCopyMemory(Idt, + (PVOID)KiIdtDescriptor.Base, + KiIdtDescriptor.Limit + 1); + + /* Restore NMI and double fault */ + RtlCopyMemory(&Idt[2], &NmiEntry, sizeof(KIDTENTRY)); + RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY)); + +AppCpuInit: + /* Loop until we can release the freeze lock */ + do + { + /* Loop until execution can continue */ + while (*(volatile PKSPIN_LOCK*)&KiFreezeExecutionLock == (PVOID)1); + } while(InterlockedBitTestAndSet((PLONG)&KiFreezeExecutionLock, 0)); + + /* Setup CPU-related fields */ + __writefsdword(KPCR_NUMBER, Cpu); + __writefsdword(KPCR_SET_MEMBER, 1 << Cpu); + __writefsdword(KPCR_SET_MEMBER_COPY, 1 << Cpu); + __writefsdword(KPCR_PRCB_SET_MEMBER, 1 << Cpu); + + /* Initialize the Processor with HAL */ + HalInitializeProcessor(Cpu, KeLoaderBlock); + + /* Set active processors */ + KeActiveProcessors |= __readfsdword(KPCR_SET_MEMBER); + KeNumberProcessors++; + + /* Check if this is the boot CPU */ + if (!Cpu) + { + /* Initialize debugging system */ + KdInitSystem(0, KeLoaderBlock); + + /* Check for break-in */ + if (KdPollBreakIn()) DbgBreakPointWithStatus(1); + } + + /* Raise to HIGH_LEVEL */ + KfRaiseIrql(HIGH_LEVEL); + + /* Align stack and make space for the trap frame and NPX frame */ + InitialStack &= ~(KTRAP_FRAME_ALIGN - 1); + + /* Switch to new kernel stack and start kernel bootstrapping */ + KiSetupStackAndInitializeKernel(&KiInitialProcess.Pcb, + InitialThread, + (PVOID)InitialStack, + (PKPRCB)__readfsdword(KPCR_PRCB), + (CCHAR)Cpu, + KeLoaderBlock); +#endif +} diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index b2f487670a4..c1ae488c8e9 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -87,7 +87,13 @@ ctxhelp.S - + + + boot.S + kiinit.c + + + apc.c @@ -95,14 +101,14 @@ devqueue.c eventobj.c - - - - + except.c + freeldr.c + gate.c + gmutex.c ipi.c - - + mutex.c + procobj.c @@ -145,9 +151,9 @@ cmdata.c cmdelay.c cmindex.c - + cminit.c cmhook.c - + cmkcbncb.c cmkeydel.c cmlazy.c cmmapvw.c @@ -155,14 +161,14 @@ cmparse.c cmse.c cmsecach.c - + cmsysini.c cmvalue.c cmvalche.c cmwraprs.c - + ntapi.c - + dbgkutil.c @@ -181,30 +187,30 @@ dbgctrl.c efi.c - + evtpair.c exintrin.c fastinterlck.c fmutex.c - - + handle.c + harderr.c hdlsterm.c keyedevt.c - + locale.c - - - + pushlock.c + profile.c + resource.c rundown.c shutdown.c - + uuid.c win32k.c - + work.c xipdisp.c zone.c @@ -244,11 +250,11 @@ deviface.c driver.c drvrlist.c - + error.c ioevent.c - + iofunc.c iomdl.c iorsrce.c @@ -261,10 +267,10 @@ remlock.c symlink.c - + volume.c - + plugplay.c pnpdma.c pnpmgr.c pnpnotify.c @@ -289,17 +295,17 @@ - + kdb_expr.c kdb_keyboard.c - + kdb_serial.c - + kdb_symbols.c - + bochs.c gdbstub.c @@ -326,13 +332,13 @@ close.c - - - + complete.c + connect.c + create.c listen.c port.c - - + reply.c + send.c @@ -365,8 +371,8 @@ - - + npool.c + pagefile.c pageop.c pager.c pagfault.c @@ -374,12 +380,12 @@ pe.c physical.c - + ppool.c rmap.c - + sysldr.c verifier.c wset.c @@ -391,18 +397,18 @@ - + obhandle.c obname.c oblife.c obref.c - + obsdcach.c obsecure.c - - + oblink.c + obwait.c power.c - + events.c @@ -415,16 +421,16 @@ psctx.c - - - + debug.c + job.c + kill.c psnotify.c - + process.c - + query.c quota.c - - + security.c + state.c @@ -441,10 +447,10 @@ access.c acl.c - - + audit.c + lsa.c priv.c - + sd.c semgr.c sid.c diff --git a/reactos/ntoskrnl/ntoskrnl.rbuild b/reactos/ntoskrnl/ntoskrnl.rbuild index b8d4defb8f4..50d40d45ec2 100644 --- a/reactos/ntoskrnl/ntoskrnl.rbuild +++ b/reactos/ntoskrnl/ntoskrnl.rbuild @@ -1,7 +1,7 @@ - + From 17bcdbc7bb06481a8f42ac6eed0bcaacb6176d59 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 10:52:11 +0000 Subject: [PATCH 024/388] Lazy port of PSEH to amd64 probably has no chance of working, but satisfies ld a bit more on certain modules svn path=/branches/ros-amd64-bringup/; revision=34768 --- reactos/lib/pseh/amd64/framebased.S | 73 +++++++++++++++++++++++++++++ reactos/lib/pseh/framebased.c | 2 +- reactos/lib/pseh/pseh.rbuild | 5 ++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 reactos/lib/pseh/amd64/framebased.S diff --git a/reactos/lib/pseh/amd64/framebased.S b/reactos/lib/pseh/amd64/framebased.S new file mode 100644 index 00000000000..b7d8607ce8d --- /dev/null +++ b/reactos/lib/pseh/amd64/framebased.S @@ -0,0 +1,73 @@ +// Copyright (c) 2004/2005 KJK::Hyperion + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to dos so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +.text +.intel_syntax noprefix + +.globl __SEHCleanHandlerEnvironment +__SEHCleanHandlerEnvironment: + cld + ret + +.globl __SEHCurrentRegistration +__SEHCurrentRegistration: + mov rax, [fs:0] + ret + +.globl __SEHRegisterFrame +__SEHRegisterFrame: + mov rcx, [rsp+4] + mov rax, [fs:0] + mov [rcx+0], eax + mov [fs:0], ecx + ret + +.globl __SEHUnregisterFrame +__SEHUnregisterFrame: + mov rcx, [fs:0] + mov rcx, [rcx+0] + mov [fs:0], rcx + ret + +.globl __SEHGlobalUnwind +__SEHGlobalUnwind: + +.extern __SEHRtlUnwind + +// RtlUnwind clobbers all the "don't clobber" registers, so we save them + push rbx + mov rbx, [rsp+8] + push rsi + push rdi + + push 0 // ReturnValue + push 0 // ExceptionRecord + push .RestoreRegisters // TargetIp + push rbx // TargetFrame + call [__SEHRtlUnwind] + +.RestoreRegisters: + pop rdi + pop rsi + pop rbx + + ret + +// EOF diff --git a/reactos/lib/pseh/framebased.c b/reactos/lib/pseh/framebased.c index 121cb90d9e0..b74b174ecfc 100644 --- a/reactos/lib/pseh/framebased.c +++ b/reactos/lib/pseh/framebased.c @@ -94,7 +94,7 @@ extern unsigned long __cdecl DbgPrint(const char * format, ...); } \ } -#ifdef _X86_ +#ifdef __i386__ #define _SEH_TRACE_CONTEXT(FRAME_, CONTEXT_) \ { \ if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CONTEXT) \ diff --git a/reactos/lib/pseh/pseh.rbuild b/reactos/lib/pseh/pseh.rbuild index 39ddc903861..d1173209df5 100644 --- a/reactos/lib/pseh/pseh.rbuild +++ b/reactos/lib/pseh/pseh.rbuild @@ -11,5 +11,10 @@ framebased.S + + + framebased.S + + framebased.c From f6d9983a3f35d1bd627b92aabfa9ee86779bc6ca Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 10:57:44 +0000 Subject: [PATCH 025/388] -Fix definitions of IsBadHugeReadPtr, IsBadHugeWritePtr, IsBadReadPtr, IsBadStringPtrA, IsBadStringPtrW, IsBadWritePtr and SetProcessWorkingSetSize -Define CONTEXT and XMM_SAVE_AREA32, taken from WINE svn path=/branches/ros-amd64-bringup/; revision=34769 --- reactos/include/ndk/amd64/ketypes.h | 4 +- reactos/include/psdk/winbase.h | 18 ++-- reactos/include/psdk/windef.h | 25 +++-- reactos/include/psdk/winnt.h | 144 +++++++++++++++++++++++++--- 4 files changed, 163 insertions(+), 28 deletions(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 545ee521a2a..1adb6880c9a 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -16,8 +16,8 @@ Author: --*/ -#ifndef _I386_KETYPES_H -#define _I386_KETYPES_H +#ifndef _IAMD64_KETYPES_H +#define _IAMD64_KETYPES_H // // Dependencies diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index 5399f93c189..0fdc0035a7c 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -1712,10 +1712,10 @@ LONG WINAPI InterlockedExchange(IN OUT LONG volatile *,LONG); #if defined(_WIN64) /* PVOID WINAPI InterlockedExchangePointer(PVOID*,PVOID); */ #define InterlockedExchangePointer(t,v) \ - (PVOID)InterlockedExchange64((LONGLONG*)(t),(LONGLONG)(v)) + (PVOID)_InterlockedExchange64((LONGLONG*)(t),(LONGLONG)(v)) /* PVOID WINAPI InterlockedCompareExchangePointer(PVOID*,PVOID,PVOID); */ #define InterlockedCompareExchangePointer(d,e,c) \ - (PVOID)InterlockedCompareExchange64((LONGLONG*)(d),(LONGLONG)(e),(LONGLONG)(c)) + (PVOID)_InterlockedCompareExchange64((LONGLONG*)(d),(LONGLONG)(e),(LONGLONG)(c)) #else /* PVOID WINAPI InterlockedExchangePointer(PVOID*,PVOID); */ #define InterlockedExchangePointer(t,v) \ @@ -1735,12 +1735,12 @@ PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY); #endif #endif /* __INTERLOCKED_DECLARED */ BOOL WINAPI IsBadCodePtr(FARPROC); -BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT); -BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT); -BOOL WINAPI IsBadReadPtr(PCVOID,UINT); -BOOL WINAPI IsBadStringPtrA(LPCSTR,UINT); -BOOL WINAPI IsBadStringPtrW(LPCWSTR,UINT); -BOOL WINAPI IsBadWritePtr(PVOID,UINT); +BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT_PTR); +BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT_PTR); +BOOL WINAPI IsBadReadPtr(PCVOID,UINT_PTR); +BOOL WINAPI IsBadStringPtrA(LPCSTR,UINT_PTR); +BOOL WINAPI IsBadStringPtrW(LPCWSTR,UINT_PTR); +BOOL WINAPI IsBadWritePtr(PVOID,UINT_PTR); BOOL WINAPI IsDebuggerPresent(void); #if (_WIN32_WINNT >= 0x0501) BOOL WINAPI IsProcessInJob(HANDLE,HANDLE,PBOOL); @@ -1994,7 +1994,7 @@ BOOL WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,P BOOL WINAPI SetProcessAffinityMask(HANDLE,DWORD); BOOL WINAPI SetProcessPriorityBoost(HANDLE,BOOL); BOOL WINAPI SetProcessShutdownParameters(DWORD,DWORD); -BOOL WINAPI SetProcessWorkingSetSize(HANDLE,DWORD,DWORD); +BOOL WINAPI SetProcessWorkingSetSize(HANDLE,SIZE_T,SIZE_T); #if (_WIN32_WINNT >= 0x0600) VOID WINAPI SetSecurityAccessMask(SECURITY_INFORMATION,LPDWORD); #endif diff --git a/reactos/include/psdk/windef.h b/reactos/include/psdk/windef.h index ca5f61a29ca..bd9fcaf69ce 100644 --- a/reactos/include/psdk/windef.h +++ b/reactos/include/psdk/windef.h @@ -123,14 +123,27 @@ extern "C" { #define pascal __stdcall #define _pascal __stdcall #define __pascal __stdcall -#define PASCAL _pascal + #define CDECL _cdecl +#define PASCAL _pascal + +#if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED) #define STDCALL __stdcall -#define WINAPI __stdcall -#define WINAPIV __cdecl -#define APIENTRY __stdcall -#define CALLBACK __stdcall -#define APIPRIVATE __stdcall +#define CALLBACK __stdcall +#define WINAPI __stdcall +#define WINAPIV __cdecl +#define APIENTRY WINAPI +#define APIPRIVATE __stdcall +#define PASCAL __stdcall +#else +#define STDCALL +#define CALLBACK +#define WINAPI +#define WINAPIV +#define APIENTRY WINAPI +#define APIPRIVATE +#define PASCAL pascal +#endif #define DECLSPEC_IMPORT __declspec(dllimport) #define DECLSPEC_EXPORT __declspec(dllexport) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 968da0d9cf3..3309be48014 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -100,15 +100,6 @@ extern "C" { #endif #endif -/* i386 context definitions */ -#ifdef __i386__ - -#define EXCEPTION_READ_FAULT 0 -#define EXCEPTION_WRITE_FAULT 1 -#define EXCEPTION_EXECUTE_FAULT 8 - -#endif /* __i386__ */ - #ifndef VOID #define VOID void #endif @@ -1358,7 +1349,7 @@ typedef enum #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 -#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD_PTR)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader)) +#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((ULONG_PTR)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader)) #define IMAGE_DIRECTORY_ENTRY_EXPORT 0 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 @@ -2022,7 +2013,7 @@ typedef struct _ACL_SIZE_INFORMATION { } ACL_SIZE_INFORMATION; /* FIXME: add more machines */ -#if defined(_X86_) || defined(unix) && !defined(__PowerPC__) +#if defined(__i386__) && !defined(__PowerPC__) #define SIZE_OF_80387_REGISTERS 80 #define CONTEXT_i386 0x10000 #define CONTEXT_i486 0x10000 @@ -2034,6 +2025,11 @@ typedef struct _ACL_SIZE_INFORMATION { #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L) #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS) #define MAXIMUM_SUPPORTED_EXTENSION 512 + +#define EXCEPTION_READ_FAULT 0 +#define EXCEPTION_WRITE_FAULT 1 +#define EXCEPTION_EXECUTE_FAULT 8 + typedef struct _FLOATING_SAVE_AREA { DWORD ControlWord; DWORD StatusWord; @@ -2072,6 +2068,132 @@ typedef struct _CONTEXT { DWORD SegSs; BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION]; } CONTEXT; +#elif defined(__x86_64__) +#define CONTEXT_AMD64 0x00100000 + +#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x0001) +#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x0002) +#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x0004) +#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x0008L) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x0010L) +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) +#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS) + +#define EXCEPTION_READ_FAULT 0 +#define EXCEPTION_WRITE_FAULT 1 +#define EXCEPTION_EXECUTE_FAULT 8 + +typedef struct DECLSPEC_ALIGN(16) _M128A { + ULONGLONG Low; + LONGLONG High; +} M128A, *PM128A; + +typedef struct _XMM_SAVE_AREA32 { + WORD ControlWord; + WORD StatusWord; + BYTE TagWord; + BYTE Reserved1; + WORD ErrorOpcode; + DWORD ErrorOffset; + WORD ErrorSelector; + WORD Reserved2; + DWORD DataOffset; + WORD DataSelector; + WORD Reserved3; + DWORD MxCsr; + DWORD MxCsr_Mask; + M128A FloatRegisters[8]; + M128A XmmRegisters[16]; + BYTE Reserved4[96]; +} XMM_SAVE_AREA32, *PXMM_SAVE_AREA32; + +typedef struct DECLSPEC_ALIGN(16) _CONTEXT { + DWORD64 P1Home; + DWORD64 P2Home; + DWORD64 P3Home; + DWORD64 P4Home; + DWORD64 P5Home; + DWORD64 P6Home; + + /* Control flags */ + DWORD ContextFlags; + DWORD MxCsr; + + /* Segment */ + WORD SegCs; + WORD SegDs; + WORD SegEs; + WORD SegFs; + WORD SegGs; + WORD SegSs; + DWORD EFlags; + + /* Debug */ + DWORD64 Dr0; + DWORD64 Dr1; + DWORD64 Dr2; + DWORD64 Dr3; + DWORD64 Dr6; + DWORD64 Dr7; + + /* Integer */ + DWORD64 Rax; + DWORD64 Rcx; + DWORD64 Rdx; + DWORD64 Rbx; + DWORD64 Rsp; + DWORD64 Rbp; + DWORD64 Rsi; + DWORD64 Rdi; + DWORD64 R8; + DWORD64 R9; + DWORD64 R10; + DWORD64 R11; + DWORD64 R12; + DWORD64 R13; + DWORD64 R14; + DWORD64 R15; + + /* Counter */ + DWORD64 Rip; + + /* Floating point */ + union { + XMM_SAVE_AREA32 FltSave; + struct { + M128A Header[2]; + M128A Legacy[8]; + M128A Xmm0; + M128A Xmm1; + M128A Xmm2; + M128A Xmm3; + M128A Xmm4; + M128A Xmm5; + M128A Xmm6; + M128A Xmm7; + M128A Xmm8; + M128A Xmm9; + M128A Xmm10; + M128A Xmm11; + M128A Xmm12; + M128A Xmm13; + M128A Xmm14; + M128A Xmm15; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + + /* Vector */ + M128A VectorRegister[26]; + DWORD64 VectorControl; + + /* Debug control */ + DWORD64 DebugControl; + DWORD64 LastBranchToRip; + DWORD64 LastBranchFromRip; + DWORD64 LastExceptionToRip; + DWORD64 LastExceptionFromRip; +} CONTEXT; + #elif defined(_PPC_) #define CONTEXT_CONTROL 1L #define CONTEXT_FLOATING_POINT 2L From d99afa913fb878f6ccaedc1f9d091985aab20ff0 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 11:09:07 +0000 Subject: [PATCH 026/388] Fix some compiler warnings. Implement InitializeCriticalSectionEx Stub TermsrvAppInstallMode and SetTermsrvAppInstallMode. Lazy port of BasepInitializeContext. Lazy ports of thread and fiber startup code, probably will not work. svn path=/branches/ros-amd64-bringup/; revision=34770 --- reactos/dll/win32/kernel32/debug/debugger.c | 4 +- reactos/dll/win32/kernel32/except/except.c | 16 +- reactos/dll/win32/kernel32/file/lfile.c | 2 +- reactos/dll/win32/kernel32/file/rw.c | 2 +- reactos/dll/win32/kernel32/kernel32.def | 1033 ----------------- reactos/dll/win32/kernel32/kernel32.rbuild | 11 +- reactos/dll/win32/kernel32/kernel32.spec | 1017 ++++++++++++++++ reactos/dll/win32/kernel32/misc/dllmain.c | 1 + reactos/dll/win32/kernel32/misc/handle.c | 2 +- reactos/dll/win32/kernel32/misc/stubs.c | 12 + reactos/dll/win32/kernel32/misc/utils.c | 44 +- reactos/dll/win32/kernel32/process/session.c | 2 +- reactos/dll/win32/kernel32/synch/critical.c | 10 + .../dll/win32/kernel32/thread/amd64/fiber.S | 124 ++ .../dll/win32/kernel32/thread/amd64/thread.S | 32 + reactos/dll/win32/kernel32/thread/fiber.c | 7 + reactos/dll/win32/kernel32/thread/thread.c | 5 + 17 files changed, 1279 insertions(+), 1045 deletions(-) delete mode 100644 reactos/dll/win32/kernel32/kernel32.def create mode 100644 reactos/dll/win32/kernel32/kernel32.spec create mode 100644 reactos/dll/win32/kernel32/thread/amd64/fiber.S create mode 100644 reactos/dll/win32/kernel32/thread/amd64/thread.S diff --git a/reactos/dll/win32/kernel32/debug/debugger.c b/reactos/dll/win32/kernel32/debug/debugger.c index 611acf217e2..84f81fcc47b 100644 --- a/reactos/dll/win32/kernel32/debug/debugger.c +++ b/reactos/dll/win32/kernel32/debug/debugger.c @@ -232,11 +232,11 @@ ProcessIdToHandle(IN DWORD dwProcessId) CLIENT_ID ClientId; /* If we don't have a PID, look it up */ - if (dwProcessId == -1) dwProcessId = (DWORD)CsrGetProcessId(); + if (dwProcessId == -1) dwProcessId = (ULONG_PTR)CsrGetProcessId(); /* Open a handle to the process */ ClientId.UniqueThread = NULL; - ClientId.UniqueProcess = (HANDLE)dwProcessId; + ClientId.UniqueProcess = (HANDLE)(ULONG_PTR)dwProcessId; InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); Status = NtOpenProcess(&Handle, PROCESS_ALL_ACCESS, diff --git a/reactos/dll/win32/kernel32/except/except.c b/reactos/dll/win32/kernel32/except/except.c index 94409847a00..7cd8a3e6f25 100644 --- a/reactos/dll/win32/kernel32/except/except.c +++ b/reactos/dll/win32/kernel32/except/except.c @@ -139,6 +139,18 @@ _dump_context(PCONTEXT pc) pc->Ebp, pc->Esi, pc->Esp); DbgPrint("EDI: %.8x EFLAGS: %.8x\n", pc->Edi, pc->EFlags); } +#elif defined(_M_AMD64) +_dump_context(PCONTEXT pc) +{ + DbgPrint("CS:EIP %x:%I64x\n", pc->SegCs&0xffff, pc->Rip ); + DbgPrint("DS %x ES %x FS %x GS %x\n", pc->SegDs&0xffff, pc->SegEs&0xffff, + pc->SegFs&0xffff, pc->SegGs&0xfff); + DbgPrint("RAX: %I64x RBX: %I64x RCX: %I64x RDI: %I64x\n", pc->Rax, pc->Rbx, pc->Rcx, pc->Rdi); + DbgPrint("RDX: %I64x RBP: %I64x RSI: %I64x RSP: %I64x\n", pc->Rdx, pc->Rbp, pc->Rsi, pc->Rsp); + DbgPrint("R8: %I64x R9: %I64x R10: %I64x R11: %I64x\n", pc->R8, pc->R9, pc->R10, pc->R11); + DbgPrint("R12: %I64x R13: %I64x R14: %I64x R15: %I64x\n", pc->R12, pc->R13, pc->R14, pc->R15); + DbgPrint("EFLAGS: %.8x\n", pc->EFlags); +} #else #warning Unknown architecture static VOID @@ -260,7 +272,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo) if ((GetErrorMode() & SEM_NOGPFAULTERRORBOX) == 0) { -#ifdef _X86_ +#ifdef __i386__ PULONG Frame; #endif PVOID StartAddr; @@ -278,7 +290,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo) ExceptionInfo->ExceptionRecord->ExceptionAddress, _module_name_from_addr(ExceptionInfo->ExceptionRecord->ExceptionAddress, &StartAddr, szMod, sizeof(szMod))); _dump_context ( ExceptionInfo->ContextRecord ); -#ifdef _X86_ +#ifdef __i386__ DbgPrint("Frames:\n"); _SEH_TRY { diff --git a/reactos/dll/win32/kernel32/file/lfile.c b/reactos/dll/win32/kernel32/file/lfile.c index d24e2706bd2..94ed4504215 100644 --- a/reactos/dll/win32/kernel32/file/lfile.c +++ b/reactos/dll/win32/kernel32/file/lfile.c @@ -28,7 +28,7 @@ _hread( DWORD NumberOfBytesRead; if ( !ReadFile( - (HANDLE) hFile, + (HANDLE)(ULONG_PTR) hFile, (LPVOID) lpBuffer, (DWORD) lBytes, & NumberOfBytesRead, diff --git a/reactos/dll/win32/kernel32/file/rw.c b/reactos/dll/win32/kernel32/file/rw.c index f570e571614..fe358183586 100644 --- a/reactos/dll/win32/kernel32/file/rw.c +++ b/reactos/dll/win32/kernel32/file/rw.c @@ -37,7 +37,7 @@ WriteFile(IN HANDLE hFile, *lpNumberOfBytesWritten = 0; } - if (IsConsoleHandle(hFile)) + if (IsConsoleHandle((ULONG_PTR)hFile)) { return WriteConsoleA(hFile, lpBuffer, diff --git a/reactos/dll/win32/kernel32/kernel32.def b/reactos/dll/win32/kernel32/kernel32.def deleted file mode 100644 index 9b444c2d930..00000000000 --- a/reactos/dll/win32/kernel32/kernel32.def +++ /dev/null @@ -1,1033 +0,0 @@ -; -; kernel32.def -; -; Exports for KERNEL32 DLL -; -; Copyright (C) 1996 Free Software Foundation, Inc. -; -; Author: Scott Christley -; Date: 1996 -; -; This file is part of the Windows32 API Library. -; -; This library is free software; you can redistribute it and/or -; modify it under the terms of the GNU Library General Public -; License as published by the Free Software Foundation; either -; version 2 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 -; Library General Public License for more details. -; -; If you are interested in a warranty or support for this source code, -; contact Scott Christley for more information. -; -; You should have received a copy of the GNU Library General Public -; License along with this library; see the file COPYING.LIB. -; If not, write to the Free Software Foundation, -; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -; -LIBRARY KERNEL32.DLL -EXPORTS -AcquireSRWLockExclusive@4=NTDLL.RtlAcquireSRWLockExclusive -AcquireSRWLockShared@4=NTDLL.RtlAcquireSRWLockShared -ActivateActCtx@8 -AddAtomA@4 -AddAtomW@4 -AddConsoleAliasA@12 -AddConsoleAliasW@12 -;AddLocalAlternateComputerNameA -;AddLocalAlternateComputerNameW -AddRefActCtx@4 -AddVectoredExceptionHandler@8=NTDLL.RtlAddVectoredExceptionHandler -AllocateUserPhysicalPages@12 -AllocConsole@0 -AreFileApisANSI@0 -AssignProcessToJobObject@8 -AttachConsole@4 -BackupRead@28 -BackupSeek@24 -BackupWrite@28 -BaseAttachCompleteThunk@0 -BaseCheckAppcompatCache@16 -;BaseCleanupAppcompatCache -;BaseCleanupAppcompatCacheSupport -BaseDumpAppcompatCache@0 -BaseFlushAppcompatCache@0 -;BaseInitAppcompatCache -;BaseInitAppcompatCacheSupport -BaseProcessInitPostImport@0 -BaseQueryModuleData@20 -BaseUpdateAppcompatCache@12 -Beep@8 -BeginUpdateResourceA@8 -BeginUpdateResourceW@8 -BindIoCompletionCallback@12 -BuildCommDCBA@8 -BuildCommDCBAndTimeoutsA@12 -BuildCommDCBAndTimeoutsW@12 -BuildCommDCBW@8 -CallNamedPipeA@28 -CallNamedPipeW@28 -CancelDeviceWakeupRequest@4 -CancelIo@4 -CancelIoEx@8 -CancelSynchronousIo@4 -CancelTimerQueueTimer@8 -CancelWaitableTimer@4 -ChangeTimerQueueTimer@16 -CheckNameLegalDOS8Dot3A@20 -CheckNameLegalDOS8Dot3W@20 -CheckRemoteDebuggerPresent@8 -ClearCommBreak@4 -ClearCommError@12 -CloseConsoleHandle@4 -CloseHandle@4 -CloseProfileUserMapping@0 -CmdBatNotification@4 -CommConfigDialogA@12 -CommConfigDialogW@12 -CompareFileTime@8 -CompareStringA@24 -CompareStringW@24 -ConnectNamedPipe@8 -ConsoleMenuControl@12 -ContinueDebugEvent@12 -ConvertDefaultLocale@4 -ConvertFiberToThread@0 -ConvertThreadToFiber@4 -CopyFileA@12 -CopyFileExA@24 -CopyFileExW@24 -CopyFileW@12 -CopyLZFile@8 -CreateActCtxA@4 -CreateActCtxW@4 -CreateConsoleScreenBuffer@20 -CreateDirectoryA@8 -CreateDirectoryExA@12 -CreateDirectoryExW@12 -CreateDirectoryW@8 -CreateEventA@16 -CreateEventW@16 -CreateEventExA@16 -CreateEventExW@16 -CreateFiber@12 -CreateFiberEx@20 -CreateFileA@28 -CreateFileMappingA@24 -CreateFileMappingW@24 -CreateFileW@28 -CreateHardLinkA@12 -CreateHardLinkW@12 -CreateIoCompletionPort@16 -CreateJobObjectA@8 -CreateJobObjectW@8 -CreateJobSet@12 -CreateMailslotA@16 -CreateMailslotW@16 -CreateMemoryResourceNotification@4 -CreateMutexA@12 -CreateMutexW@12 -CreateMutexExA@16 -CreateMutexExW@16 -CreateNamedPipeA@32 -CreateNamedPipeW@32 -CreateNlsSecurityDescriptor@12 -CreatePipe@16 -CreateProcessA@40 -CreateProcessInternalA@48 -CreateProcessInternalW@48 -CreateProcessW@40 -CreateRemoteThread@28 -CreateSemaphoreA@16 -CreateSemaphoreW@16 -CreateSemaphoreExA@24 -CreateSemaphoreExW@24 -CreateSocketHandle@0 -CreateSymbolicLinkA@12 -CreateSymbolicLinkW@12 -CreateTapePartition@16 -CreateThread@24 -CreateTimerQueue@0 -CreateTimerQueueTimer@28 -CreateToolhelp32Snapshot@8 -CreateVirtualBuffer@12 -CreateWaitableTimerA@12 -CreateWaitableTimerW@12 -CreateWaitableTimerExA@16 -CreateWaitableTimerExW@16 -DeactivateActCtx@8 -DebugActiveProcess@4 -DebugActiveProcessStop@4 -DebugBreak@0=NTDLL.DbgBreakPoint -DebugBreakProcess@4 -DebugSetProcessKillOnExit@4 -DecodePointer@4=NTDLL.RtlDecodePointer -DefineDosDeviceA@12 -DefineDosDeviceW@12 -DelayLoadFailureHook@8 -DeleteAtom@4 -DeleteCriticalSection@4=NTDLL.RtlDeleteCriticalSection -DeleteFiber@4 -DeleteFileA@4 -DeleteFileW@4 -DeleteTimerQueue@4 -DeleteTimerQueueEx@8 -DeleteTimerQueueTimer@12 -DeleteVolumeMountPointA@4 -DeleteVolumeMountPointW@4 -DeviceIoControl@32 -DisableThreadLibraryCalls@4 -DisconnectNamedPipe@4 -DnsHostnameToComputerNameA@12 -DnsHostnameToComputerNameW@12 -DosDateTimeToFileTime@12 -DosPathToSessionPathA@12 -DosPathToSessionPathW@12 -DuplicateConsoleHandle@16 -DuplicateHandle@28 -EncodePointer@4=NTDLL.RtlEncodePointer -EndUpdateResourceA@8 -EndUpdateResourceW@8 -EnterCriticalSection@4=NTDLL.RtlEnterCriticalSection -EnumCalendarInfoA@16 -EnumCalendarInfoExA@16 -EnumCalendarInfoExW@16 -EnumCalendarInfoW@16 -EnumDateFormatsA@12 -EnumDateFormatsExA@12 -EnumDateFormatsExW@12 -EnumDateFormatsW@12 -EnumLanguageGroupLocalesA@16 -EnumLanguageGroupLocalesW@16 -EnumResourceLanguagesA@20 -EnumResourceLanguagesW@20 -EnumResourceNamesA@16 -EnumResourceNamesW@16 -EnumResourceTypesA@12 -EnumResourceTypesW@12 -EnumSystemCodePagesA@8 -EnumSystemCodePagesW@8 -EnumSystemGeoID@12 -EnumSystemLanguageGroupsA@12 -EnumSystemLanguageGroupsW@12 -EnumSystemLocalesA@8 -EnumSystemLocalesW@8 -EnumTimeFormatsA@12 -EnumTimeFormatsW@12 -EnumUILanguagesA@12 -EnumUILanguagesW@12 -;EnumerateLocalComputerNamesA -;EnumerateLocalComputerNamesW -EraseTape@12 -EscapeCommFunction@8 -ExitProcess@4 -ExitThread@4 -ExitVDM@8 -ExpandEnvironmentStringsA@12 -ExpandEnvironmentStringsW@12 -ExpungeConsoleCommandHistoryA@4 -ExpungeConsoleCommandHistoryW@4 -ExtendVirtualBuffer@8 -FatalAppExitA@8 -FatalAppExitW@8 -FatalExit@4 -FileTimeToDosDateTime@12 -FileTimeToLocalFileTime@8 -FileTimeToSystemTime@8 -FillConsoleOutputAttribute@20 -FillConsoleOutputCharacterA@20 -FillConsoleOutputCharacterW@20 -FindActCtxSectionGuid@20 -FindActCtxSectionStringA@20 -FindActCtxSectionStringW@20 -FindAtomA@4 -FindAtomW@4 -FindClose@4 -FindCloseChangeNotification@4 -FindFirstChangeNotificationA@12 -FindFirstChangeNotificationW@12 -FindFirstFileA@8 -FindFirstFileExA@24 -FindFirstFileExW@24 -FindFirstFileW@8 -FindFirstStreamW@16 -FindNextChangeNotification@4 -FindNextFileA@8 -FindNextFileW@8 -FindNextStreamW@8 -FindFirstVolumeA@8 -FindFirstVolumeMountPointA@12 -FindFirstVolumeMountPointW@12 -FindFirstVolumeW@8 -FindNextVolumeA@12 -FindNextVolumeMountPointA@12 -FindNextVolumeMountPointW@12 -FindNextVolumeW@12 -FindResourceA@12 -FindResourceExA@16 -FindResourceExW@16 -FindResourceW@12 -FindVolumeClose@4 -FindVolumeMountPointClose@4 -;FlsAlloc@4 ;new for 2003 -;FlsFree@4 ;new for 2003 -;FlsGetValue@4 ;new for 2003 -;FlsSetValue@8 ;new for 2003 -FlushConsoleInputBuffer@4 -FlushFileBuffers@4 -FlushInstructionCache@12 -FlushViewOfFile@8 -FoldStringA@20 -FoldStringW@20 -FormatMessageA@28 -FormatMessageW@28 -FreeConsole@0 -FreeEnvironmentStringsA@4 -FreeEnvironmentStringsW@4 -FreeLibrary@4 -FreeLibraryAndExitThread@8 -FreeResource@4 -FreeUserPhysicalPages@12 -FreeVirtualBuffer@4 -GenerateConsoleCtrlEvent@8 -GetACP@0 -GetApplicationRecoveryCallback@20 -GetApplicationRestart@16 -GetAtomNameA@12 -GetAtomNameW@12 -GetBinaryType@8=GetBinaryTypeA@8 -GetBinaryTypeA@8 -GetBinaryTypeW@8 -GetCPFileNameFromRegistry@12 -GetCPInfo@8 -GetCPInfoExA@12 -GetCPInfoExW@12 -GetCalendarInfoA@24 -GetCalendarInfoW@24 -GetCommConfig@12 -GetCommMask@8 -GetCommModemStatus@8 -GetCommProperties@8 -GetCommState@8 -GetCommTimeouts@8 -GetCommandLineA@0 -GetCommandLineW@0 -;GetComPlusPackageInstallStatus -GetCompressedFileSizeA@8 -GetCompressedFileSizeW@8 -GetComputerNameA@8 -GetComputerNameExA@12 -GetComputerNameExW@12 -GetComputerNameW@8 -GetConsoleAliasA@16 -GetConsoleAliasExesA@8 -GetConsoleAliasExesLengthA@0 -GetConsoleAliasExesLengthW@0 -GetConsoleAliasExesW@8 -GetConsoleAliasW@16 -GetConsoleAliasesA@12 -GetConsoleAliasesLengthA@4 -GetConsoleAliasesLengthW@4 -GetConsoleAliasesW@12 -;GetConsoleCharType -GetConsoleCP@0 -GetConsoleCommandHistoryA@12 -GetConsoleCommandHistoryLengthA@4 -GetConsoleCommandHistoryLengthW@4 -GetConsoleCommandHistoryW@12 -GetConsoleCursorInfo@8 -;GetConsoleCursorMode -GetConsoleDisplayMode@4 -GetConsoleFontInfo@16 -GetConsoleFontSize@8 -GetConsoleHardwareState@12 -GetConsoleInputExeNameA@8 -GetConsoleInputExeNameW@8 -GetConsoleInputWaitHandle@0 -GetConsoleKeyboardLayoutNameA@4 -GetConsoleKeyboardLayoutNameW@4 -GetConsoleMode@8 -;GetConsoleNlsMode -GetConsoleOutputCP@0 -GetConsoleProcessList@8 -GetConsoleScreenBufferInfo@8 -GetConsoleSelectionInfo@4 -GetConsoleTitleA@8 -GetConsoleTitleW@8 -GetConsoleWindow@0 -GetCurrencyFormatA@24 -GetCurrencyFormatW@24 -GetCurrentActCtx@4 -GetCurrentConsoleFont@12 -GetCurrentDirectoryA@8 -GetCurrentDirectoryW@8 -GetCurrentProcess@0 -GetCurrentProcessId@0 -GetCurrentThread@0 -GetCurrentThreadId@0 -GetDateFormatA@24 -GetDateFormatW@24 -GetDefaultCommConfigA@12 -GetDefaultCommConfigW@12 -;GetDefaultSortkeySize -GetDevicePowerState@8 -GetDiskFreeSpaceA@20 -GetDiskFreeSpaceW@20 -GetDiskFreeSpaceExA@16 -GetDiskFreeSpaceExW@16 -GetDllDirectoryA@8 -GetDllDirectoryW@8 -GetDriveTypeA@4 -GetDriveTypeW@4 -GetEnvironmentStrings@0 -GetEnvironmentStringsA=GetEnvironmentStrings@0 -GetEnvironmentStringsW@0 -GetEnvironmentVariableA@12 -GetEnvironmentVariableW@12 -GetExitCodeProcess@8 -GetExitCodeThread@8 -GetExpandedNameA@8 -GetExpandedNameW@8 -GetFileAttributesA@4 -GetFileAttributesW@4 -GetFileAttributesByHandle@12 -GetFileAttributesExA@12 -GetFileAttributesExW@12 -GetFileBandwidthReservation@24 -GetFileInformationByHandle@8 -GetFileSize@8 -GetFileSizeEx@8 -GetFileTime@16 -GetFileType@4 -GetFinalPathNameByHandleA@16 -GetFinalPathNameByHandleW@16 -GetFirmwareEnvironmentVariableA@16 -GetFirmwareEnvironmentVariableW@16 -GetFullPathNameA@16 -GetFullPathNameW@16 -GetGeoInfoA@20 -GetGeoInfoW@20 -GetHandleContext@4 -GetHandleInformation@8 -GetLargePageMinimum@0 -GetLargestConsoleWindowSize@4 -GetLastError@0 -;GetLinguistLangSize -GetLocalTime@4 -GetLocaleInfoA@16 -GetLocaleInfoW@16 -GetLocaleInfoEx@16 -GetLogicalDriveStringsA@8 -GetLogicalDriveStringsW@8 -GetLogicalDrives@0 -GetLongPathNameA@12 -GetLongPathNameW@12 -GetMailslotInfo@20 -GetModuleFileNameA@12 -GetModuleFileNameW@12 -GetModuleHandleA@4 -GetModuleHandleExA@12 -GetModuleHandleExW@12 -GetModuleHandleW@4 -GetNamedPipeHandleStateA@28 -GetNamedPipeHandleStateW@28 -GetNamedPipeInfo@20 -GetNativeSystemInfo@4 -GetNextVDMCommand@4 -GetNlsSectionName@24 -GetNumaHighestNodeNumber@4 -GetNumaNodeProcessorMask@8 -;GetNumaProcessorMap -GetNumaProcessorNode@8 -GetNumberFormatA@24 -GetNumberFormatW@24 -GetNumberOfConsoleFonts@0 -GetNumberOfConsoleInputEvents@8 -GetNumberOfConsoleMouseButtons@4 -GetOEMCP@0 -GetOverlappedResult@16 -GetPriorityClass@4 -GetPrivateProfileIntA@16 -GetPrivateProfileIntW@16 -GetPrivateProfileSectionA@16 -GetPrivateProfileSectionNamesA@12 -GetPrivateProfileSectionNamesW@12 -GetPrivateProfileSectionW@16 -GetPrivateProfileStringA@24 -GetPrivateProfileStringW@24 -GetPrivateProfileStructA@20 -GetPrivateProfileStructW@20 -GetProcAddress@8 -GetProcessAffinityMask@12 -GetProcessHandleCount@8 -GetProcessHeap@0 -GetProcessHeaps@8 -GetProcessId@4 -GetProcessIdOfThread@4 -GetProcessIoCounters@8 -GetProcessPriorityBoost@8 -GetProcessShutdownParameters@8 -GetProcessTimes@20 -GetProcessVersion@4 -GetProcessWorkingSetSize@12 -GetProfileIntA@12 -GetProfileIntW@12 -GetProfileSectionA@12 -GetProfileSectionW@12 -GetProfileStringA@20 -GetProfileStringW@20 -GetQueuedCompletionStatus@20 -GetShortPathNameA@12 -GetShortPathNameW@12 -GetStartupInfoA@4 -GetStartupInfoW@4 -GetStdHandle@4 -GetStringTypeA@20 -GetStringTypeExA@20 -GetStringTypeExW@20 -GetStringTypeW@16 -GetSystemDefaultLCID@0 -GetSystemDefaultLangID@0 -GetSystemDefaultUILanguage@0 -GetSystemDirectoryA@8 -GetSystemDirectoryW@8 -GetSystemInfo@4 -GetSystemPowerStatus@4 -GetSystemRegistryQuota@8 -GetSystemTime@4 -GetSystemTimeAdjustment@12 -GetSystemTimeAsFileTime@4 -GetSystemTimes@12 -GetSystemWow64DirectoryA@8 -GetSystemWow64DirectoryW@8 -GetSystemWindowsDirectoryA@8 -GetSystemWindowsDirectoryW@8 -GetTapeParameters@16 -GetTapePosition@20 -GetTapeStatus@4 -GetTempFileNameA@16 -GetTempFileNameW@16 -GetTempPathA@8 -GetTempPathW@8 -GetThreadContext@8 -GetThreadId@4 -GetThreadIOPendingFlag@8 -GetThreadLocale@0 -GetThreadPriority@4 -GetThreadPriorityBoost@8 -GetThreadSelectorEntry@12 -GetThreadTimes@20 -GetTickCount@0 -GetTickCount64@0 -GetTimeFormatA@24 -GetTimeFormatW@24 -GetTimeZoneInformation@4 -GetUserDefaultLCID@0 -GetUserDefaultLangID@0 -GetUserDefaultUILanguage@0 -GetUserGeoID@4 -GetVDMCurrentDirectories@8 -GetVersion@0 -GetVersionExA@4 -GetVersionExW@4 -GetVolumeInformationA@32 -GetVolumeInformationW@32 -GetVolumeNameForVolumeMountPointA@12 -GetVolumeNameForVolumeMountPointW@12 -GetVolumePathNameA@12 -GetVolumePathNameW@12 -GetVolumePathNamesForVolumeNameA@16 -GetVolumePathNamesForVolumeNameW@16 -GetWindowsDirectoryA@8 -GetWindowsDirectoryW@8 -GetWriteWatch@24 -GlobalAddAtomA@4 -GlobalAddAtomW@4 -GlobalAlloc@8 -GlobalCompact@4 -GlobalDeleteAtom@4 -GlobalFindAtomA@4 -GlobalFindAtomW@4 -GlobalFix@4 -GlobalFlags@4 -GlobalFree@4 -GlobalGetAtomNameA@12 -GlobalGetAtomNameW@12 -GlobalHandle@4 -GlobalLock@4 -GlobalMemoryStatus@4 -GlobalMemoryStatusEx@4 -GlobalReAlloc@12 -GlobalSize@4 -GlobalUnWire@4 -GlobalUnfix@4 -GlobalUnlock@4 -GlobalWire@4 -Heap32First@12 -Heap32ListFirst@8 -Heap32ListNext@8 -Heap32Next@4 -HeapAlloc@12=NTDLL.RtlAllocateHeap -HeapCompact@8 -HeapCreate@12 -HeapCreateTagsW@16 -HeapDestroy@4 -HeapExtend@16 -HeapFree@12=NTDLL.RtlFreeHeap -HeapLock@4 -HeapQueryInformation@20 -HeapQueryTagW@20 -HeapReAlloc@16=NTDLL.RtlReAllocateHeap -HeapSetInformation@16 -HeapSize@12=NTDLL.RtlSizeHeap -HeapSummary@12 -HeapUnlock@4 -HeapUsage@20 -HeapValidate@12 -HeapWalk@8 -InitAtomTable@4 -InitializeConditionVariable@4=NTDLL.RtlInitializeConditionVariable -InitializeCriticalSection@4 -InitializeCriticalSectionAndSpinCount@8 -InitializeSListHead@4=NTDLL.RtlInitializeSListHead -InitializeSRWLock@4=NTDLL.RtlInitializeSRWLock -InterlockedCompareExchange@12 -InterlockedDecrement@4 -InterlockedExchange@8 -InterlockedExchangeAdd@8 -InterlockedFlushSList@4=NTDLL.RtlInterlockedFlushSList -InterlockedIncrement@4 -InterlockedPopEntrySList@4=NTDLL.RtlInterlockedPopEntrySList -InterlockedPushEntrySList@8=NTDLL.RtlInterlockedPushEntrySList -InvalidateConsoleDIBits@8 -IsBadCodePtr@4 -IsBadHugeReadPtr@8 -IsBadHugeWritePtr@8 -IsBadReadPtr@8 -IsBadStringPtrA@8 -IsBadStringPtrW@8 -IsBadWritePtr@8 -IsDBCSLeadByte@4 -IsDBCSLeadByteEx@8 -IsDebuggerPresent@0 -IsProcessInJob@12 -IsProcessorFeaturePresent@4 -IsSystemResumeAutomatic@0 -IsThreadAFiber@0 -IsValidCodePage@4 -IsValidLanguageGroup@8 -IsValidLocale@8 -IsValidUILanguage@4 -IsWow64Process@8 -LCMapStringA@24 -LCMapStringW@24 -LeaveCriticalSection@4=NTDLL.RtlLeaveCriticalSection -LoadLibraryA@4 -LoadLibraryExA@12 -LoadLibraryExW@12 -LoadLibraryW@4 -LoadModule@8 -LoadResource@8 -LocalAlloc@8 -LocalCompact@4 -LocalFileTimeToFileTime@8 -LocalFlags@4 -LocalFree@4 -LocalHandle@4 -LocalLock@4 -LocalReAlloc@12 -LocalShrink@8 -LocalSize@4 -LocalUnlock@4 -LockFile@20 -LockFileEx@24 -LockResource@4 -LZClose@4 -;LZCloseFile -LZCopy@8 -;LZCreateFileW -LZDone@0 -LZInit@4 -LZOpenFileA@12 -LZOpenFileW@12 -LZRead@12 -LZSeek@12 -LZStart@0 -MapUserPhysicalPages@12 -MapUserPhysicalPagesScatter@12 -MapViewOfFile@20 -MapViewOfFileEx@24 -Module32First@8 -Module32FirstW@8 -Module32Next@8 -Module32NextW@8 -MoveFileA@8 -MoveFileExA@12 -MoveFileWithProgressA@20 -MoveFileExW@12 -MoveFileW@8 -MoveFileWithProgressW@20 -MulDiv@12 -MultiByteToWideChar@24 -NeedCurrentDirectoryForExePathA@4 -NeedCurrentDirectoryForExePathW@4 -NlsConvertIntegerToString@20 -NlsGetCacheUpdateCount@0 -;NlsResetProcessLocale -;NumaVirtualQueryNode -OpenConsoleW@16 -;OpenDataFile -OpenEventA@12 -OpenEventW@12 -OpenFile@12 -OpenFileById@24 -OpenFileMappingA@12 -OpenFileMappingW@12 -OpenJobObjectA@12 -OpenJobObjectW@12 -OpenMutexA@12 -OpenMutexW@12 -OpenProcess@12 -;OpenProfileUserMapping@0 -OpenSemaphoreA@12 -OpenSemaphoreW@12 -OpenThread@12 -OpenWaitableTimerA@12 -OpenWaitableTimerW@12 -OutputDebugStringA@4 -OutputDebugStringW@4 -PeekConsoleInputA@16 -PeekConsoleInputW@16 -PeekNamedPipe@24 -PrivCopyFileExW@24 -;PrivMoveFileIdentityW -PostQueuedCompletionStatus@16 -PrepareTape@12 -ProcessIdToSessionId@8 -Process32First@8 -Process32FirstW@8 -Process32Next@8 -Process32NextW@8 -PulseEvent@4 -PurgeComm@8 -QueryActCtxW@28 -QueryDepthSList@4=NTDLL.RtlQueryDepthSList -QueryDosDeviceA@12 -QueryDosDeviceW@12 -QueryInformationJobObject@20 -QueryMemoryResourceNotification@8 -QueryPerformanceCounter@4 -QueryPerformanceFrequency@4 -QueueUserAPC@12 -QueueUserWorkItem@12 -QueryWin31IniFilesMappedToRegistry@16 -RaiseException@16 -ReadConsoleA@20 -ReadConsoleInputA@16 -;ReadConsoleInputExA -;ReadConsoleInputExW -ReadConsoleInputW@16 -ReadConsoleOutputA@20 -ReadConsoleOutputAttribute@20 -ReadConsoleOutputCharacterA@20 -ReadConsoleOutputCharacterW@20 -ReadConsoleOutputW@20 -ReadConsoleW@20 -ReadDirectoryChangesW@32 -ReadFile@20 -ReadFileEx@20 -ReadFileScatter@20 -ReadProcessMemory@20 -RecoveryFinished@4 -RecoveryInProgress@4 -RegisterApplicationRecoveryCallback@16 -RegisterApplicationRestart@8 -;RegisterConsoleIME -;RegisterConsoleOS2 -RegisterConsoleVDM@44 -RegisterWaitForInputIdle@4 -RegisterWaitForSingleObject@24 -RegisterWaitForSingleObjectEx@20 -RegisterWowBaseHandlers@4 -RegisterWowExec@4 -ReleaseActCtx@4 -ReleaseMutex@4 -ReleaseSemaphore@12 -ReleaseSRWLockExclusive@4=NTDLL.RtlReleaseSRWLockExclusive -ReleaseSRWLockShared@4=NTDLL.RtlReleaseSRWLockShared -RemoveDirectoryA@4 -RemoveDirectoryW@4 -;RemoveLocalAlternateComputerNameA -;RemoveLocalAlternateComputerNameW -RemoveVectoredExceptionHandler@4=NTDLL.RtlRemoveVectoredExceptionHandler -ReplaceFile=ReplaceFileW@24 -ReplaceFileA@24 -ReplaceFileW@24 -RequestDeviceWakeup@4 -RequestWakeupLatency@4 -ResetEvent@4 -ResetWriteWatch@8 -RestoreLastError@4 -ResumeThread@4 -RtlCaptureContext@4=NTDLL.RtlCaptureContext -;RtlCaptureStackBackTrace -RtlFillMemory@12=NTDLL.RtlFillMemory -RtlMoveMemory@12=NTDLL.RtlMoveMemory -RtlUnwind@16=NTDLL.RtlUnwind -RtlZeroMemory@8=NTDLL.RtlZeroMemory -ScrollConsoleScreenBufferA@20 -ScrollConsoleScreenBufferW@20 -SearchPathA@24 -SearchPathW@24 -SetCPGlobal@4 -SetCalendarInfoA@16 -SetCalendarInfoW@16 -SetClientTimeZoneInformation@4 -;SetComPlusPackageInstallStatus -SetCommBreak@4 -SetCommConfig@12 -SetCommMask@8 -SetCommState@8 -SetCommTimeouts@8 -SetComputerNameA@4 -SetComputerNameExA@8 -SetComputerNameExW@8 -SetComputerNameW@4 -SetConsoleActiveScreenBuffer@4 -SetConsoleCP@4 -SetConsoleCommandHistoryMode@4 -SetConsoleCtrlHandler@8 -SetConsoleCursor@8 -SetConsoleCursorInfo@8 -;SetConsoleCursorMode -SetConsoleCursorPosition@8 -SetConsoleDisplayMode@12 -SetConsoleFont@8 -SetConsoleHardwareState@12 -SetConsoleHistoryInfo@4 -SetConsoleIcon@4 -SetConsoleInputExeNameA@4 -SetConsoleInputExeNameW@4 -SetConsoleKeyShortcuts@16 -;SetConsoleLocalEUDC -SetConsoleMaximumWindowSize@8 -SetConsoleMenuClose@4 -SetConsoleMode@8 -;SetConsoleNlsMode -SetConsoleNumberOfCommandsA@8 -SetConsoleNumberOfCommandsW@8 -;SetConsoleOS2OemFormat -SetConsoleOutputCP@4 -SetConsolePalette@12 -SetConsoleScreenBufferInfoEx@8 -SetConsoleScreenBufferSize@8 -SetConsoleTextAttribute@8 -SetConsoleTitleA@4 -SetConsoleTitleW@4 -SetConsoleWindowInfo@12 -SetCriticalSectionSpinCount@8=NTDLL.RtlSetCriticalSectionSpinCount -SetCurrentDirectoryA@4 -SetCurrentDirectoryW@4 -SetDefaultCommConfigA@12 -SetDefaultCommConfigW@12 -SetDllDirectoryA@4 -SetDllDirectoryW@4 -SetEndOfFile@4 -SetEnvironmentVariableA@8 -SetEnvironmentVariableW@8 -SetErrorMode@4 -SetEvent@4 -SetFileApisToANSI@0 -SetFileApisToOEM@0 -SetFileAttributesA@8 -SetFileAttributesW@8 -SetFileAttributesByHandle@12 -SetFileBandwidthReservation@24 -SetFileCompletionNotificationModes@8 -SetFilePointer@16 -SetFilePointerEx@20 -SetFileShortNameA@8 -SetFileShortNameW@8 -SetFileTime@16 -SetFileValidData@12 -SetFirmwareEnvironmentVariableA@16 -SetFirmwareEnvironmentVariableW@16 -SetHandleContext@8 -SetHandleCount@4 -SetHandleInformation@12 -SetInformationJobObject@16 -SetLastConsoleEventActive@0 -SetLastError@4 -;SetLocalPrimaryComputerNameA -;SetLocalPrimaryComputerNameW -SetLocalTime@4 -SetLocaleInfoA@12 -SetLocaleInfoW@12 -SetMailslotInfo@8 -SetMessageWaitingIndicator@8 -SetNamedPipeHandleState@16 -SetPriorityClass@8 -SetProcessAffinityMask@8 -SetProcessPriorityBoost@8 -SetProcessShutdownParameters@8 -SetProcessWorkingSetSize@12 -SetStdHandle@8 -SetSystemPowerState@8 -SetSystemTime@4 -SetSystemTimeAdjustment@8 -SetTapeParameters@12 -SetTapePosition@24 -;SetTermsrvAppInstallMode -SetThreadAffinityMask@8 -SetThreadContext@8 -SetThreadExecutionState@4 -SetThreadIdealProcessor@8 -SetThreadLocale@4 -SetThreadPriority@8 -SetThreadPriorityBoost@8 -SetThreadUILanguage@4 -SetTimerQueueTimer@24 -SetTimeZoneInformation@4 -SetUnhandledExceptionFilter@4 -SetUserDefaultLCID@4 -SetUserDefaultUILanguage@4 -SetUserGeoID@4 -SetVDMCurrentDirectories@8 -SetVolumeLabelA@8 -SetVolumeLabelW@8 -SetVolumeMountPointA@8 -SetVolumeMountPointW@8 -SetWaitableTimer@24 -SetupComm@12 -ShowConsoleCursor@8 -SignalObjectAndWait@16 -SizeofResource@8 -Sleep@4 -SleepConditionVariableCS@12 -SleepConditionVariableSRW@16 -SleepEx@8 -SuspendThread@4 -SwitchToFiber@4 -SwitchToThread@0 -SystemTimeToFileTime@8 -SystemTimeToTzSpecificLocalTime@12 -TerminateJobObject@8 -TerminateProcess@8 -TerminateThread@8 -;TermsrvAppInstallMode -Thread32First@8 -Thread32Next@8 -TlsAlloc@0 -TlsFree@4 -TlsGetValue@4 -TlsSetValue@8 -Toolhelp32ReadProcessMemory@20 -TransactNamedPipe@28 -TransmitCommChar@8 -TrimVirtualBuffer@4 -TryEnterCriticalSection@4=NTDLL.RtlTryEnterCriticalSection -TzSpecificLocalTimeToSystemTime@12 -UnhandledExceptionFilter@4 -UnlockFile@20 -UnlockFileEx@20 -UnmapViewOfFile@4 -UpdateResourceA@24 -UpdateResourceW@24 -UTRegister@28 -UTUnRegister@4 -;UnregisterConsoleIME -UnregisterWait@4 -UnregisterWaitEx@8 -;ValidateLCType -;ValidateLocale -VDMConsoleOperation@8 -VDMOperationStarted@4 -VerLanguageNameA@12 -VerLanguageNameW@12 -VerSetConditionMask@16=NTDLL.VerSetConditionMask -VerifyConsoleIoHandle@4 -VerifyVersionInfoA@16 -VerifyVersionInfoW@16 -VirtualAlloc@16 -VirtualAllocEx@20 -VirtualBufferExceptionHandler@12 -VirtualFree@12 -VirtualFreeEx@16 -VirtualLock@8 -VirtualProtect@16 -VirtualProtectEx@20 -VirtualQuery@12 -VirtualQueryEx@16 -VirtualUnlock@8 -WakeAllConditionVariable@4=NTDLL.RtlWakeAllConditionVariable -WakeConditionVariable@4=NTDLL.RtlWakeConditionVariable -WaitCommEvent@12 -WaitForDebugEvent@8 -WaitForMultipleObjects@16 -WaitForMultipleObjectsEx@20 -WaitForSingleObject@8 -WaitForSingleObjectEx@12 -WaitNamedPipeA@8 -WaitNamedPipeW@8 -WideCharToMultiByte@32 -WinExec@8 -Wow64EnableWow64FsRedirection@4 -Wow64DisableWow64FsRedirection@4 -Wow64RevertWow64FsRedirection@4 -WriteConsoleA@20 -WriteConsoleInputA@16 -WriteConsoleInputVDMA@16 -WriteConsoleInputVDMW@16 -WriteConsoleInputW@16 -WriteConsoleOutputA@20 -WriteConsoleOutputAttribute@20 -WriteConsoleOutputCharacterA@20 -WriteConsoleOutputCharacterW@20 -WriteConsoleOutputW@20 -WriteConsoleW@20 -WriteFile@20 -WriteFileEx@20 -WriteFileGather@20 -WritePrivateProfileSectionA@12 -WritePrivateProfileSectionW@12 -WritePrivateProfileStringA@16 -WritePrivateProfileStringW@16 -WritePrivateProfileStructA@20 -WritePrivateProfileStructW@20 -WriteProcessMemory@20 -WriteProfileSectionA@8 -WriteProfileSectionW@8 -WriteProfileStringA@12 -WriteProfileStringW@12 -WriteTapemark@16 -WTSGetActiveConsoleSessionId@0 -ZombifyActCtx@4 -_hread@12 -_hwrite@12 -_lclose@4 -_lcreat@8 -_llseek@12 -_lopen@8 -_lread@12=_hread@12 -_lwrite@12=_hwrite@12 -lstrcat@8=lstrcatA@8 -lstrcatA@8 -lstrcatW@8 -lstrcmp@8=lstrcmpA@8 -lstrcmpA@8 -lstrcmpW@8 -lstrcmpi@8=lstrcmpiA@8 -lstrcmpiA@8 -lstrcmpiW@8 -lstrcpy@8=lstrcpyA@8 -lstrcpyA@8 -lstrcpyW@8 -lstrcpyn@12=lstrcpynA@12 -lstrcpynA@12 -lstrcpynW@12 -lstrlen@4=lstrlenA@4 -lstrlenA@4 -lstrlenW@4 diff --git a/reactos/dll/win32/kernel32/kernel32.rbuild b/reactos/dll/win32/kernel32/kernel32.rbuild index 55899c5996a..736cfa53adc 100644 --- a/reactos/dll/win32/kernel32/kernel32.rbuild +++ b/reactos/dll/win32/kernel32/kernel32.rbuild @@ -1,7 +1,7 @@ - + . include include/reactos/subsys @@ -118,10 +118,16 @@ thread.S + + + fiber.S + thread.S + + - + . . include @@ -132,5 +138,6 @@ pseh ntdll kernel32.rc + kernel32.spec diff --git a/reactos/dll/win32/kernel32/kernel32.spec b/reactos/dll/win32/kernel32/kernel32.spec new file mode 100644 index 00000000000..4c930596490 --- /dev/null +++ b/reactos/dll/win32/kernel32/kernel32.spec @@ -0,0 +1,1017 @@ +# +# kernel32.spec +# +# Exports for KERNEL32 DLL + + +@ stdcall AcquireSRWLockExclusive(ptr) ntdll.RtlAcquireSRWLockExclusive +@ stdcall AcquireSRWLockShare(ptr) ntdll.RtlAcquireSRWLockShared +@ stdcall ActivateActCtx(ptr ptr) +@ stdcall AddAtomA(str) +@ stdcall AddAtomW(wstr) +@ stdcall AddConsoleAliasA(str str str) #check +@ stdcall AddConsoleAliasW(wstr wstr wstr) #check +@ stub AddLocalAlternateComputerNameA +@ stub AddLocalAlternateComputerNameW +@ stdcall AddRefActCtx(ptr) +@ stdcall AddVectoredExceptionHandler(long ptr) ntdll.RtlAddVectoredExceptionHandler +@ stdcall AllocConsole() +@ stub AllocLSCallback +@ stub AllocateUserPhysicalPages +@ stdcall AreFileApisANSI() +@ stdcall AssignProcessToJobObject(ptr ptr) +@ stdcall AttachConsole(long) +@ stdcall BackupRead(ptr ptr long ptr long long ptr) +@ stdcall BackupSeek(ptr long long ptr ptr ptr) +@ stdcall BackupWrite(ptr ptr long ptr long long ptr) +@ stdcall BaseCheckAppcompatCache(long long long ptr) #check +@ stub BaseCleanupAppcompatCache +@ stub BaseCleanupAppcompatCacheSupport +@ stdcall BaseDumpAppcompatCache() +@ stdcall BaseFlushAppcompatCache() +@ stub BaseInitAppcompatCache +@ stub BaseInitAppcompatCacheSupport +@ stdcall BaseProcessInitPostImport() +@ stdcall BaseQueryModuleData(str str ptr ptr ptr) #check +@ stdcall BaseUpdateAppcompatCache(long long long) +@ stub BasepCheckWinSaferRestrictions +@ stub BasepDebugDump +@ stdcall Beep(long long) +@ stdcall BeginUpdateResourceA(str long) +@ stdcall BeginUpdateResourceW(wstr long) +@ stdcall BindIoCompletionCallback(long ptr long) +@ stdcall BuildCommDCBA(str ptr) +@ stdcall BuildCommDCBAndTimeoutsA(str ptr ptr) +@ stdcall BuildCommDCBAndTimeoutsW(wstr ptr ptr) +@ stdcall BuildCommDCBW(wstr ptr) +@ stdcall CallNamedPipeA(str ptr long ptr long ptr long) +@ stdcall CallNamedPipeW(wstr ptr long ptr long ptr long) +@ stdcall CancelDeviceWakeupRequest(long) +@ stdcall CancelIo(long) +@ stdcall CancelIoEx(long ptr) +@ stdcall CancelSynchronousIo(long) +@ stdcall CancelTimerQueueTimer(long long) +@ stdcall CancelWaitableTimer(long) +@ stdcall ChangeTimerQueueTimer(long long long long) +@ stdcall CheckNameLegalDOS8Dot3A(str str long long long) +@ stdcall CheckNameLegalDOS8Dot3W(wstr str long long long) +@ stdcall CheckRemoteDebuggerPresent(long ptr) +@ stdcall ClearCommBreak(long) +@ stdcall ClearCommError(long ptr ptr) +@ stdcall CloseConsoleHandle(long) +@ stdcall CloseHandle(long) +@ stdcall CloseProfileUserMapping() +@ stub CloseSystemHandle +@ stdcall CmdBatNotification(long) +@ stdcall CommConfigDialogA(str long ptr) +@ stdcall CommConfigDialogW(wstr long ptr) +@ stdcall CompareFileTime(ptr ptr) +@ stdcall CompareStringA(long long str long str long) +@ stdcall CompareStringW(long long wstr long wstr long) +@ stdcall ConnectNamedPipe(long ptr) +@ stdcall ConsoleMenuControl(long long long) +@ stub ConsoleSubst +@ stdcall ContinueDebugEvent(long long long) +@ stdcall ConvertDefaultLocale (long) +@ stdcall ConvertFiberToThread() +@ stdcall ConvertThreadToFiber(ptr) +@ stdcall ConvertThreadToFiberEx(ptr long) +@ stdcall CopyFileA(str str long) +@ stdcall CopyFileExA (str str ptr ptr ptr long) +@ stdcall CopyFileExW (wstr wstr ptr ptr ptr long) +@ stdcall CopyFileW(wstr wstr long) +@ stdcall CopyLZFile(long long) LZCopy +@ stdcall CreateActCtxA(ptr) +@ stdcall CreateActCtxW(ptr) +@ stdcall CreateConsoleScreenBuffer(long long ptr long ptr) +@ stdcall CreateDirectoryA(str ptr) +@ stdcall CreateDirectoryExA(str str ptr) +@ stdcall CreateDirectoryExW(wstr wstr ptr) +@ stdcall CreateDirectoryW(wstr ptr) +@ stdcall CreateEventA(ptr long long str) +@ stdcall CreateEventW(ptr long long wstr) +@ stdcall CreateFiber(long ptr ptr) +@ stdcall CreateFiberEx(long long long ptr ptr) +@ stdcall CreateFileA(str long long ptr long long long) +@ stdcall CreateFileMappingA(long ptr long long long str) +@ stdcall CreateFileMappingW(long ptr long long long wstr) +@ stdcall CreateFileW(wstr long long ptr long long long) +@ stdcall CreateHardLinkA(str str ptr) +@ stdcall CreateHardLinkW(wstr wstr ptr) +@ stdcall CreateIoCompletionPort(long long long long) +@ stdcall CreateJobObjectA(ptr str) +@ stdcall CreateJobObjectW(ptr wstr) +@ stdcall CreateJobSet(long ptr long) +@ stub CreateKernelThread +@ stdcall CreateMailslotA(ptr long long ptr) +@ stdcall CreateMailslotW(ptr long long ptr) +@ stdcall CreateMemoryResourceNotification(ptr) +@ stdcall CreateMutexA(ptr long str) +@ stdcall CreateMutexW(ptr long wstr) +@ stdcall CreateNamedPipeA(str long long long long long long ptr) +@ stdcall CreateNamedPipeW(wstr long long long long long long ptr) +@ stdcall CreateNlsSecurityDescriptor(ptr long long) +@ stdcall CreatePipe(ptr ptr ptr long) +@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) +@ stdcall CreateProcessInternalA(ptr str str ptr ptr long long ptr str ptr ptr long) +@ stdcall CreateProcessInternalW(ptr wstr wstr ptr ptr long long ptr wstr ptr ptr long) +@ stub CreateProcessInternalWSecure +@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) +@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) +@ stdcall CreateSemaphoreA(ptr long long str) +@ stdcall CreateSemaphoreW(ptr long long wstr) +@ stdcall CreateSemaphoreExA(ptr long long long str long long) +@ stdcall CreateSemaphoreExW(ptr long long long wstr long long) +@ stdcall CreateSocketHandle() +@ stdcall CreateSymbolicLinkA(str str long) +@ stdcall CreateSymbolicLinkW(wstr wstr long) +@ stdcall CreateTapePartition(long long long long) +@ stdcall CreateThread(ptr long ptr long long ptr) +@ stdcall CreateTimerQueue () +@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) +@ stdcall CreateToolhelp32Snapshot(long long) +@ stdcall CreateVirtualBuffer(long long long) +@ stdcall CreateWaitableTimerA(ptr long str) +@ stdcall CreateWaitableTimerW(ptr long wstr) +@ stdcall CreateWaitableTimerExA (ptr str long long) +@ stdcall CreateWaitableTimerExW (ptr wstr long long) +@ stdcall DeactivateActCtx(long ptr) +@ stdcall DebugActiveProcess(long) +@ stdcall DebugActiveProcessStop(long) +@ stdcall DebugBreak() ntdll.DbgBreakPoint +@ stdcall DebugBreakProcess(long) +@ stdcall DebugSetProcessKillOnExit(long) +@ stdcall DecodePointer(ptr) ntdll.RtlDecodePointer +@ stub DecodeSystemPointer +@ stdcall DefineDosDeviceA(long str str) +@ stdcall DefineDosDeviceW(long wstr wstr) +@ stdcall DelayLoadFailureHook(str str) +@ stdcall DeleteAtom(long) +@ stdcall DeleteCriticalSection(ptr) ntdll.RtlDeleteCriticalSection +@ stdcall DeleteFiber(ptr) +@ stdcall DeleteFileA(str) +@ stdcall DeleteFileW(wstr) +@ stdcall DeleteTimerQueue(long) +@ stdcall DeleteTimerQueueEx (long long) +@ stdcall DeleteTimerQueueTimer(long long long) +@ stdcall DeleteVolumeMountPointA(str) #check +@ stdcall DeleteVolumeMountPointW(wstr) #check +@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) +@ stdcall DisableThreadLibraryCalls(long) +@ stdcall DisconnectNamedPipe(long) +@ stdcall DnsHostnameToComputerNameA (str ptr ptr) +@ stdcall DnsHostnameToComputerNameW (wstr ptr ptr) +@ stdcall DosDateTimeToFileTime(long long ptr) +@ stdcall DosPathToSessionPathA(long str str) +@ stdcall DosPathToSessionPathW(long wstr wstr) +@ stdcall DuplicateConsoleHandle(long long long long) +@ stdcall DuplicateHandle(long long long ptr long long long) +@ stdcall EncodePointer(ptr) ntdll.RtlEncodePointer +@ stub EncodeSystemPointer +@ stdcall EndUpdateResourceA(long long) +@ stdcall EndUpdateResourceW(long long) +@ stdcall EnterCriticalSection(ptr) ntdll.RtlEnterCriticalSection +@ stdcall EnumCalendarInfoA(ptr long long long) +@ stdcall EnumCalendarInfoExA(ptr long long long) +@ stdcall EnumCalendarInfoExW(ptr long long long) +@ stdcall EnumCalendarInfoW(ptr long long long) +@ stdcall EnumDateFormatsA(ptr long long) +@ stdcall EnumDateFormatsExA(ptr long long) +@ stdcall EnumDateFormatsExW(ptr long long) +@ stdcall EnumDateFormatsW(ptr long long) +@ stdcall EnumLanguageGroupLocalesA(ptr long long ptr) +@ stdcall EnumLanguageGroupLocalesW(ptr long long ptr) +@ stdcall EnumResourceLanguagesA(long str str ptr long) +@ stdcall EnumResourceLanguagesW(long wstr wstr ptr long) +@ stdcall EnumResourceNamesA(long str ptr long) +@ stdcall EnumResourceNamesW(long wstr ptr long) +@ stdcall EnumResourceTypesA(long ptr long) +@ stdcall EnumResourceTypesW(long ptr long) +@ stdcall EnumSystemCodePagesA(ptr long) +@ stdcall EnumSystemCodePagesW(ptr long) +@ stdcall EnumSystemGeoID(long long ptr) +@ stdcall EnumSystemLanguageGroupsA(ptr long ptr) +@ stdcall EnumSystemLanguageGroupsW(ptr long ptr) +@ stdcall EnumSystemLocalesA(ptr long) +@ stdcall EnumSystemLocalesW(ptr long) +@ stdcall EnumTimeFormatsA(ptr long long) +@ stdcall EnumTimeFormatsW(ptr long long) +@ stdcall EnumUILanguagesA(ptr long long) +@ stdcall EnumUILanguagesW(ptr long long) +@ stub EnumerateLocalComputerNamesA +@ stub EnumerateLocalComputerNamesW +@ stdcall EraseTape(ptr long long) +@ stdcall EscapeCommFunction(long long) +@ stdcall ExitProcess(long) +@ stdcall ExitThread(long) +@ stub ExitVDM +@ stdcall ExpandEnvironmentStringsA(str ptr long) +@ stdcall ExpandEnvironmentStringsW(wstr ptr long) +@ stdcall ExpungeConsoleCommandHistoryA(long) +@ stdcall ExpungeConsoleCommandHistoryW(long) +@ stdcall ExtendVirtualBuffer(long long) +@ stdcall FatalAppExitA(long str) +@ stdcall FatalAppExitW(long wstr) +@ stdcall FatalExit(long) +@ stdcall FileTimeToDosDateTime(ptr ptr ptr) +@ stdcall FileTimeToLocalFileTime(ptr ptr) +@ stdcall FileTimeToSystemTime(ptr ptr) +@ stdcall FillConsoleOutputAttribute(long long long long ptr) +@ stdcall FillConsoleOutputCharacterA(long long long long ptr) +@ stdcall FillConsoleOutputCharacterW(long long long long ptr) +@ stdcall FindActCtxSectionGuid(long ptr long ptr ptr) +@ stdcall FindActCtxSectionStringA(long ptr long str ptr) +@ stdcall FindActCtxSectionStringW(long ptr long wstr ptr) +@ stdcall FindAtomA(str) +@ stdcall FindAtomW(wstr) +@ stdcall FindClose(long) +@ stdcall FindCloseChangeNotification(long) +@ stdcall FindFirstChangeNotificationA(str long long) +@ stdcall FindFirstChangeNotificationW(wstr long long) +@ stdcall FindFirstFileA(str ptr) +@ stdcall FindFirstFileExA(str long ptr long ptr long) +@ stdcall FindFirstFileExW(wstr long ptr long ptr long) +@ stdcall FindFirstFileW(wstr ptr) +@ stdcall FindFirstStreamW(wstr ptr ptr long) +@ stdcall FindFirstVolumeA(ptr long) +@ stdcall FindFirstVolumeMountPointA(str ptr long) +@ stdcall FindFirstVolumeMountPointW(wstr ptr long) +@ stdcall FindFirstVolumeW(ptr long) +@ stdcall FindNextChangeNotification(long) +@ stdcall FindNextFileA(long ptr) +@ stdcall FindNextFileW(long ptr) +@ stdcall FindNextVolumeA(long ptr long) +@ stdcall FindNextVolumeMountPointA(long str long) +@ stdcall FindNextVolumeMountPointW(long wstr long) +@ stdcall FindNextVolumeW(long ptr long) +@ stdcall FindResourceA(long str str) +@ stdcall FindResourceExA(long str str long) +@ stdcall FindResourceExW(long wstr wstr long) +@ stdcall FindResourceW(long wstr wstr) +@ stdcall FindVolumeClose(ptr) +@ stdcall FindVolumeMountPointClose(ptr) +@ stdcall FlsAlloc(ptr) +@ stdcall FlsFree(long) +@ stdcall FlsGetValue(long) +@ stdcall FlsSetValue(long ptr) +@ stdcall FlushConsoleInputBuffer(long) +@ stdcall FlushFileBuffers(long) +@ stdcall FlushInstructionCache(long long long) +@ stdcall FlushViewOfFile(ptr long) +@ stdcall FoldStringA(long str long ptr long) +@ stdcall FoldStringW(long wstr long ptr long) +@ stdcall FormatMessageA(long ptr long long ptr long ptr) +@ stdcall FormatMessageW(long ptr long long ptr long ptr) +@ stdcall FreeConsole() +@ stdcall FreeEnvironmentStringsA(ptr) +@ stdcall FreeEnvironmentStringsW(ptr) +@ stdcall FreeLibrary(long) +@ stdcall FreeLibraryAndExitThread(long long) +@ stdcall FreeResource(long) +@ stdcall FreeUserPhysicalPages(long long long) +@ stdcall FreeVirtualBuffer(ptr) +@ stdcall GenerateConsoleCtrlEvent(long long) +@ stdcall GetACP() +@ stdcall GetAtomNameA(long ptr long) +@ stdcall GetAtomNameW(long ptr long) +@ stdcall GetBinaryType(str ptr) GetBinaryTypeA +@ stdcall GetBinaryTypeA(str ptr) +@ stdcall GetBinaryTypeW(wstr ptr) +@ stdcall GetCPFileNameFromRegistry(long wstr long) #check +@ stdcall GetCPInfo(long ptr) +@ stdcall GetCPInfoExA(long long ptr) +@ stdcall GetCPInfoExW(long long ptr) +@ stdcall GetCalendarInfoA(long long long ptr long ptr) +@ stdcall GetCalendarInfoW(long long long ptr long ptr) +@ stub GetComPlusPackageInstallStatus +@ stdcall GetCommConfig(long ptr long) +@ stdcall GetCommMask(long ptr) +@ stdcall GetCommModemStatus(long ptr) +@ stdcall GetCommProperties(long ptr) +@ stdcall GetCommState(long ptr) +@ stdcall GetCommTimeouts(long ptr) +@ stdcall GetCommandLineA() +@ stdcall GetCommandLineW() +@ stdcall GetCompressedFileSizeA(long ptr) +@ stdcall GetCompressedFileSizeW(long ptr) +@ stdcall GetComputerNameA(ptr ptr) +@ stdcall GetComputerNameExA(long ptr ptr) +@ stdcall GetComputerNameExW(long ptr ptr) +@ stdcall GetComputerNameW(ptr ptr) +@ stdcall GetConsoleAliasA(str str long str) +@ stdcall GetConsoleAliasExesA(str long) +@ stdcall GetConsoleAliasExesLengthA() +@ stdcall GetConsoleAliasExesLengthW() +@ stdcall GetConsoleAliasExesW(wstr long) +@ stdcall GetConsoleAliasW(wstr wstr long wstr) +@ stdcall GetConsoleAliasesA(str long str) +@ stdcall GetConsoleAliasesLengthA(str) +@ stdcall GetConsoleAliasesLengthW(wstr) +@ stdcall GetConsoleAliasesW(wstr long wstr) +@ stdcall GetConsoleCP() +@ stub GetConsoleCharType +@ stdcall GetConsoleCommandHistoryA(long long long) #check +@ stdcall GetConsoleCommandHistoryLengthA(long long long)#check +@ stdcall GetConsoleCommandHistoryLengthW(long)#check +@ stdcall GetConsoleCommandHistoryW(long long long)#check +@ stdcall GetConsoleCursorInfo(long ptr) +@ stub GetConsoleCursorMode +@ stdcall GetConsoleDisplayMode(ptr) +@ stub GetConsoleFontInfo +@ stub GetConsoleFontSize +@ stub GetConsoleHardwareState +@ stdcall GetConsoleInputExeNameA(long ptr) +@ stdcall GetConsoleInputExeNameW(long ptr) +@ stdcall GetConsoleInputWaitHandle() +@ stdcall GetConsoleKeyboardLayoutNameA(ptr) +@ stdcall GetConsoleKeyboardLayoutNameW(ptr) +@ stdcall GetConsoleMode(long ptr) +@ stub GetConsoleNlsMode +@ stdcall GetConsoleOutputCP() +@ stub GetConsoleProcessist +@ stdcall GetConsoleScreenBufferInfo(long ptr) +@ stub GetConsoleSelectionInfo +@ stdcall GetConsoleTitleA(ptr long) +@ stdcall GetConsoleTitleW(ptr long) +@ stdcall GetConsoleWindow() +@ stdcall GetCurrencyFormatA(long long str ptr str long) +@ stdcall GetCurrencyFormatW(long long str ptr str long) +@ stdcall GetCurrentActCtx(ptr) +@ stub GetCurrentConsoleFont +@ stdcall GetCurrentDirectoryA(long ptr) +@ stdcall GetCurrentDirectoryW(long ptr) +@ stdcall GetCurrentProcess() +@ stdcall GetCurrentProcessId() +@ stdcall GetCurrentThread() +@ stdcall GetCurrentThreadId() +@ stdcall GetDateFormatA(long long ptr str ptr long) +@ stdcall GetDateFormatW(long long ptr wstr ptr long) +@ stub GetDaylightFlag +@ stdcall GetDefaultCommConfigA(str ptr long) +@ stdcall GetDefaultCommConfigW(wstr ptr long) +@ stub GetDefaultSortkeySize +@ stdcall GetDevicePowerState(long ptr) +@ stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) +@ stdcall GetDiskFreeSpaceExA (str ptr ptr ptr) +@ stdcall GetDiskFreeSpaceExW (wstr ptr ptr ptr) +@ stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) +@ stdcall GetDllDirectoryA(long ptr) +@ stdcall GetDllDirectoryW(long ptr) +@ stdcall GetDriveTypeA(str) +@ stdcall GetDriveTypeW(wstr) +@ stdcall GetEnvironmentStrings() +@ stdcall GetEnvironmentStringsA() GetEnvironmentStrings +@ stdcall GetEnvironmentStringsW() +@ stdcall GetEnvironmentVariableA(str ptr long) +@ stdcall GetEnvironmentVariableW(wstr ptr long) +@ stub GetErrorMode +@ stdcall GetExitCodeProcess(long ptr) +@ stdcall GetExitCodeThread(long ptr) +@ stdcall GetExpandedNameA(str ptr) +@ stdcall GetExpandedNameW(wstr ptr) +@ stdcall GetFileAttributesA(str) +@ stdcall GetFileAttributesByHandle(long ptr long) +@ stdcall GetFileAttributesExA(str long ptr) +@ stdcall GetFileAttributesExW(wstr long ptr) +@ stdcall GetFileAttributesW(wstr) +@ stdcall GetFileBandwidthReservation(long ptr ptr ptr ptr ptr) +@ stdcall GetFileInformationByHandle(long ptr) +@ stdcall GetFileSize(long ptr) +@ stdcall GetFileSizeEx(long ptr) +@ stdcall GetFileTime(long ptr ptr ptr) +@ stdcall GetFileType(long) +@ stdcall GetFinalPathNameByHandleA(long str long long) +@ stdcall GetFinalPathNameByHandleW(long wstr long long) +@ stub GetFirmwareEnvironmentVariableA +@ stub GetFirmwareEnvironmentVariableW +@ stdcall GetFullPathNameA(str long ptr ptr) +@ stdcall GetFullPathNameW(wstr long ptr ptr) +@ stdcall GetGeoInfoA(long long ptr long long) +@ stdcall GetGeoInfoW(long long ptr long long) +@ stdcall GetHandleContext(long) +@ stdcall GetHandleInformation(long ptr) +@ stub GetSCallbackTarget +@ stub GetSCallbackTemplate +@ stdcall GetLargePageMinimum() +@ stdcall GetLargestConsoleWindowSize(long) +@ stdcall GetLastError() +@ stub GetLinguistLangSize +@ stdcall GetLocalTime(ptr) +@ stdcall GetLocaleInfoA(long long ptr long) +@ stdcall GetLocaleInfoW(long long ptr long) +@ stdcall GetLogicalDriveStringsA(long ptr) +@ stdcall GetLogicalDriveStringsW(long ptr) +@ stdcall GetLogicalDrives() +@ stdcall GetLongPathNameA (str long long) +@ stdcall GetLongPathNameW (wstr long long) +@ stdcall GetMailslotInfo(long ptr ptr ptr ptr) +@ stdcall GetModuleFileNameA(long ptr long) +@ stdcall GetModuleFileNameW(long ptr long) +@ stdcall GetModuleHandleA(str) +@ stdcall GetModuleHandleExA(long ptr ptr) +@ stdcall GetModuleHandleExW(long ptr ptr) +@ stdcall GetModuleHandleW(wstr) +@ stdcall GetNamedPipeHandleStateA(long ptr ptr ptr ptr str long) +@ stdcall GetNamedPipeHandleStateW(long ptr ptr ptr ptr wstr long) +@ stdcall GetNamedPipeInfo(long ptr ptr ptr ptr) +@ stdcall GetNativeSystemInfo(ptr) +@ stub GetNextVDMCommand +@ stub GetNlsSectionName +@ stub GetNumaAvailableMemory +@ stub GetNumaAvailableMemoryNode +@ stub GetNumaHighestNodeNumber +@ stub GetNumaNodeProcessorMask +@ stub GetNumaProcessorMap +@ stub GetNumaProcessorNode +@ stdcall GetNumberFormatA(long long str ptr ptr long) +@ stdcall GetNumberFormatW(long long wstr ptr ptr long) +@ stdcall GetNumberOfConsoleFonts() +@ stdcall GetNumberOfConsoleInputEvents(long ptr) +@ stdcall GetNumberOfConsoleMouseButtons(ptr) +@ stdcall GetOEMCP() +@ stdcall GetOverlappedResult(long ptr ptr long) +@ stdcall GetPriorityClass(long) +@ stdcall GetPrivateProfileIntA(str str long str) +@ stdcall GetPrivateProfileIntW(wstr wstr long wstr) +@ stdcall GetPrivateProfileSectionA(str ptr long str) +@ stdcall GetPrivateProfileSectionNamesA(ptr long str) +@ stdcall GetPrivateProfileSectionNamesW(ptr long wstr) +@ stdcall GetPrivateProfileSectionW(wstr ptr long wstr) +@ stdcall GetPrivateProfileStringA(str str str ptr long str) +@ stdcall GetPrivateProfileStringW(wstr wstr wstr ptr long wstr) +@ stdcall GetPrivateProfileStructA (str str ptr long str) +@ stdcall GetPrivateProfileStructW(wstr wstr ptr long wstr) +@ stdcall GetProcAddress(long str) +@ stdcall GetProcessAffinityMask(long ptr ptr) +@ stdcall GetProcessHandleCount(long ptr) +@ stdcall GetProcessHeap() +@ stdcall GetProcessHeaps(long ptr) +@ stdcall GetProcessId(long) +@ stdcall GetProcessIoCounters(long ptr) +@ stdcall GetProcessPriorityBoost(long ptr) +@ stdcall GetProcessShutdownParameters(ptr ptr) +@ stdcall GetProcessTimes(long ptr ptr ptr ptr) +@ stdcall GetProcessVersion(long) +@ stdcall GetProcessWorkingSetSize(long ptr ptr) +@ stub GetProductName +@ stdcall GetProfileIntA(str str long) +@ stdcall GetProfileIntW(wstr wstr long) +@ stdcall GetProfileSectionA(str ptr long) +@ stdcall GetProfileSectionW(wstr ptr long) +@ stdcall GetProfileStringA(str str str ptr long) +@ stdcall GetProfileStringW(wstr wstr wstr ptr long) +@ stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) +@ stub GetLSCallbackTarget +@ stub GetLSCallbackTemplate +@ stdcall GetShortPathNameA(str ptr long) +@ stdcall GetShortPathNameW(wstr ptr long) +@ stdcall GetStartupInfoA(ptr) +@ stdcall GetStartupInfoW(ptr) +@ stdcall GetStdHandle(long) +@ stdcall GetStringTypeA(long long str long ptr) +@ stdcall GetStringTypeExA(long long str long ptr) +@ stdcall GetStringTypeExW(long long wstr long ptr) +@ stdcall GetStringTypeW(long wstr long ptr) +@ stdcall GetSystemDefaultLCID() +@ stdcall GetSystemDefaultLangID() +@ stdcall GetSystemDefaultUILanguage() +@ stdcall GetSystemDirectoryA(ptr long) +@ stdcall GetSystemDirectoryW(ptr long) +@ stdcall GetSystemInfo(ptr) +@ stdcall GetSystemPowerStatus(ptr) +@ stub GetSystemRegistryQuota +@ stdcall GetSystemTime(ptr) +@ stdcall GetSystemTimeAdjustment(ptr ptr ptr) +@ stdcall GetSystemTimeAsFileTime(ptr) +@ stub GetSystemTimes +@ stdcall GetSystemWindowsDirectoryA(ptr long) +@ stdcall GetSystemWindowsDirectoryW(ptr long) +@ stdcall GetSystemWow64DirectoryA(ptr long) +@ stdcall GetSystemWow64DirectoryW(ptr long) +@ stdcall GetTapeParameters(ptr long ptr ptr) +@ stdcall GetTapePosition(ptr long ptr ptr ptr) +@ stdcall GetTapeStatus(ptr) +@ stdcall GetTempFileNameA(str str long ptr) +@ stdcall GetTempFileNameW(wstr wstr long ptr) +@ stdcall GetTempPathA(long ptr) +@ stdcall GetTempPathW(long ptr) +@ stdcall GetThreadContext(long ptr) +@ stdcall GetThreadId(ptr) +@ stub GetThreadIOPendingFlag +@ stdcall GetThreadLocale() +@ stdcall GetThreadPriority(long) +@ stdcall GetThreadPriorityBoost(long ptr) +@ stdcall GetThreadSelectorEntry(long long ptr) +@ stdcall GetThreadTimes(long ptr ptr ptr ptr) +@ stdcall GetTickCount() +@ stdcall -ret64 GetTickCount64() +@ stdcall GetTimeFormatA(long long ptr str ptr long) +@ stdcall GetTimeFormatW(long long ptr wstr ptr long) +@ stdcall GetTimeZoneInformation(ptr) +@ stdcall GetUserDefaultLCID() +@ stdcall GetUserDefaultLangID() +@ stdcall GetUserDefaultUILanguage() +@ stdcall GetUserGeoID(long) +@ stub GetVDMCurrentDirectories +@ stdcall GetVersion() +@ stdcall GetVersionExA(ptr) +@ stdcall GetVersionExW(ptr) +@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long) +@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) +@ stdcall GetVolumeNameForVolumeMountPointA(str ptr long) +@ stdcall GetVolumeNameForVolumeMountPointW(wstr ptr long) +@ stdcall GetVolumePathNameA(str ptr long) +@ stdcall GetVolumePathNameW(wstr ptr long) +@ stub GetVolumePathNamesForVolumeNameA +@ stub GetVolumePathNamesForVolumeNameW +@ stdcall GetWindowsDirectoryA(ptr long) +@ stdcall GetWindowsDirectoryW(ptr long) +@ stub GetWriteWatch +@ stdcall GlobalAddAtomA(str) +@ stdcall GlobalAddAtomW(wstr) +@ stdcall GlobalAlloc(long long) +@ stdcall GlobalCompact(long) +@ stdcall GlobalDeleteAtom(long) +@ stdcall GlobalFindAtomA(str) +@ stdcall GlobalFindAtomW(wstr) +@ stdcall GlobalFix(long) +@ stdcall GlobalFlags(long) +@ stdcall GlobalFree(long) +@ stdcall GlobalGetAtomNameA(long ptr long) +@ stdcall GlobalGetAtomNameW(long ptr long) +@ stdcall GlobalHandle(ptr) +@ stdcall GlobalLock(long) +@ stdcall GlobalMemoryStatus(ptr) +@ stdcall GlobalMemoryStatusEx(ptr) +@ stdcall GlobalReAlloc(long long long) +@ stdcall GlobalSize(long) +@ stdcall GlobalUnWire(long) +@ stdcall GlobalUnfix(long) +@ stdcall GlobalUnlock(long) +@ stdcall GlobalWire(long) +@ stub Heap32First +@ stdcall Heap32ListFirst(long ptr) +@ stub Heap32ListNext +@ stub Heap32Next +@ stdcall HeapAlloc(long long long) ntdll.RtlAllocateHeap +@ stdcall HeapCompact(long long) +@ stdcall HeapCreate(long long long) +@ stub HeapCreateTagsW +@ stdcall HeapDestroy(long) +@ stub HeapExtend +@ stdcall HeapFree(long long long) ntdll.RtlFreeHeap +@ stdcall HeapLock(long) +@ stub HeapQueryInformation +@ stub HeapQueryTagW +@ stdcall HeapReAlloc(long long ptr long) ntdll.RtlReAllocateHeap +@ stub HeapSetFlags +@ stdcall HeapSetInformation(ptr long ptr long) +@ stdcall HeapSize(long long ptr) ntdll.RtlSizeHeap +@ stub HeapSummary +@ stdcall HeapUnlock(long) +@ stub HeapUsage +@ stdcall HeapValidate(long long ptr) +@ stdcall HeapWalk(long ptr) +@ stdcall InitAtomTable(long) +@ stdcall InitializeCriticalSection(ptr) +@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) +@ stdcall InitializeCriticalSectionEx(ptr long long) +@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead +@ stdcall InitializeSRWLock(ptr) ntdll.RtlInitializeSRWLock +@ stdcall InterlockedCompareExchange (ptr long long) +@ stdcall InterlockedDecrement(ptr) +@ stdcall InterlockedExchange(ptr long) +@ stdcall InterlockedExchangeAdd (ptr long ) +@ stdcall InterlockedFlushSList(ptr) ntdll.RtlInterlockedFlushSList +@ stdcall InterlockedIncrement(ptr) +@ stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList +@ stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList +@ stub InvalidateConsoleDIBits +@ stub InvalidateNSCache +@ stdcall IsBadCodePtr(ptr) +@ stdcall IsBadHugeReadPtr(ptr long) +@ stdcall IsBadHugeWritePtr(ptr long) +@ stdcall IsBadReadPtr(ptr long) +@ stdcall IsBadStringPtrA(ptr long) +@ stdcall IsBadStringPtrW(ptr long) +@ stdcall IsBadWritePtr(ptr long) +@ stdcall IsDBCSLeadByte(long) +@ stdcall IsDBCSLeadByteEx(long long) +@ stdcall IsDebuggerPresent() +@ stub IsProcessInJob +@ stdcall IsProcessorFeaturePresent(long) +@ stdcall IsSystemResumeAutomatic() +@ stdcall IsValidCodePage(long) +@ stdcall IsValidLanguageGroup(long long) +@ stdcall IsValidLocale(long long) +@ stub IsValidUILanguage +@ stdcall IsWow64Process(ptr ptr) +@ stub LCIDToLocaleName +@ stdcall LCMapStringA(long long str long ptr long) +@ stdcall LCMapStringW(long long wstr long ptr long) +@ stdcall LeaveCriticalSection(ptr) ntdll.RtlLeaveCriticalSection +@ stdcall LoadLibraryA(str) +@ stdcall LoadLibraryExA( str long long) +@ stdcall LoadLibraryExW(wstr long long) +@ stdcall LoadLibraryW(wstr) +@ stdcall LoadModule(str ptr) +@ stdcall LoadResource(long long) +@ stdcall LocalAlloc(long long) +@ stdcall LocalCompact(long) +@ stdcall LocalFileTimeToFileTime(ptr ptr) +@ stdcall LocalFlags(long) +@ stdcall LocalFree(long) +@ stdcall LocalHandle(ptr) +@ stdcall LocalLock(long) +@ stdcall LocalReAlloc(long long long) +@ stdcall LocalShrink(long long) +@ stdcall LocalSize(long) +@ stdcall LocalUnlock(long) +@ stub LocaleNameToLCID +@ stdcall LockFile(long long long long long) +@ stdcall LockFileEx(long long long long long ptr) +@ stdcall LockResource(long) +@ stdcall LZClose(long) +@ stdcall LZCopy(long long) +@ stdcall LZDone() +@ stdcall LZInit(long) +@ stdcall LZOpenFileA(str ptr long) +@ stdcall LZOpenFileW(wstr ptr long) +@ stdcall LZRead(long str long) #check +@ stdcall LZSeek(long long long) #check +@ stdcall LZStart() +@ stdcall MapUserPhysicalPages(ptr long ptr) +@ stdcall MapUserPhysicalPagesScatter(ptr long ptr) +@ stdcall MapViewOfFile(long long long long long) +@ stdcall MapViewOfFileEx(long long long long long ptr) +@ stdcall Module32First(long ptr) +@ stdcall Module32FirstW(long ptr) +@ stdcall Module32Next(long ptr) +@ stdcall Module32NextW(long ptr) +@ stdcall MoveFileA(str str) +@ stdcall MoveFileExA(str str long) +@ stdcall MoveFileExW(wstr wstr long) +@ stdcall MoveFileW(wstr wstr) +@ stdcall MoveFileWithProgressA(str str ptr ptr long) +@ stdcall MoveFileWithProgressW(wstr wstr ptr ptr long) +@ stdcall MulDiv(long long long) +@ stdcall MultiByteToWideChar(long long str long ptr long) +@ stdcall NeedCurrentDirectoryForExePathA(str) +@ stdcall NeedCurrentDirectoryForExePathW(wstr) +@ stub NlsConvertIntegerToString +@ stub NlsGetCacheUpdateCount +@ stub NlsResetProcessocale +@ stub NotifyNLSUserCache +@ stub NumaVirtualQueryNode +@ stdcall OpenConsoleW(wstr long long long) +@ stub OpenDataFile +@ stdcall OpenEventA(long long str) +@ stdcall OpenEventW(long long wstr) +@ stdcall OpenFile(str ptr long) +@ stdcall OpenFileMappingA(long long str) +@ stdcall OpenFileMappingW(long long wstr) +@ stub OpenJobObjectA +@ stub OpenJobObjectW +@ stdcall OpenMutexA(long long str) +@ stdcall OpenMutexW(long long wstr) +@ stdcall OpenProcess(long long long) +@ stub OpenProfileUserMapping +@ stdcall OpenSemaphoreA(long long str) +@ stdcall OpenSemaphoreW(long long wstr) +@ stdcall OpenThread(long long long) +@ stdcall OpenWaitableTimerA(long long str) +@ stdcall OpenWaitableTimerW(long long wstr) +@ stdcall OutputDebugStringA(str) +@ stdcall OutputDebugStringW(wstr) +@ stdcall PeekConsoleInputA(ptr ptr long ptr) +@ stdcall PeekConsoleInputW(ptr ptr long ptr) +@ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) +@ stdcall PostQueuedCompletionStatus(long long ptr ptr) +@ stdcall PrepareTape(ptr long long) +@ stub PrivCopyFileExW +@ stub PrivMoveFileIdentityW +@ stdcall Process32First (ptr ptr) +@ stdcall Process32FirstW (ptr ptr) +@ stdcall Process32Next (ptr ptr) +@ stdcall Process32NextW (ptr ptr) +@ stdcall ProcessIdToSessionId(long ptr) +@ stdcall PulseEvent(long) +@ stdcall PurgeComm(long long) +@ stdcall QueryActCtxW(long ptr ptr long ptr long ptr) +@ stdcall QueryDepthSList(ptr) ntdll.RtlQueryDepthSList +@ stdcall QueryDosDeviceA(str ptr long) +@ stdcall QueryDosDeviceW(wstr ptr long) +@ stub QueryInformationJobObject +@ stub QueryMemoryResourceNotification +@ stub QueryNumberOfEventogRecords +@ stub QueryOldestEventogRecord +@ stdcall QueryPerformanceCounter(ptr) +@ stdcall QueryPerformanceFrequency(ptr) +@ stub QueryWin31IniFilesMappedToRegistry +@ stdcall QueueUserAPC(ptr long long) +@ stdcall QueueUserWorkItem(ptr ptr long) +@ stdcall RaiseException(long long long ptr) +@ stdcall ReadConsoleA(long ptr long ptr ptr) +@ stdcall ReadConsoleInputA(long ptr long ptr) +@ stub ReadConsoleInputExA +@ stub ReadConsoleInputExW +@ stdcall ReadConsoleInputW(long ptr long ptr) +@ stdcall ReadConsoleOutputA(long ptr long long ptr) +@ stdcall ReadConsoleOutputAttribute(long ptr long long ptr) +@ stdcall ReadConsoleOutputCharacterA(long ptr long long ptr) +@ stdcall ReadConsoleOutputCharacterW(long ptr long long ptr) +@ stdcall ReadConsoleOutputW(long ptr long long ptr) +@ stdcall ReadConsoleW(long ptr long ptr ptr) +@ stdcall ReadDirectoryChangesW(long ptr long long long ptr ptr ptr) +@ stdcall ReadFile(long ptr long ptr ptr) +@ stdcall ReadFileEx(long ptr long ptr ptr) +@ stdcall ReadFileScatter(long ptr long ptr ptr) +@ stdcall ReadProcessMemory(long ptr ptr long ptr) +@ stdcall RegisterApplicationRestart(wstr long) +@ stub RegisterConsoleIME +@ stub RegisterConsoleOS2 +@ stub RegisterConsoleVDM +@ stub RegisterServiceProcess +@ stub RegisterSysMsgHandler +@ stub RegisterWaitForInputIdle +@ stdcall RegisterWaitForSingleObject(ptr long ptr ptr long long) +@ stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) +@ stub RegisterWowBaseHandlers +@ stub RegisterWowExec +@ stdcall ReleaseActCtx(ptr) +@ stdcall ReleaseMutex(long) +@ stdcall ReleaseSemaphore(long long ptr) +@ stdcall ReleaseSRWLockExclusive(ptr) ntdll.RtlReleaseSRWLockExclusive +@ stdcall ReleaseSRWLockShared(ptr) ntdll.RtlReleaseSRWLockShared +@ stdcall RemoveDirectoryA(str) +@ stdcall RemoveDirectoryW(wstr) +@ stub RemoveLocalAlternateComputerNameA +@ stub RemoveLocalAlternateComputerNameW +@ stdcall RemoveVectoredExceptionHandler(ptr) ntdll.RtlRemoveVectoredExceptionHandler +@ stdcall ReplaceFile(wstr wstr wstr long ptr ptr) ReplaceFileW +@ stdcall ReplaceFileA(str str str long ptr ptr) +@ stdcall ReplaceFileW(wstr wstr wstr long ptr ptr) +@ stub RequestDeviceWakeup +@ stdcall RequestWakeupLatency(long) +@ stdcall ResetEvent(long) +@ stub ResetWriteWatch +@ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error +@ stdcall ResumeThread(long) +@ stdcall RtlCaptureContext(ptr) ntdll.RtlCaptureContext +@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace +@ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory +@ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory +@ stdcall RtlUnwind(ptr ptr ptr long) ntdll.RtlUnwind +@ stdcall RtlZeroMemory(ptr long) ntdll.RtlZeroMemory +@ stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr) +@ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) +@ stdcall SearchPathA(str str str long ptr ptr) +@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) +@ stdcall SetCPGlobal(long) +@ stdcall SetCalendarInfoA(long long long str) +@ stdcall SetCalendarInfoW(long long long wstr) +@ stub SetClientTimeZoneInformation +@ stub SetComPlusPackageInstallStatus +@ stdcall SetCommBreak(long) +@ stdcall SetCommConfig(long ptr long) +@ stdcall SetCommMask(long ptr) +@ stdcall SetCommState(long ptr) +@ stdcall SetCommTimeouts(long ptr) +@ stdcall SetComputerNameA(str) +@ stdcall SetComputerNameExA(long str) +@ stdcall SetComputerNameExW(long wstr) +@ stdcall SetComputerNameW(wstr) +@ stdcall SetConsoleActiveScreenBuffer(long) +@ stdcall SetConsoleCP(long) +@ stub SetConsoleCommandHistoryMode +@ stdcall SetConsoleCtrlHandler(ptr long) +@ stub SetConsoleCursor +@ stdcall SetConsoleCursorInfo(long ptr) +@ stub SetConsoleCursorMode +@ stdcall SetConsoleCursorPosition(long long) +@ stdcall SetConsoleDisplayMode(long long ptr) +@ stub SetConsoleFont +@ stub SetConsoleHardwareState +@ stub SetConsoleIcon +@ stdcall SetConsoleInputExeNameA(ptr) +@ stdcall SetConsoleInputExeNameW(ptr) +@ stub SetConsoleKeyShortcuts +@ stub SetConsoleLocalEUDC +@ stub SetConsoleMaximumWindowSize +@ stub SetConsoleMenuClose +@ stdcall SetConsoleMode(long long) +@ stub SetConsoleNlsMode +@ stub SetConsoleNumberOfCommandsA +@ stub SetConsoleNumberOfCommandsW +@ stub SetConsoleOS2OemFormat +@ stdcall SetConsoleOutputCP(long) +@ stub SetConsolePalette +@ stdcall SetConsoleScreenBufferSize(long long) +@ stdcall SetConsoleTextAttribute(long long) +@ stdcall SetConsoleTitleA(str) +@ stdcall SetConsoleTitleW(wstr) +@ stdcall SetConsoleWindowInfo(long long ptr) +@ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount +@ stdcall SetCurrentDirectoryA(str) +@ stdcall SetCurrentDirectoryW(wstr) +@ stub SetDaylightFlag +@ stdcall SetDefaultCommConfigA(str ptr long) +@ stdcall SetDefaultCommConfigW(wstr ptr long) +@ stdcall SetDllDirectoryA(str) +@ stdcall SetDllDirectoryW(wstr) +@ stdcall SetEndOfFile(long) +@ stdcall SetEnvironmentVariableA(str str) +@ stdcall SetEnvironmentVariableW(wstr wstr) +@ stdcall SetErrorMode(long) +@ stdcall SetEvent(long) +@ stdcall SetFileApisToANSI() +@ stdcall SetFileApisToOEM() +@ stdcall SetFileAttributesA(str long) +@ stdcall SetFileAttributesW(wstr long) +@ stdcall SetFilePointer(long long ptr long) +@ stdcall SetFilePointerEx(long double ptr long) +@ stub SetFileShortNameA +@ stub SetFileShortNameW +@ stdcall SetFileTime(long ptr ptr ptr) +@ stub SetFileValidData +@ stub SetFirmwareEnvironmentVariableA +@ stub SetFirmwareEnvironmentVariableW +@ stdcall SetHandleContext(long long) +@ stdcall SetHandleCount(long) +@ stdcall SetHandleInformation(long long long) +@ stub SetInformationJobObject +@ stub SetastConsoleEventActive +@ stdcall SetLastError(long) +@ stub SetocalPrimaryComputerNameA +@ stub SetocalPrimaryComputerNameW +@ stdcall SetLocalTime(ptr) +@ stdcall SetLocaleInfoA(long long str) +@ stdcall SetLocaleInfoW(long long wstr) +@ stdcall SetMailslotInfo(long long) +@ stub SetMessageWaitingIndicator +@ stdcall SetNamedPipeHandleState(long ptr ptr ptr) +@ stdcall SetPriorityClass(long long) +@ stdcall SetProcessAffinityMask(long long) +@ stdcall SetProcessPriorityBoost(long long) +@ stdcall SetProcessShutdownParameters(long long) +@ stdcall SetProcessWorkingSetSize(long long long) +@ stdcall SetStdHandle(long long) +@ stdcall SetSystemPowerState(long long) +@ stdcall SetSystemTime(ptr) +@ stdcall SetSystemTimeAdjustment(long long) +@ stdcall SetTapeParameters(ptr long ptr) +@ stdcall SetTapePosition(ptr long long long long long) +@ stdcall SetTermsrvAppInstallMode(long) +@ stdcall SetThreadAffinityMask(long long) +@ stdcall SetThreadContext(long ptr) +@ stdcall SetThreadExecutionState(long) +@ stdcall SetThreadIdealProcessor(long long) +@ stdcall SetThreadLocale(long) +@ stdcall SetThreadPriority(long long) +@ stdcall SetThreadPriorityBoost(long long) +@ stdcall SetThreadUILanguage(long) +@ stdcall SetTimeZoneInformation(ptr) +@ stub SetTimerQueueTimer +@ stdcall SetUnhandledExceptionFilter(ptr) +@ stdcall SetUserGeoID(long) +@ stub SetVDMCurrentDirectories +@ stdcall SetVolumeLabelA(str str) +@ stdcall SetVolumeLabelW(wstr wstr) +@ stub SetVolumeMountPointA +@ stub SetVolumeMountPointW +@ stdcall SetWaitableTimer(long ptr long ptr ptr long) +@ stdcall SetupComm(long long long) +@ stub ShowConsoleCursor +@ stdcall SignalObjectAndWait(long long long long) +@ stdcall SizeofResource(long long) +@ stdcall Sleep(long) +@ stdcall SleepEx(long long) +@ stdcall SuspendThread(long) +@ stdcall SwitchToFiber(ptr) +@ stdcall SwitchToThread() +@ stdcall SystemTimeToFileTime(ptr ptr) +@ stdcall SystemTimeToTzSpecificLocalTime (ptr ptr ptr) +@ stub TerminateJobObject +@ stdcall TerminateProcess(long long) +@ stdcall TerminateThread(long long) +@ stdcall TermsrvAppInstallMode() +@ stdcall Thread32First(long ptr) +@ stdcall Thread32Next(long ptr) +@ stdcall TlsAlloc() +@ stub TlsAllocInternal +@ stdcall TlsFree(long) +@ stub TlsFreeInternal +@ stdcall TlsGetValue(long) +@ stdcall TlsSetValue(long ptr) +@ stdcall Toolhelp32ReadProcessMemory(long ptr ptr long ptr) +@ stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) +@ stdcall TransmitCommChar(long long) +@ stdcall TrimVirtualBuffer(ptr) +@ stdcall TryEnterCriticalSection(ptr) ntdll.RtlTryEnterCriticalSection +@ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) +@ stdcall UTRegister(long str str str ptr ptr ptr) +@ stdcall UTUnRegister(long) +@ stdcall UnhandledExceptionFilter(ptr) +@ stdcall UnlockFile(long long long long long) +@ stdcall UnlockFileEx(long long long long ptr) +@ stdcall UnmapViewOfFile(ptr) +@ stub UnregisterConsoleIME +@ stdcall UnregisterWait(long) +@ stdcall UnregisterWaitEx(long long) +@ stdcall UpdateResourceA(long str str long ptr long) +@ stdcall UpdateResourceW(long wstr wstr long ptr long) +@ stub VDMConsoleOperation +@ stub VDMOperationStarted +@ stub ValidateCType +@ stub ValidatLeocale +@ stdcall VerLanguageNameA(long str long) +@ stdcall VerLanguageNameW(long wstr long) +@ stdcall -ret64 VerSetConditionMask(long long long long) ntdll.VerSetConditionMask +@ stdcall VerifyConsoleIoHandle(long) +@ stdcall VerifyVersionInfoA(long long double) +@ stdcall VerifyVersionInfoW(long long double) +@ stdcall VirtualAlloc(ptr long long long) +@ stdcall VirtualAllocEx(long ptr long long long) +@ stub VirtualBufferExceptionHandler +@ stdcall VirtualFree(ptr long long) +@ stdcall VirtualFreeEx(long ptr long long) +@ stdcall VirtualLock(ptr long) +@ stdcall VirtualProtect(ptr long long ptr) +@ stdcall VirtualProtectEx(long ptr long long ptr) +@ stdcall VirtualQuery(ptr ptr long) +@ stdcall VirtualQueryEx(long ptr ptr long) +@ stdcall VirtualUnlock(ptr long) +@ stdcall WakeAllConditionVariable(ptr) ntdll.RtlWakeAllConditionVariable +@ stdcall WakeConditionVariable(ptr) ntdll.RtlWakeConditionVariable +@ stdcall WaitCommEvent(long ptr ptr) +@ stdcall WaitForDebugEvent(ptr long) +@ stdcall WaitForMultipleObjects(long ptr long long) +@ stdcall WaitForMultipleObjectsEx(long ptr long long long) +@ stdcall WaitForSingleObject(long long) +@ stdcall WaitForSingleObjectEx(long long long) +@ stdcall WaitNamedPipeA (str long) +@ stdcall WaitNamedPipeW (wstr long) +@ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) +@ stdcall WinExec(str long) +@ stdcall Wow64EnableWow64FsRedirection(long) +@ stdcall Wow64DisableWow64FsRedirection(long) +@ stdcall Wow64RevertWow64FsRedirection(long) +@ stdcall WriteConsoleA(long ptr long ptr ptr) +@ stdcall WriteConsoleInputA(long ptr long ptr) +@ stub WriteConsoleInputVDMA +@ stub WriteConsoleInputVDMW +@ stdcall WriteConsoleInputW(long ptr long ptr) +@ stdcall WriteConsoleOutputA(long ptr long long ptr) +@ stdcall WriteConsoleOutputAttribute(long ptr long long ptr) +@ stdcall WriteConsoleOutputCharacterA(long ptr long long ptr) +@ stdcall WriteConsoleOutputCharacterW(long ptr long long ptr) +@ stdcall WriteConsoleOutputW(long ptr long long ptr) +@ stdcall WriteConsoleW(long ptr long ptr ptr) +@ stdcall WriteFile(long ptr long ptr ptr) +@ stdcall WriteFileEx(long ptr long ptr ptr) +@ stdcall WriteFileGather(long ptr long ptr ptr) +@ stdcall WritePrivateProfileSectionA(str str str) +@ stdcall WritePrivateProfileSectionW(wstr wstr wstr) +@ stdcall WritePrivateProfileStringA(str str str str) +@ stdcall WritePrivateProfileStringW(wstr wstr wstr wstr) +@ stdcall WritePrivateProfileStructA (str str ptr long str) +@ stdcall WritePrivateProfileStructW(wstr wstr ptr long wstr) +@ stdcall WriteProcessMemory(long ptr ptr long ptr) +@ stdcall WriteProfileSectionA(str str) +@ stdcall WriteProfileSectionW(str str) +@ stdcall WriteProfileStringA(str str str) +@ stdcall WriteProfileStringW(wstr wstr wstr) +@ stdcall WriteTapemark(ptr long long long) +@ stdcall WTSGetActiveConsoleSessionId() +@ stdcall ZombifyActCtx(ptr) +@ stub _DebugOut +@ stub _DebugPrintf +@ stdcall _hread(long ptr long) +@ stdcall _hwrite(long ptr long) +@ stdcall _lclose(long) +@ stdcall _lcreat(str long) +@ stdcall _llseek(long long long) +@ stdcall _lopen(str long) +@ stdcall _lread(long ptr long) _hread +@ stdcall _lwrite(long ptr long) _hwrite +@ stub dprintf +@ stdcall lstrcat(str str) lstrcatA +@ stdcall lstrcatA(str str) +@ stdcall lstrcatW(wstr wstr) +@ stdcall lstrcmp(str str) lstrcmpA +@ stdcall lstrcmpA(str str) +@ stdcall lstrcmpW(wstr wstr) +@ stdcall lstrcmpi(str str) lstrcmpiA +@ stdcall lstrcmpiA(str str) +@ stdcall lstrcmpiW(wstr wstr) +@ stdcall lstrcpy(ptr str) lstrcpyA +@ stdcall lstrcpyA(ptr str) +@ stdcall lstrcpyW(ptr wstr) +@ stdcall lstrcpyn(ptr str long) lstrcpynA +@ stdcall lstrcpynA(ptr str long) +@ stdcall lstrcpynW(ptr wstr long) +@ stdcall lstrlen(str) lstrlenA +@ stdcall lstrlenA(str) +@ stdcall lstrlenW(wstr) + +#EOF diff --git a/reactos/dll/win32/kernel32/misc/dllmain.c b/reactos/dll/win32/kernel32/misc/dllmain.c index e1f9a5b53d6..958a4076d95 100644 --- a/reactos/dll/win32/kernel32/misc/dllmain.c +++ b/reactos/dll/win32/kernel32/misc/dllmain.c @@ -407,6 +407,7 @@ InterlockedDecrement(IN OUT LONG volatile *lpAddend) return _InterlockedDecrement(lpAddend); } +#undef InterlockedExchange LONG WINAPI InterlockedExchange(IN OUT LONG volatile *Target, diff --git a/reactos/dll/win32/kernel32/misc/handle.c b/reactos/dll/win32/kernel32/misc/handle.c index 1a61ba19043..99a550d1b43 100644 --- a/reactos/dll/win32/kernel32/misc/handle.c +++ b/reactos/dll/win32/kernel32/misc/handle.c @@ -40,7 +40,7 @@ GetHandleInformation (HANDLE hObject, DWORD Flags; Ppb = NtCurrentPeb()->ProcessParameters; - switch ((ULONG)hObject) + switch ((ULONG_PTR)hObject) { case STD_INPUT_HANDLE: hObject = Ppb->StandardInput; diff --git a/reactos/dll/win32/kernel32/misc/stubs.c b/reactos/dll/win32/kernel32/misc/stubs.c index d197b4acdde..b11385b2bd7 100644 --- a/reactos/dll/win32/kernel32/misc/stubs.c +++ b/reactos/dll/win32/kernel32/misc/stubs.c @@ -1401,3 +1401,15 @@ Wow64RevertWow64FsRedirection (VOID * pv) STUB; return FALSE; } + +BOOL WINAPI TermsrvAppInstallMode(void) +{ + STUB; + return FALSE; +} + +DWORD WINAPI SetTermsrvAppInstallMode(BOOL bInstallMode) +{ + STUB; + return 0; +} diff --git a/reactos/dll/win32/kernel32/misc/utils.c b/reactos/dll/win32/kernel32/misc/utils.c index 6048b15fb76..dc663f0ff03 100644 --- a/reactos/dll/win32/kernel32/misc/utils.c +++ b/reactos/dll/win32/kernel32/misc/utils.c @@ -11,6 +11,8 @@ #include #ifdef _M_IX86 #include "i386/ketypes.h" +#elif defined _M_AMD64 +#include "amd64/ketypes.h" #endif #define NDEBUG @@ -336,7 +338,7 @@ BasepInitializeContext(IN PCONTEXT Context, IN PVOID StackAddress, IN ULONG ContextType) { -#ifdef _M_IX86 +#ifdef __i386__ DPRINT("BasepInitializeContext: %p\n", Context); /* Setup the Initial Win32 Thread Context */ @@ -362,7 +364,7 @@ BasepInitializeContext(IN PCONTEXT Context, } else if (ContextType == 2) /* For Fibers */ { - //Context->Eip = (ULONG)BaseFiberStartup; + Context->Eip = (ULONG)BaseFiberStartup; } else /* For first thread in a Process */ { @@ -374,6 +376,44 @@ BasepInitializeContext(IN PCONTEXT Context, /* Give it some room for the Parameter */ Context->Esp -= sizeof(PVOID); +#elif defined(__x86_64__) + DPRINT("BasepInitializeContext: %p\n", Context); + + /* Setup the Initial Win32 Thread Context */ + Context->Rax = (ULONG_PTR)StartAddress; + Context->Rbx = (ULONG_PTR)Parameter; + Context->Rsp = (ULONG_PTR)StackAddress; + /* The other registers are undefined */ + + /* Setup the Segments */ + Context->SegFs = KGDT_R3_TEB | RPL_MASK; + Context->SegEs = KGDT_R3_DATA | RPL_MASK; + Context->SegDs = KGDT_R3_DATA | RPL_MASK; + Context->SegCs = KGDT_R3_CODE | RPL_MASK; + Context->SegSs = KGDT_R3_DATA | RPL_MASK; + Context->SegGs = 0; + + /* Set the EFLAGS */ + Context->EFlags = 0x3000; /* IOPL 3 */ + + if (ContextType == 1) /* For Threads */ + { + Context->Rip = (ULONG_PTR)BaseThreadStartupThunk; + } + else if (ContextType == 2) /* For Fibers */ + { + Context->Rip = (ULONG_PTR)BaseFiberStartup; + } + else /* For first thread in a Process */ + { + Context->Rip = (ULONG_PTR)BaseProcessStartThunk; + } + + /* Set the Context Flags */ + Context->ContextFlags = CONTEXT_FULL; + + /* Give it some room for the Parameter */ + Context->Rsp -= sizeof(PVOID); #else #warning Unknown architecture UNIMPLEMENTED; diff --git a/reactos/dll/win32/kernel32/process/session.c b/reactos/dll/win32/kernel32/process/session.c index b87f5c31120..79d3842e7ac 100644 --- a/reactos/dll/win32/kernel32/process/session.c +++ b/reactos/dll/win32/kernel32/process/session.c @@ -60,7 +60,7 @@ BOOL STDCALL ProcessIdToSessionId (IN DWORD dwProcessId, return FALSE; } - ClientId.UniqueProcess = (HANDLE)dwProcessId; + ClientId.UniqueProcess = (HANDLE)(ULONG_PTR)dwProcessId; ClientId.UniqueThread = 0; InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); diff --git a/reactos/dll/win32/kernel32/synch/critical.c b/reactos/dll/win32/kernel32/synch/critical.c index 474a5d6c543..ce3844d6a67 100644 --- a/reactos/dll/win32/kernel32/synch/critical.c +++ b/reactos/dll/win32/kernel32/synch/critical.c @@ -55,4 +55,14 @@ InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, return TRUE; } +/* + * @implemented + */ +BOOL WINAPI InitializeCriticalSectionEx( CRITICAL_SECTION *crit, DWORD spincount, DWORD flags ) +{ + NTSTATUS ret = RtlInitializeCriticalSectionEx( crit, spincount, flags ); + if (ret) RtlRaiseStatus( ret ); + return !ret; +} + /* EOF */ diff --git a/reactos/dll/win32/kernel32/thread/amd64/fiber.S b/reactos/dll/win32/kernel32/thread/amd64/fiber.S new file mode 100644 index 00000000000..00b3a17fb34 --- /dev/null +++ b/reactos/dll/win32/kernel32/thread/amd64/fiber.S @@ -0,0 +1,124 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/kernel32/thread/i386/fiber.S + * PURPOSE: Fiber context switch code for the x86 architecture + * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) + * KJK::Hyperion + */ + +#include + +#define CONTEXT_FULL 0x10007 +#define CONTEXT_FLOATING_POINT 0xF + +.globl _SwitchToFiber@4 +.intel_syntax noprefix + +_SwitchToFiber@4: + /* Get the TEB */ + mov edx, fs:[KGDT_R3_TEB] + + /* Get the Fiber */ + mov eax, [edx+TEB_FIBER_DATA] + + /* Save the non-volatile registers */ + mov [eax+FIBER_CONTEXT_EBX], ebx + mov [eax+FIBER_CONTEXT_ESI], esi + mov [eax+FIBER_CONTEXT_EDI], edi + mov [eax+FIBER_CONTEXT_EBP], ebp + + /* Check if we're to save FPU State */ + cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL + CONTEXT_FLOATING_POINT + jnz NoFpuStateSave + + /* Save the FPU State (Status and Control)*/ + fstsw [eax+FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD] + fstcw [eax+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] + + /* Check if the CPU supports SIMD MXCSR State Save */ + cmp byte ptr ds:[PROCESSOR_FEATURE_FXSR], 0 + jnz NoFpuStateSave + stmxcsr [eax+FIBER_CONTEXT_DR6] + +NoFpuStateSave: + + /* Save stack since we're not touching it anymore */ + mov [eax+FIBER_CONTEXT_ESP], esp + + /* Transfer some data from the TEB */ + mov ecx, [edx+TEB_FLS_DATA] + mov [eax+FIBER_FLS_DATA], ecx + mov ecx, [edx+TEB_ACTIVATION_CONTEXT_STACK_POINTER] + mov [eax+FIBER_ACTIVATION_CONTEXT_STACK], ecx + + /* Transfer some data related to the Stack */ + mov ecx, [edx+TEB_EXCEPTION_LIST] + mov [eax+FIBER_EXCEPTION_LIST], ecx + mov ecx, [edx+TEB_STACK_LIMIT] + mov [eax+FIBER_STACK_LIMIT], ecx + mov ecx, [edx+TEB_GUARANTEED_STACK_BYTES] + mov [eax+FIBER_GUARANTEED_STACK_BYTES], ecx + + /* Switch to the new fiber */ + mov ecx, [esp+4] + mov [edx+TEB_FIBER_DATA], ecx + + /* Switch Fiber Data */ + mov esi, [ecx+FIBER_EXCEPTION_LIST] + mov [edx+TEB_EXCEPTION_LIST], esi + mov esi, [ecx+FIBER_STACK_BASE] + mov [edx+TEB_STACK_BASE], esi + mov esi, [ecx+FIBER_STACK_LIMIT] + mov [edx+TEB_STACK_LIMIT], esi + mov esi, [ecx+FIBER_DEALLOCATION_STACK] + mov [edx+TEB_DEALLOCATION_STACK], esi + mov esi, [ecx+FIBER_GUARANTEED_STACK_BYTES] + mov [edx+TEB_GUARANTEED_STACK_BYTES], esi + mov esi, [ecx+FIBER_ACTIVATION_CONTEXT_STACK] + mov [edx+TEB_ACTIVATION_CONTEXT_STACK_POINTER], esi + + /* Restore FPU State */ + cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL + CONTEXT_FLOATING_POINT + jnz NoFpuStateRestore + + /* Check if the Status Word Changed */ + mov esi, [eax+FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD] + cmp si, word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD] + jnz StatusWordChanged + + /* Check if the Control Word Changed */ + mov esi, [eax+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] + cmp si, word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] + jz ControlWordEqual + +StatusWordChanged: + + /* Load the new one */ + mov word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_TAG_WORD], 0xFFFF + fldenv [ecx+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] + +ControlWordEqual: + + /* Load the new one */ + cmp byte ptr ds:[PROCESSOR_FEATURE_FXSR], 0 + jnz NoFpuStateRestore + ldmxcsr [ecx+FIBER_CONTEXT_DR6] + +NoFpuStateRestore: + + /* Restore non-volatile registers */ + mov esi, [ecx+FIBER_CONTEXT_ESI] + mov edi, [ecx+FIBER_CONTEXT_EDI] + mov ebx, [ecx+FIBER_CONTEXT_EBX] + mov ebp, [ecx+FIBER_CONTEXT_EBP] + mov esp, [ecx+FIBER_CONTEXT_ESP] + + /* Restore FLS Data */ + mov eax, [ecx+FIBER_FLS_DATA] + mov [edx+TEB_FLS_DATA], eax + + /* Return */ + ret 4 + +/* EOF */ diff --git a/reactos/dll/win32/kernel32/thread/amd64/thread.S b/reactos/dll/win32/kernel32/thread/amd64/thread.S new file mode 100644 index 00000000000..36bc0c31b14 --- /dev/null +++ b/reactos/dll/win32/kernel32/thread/amd64/thread.S @@ -0,0 +1,32 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/kernel32/thread/i386/thread.S + * PURPOSE: Thread Start Thunks + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + */ + +.globl _BaseThreadStartupThunk@0 +.globl _BaseProcessStartThunk@0 +.intel_syntax noprefix + +_BaseThreadStartupThunk@0: + + /* Start out fresh */ + xor rbp, rbp + + push rbx /* lpParameter */ + push rax /* lpStartAddress */ + push 0 /* Return RIP */ + jmp _BaseThreadStartup + +_BaseProcessStartThunk@0: + + /* Start out fresh */ + xor rbp, rbp + + push rax /* lpStartAddress */ + push 0 /* Return RIP */ + jmp _BaseProcessStartup + +/* EOF */ diff --git a/reactos/dll/win32/kernel32/thread/fiber.c b/reactos/dll/win32/kernel32/thread/fiber.c index 56fe5898b49..50dd9b45010 100644 --- a/reactos/dll/win32/kernel32/thread/fiber.c +++ b/reactos/dll/win32/kernel32/thread/fiber.c @@ -258,6 +258,13 @@ BaseFiberStartup(VOID) DPRINT1("Starting Fiber\n"); BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Eax, (LPVOID)Fiber->Context.Ebx); +#elif defined(__x86_64__) + PFIBER Fiber = GetFiberData(); + + /* Call the Thread Startup Routine */ + DPRINT1("Starting Fiber\n"); + BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Rax, + (LPVOID)Fiber->Context.Rbx); #else #warning Unknown architecture UNIMPLEMENTED; diff --git a/reactos/dll/win32/kernel32/thread/thread.c b/reactos/dll/win32/kernel32/thread/thread.c index 1d003ef6b3e..c208aa9d9f4 100644 --- a/reactos/dll/win32/kernel32/thread/thread.c +++ b/reactos/dll/win32/kernel32/thread/thread.c @@ -658,6 +658,7 @@ GetThreadSelectorEntry(IN HANDLE hThread, IN DWORD dwSelector, OUT LPLDT_ENTRY lpSelectorEntry) { +#ifdef _M_IX86 DESCRIPTOR_TABLE_ENTRY DescriptionTableEntry; NTSTATUS Status; @@ -675,6 +676,10 @@ GetThreadSelectorEntry(IN HANDLE hThread, *lpSelectorEntry = DescriptionTableEntry.Descriptor; return TRUE; +#else + DPRINT1("Calling GetThreadSelectorEntry!\n"); + return FALSE; +#endif } /* From b77079a4d8f1f0a22e983bf50421d51bbb2dddf6 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 11:33:42 +0000 Subject: [PATCH 027/388] Fix multiple 64bit warnings svn path=/branches/ros-amd64-bringup/; revision=34771 --- reactos/base/applications/calc/winmain.c | 2 +- reactos/base/applications/charmap/about.c | 2 +- reactos/base/applications/control/control.c | 2 +- reactos/base/applications/control/control.h | 2 +- reactos/base/applications/dxdiag/display.c | 2 +- reactos/base/applications/dxdiag/dxdiag.c | 10 +++++----- reactos/base/applications/dxdiag/sound.c | 2 +- .../games/solitaire/cardlib/cardbutton.cpp | 2 +- .../games/solitaire/cardlib/cardrgndraw.cpp | 2 +- .../games/solitaire/cardlib/cardwindow.cpp | 2 +- reactos/base/applications/games/solitaire/solgame.cpp | 4 ++-- reactos/base/applications/games/winemine/dialog.h | 8 ++++---- reactos/base/applications/msconfig/msconfig.c | 2 +- reactos/base/applications/msconfig/startuppage.c | 6 +++--- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/reactos/base/applications/calc/winmain.c b/reactos/base/applications/calc/winmain.c index 86ffe56ad61..9c83b347dad 100644 --- a/reactos/base/applications/calc/winmain.c +++ b/reactos/base/applications/calc/winmain.c @@ -1303,7 +1303,7 @@ static LRESULT CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) SetFocus(GetDlgItem(hWnd, IDC_BUTTON_FOCUS)); switch (LOWORD(wp)) { case IDM_HELP_ABOUT: - DialogBox(calc.hInstance,MAKEINTRESOURCE(IDD_DIALOG_ABOUT), hWnd, AboutDlgProc); + DialogBox(calc.hInstance,MAKEINTRESOURCE(IDD_DIALOG_ABOUT), hWnd,(DLGPROC) AboutDlgProc); return TRUE; case IDM_HELP_HELP: #ifndef DISABLE_HTMLHELP_SUPPORT diff --git a/reactos/base/applications/charmap/about.c b/reactos/base/applications/charmap/about.c index 464591ee1c6..91b2ebbb3a2 100644 --- a/reactos/base/applications/charmap/about.c +++ b/reactos/base/applications/charmap/about.c @@ -79,5 +79,5 @@ ShowAboutDlg(HWND hWndParent) DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_ABOUTBOX), hWndParent, - AboutDialogProc); + (DLGPROC)AboutDialogProc); } diff --git a/reactos/base/applications/control/control.c b/reactos/base/applications/control/control.c index 660c40a0073..866146ef42c 100644 --- a/reactos/base/applications/control/control.c +++ b/reactos/base/applications/control/control.c @@ -23,7 +23,7 @@ OpenShellFolder(LPTSTR lpFolderCLSID) _tcscpy(szParameters, _T("/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")); _tcscat(szParameters, lpFolderCLSID); - return (int)ShellExecute(NULL, _T("open"), _T("explorer.exe"), szParameters, NULL, SW_SHOWDEFAULT) > 32; + return (INT)(INT_PTR)ShellExecute(NULL, _T("open"), _T("explorer.exe"), szParameters, NULL, SW_SHOWDEFAULT) > 32; } static INT diff --git a/reactos/base/applications/control/control.h b/reactos/base/applications/control/control.h index 4fbc9bc3302..c9fd9bd7047 100644 --- a/reactos/base/applications/control/control.h +++ b/reactos/base/applications/control/control.h @@ -15,4 +15,4 @@ /* Macro for calling "rundll32.exe" According to MSDN, ShellExecute returns a value greater than 32 if the operation was successful. */ -#define RUNDLL(param) ((int)ShellExecute(NULL, _T("open"), _T("rundll32.exe"), (param), NULL, SW_SHOWDEFAULT) > 32) +#define RUNDLL(param) ((int)(INT_PTR)ShellExecute(NULL, _T("open"), _T("rundll32.exe"), (param), NULL, SW_SHOWDEFAULT) > 32) diff --git a/reactos/base/applications/dxdiag/display.c b/reactos/base/applications/dxdiag/display.c index 6542034af6d..8b4c02bb7ba 100644 --- a/reactos/base/applications/dxdiag/display.c +++ b/reactos/base/applications/dxdiag/display.c @@ -338,7 +338,7 @@ void InitializeDisplayAdapters(PDXDIAG_CONTEXT pContext) break; pContext->hDisplayWnd = hDlgs; - hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG), pContext->hMainDialog, DisplayPageWndProc, (LPARAM)pContext); + hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG), pContext->hMainDialog, (DLGPROC)DisplayPageWndProc, (LPARAM)pContext); if (!hwndDlg) break; diff --git a/reactos/base/applications/dxdiag/dxdiag.c b/reactos/base/applications/dxdiag/dxdiag.c index 0e6330d3b0d..787650907f1 100644 --- a/reactos/base/applications/dxdiag/dxdiag.c +++ b/reactos/base/applications/dxdiag/dxdiag.c @@ -119,11 +119,11 @@ InitializeTabCtrl(HWND hwndDlg, PDXDIAG_CONTEXT pContext) pContext->hTabCtrl = hTabCtrlWnd; /* create the dialogs */ - pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hTabCtrlWnd, SystemPageWndProc, (LPARAM)pContext); - pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hTabCtrlWnd, MusicPageWndProc, (LPARAM)pContext); - pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hTabCtrlWnd, InputPageWndProc, (LPARAM)pContext); - pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hTabCtrlWnd, NetworkPageWndProc, (LPARAM)pContext); - pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, HelpPageWndProc, (LPARAM)pContext); + pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hTabCtrlWnd, (DLGPROC)SystemPageWndProc, (LPARAM)pContext); + pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hTabCtrlWnd, (DLGPROC)MusicPageWndProc, (LPARAM)pContext); + pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hTabCtrlWnd, (DLGPROC)InputPageWndProc, (LPARAM)pContext); + pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hTabCtrlWnd, (DLGPROC)NetworkPageWndProc, (LPARAM)pContext); + pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, (DLGPROC)HelpPageWndProc, (LPARAM)pContext); /* insert tab ctrl items */ diff --git a/reactos/base/applications/dxdiag/sound.c b/reactos/base/applications/dxdiag/sound.c index 47c66f439bd..0b8c2a6e619 100644 --- a/reactos/base/applications/dxdiag/sound.c +++ b/reactos/base/applications/dxdiag/sound.c @@ -209,7 +209,7 @@ BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR l return FALSE; pContext->hSoundWnd = hDlgs; - hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG), pContext->hMainDialog, SoundPageWndProc, (LPARAM)pContext); + hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG), pContext->hMainDialog, (DLGPROC)SoundPageWndProc, (LPARAM)pContext); if (!hwndDlg) return FALSE; diff --git a/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp b/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp index 66e7e77a18d..1722624f59c 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp @@ -326,7 +326,7 @@ int CardButton::OnLButtonUp(HWND hwnd, int x, int y) else { HWND hwnd = (HWND)parentWnd; - SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(id, BN_CLICKED), (LONG)hwnd); + SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(id, BN_CLICKED), (LONG_PTR)hwnd); } } } diff --git a/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp b/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp index 4c95613b338..84b748332be 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp @@ -298,7 +298,7 @@ void CardRegion::Render(HDC hdc) else fDrawTips = TRUE; - if(yoffset != 0 && abs(xoffset) == 1 || xoffset != 0 && abs(yoffset) == 1) + if((yoffset != 0 && abs(xoffset) == 1) || (xoffset != 0 && abs(yoffset) == 1)) fDrawTips = TRUE; //draw horizontal strips diff --git a/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp b/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp index 400985e1215..3b01a0b650a 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp @@ -366,7 +366,7 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM // // associate this class with the window // - SetWindowLong(hwnd, 0, (LONG)cs->lpCreateParams); + SetWindowLong(hwnd, 0, (LONG_PTR)cs->lpCreateParams); return 1; diff --git a/reactos/base/applications/games/solitaire/solgame.cpp b/reactos/base/applications/games/solitaire/solgame.cpp index 6b61783d6c0..5eed2aa8f76 100644 --- a/reactos/base/applications/games/solitaire/solgame.cpp +++ b/reactos/base/applications/games/solitaire/solgame.cpp @@ -117,8 +117,8 @@ bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, const CardStack &dragca } //can only drop if card is different colour - if( mystack[0].IsBlack() && !dragcard.IsRed() || - !mystack[0].IsBlack() && dragcard.IsRed() ) + if( (mystack[0].IsBlack() && !dragcard.IsRed()) || + (!mystack[0].IsBlack() && dragcard.IsRed()) ) { TRACE("EXIT RowStackDropProc(false)\n"); return false; diff --git a/reactos/base/applications/games/winemine/dialog.h b/reactos/base/applications/games/winemine/dialog.h index 9f5471f8a16..0de5ae2b82f 100644 --- a/reactos/base/applications/games/winemine/dialog.h +++ b/reactos/base/applications/games/winemine/dialog.h @@ -19,7 +19,7 @@ */ -BOOL CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); -BOOL CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); -BOOL CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); -BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); +INT_PTR CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); diff --git a/reactos/base/applications/msconfig/msconfig.c b/reactos/base/applications/msconfig/msconfig.c index 3e4ce7c000c..117bf74efbc 100644 --- a/reactos/base/applications/msconfig/msconfig.c +++ b/reactos/base/applications/msconfig/msconfig.c @@ -173,7 +173,7 @@ MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_NOTIFY: - idctrl = (int)wParam; + idctrl = wParam; pnmh = (LPNMHDR)lParam; if ((pnmh->hwndFrom == hTabWnd) && (pnmh->idFrom == IDC_TAB) && diff --git a/reactos/base/applications/msconfig/startuppage.c b/reactos/base/applications/msconfig/startuppage.c index b30219fca4f..30ac5ca2ada 100644 --- a/reactos/base/applications/msconfig/startuppage.c +++ b/reactos/base/applications/msconfig/startuppage.c @@ -183,12 +183,12 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ) SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); } - switch (PtrToLong(hRootKey)) + switch (((LONG_PTR)HKEY_LOCAL_MACHINE) & 0xff) { - case PtrToLong(HKEY_LOCAL_MACHINE): + case (((LONG_PTR)HKEY_LOCAL_MACHINE) & 0xff): _tcscpy(Path, _T("HKLM\\\0")); break; - case PtrToLong(HKEY_CURRENT_USER): + case (((LONG_PTR)HKEY_CURRENT_USER) & 0xff): _tcscpy(Path, _T("HKCU\\\0")); break; default: From fe5640712e24a7b7f2d5092e528f8904beff9781 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 12:05:01 +0000 Subject: [PATCH 028/388] Make calling spec file stubs a non-fatal event. svn path=/branches/ros-amd64-bringup/; revision=34772 --- reactos/tools/winebuild/spec32.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/reactos/tools/winebuild/spec32.c b/reactos/tools/winebuild/spec32.c index 1277f858bc7..266941f82e1 100644 --- a/reactos/tools/winebuild/spec32.c +++ b/reactos/tools/winebuild/spec32.c @@ -668,20 +668,16 @@ void BuildPedllFile( DLLSPEC *spec ) return; } - output( "#include \n"); - output( "#include \"windef.h\"\n"); - output( "#include \"winbase.h\"\n"); - output( "#include \"wine/config.h\"\n"); - output( "#include \"wine/exception.h\"\n\n"); + output( "#include \n"); + output( "#include \n"); - output( "void __wine_spec_unimplemented_stub( const char *module, const char *function )\n"); + output( "DWORD __wine_spec_unimplemented_stub( const char *module, const char *function )\n"); output( "{\n"); - output( " ULONG_PTR args[2];\n"); + output( " DPRINT1(\"%%s hit stub for %%s\\n\",module,function);"); output( "\n"); - output( " args[0] = (ULONG_PTR)module;\n"); - output( " args[1] = (ULONG_PTR)function;\n"); - output( " RaiseException( EXCEPTION_WINE_STUB, EH_NONCONTINUABLE, 2, args );\n"); - output( "}\n\n"); + output( " SetLastError(ERROR_CALL_NOT_IMPLEMENTED);\n"); + output( " return -1;\n"); + output( "}\n"); output( "static const char __wine_spec_file_name[] = \"%s\";\n\n", spec->file_name ); From 364d3152c9e5a58e9af92f6dda10ef4a60986e4f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 12:22:27 +0000 Subject: [PATCH 029/388] Fix a 64bit portability issue. Hack widl a bit in order to compile more code. svn path=/branches/ros-amd64-bringup/; revision=34773 --- reactos/tools/widl/client.c | 2 +- reactos/tools/widl/typegen.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/tools/widl/client.c b/reactos/tools/widl/client.c index 2eaa43c9848..710de6b2718 100644 --- a/reactos/tools/widl/client.c +++ b/reactos/tools/widl/client.c @@ -437,7 +437,7 @@ void write_client(ifref_list_t *ifaces) write_function_stubs(iface->iface, &proc_offset); print_client("#if !defined(__RPC_WIN32__)\n"); - print_client("#error Invalid build platform for this stub.\n"); + print_client("//#error Invalid build platform for this stub.\n"); print_client("#endif\n"); fprintf(client, "\n"); diff --git a/reactos/tools/widl/typegen.c b/reactos/tools/widl/typegen.c index 41dd22f2cfd..93b2c8f1215 100644 --- a/reactos/tools/widl/typegen.c +++ b/reactos/tools/widl/typegen.c @@ -2667,8 +2667,8 @@ void print_phase_basetype(FILE *file, int indent, enum remoting_phase phase, } if (phase == PHASE_MARSHAL) - print_file(file, indent, "MIDL_memset(_StubMsg.Buffer, 0, (0x%x - (long)_StubMsg.Buffer) & 0x%x);\n", alignment, alignment - 1); - print_file(file, indent, "_StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + %u) & ~0x%x);\n", + print_file(file, indent, "MIDL_memset(_StubMsg.Buffer, 0, (0x%x - (size_t)_StubMsg.Buffer) & 0x%x);\n", alignment, alignment - 1); + print_file(file, indent, "_StubMsg.Buffer = (unsigned char *)(((size_t)_StubMsg.Buffer + %u) & ~0x%x);\n", alignment - 1, alignment - 1); if (phase == PHASE_MARSHAL) From 76f94aee74536bbb07f71d92381c8cd49e7ef937 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 25 Jul 2008 12:28:50 +0000 Subject: [PATCH 030/388] merge 34755 from trunk svn path=/branches/ros-amd64-bringup/; revision=34775 --- reactos/drivers/base/bootvid/bootvid.rbuild | 3 ++- reactos/drivers/base/bootvid/bootvid.spec | 11 +++++++++++ reactos/drivers/base/bootvid/bootvid_amd64.def | 15 --------------- reactos/drivers/base/bootvid/bootvid_arm.def | 15 --------------- reactos/drivers/base/bootvid/bootvid_i386.def | 15 --------------- 5 files changed, 13 insertions(+), 46 deletions(-) create mode 100644 reactos/drivers/base/bootvid/bootvid.spec delete mode 100644 reactos/drivers/base/bootvid/bootvid_amd64.def delete mode 100644 reactos/drivers/base/bootvid/bootvid_arm.def delete mode 100644 reactos/drivers/base/bootvid/bootvid_i386.def diff --git a/reactos/drivers/base/bootvid/bootvid.rbuild b/reactos/drivers/base/bootvid/bootvid.rbuild index 4a733a2f947..d1174a8b07c 100644 --- a/reactos/drivers/base/bootvid/bootvid.rbuild +++ b/reactos/drivers/base/bootvid/bootvid.rbuild @@ -1,7 +1,7 @@ - + . ntoskrnl @@ -20,5 +20,6 @@ bootvid.rc + bootvid.spec precomp.h diff --git a/reactos/drivers/base/bootvid/bootvid.spec b/reactos/drivers/base/bootvid/bootvid.spec new file mode 100644 index 00000000000..a698522706e --- /dev/null +++ b/reactos/drivers/base/bootvid/bootvid.spec @@ -0,0 +1,11 @@ +@ stdcall VidBitBlt(ptr long long) +@ stdcall VidBufferToScreenBlt(ptr long long long long long) +@ stdcall VidCleanUp() +@ stdcall VidDisplayString(str) +@ stdcall VidDisplayStringXY(str long long long) +@ stdcall VidInitialize(long) +@ stdcall VidResetDisplay(long) +@ stdcall VidScreenToBufferBlt(ptr long long long long long) +@ stdcall VidSetScrollRegion(long long long long) +@ stdcall VidSetTextColor(long) +@ stdcall VidSolidColorFill(long long long long long) diff --git a/reactos/drivers/base/bootvid/bootvid_amd64.def b/reactos/drivers/base/bootvid/bootvid_amd64.def deleted file mode 100644 index 7d3aacc1367..00000000000 --- a/reactos/drivers/base/bootvid/bootvid_amd64.def +++ /dev/null @@ -1,15 +0,0 @@ -LIBRARY BOOTVID.DLL - -EXPORTS -VidBitBlt -VidBufferToScreenBlt -VidCleanUp -VidDisplayString -VidDisplayStringXY -VidInitialize -VidResetDisplay -VidScreenToBufferBlt -VidSetScrollRegion -VidSetTextColor -VidSolidColorFill - diff --git a/reactos/drivers/base/bootvid/bootvid_arm.def b/reactos/drivers/base/bootvid/bootvid_arm.def deleted file mode 100644 index 7d3aacc1367..00000000000 --- a/reactos/drivers/base/bootvid/bootvid_arm.def +++ /dev/null @@ -1,15 +0,0 @@ -LIBRARY BOOTVID.DLL - -EXPORTS -VidBitBlt -VidBufferToScreenBlt -VidCleanUp -VidDisplayString -VidDisplayStringXY -VidInitialize -VidResetDisplay -VidScreenToBufferBlt -VidSetScrollRegion -VidSetTextColor -VidSolidColorFill - diff --git a/reactos/drivers/base/bootvid/bootvid_i386.def b/reactos/drivers/base/bootvid/bootvid_i386.def deleted file mode 100644 index ccd481bd100..00000000000 --- a/reactos/drivers/base/bootvid/bootvid_i386.def +++ /dev/null @@ -1,15 +0,0 @@ -LIBRARY BOOTVID.DLL - -EXPORTS -VidBitBlt@12 -VidBufferToScreenBlt@24 -VidCleanUp@0 -VidDisplayString@4 -VidDisplayStringXY -VidInitialize@4 -VidResetDisplay@4 -VidScreenToBufferBlt@24 -VidSetScrollRegion@16 -VidSetTextColor@4 -VidSolidColorFill@20 - From 27fd7781102800f5e62b607f3f6938ba9da4dc9b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 25 Jul 2008 12:54:02 +0000 Subject: [PATCH 031/388] revert last commit and instead... svn path=/branches/ros-amd64-bringup/; revision=34778 --- reactos/drivers/base/bootvid/bootvid.rbuild | 3 +-- reactos/drivers/base/bootvid/bootvid.spec | 11 ----------- reactos/drivers/base/bootvid/bootvid_amd64.def | 15 +++++++++++++++ reactos/drivers/base/bootvid/bootvid_arm.def | 15 +++++++++++++++ reactos/drivers/base/bootvid/bootvid_i386.def | 15 +++++++++++++++ 5 files changed, 46 insertions(+), 13 deletions(-) delete mode 100644 reactos/drivers/base/bootvid/bootvid.spec create mode 100644 reactos/drivers/base/bootvid/bootvid_amd64.def create mode 100644 reactos/drivers/base/bootvid/bootvid_arm.def create mode 100644 reactos/drivers/base/bootvid/bootvid_i386.def diff --git a/reactos/drivers/base/bootvid/bootvid.rbuild b/reactos/drivers/base/bootvid/bootvid.rbuild index d1174a8b07c..4a733a2f947 100644 --- a/reactos/drivers/base/bootvid/bootvid.rbuild +++ b/reactos/drivers/base/bootvid/bootvid.rbuild @@ -1,7 +1,7 @@ - + . ntoskrnl @@ -20,6 +20,5 @@ bootvid.rc - bootvid.spec precomp.h diff --git a/reactos/drivers/base/bootvid/bootvid.spec b/reactos/drivers/base/bootvid/bootvid.spec deleted file mode 100644 index a698522706e..00000000000 --- a/reactos/drivers/base/bootvid/bootvid.spec +++ /dev/null @@ -1,11 +0,0 @@ -@ stdcall VidBitBlt(ptr long long) -@ stdcall VidBufferToScreenBlt(ptr long long long long long) -@ stdcall VidCleanUp() -@ stdcall VidDisplayString(str) -@ stdcall VidDisplayStringXY(str long long long) -@ stdcall VidInitialize(long) -@ stdcall VidResetDisplay(long) -@ stdcall VidScreenToBufferBlt(ptr long long long long long) -@ stdcall VidSetScrollRegion(long long long long) -@ stdcall VidSetTextColor(long) -@ stdcall VidSolidColorFill(long long long long long) diff --git a/reactos/drivers/base/bootvid/bootvid_amd64.def b/reactos/drivers/base/bootvid/bootvid_amd64.def new file mode 100644 index 00000000000..7d3aacc1367 --- /dev/null +++ b/reactos/drivers/base/bootvid/bootvid_amd64.def @@ -0,0 +1,15 @@ +LIBRARY BOOTVID.DLL + +EXPORTS +VidBitBlt +VidBufferToScreenBlt +VidCleanUp +VidDisplayString +VidDisplayStringXY +VidInitialize +VidResetDisplay +VidScreenToBufferBlt +VidSetScrollRegion +VidSetTextColor +VidSolidColorFill + diff --git a/reactos/drivers/base/bootvid/bootvid_arm.def b/reactos/drivers/base/bootvid/bootvid_arm.def new file mode 100644 index 00000000000..7d3aacc1367 --- /dev/null +++ b/reactos/drivers/base/bootvid/bootvid_arm.def @@ -0,0 +1,15 @@ +LIBRARY BOOTVID.DLL + +EXPORTS +VidBitBlt +VidBufferToScreenBlt +VidCleanUp +VidDisplayString +VidDisplayStringXY +VidInitialize +VidResetDisplay +VidScreenToBufferBlt +VidSetScrollRegion +VidSetTextColor +VidSolidColorFill + diff --git a/reactos/drivers/base/bootvid/bootvid_i386.def b/reactos/drivers/base/bootvid/bootvid_i386.def new file mode 100644 index 00000000000..ccd481bd100 --- /dev/null +++ b/reactos/drivers/base/bootvid/bootvid_i386.def @@ -0,0 +1,15 @@ +LIBRARY BOOTVID.DLL + +EXPORTS +VidBitBlt@12 +VidBufferToScreenBlt@24 +VidCleanUp@0 +VidDisplayString@4 +VidDisplayStringXY +VidInitialize@4 +VidResetDisplay@4 +VidScreenToBufferBlt@24 +VidSetScrollRegion@16 +VidSetTextColor@4 +VidSolidColorFill@20 + From 2241dceb71d73dde13d65bf55efc54535a394adc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 25 Jul 2008 13:26:08 +0000 Subject: [PATCH 032/388] some DWORD -> DWORD_PTR svn path=/branches/ros-amd64-bringup/; revision=34780 --- reactos/include/reactos/win32k/ntuser.h | 8 +- reactos/subsystems/win32/win32k/ntuser/misc.c | 14 +-- .../win32/win32k/ntuser/simplecall.c | 116 +++++++++--------- 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index 0cc48479d64..a30119a389f 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -876,18 +876,18 @@ NtUserCallNextHookEx( LPARAM lParam, BOOL Ansi); -DWORD +DWORD_PTR NTAPI NtUserCallNoParam( DWORD Routine); -DWORD +DWORD_PTR NTAPI NtUserCallOneParam( DWORD Param, DWORD Routine); -DWORD +DWORD_PTR NTAPI NtUserCallTwoParam( DWORD Param1, @@ -1612,7 +1612,7 @@ enum ThreadStateRoutines THREADSTATE_TASKMANWINDOW }; -DWORD +DWORD_PTR NTAPI NtUserGetThreadState( DWORD Routine); diff --git a/reactos/subsystems/win32/win32k/ntuser/misc.c b/reactos/subsystems/win32/win32k/ntuser/misc.c index 365debf64d0..68fce8b573c 100644 --- a/reactos/subsystems/win32/win32k/ntuser/misc.c +++ b/reactos/subsystems/win32/win32k/ntuser/misc.c @@ -17,11 +17,11 @@ /* * @unimplemented */ -DWORD STDCALL +DWORD_PTR STDCALL NtUserGetThreadState( DWORD Routine) { - DECLARE_RETURN(DWORD); + DECLARE_RETURN(DWORD_PTR); DPRINT("Enter NtUserGetThreadState\n"); if (Routine != THREADSTATE_GETTHREADINFO) @@ -40,16 +40,16 @@ NtUserGetThreadState( RETURN(0); case THREADSTATE_FOCUSWINDOW: - RETURN( (DWORD)IntGetThreadFocusWindow()); + RETURN( (DWORD_PTR)IntGetThreadFocusWindow()); case THREADSTATE_CAPTUREWINDOW: /* FIXME should use UserEnterShared */ - RETURN( (DWORD)IntGetCapture()); + RETURN( (DWORD_PTR)IntGetCapture()); case THREADSTATE_PROGMANWINDOW: - RETURN( (DWORD)GetW32ThreadInfo()->Desktop->hProgmanWindow); + RETURN( (DWORD_PTR)GetW32ThreadInfo()->Desktop->hProgmanWindow); case THREADSTATE_TASKMANWINDOW: - RETURN( (DWORD)GetW32ThreadInfo()->Desktop->hTaskManWindow); + RETURN( (DWORD_PTR)GetW32ThreadInfo()->Desktop->hTaskManWindow); case THREADSTATE_ACTIVEWINDOW: - RETURN ( (DWORD)UserGetActiveWindow()); + RETURN ( (DWORD_PTR)UserGetActiveWindow()); } RETURN( 0); diff --git a/reactos/subsystems/win32/win32k/ntuser/simplecall.c b/reactos/subsystems/win32/win32k/ntuser/simplecall.c index b6ee8ab9438..c6b91452720 100644 --- a/reactos/subsystems/win32/win32k/ntuser/simplecall.c +++ b/reactos/subsystems/win32/win32k/ntuser/simplecall.c @@ -74,12 +74,12 @@ co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register) /* * @unimplemented */ -DWORD +DWORD_PTR STDCALL NtUserCallNoParam(DWORD Routine) { - DWORD Result = 0; - DECLARE_RETURN(DWORD); + DWORD_PTR Result = 0; + DECLARE_RETURN(DWORD_PTR); DPRINT("Enter NtUserCallNoParam\n"); UserEnterExclusive(); @@ -87,39 +87,39 @@ NtUserCallNoParam(DWORD Routine) switch(Routine) { case NOPARAM_ROUTINE_CREATEMENU: - Result = (DWORD)UserCreateMenu(FALSE); + Result = (DWORD_PTR)UserCreateMenu(FALSE); break; case NOPARAM_ROUTINE_CREATEMENUPOPUP: - Result = (DWORD)UserCreateMenu(TRUE); + Result = (DWORD_PTR)UserCreateMenu(TRUE); break; case NOPARAM_ROUTINE_DESTROY_CARET: - Result = (DWORD)co_IntDestroyCaret(PsGetCurrentThread()->Tcb.Win32Thread); + Result = (DWORD_PTR)co_IntDestroyCaret(PsGetCurrentThread()->Tcb.Win32Thread); break; case NOPARAM_ROUTINE_INIT_MESSAGE_PUMP: - Result = (DWORD)IntInitMessagePumpHook(); + Result = (DWORD_PTR)IntInitMessagePumpHook(); break; case NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP: - Result = (DWORD)IntUninitMessagePumpHook(); + Result = (DWORD_PTR)IntUninitMessagePumpHook(); break; case NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO: - Result = (DWORD)MsqGetMessageExtraInfo(); + Result = (DWORD_PTR)MsqGetMessageExtraInfo(); break; case NOPARAM_ROUTINE_ANYPOPUP: - Result = (DWORD)IntAnyPopup(); + Result = (DWORD_PTR)IntAnyPopup(); break; case NOPARAM_ROUTINE_CSRSS_INITIALIZED: - Result = (DWORD)CsrInit(); + Result = (DWORD_PTR)CsrInit(); break; case NOPARAM_ROUTINE_MSQCLEARWAKEMASK: - RETURN( (DWORD)IntMsqClearWakeMask()); + RETURN( (DWORD_PTR)IntMsqClearWakeMask()); default: DPRINT1("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine); @@ -138,13 +138,13 @@ CLEANUP: /* * @implemented */ -DWORD +DWORD_PTR STDCALL NtUserCallOneParam( DWORD Param, DWORD Routine) { - DECLARE_RETURN(DWORD); + DECLARE_RETURN(DWORD_PTR); DPRINT("Enter NtUserCallOneParam\n"); @@ -153,7 +153,7 @@ NtUserCallOneParam( switch(Routine) { case ONEPARAM_ROUTINE_SHOWCURSOR: - RETURN( (DWORD)UserShowCursor((BOOL)Param) ); + RETURN( (DWORD_PTR)UserShowCursor((BOOL)Param) ); case ONEPARAM_ROUTINE_GETDESKTOPMAPPING: { @@ -163,7 +163,7 @@ NtUserCallOneParam( { /* Try convert the pointer to a user mode pointer if the desktop is mapped into the process */ - RETURN((DWORD)DesktopHeapAddressToUser((PVOID)Param)); + RETURN((DWORD_PTR)DesktopHeapAddressToUser((PVOID)Param)); } else { @@ -174,14 +174,14 @@ NtUserCallOneParam( case ONEPARAM_ROUTINE_GETMENU: { PWINDOW_OBJECT Window; - DWORD Result; + DWORD DWORD_PTR; if(!(Window = UserGetWindowObject((HWND)Param))) { RETURN( FALSE); } - Result = (DWORD)Window->Wnd->IDMenu; + Result = (DWORD_PTR)Window->Wnd->IDMenu; RETURN( Result); } @@ -189,7 +189,7 @@ NtUserCallOneParam( case ONEPARAM_ROUTINE_ISWINDOWUNICODE: { PWINDOW_OBJECT Window; - DWORD Result; + DWORD_PTR Result; Window = UserGetWindowObject((HWND)Param); if(!Window) @@ -201,12 +201,12 @@ NtUserCallOneParam( } case ONEPARAM_ROUTINE_WINDOWFROMDC: - RETURN( (DWORD)IntWindowFromDC((HDC)Param)); + RETURN( (DWORD_PTR)IntWindowFromDC((HDC)Param)); case ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID: { PWINDOW_OBJECT Window; - DWORD Result; + DWORD_PTR Result; Window = UserGetWindowObject((HWND)Param); if(!Window) @@ -223,17 +223,17 @@ NtUserCallOneParam( { PWINSTATION_OBJECT WinSta; NTSTATUS Status; - DWORD Result; + DWORD_PTR Result; Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation, KernelMode, 0, &WinSta); if (!NT_SUCCESS(Status)) - RETURN( (DWORD)FALSE); + RETURN( (DWORD_PTR)FALSE); /* FIXME - Result = (DWORD)IntSwapMouseButton(WinStaObject, (BOOL)Param); */ + Result = (DWORD_PTR)IntSwapMouseButton(WinStaObject, (BOOL)Param); */ Result = 0; ObDereferenceObject(WinSta); @@ -241,10 +241,10 @@ NtUserCallOneParam( } case ONEPARAM_ROUTINE_SWITCHCARETSHOWING: - RETURN( (DWORD)IntSwitchCaretShowing((PVOID)Param)); + RETURN( (DWORD_PTR)IntSwitchCaretShowing((PVOID)Param)); case ONEPARAM_ROUTINE_SETCARETBLINKTIME: - RETURN( (DWORD)IntSetCaretBlinkTime((UINT)Param)); + RETURN( (DWORD_PTR)IntSetCaretBlinkTime((UINT)Param)); case ONEPARAM_ROUTINE_GETWINDOWINSTANCE: { @@ -256,12 +256,12 @@ NtUserCallOneParam( RETURN( FALSE); } - Result = (DWORD)Window->Wnd->Instance; + Result = (DWORD_PTR)Window->Wnd->Instance; RETURN( Result); } case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO: - RETURN( (DWORD)MsqSetMessageExtraInfo((LPARAM)Param)); + RETURN( (DWORD_PTR)MsqSetMessageExtraInfo((LPARAM)Param)); case ONEPARAM_ROUTINE_CREATECURICONHANDLE: { @@ -282,7 +282,7 @@ NtUserCallOneParam( } ObDereferenceObject(WinSta); - RETURN((DWORD)CurIcon->Self); + RETURN((DWORD_PTR)CurIcon->Self); } case ONEPARAM_ROUTINE_GETCURSORPOSITION: @@ -292,13 +292,13 @@ NtUserCallOneParam( POINT Pos; if(!Param) - RETURN( (DWORD)FALSE); + RETURN( (DWORD_PTR)FALSE); Status = IntValidateWindowStationHandle(PsGetCurrentProcess()->Win32WindowStation, KernelMode, 0, &WinSta); if (!NT_SUCCESS(Status)) - RETURN( (DWORD)FALSE); + RETURN( (DWORD_PTR)FALSE); /* FIXME - check if process has WINSTA_READATTRIBUTES */ IntGetCursorLocation(WinSta, &Pos); @@ -313,20 +313,20 @@ NtUserCallOneParam( ObDereferenceObject(WinSta); - RETURN( (DWORD)TRUE); + RETURN( (DWORD_PTR)TRUE); } case ONEPARAM_ROUTINE_ISWINDOWINDESTROY: { PWINDOW_OBJECT Window; - DWORD Result; + DWORD_PTR Result; if(!(Window = UserGetWindowObject((HWND)Param))) { RETURN( FALSE); } - Result = (DWORD)IntIsWindowInDestroy(Window); + Result = (DWORD_PTR)IntIsWindowInDestroy(Window); RETURN( Result); } @@ -356,13 +356,13 @@ NtUserCallOneParam( } case ONEPARAM_ROUTINE_MSQSETWAKEMASK: - RETURN( (DWORD)IntMsqSetWakeMask(Param)); + RETURN( (DWORD_PTR)IntMsqSetWakeMask(Param)); case ONEPARAM_ROUTINE_GETKEYBOARDTYPE: RETURN( UserGetKeyboardType(Param)); case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT: - RETURN( (DWORD)UserGetKeyboardLayout(Param)); + RETURN( (DWORD_PTR)UserGetKeyboardLayout(Param)); case ONEPARAM_ROUTINE_REGISTERUSERMODULE: { @@ -415,7 +415,7 @@ CLEANUP: /* * @implemented */ -DWORD +DWORD_PTR STDCALL NtUserCallTwoParam( DWORD Param1, @@ -424,7 +424,7 @@ NtUserCallTwoParam( { NTSTATUS Status; PWINDOW_OBJECT Window; - DECLARE_RETURN(DWORD); + DECLARE_RETURN(DWORD_PTR); DPRINT("Enter NtUserCallTwoParam\n"); UserEnterExclusive(); @@ -433,12 +433,12 @@ NtUserCallTwoParam( { case TWOPARAM_ROUTINE_GETWINDOWRGNBOX: { - DWORD Ret; + DWORD_PTR Ret; RECT rcRect; Window = UserGetWindowObject((HWND)Param1); if (!Window) RETURN(ERROR); - Ret = (DWORD)IntGetWindowRgnBox(Window, &rcRect); + Ret = (DWORD_PTR)IntGetWindowRgnBox(Window, &rcRect); Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT)); if(!NT_SUCCESS(Status)) { @@ -452,11 +452,11 @@ NtUserCallTwoParam( Window = UserGetWindowObject((HWND)Param1); if (!Window) RETURN(ERROR); - RETURN( (DWORD)IntGetWindowRgn(Window, (HRGN)Param2)); + RETURN( (DWORD_PTR)IntGetWindowRgn(Window, (HRGN)Param2)); } case TWOPARAM_ROUTINE_SETMENUBARHEIGHT: { - DWORD Ret; + DWORD_PTR Ret; PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1); if(!MenuObject) RETURN( 0); @@ -467,7 +467,7 @@ NtUserCallTwoParam( MenuObject->MenuInfo.Height = (int)Param2; } else - Ret = (DWORD)MenuObject->MenuInfo.Height; + Ret = (DWORD_PTR)MenuObject->MenuInfo.Height; IntReleaseMenuObject(MenuObject); RETURN( Ret); } @@ -488,7 +488,7 @@ NtUserCallTwoParam( Ret = IntSetMenuItemRect(MenuObject, smir.uItem, smir.fByPosition, &smir.rcRect); IntReleaseMenuObject(MenuObject); - RETURN( (DWORD)Ret); + RETURN( (DWORD_PTR)Ret); } case TWOPARAM_ROUTINE_SETGUITHRDHANDLE: @@ -496,7 +496,7 @@ NtUserCallTwoParam( PUSER_MESSAGE_QUEUE MsgQueue = ((PW32THREAD)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue; ASSERT(MsgQueue); - RETURN( (DWORD)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2)); + RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2)); } case TWOPARAM_ROUTINE_ENABLEWINDOW: @@ -508,7 +508,7 @@ NtUserCallTwoParam( Window = UserGetWindowObject((HWND)Param1); if (!Window) RETURN(0); - RETURN( (DWORD)IntShowOwnedPopups(Window, (BOOL) Param2)); + RETURN( (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL) Param2)); } case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE: @@ -532,20 +532,20 @@ NtUserCallTwoParam( if(!(Window = UserGetWindowObject((HWND)Param1))) { - RETURN( (DWORD)FALSE); + RETURN( (DWORD_PTR)FALSE); } Window->Wnd->ContextHelpId = Param2; - RETURN( (DWORD)TRUE); + RETURN( (DWORD_PTR)TRUE); case TWOPARAM_ROUTINE_SETCARETPOS: - RETURN( (DWORD)co_IntSetCaretPos((int)Param1, (int)Param2)); + RETURN( (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2)); case TWOPARAM_ROUTINE_GETWINDOWINFO: { WINDOWINFO wi; - DWORD Ret; + DWORD_PTR Ret; if(!(Window = UserGetWindowObject((HWND)Param1))) { @@ -571,7 +571,7 @@ NtUserCallTwoParam( } #endif - if((Ret = (DWORD)IntGetWindowInfo(Window, &wi))) + if((Ret = (DWORD_PTR)IntGetWindowInfo(Window, &wi))) { Status = MmCopyToCaller((PVOID)Param2, &wi, sizeof(WINDOWINFO)); if(!NT_SUCCESS(Status)) @@ -585,13 +585,13 @@ NtUserCallTwoParam( } case TWOPARAM_ROUTINE_REGISTERLOGONPROC: - RETURN( (DWORD)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2)); + RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2)); case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES: case TWOPARAM_ROUTINE_GETSYSCOLORPENS: case TWOPARAM_ROUTINE_GETSYSCOLORS: { - DWORD Ret = 0; + DWORD_PTR Ret = 0; union { PVOID Pointer; @@ -608,13 +608,13 @@ NtUserCallTwoParam( switch(Routine) { case TWOPARAM_ROUTINE_GETSYSCOLORBRUSHES: - Ret = (DWORD)IntGetSysColorBrushes(Buffer.Brushes, (UINT)Param2); + Ret = (DWORD_PTR)IntGetSysColorBrushes(Buffer.Brushes, (UINT)Param2); break; case TWOPARAM_ROUTINE_GETSYSCOLORPENS: - Ret = (DWORD)IntGetSysColorPens(Buffer.Pens, (UINT)Param2); + Ret = (DWORD_PTR)IntGetSysColorPens(Buffer.Pens, (UINT)Param2); break; case TWOPARAM_ROUTINE_GETSYSCOLORS: - Ret = (DWORD)IntGetSysColors(Buffer.Colors, (UINT)Param2); + Ret = (DWORD_PTR)IntGetSysColors(Buffer.Colors, (UINT)Param2); break; default: Ret = 0; @@ -638,7 +638,7 @@ NtUserCallTwoParam( case TWOPARAM_ROUTINE_ROS_REGSYSCLASSES: { - DWORD Ret = 0; + DWORD_PTR Ret = 0; DWORD Count = Param1; PREGISTER_SYSCLASS RegSysClassArray = (PREGISTER_SYSCLASS)Param2; @@ -651,7 +651,7 @@ NtUserCallTwoParam( Count, 2); - Ret = (DWORD)UserRegisterSystemClasses(Count, + Ret = (DWORD_PTR)UserRegisterSystemClasses(Count, RegSysClassArray); } _SEH_HANDLE From 374c44c7008884aa0799a524965603d4a715e951 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 25 Jul 2008 13:37:45 +0000 Subject: [PATCH 033/388] fix usage of InterlockedCompareExchangePointer svn path=/branches/ros-amd64-bringup/; revision=34781 --- reactos/subsystems/win32/win32k/eng/engwindow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/win32k/eng/engwindow.c b/reactos/subsystems/win32/win32k/eng/engwindow.c index a3f505468f9..2534bb37aa9 100644 --- a/reactos/subsystems/win32/win32k/eng/engwindow.c +++ b/reactos/subsystems/win32/win32k/eng/engwindow.c @@ -134,7 +134,7 @@ IntEngWndUpdateClipObj( RtlCopyMemory(&WndObjInt->WndObj.coClient, ClipObj, sizeof (CLIPOBJ)); RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->ClientRect, sizeof (RECT)); - OldClipObj = InterlockedExchangePointer(&WndObjInt->ClientClipObj, ClipObj); + OldClipObj = InterlockedExchangePointer((PVOID*)&WndObjInt->ClientClipObj, ClipObj); if (OldClipObj != NULL) IntEngDeleteClipRegion(OldClipObj); From 4a991aa01437baa8df1447cf51352de84e70125a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 25 Jul 2008 13:42:03 +0000 Subject: [PATCH 034/388] fix usage of InterlockedCompareExchangePointer svn path=/branches/ros-amd64-bringup/; revision=34782 --- reactos/subsystems/win32/win32k/ntuser/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/class.c b/reactos/subsystems/win32/win32k/ntuser/class.c index fd8a0ba73f9..30fb1c35568 100644 --- a/reactos/subsystems/win32/win32k/ntuser/class.c +++ b/reactos/subsystems/win32/win32k/ntuser/class.c @@ -486,7 +486,7 @@ IntGetClassForDesktop(IN OUT PWINDOWCLASS BaseClass, Class->Clone = NULL; Class->Base = BaseClass; Class->Next = BaseClass->Clone; - (void)InterlockedExchangePointer(&BaseClass->Clone, + (void)InterlockedExchangePointer((VOID*)&BaseClass->Clone, Class); } } From 9f836ebf3acfcfbb25133d4ae81af856762161de Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 14:13:04 +0000 Subject: [PATCH 035/388] Fix all 64 bit warnings. Switch over to spec file, taken from WINE. svn path=/branches/ros-amd64-bringup/; revision=34785 --- reactos/dll/win32/advapi32/advapi32.def | 707 --------------------- reactos/dll/win32/advapi32/advapi32.rbuild | 3 +- reactos/dll/win32/advapi32/advapi32.spec | 690 ++++++++++++++++++++ reactos/dll/win32/advapi32/reg/reg.c | 4 +- reactos/dll/win32/advapi32/sec/lsa.c | 2 +- reactos/dll/win32/advapi32/service/scm.c | 2 +- reactos/dll/win32/advapi32/service/sctrl.c | 4 +- 7 files changed, 698 insertions(+), 714 deletions(-) delete mode 100644 reactos/dll/win32/advapi32/advapi32.def create mode 100644 reactos/dll/win32/advapi32/advapi32.spec diff --git a/reactos/dll/win32/advapi32/advapi32.def b/reactos/dll/win32/advapi32/advapi32.def deleted file mode 100644 index af2bf1ab8e9..00000000000 --- a/reactos/dll/win32/advapi32/advapi32.def +++ /dev/null @@ -1,707 +0,0 @@ -; $Id$ -; -; advapi32.def -; -; ReactOS Operating System -; -LIBRARY advapi32.dll -EXPORTS -A_SHAFinal@8 -A_SHAInit@4 -A_SHAUpdate@12 -AbortSystemShutdownA@4 -AbortSystemShutdownW@4 -AccessCheck@32 -AccessCheckAndAuditAlarmA@44 -AccessCheckAndAuditAlarmW@44 -;AccessCheckByType -AccessCheckByTypeAndAuditAlarmA@64 -AccessCheckByTypeAndAuditAlarmW@64 -;AccessCheckByTypeResultList@44 -AccessCheckByTypeResultListAndAuditAlarmA@64 -AccessCheckByTypeResultListAndAuditAlarmByHandleA@68 -AccessCheckByTypeResultListAndAuditAlarmByHandleW@68 -AccessCheckByTypeResultListAndAuditAlarmW@64 -AddAccessAllowedAce@16 -AddAccessAllowedAceEx@20 -AddAccessAllowedObjectAce@28 -AddAccessDeniedAce@16 -AddAccessDeniedAceEx@20 -AddAccessDeniedObjectAce@28 -AddAce@20 -AddAuditAccessAce@24 -AddAuditAccessAceEx@28 -AddAuditAccessObjectAce@36 -AddMandatoryAce@20 -AddUsersToEncryptedFile@8 -AdjustTokenGroups@24 -AdjustTokenPrivileges@24 -AllocateAndInitializeSid@44 -AllocateLocallyUniqueId@4 -AreAllAccessesGranted@8 -AreAnyAccessesGranted@8 -BackupEventLogA@8 -BackupEventLogW@8 -BuildExplicitAccessWithNameA@20 -BuildExplicitAccessWithNameW@20 -BuildImpersonateExplicitAccessWithNameA@24 -BuildImpersonateExplicitAccessWithNameW@24 -BuildImpersonateTrusteeA@8 -BuildImpersonateTrusteeW@8 -BuildSecurityDescriptorA@36 -BuildSecurityDescriptorW@36 -BuildTrusteeWithNameA@8 -BuildTrusteeWithNameW@8 -BuildTrusteeWithObjectsAndNameA@24 -BuildTrusteeWithObjectsAndNameW@24 -BuildTrusteeWithObjectsAndSidA@20 -BuildTrusteeWithObjectsAndSidW@20 -BuildTrusteeWithSidA@8 -BuildTrusteeWithSidW@8 -;CancelOverlappedAccess@4 -ChangeServiceConfig2A@12 -ChangeServiceConfig2W@12 -ChangeServiceConfigA@44 -ChangeServiceConfigW@44 -CheckTokenMembership@12 -ClearEventLogA@8 -ClearEventLogW@8 -;CloseCodeAuthzLevel@4 -;CloseEncryptedFileRaw -CloseEventLog@4 -CloseServiceHandle@4 -;CloseTrace@8 -CommandLineFromMsiDescriptor@12 -;ComputeAccessTokenFromCodeAuthzLevel@20 -ControlService@12 -ControlServiceEx@16 -;ControlTraceA@12 -;ControlTraceW@12 -;ConvertAccessToSecurityDescriptorA@20 -;ConvertAccessToSecurityDescriptorW@20 -;ConvertSDToStringSDRootDomainA@24 -;ConvertSDToStringSDRootDomainW@24 -;ConvertSecurityDescriptorToAccessA@28 -;ConvertSecurityDescriptorToAccessNamedA=ConvertSecurityDescriptorToAccessA@28 -;ConvertSecurityDescriptorToAccessNamedW=ConvertSecurityDescriptorToAccessW@28 -;ConvertSecurityDescriptorToAccessW@28 -ConvertSecurityDescriptorToStringSecurityDescriptorA@20 -ConvertSecurityDescriptorToStringSecurityDescriptorW@20 -ConvertSidToStringSidA@8 -ConvertSidToStringSidW@8 -;ConvertStringSDToSDDomainA@24 -;ConvertStringSDToSDDomainW@24 -;ConvertStringSDToSDRootDomainA@20 -;ConvertStringSDToSDRootDomainW@20 -ConvertStringSecurityDescriptorToSecurityDescriptorA@16 -ConvertStringSecurityDescriptorToSecurityDescriptorW@16 -ConvertStringSidToSidA@8 -ConvertStringSidToSidW@8 -ConvertToAutoInheritPrivateObjectSecurity@24 -CopySid@12 -;CreateCodeAuthzLevel@20 -CreatePrivateObjectSecurity@24 -CreatePrivateObjectSecurityEx@32 -CreatePrivateObjectSecurityWithMultipleInheritance@36 -CreateProcessAsUserA@44 -;CreateProcessAsUserSecure -CreateProcessAsUserW@44 -;CreateProcessWithLogonW -CreateRestrictedToken@36 -CreateServiceA@52 -CreateServiceW@52 -;CreateTraceInstanceId@8 -CreateWellKnownSid@16 -;CredDeleteA@12 -;CredDeleteW@12 -;CredEnumerateA@16 -;CredEnumerateW@16 -;CredFree@4 -;CredGetSessionTypes@8 -;CredGetTargetInfoA@12 -;CredGetTargetInfoW@12 -;CredIsMarshaledCredentialA@4 -;CredIsMarshaledCredentialW@4 -;CredMarshalCredentialA@12 -;CredMarshalCredentialW@12 -;CredProfileLoaded -;CredReadA -;CredReadDomainCredentialsA -;CredReadDomainCredentialsW -;CredReadW -;CredRenameA -;CredRenameW -;CredUnmarshalCredentialA -;CredUnmarshalCredentialW -;CredWriteA -;CredWriteDomainCredentialsA -;CredWriteDomainCredentialsW -;CredWriteW -;CredpConvertCredential -;CredpConvertTargetInfo -;CredpDecodeCredential -;CredpEncodeCredential -CryptAcquireContextA@20 -CryptAcquireContextW@20 -CryptContextAddRef@12 -CryptCreateHash@20 -CryptDecrypt@24 -CryptDeriveKey@20 -CryptDestroyHash@4 -CryptDestroyKey@4 -CryptDuplicateHash@16 -CryptDuplicateKey@16 -CryptEncrypt@28 -CryptEnumProviderTypesA@24 -CryptEnumProviderTypesW@24 -CryptEnumProvidersA@24 -CryptEnumProvidersW@24 -CryptExportKey@24 -CryptGenKey@16 -CryptGenRandom@12 -CryptGetDefaultProviderA@20 -CryptGetDefaultProviderW@20 -CryptGetHashParam@20 -CryptGetKeyParam@20 -CryptGetProvParam@20 -CryptGetUserKey@12 -CryptHashData@16 -CryptHashSessionKey@12 -CryptImportKey@24 -CryptReleaseContext@8 -CryptSetHashParam@16 -CryptSetKeyParam@16 -CryptSetProvParam@16 -CryptSetProviderA@8 -CryptSetProviderExA@16 -CryptSetProviderExW@16 -CryptSetProviderW@8 -CryptSignHashA@24 -CryptSignHashW@24 -CryptVerifySignatureA@24 -CryptVerifySignatureW@24 -DecryptFileA@8 -DecryptFileW@8 -DeleteAce@8 -DeleteService@4 -DeregisterEventSource@4 -DestroyPrivateObjectSecurity@4 -;DuplicateEncryptionInfoFile -DuplicateToken@12 -DuplicateTokenEx@24 -;ElfBackupEventLogFileA@8 -;ElfBackupEventLogFileW@8 -;ElfChangeNotify@8 -;ElfClearEventLogFileA@8 -;ElfClearEventLogFileW@8 -;ElfCloseEventLog@4 -;ElfDeregisterEventSource@4 -;ElfNumberOfRecords@8 -;ElfOldestRecord@8 -;ElfOpenBackupEventLogA@12 -;ElfOpenBackupEventLogW@12 -;ElfOpenEventLogA@12 -;ElfOpenEventLogW@12 -;ElfReadEventLogA@28 -;ElfReadEventLogW@28 -;ElfRegisterEventSourceA@12 -;ElfRegisterEventSourceW@12 -;ElfReportEventA@48 -;ElfReportEventW@48 -;EnableTrace -EncryptFileA@4 -EncryptFileW@4 -;EncryptedFileKeyInfo -EncryptionDisable@8 -EnumDependentServicesA@24 -EnumDependentServicesW@24 -EnumServiceGroupW@36 -EnumServicesStatusA@32 -EnumServicesStatusExA@40 -EnumServicesStatusExW@40 -EnumServicesStatusW@32 -;EnumerateTraceGuids -EqualDomainSid@12 -EqualPrefixSid@8 -EqualSid@8 -FileEncryptionStatusA@8 -FileEncryptionStatusW@8 -FindFirstFreeAce@8 -;FlushTraceA -;FlushTraceW -;FreeEncryptedFileKeyInfo -FreeEncryptionCertificateHashList@4 -FreeInheritedFromArray@12 -FreeSid@4 -;GetAccessPermissionsForObjectA -;GetAccessPermissionsForObjectW -GetAce@12 -GetAclInformation@16 -GetAuditedPermissionsFromAclA@16 -GetAuditedPermissionsFromAclW@16 -GetCurrentHwProfileA@4 -GetCurrentHwProfileW@4 -GetEffectiveRightsFromAclA@12 -GetEffectiveRightsFromAclW@12 -;GetEventLogInformation -GetExplicitEntriesFromAclA@12=ADVAPI32.GetExplicitEntriesFromAclW -GetExplicitEntriesFromAclW@12 -GetFileSecurityA@20 -GetFileSecurityW@20 -;GetInformationCodeAuthzLevelW -;GetInformationCodeAuthzPolicyW -GetInheritanceSourceA@40 -GetInheritanceSourceW@40 -GetKernelObjectSecurity@20 -GetLengthSid@4 -;GetLocalManagedApplicationData -;GetLocalManagedApplications -;GetManagedApplicationCategories -;GetManagedApplications -GetMultipleTrusteeA@4 -GetMultipleTrusteeOperationA@4 -GetMultipleTrusteeOperationW@4 -GetMultipleTrusteeW@4 -GetNamedSecurityInfoA@32 -;GetNamedSecurityInfoExA -;GetNamedSecurityInfoExW -GetNamedSecurityInfoW@32 -GetNumberOfEventLogRecords@8 -GetOldestEventLogRecord@8 -;GetOverlappedAccessResults -GetPrivateObjectSecurity@20 -GetSecurityDescriptorControl@12 -GetSecurityDescriptorDacl@16 -GetSecurityDescriptorGroup@12 -GetSecurityDescriptorLength@4=NTDLL.RtlLengthSecurityDescriptor -GetSecurityDescriptorOwner@12 -GetSecurityDescriptorRMControl@8 -GetSecurityDescriptorSacl@16 -GetSecurityInfo@32 -GetSecurityInfoExA@36 -GetSecurityInfoExW@36 -GetServiceDisplayNameA@16 -GetServiceDisplayNameW@16 -GetServiceKeyNameA@16 -GetServiceKeyNameW@16 -GetSidIdentifierAuthority@4 -GetSidLengthRequired@4 -GetSidSubAuthority@8 -GetSidSubAuthorityCount@4 -GetSiteSidFromToken@4 -GetTokenInformation@20 -GetTraceEnableFlags@8 -GetTraceEnableLevel@8 -GetTraceLoggerHandle@4 -GetTrusteeFormA@4 -GetTrusteeFormW@4 -GetTrusteeNameA@4 -GetTrusteeNameW@4 -GetTrusteeTypeA@4 -GetTrusteeTypeW@4 -GetUserNameA@8 -GetUserNameW@8 -GetWindowsAccountDomainSid@12 -;I_ScGetCurrentGroupStateW@12 -;I_ScIsSecurityProcess -;I_ScPnPGetServiceName -;I_ScSendTSMessage -;I_ScSetServiceBitsA@20 -;I_ScSetServiceBitsW@20 -;IdentifyCodeAuthzLevelW -ImpersonateAnonymousToken@4 -ImpersonateLoggedOnUser@4 -ImpersonateNamedPipeClient@4 -ImpersonateSelf@4 -InitializeAcl@12 -InitializeSecurityDescriptor@8 -InitializeSid@12 -InitiateSystemShutdownA@20 -;InitiateSystemShutdownExA@24 -InitiateSystemShutdownExW@24 -InitiateSystemShutdownW@20 -;InstallApplication -IsTextUnicode@12=NTDLL.RtlIsTextUnicode -IsTokenRestricted@4 -;IsTokenUntrusted -IsValidAcl@4 -IsValidSecurityDescriptor@4 -IsValidSid@4 -IsWellKnownSid@8 -LockServiceDatabase@4 -LogonUserA@24 -;LogonUserExA -;LogonUserExW -LogonUserW@24 -LookupAccountNameA@28 -LookupAccountNameW@28 -LookupAccountSidA@28 -LookupAccountSidW@28 -LookupPrivilegeDisplayNameA@20 -LookupPrivilegeDisplayNameW@20 -LookupPrivilegeNameA@16 -LookupPrivilegeNameW@16 -LookupPrivilegeValueA@12 -LookupPrivilegeValueW@12 -;LookupSecurityDescriptorPartsA@28 -;LookupSecurityDescriptorPartsW@28 -LsaAddAccountRights@16 -;LsaAddPrivilegesToAccount@8 -;LsaClearAuditLog@4 -LsaClose@4 -;LsaCreateAccount@16 -;LsaCreateSecret@16 -;LsaCreateTrustedDomain@16 -;LsaCreateTrustedDomainEx -LsaDelete@4 -;LsaDeleteTrustedDomain@8 -LsaEnumerateAccountRights@16 -;LsaEnumerateAccounts@20 -LsaEnumerateAccountsWithUserRight@16 -;LsaEnumeratePrivileges@20 -;LsaEnumeratePrivilegesOfAccount@8 -LsaEnumerateTrustedDomains@20 -;LsaEnumerateTrustedDomainsEx -LsaFreeMemory@4 -;LsaGetQuotasForAccount@8 -;LsaGetRemoteUserName -;LsaGetSystemAccessAccount@8 -LsaGetUserName@8 -;LsaICLookupNames@32 -;LsaICLookupNamesWithCreds -;LsaICLookupSids@32 -;LsaICLookupSidsWithCreds -;LsaLookupNames@20 -LsaLookupNames2@24 -;LsaLookupPrivilegeDisplayName@16 -;LsaLookupPrivilegeName@12 -;LsaLookupPrivilegeValue@12 -LsaLookupSids@20 -LsaNtStatusToWinError@4 -;LsaOpenAccount@16 -LsaOpenPolicy@16 -;LsaOpenPolicySce -;LsaOpenSecret@16 -;LsaOpenTrustedDomain@16 -;LsaOpenTrustedDomainByName -;LsaQueryDomainInformationPolicy -;LsaQueryForestTrustInformation -LsaQueryInfoTrustedDomain@12 -LsaQueryInformationPolicy@12 -;LsaQuerySecret@20 -;LsaQuerySecurityObject@12 -;LsaQueryTrustedDomainInfo@16 -;LsaQueryTrustedDomainInfoByName -LsaRemoveAccountRights@20 -;LsaRemovePrivilegesFromAccount@12 -LsaRetrievePrivateData@12 -LsaSetInformationPolicy@12 -;LsaSetForestTrustInformation -;LsaSetInformationPolicy -;LsaSetInformationTrustedDomain@12 -;LsaSetQuotasForAccount@8 -;LsaSetSecret@12 -;LsaSetSecurityObject@12 -;LsaSetSystemAccessAccount@8 -;LsaSetTrustedDomainInfoByName -;LsaSetTrustedDomainInformation@16 -LsaStorePrivateData@12 -MD4Final@4 -MD4Init@4 -MD4Update@12 -MD5Final@4 -MD5Init@4 -MD5Update@12 -;MSChapSrvChangePassword -;MSChapSrvChangePassword2 -MakeAbsoluteSD@44 -MakeAbsoluteSD2@8 -MakeSelfRelativeSD@12 -MapGenericMask@8=NTDLL.RtlMapGenericMask -NotifyBootConfigStatus@4 -NotifyChangeEventLog@8 -ObjectCloseAuditAlarmA@12 -ObjectCloseAuditAlarmW@12 -ObjectDeleteAuditAlarmA@12 -ObjectDeleteAuditAlarmW@12 -ObjectOpenAuditAlarmA@48 -ObjectOpenAuditAlarmW@48 -ObjectPrivilegeAuditAlarmA@24 -ObjectPrivilegeAuditAlarmW@24 -OpenBackupEventLogA@8 -OpenBackupEventLogW@8 -;OpenEncryptedFileRawA -;OpenEncryptedFileRawW -OpenEventLogA@8 -OpenEventLogW@8 -OpenProcessToken@12 -OpenSCManagerA@12 -OpenSCManagerW@12 -OpenServiceA@12 -OpenServiceW@12 -OpenThreadToken@16 -;OpenTraceA -;OpenTraceW -PrivilegeCheck@12 -PrivilegedServiceAuditAlarmA@20 -PrivilegedServiceAuditAlarmW@20 -;ProcessIdleTasks -;ProcessTrace -;ProvAccessRightsToNTAccessMask ; ? -;QueryAllTracesA -;QueryAllTracesW -QueryRecoveryAgentsOnEncryptedFile@8 -QuerySecurityAccessMask@8 -QueryServiceConfig2A@20 -QueryServiceConfig2W@20 -QueryServiceConfigA@16 -QueryServiceConfigW@16 -QueryServiceLockStatusA@16 -QueryServiceLockStatusW@16 -QueryServiceObjectSecurity@20 -QueryServiceStatus@8 -QueryServiceStatusEx@20 -;QueryTraceA -;QueryTraceW -QueryUsersOnEncryptedFile@8 -;QueryWindows31FilesMigration@4 -;ReadEncryptedFileRaw -ReadEventLogA@28 -ReadEventLogW@28 -RegCloseKey@4 -RegConnectRegistryA@12 -RegConnectRegistryW@12 -RegCopyTreeA@12 -RegCopyTreeW@12 -RegCreateKeyA@12 -RegCreateKeyExA@36 -RegCreateKeyExW@36 -RegCreateKeyW@12 -RegDeleteKeyA@8 -RegDeleteKeyW@8 -RegDeleteKeyExA@16 -RegDeleteKeyExW@16 -RegDeleteKeyValueA@12 -RegDeleteKeyValueW@12 -RegDeleteTreeA@8 -RegDeleteTreeW@8 -RegDeleteValueA@8 -RegDeleteValueW@8 -RegDisablePredefinedCache@0 -RegDisablePredefinedCacheEx@0 -RegDisableReflectionKey@4 -RegEnableReflectionKey@4 -RegEnumKeyA@16 -RegEnumKeyExA@32 -RegEnumKeyExW@32 -RegEnumKeyW@16 -RegEnumValueA@32 -RegEnumValueW@32 -RegFlushKey@4 -RegGetKeySecurity@16 -RegGetValueA@28 -RegGetValueW@28 -RegLoadKeyA@12 -RegLoadKeyW@12 -RegLoadMUIStringA@28 -RegLoadMUIStringW@28 -RegNotifyChangeKeyValue@20 -RegOpenCurrentUser@8 -RegOpenKeyA@12 -RegOpenKeyExA@20 -RegOpenKeyExW@20 -RegOpenKeyW@12 -RegOpenUserClassesRoot@16 -RegOverridePredefKey@8 -RegQueryInfoKeyA@48 -RegQueryInfoKeyW@48 -RegQueryMultipleValuesA@20 -RegQueryMultipleValuesW@20 -RegQueryReflectionKey@8 -RegQueryValueA@16 -RegQueryValueExA@24 -RegQueryValueExW@24 -RegQueryValueW@16 -RegReplaceKeyA@16 -RegReplaceKeyW@16 -RegRestoreKeyA@12 -RegRestoreKeyW@12 -RegSaveKeyA@12 -;RegSaveKeyExA -;RegSaveKeyExW -RegSaveKeyW@12 -RegSetKeySecurity@12 -RegSetKeyValueA@24 -RegSetKeyValueW@24 -RegSetValueA@20 -RegSetValueExA@24 -RegSetValueExW@24 -RegSetValueW@20 -RegUnLoadKeyA@8 -RegUnLoadKeyW@8 -RegisterEventSourceA@8 -RegisterEventSourceW@8 -;RegisterIdleTask -RegisterServiceCtrlHandlerA@8 -RegisterServiceCtrlHandlerExA@12 -RegisterServiceCtrlHandlerExW@12 -RegisterServiceCtrlHandlerW@8 -RegisterTraceGuidsA@32 -RegisterTraceGuidsW@32 -;RemoveTraceCallback -RemoveUsersFromEncryptedFile@8 -ReportEventA@36 -ReportEventW@36 -RevertToSelf@0 -;SaferCloseLevel -;SaferComputeTokenFromLevel -;SaferCreateLevel -;SaferGetLevelInformation -;SaferGetPolicyInformation -;SaferIdentifyLevel -;SaferRecordEventLogEntry -;SaferSetLevelInformation -;SaferSetPolicyInformation -;SaferiChangeRegistryScope -;SaferiCompareTokenLevels -;SaferiIsExecutableFileType -;SaferiPopulateDefaultsInRegistry -;SaferiRecordEventLogEntry -;SaferiReplaceProcessThreadTokens -;SaferiSearchMatchingHashRules -SetAclInformation@16 -;SetEntriesInAccessListA -;SetEntriesInAccessListW -SetEntriesInAclA@16 -SetEntriesInAclW@16 -;SetEntriesInAuditListA -;SetEntriesInAuditListW -SetFileSecurityA@12 -SetFileSecurityW@12 -;SetInformationCodeAuthzLevelW -;SetInformationCodeAuthzPolicyW -SetKernelObjectSecurity@12 -SetNamedSecurityInfoA@28 -;SetNamedSecurityInfoExA -;SetNamedSecurityInfoExW -SetNamedSecurityInfoW@28 -SetPrivateObjectSecurity@20 -;SetPrivateObjectSecurityEx -SetSecurityAccessMask@8 -SetSecurityDescriptorControl@12 -SetSecurityDescriptorDacl@16 -SetSecurityDescriptorGroup@12 -SetSecurityDescriptorOwner@12 -SetSecurityDescriptorRMControl@8 -SetSecurityDescriptorSacl@16 -SetSecurityInfo@28 -;SetSecurityInfoExA -;SetSecurityInfoExW -SetServiceBits@16 -SetServiceObjectSecurity@12 -SetServiceStatus@8 -SetThreadToken@8 -SetTokenInformation@16 -;SetTraceCallback -;SetUserFileEncryptionKey -StartServiceA@12 -StartServiceCtrlDispatcherA@4 -StartServiceCtrlDispatcherW@4 -StartServiceW@12 -;StartTraceA -;StartTraceW -;StopTraceA -;StopTraceW -;SynchronizeWindows31FilesAndWindowsNTRegistry@16 -SystemFunction001@12 -SystemFunction002@12 -SystemFunction003@8 -SystemFunction004@12 -SystemFunction005@12 -SystemFunction006@8 -SystemFunction007@8 -SystemFunction008@12 -SystemFunction009@12 -SystemFunction010@12 -SystemFunction011@12=ADVAPI32.SystemFunction010@12 -SystemFunction012@12 -SystemFunction013@12 -SystemFunction014@12=ADVAPI32.SystemFunction012@12 -SystemFunction015@12=ADVAPI32.SystemFunction013@13 -SystemFunction016@12=ADVAPI32.SystemFunction012@12 -SystemFunction017@12=ADVAPI32.SystemFunction013@12 -SystemFunction018@12=ADVAPI32.SystemFunction012@12 -SystemFunction019@12=ADVAPI32.SystemFunction013@12 -SystemFunction020@12=ADVAPI32.SystemFunction012@12 -SystemFunction021@12=ADVAPI32.SystemFunction013@12 -SystemFunction022@12=ADVAPI32.SystemFunction012@12 -SystemFunction023@12=ADVAPI32.SystemFunction013@12 -SystemFunction024@12 -SystemFunction025@12 -SystemFunction026@12=ADVAPI32.SystemFunction024@12 -SystemFunction027@12=ADVAPI32.SystemFunction025@12 -SystemFunction028@8 -SystemFunction029@8 -SystemFunction030@8 -SystemFunction031@8=ADVAPI32.SystemFunction030@8 -SystemFunction032@8 -SystemFunction033@8 -SystemFunction034@8 -SystemFunction035@4 -SystemFunction036@8 -SystemFunction040@12 -SystemFunction041@12 -TraceEvent@12 -;TraceEventInstance -TraceMessage -;TraceMessageVa -TreeResetNamedSecurityInfoA@44 -TreeResetNamedSecurityInfoW@44 -;TrusteeAccessToObjectA -;TrusteeAccessToObjectW -;UninstallApplication -UnlockServiceDatabase@4 -;UnregisterIdleTask -UnregisterTraceGuids@8 -;UpdateTraceA -;UpdateTraceW -;WdmWmiServiceMain -;WmiCloseBlock -;WmiCloseTraceWithCursor -;WmiConvertTimestamp -;WmiDevInstToInstanceNameA -;WmiDevInstToInstanceNameW -;WmiEnumerateGuids -;WmiExecuteMethodA -;WmiExecuteMethodW -;WmiFileHandleToInstanceNameA -;WmiFileHandleToInstanceNameW -;WmiFreeBuffer -;WmiGetFirstTraceOffset -;WmiGetNextEvent -;WmiGetTraceHeader -;WmiMofEnumerateResourcesA -;WmiMofEnumerateResourcesW -;WmiNotificationRegistrationA -;WmiNotificationRegistrationW -;WmiOpenBlock -;WmiOpenTraceWithCursor -;WmiParseTraceEvent -;WmiQueryAllDataA -;WmiQueryAllDataMultipleA -;WmiQueryAllDataMultipleW -;WmiQueryAllDataW -;WmiQueryGuidInformation -;WmiQuerySingleInstanceA -;WmiQuerySingleInstanceMultipleA -;WmiQuerySingleInstanceMultipleW -;WmiQuerySingleInstanceW -;WmiReceiveNotificationsA -;WmiReceiveNotificationsW -;WmiSetSingleInstanceA -;WmiSetSingleInstanceW -;WmiSetSingleItemA -;WmiSetSingleItemW -;Wow64Win32ApiEntry -;WriteEncryptedFileRaw -; EOF diff --git a/reactos/dll/win32/advapi32/advapi32.rbuild b/reactos/dll/win32/advapi32/advapi32.rbuild index e6d2c4fe3f4..4361ede2136 100644 --- a/reactos/dll/win32/advapi32/advapi32.rbuild +++ b/reactos/dll/win32/advapi32/advapi32.rbuild @@ -1,6 +1,6 @@ - + . . . @@ -17,6 +17,7 @@ kernel32 pseh advapi32.h + advapi32.spec crypt.c crypt_arc4.c diff --git a/reactos/dll/win32/advapi32/advapi32.spec b/reactos/dll/win32/advapi32/advapi32.spec new file mode 100644 index 00000000000..ca87a083f65 --- /dev/null +++ b/reactos/dll/win32/advapi32/advapi32.spec @@ -0,0 +1,690 @@ + @ stdcall A_SHAFinal(ptr ptr) + @ stdcall A_SHAInit(ptr) + @ stdcall A_SHAUpdate(ptr ptr long) + @ stdcall AbortSystemShutdownA(ptr) + @ stdcall AbortSystemShutdownW(ptr) + @ stdcall AccessCheck(ptr long long ptr ptr ptr ptr ptr) + @ stdcall AccessCheckAndAuditAlarmA(str ptr str str ptr long ptr long ptr ptr ptr) + @ stdcall AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr) + @ stub AccessCheckByType #(ptr ptr long long ptr long ptr ptr ptr ptr ptr) + @ stub AccessCheckByTypeAndAuditAlarmA + @ stub AccessCheckByTypeAndAuditAlarmW + @ stub AccessCheckByTypeResultList + @ stub AccessCheckByTypeResultListAndAuditAlarmA + @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleA + @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW + @ stub AccessCheckByTypeResultListAndAuditAlarmW + @ stdcall AddAccessAllowedAce (ptr long long ptr) + @ stdcall AddAccessAllowedAceEx (ptr long long long ptr) + @ stub AddAccessAllowedObjectAce + @ stdcall AddAccessDeniedAce(ptr long long ptr) + @ stdcall AddAccessDeniedAceEx(ptr long long long ptr) + @ stub AddAccessDeniedObjectAce + @ stdcall AddAce(ptr long long ptr long) + @ stdcall AddAuditAccessAce(ptr long long ptr long long) + @ stdcall AddAuditAccessAceEx(ptr long long long ptr long long) + @ stub AddAuditAccessObjectAce + @ stub AddUsersToEncryptedFile + @ stdcall AdjustTokenGroups(long long ptr long ptr ptr) + @ stdcall AdjustTokenPrivileges(long long ptr long ptr ptr) + @ stdcall AllocateAndInitializeSid(ptr long long long long long long long long long ptr) + @ stdcall AllocateLocallyUniqueId(ptr) + @ stdcall AreAllAccessesGranted(long long) + @ stdcall AreAnyAccessesGranted(long long) + @ stdcall BackupEventLogA (long str) + @ stdcall BackupEventLogW (long wstr) + @ stdcall BuildExplicitAccessWithNameA(ptr str long long long) + @ stdcall BuildExplicitAccessWithNameW(ptr wstr long long long) + @ stub BuildImpersonateExplicitAccessWithNameA + @ stub BuildImpersonateExplicitAccessWithNameW + @ stub BuildImpersonateTrusteeA + @ stub BuildImpersonateTrusteeW + @ stdcall BuildSecurityDescriptorA(ptr ptr long ptr long ptr ptr ptr ptr) + @ stdcall BuildSecurityDescriptorW(ptr ptr long ptr long ptr ptr ptr ptr) + @ stdcall BuildTrusteeWithNameA(ptr str) + @ stdcall BuildTrusteeWithNameW(ptr wstr) + @ stdcall BuildTrusteeWithObjectsAndNameA(ptr ptr long str str str) + @ stdcall BuildTrusteeWithObjectsAndNameW(ptr ptr long wstr wstr wstr) + @ stdcall BuildTrusteeWithObjectsAndSidA(ptr ptr ptr ptr ptr) + @ stdcall BuildTrusteeWithObjectsAndSidW(ptr ptr ptr ptr ptr) + @ stdcall BuildTrusteeWithSidA(ptr ptr) + @ stdcall BuildTrusteeWithSidW(ptr ptr) + @ stub CancelOverlappedAccess + @ stdcall ChangeServiceConfig2A(long long ptr) + @ stdcall ChangeServiceConfig2W(long long ptr) + @ stdcall ChangeServiceConfigA(long long long long wstr str ptr str str str str) + @ stdcall ChangeServiceConfigW(long long long long wstr wstr ptr wstr wstr wstr wstr) + @ stdcall CheckTokenMembership(long ptr ptr) + @ stdcall ClearEventLogA (long str) + @ stdcall ClearEventLogW (long wstr) + @ stub CloseCodeAuthzLevel + @ stub CloseEncryptedFileRaw + @ stdcall CloseEventLog (long) + @ stdcall CloseServiceHandle(long) + @ stub CloseTrace + @ stdcall CommandLineFromMsiDescriptor(wstr ptr ptr) + @ stub ComputeAccessTokenFromCodeAuthzLevel + @ stdcall ControlService(long long ptr) + @ stub ControlTraceA + @ stub ControlTraceW + @ stub ConvertAccessToSecurityDescriptorA + @ stub ConvertAccessToSecurityDescriptorW + @ stub ConvertSDToStringSDRootDomainA + @ stub ConvertSDToStringSDRootDomainW + @ stub ConvertSecurityDescriptorToAccessA + @ stub ConvertSecurityDescriptorToAccessNamedA + @ stub ConvertSecurityDescriptorToAccessNamedW + @ stub ConvertSecurityDescriptorToAccessW + @ stdcall ConvertSecurityDescriptorToStringSecurityDescriptorA(ptr long long ptr ptr) + @ stdcall ConvertSecurityDescriptorToStringSecurityDescriptorW(ptr long long ptr ptr) + @ stdcall ConvertSidToStringSidA(ptr ptr) + @ stdcall ConvertSidToStringSidW(ptr ptr) + @ stub ConvertStringSDToSDDomainA + @ stub ConvertStringSDToSDDomainW + @ stub ConvertStringSDToSDRootDomainA + @ stub ConvertStringSDToSDRootDomainW + @ stdcall ConvertStringSecurityDescriptorToSecurityDescriptorA(str long ptr ptr) + @ stdcall ConvertStringSecurityDescriptorToSecurityDescriptorW(wstr long ptr ptr) + @ stdcall ConvertStringSidToSidA(ptr ptr) + @ stdcall ConvertStringSidToSidW(ptr ptr) + @ stub ConvertToAutoInheritPrivateObjectSecurity + @ stdcall CopySid(long ptr ptr) + @ stub CreateCodeAuthzLevel + @ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr) + @ stub CreatePrivateObjectSecurityEx + @ stub CreatePrivateObjectSecurityWithMultipleInheritance + @ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) + @ stub CreateProcessAsUserSecure + @ stdcall CreateProcessAsUserW(long str str ptr ptr long long ptr str ptr ptr) + @ stub CreateProcessWithLogonW #(wstr wstr wstr long wstr wstr long ptr wstr ptr ptr) + @ stdcall CreateRestrictedToken(long long long ptr long ptr long ptr ptr) + @ stdcall CreateServiceA(long ptr ptr long long long long ptr ptr ptr ptr ptr ptr) + @ stdcall CreateServiceW (long ptr ptr long long long long ptr ptr ptr ptr ptr ptr) + @ stub CreateTraceInstanceId + @ stdcall CreateWellKnownSid(long ptr ptr ptr) + @ stub CredDeleteA #(str long long) + @ stub CredDeleteW #(wstr long long) + @ stub CredEnumerateA #(str long ptr ptr) + @ stub CredEnumerateW #(wstr long ptr ptr) + @ stub CredFree #(ptr) + @ stub CredGetSessionTypes #(long ptr) + @ stub CredGetTargetInfoA + @ stub CredGetTargetInfoW + @ stub CredIsMarshaledCredentialA + @ stub CredIsMarshaledCredentialW + @ stub CredMarshalCredentialA + @ stub CredMarshalCredentialW + @ stub CredProfileLoaded + @ stub CredReadA #(str long long ptr) + @ stub CredReadDomainCredentialsA + @ stub CredReadDomainCredentialsW + @ stub CredReadW #(wstr long long ptr) + @ stub CredRenameA + @ stub CredRenameW + @ stub CredUnmarshalCredentialA + @ stub CredUnmarshalCredentialW + @ stub CredWriteA #(ptr long) + @ stub CredWriteDomainCredentialsA + @ stub CredWriteDomainCredentialsW + @ stub CredWriteW #(ptr long) + @ stub CredpConvertCredential + @ stub CredpConvertTargetInfo + @ stub CredpDecodeCredential + @ stub CredpEncodeCredential + @ stdcall CryptAcquireContextA(ptr str str long long) + @ stdcall CryptAcquireContextW(ptr wstr wstr long long) + @ stdcall CryptContextAddRef(long ptr long) + @ stdcall CryptCreateHash(long long long long ptr) + @ stdcall CryptDecrypt(long long long long ptr ptr) + @ stdcall CryptDeriveKey(long long long long ptr) + @ stdcall CryptDestroyHash(long) + @ stdcall CryptDestroyKey(long) + @ stdcall CryptDuplicateHash(long ptr long ptr) + @ stdcall CryptDuplicateKey(long ptr long ptr) + @ stdcall CryptEncrypt(long long long long ptr ptr long) + @ stdcall CryptEnumProviderTypesA(long ptr long ptr ptr ptr) + @ stdcall CryptEnumProviderTypesW(long ptr long ptr ptr ptr) + @ stdcall CryptEnumProvidersA(long ptr long ptr ptr ptr) + @ stdcall CryptEnumProvidersW(long ptr long ptr ptr ptr) + @ stdcall CryptExportKey(long long long long ptr ptr) + @ stdcall CryptGenKey(long long long ptr) + @ stdcall CryptGenRandom(long long ptr) + @ stdcall CryptGetDefaultProviderA(long ptr long ptr ptr) + @ stdcall CryptGetDefaultProviderW(long ptr long ptr ptr) + @ stdcall CryptGetHashParam(long long ptr ptr long) + @ stdcall CryptGetKeyParam(long long ptr ptr long) + @ stdcall CryptGetProvParam(long long ptr ptr long) + @ stdcall CryptGetUserKey(long long ptr) + @ stdcall CryptHashData(long ptr long long) + @ stdcall CryptHashSessionKey(long long long) + @ stdcall CryptImportKey(long ptr long long long ptr) + @ stdcall CryptReleaseContext(long long) + @ stdcall CryptSetHashParam(long long ptr long) + @ stdcall CryptSetKeyParam(long long ptr long) + @ stdcall CryptSetProvParam(long long ptr long) + @ stdcall CryptSetProviderA(str long) + @ stdcall CryptSetProviderExA(str long ptr long) + @ stdcall CryptSetProviderExW(wstr long ptr long) + @ stdcall CryptSetProviderW(wstr long) + @ stdcall CryptSignHashA(long long ptr long ptr ptr) + @ stdcall CryptSignHashW(long long ptr long ptr ptr) + @ stdcall CryptVerifySignatureA(long ptr long long ptr long) + @ stdcall CryptVerifySignatureW(long ptr long long ptr long) + @ stdcall DecryptFileA(str long) + @ stdcall DecryptFileW(wstr long) + @ stdcall DeleteAce(ptr long) + @ stdcall DeleteService(long) + @ stdcall DeregisterEventSource(long) + @ stdcall DestroyPrivateObjectSecurity(ptr) + @ stub DuplicateEncryptionInfoFile + @ stdcall DuplicateToken(long long ptr) + @ stdcall DuplicateTokenEx(long long ptr long long ptr) + @ stub ElfBackupEventLogFileA + @ stub ElfBackupEventLogFileW + @ stub ElfChangeNotify + @ stub ElfClearEventLogFileA + @ stub ElfClearEventLogFileW + @ stub ElfCloseEventLog + @ stub ElfDeregisterEventSource + @ stub ElfDeregisterEventSourceW + @ stub ElfFlushEventLog + @ stub ElfNumberOfRecords + @ stub ElfOldestRecord + @ stub ElfOpenBackupEventLogA + @ stub ElfOpenBackupEventLogW + @ stub ElfOpenEventLogA + @ stub ElfOpenEventLogW + @ stub ElfReadEventLogA + @ stub ElfReadEventLogW + @ stub ElfRegisterEventSourceA + @ stub ElfRegisterEventSourceW + @ stub ElfReportEventA + @ stub ElfReportEventW + @ stub EnableTrace + @ stdcall EncryptFileA(str) + @ stdcall EncryptFileW(wstr) + @ stub EncryptedFileKeyInfo + @ stub EncryptionDisable + @ stdcall EnumDependentServicesA(long long ptr long ptr ptr) + @ stdcall EnumDependentServicesW(long long ptr long ptr ptr) + @ stub EnumServiceGroupA + @ stub EnumServiceGroupW + @ stdcall EnumServicesStatusA (long long long ptr long ptr ptr ptr) + @ stdcall EnumServicesStatusExA(long long long long ptr long ptr ptr ptr str) + @ stdcall EnumServicesStatusExW(long long long long ptr long ptr ptr ptr wstr) + @ stdcall EnumServicesStatusW (long long long ptr long ptr ptr ptr) + @ stub EnumerateTraceGuids + @ stub EqualDomainSid + @ stdcall EqualPrefixSid(ptr ptr) + @ stdcall EqualSid(ptr ptr) + @ stdcall FileEncryptionStatusA(str ptr) + @ stdcall FileEncryptionStatusW(wstr ptr) + @ stdcall FindFirstFreeAce(ptr ptr) + @ stub FlushTraceA + @ stub FlushTraceW + @ stub FreeEncryptedFileKeyInfo + @ stub FreeEncryptionCertificateHashList + @ stub FreeInheritedFromArray + @ stdcall FreeSid(ptr) + @ stub GetAccessPermissionsForObjectA + @ stub GetAccessPermissionsForObjectW + @ stdcall GetAce(ptr long ptr) + @ stdcall GetAclInformation(ptr ptr long long) + @ stdcall GetAuditedPermissionsFromAclA(ptr ptr ptr ptr) + @ stdcall GetAuditedPermissionsFromAclW(ptr ptr ptr ptr) + @ stdcall GetCurrentHwProfileA(ptr) + @ stdcall GetCurrentHwProfileW(ptr) + @ stdcall GetEffectiveRightsFromAclA(ptr ptr ptr) + @ stdcall GetEffectiveRightsFromAclW(ptr ptr ptr) + @ stub GetEventLogInformation + @ stub GetExplicitEntriesFromAclA #(ptr ptr ptr) + @ stdcall GetExplicitEntriesFromAclW(ptr ptr ptr) + @ stdcall GetFileSecurityA(str long ptr long ptr) + @ stdcall GetFileSecurityW(wstr long ptr long ptr) + @ stub GetInformationCodeAuthzLevelW + @ stub GetInformationCodeAuthzPolicyW + @ stub GetInheritanceSourceA + @ stub GetInheritanceSourceW + @ stdcall GetKernelObjectSecurity(long long ptr long ptr) + @ stdcall GetLengthSid(ptr) + @ stub GetLocalManagedApplicationData + @ stub GetLocalManagedApplications + @ stub GetManagedApplicationCategories + @ stub GetManagedApplications + @ stub GetMangledSiteSid + @ stub GetMultipleTrusteeA + @ stub GetMultipleTrusteeOperationA + @ stub GetMultipleTrusteeOperationW + @ stub GetMultipleTrusteeW + @ stdcall GetNamedSecurityInfoA (str long long ptr ptr ptr ptr ptr) + @ stub GetNamedSecurityInfoExA + @ stub GetNamedSecurityInfoExW + @ stdcall GetNamedSecurityInfoW (wstr long long ptr ptr ptr ptr ptr) + @ stdcall GetNumberOfEventLogRecords (long ptr) + @ stdcall GetOldestEventLogRecord (long ptr) + @ stub GetOverlappedAccessResults + @ stdcall GetPrivateObjectSecurity(ptr long ptr long ptr) + @ stdcall GetSecurityDescriptorControl (ptr ptr ptr) + @ stdcall GetSecurityDescriptorDacl (ptr ptr ptr ptr) + @ stdcall GetSecurityDescriptorGroup(ptr ptr ptr) + @ stub GetSecurityDescriptorLength #(ptr) + @ stdcall GetSecurityDescriptorOwner(ptr ptr ptr) + @ stub GetSecurityDescriptorRMControl + @ stdcall GetSecurityDescriptorSacl (ptr ptr ptr ptr) + @ stdcall GetSecurityInfo (long long long ptr ptr ptr ptr ptr) + @ stub GetSecurityInfoExA + @ stdcall GetSecurityInfoExW (long long long wstr wstr ptr ptr ptr ptr) + @ stdcall GetServiceDisplayNameA(ptr str ptr ptr) + @ stdcall GetServiceDisplayNameW(ptr wstr ptr ptr) + @ stdcall GetServiceKeyNameA(long str ptr ptr) + @ stdcall GetServiceKeyNameW(long wstr ptr ptr) + @ stdcall GetSidIdentifierAuthority(ptr) + @ stdcall GetSidLengthRequired(long) + @ stdcall GetSidSubAuthority(ptr long) + @ stdcall GetSidSubAuthorityCount(ptr) + @ stub GetSiteSidFromToken + @ stdcall GetTokenInformation(long long ptr long ptr) + @ stub GetTraceEnableFlags + @ stub GetTraceEnableLevel + @ stub GetTraceLoggerHandle + @ stdcall GetTrusteeFormA(ptr) + @ stdcall GetTrusteeFormW(ptr) + @ stdcall GetTrusteeNameA(ptr) + @ stdcall GetTrusteeNameW(ptr) + @ stdcall GetTrusteeTypeA(ptr) + @ stdcall GetTrusteeTypeW(ptr) + @ stdcall GetUserNameA(ptr ptr) + @ stdcall GetUserNameW(ptr ptr) + @ stub GetWindowsAccountDomainSid + @ stub I_ScGetCurrentGroupStateW + @ stub I_ScIsSecurityProcess + @ stub I_ScPnPGetServiceName + @ stub I_ScSendTSMessage + @ stub I_ScSetServiceBit + @ stub I_ScSetServiceBitsA + @ stub I_ScSetServiceBitsW + @ stub IdentifyCodeAuthzLevelW + @ stub ImpersonateAnonymousToken + @ stdcall ImpersonateLoggedOnUser(long) + @ stdcall ImpersonateNamedPipeClient(long) + @ stdcall ImpersonateSelf(long) + @ stdcall InitializeAcl(ptr long long) + @ stdcall InitializeSecurityDescriptor(ptr long) + @ stdcall InitializeSid(ptr ptr long) + @ stdcall InitiateSystemShutdownA(str str long long long) + @ stub InitiateSystemShutdownExA #(str str long long long long) + @ stdcall InitiateSystemShutdownExW(wstr wstr long long long long) + @ stdcall InitiateSystemShutdownW(str str long long long) + @ stub InstallApplication + @ stub IsProcessRestricted + @ stub IsTextUnicode #(ptr long ptr) + @ stdcall IsTokenRestricted(long) + @ stub IsTokenUntrusted + @ stdcall IsValidAcl(ptr) + @ stdcall IsValidSecurityDescriptor(ptr) + @ stdcall IsValidSid(ptr) + @ stdcall IsWellKnownSid(ptr long) + @ stdcall LockServiceDatabase(ptr) + @ stdcall LogonUserA(str str str long long ptr) + @ stub LogonUserExA + @ stub LogonUserExW + @ stdcall LogonUserW(wstr wstr wstr long long ptr) + @ stdcall LookupAccountNameA(str str ptr ptr ptr ptr ptr) + @ stdcall LookupAccountNameW(wstr wstr ptr ptr ptr ptr ptr) + @ stdcall LookupAccountSidA(ptr ptr ptr ptr ptr ptr ptr) + @ stdcall LookupAccountSidW(ptr ptr ptr ptr ptr ptr ptr) + @ stdcall LookupPrivilegeDisplayNameA(str str str ptr ptr) + @ stdcall LookupPrivilegeDisplayNameW(wstr wstr wstr ptr ptr) + @ stdcall LookupPrivilegeNameA(str ptr ptr long) + @ stdcall LookupPrivilegeNameW(wstr ptr ptr long) + @ stdcall LookupPrivilegeValueA(ptr ptr ptr) + @ stdcall LookupPrivilegeValueW(ptr ptr ptr) + @ stub LookupSecurityDescriptorPartsA + @ stub LookupSecurityDescriptorPartsW + @ stdcall LsaAddAccountRights(ptr ptr ptr long) + @ stub LsaAddPrivilegesToAccount + @ stub LsaClearAuditLog + @ stdcall LsaClose(ptr) + @ stub LsaCreateAccount + @ stub LsaCreateSecret + @ stub LsaCreateTrustedDomain + @ stdcall LsaCreateTrustedDomainEx(ptr ptr ptr long ptr) + @ stub LsaDelete + @ stdcall LsaDeleteTrustedDomain(ptr ptr) + @ stdcall LsaEnumerateAccountRights(ptr ptr ptr ptr) + @ stub LsaEnumerateAccounts + @ stdcall LsaEnumerateAccountsWithUserRight(ptr ptr ptr ptr) + @ stub LsaEnumeratePrivileges + @ stub LsaEnumeratePrivilegesOfAccount + @ stdcall LsaEnumerateTrustedDomains(ptr ptr ptr long ptr) + @ stdcall LsaEnumerateTrustedDomainsEx(ptr ptr ptr long ptr) + @ stdcall LsaFreeMemory(ptr) + @ stub LsaGetQuotasForAccount + @ stub LsaGetRemoteUserName + @ stub LsaGetSystemAccessAccount + @ stub LsaGetUserName + @ stub LsaICLookupNames + @ stub LsaICLookupNamesWithCreds + @ stub LsaICLookupSids + @ stub LsaICLookupSidsWithCreds + @ stdcall LsaLookupNames2(ptr long long ptr ptr ptr) + @ stdcall LsaLookupNames(long long ptr ptr ptr) + @ stub LsaLookupPrivilegeDisplayName + @ stub LsaLookupPrivilegeName + @ stub LsaLookupPrivilegeValue + @ stdcall LsaLookupSids(ptr long ptr ptr ptr) + @ stdcall LsaNtStatusToWinError(long) + @ stub LsaOpenAccount + @ stdcall LsaOpenPolicy(long long long long) + @ stub LsaOpenPolicySce + @ stub LsaOpenSecret + @ stub LsaOpenTrustedDomain + @ stdcall LsaOpenTrustedDomainByName(ptr ptr long ptr) + @ stub LsaQueryDomainInformationPolicy + @ stub LsaQueryForestTrustInformation + @ stub LsaQueryInfoTrustedDomain + @ stdcall LsaQueryInformationPolicy(ptr long ptr) + @ stub LsaQuerySecret + @ stub LsaQuerySecurityObject + @ stdcall LsaQueryTrustedDomainInfo(ptr ptr long ptr) + @ stdcall LsaQueryTrustedDomainInfoByName(ptr ptr long ptr) + @ stub LsaRegisterPolicyChangeNotification #(long long) + @ stdcall LsaRemoveAccountRights(ptr ptr long ptr long) + @ stub LsaRemovePrivilegesFromAccount + @ stdcall LsaRetrievePrivateData(ptr ptr ptr) + @ stub LsaSetDomainInformationPolicy + @ stub LsaSetForestTrustInformation + @ stdcall LsaSetInformationPolicy(long long ptr) + @ stub LsaSetInformationTrustedDomain + @ stub LsaSetQuotasForAccount + @ stub LsaSetSecret + @ stub LsaSetSecurityObject + @ stub LsaSetSystemAccessAccount + @ stdcall LsaSetTrustedDomainInfoByName(ptr ptr long ptr) + @ stdcall LsaSetTrustedDomainInformation(ptr ptr long ptr) + @ stdcall LsaStorePrivateData(ptr ptr ptr) + @ stub LsaUnregisterPolicyChangeNotification #(long long) + @ stdcall MD4Final(ptr) + @ stdcall MD4Init(ptr) + @ stdcall MD4Update(ptr ptr long) + @ stdcall MD5Final(ptr) + @ stdcall MD5Init(ptr) + @ stdcall MD5Update(ptr ptr long) + @ stub MSChapSrvChangePassword2 + @ stub MSChapSrvChangePassword + @ stub MakeAbsoluteSD2 + @ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) + @ stdcall MakeSelfRelativeSD(ptr ptr ptr) + @ stub MapGenericMask #(ptr ptr) + @ stdcall NotifyBootConfigStatus(long) + @ stdcall NotifyChangeEventLog (long long) + @ stdcall ObjectCloseAuditAlarmA(str ptr long) + @ stdcall ObjectCloseAuditAlarmW(wstr ptr long) + @ stub ObjectDeleteAuditAlarmA + @ stdcall ObjectDeleteAuditAlarmW(wstr ptr long) + @ stdcall ObjectOpenAuditAlarmA(str ptr str str ptr long long long ptr long long ptr) + @ stdcall ObjectOpenAuditAlarmW(wstr ptr wstr wstr ptr long long long ptr long long ptr) + @ stdcall ObjectPrivilegeAuditAlarmA(str ptr long long ptr long) + @ stdcall ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long) + @ stdcall OpenBackupEventLogA (str str) + @ stdcall OpenBackupEventLogW (wstr wstr) + @ stub OpenEncryptedFileRawA + @ stub OpenEncryptedFileRawW + @ stdcall OpenEventLogA (str str) + @ stdcall OpenEventLogW (wstr wstr) + @ stdcall OpenProcessToken(long long ptr) + @ stdcall OpenSCManagerA(str str long) + @ stdcall OpenSCManagerW(wstr wstr long) + @ stdcall OpenServiceA(long str long) + @ stdcall OpenServiceW(long wstr long) + @ stdcall OpenThreadToken(long long long ptr) + @ stub OpenTraceA + @ stub OpenTraceW + @ stdcall PrivilegeCheck(ptr ptr ptr) + @ stdcall PrivilegedServiceAuditAlarmA(str str long ptr long) + @ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long) + @ stub ProcessIdleTasks + @ stub ProcessTrace + @ stub QueryAllTracesA + @ stub QueryAllTracesW + @ stub QueryRecoveryAgentsOnEncryptedFile + @ stdcall QueryServiceConfig2A(long long ptr long ptr) + @ stdcall QueryServiceConfig2W(long long ptr long ptr) + @ stdcall QueryServiceConfigA(long ptr long ptr) + @ stdcall QueryServiceConfigW(long ptr long ptr) + @ stdcall QueryServiceLockStatusA(long ptr long ptr) + @ stdcall QueryServiceLockStatusW(long ptr long ptr) + @ stdcall QueryServiceObjectSecurity(long long ptr long ptr) + @ stdcall QueryServiceStatus(long ptr) + @ stdcall QueryServiceStatusEx (long long ptr long ptr) + @ stub QueryTraceA + @ stub QueryTraceW + @ stub QueryUsersOnEncryptedFile + @ stub QueryWindows31FilesMigration #(long) + @ stub ReadEncryptedFileRaw + @ stdcall ReadEventLogA (long long long ptr long ptr ptr) + @ stdcall ReadEventLogW (long long long ptr long ptr ptr) + @ stdcall RegCloseKey(long) + @ stdcall RegConnectRegistryA(str long ptr) + @ stdcall RegConnectRegistryW(wstr long ptr) + @ stdcall RegCreateKeyA(long str ptr) + @ stdcall RegCreateKeyExA(long str long ptr long long ptr ptr ptr) + @ stdcall RegCreateKeyExW(long wstr long ptr long long ptr ptr ptr) + @ stdcall RegCreateKeyW(long wstr ptr) + @ stdcall RegDeleteKeyA(long str) + @ stdcall RegDeleteKeyW(long wstr) + @ stdcall RegDeleteTreeA(long str) + @ stdcall RegDeleteTreeW(long wstr) + @ stdcall RegDeleteValueA(long str) + @ stdcall RegDeleteValueW(long wstr) + @ stdcall RegDisablePredefinedCache() + @ stdcall RegEnumKeyA(long long ptr long) + @ stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr) + @ stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr) + @ stdcall RegEnumKeyW(long long ptr long) + @ stdcall RegEnumValueA(long long ptr ptr ptr ptr ptr ptr) + @ stdcall RegEnumValueW(long long ptr ptr ptr ptr ptr ptr) + @ stdcall RegFlushKey(long) + @ stdcall RegGetKeySecurity(long long ptr ptr) + @ stdcall RegGetValueA(long str str long ptr ptr ptr) + @ stdcall RegGetValueW(long wstr wstr long ptr ptr ptr) + @ stdcall RegLoadKeyA(long str str) + @ stdcall RegLoadKeyW(long wstr wstr) + @ stdcall RegLoadMUIStringA(long str str long ptr long str) + @ stdcall RegLoadMUIStringW(long wstr wstr long ptr long wstr) + @ stdcall RegNotifyChangeKeyValue(long long long long long) + @ stdcall RegOpenCurrentUser(long ptr) + @ stdcall RegOpenKeyA(long str ptr) + @ stdcall RegOpenKeyExA(long str long long ptr) + @ stdcall RegOpenKeyExW(long wstr long long ptr) + @ stdcall RegOpenKeyW(long wstr ptr) + @ stdcall RegOpenUserClassesRoot(ptr long long ptr) + @ stdcall RegOverridePredefKey(long long) + @ stdcall RegQueryInfoKeyA(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) + @ stdcall RegQueryInfoKeyW(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) + @ stdcall RegQueryMultipleValuesA(long ptr long ptr ptr) + @ stdcall RegQueryMultipleValuesW(long ptr long ptr ptr) + @ stdcall RegQueryValueA(long str ptr ptr) + @ stdcall RegQueryValueExA(long str ptr ptr ptr ptr) + @ stdcall RegQueryValueExW(long wstr ptr ptr ptr ptr) + @ stdcall RegQueryValueW(long wstr ptr ptr) + @ stub RegRemapPreDefKey + @ stdcall RegReplaceKeyA(long str str str) + @ stdcall RegReplaceKeyW(long wstr wstr wstr) + @ stdcall RegRestoreKeyA(long str long) + @ stdcall RegRestoreKeyW(long wstr long) + @ stdcall RegSaveKeyA(long ptr ptr) + @ stub RegSaveKeyExA + @ stub RegSaveKeyExW + @ stdcall RegSaveKeyW(long ptr ptr) + @ stdcall RegSetKeySecurity(long long ptr) + @ stdcall RegSetValueA(long str long ptr long) + @ stdcall RegSetValueExA(long str long long ptr long) + @ stdcall RegSetValueExW(long wstr long long ptr long) + @ stdcall RegSetValueW(long wstr long ptr long) + @ stdcall RegUnLoadKeyA(long str) + @ stdcall RegUnLoadKeyW(long wstr) + @ stdcall RegisterEventSourceA(ptr ptr) + @ stdcall RegisterEventSourceW(ptr ptr) + @ stub RegisterIdleTask + @ stdcall RegisterServiceCtrlHandlerA(str ptr) + @ stdcall RegisterServiceCtrlHandlerExA(str ptr ptr) + @ stdcall RegisterServiceCtrlHandlerExW(wstr ptr ptr) + @ stdcall RegisterServiceCtrlHandlerW(wstr ptr) + @ stdcall RegisterTraceGuidsA(ptr ptr ptr long ptr str str ptr) + @ stdcall RegisterTraceGuidsW(ptr ptr ptr long ptr wstr wstr ptr) + @ stub RemoveTraceCallback + @ stub RemoveUsersFromEncryptedFile + @ stdcall ReportEventA (long long long long ptr long long str ptr) + @ stdcall ReportEventW (long long long long ptr long long wstr ptr) + @ stdcall RevertToSelf() + @ stub SaferCloseLevel + @ stub SaferComputeTokenFromLevel + @ stub SaferCreateLevel + @ stub SaferGetLevelInformation + @ stub SaferGetPolicyInformation + @ stub SaferIdentifyLevel + @ stub SaferRecordEventLogEntry + @ stub SaferSetLevelInformation + @ stub SaferSetPolicyInformation + @ stub SaferiChangeRegistryScope + @ stub SaferiCompareTokenLevels + @ stub SaferiIsExecutableFileType + @ stub SaferiPopulateDefaultsInRegistry + @ stub SaferiRecordEventLogEntry + @ stub SaferiReplaceProcessThreadTokens + @ stub SaferiSearchMatchingHashRules + @ stdcall SetAclInformation(ptr ptr long long) + @ stub SetEntriesInAccessListA + @ stub SetEntriesInAccessListW + @ stdcall SetEntriesInAclA(long ptr ptr ptr) + @ stdcall SetEntriesInAclW(long ptr ptr ptr) + @ stub SetEntriesInAuditListA + @ stub SetEntriesInAuditListW + @ stdcall SetFileSecurityA(str long ptr ) + @ stdcall SetFileSecurityW(wstr long ptr) + @ stub SetInformationCodeAuthzLevelW + @ stub SetInformationCodeAuthzPolicyW + @ stdcall SetKernelObjectSecurity(long long ptr) + @ stdcall SetNamedSecurityInfoA(str long ptr ptr ptr ptr ptr) + @ stub SetNamedSecurityInfoExA + @ stub SetNamedSecurityInfoExW + @ stdcall SetNamedSecurityInfoW(wstr long ptr ptr ptr ptr ptr) + @ stdcall SetPrivateObjectSecurity(long ptr ptr ptr long) + @ stub SetPrivateObjectSecurityEx + @ stdcall SetSecurityDescriptorControl(ptr long long) + @ stdcall SetSecurityDescriptorDacl(ptr long ptr long) + @ stdcall SetSecurityDescriptorGroup (ptr ptr long) + @ stdcall SetSecurityDescriptorOwner (ptr ptr long) + @ stub SetSecurityDescriptorRMControl + @ stdcall SetSecurityDescriptorSacl(ptr long ptr long) + @ stdcall SetSecurityInfo (long long long ptr ptr ptr ptr) + @ stub SetSecurityInfoExA + @ stub SetSecurityInfoExW + @ stdcall SetServiceBits(long long long long) + @ stdcall SetServiceObjectSecurity(long long ptr) + @ stdcall SetServiceStatus(long long) + @ stdcall SetThreadToken (ptr ptr) + @ stdcall SetTokenInformation (long long ptr long) + @ stub SetTraceCallback + @ stub SetUserFileEncryptionKey + @ stdcall StartServiceA(long long ptr) + @ stdcall StartServiceCtrlDispatcherA(ptr) + @ stdcall StartServiceCtrlDispatcherW(ptr) + @ stdcall StartServiceW(long long ptr) + @ stub StartTraceA + @ stub StartTraceW + @ stub StopTraceA + @ stub StopTraceW + @ stub SynchronizeWindows31FilesAndWindowsNTRegistry #(long long long long) + @ stdcall SystemFunction001(ptr ptr ptr) + @ stdcall SystemFunction002(ptr ptr ptr) + @ stdcall SystemFunction003(ptr ptr) + @ stdcall SystemFunction004(ptr ptr ptr) + @ stdcall SystemFunction005(ptr ptr ptr) + @ stdcall SystemFunction006(ptr ptr) + @ stdcall SystemFunction007(ptr ptr) + @ stdcall SystemFunction008(ptr ptr ptr) + @ stdcall SystemFunction009(ptr ptr ptr) + @ stdcall SystemFunction010(ptr ptr ptr) + @ stdcall SystemFunction011(ptr ptr ptr) SystemFunction010 + @ stdcall SystemFunction012(ptr ptr ptr) + @ stdcall SystemFunction013(ptr ptr ptr) + @ stdcall SystemFunction014(ptr ptr ptr) SystemFunction012 + @ stdcall SystemFunction015(ptr ptr ptr) SystemFunction013 + @ stdcall SystemFunction016(ptr ptr ptr) SystemFunction012 + @ stdcall SystemFunction017(ptr ptr ptr) SystemFunction013 + @ stdcall SystemFunction018(ptr ptr ptr) SystemFunction012 + @ stdcall SystemFunction019(ptr ptr ptr) SystemFunction013 + @ stdcall SystemFunction020(ptr ptr ptr) SystemFunction012 + @ stdcall SystemFunction021(ptr ptr ptr) SystemFunction013 + @ stdcall SystemFunction022(ptr ptr ptr) SystemFunction012 + @ stdcall SystemFunction023(ptr ptr ptr) SystemFunction013 + @ stdcall SystemFunction024(ptr ptr ptr) + @ stdcall SystemFunction025(ptr ptr ptr) + @ stdcall SystemFunction026(ptr ptr ptr) SystemFunction024 + @ stdcall SystemFunction027(ptr ptr ptr) SystemFunction025 + @ stub SystemFunction028 + @ stub SystemFunction029 + @ stdcall SystemFunction030(ptr ptr) + @ stdcall SystemFunction031(ptr ptr) SystemFunction030 + @ stdcall SystemFunction032(ptr ptr) + @ stub SystemFunction033 + @ stub SystemFunction034 + @ stdcall SystemFunction035(str) + @ stdcall SystemFunction036(ptr long) # RtlGenRandom + @ stdcall SystemFunction040(ptr long long) # RtlEncryptMemory + @ stdcall SystemFunction041(ptr long long) # RtlDecryptMemory + @ stub TraceEvent + @ stub TraceEventInstance + @ stub TraceMessage + @ stub TraceMessageVa + @ stub TreeResetNamedSecurityInfoA + @ stub TreeResetNamedSecurityInfoW + @ stub TrusteeAccessToObjectA + @ stub TrusteeAccessToObjectW + @ stub UninstallApplication + @ stdcall UnlockServiceDatabase (ptr) + @ stub UnregisterIdleTask + @ stub UnregisterTraceGuids + @ stub UpdateTraceA + @ stub UpdateTraceW + @ stub WdmWmiServiceMain + @ stub WmiCloseBlock + @ stub WmiCloseTraceWithCursor + @ stub WmiConvertTimestamp + @ stub WmiDevInstToInstanceNameA + @ stub WmiDevInstToInstanceNameW + @ stub WmiEnumerateGuids + @ stub WmiExecuteMethodA + @ stub WmiExecuteMethodW + @ stub WmiFileHandleToInstanceNameA + @ stub WmiFileHandleToInstanceNameW + @ stub WmiFreeBuffer + @ stub WmiGetFirstTraceOffset + @ stub WmiGetNextEvent + @ stub WmiGetTraceHeader + @ stub WmiMofEnumerateResourcesA + @ stub WmiMofEnumerateResourcesW + @ stub WmiNotificationRegistrationA + @ stub WmiNotificationRegistrationW + @ stub WmiOpenBlock + @ stub WmiOpenTraceWithCursor + @ stub WmiParseTraceEvent + @ stub WmiQueryAllDataA + @ stub WmiQueryAllDataMultipleA + @ stub WmiQueryAllDataMultipleW + @ stub WmiQueryAllDataW + @ stub WmiQueryGuidInformation + @ stub WmiQuerySingleInstanceA + @ stub WmiQuerySingleInstanceMultipleA + @ stub WmiQuerySingleInstanceMultipleW + @ stub WmiQuerySingleInstanceW + @ stub WmiReceiveNotificationsA + @ stub WmiReceiveNotificationsW + @ stub WmiSetSingleInstanceA + @ stub WmiSetSingleInstanceW + @ stub WmiSetSingleItemA + @ stub WmiSetSingleItemW + @ stub Wow64Win32ApiEntry + @ stub WriteEncryptedFileRaw diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index de3c2ac4d55..099bc4a7c0b 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -41,9 +41,9 @@ static VOID CloseDefaultKeys(VOID); NtClose(Handle); \ } #define IsPredefKey(HKey) \ - (((ULONG)(HKey) & 0xF0000000) == 0x80000000) + (((ULONG_PTR)(HKey) & 0xF0000000) == 0x80000000) #define GetPredefKeyIndex(HKey) \ - ((ULONG)(HKey) & 0x0FFFFFFF) + ((ULONG_PTR)(HKey) & 0x0FFFFFFF) static NTSTATUS OpenClassesRootKey(PHANDLE KeyHandle); static NTSTATUS OpenLocalMachineKey (PHANDLE KeyHandle); diff --git a/reactos/dll/win32/advapi32/sec/lsa.c b/reactos/dll/win32/advapi32/sec/lsa.c index 032a5bd0ea9..2b68edeea7e 100644 --- a/reactos/dll/win32/advapi32/sec/lsa.c +++ b/reactos/dll/win32/advapi32/sec/lsa.c @@ -93,7 +93,7 @@ LsaClose(LSA_HANDLE ObjectHandle) LSAHandleBind(); return LsarClose(LSABindingHandle, - (unsigned long)ObjectHandle); + (ULONG_PTR)ObjectHandle); } diff --git a/reactos/dll/win32/advapi32/service/scm.c b/reactos/dll/win32/advapi32/service/scm.c index 61105fb835f..ae9046b4eb6 100644 --- a/reactos/dll/win32/advapi32/service/scm.c +++ b/reactos/dll/win32/advapi32/service/scm.c @@ -117,7 +117,7 @@ ChangeServiceConfig2A(SC_HANDLE hService, HandleBind(); dwError = RChangeServiceConfig2A(BindingHandle, - (SC_RPC_HANDLE)hService, + (SC_RPC_HANDLE)(ULONG_PTR)hService, Info); if (dwError != ERROR_SUCCESS) { diff --git a/reactos/dll/win32/advapi32/service/sctrl.c b/reactos/dll/win32/advapi32/service/sctrl.c index 52f51c36c8a..07fc86a1d78 100644 --- a/reactos/dll/win32/advapi32/service/sctrl.c +++ b/reactos/dll/win32/advapi32/service/sctrl.c @@ -277,7 +277,7 @@ ScStartService(PSCM_CONTROL_PACKET ControlPacket) TRACE("Size: %lu\n", ControlPacket->dwSize); TRACE("Service: %S\n", &ControlPacket->szArguments[0]); - lpService = (PACTIVE_SERVICE)ControlPacket->hClient; + lpService = (PACTIVE_SERVICE)(ULONG_PTR)ControlPacket->hClient; if (lpService == NULL) { TRACE("Service not found\n"); @@ -320,7 +320,7 @@ ScControlService(PSCM_CONTROL_PACKET ControlPacket) TRACE("Size: %lu\n", ControlPacket->dwSize); TRACE("Service: %S\n", &ControlPacket->szArguments[0]); - lpService = (PACTIVE_SERVICE)ControlPacket->hClient; + lpService = (PACTIVE_SERVICE)(ULONG_PTR)ControlPacket->hClient; if (lpService == NULL) { TRACE("Service not found\n"); From d75ee99e103594d11463daac2599ec247c313875 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 16:00:47 +0000 Subject: [PATCH 036/388] Fix broken DLGPROC definition. Fix previous, unneeded, fixes. svn path=/branches/ros-amd64-bringup/; revision=34786 --- reactos/base/applications/calc/winmain.c | 6 +++--- reactos/base/applications/charmap/about.c | 2 +- reactos/base/applications/charmap/charmap.c | 4 ++-- reactos/base/applications/dxdiag/display.c | 2 +- reactos/base/applications/dxdiag/dxdiag.c | 12 ++++++------ reactos/base/applications/dxdiag/sound.c | 2 +- reactos/base/applications/msconfig/msconfig.c | 14 +++++++------- .../base/applications/mscutils/devmgmt/mainwnd.c | 2 +- .../base/applications/mscutils/servman/create.c | 2 +- .../base/applications/mscutils/servman/mainwnd.c | 6 +++--- .../base/applications/mscutils/servman/progress.c | 2 +- reactos/base/applications/mstsc/connectdialog.c | 6 +++--- reactos/base/applications/notepad/dialog.c | 4 ++-- reactos/base/applications/notepad/main.c | 2 +- reactos/base/applications/winhlp32/lex.yy.c | 2 +- reactos/include/psdk/winuser.h | 2 +- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/reactos/base/applications/calc/winmain.c b/reactos/base/applications/calc/winmain.c index 9c83b347dad..d4c57f5e66e 100644 --- a/reactos/base/applications/calc/winmain.c +++ b/reactos/base/applications/calc/winmain.c @@ -1303,7 +1303,7 @@ static LRESULT CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) SetFocus(GetDlgItem(hWnd, IDC_BUTTON_FOCUS)); switch (LOWORD(wp)) { case IDM_HELP_ABOUT: - DialogBox(calc.hInstance,MAKEINTRESOURCE(IDD_DIALOG_ABOUT), hWnd,(DLGPROC) AboutDlgProc); + DialogBox(calc.hInstance,MAKEINTRESOURCE(IDD_DIALOG_ABOUT), hWnd, AboutDlgProc); return TRUE; case IDM_HELP_HELP: #ifndef DISABLE_HTMLHELP_SUPPORT @@ -1626,7 +1626,7 @@ static LRESULT CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) if (IsWindow(calc.hStatWnd)) break; calc.hStatWnd = CreateDialog(calc.hInstance, - MAKEINTRESOURCE(IDD_DIALOG_STAT), hWnd, (DLGPROC)DlgStatProc); + MAKEINTRESOURCE(IDD_DIALOG_STAT), hWnd, DlgStatProc); if (calc.hStatWnd != NULL) { enable_allowed_controls(hWnd, calc.base); SendMessage(calc.hStatWnd, WM_SETFOCUS, 0, 0); @@ -1715,7 +1715,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL else dwLayout = IDD_DIALOG_STANDARD; - CreateDialog(hInstance, MAKEINTRESOURCE(dwLayout), NULL, (DLGPROC)DlgMainProc); + CreateDialog(hInstance, MAKEINTRESOURCE(dwLayout), NULL, DlgMainProc); while (GetMessage(&msg, NULL, 0, 0)) { #ifndef USE_KEYBOARD_HOOK diff --git a/reactos/base/applications/charmap/about.c b/reactos/base/applications/charmap/about.c index 91b2ebbb3a2..464591ee1c6 100644 --- a/reactos/base/applications/charmap/about.c +++ b/reactos/base/applications/charmap/about.c @@ -79,5 +79,5 @@ ShowAboutDlg(HWND hWndParent) DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_ABOUTBOX), hWndParent, - (DLGPROC)AboutDialogProc); + AboutDialogProc); } diff --git a/reactos/base/applications/charmap/charmap.c b/reactos/base/applications/charmap/charmap.c index 22c966ed0fa..b7cfefec54e 100644 --- a/reactos/base/applications/charmap/charmap.c +++ b/reactos/base/applications/charmap/charmap.c @@ -182,7 +182,7 @@ AddCharToSelection(HWND hText, } -static BOOL CALLBACK +static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT Message, WPARAM wParam, @@ -351,7 +351,7 @@ wWinMain(HINSTANCE hInst, Ret = DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_CHARMAP), NULL, - (DLGPROC)DlgProc) >= 0; + DlgProc) >= 0; UnregisterMapClasses(hInstance); } diff --git a/reactos/base/applications/dxdiag/display.c b/reactos/base/applications/dxdiag/display.c index 8b4c02bb7ba..6542034af6d 100644 --- a/reactos/base/applications/dxdiag/display.c +++ b/reactos/base/applications/dxdiag/display.c @@ -338,7 +338,7 @@ void InitializeDisplayAdapters(PDXDIAG_CONTEXT pContext) break; pContext->hDisplayWnd = hDlgs; - hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG), pContext->hMainDialog, (DLGPROC)DisplayPageWndProc, (LPARAM)pContext); + hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG), pContext->hMainDialog, DisplayPageWndProc, (LPARAM)pContext); if (!hwndDlg) break; diff --git a/reactos/base/applications/dxdiag/dxdiag.c b/reactos/base/applications/dxdiag/dxdiag.c index 787650907f1..3985fae208d 100644 --- a/reactos/base/applications/dxdiag/dxdiag.c +++ b/reactos/base/applications/dxdiag/dxdiag.c @@ -119,11 +119,11 @@ InitializeTabCtrl(HWND hwndDlg, PDXDIAG_CONTEXT pContext) pContext->hTabCtrl = hTabCtrlWnd; /* create the dialogs */ - pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hTabCtrlWnd, (DLGPROC)SystemPageWndProc, (LPARAM)pContext); - pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hTabCtrlWnd, (DLGPROC)MusicPageWndProc, (LPARAM)pContext); - pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hTabCtrlWnd, (DLGPROC)InputPageWndProc, (LPARAM)pContext); - pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hTabCtrlWnd, (DLGPROC)NetworkPageWndProc, (LPARAM)pContext); - pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, (DLGPROC)HelpPageWndProc, (LPARAM)pContext); + pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hTabCtrlWnd, SystemPageWndProc, (LPARAM)pContext); + pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hTabCtrlWnd, MusicPageWndProc, (LPARAM)pContext); + pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hTabCtrlWnd, InputPageWndProc, (LPARAM)pContext); + pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hTabCtrlWnd, NetworkPageWndProc, (LPARAM)pContext); + pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, HelpPageWndProc, (LPARAM)pContext); /* insert tab ctrl items */ @@ -238,7 +238,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, hInst = hInstance; - DialogBox(hInst, MAKEINTRESOURCE(IDD_MAIN_DIALOG), NULL, (DLGPROC) DxDiagWndProc); + DialogBox(hInst, MAKEINTRESOURCE(IDD_MAIN_DIALOG), NULL, DxDiagWndProc); return 0; } diff --git a/reactos/base/applications/dxdiag/sound.c b/reactos/base/applications/dxdiag/sound.c index 0b8c2a6e619..47c66f439bd 100644 --- a/reactos/base/applications/dxdiag/sound.c +++ b/reactos/base/applications/dxdiag/sound.c @@ -209,7 +209,7 @@ BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR l return FALSE; pContext->hSoundWnd = hDlgs; - hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG), pContext->hMainDialog, (DLGPROC)SoundPageWndProc, (LPARAM)pContext); + hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG), pContext->hMainDialog, SoundPageWndProc, (LPARAM)pContext); if (!hwndDlg) return FALSE; diff --git a/reactos/base/applications/msconfig/msconfig.c b/reactos/base/applications/msconfig/msconfig.c index 117bf74efbc..b5a5e525335 100644 --- a/reactos/base/applications/msconfig/msconfig.c +++ b/reactos/base/applications/msconfig/msconfig.c @@ -21,12 +21,12 @@ BOOL OnCreate(HWND hWnd) TCITEM item; hTabWnd = GetDlgItem(hWnd, IDC_TAB); - hGeneralPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_GENERAL_PAGE), hWnd, (DLGPROC) GeneralPageWndProc); - hSystemPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SYSTEM_PAGE), hWnd, (DLGPROC) SystemPageWndProc); - hFreeLdrPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FREELDR_PAGE), hWnd, (DLGPROC) FreeLdrPageWndProc); - hServicesPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SERVICES_PAGE), hWnd, (DLGPROC) ServicesPageWndProc); - hStartupPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_STARTUP_PAGE), hWnd, (DLGPROC) StartupPageWndProc); - hToolsPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TOOLS_PAGE), hWnd, (DLGPROC) ToolsPageWndProc); + hGeneralPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_GENERAL_PAGE), hWnd, GeneralPageWndProc); + hSystemPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SYSTEM_PAGE), hWnd, SystemPageWndProc); + hFreeLdrPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_FREELDR_PAGE), hWnd, FreeLdrPageWndProc); + hServicesPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SERVICES_PAGE), hWnd, ServicesPageWndProc); + hStartupPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_STARTUP_PAGE), hWnd, StartupPageWndProc); + hToolsPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TOOLS_PAGE), hWnd, ToolsPageWndProc); LoadString(hInst, IDS_MSCONFIG, szTemp, 256); SetWindowText(hWnd, szTemp); @@ -222,7 +222,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, hInst = hInstance; - DialogBox(hInst, (LPCTSTR)IDD_MSCONFIG_DIALOG, NULL, (DLGPROC) MsConfigWndProc); + DialogBox(hInst, (LPCTSTR)IDD_MSCONFIG_DIALOG, NULL, MsConfigWndProc); return 0; } diff --git a/reactos/base/applications/mscutils/devmgmt/mainwnd.c b/reactos/base/applications/mscutils/devmgmt/mainwnd.c index 1d9b45df031..68ad01afb86 100644 --- a/reactos/base/applications/mscutils/devmgmt/mainwnd.c +++ b/reactos/base/applications/mscutils/devmgmt/mainwnd.c @@ -464,7 +464,7 @@ MainWndCommand(PMAIN_WND_INFO Info, DialogBox(hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), Info->hMainWnd, - (DLGPROC)AboutDialogProc); + AboutDialogProc); SetFocus(Info->hTreeView); } diff --git a/reactos/base/applications/mscutils/servman/create.c b/reactos/base/applications/mscutils/servman/create.c index 4bc304672e3..5405fa54335 100644 --- a/reactos/base/applications/mscutils/servman/create.c +++ b/reactos/base/applications/mscutils/servman/create.c @@ -302,7 +302,7 @@ CreateDialogProc(HWND hDlg, hHelp = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DLG_HELP_OPTIONS), hDlg, - (DLGPROC)CreateHelpDialogProc); + CreateHelpDialogProc); if(hHelp != NULL) { bHelpOpen = TRUE; diff --git a/reactos/base/applications/mscutils/servman/mainwnd.c b/reactos/base/applications/mscutils/servman/mainwnd.c index a00fca6c8a7..6435b2b3708 100644 --- a/reactos/base/applications/mscutils/servman/mainwnd.c +++ b/reactos/base/applications/mscutils/servman/mainwnd.c @@ -432,7 +432,7 @@ MainWndCommand(PMAIN_WND_INFO Info, ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DLG_CREATE), Info->hMainWnd, - (DLGPROC)CreateDialogProc, + CreateDialogProc, (LPARAM)Info); if (ret == IDOK) RefreshServiceList(Info); @@ -448,7 +448,7 @@ MainWndCommand(PMAIN_WND_INFO Info, DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DLG_DELETE), Info->hMainWnd, - (DLGPROC)DeleteDialogProc, + DeleteDialogProc, (LPARAM)Info); } else @@ -569,7 +569,7 @@ MainWndCommand(PMAIN_WND_INFO Info, DialogBox(hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), Info->hMainWnd, - (DLGPROC)AboutDialogProc); + AboutDialogProc); SetFocus(Info->hListView); break; diff --git a/reactos/base/applications/mscutils/servman/progress.c b/reactos/base/applications/mscutils/servman/progress.c index 6ecd86c9898..78bf91fa517 100644 --- a/reactos/base/applications/mscutils/servman/progress.c +++ b/reactos/base/applications/mscutils/servman/progress.c @@ -113,7 +113,7 @@ CreateProgressDialog(HWND hParent, hProgDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DLG_PROGRESS), hParent, - (DLGPROC)ProgressDialogProc); + ProgressDialogProc); if (hProgDlg != NULL) { /* write the info to the progress dialog */ diff --git a/reactos/base/applications/mstsc/connectdialog.c b/reactos/base/applications/mstsc/connectdialog.c index e25da38900a..792f21ac16a 100644 --- a/reactos/base/applications/mstsc/connectdialog.c +++ b/reactos/base/applications/mstsc/connectdialog.c @@ -986,7 +986,7 @@ OnMainCreate(HWND hwnd, if (CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_GENERAL), pInfo->hTab, - (DLGPROC)GeneralDlgProc, + GeneralDlgProc, (LPARAM)pInfo)) { WCHAR str[256]; @@ -1001,7 +1001,7 @@ OnMainCreate(HWND hwnd, if (CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY), pInfo->hTab, - (DLGPROC)DisplayDlgProc, + DisplayDlgProc, (LPARAM)pInfo)) { WCHAR str[256]; @@ -1233,6 +1233,6 @@ OpenRDPConnectDialog(HINSTANCE hInstance, return (DialogBoxParamW(hInst, MAKEINTRESOURCEW(IDD_CONNECTDIALOG), NULL, - (DLGPROC)DlgProc, + DlgProc, (LPARAM)pRdpSettings) == IDOK); } diff --git a/reactos/base/applications/notepad/dialog.c b/reactos/base/applications/notepad/dialog.c index 4dea2329882..f5586021186 100644 --- a/reactos/base/applications/notepad/dialog.c +++ b/reactos/base/applications/notepad/dialog.c @@ -851,7 +851,7 @@ VOID DIALOG_GoTo(VOID) } nLine = DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(DIALOG_GOTO), - Globals.hMainWnd, (DLGPROC)DIALOG_GoTo_DialogProc, nLine); + Globals.hMainWnd, DIALOG_GoTo_DialogProc, nLine); if (nLine >= 1) { @@ -981,7 +981,7 @@ VOID DIALOG_HelpAboutWine(VOID) VOID DIALOG_FilePageSetup(void) { DialogBox(Globals.hInstance, MAKEINTRESOURCE(DIALOG_PAGESETUP), - Globals.hMainWnd, (DLGPROC)DIALOG_PAGESETUP_DlgProc); + Globals.hMainWnd, DIALOG_PAGESETUP_DlgProc); } diff --git a/reactos/base/applications/notepad/main.c b/reactos/base/applications/notepad/main.c index 403fae3fece..8b8b901641d 100644 --- a/reactos/base/applications/notepad/main.c +++ b/reactos/base/applications/notepad/main.c @@ -91,7 +91,7 @@ static int NOTEPAD_MenuCommand(WPARAM wParam) case CMD_ABOUT: DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUTBOX), Globals.hMainWnd, - (DLGPROC) AboutDialogProc); + AboutDialogProc); break; case CMD_ABOUT_WINE: DIALOG_HelpAboutWine(); break; diff --git a/reactos/base/applications/winhlp32/lex.yy.c b/reactos/base/applications/winhlp32/lex.yy.c index 5747c715bd5..76267739db1 100644 --- a/reactos/base/applications/winhlp32/lex.yy.c +++ b/reactos/base/applications/winhlp32/lex.yy.c @@ -1662,7 +1662,7 @@ static LRESULT CALLBACK MACRO_TestDialogProc(HWND hDlg, UINT msg, WPARAM wParam, void macro_test(void) { WNDPROC lpfnDlg = MakeProcInstance(MACRO_TestDialogProc, Globals.hInstance); - DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, (DLGPROC)lpfnDlg); + DialogBox(Globals.hInstance, STRING_DIALOG_TEST, Globals.active_win->hMainWnd, lpfnDlg); FreeProcInstance(lpfnDlg); macro = szTestMacro; } diff --git a/reactos/include/psdk/winuser.h b/reactos/include/psdk/winuser.h index 13f41756ad0..435f7f9ffcb 100644 --- a/reactos/include/psdk/winuser.h +++ b/reactos/include/psdk/winuser.h @@ -2691,7 +2691,7 @@ extern "C" { #define STATE_SYSTEM_VALID 0x1fffffff #ifndef RC_INVOKED -typedef BOOL(CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM); +typedef INT_PTR(CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM); typedef VOID(CALLBACK *TIMERPROC)(HWND,UINT,UINT,DWORD); typedef BOOL(CALLBACK *GRAYSTRINGPROC)(HDC,LPARAM,int); typedef LRESULT(CALLBACK *HOOKPROC)(int,WPARAM,LPARAM); From 5502f51b0f6f873f0f129200c12e1bdc59a7b30f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 16:49:23 +0000 Subject: [PATCH 037/388] Fix Warnings svn path=/branches/ros-amd64-bringup/; revision=34787 --- .../games/solitaire/cardlib/cardrgnmouse.cpp | 2 +- .../base/applications/games/solitaire/solitaire.cpp | 4 ++-- reactos/base/applications/msconfig/startuppage.c | 2 +- reactos/base/applications/mscutils/devmgmt/about.c | 2 +- reactos/base/applications/mscutils/devmgmt/precomp.h | 2 +- reactos/base/applications/mscutils/servman/about.c | 2 +- reactos/base/applications/mscutils/servman/create.c | 4 ++-- reactos/base/applications/mscutils/servman/delete.c | 2 +- reactos/base/applications/mscutils/servman/precomp.h | 8 ++++---- reactos/base/applications/mscutils/servman/progress.c | 2 +- reactos/base/applications/mstsc/connectdialog.c | 2 +- reactos/base/applications/network/ping/ping.rbuild | 2 +- reactos/base/applications/winhlp32/macro.c | 2 +- reactos/base/applications/wordpad/wordpad.c | 11 ++++++----- 14 files changed, 24 insertions(+), 23 deletions(-) diff --git a/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp b/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp index 52c269f2363..c8cdf4a3aff 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp @@ -626,7 +626,7 @@ void CardRegion::ZoomCard(HDC hdc, int xpos, int ypos, CardRegion *pDestStack) MoveDragCardTo(hdc, ix, iy); - if(attarget || ix == idestx && iy == idesty) + if(attarget || (ix == idestx && iy == idesty)) break; oldx = (int)x; diff --git a/reactos/base/applications/games/solitaire/solitaire.cpp b/reactos/base/applications/games/solitaire/solitaire.cpp index a571b2c7888..1a9302a2357 100644 --- a/reactos/base/applications/games/solitaire/solitaire.cpp +++ b/reactos/base/applications/games/solitaire/solitaire.cpp @@ -198,7 +198,7 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm } -BOOL CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { @@ -356,7 +356,7 @@ CardImageWndProc(HWND hwnd, } -BOOL CALLBACK CardBackDlgProc(HWND hDlg, +INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) diff --git a/reactos/base/applications/msconfig/startuppage.c b/reactos/base/applications/msconfig/startuppage.c index 30ac5ca2ada..059594db986 100644 --- a/reactos/base/applications/msconfig/startuppage.c +++ b/reactos/base/applications/msconfig/startuppage.c @@ -183,7 +183,7 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ) SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); } - switch (((LONG_PTR)HKEY_LOCAL_MACHINE) & 0xff) + switch (PtrToLong(hRootKey)) { case (((LONG_PTR)HKEY_LOCAL_MACHINE) & 0xff): _tcscpy(Path, _T("HKLM\\\0")); diff --git a/reactos/base/applications/mscutils/devmgmt/about.c b/reactos/base/applications/mscutils/devmgmt/about.c index ed20b2157cb..b68c96f6205 100644 --- a/reactos/base/applications/mscutils/devmgmt/about.c +++ b/reactos/base/applications/mscutils/devmgmt/about.c @@ -9,7 +9,7 @@ #include "precomp.h" -BOOL CALLBACK +INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { HWND hLicenseEditWnd; diff --git a/reactos/base/applications/mscutils/devmgmt/precomp.h b/reactos/base/applications/mscutils/devmgmt/precomp.h index 81a59b89762..d9bdd425f85 100644 --- a/reactos/base/applications/mscutils/devmgmt/precomp.h +++ b/reactos/base/applications/mscutils/devmgmt/precomp.h @@ -34,7 +34,7 @@ typedef struct _MAIN_WND_INFO } MAIN_WND_INFO, *PMAIN_WND_INFO; -BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); /* devmgmt.c */ diff --git a/reactos/base/applications/mscutils/servman/about.c b/reactos/base/applications/mscutils/servman/about.c index 18a2abfcc5a..c45e456fd1b 100644 --- a/reactos/base/applications/mscutils/servman/about.c +++ b/reactos/base/applications/mscutils/servman/about.c @@ -9,7 +9,7 @@ #include "precomp.h" -BOOL CALLBACK +INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) diff --git a/reactos/base/applications/mscutils/servman/create.c b/reactos/base/applications/mscutils/servman/create.c index 5405fa54335..16c50141d9e 100644 --- a/reactos/base/applications/mscutils/servman/create.c +++ b/reactos/base/applications/mscutils/servman/create.c @@ -164,7 +164,7 @@ FreeMemory(PCREATE_DATA Data) } -BOOL CALLBACK +INT_PTR CALLBACK CreateHelpDialogProc(HWND hDlg, UINT message, WPARAM wParam, @@ -221,7 +221,7 @@ CreateHelpDialogProc(HWND hDlg, } -BOOL CALLBACK +INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, diff --git a/reactos/base/applications/mscutils/servman/delete.c b/reactos/base/applications/mscutils/servman/delete.c index 9faa36714cf..8f6e27c9877 100644 --- a/reactos/base/applications/mscutils/servman/delete.c +++ b/reactos/base/applications/mscutils/servman/delete.c @@ -56,7 +56,7 @@ DoDeleteService(PMAIN_WND_INFO Info, } -BOOL CALLBACK +INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, diff --git a/reactos/base/applications/mscutils/servman/precomp.h b/reactos/base/applications/mscutils/servman/precomp.h index b6fd9835aa4..796bb321167 100644 --- a/reactos/base/applications/mscutils/servman/precomp.h +++ b/reactos/base/applications/mscutils/servman/precomp.h @@ -43,10 +43,10 @@ typedef struct _MAIN_WND_INFO } MAIN_WND_INFO, *PMAIN_WND_INFO; -BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam); /* servman.c */ diff --git a/reactos/base/applications/mscutils/servman/progress.c b/reactos/base/applications/mscutils/servman/progress.c index 78bf91fa517..e6c01feefc2 100644 --- a/reactos/base/applications/mscutils/servman/progress.c +++ b/reactos/base/applications/mscutils/servman/progress.c @@ -56,7 +56,7 @@ IncrementProgressBar(HWND hProgDlg) } } -BOOL CALLBACK +INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, diff --git a/reactos/base/applications/mstsc/connectdialog.c b/reactos/base/applications/mstsc/connectdialog.c index 792f21ac16a..870caa1da7a 100644 --- a/reactos/base/applications/mstsc/connectdialog.c +++ b/reactos/base/applications/mstsc/connectdialog.c @@ -1021,7 +1021,7 @@ OnMainCreate(HWND hwnd, } -static BOOL CALLBACK +static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT Message, WPARAM wParam, diff --git a/reactos/base/applications/network/ping/ping.rbuild b/reactos/base/applications/network/ping/ping.rbuild index fdbe73e37fc..e69d7906e1c 100644 --- a/reactos/base/applications/network/ping/ping.rbuild +++ b/reactos/base/applications/network/ping/ping.rbuild @@ -1,6 +1,6 @@ - + . 0x600 diff --git a/reactos/base/applications/winhlp32/macro.c b/reactos/base/applications/winhlp32/macro.c index d8607c58d64..c055c71649e 100644 --- a/reactos/base/applications/winhlp32/macro.c +++ b/reactos/base/applications/winhlp32/macro.c @@ -842,7 +842,7 @@ void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args) dll->class = dll->handler ? (dll->handler)(DW_WHATMSG, 0, 0) : DC_NOMSG; WINE_TRACE("Got class %x for DLL %s\n", dll->class, dll_name); if (dll->class & DC_INITTERM) dll->handler(DW_INIT, 0, 0); - if (dll->class & DC_CALLBACKS) dll->handler(DW_CALLBACKS, (DWORD)Callbacks, 0); + if (dll->class & DC_CALLBACKS) dll->handler(DW_CALLBACKS, (DWORD_PTR)Callbacks, 0); } else WINE_WARN("OOM\n"); } diff --git a/reactos/base/applications/wordpad/wordpad.c b/reactos/base/applications/wordpad/wordpad.c index 80638c81b09..3259c2bf50d 100644 --- a/reactos/base/applications/wordpad/wordpad.c +++ b/reactos/base/applications/wordpad/wordpad.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -583,7 +584,7 @@ static void populate_font_list(HWND hListWnd) fontinfo.lfPitchAndFamily = 0; EnumFontFamiliesExW(hdc, &fontinfo, enum_font_proc, - (LPARAM)hListWnd, 0); + (LPARAM)(UINT_PTR)hListWnd, 0); ZeroMemory(&fmt, sizeof(fmt)); fmt.cbSize = sizeof(fmt); @@ -1115,7 +1116,7 @@ static void HandleCommandLine(LPWSTR cmdline) } if (opt_print) - MessageBox(hMainWnd, "Printing not implemented", "WordPad", MB_OK); + MessageBox(hMainWnd, _T("Printing not implemented"), _T("WordPad"), MB_OK); } static LRESULT handle_findmsg(LPFINDREPLACEW pFr) @@ -1279,7 +1280,7 @@ static BOOL get_comboexlist_selection(HWND hComboEx, LPWSTR wszBuffer, UINT buff ZeroMemory(&cbItem, sizeof(cbItem)); cbItem.mask = CBEIF_TEXT; cbItem.iItem = idx; - cbItem.pszText = szBuffer; + cbItem.pszText = (ULONG_PTR)szBuffer; cbItem.cchTextMax = bufferLength-1; result = SendMessage(hComboEx, CBEM_GETITEM, 0, (LPARAM)&cbItem); if (!result) @@ -1795,7 +1796,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam) if (!hEditorWnd) { - fprintf(stderr, "Error code %u\n", GetLastError()); + fprintf(stderr, _T("Error code %d\n"), GetLastError()); return -1; } assert(hEditorWnd); @@ -1987,7 +1988,7 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam) mi.cbSize = sizeof(MENUITEMINFOW); mi.fMask = MIIM_DATA; if(GetMenuItemInfoW(hMenu, LOWORD(wParam), FALSE, &mi)) - DoOpenFile((LPWSTR)mi.dwItemData); + DoOpenFile((LPWSTR)(ULONG_PTR)mi.dwItemData); } break; From f8af30533163689d1a5abf0d89f3ed25158c96e1 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 25 Jul 2008 23:41:31 +0000 Subject: [PATCH 038/388] Fix dozens of 64bit warnings. Create amd64 def file. svn path=/branches/ros-amd64-bringup/; revision=34795 --- reactos/dll/ntdll/csr/capture.c | 4 +- reactos/dll/ntdll/dbg/dbgui.c | 4 +- reactos/dll/ntdll/def/ntdll_amd64.def | 1097 +++++++++++++++++++++++++ reactos/dll/ntdll/def/ntdll_arm.def | 1 + reactos/dll/ntdll/ldr/utils.c | 16 +- 5 files changed, 1110 insertions(+), 12 deletions(-) create mode 100644 reactos/dll/ntdll/def/ntdll_amd64.def diff --git a/reactos/dll/ntdll/csr/capture.c b/reactos/dll/ntdll/csr/capture.c index fd48ed49e76..414331c9209 100644 --- a/reactos/dll/ntdll/csr/capture.c +++ b/reactos/dll/ntdll/csr/capture.c @@ -42,7 +42,7 @@ CsrProbeForRead(IN PVOID Address, /* Do the probe */ Pointer = (PUCHAR)Address; Data = *Pointer; - Pointer = (PUCHAR)((ULONG)Address + Length -1); + Pointer = (PUCHAR)((ULONG_PTR)Address + Length -1); Data = *Pointer; } @@ -72,7 +72,7 @@ CsrProbeForWrite(IN PVOID Address, Pointer = (PUCHAR)Address; Data = *Pointer; *Pointer = Data; - Pointer = (PUCHAR)((ULONG)Address + Length -1); + Pointer = (PUCHAR)((ULONG_PTR)Address + Length -1); Data = *Pointer; *Pointer = Data; } diff --git a/reactos/dll/ntdll/dbg/dbgui.c b/reactos/dll/ntdll/dbg/dbgui.c index 376b09d35d6..8df8acccae7 100644 --- a/reactos/dll/ntdll/dbg/dbgui.c +++ b/reactos/dll/ntdll/dbg/dbgui.c @@ -65,9 +65,9 @@ DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, HANDLE ThreadHandle; /* Write common data */ - DebugEvent->dwProcessId = (DWORD)WaitStateChange-> + DebugEvent->dwProcessId = (ULONG_PTR)WaitStateChange-> AppClientId.UniqueProcess; - DebugEvent->dwThreadId = (DWORD)WaitStateChange->AppClientId.UniqueThread; + DebugEvent->dwThreadId = (ULONG_PTR)WaitStateChange->AppClientId.UniqueThread; /* Check what kind of even this is */ switch (WaitStateChange->NewState) diff --git a/reactos/dll/ntdll/def/ntdll_amd64.def b/reactos/dll/ntdll/def/ntdll_amd64.def new file mode 100644 index 00000000000..3b1d2fbd903 --- /dev/null +++ b/reactos/dll/ntdll/def/ntdll_amd64.def @@ -0,0 +1,1097 @@ +; $Id: ntdll.def 34404 2008-07-10 09:46:25Z fireball $ +; +; ReactOS Operating System +; +LIBRARY ntdll.dll + +EXPORTS +CsrAllocateCaptureBuffer +CsrAllocateMessagePointer +CsrCaptureMessageBuffer +CsrCaptureMessageMultiUnicodeStringsInPlace +CsrCaptureMessageString +CsrCaptureTimeout +CsrClientCallServer +CsrClientConnectToServer +CsrFreeCaptureBuffer +CsrGetProcessId +CsrIdentifyAlertableThread +CsrNewThread +CsrProbeForRead +CsrProbeForWrite +CsrSetPriorityClass +DbgBreakPoint +DbgPrint +DbgPrintEx +DbgPrompt +DbgUiConvertStateChangeStructure +DbgUiDebugActiveProcess +DbgUiConnectToDbg +DbgUiContinue +DbgUiGetThreadDebugObject +DbgUiIssueRemoteBreakin +DbgUiRemoteBreakin +DbgUiSetThreadDebugObject +DbgUiStopDebugging +DbgUiWaitStateChange +DbgUserBreakPoint +KiRaiseUserExceptionDispatcher +KiUserApcDispatcher +KiUserCallbackDispatcher +KiUserExceptionDispatcher +KiIntSystemCall +KiFastSystemCallRet +KiFastSystemCall +LdrAccessResource +LdrAddRefDll +LdrDisableThreadCalloutsForDll +LdrEnumResources +LdrFindEntryForAddress +LdrFindResourceDirectory_U +LdrFindResource_U +LdrGetDllHandle +LdrGetProcedureAddress +LdrInitializeThunk +LdrLoadDll +LdrProcessRelocationBlock +LdrQueryImageFileExecutionOptions +LdrQueryProcessModuleInformation +LdrShutdownProcess +LdrShutdownThread +LdrUnloadDll +LdrVerifyImageMatchesChecksum +NlsAnsiCodePage DATA +NlsMbCodePageTag DATA +NlsMbOemCodePageTag DATA +NtAcceptConnectPort +NtAccessCheck +NtAccessCheckAndAuditAlarm +NtAddAtom +NtAddBootEntry +NtAdjustGroupsToken +NtAdjustPrivilegesToken +NtAlertResumeThread +NtAlertThread +NtAllocateLocallyUniqueId +NtAllocateUuids +NtAllocateVirtualMemory +NtAssignProcessToJobObject +NtCallbackReturn +NtCancelIoFile +NtCancelTimer +NtClearEvent +NtClose +NtCloseObjectAuditAlarm +NtCompareTokens +NtCompleteConnectPort +NtConnectPort +NtContinue +NtCreateDebugObject +NtCreateDirectoryObject +NtCreateEvent +NtCreateEventPair +NtCreateFile +NtCreateIoCompletion +NtCreateJobObject +NtCreateKey +NtCreateMailslotFile +NtCreateMutant +NtCreateNamedPipeFile +NtCreatePagingFile +NtCreatePort +NtCreateProcess +NtCreateProfile +NtCreateSection +NtCreateSemaphore +NtCreateSymbolicLinkObject +NtCreateThread +NtCreateTimer +NtCreateToken +NtCreateWaitablePort +NtCurrentTeb=_NtCurrentTeb +NtDebugContinue +NtDelayExecution +NtDeleteAtom +NtDeleteFile +NtDeleteKey +NtDeleteObjectAuditAlarm +NtDeleteValueKey +NtDeviceIoControlFile +NtDisplayString +NtDuplicateObject +NtDuplicateToken +NtEnumerateKey +NtEnumerateValueKey +NtExtendSection +NtFindAtom +NtFlushBuffersFile +NtFlushInstructionCache +NtFlushKey +NtFlushVirtualMemory +NtFlushWriteBuffer +NtFreeVirtualMemory +NtFsControlFile +NtGetContextThread +NtGetPlugPlayEvent +NtImpersonateAnonymousToken +NtImpersonateClientOfPort +NtImpersonateThread +NtInitializeRegistry +NtIsProcessInJob +NtListenPort +NtLoadDriver +NtLoadKey +NtLoadKey2 +NtLockFile +NtLockVirtualMemory +NtMakeTemporaryObject +NtMapViewOfSection +NtNotifyChangeDirectoryFile +NtNotifyChangeKey +NtOpenDirectoryObject +NtOpenEvent +NtOpenEventPair +NtOpenFile +NtOpenIoCompletion +NtOpenJobObject +NtOpenKey +NtOpenMutant +NtOpenObjectAuditAlarm +NtOpenProcess +NtOpenProcessToken +NtOpenSection +NtOpenSemaphore +NtOpenSymbolicLinkObject +NtOpenThread +NtOpenThreadToken +NtOpenTimer +NtPlugPlayControl +NtPowerInformation +NtPrivilegeCheck +NtPrivilegedServiceAuditAlarm +NtPrivilegeObjectAuditAlarm +NtProtectVirtualMemory +NtPulseEvent +NtQueryAttributesFile +NtQueryDebugFilterState +NtQueryDefaultLocale +NtQueryDefaultUILanguage +NtQueryDirectoryFile +NtQueryDirectoryObject +NtQueryEaFile +NtQueryEvent +NtQueryFullAttributesFile +NtQueryInformationAtom +NtQueryInformationFile +NtQueryInformationJobObject +NtQueryInformationPort +NtQueryInformationProcess +NtQueryInformationThread +NtQueryInformationToken +NtQueryInstallUILanguage +NtQueryIntervalProfile +NtQueryIoCompletion +NtQueryKey +NtQueryMultipleValueKey +NtQueryMutant +NtQueryObject +NtQueryPerformanceCounter +NtQuerySection +NtQuerySecurityObject +NtQuerySemaphore +NtQuerySymbolicLinkObject +NtQuerySystemEnvironmentValue +NtQuerySystemInformation +NtQuerySystemTime +NtQueryTimer +NtQueryTimerResolution +NtQueryValueKey +NtQueryVirtualMemory +NtQueryVolumeInformationFile +NtQueueApcThread +NtRaiseException +NtRaiseHardError +NtReadFile +NtReadFileScatter +NtReadRequestData +NtReadVirtualMemory +NtRegisterThreadTerminatePort +NtReleaseMutant +NtReleaseSemaphore +NtRemoveIoCompletion +NtReplaceKey +NtReplyPort +NtReplyWaitReceivePort +NtReplyWaitReceivePortEx +NtReplyWaitReplyPort +NtRequestPort +NtRequestWaitReplyPort +NtResetEvent +NtRestoreKey +NtResumeProcess +NtResumeThread +NtSaveKey +NtSecureConnectPort +NtSetContextThread +NtSetDebugFilterState +NtSetDefaultHardErrorPort +NtSetDefaultLocale +NtSetDefaultUILanguage +NtSetEaFile +NtSetEvent +NtSetHighEventPair +NtSetHighWaitLowEventPair +NtSetInformationDebugObject +NtSetInformationFile +NtSetInformationJobObject +NtSetInformationKey +NtSetInformationObject +NtSetInformationProcess +NtSetInformationThread +NtSetInformationToken +NtSetIntervalProfile +NtSetIoCompletion +NtSetLdtEntries +NtSetLowEventPair +NtSetLowWaitHighEventPair +NtSetSecurityObject +NtSetSystemEnvironmentValue +NtSetSystemInformation +NtSetSystemPowerState +NtSetSystemTime +NtSetTimer +NtSetTimerResolution +NtSetUuidSeed +NtSetValueKey +NtSetVolumeInformationFile +NtShutdownSystem +NtSignalAndWaitForSingleObject +NtStartProfile +NtStopProfile +NtSuspendProcess +NtSuspendThread +NtSystemDebugControl +NtTerminateJobObject +NtTerminateProcess +NtTerminateThread +NtTestAlert +NtUnloadDriver +NtUnloadKey +NtUnlockFile +NtUnlockVirtualMemory +NtUnmapViewOfSection +NtVdmControl +NtWaitForDebugEvent +NtWaitForMultipleObjects +NtWaitForSingleObject +NtWaitHighEventPair +NtWaitLowEventPair +NtWriteFile +NtWriteFileGather +NtWriteRequestData +NtWriteVirtualMemory +NtYieldExecution +;PfxFindPrefix +;PfxInitialize +;PfxInsertPrefix +;PfxRemovePrefix +;PropertyLengthAsVariant +;RestoreEmContext +;RtlAbortRXact +RtlAbsoluteToSelfRelativeSD +RtlAcquirePebLock +RtlAcquireResourceExclusive +RtlAcquireResourceShared +RtlAcquireSRWLockExclusive +RtlAcquireSRWLockShared +RtlAddAccessAllowedAce +RtlAddAccessAllowedAceEx +RtlAddAccessAllowedObjectAce +RtlAddAccessDeniedAce +RtlAddAccessDeniedAceEx +RtlAddAccessDeniedObjectAce +RtlAddAce +;RtlAddActionToRXact +RtlAddAtomToAtomTable +;RtlAddAttributeActionToRXact +RtlAddAuditAccessAce +RtlAddAuditAccessAceEx +RtlAddAuditAccessObjectAce +;RtlAddCompoundAce +RtlAddMandatoryAce +RtlAddRange +RtlAddVectoredExceptionHandler +RtlAdjustPrivilege +RtlAllocateAndInitializeSid +RtlAllocateHandle +RtlAllocateHeap +RtlAnsiCharToUnicodeChar +RtlAnsiStringToUnicodeSize=RtlxAnsiStringToUnicodeSize +RtlAnsiStringToUnicodeString +RtlAppendAsciizToString +RtlAppendStringToString +RtlAppendUnicodeStringToString +RtlAppendUnicodeToString +;RtlApplyRXact +;RtlApplyRXactNoFlush +RtlAreAllAccessesGranted +RtlAreAnyAccessesGranted +RtlAreBitsClear +RtlAreBitsSet +RtlAssert +RtlCaptureStackBackTrace +RtlCharToInteger +RtlCheckRegistryKey +RtlClearAllBits +RtlClearBits +RtlCompactHeap +RtlCompareMemory +RtlCompareMemoryUlong +RtlCompareString +RtlCompareUnicodeString +RtlCompressBuffer +RtlComputeCrc32 +;RtlConsoleMultiByteToUnicodeN +RtlConvertExclusiveToShared +RtlConvertLongToLargeInteger +RtlConvertSharedToExclusive +RtlConvertSidToUnicodeString +;RtlConvertUiListToApiList +RtlConvertUlongToLargeInteger +RtlCopyLuid +RtlCopyLuidAndAttributesArray +RtlCopyRangeList +RtlCopySecurityDescriptor +RtlCopySid +RtlCopySidAndAttributesArray +RtlCopyString +RtlCopyUnicodeString +RtlCreateAcl +;RtlCreateAndSetSD +RtlCreateAtomTable +RtlCreateEnvironment +RtlCreateHeap +RtlCreateProcessParameters +RtlCreateQueryDebugBuffer +RtlCreateRegistryKey +RtlCreateSecurityDescriptor +RtlCreateTagHeap +RtlCreateTimer +RtlCreateTimerQueue +RtlCreateUnicodeString +RtlCreateUnicodeStringFromAsciiz +RtlCreateUserProcess +;RtlCreateUserSecurityObject +RtlCreateUserThread +RtlCustomCPToUnicodeN +RtlCutoverTimeToSystemTime +RtlDeNormalizeProcessParams +RtlDecodePointer=RtlEncodePointer +RtlDecompressBuffer +RtlDecompressFragment +RtlDelete +RtlDeleteAce +RtlDeleteAtomFromAtomTable +RtlDeleteCriticalSection +RtlDeleteElementGenericTable +RtlDeleteElementGenericTableAvl +RtlDeleteNoSplay +RtlDeleteOwnersRanges +RtlDeleteRange +RtlDeleteRegistryValue +RtlDeleteResource +RtlDeleteSecurityObject +RtlDeleteTimer +RtlDeleteTimerQueue +RtlDeleteTimerQueueEx +RtlDeregisterWait +RtlDeregisterWaitEx +RtlDestroyAtomTable +RtlDestroyEnvironment +RtlDestroyHandleTable +RtlDestroyHeap +RtlDestroyProcessParameters +RtlDestroyQueryDebugBuffer +RtlDetermineDosPathNameType_U +RtlDllShutdownInProgress +RtlDoesFileExists_U +RtlDosPathNameToNtPathName_U +RtlDosPathNameToRelativeNtPathName_U +RtlDosSearchPath_U +RtlDowncaseUnicodeChar +RtlDowncaseUnicodeString +RtlDumpResource +RtlDuplicateUnicodeString +RtlEmptyAtomTable +RtlEncodePointer +RtlEnlargedIntegerMultiply +RtlEnlargedUnsignedDivide +RtlEnlargedUnsignedMultiply +RtlEnterCriticalSection +RtlEnumProcessHeaps +RtlEnumerateGenericTable +RtlEnumerateGenericTableAvl +RtlEnumerateGenericTableLikeADirectory +RtlEnumerateGenericTableWithoutSplaying +RtlEnumerateGenericTableWithoutSplayingAvl +RtlEqualComputerName +RtlEqualDomainName +RtlEqualLuid +RtlEqualPrefixSid +RtlEqualSid +RtlEqualString +RtlEqualUnicodeString +RtlEraseUnicodeString +RtlExitUserThread +RtlExpandEnvironmentStrings_U +RtlExtendHeap +RtlExtendedIntegerMultiply +RtlExtendedLargeIntegerDivide +RtlExtendedMagicDivide +RtlFillMemory +RtlFillMemoryUlong +RtlFindClearBits +RtlFindClearBitsAndSet +RtlFindClearRuns +RtlFindLastBackwardRunClear +RtlFindLeastSignificantBit +RtlFindLongestRunClear +RtlFindLongestRunSet +RtlFindMessage +RtlFindMostSignificantBit +RtlFindNextForwardRunClear +RtlFindRange +RtlFindSetBits +RtlFindSetBitsAndClear +RtlFirstFreeAce +RtlFormatCurrentUserKeyPath +RtlFormatMessage +RtlFreeAnsiString +RtlFreeHandle +RtlFreeHeap +RtlFreeOemString +RtlFreeRangeList +RtlFreeSid +RtlFreeUnicodeString +RtlFreeUserThreadStack +RtlGUIDFromString +RtlGeneratedotName +RtlGetAce +;RtlGetCallersAddress +RtlGetCompressionWorkSpaceSize +RtlGetControlSecurityDescriptor +RtlGetCurrentDirectory_U +RtlGetDaclSecurityDescriptor +RtlGetElementGenericTable +RtlGetElementGenericTableAvl +RtlGetFirstRange +RtlGetFullPathName_U +RtlGetGroupSecurityDescriptor +RtlGetLastNtStatus +RtlGetLastWinError +RtlGetLongestNtPathLength +RtlGetNextRange +RtlGetNtGlobalFlags +RtlGetNtProductType +RtlGetNtVersionNumbers +RtlGetOwnerSecurityDescriptor +RtlGetProcessHeaps +RtlGetSaclSecurityDescriptor +RtlGetSecurityDescriptorRMControl +RtlGetSetBootStatusData +RtlGetUserInfoHeap +RtlGetVersion +RtlHashUnicodeString +RtlIdentifierAuthoritySid +RtlImageDirectoryEntryToData +RtlImageNtHeader +RtlImageRvaToSection +RtlImageRvaToVa +RtlImpersonateSelf +RtlInitAnsiString +RtlInitCodePageTable +RtlInitNlsTables +RtlInitString +RtlInitUnicodeString +RtlInitUnicodeStringEx +;RtlInitializeAtomPackage +RtlInitializeBitMap +RtlInitializeConditionVariable +RtlInitializeContext +RtlInitializeCriticalSection +RtlInitializeCriticalSectionEx +RtlInitializeCriticalSectionAndSpinCount +RtlInitializeGenericTable +RtlInitializeGenericTableAvl +RtlInitializeHandleTable +RtlInitializeRangeList +RtlInitializeResource +;RtlInitializeRXact +RtlInitializeSid +RtlInitializeSRWLock +RtlInsertElementGenericTable +RtlInsertElementGenericTableAvl +RtlInsertElementGenericTableFull +RtlInsertElementGenericTableFullAvl +RtlIntToUnicodeString +RtlIntegerToChar +RtlIntegerToUnicodeString +RtlInvertRangeList +RtlIpvAddressToStringA +RtlIpvAddressToStringExA +RtlIpvAddressToStringExW +RtlIpvAddressToStringW +RtlIpvStringToAddressA +RtlIpvStringToAddressExA +RtlIpvStringToAddressExW +RtlIpvStringToAddressW +RtlIpvAddressToStringA +RtlIpvAddressToStringExA +RtlIpvAddressToStringExW +RtlIpvAddressToStringW +RtlIpvStringToAddressA +RtlIpvStringToAddressExA +RtlIpvStringToAddressExW +RtlIpvStringToAddressW +RtlIsDosDeviceName_U +RtlIsGenericTableEmpty +RtlIsGenericTableEmptyAvl +RtlIsNameLegalDOS8Dot3 +RtlIsRangeAvailable +RtlIsTextUnicode +RtlIsValidHandle +RtlIsValidIndexHandle +RtlLargeIntegerAdd +RtlLargeIntegerArithmeticShift +RtlLargeIntegerDivide +RtlLargeIntegerNegate +RtlLargeIntegerShiftLeft +RtlLargeIntegerShiftRight +RtlLargeIntegerSubtract +RtlLargeIntegerToChar +RtlLeaveCriticalSection +RtlLengthRequiredSid +RtlLengthSecurityDescriptor +RtlLengthSid +RtlLocalTimeToSystemTime +RtlLockBootStatusData +RtlLockHeap +RtlLookupAtomInAtomTable +RtlLookupElementGenericTable +RtlLookupElementGenericTableAvl +RtlLookupElementGenericTableFull +RtlLookupElementGenericTableFullAvl +RtlMakeSelfRelativeSD +RtlMapGenericMask +RtlMergeRangeLists +RtlMoveMemory +RtlMultiByteToUnicodeN +RtlMultiByteToUnicodeSize +;RtlNewInstanceSecurityObject +;RtlNewSecurityGrantedAccess +RtlNewSecurityObject +RtlNormalizeProcessParams +RtlNtPathNameToDosPathName +RtlNtStatusToDosError +RtlNumberGenericTableElements +RtlNumberGenericTableElementsAvl +RtlNumberOfClearBits +RtlNumberOfSetBits +RtlOemStringToUnicodeSize=RtlxOemStringToUnicodeSize +RtlOemStringToUnicodeString +RtlOemToUnicodeN +RtlOpenCurrentUser +RtlPcToFileHeader +RtlPinAtomInAtomTable +RtlPrefixString +RtlPrefixUnicodeString +;RtlProtectHeap +RtlQueryAtomInAtomTable +RtlQueryEnvironmentVariable_U +RtlQueryInformationAcl +;RtlQueryProcessBackTraceInformation +RtlQueryProcessDebugInformation +;RtlQueryProcessHeapInformation +;RtlQueryProcessLockInformation +RtlQueryRegistryValues +RtlQuerySecurityObject +RtlQueryTagHeap +RtlQueryTimeZoneInformation +RtlQueueWorkItem +RtlRaiseException +RtlRaiseStatus +RtlRandom +RtlRandomEx=RtlRandom +RtlReAllocateHeap +RtlRealPredecessor +RtlRealSuccessor +RtlRegisterWait +RtlReleasePebLock +RtlReleaseRelativeName +RtlReleaseResource +RtlReleaseSRWLockExclusive +RtlReleaseSRWLockShared +;RtlRemoteCall +RtlRemoveVectoredExceptionHandler +RtlResetRtlTranslations +RtlRestoreLastWinError=RtlSetLastWinError +RtlRunDecodeUnicodeString +RtlRunEncodeUnicodeString +RtlSecondsSinceToTime +RtlSecondsSinceToTime +RtlSelfRelativeToAbsoluteSD +RtlSelfRelativeToAbsoluteSD2 +RtlSetAllBits +RtlSetAttributesSecurityDescriptor +RtlSetBits +RtlSetControlSecurityDescriptor +RtlSetCriticalSectionSpinCount +RtlSetCurrentDirectory_U +RtlSetCurrentEnvironment +RtlSetDaclSecurityDescriptor +RtlSetEnvironmentVariable +RtlSetGroupSecurityDescriptor +RtlSetInformationAcl +RtlSetLastWinError +RtlSetLastWinErrorAndNtStatusFromNtStatus +RtlSetOwnerSecurityDescriptor +RtlSetProcessIsCritical +RtlSetSaclSecurityDescriptor +RtlSetSecurityDescriptorRMControl +RtlSetSecurityObject +RtlSetTimeZoneInformation +;RtlSetUnicodeCallouts +RtlSetUserFlagsHeap +RtlSetUserValueHeap +RtlSizeHeap +RtlSleepConditionVariableCS +RtlSleepConditionVariableSRW +RtlSplay +;RtlStartRXact +RtlStringFromGUID +RtlSubAuthorityCountSid +RtlSubAuthoritySid +RtlSubtreePredecessor +RtlSubtreeSuccessor +RtlSystemTimeToLocalTime +RtlTimeFieldsToTime +RtlTimeToElapsedTimeFields +RtlTimeToSecondsSince1970 +RtlTimeToSecondsSince1980 +RtlTimeToTimeFields +RtlTryEnterCriticalSection +RtlUlongByteSwap +RtlUlonglongByteSwap +RtlUnhandledExceptionFilter +RtlUnicodeStringToAnsiSize=RtlxUnicodeStringToAnsiSize +RtlUnicodeStringToAnsiString +RtlUnicodeStringToCountedOemString +RtlUnicodeStringToInteger +RtlUnicodeStringToOemSize=RtlxUnicodeStringToOemSize +RtlUnicodeStringToOemString +RtlUnicodeToCustomCPN +RtlUnicodeToMultiByteN +RtlUnicodeToMultiByteSize +RtlUnicodeToOemN +RtlUniform +RtlUnlockBootStatusData +RtlUnlockHeap +RtlUnwind +RtlUpcaseUnicodeChar +RtlUpcaseUnicodeString +RtlUpcaseUnicodeStringToAnsiString +RtlUpcaseUnicodeStringToCountedOemString +RtlUpcaseUnicodeStringToOemString +RtlUpcaseUnicodeToCustomCPN +RtlUpcaseUnicodeToMultiByteN +RtlUpcaseUnicodeToOemN +RtlUpdateTimer +RtlUpperChar +RtlUpperString +RtlUsageHeap +RtlUshortByteSwap +RtlValidAcl +RtlValidRelativeSecurityDescriptor +RtlValidSecurityDescriptor +RtlValidSid +RtlValidateHeap +RtlValidateProcessHeaps +RtlValidateUnicodeString +RtlVerifyVersionInfo +;RtlWalkHeap +RtlWakeAllConditionVariable +RtlWakeConditionVariable +RtlWriteRegistryValue +;RtlZeroHeap +RtlZeroMemory +RtlpEnsureBufferSize +RtlpNtCreateKey +RtlpNtEnumerateSubKey +RtlpNtMakeTemporaryKey +RtlpNtOpenKey +RtlpNtQueryValueKey +RtlpNtSetValueKey +RtlpUnWaitCriticalSection +RtlpWaitForCriticalSection +RtlxAnsiStringToUnicodeSize +RtlxOemStringToUnicodeSize +RtlxUnicodeStringToAnsiSize +RtlxUnicodeStringToOemSize +;SaveEmContext +VerSetConditionMask +ZwAcceptConnectPort +ZwAccessCheck +ZwAccessCheckAndAuditAlarm +ZwAddAtom +ZwAdjustGroupsToken +ZwAdjustPrivilegesToken +ZwAlertResumeThread +ZwAlertThread +ZwAllocateLocallyUniqueId +ZwAllocateUuids +ZwAllocateVirtualMemory +ZwAssignProcessToJobObject +ZwCallbackReturn +ZwCancelIoFile +ZwCancelTimer +ZwClearEvent +ZwClose +ZwCloseObjectAuditAlarm +ZwCompareTokens +ZwCompleteConnectPort +ZwConnectPort +ZwContinue +ZwCreateDebugObject +ZwCreateDirectoryObject +ZwCreateEvent +ZwCreateEventPair +ZwCreateFile +ZwCreateIoCompletion +ZwCreateJobObject +ZwCreateKey +ZwCreateMailslotFile +ZwCreateMutant +ZwCreateNamedPipeFile +ZwCreatePagingFile +ZwCreatePort +ZwCreateProcess +ZwCreateProfile +ZwCreateSection +ZwCreateSemaphore +ZwCreateSymbolicLinkObject +ZwCreateThread +ZwCreateTimer +ZwCreateToken +ZwCreateWaitablePort +ZwDebugContinue +ZwDelayExecution +ZwDeleteAtom +ZwDeleteFile +ZwDeleteKey +ZwDeleteObjectAuditAlarm +ZwDeleteValueKey +ZwDeviceIoControlFile +ZwDisplayString +ZwDuplicateObject +ZwDuplicateToken +ZwEnumerateKey +ZwEnumerateValueKey +ZwExtendSection +ZwFindAtom +ZwFlushBuffersFile +ZwFlushInstructionCache +ZwFlushKey +ZwFlushVirtualMemory +ZwFlushWriteBuffer +ZwFreeVirtualMemory +ZwFsControlFile +ZwGetContextThread +ZwGetPlugPlayEvent +ZwImpersonateAnonymousToken +ZwImpersonateClientOfPort +ZwImpersonateThread +ZwInitializeRegistry +ZwIsProcessInJob +ZwListenPort +ZwLoadDriver +ZwLoadKey +ZwLoadKey +ZwLockFile +ZwLockVirtualMemory +ZwMakeTemporaryObject +ZwMapViewOfSection +ZwNotifyChangeDirectoryFile +ZwNotifyChangeKey +ZwOpenDirectoryObject +ZwOpenEvent +ZwOpenEventPair +ZwOpenFile +ZwOpenIoCompletion +ZwOpenJobObject +ZwOpenKey +ZwOpenMutant +ZwOpenObjectAuditAlarm +ZwOpenProcess +ZwOpenProcessToken +ZwOpenSection +ZwOpenSemaphore +ZwOpenSymbolicLinkObject +ZwOpenThread +ZwOpenThreadToken +ZwOpenTimer +ZwPlugPlayControl +ZwPowerInformation +ZwPrivilegeCheck +ZwPrivilegedServiceAuditAlarm +ZwPrivilegeObjectAuditAlarm +ZwProtectVirtualMemory +ZwPulseEvent +ZwQueryAttributesFile +ZwQueryDebugFilterState +ZwQueryDefaultLocale +ZwQueryDefaultUILanguage +ZwQueryDirectoryFile +ZwQueryDirectoryObject +ZwQueryEaFile +ZwQueryEvent +ZwQueryFullAttributesFile +ZwQueryInformationAtom +ZwQueryInformationFile +ZwQueryInformationJobObject +ZwQueryInformationPort +ZwQueryInformationProcess +ZwQueryInformationThread +ZwQueryInformationToken +ZwQueryInstallUILanguage +ZwQueryIntervalProfile +ZwQueryIoCompletion +ZwQueryKey +ZwQueryMultipleValueKey +ZwQueryMutant +ZwQueryObject +ZwQueryPerformanceCounter +ZwQuerySection +ZwQuerySecurityObject +ZwQuerySemaphore +ZwQuerySymbolicLinkObject +ZwQuerySystemEnvironmentValue +ZwQuerySystemInformation +ZwQuerySystemTime +ZwQueryTimer +ZwQueryTimerResolution +ZwQueryValueKey +ZwQueryVirtualMemory +ZwQueryVolumeInformationFile +ZwQueueApcThread +ZwRaiseException +ZwRaiseHardError +ZwReadFile +ZwReadFileScatter +ZwReadRequestData +ZwReadVirtualMemory +ZwRegisterThreadTerminatePort +ZwReleaseMutant +ZwReleaseSemaphore +ZwRemoveIoCompletion +ZwReplaceKey +ZwReplyPort +ZwReplyWaitReceivePort +ZwReplyWaitReceivePortEx +ZwReplyWaitReplyPort +ZwRequestPort +ZwRequestWaitReplyPort +ZwResetEvent +ZwRestoreKey +ZwResumeProcess +ZwResumeThread +ZwSaveKey +ZwSecureConnectPort +ZwSetContextThread +ZwSetDebugFilterState +ZwSetDefaultHardErrorPort +ZwSetDefaultLocale +ZwSetDefaultUILanguage +ZwSetEaFile +ZwSetEvent +ZwSetHighEventPair +ZwSetHighWaitLowEventPair +ZwSetInformationDebugObject +ZwSetInformationFile +ZwSetInformationJobObject +ZwSetInformationKey +ZwSetInformationObject +ZwSetInformationProcess +ZwSetInformationThread +ZwSetInformationToken +ZwSetIntervalProfile +ZwSetIoCompletion +ZwSetLdtEntries +ZwSetLowEventPair +ZwSetLowWaitHighEventPair +ZwSetSecurityObject +ZwSetSystemEnvironmentValue +ZwSetSystemInformation +ZwSetSystemPowerState +ZwSetSystemTime +ZwSetTimer +ZwSetTimerResolution +ZwSetUuidSeed +ZwSetValueKey +ZwSetVolumeInformationFile +ZwShutdownSystem +ZwSignalAndWaitForSingleObject +ZwStartProfile +ZwStopProfile +ZwSuspendProcess +ZwSuspendThread +ZwSystemDebugControl +ZwTerminateJobObject +ZwTerminateProcess +ZwTerminateThread +ZwTestAlert +ZwUnloadDriver +ZwUnloadKey +ZwUnlockFile +ZwUnlockVirtualMemory +ZwUnmapViewOfSection +ZwVdmControl +ZwWaitForDebugEvent +ZwWaitForMultipleObjects +ZwWaitForSingleObject +ZwWaitHighEventPair +ZwWaitLowEventPair +ZwWriteFile +ZwWriteFileGather +ZwWriteRequestData +ZwWriteVirtualMemory +ZwYieldExecution +__isascii +__iscsym +__iscsymf +__toascii +_alldiv +_allmul +_alloca_probe +_allrem +_allshl +_allshr +_atoi64 +_aulldiv +_aullrem +_aullshr +_chkstk +_fltused +_ftol +_itoa +_itow +_i64toa +_i64tow +_lfind +_ltoa +_ltow +_memccpy +_memicmp +_snprintf +_snwprintf +_splitpath +_strcmpi +_stricmp +_strlwr +_strnicmp +_strupr +_tolower +_toupper +_ui64toa +_ui64tow +_ultoa +_ultow +_vsnprintf +_vsnwprintf +_wcsicmp +_wcslwr +_wcsnicmp +_wcsupr +_wtoi +_wtoi +_wtol +abs +atan +atoi +atol +bsearch +ceil +cos +fabs +floor +isalnum +isalpha +iscntrl +isdigit +isgraph +islower +isprint +ispunct +isspace +isupper +iswalpha +iswctype +iswdigit +iswlower +iswspace +iswxdigit +isxdigit +labs +log +mbstowcs +memchr +memcmp +memcpy +memmove +memset +pow +qsort +sin +sprintf +sqrt +sscanf +strcat +strchr +strcmp +strcpy +strcspn +strlen +strncat +strncmp +strncpy +strpbrk +strrchr +strspn +strstr +strtol +strtoul +strtoull +swprintf +tan +tolower +toupper +towlower +towupper +vsprintf +vDbgPrintExWithPrefix +wcscat +wcschr +wcscmp +wcscpy +wcscspn +wcslen +wcsncat +wcsncmp +wcsncpy +wcspbrk +wcsrchr +wcsspn +wcsstr +wcstol +wcstombs +wcstoul +; EOF diff --git a/reactos/dll/ntdll/def/ntdll_arm.def b/reactos/dll/ntdll/def/ntdll_arm.def index b27dd6f3a9e..a5d362d7c5d 100644 --- a/reactos/dll/ntdll/def/ntdll_arm.def +++ b/reactos/dll/ntdll/def/ntdll_arm.def @@ -1,3 +1,4 @@ + ; $Id: ntdll.def 34404 2008-07-10 09:46:25Z fireball $ ; ; ReactOS Operating System diff --git a/reactos/dll/ntdll/ldr/utils.c b/reactos/dll/ntdll/ldr/utils.c index 862115d09db..7162be82864 100644 --- a/reactos/dll/ntdll/ldr/utils.c +++ b/reactos/dll/ntdll/ldr/utils.c @@ -268,7 +268,7 @@ LdrpInitializeTlsForProccess(VOID) &Size); ASSERT(Module->TlsIndex < LdrpTlsCount); TlsData = &LdrpTlsArray[Module->TlsIndex]; - TlsData->StartAddressOfRawData = (PVOID)TlsDirectory->StartAddressOfRawData; + TlsData->StartAddressOfRawData = (PVOID)(ULONG_PTR)TlsDirectory->StartAddressOfRawData; TlsData->TlsDataSize = TlsDirectory->EndAddressOfRawData - TlsDirectory->StartAddressOfRawData; TlsData->TlsZeroSize = TlsDirectory->SizeOfZeroFill; if (TlsDirectory->AddressOfCallBacks) @@ -471,7 +471,7 @@ LdrAddModuleEntry(PVOID ImageBase, ASSERT(Module); memset(Module, 0, sizeof(LDR_DATA_TABLE_ENTRY)); Module->DllBase = (PVOID)ImageBase; - Module->EntryPoint = (PVOID)NTHeaders->OptionalHeader.AddressOfEntryPoint; + Module->EntryPoint = (PVOID)(ULONG_PTR)NTHeaders->OptionalHeader.AddressOfEntryPoint; if (Module->EntryPoint != 0) Module->EntryPoint = (PVOID)((ULONG_PTR)Module->EntryPoint + (ULONG_PTR)Module->DllBase); Module->SizeOfImage = LdrpGetResidentSize(NTHeaders); @@ -1047,8 +1047,8 @@ LdrGetExportByOrdinal ( ? RVA(BaseAddress, ExFunctions[Ordinal - ExportDir->Base] ) : NULL); - if (((ULONG)Function >= (ULONG)ExportDir) && - ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize)) + if (((ULONG_PTR)Function >= (ULONG_PTR)ExportDir) && + ((ULONG_PTR)Function < (ULONG_PTR)ExportDir + (ULONG_PTR)ExportDirSize)) { DPRINT("Forward: %s\n", (PCHAR)Function); Function = LdrFixupForward((PCHAR)Function); @@ -1132,8 +1132,8 @@ LdrGetExportByName(PVOID BaseAddress, { Ordinal = ExOrdinals[Hint]; Function = RVA(BaseAddress, ExFunctions[Ordinal]); - if (((ULONG)Function >= (ULONG)ExportDir) && - ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize)) + if (((ULONG_PTR)Function >= (ULONG_PTR)ExportDir) && + ((ULONG_PTR)Function < (ULONG_PTR)ExportDir + (ULONG_PTR)ExportDirSize)) { DPRINT("Forward: %s\n", (PCHAR)Function); Function = LdrFixupForward((PCHAR)Function); @@ -1166,8 +1166,8 @@ LdrGetExportByName(PVOID BaseAddress, { Ordinal = ExOrdinals[mid]; Function = RVA(BaseAddress, ExFunctions[Ordinal]); - if (((ULONG)Function >= (ULONG)ExportDir) && - ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize)) + if (((ULONG_PTR)Function >= (ULONG_PTR)ExportDir) && + ((ULONG_PTR)Function < (ULONG_PTR)ExportDir + (ULONG_PTR)ExportDirSize)) { DPRINT("Forward: %s\n", (PCHAR)Function); Function = LdrFixupForward((PCHAR)Function); From 6618e25fad5f1881a3661612df44d38e1cc9dd32 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 00:02:34 +0000 Subject: [PATCH 039/388] - add a hack to basetsd.h to undefine _X86_ on amd64 builds (gcc defines it) - include _M_AMD64 for defintitions in ioaccess.h - remove KeGetCurrentThread from winddk.h (doesn't work that way) - hack amd64/ketypes.h to make it compile svn path=/branches/ros-amd64-bringup/; revision=34796 --- reactos/include/ddk/ioaccess.h | 2 +- reactos/include/ddk/winddk.h | 16 ++++++++++------ reactos/include/ndk/amd64/ketypes.h | 21 +++++++++++---------- reactos/include/psdk/basetsd.h | 5 +++++ 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/reactos/include/ddk/ioaccess.h b/reactos/include/ddk/ioaccess.h index 677b9f4086c..51537bea7be 100755 --- a/reactos/include/ddk/ioaccess.h +++ b/reactos/include/ddk/ioaccess.h @@ -31,7 +31,7 @@ extern "C" { #ifndef NO_PORT_MACROS -#if defined(_X86_) +#if defined(_X86_) || defined(_M_AMD64) #define READ_REGISTER_UCHAR(r) (*(volatile UCHAR *)(r)) #define READ_REGISTER_USHORT(r) (*(volatile USHORT *)(r)) #define READ_REGISTER_ULONG(r) (*(volatile ULONG *)(r)) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 0cf6228cb02..7cea3d41de9 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5496,16 +5496,20 @@ KeGetCurrentThread( #elif defined(__x86_64__) +#define PASSIVE_LEVEL 0 +#define LOW_LEVEL 0 +#define APC_LEVEL 1 +#define DISPATCH_LEVEL 2 +#define CLOCK_LEVEL 13 +#define IPI_LEVEL 14 +#define POWER_LEVEL 14 +#define PROFILE_LEVEL 15 +#define HIGH_LEVEL 15 + typedef struct _KFLOATING_SAVE { ULONG Dummy; } KFLOATING_SAVE, *PKFLOATING_SAVE; -NTKERNELAPI -PRKTHREAD -NTAPI -KeGetCurrentThread( - VOID); - #elif defined(__PowerPC__) typedef ULONG PFN_NUMBER, *PPFN_NUMBER; diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 1adb6880c9a..1551306394c 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -8,7 +8,7 @@ Header Name: Abstract: - i386 Type definitions for the Kernel services. + amd64 Type definitions for the Kernel services. Author: @@ -16,8 +16,8 @@ Author: --*/ -#ifndef _IAMD64_KETYPES_H -#define _IAMD64_KETYPES_H +#ifndef _AMD64_KETYPES_H +#define _AMD64_KETYPES_H // // Dependencies @@ -26,12 +26,12 @@ Author: // // KPCR Access for non-IA64 builds // -#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS)) -#define PCR ((volatile KPCR * const)K0IPCR) -#if defined(CONFIG_SMP) || defined(NT_BUILD) -#undef KeGetPcr -#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C)) -#endif +//#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS)) +//#define PCR ((volatile KPCR * const)K0IPCR) +//#if defined(CONFIG_SMP) || defined(NT_BUILD) +//#undef KeGetPcr +//#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C)) +//#endif // // Machine Types @@ -296,7 +296,8 @@ FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID) { - return (struct _KPRCB *)(ULONG_PTR)__readgsqword(FIELD_OFFSET(KPCR, Prcb)); +// return (struct _KPRCB *)(ULONG_PTR)__readgsqword(FIELD_OFFSET(KPCR, Prcb)); + return 0; } // diff --git a/reactos/include/psdk/basetsd.h b/reactos/include/psdk/basetsd.h index e6e99a53236..770f30bde47 100644 --- a/reactos/include/psdk/basetsd.h +++ b/reactos/include/psdk/basetsd.h @@ -8,6 +8,11 @@ #ifndef __int64 #define __int64 long long #endif +#if defined(_M_AMD64) || defined(__x86_64__) +#if defined(_X86_) +#undef _X86_ +#endif +#endif #endif #if defined(_WIN64) From ea74713aa6031784f686ba463af687732c32bbcd Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 00:13:23 +0000 Subject: [PATCH 040/388] add Interlocked intrinisc definitions for AMD64 platform svn path=/branches/ros-amd64-bringup/; revision=34798 --- reactos/include/psdk/winbase.h | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index 0fdc0035a7c..ce704694662 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -1706,6 +1706,40 @@ VOID WINAPI InitializeSRWLock(PSRWLOCK); #endif #ifndef __INTERLOCKED_DECLARED #define __INTERLOCKED_DECLARED + +#if defined (_M_AMD64) + +#define InterlockedAnd _InterlockedAnd +#define InterlockedOr _InterlockedOr +#define InterlockedXor _InterlockedXor +#define InterlockedIncrement _InterlockedIncrement +#define InterlockedIncrementAcquire InterlockedIncrement +#define InterlockedIncrementRelease InterlockedIncrement +#define InterlockedDecrement _InterlockedDecrement +#define InterlockedDecrementAcquire InterlockedDecrement +#define InterlockedDecrementRelease InterlockedDecrement +#define InterlockedExchange _InterlockedExchange +#define InterlockedExchangeAdd _InterlockedExchangeAdd +#define InterlockedCompareExchange _InterlockedCompareExchange +#define InterlockedCompareExchangeAcquire InterlockedCompareExchange +#define InterlockedCompareExchangeRelease InterlockedCompareExchange +#define InterlockedExchangePointer _InterlockedExchangePointer +#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer +#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer +#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer +#define InterlockedAnd64 _InterlockedAnd64 +#define InterlockedOr64 _InterlockedOr64 +#define InterlockedXor64 _InterlockedXor64 +#define InterlockedIncrement64 _InterlockedIncrement64 +#define InterlockedDecrement64 _InterlockedDecrement64 +#define InterlockedExchange64 _InterlockedExchange64 +#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 +#define InterlockedCompareExchange64 _InterlockedCompareExchange64 +#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64 +#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64 + +#else + LONG WINAPI InterlockedCompareExchange(IN OUT LONG volatile *,LONG,LONG); LONG WINAPI InterlockedDecrement(IN OUT LONG volatile *); LONG WINAPI InterlockedExchange(IN OUT LONG volatile *,LONG); @@ -1733,6 +1767,8 @@ LONG WINAPI InterlockedIncrement(IN OUT LONG volatile *); PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER); PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY); #endif + +#endif /* !defined(_WIN64) */ #endif /* __INTERLOCKED_DECLARED */ BOOL WINAPI IsBadCodePtr(FARPROC); BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT_PTR); From 0e64661365fa49dd8f8fb895a09592cbf6c08fb4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 01:05:57 +0000 Subject: [PATCH 041/388] - add KI_USER_SHARED_DATA and KeGetCurrentIrql() prototype to winddh svn path=/branches/ros-amd64-bringup/; revision=34800 --- reactos/include/ddk/winddk.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 7cea3d41de9..3ef8e8579b6 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5506,10 +5506,18 @@ KeGetCurrentThread( #define PROFILE_LEVEL 15 #define HIGH_LEVEL 15 +#define KI_USER_SHARED_DATA 0xFFFFF78000000000 + typedef struct _KFLOATING_SAVE { ULONG Dummy; } KFLOATING_SAVE, *PKFLOATING_SAVE; +NTKERNELAPI +KIRQL +KeGetCurrentIrql ( + VOID + ); + #elif defined(__PowerPC__) typedef ULONG PFN_NUMBER, *PPFN_NUMBER; From 3c9ae1448a5c4f90981806080fe6016e941df728 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 01:07:27 +0000 Subject: [PATCH 042/388] - hack amd64/ke.h - unhack inernal/ntoskrnl.h - more files compile svn path=/branches/ros-amd64-bringup/; revision=34801 --- reactos/ntoskrnl/include/internal/amd64/ke.h | 11 ++--- reactos/ntoskrnl/include/internal/ntoskrnl.h | 4 +- reactos/ntoskrnl/ntoskrnl-generic.rbuild | 42 ++++++++++---------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/ke.h b/reactos/ntoskrnl/include/internal/amd64/ke.h index 7b6aaf012e2..23b04db4039 100644 --- a/reactos/ntoskrnl/include/internal/amd64/ke.h +++ b/reactos/ntoskrnl/include/internal/amd64/ke.h @@ -1,5 +1,5 @@ -#ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H -#define __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H +#ifndef __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H +#define __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H #if __GNUC__ >=3 #pragma GCC system_header @@ -45,9 +45,10 @@ #ifndef __ASM__ -//#include "intrin_i.h" +#include "intrin_i.h" -#define KeArchFnInit() Ke386FnInit() +//#define KeArchFnInit() Ke386FnInit() +#define KeArchFnInit() DbgPrint("KeArchFnInit is unimplemented!\n"); #define KeArchHaltProcessor() Ke386HaltProcessor() extern ULONG Ke386CacheAlignment; @@ -136,6 +137,6 @@ KiThreadStartup(PKSYSTEM_ROUTINE SystemRoutine, #endif #endif -#endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H */ +#endif /* __NTOSKRNL_INCLUDE_INTERNAL_AMD64_KE_H */ /* EOF */ diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index cf72757836c..6e1232cbfef 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -17,7 +17,7 @@ #ifdef _NTOSKRNL_ -#if !defined (_ARM_) && !defined (_M_AMD64) +#ifndef _ARM_ #define KeGetCurrentThread _KeGetCurrentThread #define KeGetPreviousMode _KeGetPreviousMode #endif @@ -34,7 +34,7 @@ #define InterlockedExchange _InterlockedExchange #define InterlockedExchangeAdd _InterlockedExchangeAdd -//#include "ke.h" +#include "ke.h" #include "i386/mm.h" #include "i386/fpu.h" #include "i386/v86m.h" diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index c1ae488c8e9..439bf8a7a8d 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -94,29 +94,29 @@ apc.c - + balmgr.c - + clock.c config.c devqueue.c - + dpc.c eventobj.c except.c freeldr.c gate.c gmutex.c ipi.c - + krnlinit.c mutex.c procobj.c - - - + profobj.c + queue.c + semphobj.c spinlock.c - - - - + thrdschd.c + thrdobj.c + timerobj.c + wait.c cacheman.c @@ -182,7 +182,7 @@ ioport.S - + atom.c callback.c dbgctrl.c efi.c @@ -194,7 +194,7 @@ handle.c harderr.c hdlsterm.c - + init.c keyedevt.c locale.c @@ -206,7 +206,7 @@ shutdown.c - + time.c uuid.c win32k.c @@ -251,12 +251,12 @@ driver.c drvrlist.c error.c - + file.c ioevent.c iofunc.c iomdl.c - + iomgr.c iorsrce.c iotimer.c iowork.c @@ -316,7 +316,7 @@ kdinit.c kdio.c - + kdmain.c @@ -369,7 +369,7 @@ - + mpw.c npool.c pagefile.c @@ -395,8 +395,8 @@ - - + obdir.c + obinit.c obhandle.c obname.c oblife.c @@ -426,7 +426,7 @@ kill.c psnotify.c process.c - + psmgr.c query.c quota.c security.c From 0dfe50f09319d962ab4f3ce7cd4bc9bfbbface9d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 01:17:03 +0000 Subject: [PATCH 043/388] make ncitool generate at least valid 64 bit assembly svn path=/branches/ros-amd64-bringup/; revision=34802 --- reactos/tools/nci/ncitool.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reactos/tools/nci/ncitool.c b/reactos/tools/nci/ncitool.c index a79201949f0..543b4c732b7 100644 --- a/reactos/tools/nci/ncitool.c +++ b/reactos/tools/nci/ncitool.c @@ -53,6 +53,11 @@ " call *(%%ecx)\n" \ " ret $0x%x\n\n" +#define UserModeStub_amd64 " movq $0x%x, %%rax\n" \ + " movq $KUSER_SHARED_SYSCALL, %%rcx\n" \ + " call *(%%rcx)\n" \ + " ret $0x%x\n\n" + #define UserModeStub_ppc " stwu 1,-16(1)\n" \ " mflr 0\n\t" \ " stw 0,0(1)\n" \ @@ -94,6 +99,13 @@ " call _KiSystemService\n" \ " ret $0x%x\n\n" +#define KernelModeStub_amd64 " movq $0x%x, %%rax\n" \ + " leaq 4(%%rsp), %%rdx\n" \ + " pushfq\n" \ + " pushq $KGDT_R0_CODE\n" \ + " call _KiSystemService\n" \ + " ret $0x%x\n\n" + /* For now, use the usermode stub. We'll optimize later */ #define KernelModeStub_ppc UserModeStub_ppc @@ -130,7 +142,7 @@ struct ncitool_data_t { struct ncitool_data_t ncitool_data[] = { { "i386", 4, KernelModeStub_x86, UserModeStub_x86, ".global _%s@%d\n", "_%s@%d:\n" }, - { "amd64", 4, KernelModeStub_x86, UserModeStub_x86, + { "amd64", 4, KernelModeStub_amd64, UserModeStub_amd64, ".global _%s@%d\n", "_%s@%d:\n" }, { "powerpc", 4, KernelModeStub_ppc, UserModeStub_ppc, "\t.globl %s\n", "%s:\n" }, From 0d442f4cec7c7ad48187543916037edf8f2150d3 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 26 Jul 2008 06:08:04 +0000 Subject: [PATCH 044/388] Fix more warnings. Convert pciidex to use spec file. NOTE: drivers need to be carefully reviewed for 64bit safety. There is a lot of stuff that can kill us that won't show up in any compiler, knowing ros we probably have at least some issues. Everything but network/ compiles error free. svn path=/branches/ros-amd64-bringup/; revision=34803 --- reactos/drivers/input/i8042prt/keyboard.c | 8 ++--- reactos/drivers/input/i8042prt/setup.c | 4 +-- reactos/drivers/serial/serenum/detect.c | 2 +- reactos/drivers/storage/class/class2/class2.c | 8 ++--- reactos/drivers/storage/ide/atapi/atapi.c | 30 +++++++++---------- .../drivers/storage/ide/pciidex/pciidex.def | 8 ----- .../storage/ide/pciidex/pciidex.rbuild | 3 +- .../drivers/storage/ide/pciidex/pciidex.spec | 5 ++++ .../drivers/storage/port/diskdump/diskdump.c | 6 ++-- 9 files changed, 36 insertions(+), 38 deletions(-) delete mode 100644 reactos/drivers/storage/ide/pciidex/pciidex.def create mode 100644 reactos/drivers/storage/ide/pciidex/pciidex.spec diff --git a/reactos/drivers/input/i8042prt/keyboard.c b/reactos/drivers/input/i8042prt/keyboard.c index 0b1c3d13e5d..179ef71d110 100644 --- a/reactos/drivers/input/i8042prt/keyboard.c +++ b/reactos/drivers/input/i8042prt/keyboard.c @@ -218,7 +218,7 @@ i8042PowerWorkItem( /* Register GUID_DEVICE_SYS_BUTTON interface and report capability */ if (DeviceExtension->NewCaps != DeviceExtension->ReportedCaps) { - WaitingIrp = InterlockedExchangePointer(&DeviceExtension->PowerIrp, NULL); + WaitingIrp = InterlockedExchangePointer((PVOID)&DeviceExtension->PowerIrp, NULL); if (WaitingIrp) { /* Cancel the current power irp, as capability changed */ @@ -273,7 +273,7 @@ i8042PowerWorkItem( } /* Directly complete the IOCTL_GET_SYS_BUTTON_EVENT Irp (if any) */ - WaitingIrp = InterlockedExchangePointer(&DeviceExtension->PowerIrp, NULL); + WaitingIrp = InterlockedExchangePointer((PVOID)&DeviceExtension->PowerIrp, NULL); if (WaitingIrp) { PULONG pEvent = (PULONG)WaitingIrp->AssociatedIrp.SystemBuffer; @@ -447,7 +447,7 @@ i8042KbdDeviceControl( else { WaitingIrp = InterlockedCompareExchangePointer( - &DeviceExtension->PowerIrp, + (PVOID)&DeviceExtension->PowerIrp, Irp, NULL); /* Check if an Irp is already pending */ @@ -465,7 +465,7 @@ i8042KbdDeviceControl( PowerKey = InterlockedExchange((PLONG)&DeviceExtension->LastPowerKey, 0); if (PowerKey != 0) { - (VOID)InterlockedCompareExchangePointer(&DeviceExtension->PowerIrp, NULL, Irp); + (VOID)InterlockedCompareExchangePointer((PVOID)&DeviceExtension->PowerIrp, NULL, Irp); *(PULONG)Irp->AssociatedIrp.SystemBuffer = PowerKey; Status = STATUS_SUCCESS; Irp->IoStatus.Status = Status; diff --git a/reactos/drivers/input/i8042prt/setup.c b/reactos/drivers/input/i8042prt/setup.c index 17d08468b7b..f2d75c66813 100644 --- a/reactos/drivers/input/i8042prt/setup.c +++ b/reactos/drivers/input/i8042prt/setup.c @@ -99,7 +99,7 @@ SendStartDevice( AllocatedResources->List[0].PartialResourceList.PartialDescriptors[2].Flags = CM_RESOURCE_INTERRUPT_LATCHED; AllocatedResources->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Level = KEYBOARD_IRQ; AllocatedResources->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Vector = 0; - AllocatedResources->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Affinity = (KAFFINITY)-1; + AllocatedResources->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Affinity = (LONG_PTR)(KAFFINITY)-1; /* Create default resource list translated */ AllocatedResourcesTranslated = ExAllocatePoolWithTag(PagedPool, ResourceListSize, I8042PRT_TAG); @@ -115,7 +115,7 @@ SendStartDevice( AllocatedResources->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Level, AllocatedResources->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Vector, (PKIRQL)&AllocatedResourcesTranslated->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Level, - &AllocatedResourcesTranslated->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Affinity); + (PVOID)&AllocatedResourcesTranslated->List[0].PartialResourceList.PartialDescriptors[2].u.Interrupt.Affinity); /* Send IRP_MN_START_DEVICE */ TopDeviceObject = IoGetAttachedDeviceReference(Pdo); diff --git a/reactos/drivers/serial/serenum/detect.c b/reactos/drivers/serial/serenum/detect.c index fcf2a6543c7..0e6bf76b058 100644 --- a/reactos/drivers/serial/serenum/detect.c +++ b/reactos/drivers/serial/serenum/detect.c @@ -532,7 +532,7 @@ SerenumDetectLegacyDevice( /* Fill the read buffer */ TRACE_(SERENUM, "Fill the read buffer\n"); - Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count); + Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), (PVOID)&Count); if (!NT_SUCCESS(Status)) goto ByeBye; RtlInitUnicodeString(&DeviceId, L"Serenum\\Mouse"); diff --git a/reactos/drivers/storage/class/class2/class2.c b/reactos/drivers/storage/class/class2/class2.c index e4c95c15bbb..00ad4f1e1a3 100644 --- a/reactos/drivers/storage/class/class2/class2.c +++ b/reactos/drivers/storage/class/class2/class2.c @@ -1504,7 +1504,7 @@ Return Value: srb, irpStack->MajorFunction, irpStack->MajorFunction == IRP_MJ_DEVICE_CONTROL ? irpStack->Parameters.DeviceIoControl.IoControlCode : 0, - MAXIMUM_RETRIES - ((ULONG)irpStack->Parameters.Others.Argument4), + MAXIMUM_RETRIES - ((ULONG_PTR)irpStack->Parameters.Others.Argument4), &status); // @@ -1519,7 +1519,7 @@ Return Value: retry = TRUE; } - if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG)irpStack->Parameters.Others.Argument4-1))) { + if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG_PTR)irpStack->Parameters.Others.Argument4-1))) { // // Retry request. @@ -1656,7 +1656,7 @@ Return Value: srb, irpStack->MajorFunction, irpStack->MajorFunction == IRP_MJ_DEVICE_CONTROL ? irpStack->Parameters.DeviceIoControl.IoControlCode : 0, - MAXIMUM_RETRIES - ((ULONG)irpStack->Parameters.Others.Argument4), + MAXIMUM_RETRIES - ((ULONG_PTR)irpStack->Parameters.Others.Argument4), &status); // @@ -1671,7 +1671,7 @@ Return Value: retry = TRUE; } - if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG)irpStack->Parameters.Others.Argument4-1))) { + if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG_PTR)irpStack->Parameters.Others.Argument4-1))) { // // Retry request. If the class driver has supplied a StartIo, diff --git a/reactos/drivers/storage/ide/atapi/atapi.c b/reactos/drivers/storage/ide/atapi/atapi.c index 3ef862e49fd..2eddcbcd971 100644 --- a/reactos/drivers/storage/ide/atapi/atapi.c +++ b/reactos/drivers/storage/ide/atapi/atapi.c @@ -927,7 +927,7 @@ Return Value: { PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; PIDE_REGISTERS_1 baseIoAddress1 = deviceExtension->BaseIoAddress1[Srb->TargetId >> 1]; - PIDE_REGISTERS_2 baseIoAddress2 = deviceExtension->BaseIoAddress2[Srb->TargetId >> 1]; + //PIDE_REGISTERS_2 baseIoAddress2 = deviceExtension->BaseIoAddress2[Srb->TargetId >> 1]; ULONG i; UCHAR errorByte; UCHAR srbStatus; @@ -1435,7 +1435,7 @@ Return Value: // is clear and then just wait for an arbitrary amount of time! // if (deviceExtension->DeviceFlags[i] & DFLAGS_ATAPI_DEVICE) { - PIDE_REGISTERS_1 baseIoAddress1 = deviceExtension->BaseIoAddress1[i >> 1]; + //PIDE_REGISTERS_1 baseIoAddress1 = deviceExtension->BaseIoAddress1[i >> 1]; PIDE_REGISTERS_2 baseIoAddress2 = deviceExtension->BaseIoAddress2[i >> 1]; ULONG waitCount; @@ -2139,7 +2139,7 @@ Return Value: PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; PULONG adapterCount = (PULONG)Context; PUCHAR ioSpace; - ULONG i,j; + ULONG i; ULONG irq; ULONG portBase; ULONG retryCount; @@ -2600,12 +2600,12 @@ Return Value: --*/ { - PHW_DEVICE_EXTENSION deviceExtension = DeviceExtension; - ULONG rangeNumber = 0; + //PHW_DEVICE_EXTENSION deviceExtension = DeviceExtension; + //ULONG rangeNumber = 0; ULONG pciBuffer; ULONG slotNumber; ULONG functionNumber; - ULONG status; + //ULONG status; PCI_SLOT_NUMBER slotData; PPCI_COMMON_CONFIG pciData; UCHAR vendorString[5]; @@ -2668,8 +2668,8 @@ Return Value: vendorStrPtr = vendorString; deviceStrPtr = deviceString; - AtapiHexToString(pciData->VendorID, &vendorStrPtr); - AtapiHexToString(pciData->DeviceID, &deviceStrPtr); + AtapiHexToString(pciData->VendorID, (PVOID)&vendorStrPtr); + AtapiHexToString(pciData->DeviceID, (PVOID)&deviceStrPtr); DebugPrint((2, "FindBrokenController: Bus %x Slot %x Function %x Vendor %s Product %s\n", @@ -2747,7 +2747,7 @@ Return Value: { PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; - ULONG nativeModeAdapterTableIndex = (ULONG)Context; + ULONG nativeModeAdapterTableIndex = (ULONG_PTR)Context; ULONG channel; PUCHAR ioSpace; BOOLEAN atapiOnly, @@ -2803,8 +2803,8 @@ Return Value: vendorStrPtr = vendorString; deviceStrPtr = deviceString; - AtapiHexToString(pciData.VendorID, &vendorStrPtr); - AtapiHexToString(pciData.DeviceID, &deviceStrPtr); + AtapiHexToString(pciData.VendorID, (PVOID)&vendorStrPtr); + AtapiHexToString(pciData.DeviceID, (PVOID)&deviceStrPtr); // // Compare strings. @@ -3515,7 +3515,7 @@ Return Value: ULONG status; ULONG i; UCHAR statusByte,interruptReason; - BOOLEAN commandComplete = FALSE; + //BOOLEAN commandComplete = FALSE; BOOLEAN atapiDev = FALSE; if (srb) { @@ -4771,7 +4771,7 @@ Return Value: { PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; PIDE_REGISTERS_1 baseIoAddress1 = deviceExtension->BaseIoAddress1[Srb->TargetId >> 1]; - PIDE_REGISTERS_2 baseIoAddress2 = deviceExtension->BaseIoAddress2[Srb->TargetId >> 1]; + //PIDE_REGISTERS_2 baseIoAddress2 = deviceExtension->BaseIoAddress2[Srb->TargetId >> 1]; ULONG startingSector; ULONG sectors; ULONG endSector; @@ -5759,7 +5759,7 @@ Return Value: { PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; - ULONG status; + //ULONG status; PSENSE_DATA senseBuffer = (PSENSE_DATA)Srb->DataBuffer; @@ -6258,7 +6258,7 @@ Return Value: newStatus = ScsiPortInitialize(DriverObject, Argument2, &hwInitializationData, - (PVOID) i); + (PVOID)(ULONG_PTR)i); if (newStatus < statusToReturn) statusToReturn = newStatus; } diff --git a/reactos/drivers/storage/ide/pciidex/pciidex.def b/reactos/drivers/storage/ide/pciidex/pciidex.def deleted file mode 100644 index 5f810fe1d0e..00000000000 --- a/reactos/drivers/storage/ide/pciidex/pciidex.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY pciidex.sys - -EXPORTS -PciIdeXGetBusData@16 -PciIdeXInitialize@16 -PciIdeXSetBusData@20 - -;EOF \ No newline at end of file diff --git a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild index 5aa07d10e5e..ec532f5e771 100644 --- a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild +++ b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild @@ -1,8 +1,9 @@ - + ntoskrnl + pciidex.spec fdo.c miniport.c misc.c diff --git a/reactos/drivers/storage/ide/pciidex/pciidex.spec b/reactos/drivers/storage/ide/pciidex/pciidex.spec new file mode 100644 index 00000000000..93d22bcb28a --- /dev/null +++ b/reactos/drivers/storage/ide/pciidex/pciidex.spec @@ -0,0 +1,5 @@ + +@ stdcall PciIdeXGetBusData(ptr ptr long long) +@ stdcall PciIdeXInitialize(ptr ptr ptr long) +@ stdcall PciIdeXSetBusData(ptr ptr ptr long long) + diff --git a/reactos/drivers/storage/port/diskdump/diskdump.c b/reactos/drivers/storage/port/diskdump/diskdump.c index b5e0262f9bd..b5c1492c935 100644 --- a/reactos/drivers/storage/port/diskdump/diskdump.c +++ b/reactos/drivers/storage/port/diskdump/diskdump.c @@ -366,9 +366,9 @@ DiskDumpPrepare(PDEVICE_OBJECT DeviceObject, PDUMP_POINTERS DumpPointers) } else // hint-name { - Name = (PCHAR)((ULONG)DriverBase + - *FunctionNameList + 2); - Hint = *(PUSHORT)((ULONG)DriverBase + *FunctionNameList); + Name = (PCHAR)((ULONG_PTR)DriverBase + + (ULONG_PTR)*FunctionNameList + 2); + Hint = *(PUSHORT)((ULONG_PTR)DriverBase + (ULONG_PTR)*FunctionNameList); } #if 0 DPRINT(" Hint:%04x Name:%s\n", Hint, pName); From 524c885d7441b3f1b22de401efd9c65293332130 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 26 Jul 2008 08:21:51 +0000 Subject: [PATCH 045/388] Merge 34789, make appropriate changes to ReactOS-amd64.rbuild svn path=/branches/ros-amd64-bringup/; revision=34804 --- reactos/Makefile | 10 +++++++--- reactos/ReactOS-amd64.rbuild | 2 +- reactos/ReactOS-arm.rbuild | 2 +- reactos/ReactOS-ppc.rbuild | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/reactos/Makefile b/reactos/Makefile index 7cd62c11504..dc823d59275 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -38,7 +38,7 @@ # 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-{ROS_ARCH}.auto if needed. +# missing makefile-${ROS_ARCH}.auto if needed. # # module_depends # These targets do a dependency check of individual modules. Replace module @@ -125,7 +125,7 @@ # -r Input XML # # ROS_AUTOMAKE -# Alternate name of makefile.auto +# Alternate name of makefile-${ROS_ARCH}.auto # # ROS_BUILDENGINE # The Build engine to be used. The variable defaults to rbuild (RBUILD_TARGET) @@ -158,7 +158,11 @@ else endif ifeq ($(ROS_AUTOMAKE),) -ROS_AUTOMAKE=makefile.auto + ifeq ($(ARCH),i386) + ROS_AUTOMAKE=makefile.auto + else + ROS_AUTOMAKE=makefile-$(ARCH).auto + endif endif all: $(ROS_AUTOMAKE) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 46715ae83b9..df67904061c 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -1,6 +1,6 @@ - + diff --git a/reactos/ReactOS-arm.rbuild b/reactos/ReactOS-arm.rbuild index 14c9c2f0fd6..a75411a2ec0 100644 --- a/reactos/ReactOS-arm.rbuild +++ b/reactos/ReactOS-arm.rbuild @@ -1,6 +1,6 @@ - + diff --git a/reactos/ReactOS-ppc.rbuild b/reactos/ReactOS-ppc.rbuild index 343b7539fcf..170c41717a2 100644 --- a/reactos/ReactOS-ppc.rbuild +++ b/reactos/ReactOS-ppc.rbuild @@ -1,6 +1,6 @@ - + From b0b7a7611bde537bb747df5cffa199d933c6dee1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 21:13:25 +0000 Subject: [PATCH 046/388] on amd64 KfAcquireSpinLock, KfReleaseSpinLock, KeAcquireInStackQueuedSpinLock and KeReleaseInStackQueuedSpinLock belong to ntoskrnl, not to hal. svn path=/branches/ros-amd64-bringup/; revision=34811 --- reactos/include/ddk/winddk.h | 42 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 3ef8e8579b6..3a5ce992acb 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5817,6 +5817,20 @@ FASTCALL KefReleaseSpinLockFromDpcLevel( IN PKSPIN_LOCK SpinLock); +#if defined(_M_AMD64) +NTKERNELAPI +KIRQL +FASTCALL +KfAcquireSpinLock( + IN PKSPIN_LOCK SpinLock); + +NTKERNELAPI +VOID +FASTCALL +KfReleaseSpinLock( + IN PKSPIN_LOCK SpinLock, + IN KIRQL NewIrql); +#else NTHALAPI KIRQL FASTCALL @@ -5829,6 +5843,7 @@ FASTCALL KfReleaseSpinLock( IN PKSPIN_LOCK SpinLock, IN KIRQL NewIrql); +#endif NTKERNELAPI BOOLEAN @@ -9322,6 +9337,20 @@ IoWritePartitionTableEx( /** Kernel routines **/ +#if defined (_M_AMD64) +NTKERNELAPI +VOID +FASTCALL +KeAcquireInStackQueuedSpinLock( + IN PKSPIN_LOCK SpinLock, + IN PKLOCK_QUEUE_HANDLE LockHandle); + +NTKERNELAPI +VOID +FASTCALL +KeReleaseInStackQueuedSpinLock( + IN PKLOCK_QUEUE_HANDLE LockHandle); +#else NTHALAPI VOID FASTCALL @@ -9329,6 +9358,13 @@ KeAcquireInStackQueuedSpinLock( IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle); +NTHALAPI +VOID +FASTCALL +KeReleaseInStackQueuedSpinLock( + IN PKLOCK_QUEUE_HANDLE LockHandle); +#endif + NTKERNELAPI VOID FASTCALL @@ -9586,12 +9622,6 @@ KeRegisterBugCheckCallback( IN ULONG Length, IN PUCHAR Component); -NTHALAPI -VOID -FASTCALL -KeReleaseInStackQueuedSpinLock( - IN PKLOCK_QUEUE_HANDLE LockHandle); - NTKERNELAPI VOID FASTCALL From de146d7b6c7aa2c93c3a68177dbb68c835f4cf91 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 21:18:00 +0000 Subject: [PATCH 047/388] stubbed hal more or less copied from arm. It compiles... svn path=/branches/ros-amd64-bringup/; revision=34812 --- reactos/hal/hal.rbuild | 2 +- reactos/hal/hal/hal.c | 4 +- reactos/hal/hal/hal_amd64.def | 2 +- reactos/hal/halamd64/directory.rbuild | 10 + reactos/hal/halamd64/generic/generic.rbuild | 10 + reactos/hal/halamd64/generic/hal.c | 1538 +++++++++++++++++++ reactos/hal/halamd64/hal_generic.c | 34 - reactos/hal/halamd64/hal_generic.rbuild | 11 - reactos/hal/halamd64/include/hal.h | 43 + reactos/hal/halamd64/include/halp.h | 22 + reactos/hal/halamd64/up/halinit_up.c | 32 + reactos/hal/halamd64/up/halup.rbuild | 14 + reactos/hal/halamd64/up/halup.rc | 5 + 13 files changed, 1678 insertions(+), 49 deletions(-) create mode 100644 reactos/hal/halamd64/directory.rbuild create mode 100644 reactos/hal/halamd64/generic/generic.rbuild create mode 100644 reactos/hal/halamd64/generic/hal.c delete mode 100644 reactos/hal/halamd64/hal_generic.c delete mode 100644 reactos/hal/halamd64/hal_generic.rbuild create mode 100644 reactos/hal/halamd64/include/hal.h create mode 100644 reactos/hal/halamd64/include/halp.h create mode 100644 reactos/hal/halamd64/up/halinit_up.c create mode 100644 reactos/hal/halamd64/up/halup.rbuild create mode 100644 reactos/hal/halamd64/up/halup.rc diff --git a/reactos/hal/hal.rbuild b/reactos/hal/hal.rbuild index 34a2e86248b..568dcbdf9d4 100644 --- a/reactos/hal/hal.rbuild +++ b/reactos/hal/hal.rbuild @@ -26,7 +26,7 @@ - + diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index 1e963ec8dfa..40e512f1bce 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -74,7 +74,7 @@ HalSetProfileInterval(IN ULONG_PTR Interval) KEBUGCHECK(0); return Interval; } - +#if 0 VOID FASTCALL ExAcquireFastMutex( @@ -101,7 +101,7 @@ ExTryToAcquireFastMutex( return TRUE; } - +#endif VOID NTAPI diff --git a/reactos/hal/hal/hal_amd64.def b/reactos/hal/hal/hal_amd64.def index 27f67d97045..9a749c9e7cf 100644 --- a/reactos/hal/hal/hal_amd64.def +++ b/reactos/hal/hal/hal_amd64.def @@ -59,7 +59,7 @@ IoMapTransfer ;IoReadPartitionTable ;IoSetPartitionInformation ;IoWritePartitionTable -;KdComPortInUse +KdComPortInUse=_KdComPortInUse DATA KeFlushWriteBuffer KeQueryPerformanceCounter KeStallExecutionProcessor diff --git a/reactos/hal/halamd64/directory.rbuild b/reactos/hal/halamd64/directory.rbuild new file mode 100644 index 00000000000..1e0c730ba32 --- /dev/null +++ b/reactos/hal/halamd64/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/reactos/hal/halamd64/generic/generic.rbuild b/reactos/hal/halamd64/generic/generic.rbuild new file mode 100644 index 00000000000..4c14a41f768 --- /dev/null +++ b/reactos/hal/halamd64/generic/generic.rbuild @@ -0,0 +1,10 @@ + + + + ../include + include + + + hal.c + ../include/hal.h + diff --git a/reactos/hal/halamd64/generic/hal.c b/reactos/hal/halamd64/generic/hal.c new file mode 100644 index 00000000000..82c60f243e6 --- /dev/null +++ b/reactos/hal/halamd64/generic/hal.c @@ -0,0 +1,1538 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: hal/halarm/generic/hal.c + * PURPOSE: Hardware Abstraction Layer + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include +#define NDEBUG +#include +#include + +#undef ExAcquireFastMutex +#undef ExReleaseFastMutex +#undef ExTryToAcquireFastMutex +#undef KeAcquireSpinLock +#undef KeLowerIrql +#undef KeRaiseIrql +#undef KeReleaseSpinLock + +#define READ_REGISTER_ULONG(r) (*(volatile ULONG * const)(r)) +#define WRITE_REGISTER_ULONG(r, v) (*(volatile ULONG *)(r) = (v)) + +/* DATA **********************************************************************/ + +ULONG HalpCurrentTimeIncrement, HalpNextTimeIncrement, HalpNextIntervalCount; +ULONG _KdComPortInUse = 0; + +ULONG HalpIrqlTable[HIGH_LEVEL + 1] = +{ + 0xFFFFFFFF, // IRQL 0 PASSIVE_LEVEL + 0xFFFFFFFD, // IRQL 1 APC_LEVEL + 0xFFFFFFF9, // IRQL 2 DISPATCH_LEVEL + 0xFFFFFFD9, // IRQL 3 + 0xFFFFFF99, // IRQL 4 + 0xFFFFFF19, // IRQL 5 + 0xFFFFFE19, // IRQL 6 + 0xFFFFFC19, // IRQL 7 + 0xFFFFF819, // IRQL 8 + 0xFFFFF019, // IRQL 9 + 0xFFFFE019, // IRQL 10 + 0xFFFFC019, // IRQL 11 + 0xFFFF8019, // IRQL 12 + 0xFFFF0019, // IRQL 13 + 0xFFFE0019, // IRQL 14 + 0xFFFC0019, // IRQL 15 + 0xFFF80019, // IRQL 16 + 0xFFF00019, // IRQL 17 + 0xFFE00019, // IRQL 18 + 0xFFC00019, // IRQL 19 + 0xFF800019, // IRQL 20 + 0xFF000019, // IRQL 21 + 0xFE000019, // IRQL 22 + 0xFC000019, // IRQL 23 + 0xF0000019, // IRQL 24 + 0x80000019, // IRQL 25 + 0x19, // IRQL 26 + 0x18, // IRQL 27 PROFILE_LEVEL + 0x10, // IRQL 28 CLOCK2_LEVEL + 0x00, // IRQL 29 IPI_LEVEL + 0x00, // IRQL 30 POWER_LEVEL + 0x00, // IRQL 31 HIGH_LEVEL +}; + +UCHAR HalpMaskTable[HIGH_LEVEL + 1] = +{ + PROFILE_LEVEL, // INT 0 WATCHDOG + APC_LEVEL, // INT 1 SOFTWARE INTERRUPT + DISPATCH_LEVEL,// INT 2 COMM RX + IPI_LEVEL, // INT 3 COMM TX + CLOCK2_LEVEL, // INT 4 TIMER 0 + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 26, + 26 +}; + +/* FUNCTIONS *****************************************************************/ + +NTSTATUS +NTAPI +DriverEntry( + PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) +{ + UNIMPLEMENTED; + + return STATUS_SUCCESS; +} + +/* +* @unimplemented +*/ +VOID +NTAPI +HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) +{ + KEBUGCHECK(0); + return; +} + +/* +* @unimplemented +*/ +VOID +NTAPI +HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) +{ + KEBUGCHECK(0); + return; +} + +/* +* @unimplemented +*/ +ULONG_PTR +NTAPI +HalSetProfileInterval(IN ULONG_PTR Interval) +{ + KEBUGCHECK(0); + return Interval; +} + +VOID +FASTCALL +ExAcquireFastMutex( + PFAST_MUTEX FastMutex) +{ + UNIMPLEMENTED; +} + + +VOID +FASTCALL +ExReleaseFastMutex( + PFAST_MUTEX FastMutex) +{ + UNIMPLEMENTED; +} + + +BOOLEAN FASTCALL +ExTryToAcquireFastMutex( + PFAST_MUTEX FastMutex) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +NTSTATUS +NTAPI +HalAdjustResourceList( + PCM_RESOURCE_LIST Resources) +{ + UNIMPLEMENTED; + + return STATUS_SUCCESS; +} + + +/* + * @implemented + */ +BOOLEAN +NTAPI +HalAllProcessorsStarted(VOID) +{ + /* Do nothing */ + return TRUE; +} + + +NTSTATUS +NTAPI +HalAllocateAdapterChannel( + PADAPTER_OBJECT AdapterObject, + PWAIT_CONTEXT_BLOCK WaitContextBlock, + ULONG NumberOfMapRegisters, + PDRIVER_CONTROL ExecutionRoutine) +{ + UNIMPLEMENTED; + + return STATUS_SUCCESS; +} + + +PVOID +NTAPI +HalAllocateCommonBuffer( + PADAPTER_OBJECT AdapterObject, + ULONG Length, + PPHYSICAL_ADDRESS LogicalAddress, + BOOLEAN CacheEnabled) +{ + UNIMPLEMENTED; + + return NULL; +} + + +PVOID +NTAPI +HalAllocateCrashDumpRegisters( + PADAPTER_OBJECT AdapterObject, + PULONG NumberOfMapRegisters) +{ + UNIMPLEMENTED; + return NULL; +} + + +NTSTATUS +NTAPI +HalAssignSlotResources( + PUNICODE_STRING RegistryPath, + PUNICODE_STRING DriverClassName, + PDRIVER_OBJECT DriverObject, + PDEVICE_OBJECT DeviceObject, + INTERFACE_TYPE BusType, + ULONG BusNumber, + ULONG SlotNumber, + PCM_RESOURCE_LIST *AllocatedResources) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +BOOLEAN +NTAPI +HalBeginSystemInterrupt (KIRQL Irql, + ULONG Vector, + PKIRQL OldIrql) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +VOID +NTAPI +HalCalibratePerformanceCounter( + volatile LONG *Count, + ULONGLONG NewCount) +{ + UNIMPLEMENTED; +} + + +BOOLEAN +NTAPI +HalDisableSystemInterrupt( + ULONG Vector, + KIRQL Irql) +{ + UNIMPLEMENTED; + + return TRUE; +} + +VOID +NTAPI +HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters) +{ + // + // Stub since Windows XP implemented Inbv + // + return; +} + +VOID +NTAPI +HalDisplayString(IN PCH String) +{ + // + // Call the Inbv driver + // + InbvDisplayString(String); +} + +VOID +NTAPI +HalQueryDisplayParameters(OUT PULONG DispSizeX, + OUT PULONG DispSizeY, + OUT PULONG CursorPosX, + OUT PULONG CursorPosY) +{ + // + // Stub since Windows XP implemented Inbv + // + return; +} + +VOID +NTAPI +HalSetDisplayParameters(IN ULONG CursorPosX, + IN ULONG CursorPosY) +{ + // + // Stub since Windows XP implemented Inbv + // + return; +} + +BOOLEAN +NTAPI +HalEnableSystemInterrupt( + ULONG Vector, + KIRQL Irql, + KINTERRUPT_MODE InterruptMode) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +VOID +NTAPI +HalEndSystemInterrupt( + KIRQL Irql, + ULONG Unknown2) +{ + UNIMPLEMENTED; +} + + +BOOLEAN +NTAPI +HalFlushCommonBuffer( + ULONG Unknown1, + ULONG Unknown2, + ULONG Unknown3, + ULONG Unknown4, + ULONG Unknown5) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +VOID +NTAPI +HalFreeCommonBuffer( + PADAPTER_OBJECT AdapterObject, + ULONG Length, + PHYSICAL_ADDRESS LogicalAddress, + PVOID VirtualAddress, + BOOLEAN CacheEnabled) +{ + UNIMPLEMENTED; +} + + +PADAPTER_OBJECT +NTAPI +HalGetAdapter( + PDEVICE_DESCRIPTION DeviceDescription, + PULONG NumberOfMapRegisters) +{ + UNIMPLEMENTED; + + return (PADAPTER_OBJECT)NULL; +} + + +ULONG +NTAPI +HalGetBusData( + BUS_DATA_TYPE BusDataType, + ULONG BusNumber, + ULONG SlotNumber, + PVOID Buffer, + ULONG Length) +{ + UNIMPLEMENTED; + + return 0; +} + + +ULONG +NTAPI +HalGetBusDataByOffset( + BUS_DATA_TYPE BusDataType, + ULONG BusNumber, + ULONG SlotNumber, + PVOID Buffer, + ULONG Offset, + ULONG Length) +{ + UNIMPLEMENTED; + + return 0; +} + + +ARC_STATUS +NTAPI +HalGetEnvironmentVariable( + PCH Name, + USHORT ValueLength, + PCH Value) +{ + UNIMPLEMENTED; + + return ENOENT; +} + + +ULONG +NTAPI +HalGetInterruptVector( + INTERFACE_TYPE InterfaceType, + ULONG BusNumber, + ULONG BusInterruptLevel, + ULONG BusInterruptVector, + PKIRQL Irql, + PKAFFINITY Affinity) +{ + UNIMPLEMENTED; + + return 0; +} + + +VOID +NTAPI +HalHandleNMI( + PVOID NmiData) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +HalpGetParameters(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PCHAR CommandLine; + + /* Make sure we have a loader block and command line */ + if ((LoaderBlock) && (LoaderBlock->LoadOptions)) + { + /* Read the command line */ + CommandLine = LoaderBlock->LoadOptions; + + /* Check for initial breakpoint */ + if (strstr(CommandLine, "BREAK")) DbgBreakPoint(); + } +} + +ULONG +HalGetInterruptSource(VOID) +{ + ULONG InterruptStatus; + + // + // Get the interrupt status, and return the highest bit set + // + InterruptStatus = READ_REGISTER_ULONG(VIC_INT_STATUS); + return 31 - _clz(InterruptStatus); +} + +VOID +HalpClockInterrupt(VOID) +{ + // + // Clear the interrupt + // + ASSERT(KeGetCurrentIrql() == CLOCK2_LEVEL); + WRITE_REGISTER_ULONG(TIMER0_INT_CLEAR, 1); + + // + // FIXME: Update HAL Perf counters + // + + // + // FIXME: Check if someone changed the clockrate + // + + // + // Call the kernel + // + KeUpdateSystemTime(KeGetCurrentThread()->TrapFrame, + CLOCK2_LEVEL, + HalpCurrentTimeIncrement); + + // + // We're done + // +} + +VOID +HalpStallInterrupt(VOID) +{ + // + // Clear the interrupt + // + WRITE_REGISTER_ULONG(TIMER0_INT_CLEAR, 1); +} + +VOID +HalpInitializeInterrupts(VOID) +{ + PKPCR Pcr = (PKPCR)KeGetPcr(); + ULONG ClockInterval; + SP804_CONTROL_REGISTER ControlRegister; + + // + // Fill out the IRQL mappings + // + RtlCopyMemory(Pcr->IrqlTable, HalpIrqlTable, sizeof(Pcr->IrqlTable)); + RtlCopyMemory(Pcr->IrqlMask, HalpMaskTable, sizeof(Pcr->IrqlMask)); + + // + // Setup the clock and profile interrupt + // + Pcr->InterruptRoutine[CLOCK2_LEVEL] = HalpStallInterrupt; + + // + // Configure the interval to 10ms + // (INTERVAL (10ms) * TIMCLKfreq (1MHz)) + // --------------------------------------- == 10^4 + // (TIMCLKENXdiv (1) * PRESCALEdiv (1)) + // + ClockInterval = 0x2710; + + // + // Configure the timer + // + ControlRegister.AsUlong = 0; + ControlRegister.Wide = TRUE; + ControlRegister.Periodic = TRUE; + ControlRegister.Interrupt = TRUE; + ControlRegister.Enabled = TRUE; + + // + // Enable the timer + // + WRITE_REGISTER_ULONG(TIMER0_LOAD, ClockInterval); + WRITE_REGISTER_ULONG(TIMER0_CONTROL, ControlRegister.AsUlong); +} + +/* + * @implemented + */ +BOOLEAN +NTAPI +HalInitSystem(IN ULONG BootPhase, + IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PKPRCB Prcb = KeGetCurrentPrcb(); + + // + // Check the boot phase + // + if (!BootPhase) + { + // + // Get command-line parameters + // + HalpGetParameters(LoaderBlock); + +#if DBG + // + // Checked HAL requires checked kernel + // + if (!(Prcb->BuildType & PRCB_BUILD_DEBUG)) + { + // + // No match, bugcheck + // + KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 1, 0); + } +#else + // + // Release build requires release HAL + // + if (Prcb->BuildType & PRCB_BUILD_DEBUG) + { + // + // No match, bugcheck + // + KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0); + } +#endif + +#ifdef CONFIG_SMP + // + // SMP HAL requires SMP kernel + // + if (Prcb->BuildType & PRCB_BUILD_UNIPROCESSOR) + { + // + // No match, bugcheck + // + KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0); + } +#endif + + // + // Validate the PRCB + // + if (Prcb->MajorVersion != PRCB_MAJOR_VERSION) + { + // + // Validation failed, bugcheck + // + KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0); + } + + // + // Setup time increments to 10ms and 1ms + // + HalpCurrentTimeIncrement = 100000; + HalpNextTimeIncrement = 100000; + HalpNextIntervalCount = 0; + KeSetTimeIncrement(100000, 10000); + + // + // Initialize interrupts + // + HalpInitializeInterrupts(); + } + else if (BootPhase == 1) + { + // + // Switch to real clock interrupt + // + PCR->InterruptRoutine[CLOCK2_LEVEL] = HalpClockInterrupt; + } + + // + // All done, return + // + return TRUE; +} + + +VOID +NTAPI +HalInitializeProcessor(IN ULONG ProcessorNumber, + IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + // + // Nothing to do + // + return; +} + + +BOOLEAN +NTAPI +HalMakeBeep( + ULONG Frequency) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +VOID +NTAPI +HalProcessorIdle(VOID) +{ + UNIMPLEMENTED; +} + + +#define RTC_DATA (PVOID)0xE00E8000 + +BOOLEAN +NTAPI +HalQueryRealTimeClock(IN PTIME_FIELDS Time) +{ + LARGE_INTEGER LargeTime; + ULONG Seconds; + + // + // Query the RTC value + // + Seconds = READ_REGISTER_ULONG(RTC_DATA); + + // + // Convert to time + // + RtlSecondsSince1970ToTime(Seconds, &LargeTime); + + // + // Convert to time-fields + // + RtlTimeToTimeFields(&LargeTime, Time); + return TRUE; +} + +ULONG +NTAPI +HalReadDmaCounter( + PADAPTER_OBJECT AdapterObject) +{ + UNIMPLEMENTED; + + return 0; +} + + +VOID +NTAPI +HalReportResourceUsage(VOID) +{ + UNIMPLEMENTED; +} + + +VOID +NTAPI +HalRequestIpi( + ULONG Unknown) +{ + UNIMPLEMENTED; +} + + +VOID +FASTCALL +HalRequestSoftwareInterrupt(IN KIRQL Request) +{ + // + // Force a software interrupt + // + WRITE_REGISTER_ULONG(VIC_SOFT_INT, 1 << Request); +} + +VOID +FASTCALL +HalClearSoftwareInterrupt(IN KIRQL Request) +{ + // + // Clear a software interrupt + // + WRITE_REGISTER_ULONG(VIC_SOFT_INT_CLEAR, 1 << Request); +} + +VOID +NTAPI +HalReturnToFirmware( + FIRMWARE_REENTRY Action) +{ + UNIMPLEMENTED; +} + + +ULONG +NTAPI +HalSetBusData( + BUS_DATA_TYPE BusDataType, + ULONG BusNumber, + ULONG SlotNumber, + PVOID Buffer, + ULONG Length) +{ + UNIMPLEMENTED; + + return 0; +} + + +ULONG +NTAPI +HalSetBusDataByOffset( + BUS_DATA_TYPE BusDataType, + ULONG BusNumber, + ULONG SlotNumber, + PVOID Buffer, + ULONG Offset, + ULONG Length) +{ + UNIMPLEMENTED; + + return 0; +} + + +ARC_STATUS +NTAPI +HalSetEnvironmentVariable( + PCH Name, + PCH Value) +{ + UNIMPLEMENTED; + + return ESUCCESS; +} + + +BOOLEAN +NTAPI +HalSetRealTimeClock( + PTIME_FIELDS Time) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +ULONG +NTAPI +HalSetTimeIncrement( + ULONG Increment) +{ + UNIMPLEMENTED; + + return Increment; +} + + +BOOLEAN +NTAPI +HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock, + IN PKPROCESSOR_STATE ProcessorState) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +ULONG +FASTCALL +HalSystemVectorDispatchEntry( + ULONG Unknown1, + ULONG Unknown2, + ULONG Unknown3) +{ + UNIMPLEMENTED; + + return 0; +} + + +BOOLEAN +NTAPI +HalTranslateBusAddress( + INTERFACE_TYPE InterfaceType, + ULONG BusNumber, + PHYSICAL_ADDRESS BusAddress, + PULONG AddressSpace, + PPHYSICAL_ADDRESS TranslatedAddress) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +VOID +NTAPI +HalpAssignDriveLetters(IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN PSTRING NtDeviceName, + OUT PUCHAR NtSystemPath, + OUT PSTRING NtSystemPathString) +{ + /* Call the kernel */ + IoAssignDriveLetters(LoaderBlock, + NtDeviceName, + NtSystemPath, + NtSystemPathString); +} + +NTSTATUS +NTAPI +HalpReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN BOOLEAN ReturnRecognizedPartitions, + IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer) +{ + /* Call the kernel */ + return IoReadPartitionTable(DeviceObject, + SectorSize, + ReturnRecognizedPartitions, + PartitionBuffer); +} + +NTSTATUS +NTAPI +HalpWritePartitionTable(IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG SectorsPerTrack, + IN ULONG NumberOfHeads, + IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer) +{ + /* Call the kernel */ + return IoWritePartitionTable(DeviceObject, + SectorSize, + SectorsPerTrack, + NumberOfHeads, + PartitionBuffer); +} + +NTSTATUS +NTAPI +HalpSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG PartitionNumber, + IN ULONG PartitionType) +{ + /* Call the kernel */ + return IoSetPartitionInformation(DeviceObject, + SectorSize, + PartitionNumber, + PartitionType); +} + + +BOOLEAN +NTAPI +IoFlushAdapterBuffers( + PADAPTER_OBJECT AdapterObject, + PMDL Mdl, + PVOID MapRegisterBase, + PVOID CurrentVa, + ULONG Length, + BOOLEAN WriteToDevice) +{ + UNIMPLEMENTED; + + return TRUE; +} + + +VOID +NTAPI +IoFreeAdapterChannel( + PADAPTER_OBJECT AdapterObject) +{ + UNIMPLEMENTED; +} + + +VOID +NTAPI +IoFreeMapRegisters( + PADAPTER_OBJECT AdapterObject, + PVOID MapRegisterBase, + ULONG NumberOfMapRegisters) +{ + UNIMPLEMENTED; +} + + +PHYSICAL_ADDRESS +NTAPI +IoMapTransfer( + PADAPTER_OBJECT AdapterObject, + PMDL Mdl, + PVOID MapRegisterBase, + PVOID CurrentVa, + PULONG Length, + BOOLEAN WriteToDevice) +{ + PHYSICAL_ADDRESS Address; + + UNIMPLEMENTED; + + Address.QuadPart = 0; + + return Address; +} + +VOID +NTAPI +KeFlushWriteBuffer(VOID) +{ + UNIMPLEMENTED; +} + +LARGE_INTEGER +NTAPI +KeQueryPerformanceCounter( + PLARGE_INTEGER PerformanceFreq) +{ + LARGE_INTEGER Value; + + UNIMPLEMENTED; + + Value.QuadPart = 0; + + return Value; +} + +VOID +NTAPI +KeStallExecutionProcessor(IN ULONG Microseconds) +{ + SP804_CONTROL_REGISTER ControlRegister; + + // + // Enable the timer + // + WRITE_REGISTER_ULONG(TIMER1_LOAD, Microseconds); + + // + // Configure the timer + // + ControlRegister.AsUlong = 0; + ControlRegister.OneShot = TRUE; + ControlRegister.Wide = TRUE; + ControlRegister.Periodic = TRUE; + ControlRegister.Enabled = TRUE; + WRITE_REGISTER_ULONG(TIMER1_CONTROL, ControlRegister.AsUlong); + + // + // Now we will loop until the timer reached 0 + // + while (READ_REGISTER_ULONG(TIMER1_VALUE)); +} + +VOID +FASTCALL +KfLowerIrql(IN KIRQL NewIrql) +{ + ULONG InterruptMask; + ARM_STATUS_REGISTER Flags; + PKPCR Pcr = (PKPCR)KeGetPcr(); + + // + // Validate the new IRQL + // + Flags = KeArmStatusRegisterGet(); + _disable(); + ASSERT(NewIrql <= Pcr->CurrentIrql); + + // + // IRQLs are internally 8 bits + // + NewIrql &= 0xFF; + + // + // Setup the interrupt mask for this IRQL + // + InterruptMask = KeGetPcr()->IrqlTable[NewIrql]; +// DPRINT1("[LOWER] IRQL: %d InterruptMask: %lx\n", NewIrql, InterruptMask); + + // + // Clear interrupts associated to the old IRQL + // + WRITE_REGISTER_ULONG(VIC_INT_CLEAR, 0xFFFFFFFF); + + // + // Set the new interrupt mask + // PL190 VIC support only for now + // + WRITE_REGISTER_ULONG(VIC_INT_ENABLE, InterruptMask); + + // + // Save the new IRQL + // + Pcr->CurrentIrql = NewIrql; + if (!Flags.IrqDisable) _enable(); +} + +KIRQL +FASTCALL +KfRaiseIrql(IN KIRQL NewIrql) +{ + KIRQL OldIrql; + ULONG InterruptMask; + ARM_STATUS_REGISTER Flags; + PKPCR Pcr = (PKPCR)KeGetPcr(); + + // + // Save the current IRQL + // + Flags = KeArmStatusRegisterGet(); + _disable(); + OldIrql = Pcr->CurrentIrql; + + // + // IRQLs are internally 8 bits + // + NewIrql &= 0xFF; + + // + // Setup the interrupt mask for this IRQL + // + InterruptMask = KeGetPcr()->IrqlTable[NewIrql]; + // DPRINT1("[RAISE] IRQL: %d InterruptMask: %lx\n", NewIrql, InterruptMask); + ASSERT(NewIrql >= OldIrql); + + // + // Clear interrupts associated to the old IRQL + // + WRITE_REGISTER_ULONG(VIC_INT_CLEAR, 0xFFFFFFFF); + + // + // Set the new interrupt mask + // PL190 VIC support only for now + // + WRITE_REGISTER_ULONG(VIC_INT_ENABLE, InterruptMask); + + // + // Save the new IRQL + // + Pcr->CurrentIrql = NewIrql; + if (!Flags.IrqDisable) _enable(); + return OldIrql; +} + +VOID +NTAPI +READ_PORT_BUFFER_UCHAR( + PUCHAR Port, + PUCHAR Buffer, + ULONG Count) +{ + UNIMPLEMENTED; +} + + +VOID +NTAPI +READ_PORT_BUFFER_ULONG( + PULONG Port, + PULONG Buffer, + ULONG Count) +{ + UNIMPLEMENTED; +} + + +VOID +NTAPI +READ_PORT_BUFFER_USHORT( + PUSHORT Port, + PUSHORT Buffer, + ULONG Count) +{ + UNIMPLEMENTED; +} + + +UCHAR +NTAPI +READ_PORT_UCHAR( + PUCHAR Port) +{ + UNIMPLEMENTED; + + return 0; +} + + +ULONG +NTAPI +READ_PORT_ULONG( + PULONG Port) +{ + UNIMPLEMENTED; + + return 0; +} + + +USHORT +NTAPI +READ_PORT_USHORT( + PUSHORT Port) +{ + UNIMPLEMENTED; + + return 0; +} + + +VOID +NTAPI +WRITE_PORT_BUFFER_UCHAR( + PUCHAR Port, + PUCHAR Buffer, + ULONG Count) +{ + UNIMPLEMENTED; +} + + +VOID +NTAPI +WRITE_PORT_BUFFER_USHORT( + PUSHORT Port, + PUSHORT Buffer, + ULONG Count) +{ + UNIMPLEMENTED; +} + + +VOID +NTAPI +WRITE_PORT_BUFFER_ULONG( + PULONG Port, + PULONG Buffer, + ULONG Count) +{ + UNIMPLEMENTED; +} + + +VOID +NTAPI +WRITE_PORT_UCHAR( + PUCHAR Port, + UCHAR Value) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +WRITE_PORT_ULONG( + PULONG Port, + ULONG Value) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +WRITE_PORT_USHORT( + PUSHORT Port, + USHORT Value) +{ + UNIMPLEMENTED; +} + +KIRQL +KeRaiseIrqlToDpcLevel(VOID) +{ + // + // Call the generic routine + // + return KfRaiseIrql(DISPATCH_LEVEL); +} + +KIRQL +KeRaiseIrqlToSynchLevel(VOID) +{ + // + // Call the generic routine + // + return KfRaiseIrql(DISPATCH_LEVEL); +} + +BOOLEAN HalpProcessorIdentified; +BOOLEAN HalpTestCleanSupported; + +VOID +HalpIdentifyProcessor(VOID) +{ + ARM_ID_CODE_REGISTER IdRegister; + + // + // Don't do it again + // + HalpProcessorIdentified = TRUE; + + // + // Read the ID Code + // + IdRegister = KeArmIdCodeRegisterGet(); + + // + // Architecture "6" CPUs support test-and-clean (926EJ-S and 1026EJ-S) + // + HalpTestCleanSupported = (IdRegister.Architecture == 6); +} + +VOID +HalSweepDcache(VOID) +{ + // + // We get called very early on, before HalInitSystem or any of the Hal* + // processor routines, so we need to figure out what CPU we're on. + // + if (!HalpProcessorIdentified) HalpIdentifyProcessor(); + + // + // Check if we can do it the ARMv5TE-J way + // + if (HalpTestCleanSupported) + { + // + // Test, clean, flush D-Cache + // + __asm__ __volatile__ ("1: mrc p15, 0, pc, c7, c14, 3; bne 1b"); + } + else + { + // + // We need to do it it by set/way + // + UNIMPLEMENTED; + } +} + +VOID +HalSweepIcache(VOID) +{ + // + // All ARM cores support the same Icache flush command, no need for HAL work + // + KeArmFlushIcache(); +} + +/* + * @implemented + */ +#undef KeGetCurrentIrql +KIRQL +NTAPI +KeGetCurrentIrql(VOID) +{ + /* Return IRQL */ + return PCR->CurrentIrql; +} + +/* + * @implemented + */ +VOID +NTAPI +KeLowerIrql(KIRQL NewIrql) +{ + /* Call the fastcall function */ + KfLowerIrql(NewIrql); +} + +/* + * @implemented + */ +VOID +NTAPI +KeRaiseIrql(KIRQL NewIrql, + PKIRQL OldIrql) +{ + /* Call the fastcall function */ + *OldIrql = KfRaiseIrql(NewIrql); +} + +/* + * @implemented + */ +VOID +NTAPI +KeAcquireSpinLock(PKSPIN_LOCK SpinLock, + PKIRQL OldIrql) +{ + /* Call the fastcall function */ + *OldIrql = KfAcquireSpinLock(SpinLock); +} + +/* + * @implemented + */ +KIRQL +FASTCALL +KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock) +{ + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +} + +/* + * @implemented + */ +VOID +NTAPI +KeReleaseSpinLock(PKSPIN_LOCK SpinLock, + KIRQL NewIrql) +{ + /* Call the fastcall function */ + KfReleaseSpinLock(SpinLock, NewIrql); +} + +/* + * @implemented + */ +KIRQL +FASTCALL +KfAcquireSpinLock(PKSPIN_LOCK SpinLock) +{ + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +} + +/* + * @implemented + */ +VOID +FASTCALL +KfReleaseSpinLock(PKSPIN_LOCK SpinLock, + KIRQL OldIrql) +{ + /* Simply lower IRQL back */ + KfLowerIrql(OldIrql); +} + +/* + * @implemented + */ +KIRQL +FASTCALL +KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) +{ + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +} + +/* + * @implemented + */ +KIRQL +FASTCALL +KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) +{ + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +} + +/* + * @implemented + */ +VOID +FASTCALL +KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + /* Simply raise to dispatch */ + LockHandle->OldIrql = KfRaiseIrql(DISPATCH_LEVEL); +} + +/* + * @implemented + */ +VOID +FASTCALL +KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + /* Simply raise to synch */ + LockHandle->OldIrql = KfRaiseIrql(DISPATCH_LEVEL); +} + +/* + * @implemented + */ +VOID +FASTCALL +KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, + IN KIRQL OldIrql) +{ + /* Simply lower IRQL back */ + KfLowerIrql(OldIrql); +} + +/* + * @implemented + */ +VOID +FASTCALL +KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + /* Simply lower IRQL back */ + KfLowerIrql(LockHandle->OldIrql); +} + +/* + * @implemented + */ +BOOLEAN +FASTCALL +KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, + IN PKIRQL OldIrql) +{ + /* Simply raise to dispatch */ + *OldIrql = KfRaiseIrql(DISPATCH_LEVEL); + + /* Always return true on UP Machines */ + return TRUE; +} + +/* + * @implemented + */ +LOGICAL +FASTCALL +KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, + OUT PKIRQL OldIrql) +{ + /* Simply raise to dispatch */ + *OldIrql = KfRaiseIrql(DISPATCH_LEVEL); + + /* Always return true on UP Machines */ + return TRUE; +} + +/* EOF */ diff --git a/reactos/hal/halamd64/hal_generic.c b/reactos/hal/halamd64/hal_generic.c deleted file mode 100644 index a5aa4488c65..00000000000 --- a/reactos/hal/halamd64/hal_generic.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * PROJECT: ReactOS HAL - * LICENSE: GPL - See COPYING in the top level directory - * FILE: hal/halamd64/ - * PURPOSE: I/O HAL Routines for Disk Access - * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org) - */ - -/* INCLUDES ******************************************************************/ - -#include -#define NDEBUG -#include - -/* FUNCTIONS *****************************************************************/ - - - - -NTSTATUS -NTAPI -HalpSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG PartitionNumber, - IN ULONG PartitionType) -{ - /* Call the kernel */ - return IoSetPartitionInformation(DeviceObject, - SectorSize, - PartitionNumber, - PartitionType); -} - - diff --git a/reactos/hal/halamd64/hal_generic.rbuild b/reactos/hal/halamd64/hal_generic.rbuild deleted file mode 100644 index 1e0fdc00088..00000000000 --- a/reactos/hal/halamd64/hal_generic.rbuild +++ /dev/null @@ -1,11 +0,0 @@ - - - - - include - include - - - hal_generic.c - - diff --git a/reactos/hal/halamd64/include/hal.h b/reactos/hal/halamd64/include/hal.h new file mode 100644 index 00000000000..e16859b753f --- /dev/null +++ b/reactos/hal/halamd64/include/hal.h @@ -0,0 +1,43 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: hal/halarm/include/hal.h + * PURPOSE: Hardware Abstraction Layer Header + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES ******************************************************************/ + +/* C Headers */ +#include + +/* WDK HAL Compilation hack */ +#ifdef _MSC_VER +#include +#include +#undef _NTHAL_ +#undef DECLSPEC_IMPORT +#define DECLSPEC_IMPORT +#define __declspec(dllimport) +#endif + +/* IFS/DDK/NDK Headers */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Internal HAL Headers */ +#include "halp.h" + +/* Helper Header */ +#include + +/* EOF */ diff --git a/reactos/hal/halamd64/include/halp.h b/reactos/hal/halamd64/include/halp.h new file mode 100644 index 00000000000..2351b9e5699 --- /dev/null +++ b/reactos/hal/halamd64/include/halp.h @@ -0,0 +1,22 @@ +#ifndef __INTERNAL_HAL_HAL_H +#define __INTERNAL_HAL_HAL_H + +// +// ARM Headers +// +#include +#include + +// +// Versatile Peripherals +// +#include +#include +#include + +// +// WDK Hack +// +#define KdComPortInUse _KdComPortInUse + +#endif /* __INTERNAL_HAL_HAL_H */ diff --git a/reactos/hal/halamd64/up/halinit_up.c b/reactos/hal/halamd64/up/halinit_up.c new file mode 100644 index 00000000000..cbb18bc665e --- /dev/null +++ b/reactos/hal/halamd64/up/halinit_up.c @@ -0,0 +1,32 @@ +/* $Id: halinit_up.c 24964 2006-11-29 08:28:20Z ion $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/hal/x86/halinit.c + * PURPOSE: Initalize the x86 hal + * PROGRAMMER: David Welch (welch@cwcom.net) + * UPDATE HISTORY: + * 11/06/98: Created + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include + +/* FUNCTIONS ***************************************************************/ + +VOID +HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + +} + +VOID +HalpInitPhase1(VOID) +{ + +} + +/* EOF */ diff --git a/reactos/hal/halamd64/up/halup.rbuild b/reactos/hal/halamd64/up/halup.rbuild new file mode 100644 index 00000000000..8308980b26a --- /dev/null +++ b/reactos/hal/halamd64/up/halup.rbuild @@ -0,0 +1,14 @@ + + + + + + ../include + include + + + halamd64_generic + ntoskrnl + halinit_up.c + halup.rc + diff --git a/reactos/hal/halamd64/up/halup.rc b/reactos/hal/halamd64/up/halup.rc new file mode 100644 index 00000000000..951c3581d56 --- /dev/null +++ b/reactos/hal/halamd64/up/halup.rc @@ -0,0 +1,5 @@ +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "AMD64 Uniprocessor Hardware Abstraction Layer\0" +#define REACTOS_STR_INTERNAL_NAME "halup\0" +#define REACTOS_STR_ORIGINAL_FILENAME "halup.dll\0" +#include From 95064f402934cd4dd0d0cbee70eecf3a2e678bd4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 26 Jul 2008 21:22:34 +0000 Subject: [PATCH 048/388] - add Zw.S back to ntoskrnl, as it now contains valid 64 bit assembly - I cheat and add all unresolved references in a stub file for now ntoskrnl links now, so I can continue on freeldr again. svn path=/branches/ros-amd64-bringup/; revision=34813 --- reactos/ntoskrnl/amd64stubs.c | 572 +++++++++++++++++++++++ reactos/ntoskrnl/ntoskrnl-generic.rbuild | 3 +- 2 files changed, 574 insertions(+), 1 deletion(-) create mode 100644 reactos/ntoskrnl/amd64stubs.c diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c new file mode 100644 index 00000000000..d54454e5be8 --- /dev/null +++ b/reactos/ntoskrnl/amd64stubs.c @@ -0,0 +1,572 @@ + +#define STUB(x) void x() {} + +STUB(KfLowerIrql) +STUB(KeRaiseIrql) +STUB(KeLowerIrql) +STUB(KeRaiseIrqlToSynchLevel) +STUB(KeRaiseIrqlToDpcLevel) +STUB(KiIdleLoop) +STUB(KeGetCurrentIrql) +STUB(KeBugCheckEx) +STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch) +STUB(KeNumberProcessors) +STUB(KeBugcheckCallbackListHead) +STUB(NtAdjustGroupsToken) +STUB(NtAdjustPrivilegesToken) +STUB(NtAllocateUserPhysicalPages) +STUB(NtAllocateVirtualMemory) +STUB(NtAreMappedFilesTheSame) +STUB(MmUserProbeAddress) +STUB(MmSizeOfMdl) +STUB(MmBuildMdlForNonPagedPool) +STUB(MmMapViewOfSection) +STUB(ExpInterlockedPushEntrySList) +STUB(ExAllocatePool) +STUB(ExFreePool) +STUB(ExFreePoolWithTag) +STUB(ExAllocatePoolWithTag) +STUB(PsGetCurrentThreadId) +STUB(NtContinue) +STUB(NtCreateEvent) +STUB(NtCreateMutant) +STUB(NtCreateSection) +STUB(NtCreateSemaphore) +STUB(NtCreateThread) +STUB(NtCreateTimer) +STUB(NtCreateToken) +STUB(NtDebugContinue) +STUB(NtDuplicateToken) +STUB(NtExtendSection) +STUB(NtFilterToken) +STUB(NtFlushInstructionCache) +STUB(NtFreeUserPhysicalPages) +STUB(NtDebugActiveProcess) +STUB(KeActiveProcessors) +STUB(KeDisableInterrupts) +STUB(KiSwapContext) +STUB(KeContextToTrapFrame) +STUB(KiDispatchException) +STUB(MmSystemRangeStart) +STUB(MiGetUserPageDirectoryCount) +STUB(MmStats) +STUB(PsCreateSystemThread) +STUB(ExAcquireResourceLock) +STUB(ExReleaseResourceLock) +STUB(MiNonPagedPoolLength) +STUB(MiNonPagedPoolStart) +STUB(MmGetPfnForProcess) +STUB(KiInitializeUserApc) +STUB(KiComputeTimerTableIndex) +STUB(KeBugcheckReasonCallbackListHead) +STUB(BugCheckCallbackLock) +STUB(NtCallbackReturn) +STUB(NtCancelTimer) +STUB(NtClearEvent) +STUB(NtCompareTokens) +STUB(NtCreateDebugObject) +STUB(NtCreateIoCompletion) +STUB(NtEnumerateSystemEnvironmentValuesEx) +STUB(NtFlushVirtualMemory) +STUB(NtFreeVirtualMemory) +STUB(NtGetWriteWatch) +STUB(NtImpersonateAnonymousToken) +STUB(NtLockVirtualMemory) +STUB(NtMapUserPhysicalPages) +STUB(NtMapUserPhysicalPagesScatter) +STUB(NtMapViewOfSection) +STUB(NtOpenEvent) +STUB(NtOpenIoCompletion) +STUB(NtOpenMutant) +STUB(NtOpenSection) +STUB(NtOpenSemaphore) +STUB(NtOpenThread) +STUB(NtOpenThreadToken) +STUB(NtOpenTimer) +STUB(NtProtectVirtualMemory) +STUB(NtPulseEvent) +STUB(NtQueryEvent) +STUB(NtQueryInformationToken) +STUB(NtQueryIoCompletion) +STUB(NtQueryMutant) +STUB(NtQuerySection) +STUB(NtQuerySemaphore) +STUB(NtQuerySystemEnvironmentValue) +STUB(NtQuerySystemEnvironmentValueEx) +STUB(NtQuerySystemInformation) +STUB(NtQueryTimer) +STUB(NtQueryVirtualMemory) +STUB(NtRaiseException) +STUB(NtReadVirtualMemory) +STUB(NtReleaseMutant) +STUB(NtReleaseSemaphore) +STUB(NtRemoveIoCompletion) +STUB(NtRemoveProcessDebug) +STUB(NtResetEvent) +STUB(NtResetWriteWatch) +STUB(NtSetEvent) +STUB(NtSetEventBoostPriority) +STUB(NtSetInformationTokenNtSetInformationDebugObject) +STUB(NtSetIoCompletion) +STUB(NtSetLdtEntries) +STUB(NtSetSystemEnvironmentValue) +STUB(NtSetSystemEnvironmentValueEx) +STUB(NtSetSystemInformation) +STUB(NtSetTimer) +STUB(NtUnlockVirtualMemory) +STUB(NtUnmapViewOfSection) +STUB(NtVdmControl) +STUB(NtWaitForDebugEvent) +STUB(NtWriteVirtualMemory) +STUB(NtGetCurrentProcessorNumber) +STUB(NtOpenThreadTokenEx) +STUB(NtSetInformationDebugObject) +STUB(NtSetInformationToken) +STUB(KiSwapProcess) +STUB(MmUpdatePageDir) +STUB(KeGetCurrentProcessorNumber) +STUB(MmDeleteKernelStack) +STUB(MmCreateKernelStack) +STUB(Ke386InitThreadWithContext) +STUB(MmUnmapLockedPages) +STUB(ExpInterlockedPopEntrySList) +STUB(MmGetPhysicalAddress) +STUB(MmFreeSectionSegments) +STUB(ExAllocateFromNPagedLookasideList) +STUB(ExInitializeNPagedLookasideList) +STUB(SeTokenType) +STUB(RtlGetCallersAddress) +STUB(RtlCompareMemory) +STUB(DbgkpSendApiMessage) +STUB(MmGetFileNameForSection) +STUB(DbgkpTraceLevel) +STUB(ExpInitializeEventImplementation) +STUB(ExpInitializeMutantImplementation) +STUB(ExpInitializeSemaphoreImplementation) +STUB(ExpInitializeTimerImplementation) +STUB(ExpEnvironmentLock) +STUB(ExpFirmwareTableProviderListHead) +STUB(MmSectionObjectType) +STUB(IoAcquireCancelSpinLock) +STUB(IoReleaseCancelSpinLock) +STUB(ExInterlockedInsertTailList) +STUB(ExInterlockedRemoveHeadList) +STUB(ExInterlockedAddLargeStatistic) +STUB(MmProbeAndLockPages) +STUB(IopCompletionMapping) +STUB(CmpInitializeMachineDependentConfiguration) +STUB(ExpInitLookasideLists) +STUB(ExpFirmwareTableResource) +STUB(MmMapViewInSystemSpace) +STUB(MmNumberOfPhysicalPages) +STUB(MmInitSystem) +STUB(RtlInitializeRangeListPackage) +STUB(ExInitPoolLookasidePointers) +STUB(KiInitializeBugCheck) +STUB(MmHighestUserAddress) +STUB(DbgkInitialize) +STUB(MmCreateMdl) +STUB(MmMapLockedPage) +STUB(PsThreadType) +STUB(MiShutdownMemoryManager) +STUB(ExfInterlockedCompareExchange64) +STUB(ExAllocatePoolWithQuotaTag) +STUB(ExInitializePagedLookasideList) +STUB(ExInterlockedInsertHeadList) +STUB(IoCheckEaBufferValidity) +STUB(ExEventObjectType) +STUB(IopDeleteIoCompletion) +STUB(IoCompletionType) +STUB(IoCompletionPacketLookaside) +STUB(CancelSpinLock) +STUB(KdbpCliInit) +STUB(MmUnlockPages) +STUB(KeDisconnectInterrupt) +STUB(KeInitializeInterrupt) +STUB(MmUnmapViewOfSection) +STUB(MiFreeDescriptor) +STUB(MmPfnDatabase) +STUB(MmHighestPhysicalPage) +STUB(MmIsPagePresent) +STUB(MmCreateVirtualMappingForKernel) +STUB(MmSetPageProtect) +STUB(MiFreeDescriptorOrg) +STUB(MmMapLockedPages) +STUB(_PsThreadType) +STUB(_ExEventObjectType) +STUB(MmCreateHyperspaceMapping) +STUB(MmDeleteHyperspaceMapping) +STUB(MmFreeVirtualMemory) +STUB(MmCreateVirtualMapping) +STUB(MmRawDeleteVirtualMapping) +STUB(MmIsPageSwapEntry) +STUB(MmDeletePageFileMapping) +STUB(KeRosDumpStackFrames) +STUB(RtlWalkFrameChain) +STUB(MmCommitPagedPoolAddress) +STUB(MmIsDirtyPage) +STUB(MmSetDirtyPage) +STUB(MmSetCleanPage) +STUB(MmPageOutSectionView) +STUB(MmPageOutVirtualMemory) +STUB(MmAllocateSection) +STUB(MmDeleteVirtualMapping) +STUB(ExSystemLookasideListHead) +STUB(PspGetOrSetContextKernelRoutine) +STUB(PspW32ThreadCallout) +STUB(ExTimerRundown) +STUB(KeConnectInterrupt) +STUB(MmWritePageSectionView) +STUB(MmWritePageVirtualMemory) +STUB(ExInitializeSystemLookasideList) +STUB(KeRaiseUserException) +STUB(PsIsThreadTerminating) +STUB(ExMutantObjectType) +STUB(_ExSemaphoreObjectType) +STUB(MmCleanProcessAddressSpace) +STUB(MmDeleteProcessAddressSpace) +STUB(MmDeleteTeb) +STUB(DbgkClearProcessDebugObject) +STUB(MmSetMemoryPriorityProcess) +STUB(MmInitializeHandBuiltProcess) +STUB(MmInitializeHandBuiltProcess2) +STUB(MmInitializeProcessAddressSpace) +STUB(MmCreatePeb) +STUB(MmQuerySystemSize) +STUB(KeFeatureBits) +STUB(MmGetFileObjectForSection) +STUB(SepTokenObjectType) +STUB(SeExchangePrimaryToken) +STUB(SeIsTokenChild) +STUB(SeTokenImpersonationLevel) +STUB(SeSubProcessToken) +STUB(SeAssignPrimaryToke) +STUB(SeCopyClientToken) +STUB(SepInitializeTokenImplementation) +STUB(KiSystemService) +STUB(KdpGdbStubInit) +STUB(KdbpGetCommandLineSettings) +STUB(KdbpSafeReadMemory) +STUB(RtlpAllocateMemory) +STUB(RtlFillMemoryUlong) +STUB(RtlCaptureContext) +STUB(RtlpGetExceptionAddress) +STUB(RtlpCheckForActiveDebugger) +STUB(RtlDispatchException) +STUB(RtlpFreeMemory) +STUB(RtlpLockAtomTable) +STUB(RtlpUnlockAtomTable) +STUB(PspW32ProcessCallout) +STUB(DbgkDebugObjectType) +STUB(DbgkCopyProcessDebugPort) +STUB(MmCreateProcessAddressSpace) +STUB(SeAssignPrimaryToken) +STUB(SeDeassignPrimaryToken) +STUB(SepCreateSystemProcessToken) +STUB(KdbEnterDebuggerException) +STUB(KdbpCliModuleLoaded) +STUB(RtlpSetInDbgPrint) +STUB(CHECK_PAGED_CODE_RTL) +STUB(RtlpGetAtomEntry) +STUB(RtlpFreeAtomHandle) +STUB(RtlpFreeAtomTableEntry) +STUB(RtlpAllocAtomTableEntry) +STUB(RtlAcquirePebLock) +STUB(RtlpGetMode) +STUB(RtlReleasePebLock) +STUB(RtlEnterHeapLock) +STUB(RtlLeaveHeapLock) +STUB(RtlInitializeHeapLock) +STUB(LdrShutdownThread) +STUB(RtlpDestroyAtomHandleTable) +STUB(RtlpDestroyAtomTableLock) +STUB(RtlpFreeAtomTable) +STUB(RtlpAllocAtomTable) +STUB(RtlpInitAtomTableLock) +STUB(RtlpCreateAtomHandleTable) +STUB(RtlpAllocDeallocQueryBufferSize) +STUB(find_entry) +STUB(RtlDeleteHeapLock) +STUB(RtlUnwind) +STUB(RtlpCreateAtomHandle) +STUB(RtlInitializeContext) +STUB(RtlpCurrentPeb) + +STUB(DbgCommandString) +STUB(ExAcquireRundownProtection) +STUB(ExAcquireRundownProtectionCacheAware) +STUB(ExAcquireRundownProtectionCacheAwareEx) +STUB(ExAcquireRundownProtectionEx) +STUB(ExAllocateFromPagedLookasideList) +STUB(ExAllocatePoolWithQuota) +STUB(ExAllocatePoolWithTagPriority) +STUB(ExDeleteNPagedLookasideList) +STUB(ExDeletePagedLookasideList) +STUB(ExEnterCriticalRegionAndAcquireResourceShared) +STUB(ExEnterCriticalRegionAndAcquireSharedWaitForExclusive) +STUB(ExFreeToPagedLookasideList) +STUB(ExGetCurrentProcessorCounts) +STUB(ExGetCurrentProcessorCpuUsage) +STUB(ExGetPreviousMode) +STUB(ExInitializeRundownProtection) +STUB(ExInterlockedAddLargeInteger) +STUB(ExInterlockedAddUlong) +STUB(ExInterlockedPopEntryList) +STUB(ExInterlockedPushEntryList) +STUB(ExIsProcessorFeaturePresent) +STUB(ExQueryDepthSList) +STUB(ExQueryPoolBlockSize) +STUB(ExRaiseException) +STUB(ExRaiseStatus) +STUB(ExReInitializeRundownProtection) +STUB(ExReInitializeRundownProtectionCacheAware) +STUB(ExReleaseRundownProtection) +STUB(ExReleaseRundownProtectionCacheAware) +STUB(ExReleaseRundownProtectionCacheAwareEx) +STUB(ExReleaseRundownProtectionEx) +STUB(ExRundownCompleted) +STUB(ExRundownCompletedCacheAware) +STUB(ExSemaphoreObjectType) +STUB(ExVerifySuite) +STUB(ExWaitForRundownProtectionRelease) +STUB(ExWaitForRundownProtectionReleaseCacheAware) +STUB(ExpInterlockedFlushSList) +STUB(FsRtlAddBaseMcbEntry) +STUB(FsRtlGetNextBaseMcbEntry) +STUB(FsRtlInitializeBaseMcb) +STUB(FsRtlLegalAnsiCharacterArray) +STUB(FsRtlLookupBaseMcbEntry) +STUB(FsRtlLookupLastBaseMcbEntry) +STUB(FsRtlLookupLastBaseMcbEntryAndIndex) +STUB(FsRtlNumberOfRunsInBaseMcb) +STUB(FsRtlRemoveBaseMcbEntry) +STUB(FsRtlResetBaseMcb) +STUB(FsRtlSplitBaseMcb) +STUB(FsRtlTruncateBaseMcb) +STUB(FsRtlUninitializeBaseMcb) +STUB(HalDispatchTable) +STUB(HeadlessDispatch) +STUB(InitializeSListHead) +STUB(IoCheckDesiredAccess) +STUB(IoCheckFunctionAccess) +STUB(IoCheckQuerySetVolumeInformation) +STUB(IoEnumerateRegisteredFiltersList) +STUB(IoFileObjectType) +STUB(IoForwardAndCatchIrp) +STUB(IoGetCurrentProcess) +STUB(IoGetDeviceToVerify) +STUB(IoGetInitialStack) +STUB(IoGetPagingIoPriority) +STUB(IoGetStackLimits) +STUB(IoIs32bitProcess) +STUB(IoIsSystemThread) +STUB(IoIsWdmVersionAvailable) +STUB(IoSetCompletionRoutineEx) +STUB(IoSetDeviceToVerify) +STUB(IoSetHardErrorOrVerifyDevice) +STUB(IoSetIoCompletion) +STUB(IoThreadToProcess) +STUB(IoTranslateBusAddress) +STUB(IoValidateDeviceIoControlAccess) +STUB(IoWMIDeviceObjectToProviderId) +STUB(KdDebuggerEnabled) +STUB(KdDebuggerNotPresent) +STUB(KdRefreshDebuggerNotPresent) +STUB(KeAcquireInStackQueuedSpinLockForDpc) +STUB(KeAcquireQueuedSpinLock) +STUB(KeAcquireQueuedSpinLockRaiseToSynch) +STUB(KeAcquireSpinLockForDpc) +STUB(KeAcquireSpinLockRaiseToDpc) +STUB(KeAcquireSpinLockRaiseToSynch) +STUB(KeDeregisterBugCheckCallback) +STUB(KeDeregisterBugCheckReasonCallback) +STUB(KeDeregisterNmiCallback) +STUB(KeEnterCriticalRegion) +STUB(KeEnterGuardedRegion) +STUB(KeEnterKernelDebugger) +STUB(KeExpandKernelStackAndCallout) +STUB(KeFlushEntireTb) +STUB(KeGenericCallDpc) +STUB(KeGetRecommendedSharedDataAlignment) +STUB(KeInitializeCrashDumpHeader) +STUB(KeInvalidateAllCaches) +STUB(KeIsWaitListEmpty) +STUB(KeLastBranchMSR) +STUB(KeLeaveCriticalRegion) +STUB(KeLeaveGuardedRegion) +STUB(KeQueryActiveProcessors) +STUB(KeQueryMultiThreadProcessorSet) +STUB(KeQueryPrcbAddress) +STUB(KeReadStateMutex) +STUB(KeRegisterBugCheckCallback) +STUB(KeRegisterBugCheckReasonCallback) +STUB(KeRegisterNmiCallback) +STUB(KeReleaseInStackQueuedSpinLockForDpc) +STUB(KeReleaseQueuedSpinLock) +STUB(KeReleaseSpinLock) +STUB(KeReleaseSpinLockForDpc) +STUB(KeRestoreFloatingPointState) +STUB(KeSaveFloatingPointState) +STUB(KeSaveStateForHibernate) +STUB(KeSetDmaIoCoherency) +STUB(KeSignalCallDpcDone) +STUB(KeSignalCallDpcSynchronize) +STUB(KeSynchronizeExecution) +STUB(KeTestSpinLock) +STUB(KeTryToAcquireQueuedSpinLock) +STUB(KeTryToAcquireQueuedSpinLockRaiseToSynch) +STUB(KeUpdateRunTime) +STUB(KeUpdateSystemTime) +STUB(KeUserModeCallback) +STUB(KeWaitForMutexObject) +STUB(KfRaiseIrql) +STUB(KiBugCheckData) +STUB(KiCpuId) +STUB(Mm64BitPhysicalAddress) +STUB(MmAdjustWorkingSetSize) +STUB(MmAdvanceMdl) +STUB(MmAllocateContiguousMemory) +STUB(MmAllocateContiguousMemorySpecifyCache) +STUB(MmAllocateMappingAddress) +STUB(MmAllocateNonCachedMemory) +STUB(MmAllocatePagesForMdl) +STUB(MmAllocatePagesForMdlEx) +STUB(MmCanFileBeTruncated) +STUB(MmCommitSessionMappedView) +STUB(MmCreateMirror) +STUB(MmCreateSection) +STUB(MmDisableModifiedWriteOfSection) +STUB(MmFlushImageSection) +STUB(MmForceSectionClosed) +STUB(MmFreeContiguousMemory) +STUB(MmFreeContiguousMemorySpecifyCache) +STUB(MmFreeMappingAddress) +STUB(MmFreeNonCachedMemory) +STUB(MmFreePagesFromMdl) +STUB(MmGetVirtualForPhysical) +STUB(MmGrowKernelStack) +STUB(MmIsAddressValid) +STUB(MmIsIoSpaceActive) +STUB(MmIsNonPagedSystemAddressValid) +STUB(MmIsThisAnNtAsSystem) +STUB(MmLockPagableImageSection) +STUB(MmMapLockedPagesSpecifyCache) +STUB(MmMapLockedPagesWithReservedMapping) +STUB(MmMapMemoryDumpMdl) +STUB(MmMapVideoDisplay) +STUB(MmMapViewInSessionSpace) +STUB(MmPrefetchPages) +STUB(MmProbeAndLockProcessPages) +STUB(MmProbeAndLockSelectedPages) +STUB(MmProtectMdlSystemAddress) +STUB(MmSecureVirtualMemory) +STUB(MmSetAddressRangeModified) +STUB(MmSetBankedSection) +STUB(MmUnmapReservedMapping) +STUB(MmUnmapVideoDisplay) +STUB(MmUnmapViewInSessionSpace) +STUB(MmUnmapViewInSystemSpace) +STUB(MmUnsecureVirtualMemory) +STUB(NlsOemLeadByteInfo) +STUB(ObDeleteCapturedInsertInfo) +STUB(ObSetHandleAttributes) +STUB(PfxFindPrefix) +STUB(PfxInitialize) +STUB(PfxInsertPrefix) +STUB(PfxRemovePrefix) +STUB(PoCancelDeviceNotify) +STUB(PoRegisterDeviceNotify) +STUB(PoRequestShutdownEvent) +STUB(PoSetHiberRange) +STUB(PoShutdownBugCheck) +STUB(PsEstablishWin32Callouts) +STUB(PsGetCurrentProcess) +STUB(PsGetCurrentProcessWow64Process) +STUB(PsGetCurrentThread) +STUB(PsGetCurrentThreadPreviousMode) +STUB(PsGetCurrentThreadProcess) +STUB(PsGetCurrentThreadProcessId) +STUB(PsGetCurrentThreadStackBase) +STUB(PsGetCurrentThreadStackLimit) +STUB(PsGetCurrentThreadTeb) +STUB(PsGetCurrentThreadWin32Thread) +STUB(PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion) +STUB(PsGetProcessSessionIdEx) +STUB(PsGetProcessWow64Process) +STUB(PsGetThreadFreezeCount) +STUB(PsGetThreadHardErrorsAreDisabled) +STUB(PsGetThreadId) +STUB(PsGetThreadProcess) +STUB(PsGetThreadProcessId) +STUB(PsGetThreadSessionId) +STUB(PsGetThreadTeb) +STUB(PsGetThreadWin32Thread) +STUB(PsIsSystemProcess) +STUB(PsIsSystemThread) +STUB(PsIsThreadImpersonating) +STUB(PsLookupThreadByThreadId) +STUB(PsProcessType) +STUB(PsSetThreadHardErrorsAreDisabled) +STUB(PsSetThreadWin32Thread) +STUB(PsWrapApcWow64Thread) +STUB(RtlAnsiStringToUnicodeSize) +STUB(RtlCompareMemoryUlong) +STUB(RtlCopyMemory) +STUB(RtlCopyMemoryNonTemporal) +STUB(RtlFillMemory) +STUB(RtlLookupFunctionEntry) +STUB(RtlMoveMemory) +STUB(RtlOemStringToUnicodeSize) +STUB(RtlPcToFileHeader) +STUB(RtlPrefetchMemoryNonTemporal) +STUB(RtlRestoreContext) +STUB(RtlTraceDatabaseAdd) +STUB(RtlTraceDatabaseCreate) +STUB(RtlTraceDatabaseDestroy) +STUB(RtlTraceDatabaseEnumerate) +STUB(RtlTraceDatabaseFind) +STUB(RtlTraceDatabaseLock) +STUB(RtlTraceDatabaseUnlock) +STUB(RtlTraceDatabaseValidate) +STUB(RtlUnicodeStringToAnsiSize) +STUB(RtlUnicodeStringToOemSize) +STUB(RtlUnwindEx) +STUB(RtlVirtualUnwind) +STUB(RtlZeroMemory) +STUB(SeFilterToken) +STUB(SeQueryAuthenticationIdToken) +STUB(SeQueryInformationToken) +STUB(SeQuerySessionIdToken) +STUB(SeReportSecurityEvent) +STUB(SeSetAuditParameter) +STUB(SeTokenIsAdmin) +STUB(SeTokenIsRestricted) +STUB(SeTokenObjectType) +STUB(VfFailDeviceNode) +STUB(VfFailDriver) +STUB(VfFailSystemBIOS) +STUB(VfIsVerificationEnabled) +STUB(WmiFlushTrace) +STUB(WmiGetClock) +STUB(WmiQueryTrace) +STUB(WmiQueryTraceInformation) +STUB(WmiStartTrace) +STUB(WmiStopTrace) +STUB(WmiTraceFastEvent) +STUB(WmiTraceMessage) +STUB(WmiTraceMessageVa) +STUB(WmiUpdateTrace) +STUB(XIPDispatch) +STUB(__C_specific_handler) +STUB(__misaligned_access) +STUB(_local_unwind) +STUB(_setjmp) +STUB(_setjmpex) +STUB(longjmp) +STUB(KfReleaseSpinLock) +STUB(KeAcquireInStackQueuedSpinLock) +STUB(KeReleaseInStackQueuedSpinLock) +STUB(KfAcquireSpinLock) +STUB(KeBugCheck) +STUB(MmMapIoSpace) +STUB(MmUnmapIoSpace) diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index 439bf8a7a8d..17227b1b64d 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -36,6 +36,7 @@ ntoskrnl.h + amd64stubs.c @@ -172,7 +173,7 @@ - + zw.S From 9ac6a3e6c881ca69c42abfcf57e704643ea02f7b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 08:03:19 +0000 Subject: [PATCH 049/388] fix parameters of NtAllocateVirtualMemory and NtFreeVirtualMemory, compile anonmem.c, update stubs file svn path=/branches/ros-amd64-bringup/; revision=34827 --- reactos/ntoskrnl/amd64stubs.c | 11 ++++++----- reactos/ntoskrnl/mm/anonmem.c | 4 ++-- reactos/ntoskrnl/ntoskrnl-generic.rbuild | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index d54454e5be8..598b07f4061 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -15,7 +15,6 @@ STUB(KeBugcheckCallbackListHead) STUB(NtAdjustGroupsToken) STUB(NtAdjustPrivilegesToken) STUB(NtAllocateUserPhysicalPages) -STUB(NtAllocateVirtualMemory) STUB(NtAreMappedFilesTheSame) STUB(MmUserProbeAddress) STUB(MmSizeOfMdl) @@ -68,7 +67,6 @@ STUB(NtCreateDebugObject) STUB(NtCreateIoCompletion) STUB(NtEnumerateSystemEnvironmentValuesEx) STUB(NtFlushVirtualMemory) -STUB(NtFreeVirtualMemory) STUB(NtGetWriteWatch) STUB(NtImpersonateAnonymousToken) STUB(NtLockVirtualMemory) @@ -196,7 +194,6 @@ STUB(_PsThreadType) STUB(_ExEventObjectType) STUB(MmCreateHyperspaceMapping) STUB(MmDeleteHyperspaceMapping) -STUB(MmFreeVirtualMemory) STUB(MmCreateVirtualMapping) STUB(MmRawDeleteVirtualMapping) STUB(MmIsPageSwapEntry) @@ -208,7 +205,6 @@ STUB(MmIsDirtyPage) STUB(MmSetDirtyPage) STUB(MmSetCleanPage) STUB(MmPageOutSectionView) -STUB(MmPageOutVirtualMemory) STUB(MmAllocateSection) STUB(MmDeleteVirtualMapping) STUB(ExSystemLookasideListHead) @@ -217,7 +213,6 @@ STUB(PspW32ThreadCallout) STUB(ExTimerRundown) STUB(KeConnectInterrupt) STUB(MmWritePageSectionView) -STUB(MmWritePageVirtualMemory) STUB(ExInitializeSystemLookasideList) STUB(KeRaiseUserException) STUB(PsIsThreadTerminating) @@ -570,3 +565,9 @@ STUB(KfAcquireSpinLock) STUB(KeBugCheck) STUB(MmMapIoSpace) STUB(MmUnmapIoSpace) +STUB(MmFindRegion) +STUB(MmAlterRegion) +STUB(MmInitializeRegion) +STUB(MmDisableVirtualMapping) +STUB(MmCreatePageFileMapping) +STUB(MmEnableVirtualMapping) diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index 5a14de50088..e7c5de160ee 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -518,7 +518,7 @@ NTSTATUS STDCALL NtAllocateVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID* UBaseAddress, IN ULONG ZeroBits, - IN OUT PULONG URegionSize, + IN OUT PSIZE_T URegionSize, IN ULONG AllocationType, IN ULONG Protect) /* @@ -895,7 +895,7 @@ MmFreeVirtualMemory(PEPROCESS Process, NTSTATUS STDCALL NtFreeVirtualMemory(IN HANDLE ProcessHandle, IN PVOID* PBaseAddress, - IN PULONG PRegionSize, + IN PSIZE_T PRegionSize, IN ULONG FreeType) /* * FUNCTION: Frees a range of virtual memory diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index 17227b1b64d..829668d818b 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -358,7 +358,7 @@ page.c - + anonmem.c aspace.c balance.c From 0f2d3247006a8911850ef0084da79c0980fafd10 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 27 Jul 2008 08:30:10 +0000 Subject: [PATCH 050/388] intrin_x86.h: - Fix rotl declaration, add mysteriously missing rotr. winnt.h: - Fix CONTEXT_AMD64 and friends, add various constants. - Define RUNTIME_FUNCTION, RtlCaptureContext, RtlRestoreContext, RtlAddFunctionTable, RtlInstallFunctionTableCallback, RtlDeleteFunctionTable. - Fix definitions for EXCEPTION_RECORD and friends to support amd64. - Define IMAGE_THUNK_DATA64 and related constants. - Define IMAGE_TLS_DIRECTORY64 and related constants. svn path=/branches/ros-amd64-bringup/; revision=34831 --- reactos/include/psdk/intrin_x86.h | 9 +- reactos/include/psdk/winbase.h | 3 +- reactos/include/psdk/winnt.h | 187 ++++++++++++++++++++++++------ 3 files changed, 160 insertions(+), 39 deletions(-) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index f83b9a343e1..6a6226b8f64 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -813,12 +813,19 @@ static __inline__ __attribute__((always_inline)) unsigned short _rotl16(const un } #ifndef __MSVCRT__ -static __inline__ __attribute__((always_inline)) unsigned long _rotl(const unsigned long value, const unsigned char shift) +static __inline__ __attribute__((always_inline)) unsigned long _rotl(const unsigned int value, const unsigned char shift) { unsigned long retval; __asm__("roll %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); return retval; } + +static __inline__ __attribute__((always_inline)) unsigned long _rotr(const unsigned int value, const unsigned char shift) +{ + unsigned long retval; + __asm__("rorl %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); + return retval; +} #endif static __inline__ __attribute__((always_inline)) unsigned char _rotr8(const unsigned char value, const unsigned char shift) diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index ce704694662..6b7315c8495 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -1737,9 +1737,10 @@ VOID WINAPI InitializeSRWLock(PSRWLOCK); #define InterlockedCompareExchange64 _InterlockedCompareExchange64 #define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64 #define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64 - #else +LONG WINAPI InterlockedOr(IN OUT LONG volatile *,LONG); +LONG WINAPI InterlockedAnd(IN OUT LONG volatile *,LONG); LONG WINAPI InterlockedCompareExchange(IN OUT LONG volatile *,LONG,LONG); LONG WINAPI InterlockedDecrement(IN OUT LONG volatile *); LONG WINAPI InterlockedExchange(IN OUT LONG volatile *,LONG); diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 3309be48014..6b2785db203 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -510,8 +510,6 @@ typedef DWORD FLONG; #define THREAD_DIRECT_IMPERSONATION 0x200 #endif #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF) -#define EXCEPTION_NONCONTINUABLE 1 -#define EXCEPTION_MAXIMUM_PARAMETERS 15 /* FIXME: Oh how I wish, I wish the w32api DDK wouldn't include winnt.h... */ #ifndef __NTDDK_H #define MUTANT_QUERY_STATE 0x0001 @@ -2069,16 +2067,28 @@ typedef struct _CONTEXT { BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION]; } CONTEXT; #elif defined(__x86_64__) -#define CONTEXT_AMD64 0x00100000 -#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x0001) -#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x0002) -#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x0004) -#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x0008L) -#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x0010L) + +#define CONTEXT_AMD64 0x100000 + +#if !defined(RC_INVOKED) +#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L) +#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L) +#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L) +#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L) + #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS) +#define CONTEXT_EXCEPTION_ACTIVE 0x8000000 +#define CONTEXT_SERVICE_ACTIVE 0x10000000 +#define CONTEXT_EXCEPTION_REQUEST 0x40000000 +#define CONTEXT_EXCEPTION_REPORTING 0x80000000 +#endif + +#define INITIAL_MXCSR 0x1f80 +#define INITIAL_FPCSR 0x027f #define EXCEPTION_READ_FAULT 0 #define EXCEPTION_WRITE_FAULT 1 #define EXCEPTION_EXECUTE_FAULT 8 @@ -2192,7 +2202,25 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { DWORD64 LastBranchFromRip; DWORD64 LastExceptionToRip; DWORD64 LastExceptionFromRip; -} CONTEXT; +} CONTEXT, *PCONTEXT; + +#define RUNTIME_FUNCTION_INDIRECT 0x1 + + typedef struct _RUNTIME_FUNCTION { + DWORD BeginAddress; + DWORD EndAddress; + DWORD UnwindData; + } RUNTIME_FUNCTION,*PRUNTIME_FUNCTION; + + typedef PRUNTIME_FUNCTION (*PGET_RUNTIME_FUNCTION_CALLBACK)(DWORD64 ControlPc,PVOID Context); + typedef DWORD (*POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK)(HANDLE Process,PVOID TableAddress,PDWORD Entries,PRUNTIME_FUNCTION *Functions); + + #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME "OutOfProcessFunctionTableCallback" + + NTSYSAPI VOID __cdecl RtlRestoreContext (PCONTEXT ContextRecord,struct _EXCEPTION_RECORD *ExceptionRecord); + NTSYSAPI BOOLEAN __cdecl RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable,DWORD EntryCount,DWORD64 BaseAddress); + NTSYSAPI BOOLEAN __cdecl RtlInstallFunctionTableCallback(DWORD64 TableIdentifier,DWORD64 BaseAddress,DWORD Length,PGET_RUNTIME_FUNCTION_CALLBACK Callback,PVOID Context,PCWSTR OutOfProcessCallbackDll); + NTSYSAPI BOOLEAN __cdecl RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable); #elif defined(_PPC_) #define CONTEXT_CONTROL 1L @@ -2681,18 +2709,44 @@ typedef struct _CONTEXT { #error "undefined processor type" #endif typedef CONTEXT *PCONTEXT,*LPCONTEXT; -typedef struct _EXCEPTION_RECORD { - DWORD ExceptionCode; - DWORD ExceptionFlags; - struct _EXCEPTION_RECORD *ExceptionRecord; - PVOID ExceptionAddress; - DWORD NumberParameters; - ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; -} EXCEPTION_RECORD,*PEXCEPTION_RECORD,*LPEXCEPTION_RECORD; -typedef struct _EXCEPTION_POINTERS { - PEXCEPTION_RECORD ExceptionRecord; - PCONTEXT ContextRecord; -} EXCEPTION_POINTERS,*PEXCEPTION_POINTERS,*LPEXCEPTION_POINTERS; + +#define EXCEPTION_NONCONTINUABLE 1 +#define EXCEPTION_MAXIMUM_PARAMETERS 15 + + typedef struct _EXCEPTION_RECORD { + DWORD ExceptionCode; + DWORD ExceptionFlags; + struct _EXCEPTION_RECORD *ExceptionRecord; + PVOID ExceptionAddress; + DWORD NumberParameters; + ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; + } EXCEPTION_RECORD, *PEXCEPTION_RECORD, *LPEXCEPTION_RECORD; + + typedef EXCEPTION_RECORD *PEXCEPTION_RECORD; + + typedef struct _EXCEPTION_RECORD32 { + DWORD ExceptionCode; + DWORD ExceptionFlags; + DWORD ExceptionRecord; + DWORD ExceptionAddress; + DWORD NumberParameters; + DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; + } EXCEPTION_RECORD32,*PEXCEPTION_RECORD32; + + typedef struct _EXCEPTION_RECORD64 { + DWORD ExceptionCode; + DWORD ExceptionFlags; + DWORD64 ExceptionRecord; + DWORD64 ExceptionAddress; + DWORD NumberParameters; + DWORD __unusedAlignment; + DWORD64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; + } EXCEPTION_RECORD64,*PEXCEPTION_RECORD64; + + typedef struct _EXCEPTION_POINTERS { + PEXCEPTION_RECORD ExceptionRecord; + PCONTEXT ContextRecord; + } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS; #ifdef _M_PPC #define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart; @@ -3044,6 +3098,12 @@ RtlCaptureStackBackTrace( OUT PDWORD BackTraceHash OPTIONAL ); +NTSYSAPI +VOID +NTAPI +RtlCaptureContext( + PCONTEXT ContextRecord +); NTSYSAPI PVOID @@ -3498,14 +3558,75 @@ typedef struct _IMAGE_IMPORT_BY_NAME { WORD Hint; BYTE Name[1]; } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME; -typedef struct _IMAGE_THUNK_DATA { - union { - ULONG ForwarderString; - ULONG Function; - DWORD Ordinal; - ULONG AddressOfData; - } u1; -} IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA; +#include "pshpack8.h" +typedef struct _IMAGE_THUNK_DATA64 { + union { + ULONGLONG ForwarderString; + ULONGLONG Function; + ULONGLONG Ordinal; + ULONGLONG AddressOfData; + } u1; +} IMAGE_THUNK_DATA64; +typedef IMAGE_THUNK_DATA64 *PIMAGE_THUNK_DATA64; +#include "poppack.h" + +typedef struct _IMAGE_THUNK_DATA32 { + union { + DWORD ForwarderString; + DWORD Function; + DWORD Ordinal; + DWORD AddressOfData; + } u1; +} IMAGE_THUNK_DATA32; +typedef IMAGE_THUNK_DATA32 *PIMAGE_THUNK_DATA32; + +#define IMAGE_ORDINAL_FLAG64 0x8000000000000000 +#define IMAGE_ORDINAL_FLAG32 0x80000000 +#define IMAGE_ORDINAL64(Ordinal) (Ordinal & 0xffff) +#define IMAGE_ORDINAL32(Ordinal) (Ordinal & 0xffff) +#define IMAGE_SNAP_BY_ORDINAL64(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG64)!=0) +#define IMAGE_SNAP_BY_ORDINAL32(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG32)!=0) + +typedef VOID +(NTAPI *PIMAGE_TLS_CALLBACK)(PVOID DllHandle,DWORD Reason,PVOID Reserved); + +typedef struct _IMAGE_TLS_DIRECTORY64 { + ULONGLONG StartAddressOfRawData; + ULONGLONG EndAddressOfRawData; + ULONGLONG AddressOfIndex; + ULONGLONG AddressOfCallBacks; + DWORD SizeOfZeroFill; + DWORD Characteristics; +} IMAGE_TLS_DIRECTORY64; +typedef IMAGE_TLS_DIRECTORY64 *PIMAGE_TLS_DIRECTORY64; + +typedef struct _IMAGE_TLS_DIRECTORY32 { + DWORD StartAddressOfRawData; + DWORD EndAddressOfRawData; + DWORD AddressOfIndex; + DWORD AddressOfCallBacks; + DWORD SizeOfZeroFill; + DWORD Characteristics; +} IMAGE_TLS_DIRECTORY32; +typedef IMAGE_TLS_DIRECTORY32 *PIMAGE_TLS_DIRECTORY32; +#ifdef _WIN64 +#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG64 +#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL64(Ordinal) +typedef IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA; +typedef PIMAGE_THUNK_DATA64 PIMAGE_THUNK_DATA; +#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL64(Ordinal) +typedef IMAGE_TLS_DIRECTORY64 IMAGE_TLS_DIRECTORY; +typedef PIMAGE_TLS_DIRECTORY64 PIMAGE_TLS_DIRECTORY; +#else +#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG32 +#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL32(Ordinal) +typedef IMAGE_THUNK_DATA32 IMAGE_THUNK_DATA; +typedef PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA; +#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL32(Ordinal) +typedef IMAGE_TLS_DIRECTORY32 IMAGE_TLS_DIRECTORY; +typedef PIMAGE_TLS_DIRECTORY32 PIMAGE_TLS_DIRECTORY; +#endif + typedef struct _IMAGE_IMPORT_DESCRIPTOR { _ANONYMOUS_UNION union { DWORD Characteristics; @@ -3527,14 +3648,6 @@ typedef struct _IMAGE_BOUND_FORWARDER_REF { WORD Reserved; } IMAGE_BOUND_FORWARDER_REF,*PIMAGE_BOUND_FORWARDER_REF; typedef void(NTAPI *PIMAGE_TLS_CALLBACK)(PVOID,DWORD,PVOID); -typedef struct _IMAGE_TLS_DIRECTORY { - DWORD StartAddressOfRawData; - DWORD EndAddressOfRawData; - PDWORD AddressOfIndex; - PIMAGE_TLS_CALLBACK *AddressOfCallBacks; - DWORD SizeOfZeroFill; - DWORD Characteristics; -} IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY; typedef struct _IMAGE_RESOURCE_DIRECTORY { DWORD Characteristics; DWORD TimeDateStamp; From 0f3f9c8bbba0e4aabbfc9e2e706e05d571c6c1b8 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 27 Jul 2008 08:34:16 +0000 Subject: [PATCH 051/388] Remove WINEisms svn path=/branches/ros-amd64-bringup/; revision=34832 --- reactos/include/reactos/wine/port.h | 56 +++-------------------------- 1 file changed, 5 insertions(+), 51 deletions(-) diff --git a/reactos/include/reactos/wine/port.h b/reactos/include/reactos/wine/port.h index d8a89fe2a02..56602d8ba49 100644 --- a/reactos/include/reactos/wine/port.h +++ b/reactos/include/reactos/wine/port.h @@ -328,53 +328,12 @@ extern int spawnvp(int mode, const char *cmdname, const char * const argv[]); #if defined(__i386__) && defined(__GNUC__) && !defined(WINE_PORT_NO_INTERLOCKED) -extern inline long interlocked_cmpxchg( long *dest, long xchg, long compare ) -{ - long ret; - __asm__ __volatile__( "lock; cmpxchgl %2,(%1)" - : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" ); - return ret; -} +#define interlocked_cmpxchg InterlockedCompareExchange +#define interlocked_cmpxchg_ptr InterlockedCompareExchangePtr +#define interlocked_xchg InterlockedExchange +#define interlocked_xchg_ptr InterlockedExchangePtr +#define interlocked_xchg_add InterlockedExchangeAdd -extern inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare ) -{ - void *ret; - __asm__ __volatile__( "lock; cmpxchgl %2,(%1)" - : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" ); - return ret; -} - -extern inline long interlocked_xchg( long *dest, long val ) -{ - long ret; - __asm__ __volatile__( "lock; xchgl %0,(%1)" - : "=r" (ret) : "r" (dest), "0" (val) : "memory" ); - return ret; -} - -extern inline void *interlocked_xchg_ptr( void **dest, void *val ) -{ - void *ret; - __asm__ __volatile__( "lock; xchgl %0,(%1)" - : "=r" (ret) : "r" (dest), "0" (val) : "memory" ); - return ret; -} - -extern inline long interlocked_xchg_add( long *dest, long incr ) -{ - long ret; - __asm__ __volatile__( "lock; xaddl %0,(%1)" - : "=r" (ret) : "r" (dest), "0" (incr) : "memory" ); - return ret; -} - -#else /* __i386___ && __GNUC__ */ - -extern long interlocked_cmpxchg( long *dest, long xchg, long compare ); -extern void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare ); -extern long interlocked_xchg( long *dest, long val ); -extern void *interlocked_xchg_ptr( void **dest, void *val ); -extern long interlocked_xchg_add( long *dest, long incr ); #endif /* __i386___ && __GNUC__ */ @@ -385,11 +344,6 @@ extern long interlocked_xchg_add( long *dest, long incr ); #define getopt_long __WINE_NOT_PORTABLE(getopt_long) #define getopt_long_only __WINE_NOT_PORTABLE(getopt_long_only) #define getpagesize __WINE_NOT_PORTABLE(getpagesize) -#define interlocked_cmpxchg __WINE_NOT_PORTABLE(interlocked_cmpxchg) -#define interlocked_cmpxchg_ptr __WINE_NOT_PORTABLE(interlocked_cmpxchg_ptr) -#define interlocked_xchg __WINE_NOT_PORTABLE(interlocked_xchg) -#define interlocked_xchg_ptr __WINE_NOT_PORTABLE(interlocked_xchg_ptr) -#define interlocked_xchg_add __WINE_NOT_PORTABLE(interlocked_xchg_add) #define lstat __WINE_NOT_PORTABLE(lstat) #define memcpy_unaligned __WINE_NOT_PORTABLE(memcpy_unaligned) #define memmove __WINE_NOT_PORTABLE(memmove) From a452cc9d7456750c9527bf1ad6d3ff5194e9145b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 27 Jul 2008 08:37:14 +0000 Subject: [PATCH 052/388] Remove multiple declarations and minor fixes. Interlocked stuff is still a bit broken. svn path=/branches/ros-amd64-bringup/; revision=34833 --- reactos/include/ddk/winddk.h | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 3a5ce992acb..59a00526db3 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -761,27 +761,6 @@ typedef IO_ALLOCATION_ACTION IN PVOID Context); -typedef struct _EXCEPTION_RECORD32 -{ - NTSTATUS ExceptionCode; - ULONG ExceptionFlags; - ULONG ExceptionRecord; - ULONG ExceptionAddress; - ULONG NumberParameters; - ULONG ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; -} EXCEPTION_RECORD32, *PEXCEPTION_RECORD32; - -typedef struct _EXCEPTION_RECORD64 -{ - NTSTATUS ExceptionCode; - ULONG ExceptionFlags; - ULONG64 ExceptionRecord; - ULONG64 ExceptionAddress; - ULONG NumberParameters; - ULONG __unusedAlignment; - ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; -} EXCEPTION_RECORD64, *PEXCEPTION_RECORD64; - typedef EXCEPTION_DISPOSITION (DDKAPI *PEXCEPTION_ROUTINE)( IN struct _EXCEPTION_RECORD *ExceptionRecord, @@ -5518,6 +5497,12 @@ KeGetCurrentIrql ( VOID ); +NTKERNELAPI +PRKTHREAD +NTAPI +KeGetCurrentThread( + VOID); + #elif defined(__PowerPC__) typedef ULONG PFN_NUMBER, *PPFN_NUMBER; @@ -5748,7 +5733,9 @@ InterlockedExchangeAdd( * IN OUT PVOID VOLATILE *Target, * IN PVOID Value) */ -#if !defined (_M_AMD64) +#if defined (_M_AMD64) +#define InterlockedExchangePointer _InterlockedExchangePointer +#else #define InterlockedExchangePointer(Target, Value) \ ((PVOID) InterlockedExchange((PLONG) Target, (LONG) Value)) #endif @@ -5760,12 +5747,13 @@ InterlockedExchangeAdd( * IN PVOID Exchange, * IN PVOID Comparand) */ -#if !defined (_M_AMD64) +#if defined (_M_AMD64) +#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer +#else #define InterlockedCompareExchangePointer(Destination, Exchange, Comparand) \ ((PVOID) InterlockedCompareExchange((PLONG) Destination, (LONG) Exchange, (LONG) Comparand)) #endif -#if defined (_M_AMD64) #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd((LONG *)a, b) #define InterlockedIncrementSizeT(a) InterlockedIncrement((LONG *)a) #define InterlockedDecrementSizeT(a) InterlockedDecrement((LONG *)a) From b0cad156e2f89d5bc7ab07de649708eb97f14ff1 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 27 Jul 2008 09:02:46 +0000 Subject: [PATCH 053/388] Forgot one. svn path=/branches/ros-amd64-bringup/; revision=34834 --- reactos/include/psdk/intrin_x86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 6a6226b8f64..e30367e44b8 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -813,7 +813,7 @@ static __inline__ __attribute__((always_inline)) unsigned short _rotl16(const un } #ifndef __MSVCRT__ -static __inline__ __attribute__((always_inline)) unsigned long _rotl(const unsigned int value, const unsigned char shift) +static __inline__ __attribute__((always_inline)) unsigned int _rotl(const unsigned int value, const int shift) { unsigned long retval; __asm__("roll %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); From dd368d7cebdfbe14ea7fde71b9380cb999107cc8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 09:07:31 +0000 Subject: [PATCH 054/388] gcc defines _WIN32 for us ... on a 64bit target. hack windef to get rid of it. This fixes zlib. svn path=/branches/ros-amd64-bringup/; revision=34835 --- reactos/include/psdk/windef.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reactos/include/psdk/windef.h b/reactos/include/psdk/windef.h index bd9fcaf69ce..2d44a3ba43f 100644 --- a/reactos/include/psdk/windef.h +++ b/reactos/include/psdk/windef.h @@ -25,12 +25,23 @@ extern "C" { * including windows.h or any other method of including the windef.h header. */ #endif + +#if !defined(WIN64) && !defined(_M_AMD64) && !defined(_M_IA64) #ifndef WIN32 #define WIN32 #endif #ifndef _WIN32 #define _WIN32 #endif +#else // WIN64 +#ifdef WIN32 +#undef WIN32 +#endif +#ifdef _WIN32 +#undef _WIN32 +#endif +#endif // WIN64 + #define FAR #define far #define NEAR From 2d984eac66648cd4a134a3413b361eb390a1366b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 09:15:54 +0000 Subject: [PATCH 055/388] "Interlocked stuff is still a bit broken." ... yeah, cause you broke it ;-) svn path=/branches/ros-amd64-bringup/; revision=34838 --- reactos/include/ddk/winddk.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 59a00526db3..40596ee7685 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5789,8 +5789,6 @@ InterlockedExchangeAdd( #define QueryDepthSList(Head) ExQueryDepthSList(Head) #endif // !defined(_WINBASE_ -#endif // defined (_WIN64) - #endif /* !__INTERLOCKED_DECLARED */ NTKERNELAPI From bf9ee2d42fb9ca01f829981584b3d7a5327988e7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 09:16:49 +0000 Subject: [PATCH 056/388] stub out hal.c, make it compile again svn path=/branches/ros-amd64-bringup/; revision=34839 --- reactos/hal/halamd64/generic/hal.c | 543 ++-------------------------- reactos/hal/halamd64/include/halp.h | 12 +- 2 files changed, 34 insertions(+), 521 deletions(-) diff --git a/reactos/hal/halamd64/generic/hal.c b/reactos/hal/halamd64/generic/hal.c index 82c60f243e6..d72a8b77896 100644 --- a/reactos/hal/halamd64/generic/hal.c +++ b/reactos/hal/halamd64/generic/hal.c @@ -47,22 +47,6 @@ ULONG HalpIrqlTable[HIGH_LEVEL + 1] = 0xFFFF0019, // IRQL 13 0xFFFE0019, // IRQL 14 0xFFFC0019, // IRQL 15 - 0xFFF80019, // IRQL 16 - 0xFFF00019, // IRQL 17 - 0xFFE00019, // IRQL 18 - 0xFFC00019, // IRQL 19 - 0xFF800019, // IRQL 20 - 0xFF000019, // IRQL 21 - 0xFE000019, // IRQL 22 - 0xFC000019, // IRQL 23 - 0xF0000019, // IRQL 24 - 0x80000019, // IRQL 25 - 0x19, // IRQL 26 - 0x18, // IRQL 27 PROFILE_LEVEL - 0x10, // IRQL 28 CLOCK2_LEVEL - 0x00, // IRQL 29 IPI_LEVEL - 0x00, // IRQL 30 POWER_LEVEL - 0x00, // IRQL 31 HIGH_LEVEL }; UCHAR HalpMaskTable[HIGH_LEVEL + 1] = @@ -71,7 +55,7 @@ UCHAR HalpMaskTable[HIGH_LEVEL + 1] = APC_LEVEL, // INT 1 SOFTWARE INTERRUPT DISPATCH_LEVEL,// INT 2 COMM RX IPI_LEVEL, // INT 3 COMM TX - CLOCK2_LEVEL, // INT 4 TIMER 0 + CLOCK_LEVEL, // INT 4 TIMER 0 3, 4, 5, @@ -82,22 +66,7 @@ UCHAR HalpMaskTable[HIGH_LEVEL + 1] = 10, 11, 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 26, - 26 + 13 }; /* FUNCTIONS *****************************************************************/ @@ -146,34 +115,6 @@ HalSetProfileInterval(IN ULONG_PTR Interval) return Interval; } -VOID -FASTCALL -ExAcquireFastMutex( - PFAST_MUTEX FastMutex) -{ - UNIMPLEMENTED; -} - - -VOID -FASTCALL -ExReleaseFastMutex( - PFAST_MUTEX FastMutex) -{ - UNIMPLEMENTED; -} - - -BOOLEAN FASTCALL -ExTryToAcquireFastMutex( - PFAST_MUTEX FastMutex) -{ - UNIMPLEMENTED; - - return TRUE; -} - - NTSTATUS NTAPI HalAdjustResourceList( @@ -482,93 +423,29 @@ HalpGetParameters(IN PLOADER_PARAMETER_BLOCK LoaderBlock) ULONG HalGetInterruptSource(VOID) { - ULONG InterruptStatus; - - // - // Get the interrupt status, and return the highest bit set - // - InterruptStatus = READ_REGISTER_ULONG(VIC_INT_STATUS); - return 31 - _clz(InterruptStatus); + KEBUGCHECK(0); + return 0; } VOID HalpClockInterrupt(VOID) { - // - // Clear the interrupt - // - ASSERT(KeGetCurrentIrql() == CLOCK2_LEVEL); - WRITE_REGISTER_ULONG(TIMER0_INT_CLEAR, 1); - - // - // FIXME: Update HAL Perf counters - // - - // - // FIXME: Check if someone changed the clockrate - // - - // - // Call the kernel - // - KeUpdateSystemTime(KeGetCurrentThread()->TrapFrame, - CLOCK2_LEVEL, - HalpCurrentTimeIncrement); - - // - // We're done - // + KEBUGCHECK(0); + return; } VOID HalpStallInterrupt(VOID) { - // - // Clear the interrupt - // - WRITE_REGISTER_ULONG(TIMER0_INT_CLEAR, 1); + KEBUGCHECK(0); + return; } VOID HalpInitializeInterrupts(VOID) { - PKPCR Pcr = (PKPCR)KeGetPcr(); - ULONG ClockInterval; - SP804_CONTROL_REGISTER ControlRegister; - - // - // Fill out the IRQL mappings - // - RtlCopyMemory(Pcr->IrqlTable, HalpIrqlTable, sizeof(Pcr->IrqlTable)); - RtlCopyMemory(Pcr->IrqlMask, HalpMaskTable, sizeof(Pcr->IrqlMask)); - - // - // Setup the clock and profile interrupt - // - Pcr->InterruptRoutine[CLOCK2_LEVEL] = HalpStallInterrupt; - - // - // Configure the interval to 10ms - // (INTERVAL (10ms) * TIMCLKfreq (1MHz)) - // --------------------------------------- == 10^4 - // (TIMCLKENXdiv (1) * PRESCALEdiv (1)) - // - ClockInterval = 0x2710; - - // - // Configure the timer - // - ControlRegister.AsUlong = 0; - ControlRegister.Wide = TRUE; - ControlRegister.Periodic = TRUE; - ControlRegister.Interrupt = TRUE; - ControlRegister.Enabled = TRUE; - - // - // Enable the timer - // - WRITE_REGISTER_ULONG(TIMER0_LOAD, ClockInterval); - WRITE_REGISTER_ULONG(TIMER0_CONTROL, ControlRegister.AsUlong); + KEBUGCHECK(0); + return; } /* @@ -579,91 +456,8 @@ NTAPI HalInitSystem(IN ULONG BootPhase, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - PKPRCB Prcb = KeGetCurrentPrcb(); - - // - // Check the boot phase - // - if (!BootPhase) - { - // - // Get command-line parameters - // - HalpGetParameters(LoaderBlock); - -#if DBG - // - // Checked HAL requires checked kernel - // - if (!(Prcb->BuildType & PRCB_BUILD_DEBUG)) - { - // - // No match, bugcheck - // - KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 1, 0); - } -#else - // - // Release build requires release HAL - // - if (Prcb->BuildType & PRCB_BUILD_DEBUG) - { - // - // No match, bugcheck - // - KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0); - } -#endif - -#ifdef CONFIG_SMP - // - // SMP HAL requires SMP kernel - // - if (Prcb->BuildType & PRCB_BUILD_UNIPROCESSOR) - { - // - // No match, bugcheck - // - KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0); - } -#endif - - // - // Validate the PRCB - // - if (Prcb->MajorVersion != PRCB_MAJOR_VERSION) - { - // - // Validation failed, bugcheck - // - KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0); - } - - // - // Setup time increments to 10ms and 1ms - // - HalpCurrentTimeIncrement = 100000; - HalpNextTimeIncrement = 100000; - HalpNextIntervalCount = 0; - KeSetTimeIncrement(100000, 10000); - - // - // Initialize interrupts - // - HalpInitializeInterrupts(); - } - else if (BootPhase == 1) - { - // - // Switch to real clock interrupt - // - PCR->InterruptRoutine[CLOCK2_LEVEL] = HalpClockInterrupt; - } - - // - // All done, return - // - return TRUE; + KEBUGCHECK(0); + return; } @@ -704,23 +498,7 @@ BOOLEAN NTAPI HalQueryRealTimeClock(IN PTIME_FIELDS Time) { - LARGE_INTEGER LargeTime; - ULONG Seconds; - - // - // Query the RTC value - // - Seconds = READ_REGISTER_ULONG(RTC_DATA); - - // - // Convert to time - // - RtlSecondsSince1970ToTime(Seconds, &LargeTime); - - // - // Convert to time-fields - // - RtlTimeToTimeFields(&LargeTime, Time); + KEBUGCHECK(0); return TRUE; } @@ -746,7 +524,7 @@ HalReportResourceUsage(VOID) VOID NTAPI HalRequestIpi( - ULONG Unknown) + KAFFINITY TargetSet) { UNIMPLEMENTED; } @@ -756,20 +534,16 @@ VOID FASTCALL HalRequestSoftwareInterrupt(IN KIRQL Request) { - // - // Force a software interrupt - // - WRITE_REGISTER_ULONG(VIC_SOFT_INT, 1 << Request); + KEBUGCHECK(0); + return; } VOID FASTCALL HalClearSoftwareInterrupt(IN KIRQL Request) { - // - // Clear a software interrupt - // - WRITE_REGISTER_ULONG(VIC_SOFT_INT_CLEAR, 1 << Request); + KEBUGCHECK(0); + return; } VOID @@ -1024,245 +798,27 @@ VOID NTAPI KeStallExecutionProcessor(IN ULONG Microseconds) { - SP804_CONTROL_REGISTER ControlRegister; - - // - // Enable the timer - // - WRITE_REGISTER_ULONG(TIMER1_LOAD, Microseconds); - - // - // Configure the timer - // - ControlRegister.AsUlong = 0; - ControlRegister.OneShot = TRUE; - ControlRegister.Wide = TRUE; - ControlRegister.Periodic = TRUE; - ControlRegister.Enabled = TRUE; - WRITE_REGISTER_ULONG(TIMER1_CONTROL, ControlRegister.AsUlong); - - // - // Now we will loop until the timer reached 0 - // - while (READ_REGISTER_ULONG(TIMER1_VALUE)); + UNIMPLEMENTED; + return; } VOID FASTCALL KfLowerIrql(IN KIRQL NewIrql) { - ULONG InterruptMask; - ARM_STATUS_REGISTER Flags; - PKPCR Pcr = (PKPCR)KeGetPcr(); - - // - // Validate the new IRQL - // - Flags = KeArmStatusRegisterGet(); - _disable(); - ASSERT(NewIrql <= Pcr->CurrentIrql); - - // - // IRQLs are internally 8 bits - // - NewIrql &= 0xFF; - - // - // Setup the interrupt mask for this IRQL - // - InterruptMask = KeGetPcr()->IrqlTable[NewIrql]; -// DPRINT1("[LOWER] IRQL: %d InterruptMask: %lx\n", NewIrql, InterruptMask); - - // - // Clear interrupts associated to the old IRQL - // - WRITE_REGISTER_ULONG(VIC_INT_CLEAR, 0xFFFFFFFF); - - // - // Set the new interrupt mask - // PL190 VIC support only for now - // - WRITE_REGISTER_ULONG(VIC_INT_ENABLE, InterruptMask); - - // - // Save the new IRQL - // - Pcr->CurrentIrql = NewIrql; - if (!Flags.IrqDisable) _enable(); + UNIMPLEMENTED; + return; } KIRQL FASTCALL KfRaiseIrql(IN KIRQL NewIrql) -{ - KIRQL OldIrql; - ULONG InterruptMask; - ARM_STATUS_REGISTER Flags; - PKPCR Pcr = (PKPCR)KeGetPcr(); - - // - // Save the current IRQL - // - Flags = KeArmStatusRegisterGet(); - _disable(); - OldIrql = Pcr->CurrentIrql; - - // - // IRQLs are internally 8 bits - // - NewIrql &= 0xFF; - - // - // Setup the interrupt mask for this IRQL - // - InterruptMask = KeGetPcr()->IrqlTable[NewIrql]; - // DPRINT1("[RAISE] IRQL: %d InterruptMask: %lx\n", NewIrql, InterruptMask); - ASSERT(NewIrql >= OldIrql); - - // - // Clear interrupts associated to the old IRQL - // - WRITE_REGISTER_ULONG(VIC_INT_CLEAR, 0xFFFFFFFF); - - // - // Set the new interrupt mask - // PL190 VIC support only for now - // - WRITE_REGISTER_ULONG(VIC_INT_ENABLE, InterruptMask); - - // - // Save the new IRQL - // - Pcr->CurrentIrql = NewIrql; - if (!Flags.IrqDisable) _enable(); - return OldIrql; -} - -VOID -NTAPI -READ_PORT_BUFFER_UCHAR( - PUCHAR Port, - PUCHAR Buffer, - ULONG Count) { UNIMPLEMENTED; + return; } -VOID -NTAPI -READ_PORT_BUFFER_ULONG( - PULONG Port, - PULONG Buffer, - ULONG Count) -{ - UNIMPLEMENTED; -} - - -VOID -NTAPI -READ_PORT_BUFFER_USHORT( - PUSHORT Port, - PUSHORT Buffer, - ULONG Count) -{ - UNIMPLEMENTED; -} - - -UCHAR -NTAPI -READ_PORT_UCHAR( - PUCHAR Port) -{ - UNIMPLEMENTED; - - return 0; -} - - -ULONG -NTAPI -READ_PORT_ULONG( - PULONG Port) -{ - UNIMPLEMENTED; - - return 0; -} - - -USHORT -NTAPI -READ_PORT_USHORT( - PUSHORT Port) -{ - UNIMPLEMENTED; - - return 0; -} - - -VOID -NTAPI -WRITE_PORT_BUFFER_UCHAR( - PUCHAR Port, - PUCHAR Buffer, - ULONG Count) -{ - UNIMPLEMENTED; -} - - -VOID -NTAPI -WRITE_PORT_BUFFER_USHORT( - PUSHORT Port, - PUSHORT Buffer, - ULONG Count) -{ - UNIMPLEMENTED; -} - - -VOID -NTAPI -WRITE_PORT_BUFFER_ULONG( - PULONG Port, - PULONG Buffer, - ULONG Count) -{ - UNIMPLEMENTED; -} - - -VOID -NTAPI -WRITE_PORT_UCHAR( - PUCHAR Port, - UCHAR Value) -{ - UNIMPLEMENTED; -} - -VOID -NTAPI -WRITE_PORT_ULONG( - PULONG Port, - ULONG Value) -{ - UNIMPLEMENTED; -} - -VOID -NTAPI -WRITE_PORT_USHORT( - PUSHORT Port, - USHORT Value) -{ - UNIMPLEMENTED; -} KIRQL KeRaiseIrqlToDpcLevel(VOID) @@ -1288,59 +844,22 @@ BOOLEAN HalpTestCleanSupported; VOID HalpIdentifyProcessor(VOID) { - ARM_ID_CODE_REGISTER IdRegister; - - // - // Don't do it again - // - HalpProcessorIdentified = TRUE; - - // - // Read the ID Code - // - IdRegister = KeArmIdCodeRegisterGet(); - - // - // Architecture "6" CPUs support test-and-clean (926EJ-S and 1026EJ-S) - // - HalpTestCleanSupported = (IdRegister.Architecture == 6); + UNIMPLEMENTED; + return; } VOID HalSweepDcache(VOID) { - // - // We get called very early on, before HalInitSystem or any of the Hal* - // processor routines, so we need to figure out what CPU we're on. - // - if (!HalpProcessorIdentified) HalpIdentifyProcessor(); - - // - // Check if we can do it the ARMv5TE-J way - // - if (HalpTestCleanSupported) - { - // - // Test, clean, flush D-Cache - // - __asm__ __volatile__ ("1: mrc p15, 0, pc, c7, c14, 3; bne 1b"); - } - else - { - // - // We need to do it it by set/way - // - UNIMPLEMENTED; - } + UNIMPLEMENTED; + return; } VOID HalSweepIcache(VOID) { - // - // All ARM cores support the same Icache flush command, no need for HAL work - // - KeArmFlushIcache(); + UNIMPLEMENTED; + return; } /* @@ -1351,8 +870,8 @@ KIRQL NTAPI KeGetCurrentIrql(VOID) { - /* Return IRQL */ - return PCR->CurrentIrql; + UNIMPLEMENTED; + return; } /* diff --git a/reactos/hal/halamd64/include/halp.h b/reactos/hal/halamd64/include/halp.h index 2351b9e5699..9428bbd370c 100644 --- a/reactos/hal/halamd64/include/halp.h +++ b/reactos/hal/halamd64/include/halp.h @@ -2,17 +2,11 @@ #define __INTERNAL_HAL_HAL_H // -// ARM Headers +// amd64 Headers // -#include -#include +#include +#include -// -// Versatile Peripherals -// -#include -#include -#include // // WDK Hack From 247137a05ec0fc6f3c32de66548b32f931fa3302 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 27 Jul 2008 09:45:59 +0000 Subject: [PATCH 057/388] revert r34835: "_WIN32 Defined for applications for Win32 and Win64. Always defined." http://msdn.microsoft.com/en-us/library/b0084kay.aspx winnt.h: Define KNONVOLATILE_CONTEXT_POINTERS, EXCEPTION_DISPOSITION, RtlVirtualUnwind svn path=/branches/ros-amd64-bringup/; revision=34840 --- reactos/include/psdk/windef.h | 11 ---- reactos/include/psdk/winnt.h | 101 ++++++++++++++++++++++++++++++++-- 2 files changed, 97 insertions(+), 15 deletions(-) diff --git a/reactos/include/psdk/windef.h b/reactos/include/psdk/windef.h index 2d44a3ba43f..bd9fcaf69ce 100644 --- a/reactos/include/psdk/windef.h +++ b/reactos/include/psdk/windef.h @@ -25,23 +25,12 @@ extern "C" { * including windows.h or any other method of including the windef.h header. */ #endif - -#if !defined(WIN64) && !defined(_M_AMD64) && !defined(_M_IA64) #ifndef WIN32 #define WIN32 #endif #ifndef _WIN32 #define _WIN32 #endif -#else // WIN64 -#ifdef WIN32 -#undef WIN32 -#endif -#ifdef _WIN32 -#undef _WIN32 -#endif -#endif // WIN64 - #define FAR #define far #define NEAR diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 6b2785db203..2912ebe4d4f 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -2204,6 +2204,65 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { DWORD64 LastExceptionFromRip; } CONTEXT, *PCONTEXT; + +typedef struct _KNONVOLATILE_CONTEXT_POINTERS { + union { + PM128A FloatingContext[16]; + struct { + PM128A Xmm0; + PM128A Xmm1; + PM128A Xmm2; + PM128A Xmm3; + PM128A Xmm4; + PM128A Xmm5; + PM128A Xmm6; + PM128A Xmm7; + PM128A Xmm8; + PM128A Xmm9; + PM128A Xmm10; + PM128A Xmm11; + PM128A Xmm12; + PM128A Xmm13; + PM128A Xmm14; + PM128A Xmm15; + }; + }; + + union { + PULONG64 IntegerContext[16]; + struct { + PULONG64 Rax; + PULONG64 Rcx; + PULONG64 Rdx; + PULONG64 Rbx; + PULONG64 Rsp; + PULONG64 Rbp; + PULONG64 Rsi; + PULONG64 Rdi; + PULONG64 R8; + PULONG64 R9; + PULONG64 R10; + PULONG64 R11; + PULONG64 R12; + PULONG64 R13; + PULONG64 R14; + PULONG64 R15; + }; + }; +} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; + +typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) ( + IN struct _EXCEPTION_RECORD *ExceptionRecord, + IN PVOID EstablisherFrame, + IN OUT struct _CONTEXT *ContextRecord, + IN OUT PVOID DispatcherContext + ); + +#define UNW_FLAG_NHANDLER 0x0 /* No handler. */ +#define UNW_FLAG_EHANDLER 0x1 /* Exception handler should be called */ +#define UNW_FLAG_UHANDLER 0x2 /* Termination handler that should be called when unwinding an exception */ +#define UNW_FLAG_CHAININFO 0x4 /* FunctionEntry member is the contents of a previous function table entry */ + #define RUNTIME_FUNCTION_INDIRECT 0x1 typedef struct _RUNTIME_FUNCTION { @@ -2217,10 +2276,44 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME "OutOfProcessFunctionTableCallback" - NTSYSAPI VOID __cdecl RtlRestoreContext (PCONTEXT ContextRecord,struct _EXCEPTION_RECORD *ExceptionRecord); - NTSYSAPI BOOLEAN __cdecl RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable,DWORD EntryCount,DWORD64 BaseAddress); - NTSYSAPI BOOLEAN __cdecl RtlInstallFunctionTableCallback(DWORD64 TableIdentifier,DWORD64 BaseAddress,DWORD Length,PGET_RUNTIME_FUNCTION_CALLBACK Callback,PVOID Context,PCWSTR OutOfProcessCallbackDll); - NTSYSAPI BOOLEAN __cdecl RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable); +NTSYSAPI +VOID +__cdecl +RtlRestoreContext(PCONTEXT ContextRecord, + struct _EXCEPTION_RECORD *ExceptionRecord); + +NTSYSAPI +BOOLEAN +__cdecl +RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable, + DWORD EntryCount, + DWORD64 BaseAddress); + +NTSYSAPI +BOOLEAN +__cdecl +RtlInstallFunctionTableCallback(DWORD64 TableIdentifier, + DWORD64 BaseAddress, + DWORD Length, + PGET_RUNTIME_FUNCTION_CALLBACK Callback, + PVOID Context, + PCWSTR OutOfProcessCallbackDll); + +NTSYSAPI +BOOLEAN +__cdecl +RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable); + +PEXCEPTION_ROUTINE +WINAPI +RtlVirtualUnwind (IN ULONG HandlerType, + IN ULONG64 ImageBase, + IN ULONG64 ControlPc, + IN PRUNTIME_FUNCTION FunctionEntry, + IN OUT PCONTEXT ContextRecord, + OUT PVOID *HandlerData, + OUT PULONG64 EstablisherFrame, + IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL); #elif defined(_PPC_) #define CONTEXT_CONTROL 1L From 0b3b92a413cb47d2a564ed552df855d83187cb31 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 11:11:02 +0000 Subject: [PATCH 058/388] - fix KESEG0_BASE svn path=/branches/ros-amd64-bringup/; revision=34842 --- reactos/include/ndk/amd64/ketypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 1551306394c..b48f1578b91 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -131,7 +131,7 @@ Author: // // Static Kernel-Mode Address start (use MM_KSEG0_BASE for actual) // -#define KSEG0_BASE 0x80000000 +#define KSEG0_BASE 0xffff080000000000ULL // // Synchronization-level IRQL From 2ee5f08ce94258a0adda629d0c6f8e8e011e7143 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 11:41:11 +0000 Subject: [PATCH 059/388] LdrPEGetExportByName: The function and name table in the PE consists of RVA's that are stored in ULONGs. Change pointers accordingly PULONG* -> ULONG* svn path=/branches/ros-amd64-bringup/; revision=34843 --- reactos/boot/freeldr/freeldr/reactos/imageldr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/reactos/imageldr.c b/reactos/boot/freeldr/freeldr/reactos/imageldr.c index 7bdbd1e51e7..9aed1ed8e2d 100644 --- a/reactos/boot/freeldr/freeldr/reactos/imageldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/imageldr.c @@ -231,8 +231,8 @@ LdrPEGetExportByName(PVOID BaseAddress, USHORT Hint) { PIMAGE_EXPORT_DIRECTORY ExportDir; - PULONG * ExFunctions; - PULONG * ExNames; + ULONG * ExFunctions; + ULONG * ExNames; USHORT * ExOrdinals; PVOID ExName; ULONG Ordinal; @@ -267,10 +267,10 @@ LdrPEGetExportByName(PVOID BaseAddress, /* * Get header pointers */ - ExNames = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfNames); + ExNames = (ULONG *)RVA(BaseAddress, ExportDir->AddressOfNames); ExOrdinals = (USHORT *)RVA(BaseAddress, ExportDir->AddressOfNameOrdinals); - ExFunctions = (PULONG *)RVA(BaseAddress, ExportDir->AddressOfFunctions); - + ExFunctions = (ULONG *)RVA(BaseAddress, ExportDir->AddressOfFunctions); + /* * Check the hint first */ From ddf3f934ad55f43688f7c5a94931b090a35f720c Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 27 Jul 2008 13:42:46 +0000 Subject: [PATCH 060/388] Fix Build. svn path=/branches/ros-amd64-bringup/; revision=34845 --- reactos/include/psdk/winnt.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 2912ebe4d4f..96f067c3476 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -2251,13 +2251,6 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS { }; } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; -typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) ( - IN struct _EXCEPTION_RECORD *ExceptionRecord, - IN PVOID EstablisherFrame, - IN OUT struct _CONTEXT *ContextRecord, - IN OUT PVOID DispatcherContext - ); - #define UNW_FLAG_NHANDLER 0x0 /* No handler. */ #define UNW_FLAG_EHANDLER 0x1 /* Exception handler should be called */ #define UNW_FLAG_UHANDLER 0x2 /* Termination handler that should be called when unwinding an exception */ @@ -2304,17 +2297,6 @@ BOOLEAN __cdecl RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable); -PEXCEPTION_ROUTINE -WINAPI -RtlVirtualUnwind (IN ULONG HandlerType, - IN ULONG64 ImageBase, - IN ULONG64 ControlPc, - IN PRUNTIME_FUNCTION FunctionEntry, - IN OUT PCONTEXT ContextRecord, - OUT PVOID *HandlerData, - OUT PULONG64 EstablisherFrame, - IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL); - #elif defined(_PPC_) #define CONTEXT_CONTROL 1L #define CONTEXT_FLOATING_POINT 2L From 1ccf8a45fa05e51ebf636f6103bcdf2dbf170be8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 21:33:32 +0000 Subject: [PATCH 061/388] advapi32: fix a forwarded export that got stubbed when changing to spec svn path=/branches/ros-amd64-bringup/; revision=34861 --- reactos/dll/win32/advapi32/advapi32.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/advapi32/advapi32.spec b/reactos/dll/win32/advapi32/advapi32.spec index ca87a083f65..39c090cd1d7 100644 --- a/reactos/dll/win32/advapi32/advapi32.spec +++ b/reactos/dll/win32/advapi32/advapi32.spec @@ -415,7 +415,7 @@ @ stub MakeAbsoluteSD2 @ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall MakeSelfRelativeSD(ptr ptr ptr) - @ stub MapGenericMask #(ptr ptr) + @ stdcall MapGenericMask (ptr ptr) NTDLL.RtlMapGenericMask @ stdcall NotifyBootConfigStatus(long) @ stdcall NotifyChangeEventLog (long long) @ stdcall ObjectCloseAuditAlarmA(str ptr long) From a3869c4bceb0561ab36a68e1bd52d79268f29f42 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 22:05:13 +0000 Subject: [PATCH 062/388] yet another advapi32 fix svn path=/branches/ros-amd64-bringup/; revision=34862 --- reactos/dll/win32/advapi32/advapi32.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/advapi32/advapi32.spec b/reactos/dll/win32/advapi32/advapi32.spec index 39c090cd1d7..1ccf85c4338 100644 --- a/reactos/dll/win32/advapi32/advapi32.spec +++ b/reactos/dll/win32/advapi32/advapi32.spec @@ -224,7 +224,7 @@ @ stub FlushTraceW @ stub FreeEncryptedFileKeyInfo @ stub FreeEncryptionCertificateHashList - @ stub FreeInheritedFromArray + @ stdcall FreeInheritedFromArray(ptr long ptr) @ stdcall FreeSid(ptr) @ stub GetAccessPermissionsForObjectA @ stub GetAccessPermissionsForObjectW @@ -244,7 +244,7 @@ @ stub GetInformationCodeAuthzLevelW @ stub GetInformationCodeAuthzPolicyW @ stub GetInheritanceSourceA - @ stub GetInheritanceSourceW + @ stdcall GetInheritanceSourceW (ptr long long long ptr long ptr ptr ptr ptr) @ stdcall GetKernelObjectSecurity(long long ptr long ptr) @ stdcall GetLengthSid(ptr) @ stub GetLocalManagedApplicationData From 013fff101d26a2df79c15419d24e6b78c7ddfa7d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 22:07:36 +0000 Subject: [PATCH 063/388] put back rbuild files in a proper state, so x86 can be compiled again (as soon as someone fixed Interlocked stuff) svn path=/branches/ros-amd64-bringup/; revision=34863 --- reactos/ReactOS-amd64.rbuild | 15 +- reactos/lib/drivers/directory.rbuild | 2 - reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 471 +++++++++++++++++++++ reactos/ntoskrnl/ntoskrnl-generic.rbuild | 61 ++- 4 files changed, 512 insertions(+), 37 deletions(-) create mode 100644 reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index df67904061c..44859b4c579 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -104,6 +104,19 @@ + + + + + + + + + + + + + @@ -123,7 +136,7 @@ - + diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild new file mode 100644 index 00000000000..5dd58a8fb2a --- /dev/null +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -0,0 +1,471 @@ + + + + + + + + + + + + + + + + + + + . + include + + include + include/internal + include/reactos/drivers + csq + hal + pseh + cmlib + rtl + rossym + libcntpr + kdcom + bootvid + wdmguid + bugcodes + + ntoskrnl.h + + amd64stubs.c + + + + boot.S + abios.c + cpu.c + ctxswitch.S + exp.c + irqobj.c + kiinit.c + ldt.c + mtrr.c + patpge.c + systimer.S + thrdini.c + trap.s + usercall_asm.S + usercall.c + v86vdm.c + v86m_sup.S + + + + + boot.s + cpu.c + ctxswtch.s + exp.c + kiinit.c + stubs_asm.s + thrdini.c + time.c + trap.s + trapc.c + usercall.c + + + + + main_asm.S + cpu.c + exp.c + kiinit.c + ppc_irq.c + stubs.c + systimer.c + thrdini.c + ctxswitch.c + ctxhelp.S + + + + + boot.S + kiinit.c + + + apc.c + balmgr.c + + clock.c + config.c + devqueue.c + dpc.c + eventobj.c + except.c + freeldr.c + gate.c + gmutex.c + ipi.c + krnlinit.c + mutex.c + procobj.c + profobj.c + queue.c + semphobj.c + spinlock.c + thrdschd.c + thrdobj.c + timerobj.c + wait.c + + + cacheman.c + copy.c + fs.c + mdl.c + pin.c + view.c + + + + + cmhardwr.c + + + + + cmhardwr.c + + + + + cmhardwr.c + + + cmalloc.c + cmapi.c + cmboot.c + cmcheck.c + cmcontrl.c + cmconfig.c + cmdata.c + cmdelay.c + cmindex.c + cminit.c + cmhook.c + cmkcbncb.c + cmkeydel.c + cmlazy.c + cmmapvw.c + cmname.c + cmparse.c + cmse.c + cmsecach.c + cmsysini.c + cmvalue.c + cmvalche.c + cmwraprs.c + ntapi.c + + + dbgkutil.c + + + + zw.S + + + + + interlck_asm.S + fastinterlck_asm.S + ioport.S + + + atom.c + callback.c + dbgctrl.c + efi.c + + evtpair.c + exintrin.c + fastinterlck.c + fmutex.c + handle.c + harderr.c + hdlsterm.c + init.c + keyedevt.c + locale.c + + + pushlock.c + profile.c + resource.c + rundown.c + + shutdown.c + + time.c + + uuid.c + win32k.c + work.c + xipdisp.c + zone.c + + + dbcsname.c + fastio.c + faulttol.c + filelock.c + filter.c + filtrctx.c + fsfilter.c + fsrtlpc.c + largemcb.c + name.c + notify.c + oplock.c + pnp.c + stackovf.c + tunnel.c + unc.c + + + disksup.c + fstubex.c + halstub.c + + + inbv.c + + + + adapter.c + arcname.c + bootlog.c + controller.c + device.c + deviface.c + driver.c + drvrlist.c + error.c + file.c + + ioevent.c + iofunc.c + iomdl.c + iomgr.c + iorsrce.c + iotimer.c + iowork.c + irp.c + irq.c + ramdisk.c + rawfs.c + remlock.c + + symlink.c + volume.c + + + plugplay.c + pnpdma.c + pnpmgr.c + pnpnotify.c + pnpreport.c + pnproot.c + + + + + + + + + i386-dis.c + kdb_help.S + longjmp.S + setjmp.S + + + + + + + + kdb_expr.c + kdb_keyboard.c + kdb_serial.c + + + kdb_symbols.c + + + + + bochs.c + + gdbstub.c + + + gdbstub_powerpc.c + + kdbg.c + + kdinit.c + kdio.c + kdmain.c + + + + + kdapi.c + kdbreak.c + kddata.c + kdinit.c + kdlock.c + kdprint.c + kdtrap.c + + + + close.c + complete.c + connect.c + create.c + listen.c + port.c + reply.c + send.c + + + + + page.c + + + + + stubs.c + + + + + pfault.c + page.c + + + anonmem.c + aspace.c + balance.c + + drvlck.c + freelist.c + + kmap.c + marea.c + + + + mpw.c + + npool.c + pagefile.c + pageop.c + pager.c + pagfault.c + paging.c + pe.c + physical.c + + ppool.c + + + rmap.c + + sysldr.c + verifier.c + + wset.c + + elf32.c + elf64.c + + + + obdir.c + obinit.c + obhandle.c + obname.c + oblife.c + obref.c + obsdcach.c + obsecure.c + oblink.c + obwait.c + + + power.c + events.c + + + + + psctx.c + + + + + psctx.c + + + debug.c + job.c + kill.c + psnotify.c + process.c + psmgr.c + query.c + quota.c + security.c + state.c + + + + + + + rtlexcpt.c + + + + misc.c + strtok.c + + + access.c + acl.c + audit.c + lsa.c + priv.c + sd.c + semgr.c + sid.c + + + + + vdmmain.c + vdmexec.c + + + + wmi.c + + ntoskrnl.rc + ntoskrnl_$(ARCH).lnk + + diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index 829668d818b..7d9a3b16940 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -36,7 +36,6 @@ ntoskrnl.h - amd64stubs.c @@ -88,15 +87,9 @@ ctxhelp.S - - - boot.S - kiinit.c - - apc.c balmgr.c - + bug.c clock.c config.c devqueue.c @@ -170,7 +163,7 @@ dbgkutil.c - + dbgkobj.c zw.S @@ -187,7 +180,7 @@ callback.c dbgctrl.c efi.c - + event.c evtpair.c exintrin.c fastinterlck.c @@ -198,17 +191,17 @@ init.c keyedevt.c locale.c - - + lookas.c + mutant.c pushlock.c profile.c resource.c rundown.c - + sem.c shutdown.c - + sysinfo.c time.c - + timer.c uuid.c win32k.c work.c @@ -253,7 +246,7 @@ drvrlist.c error.c file.c - + iocomp.c ioevent.c iofunc.c iomdl.c @@ -266,7 +259,7 @@ ramdisk.c rawfs.c remlock.c - + util.c symlink.c volume.c @@ -294,8 +287,8 @@ - - + kdb.c + kdb_cli.c kdb_expr.c kdb_keyboard.c kdb_serial.c @@ -361,17 +354,17 @@ anonmem.c aspace.c balance.c - + cont.c drvlck.c freelist.c - + iospace.c kmap.c marea.c - - - + mdlsup.c + mm.c + mminit.c mpw.c - + ncache.c npool.c pagefile.c pageop.c @@ -380,15 +373,15 @@ paging.c pe.c physical.c - + pool.c ppool.c - - + procsup.c + region.c rmap.c - + section.c sysldr.c verifier.c - + virtual.c wset.c elf32.c @@ -432,8 +425,8 @@ quota.c security.c state.c - - + thread.c + win32.c @@ -441,7 +434,7 @@ rtlexcpt.c - + libsupp.c misc.c strtok.c @@ -454,7 +447,7 @@ sd.c semgr.c sid.c - + token.c From 30ee8afdc4dc700433b21d5db95d93cbdcd28372 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 22:20:01 +0000 Subject: [PATCH 064/388] fix some ULONG to pointer casts svn path=/branches/ros-amd64-bringup/; revision=34864 --- reactos/drivers/network/ndis/ndis/io.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/drivers/network/ndis/ndis/io.c b/reactos/drivers/network/ndis/ndis/io.c index 439529e3f54..554be0fca3d 100644 --- a/reactos/drivers/network/ndis/ndis/io.c +++ b/reactos/drivers/network/ndis/ndis/io.c @@ -133,7 +133,7 @@ NdisImmediateReadPortUchar( OUT PUCHAR Data) { NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - *Data = READ_PORT_UCHAR((PUCHAR)Port); // FIXME: What to do with WrapperConfigurationContext? + *Data = READ_PORT_UCHAR(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext? } @@ -148,7 +148,7 @@ NdisImmediateReadPortUlong( OUT PULONG Data) { NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - *Data = READ_PORT_ULONG((PULONG)Port); // FIXME: What to do with WrapperConfigurationContext? + *Data = READ_PORT_ULONG(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext? } @@ -163,7 +163,7 @@ NdisImmediateReadPortUshort( OUT PUSHORT Data) { NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - *Data = READ_PORT_USHORT((PUSHORT)Port); // FIXME: What to do with WrapperConfigurationContext? + *Data = READ_PORT_USHORT(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext? } @@ -178,7 +178,7 @@ NdisImmediateWritePortUchar( IN UCHAR Data) { NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - WRITE_PORT_UCHAR((PUCHAR)Port, Data); // FIXME: What to do with WrapperConfigurationContext? + WRITE_PORT_UCHAR(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext? } @@ -193,7 +193,7 @@ NdisImmediateWritePortUlong( IN ULONG Data) { NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - WRITE_PORT_ULONG((PULONG)Port, Data); // FIXME: What to do with WrapperConfigurationContext? + WRITE_PORT_ULONG(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext? } @@ -208,7 +208,7 @@ NdisImmediateWritePortUshort( IN USHORT Data) { NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - WRITE_PORT_USHORT((PUSHORT)Port, Data); // FIXME: What to do with WrapperConfigurationContext? + WRITE_PORT_USHORT(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext? } From 8c8c4622d14aed7a50376f149bd59477466c0c21 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 22:43:41 +0000 Subject: [PATCH 065/388] give ndis it's own def file for amd64, yes that breaks arm build... :-@ svn path=/branches/ros-amd64-bringup/; revision=34866 --- reactos/drivers/network/ndis/ndis-amd64.def | 273 ++++++++++++++++++ .../network/ndis/{ndis.def => ndis-i386.def} | 0 reactos/drivers/network/ndis/ndis.rbuild | 2 +- 3 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 reactos/drivers/network/ndis/ndis-amd64.def rename reactos/drivers/network/ndis/{ndis.def => ndis-i386.def} (100%) diff --git a/reactos/drivers/network/ndis/ndis-amd64.def b/reactos/drivers/network/ndis/ndis-amd64.def new file mode 100644 index 00000000000..96afc3da179 --- /dev/null +++ b/reactos/drivers/network/ndis/ndis-amd64.def @@ -0,0 +1,273 @@ +; NDIS Kernel Module - ReactOS Operating System + +LIBRARY NDIS.SYS + +EXPORTS +ArcFilterDprIndicateReceive +ArcFilterDprIndicateReceiveComplete +EthFilterDprIndicateReceive +EthFilterDprIndicateReceiveComplete +FddiFilterDprIndicateReceive +FddiFilterDprIndicateReceiveComplete +NDIS_BUFFER_TO_SPAN_PAGES +NdisAcquireReadWriteLock +NdisAcquireSpinLock +NdisAdjustBufferLength +NdisAllocateBuffer +NdisAllocateBufferPool +NdisAllocateDmaChannel +NdisAllocateMemory +NdisAllocateMemoryWithTag +NdisAllocatePacket +NdisAllocatePacketPool +NdisAllocatePacketPoolEx +NdisAllocateSharedMemory +NdisAllocateSpinLock +NdisAnsiStringToUnicodeString +NdisBufferLength +NdisBufferVirtualAddress +NdisCancelTimer +NdisClAddParty +NdisClCloseAddressFamily +NdisClCloseCall +NdisClDeregisterSap +NdisClDropParty +NdisClIncomingCallComplete +NdisClMakeCall +NdisClModifyCallQoS +NdisClOpenAddressFamily +NdisClRegisterSap +NdisCloseAdapter +NdisCloseConfiguration +NdisCloseFile +NdisCmActivateVc +NdisCmAddPartyComplete +NdisCmCloseAddressFamilyComplete +NdisCmCloseCallComplete +NdisCmDeactivateVc +NdisCmDeregisterSapComplete +NdisCmDispatchCallConnected +NdisCmDispatchIncomingCall +NdisCmDispatchIncomingCallQoSChange +NdisCmDispatchIncomingCloseCall +NdisCmDispatchIncomingDropParty +NdisCmDropPartyComplete +NdisCmMakeCallComplete +NdisCmModifyCallQoSComplete +NdisCmOpenAddressFamilyComplete +NdisCmRegisterAddressFamily +NdisCmRegisterSapComplete +NdisCoCreateVc +NdisCoDeleteVc +NdisCoRequest +NdisCoRequestComplete +NdisCoSendPackets +;NdisCompareAnsiString ? +;NdisCompareUnicodeString ? +NdisCompleteBindAdapter +NdisCompleteCloseAdapter +NdisCompleteDmaTransfer +NdisCompleteOpenAdapter +NdisCompletePnPEvent +NdisCompleteQueryStatistics +NdisCompleteUnbindAdapter +NdisConvertStringToAtmAddress +NdisCopyBuffer +NdisCopyFromPacketToPacket +NdisDeregisterAdapter +NdisDeregisterAdapterShutdownHandler +NdisDeregisterMac +NdisDeregisterProtocol +NdisDprAcquireSpinLock +NdisDprAllocatePacket +NdisDprAllocatePacketNonInterlocked +NdisDprFreePacket +NdisDprFreePacketNonInterlocked +NdisDprReleaseSpinLock +NdisEqualString +NdisFreeBuffer +NdisFreeBufferPool +NdisFreeDmaChannel +NdisFreeMemory +NdisFreePacket +NdisFreePacketPool +NdisFreeSharedMemory +NdisFreeSpinLock +NdisGetBufferPhysicalArraySize +NdisGetCurrentProcessorCounts +NdisGetCurrentProcessorCpuUsage +NdisGetCurrentSystemTime +NdisGetDriverHandle +NdisGetFirstBufferFromPacket +NdisGetReceivedPacket +NdisGetSystemUpTime +NdisIMAssociateMiniport +NdisIMCancelInitializeDeviceInstance +NdisIMCopySendCompletePerPacketInfo +NdisIMCopySendPerPacketInfo +NdisIMDeInitializeDeviceInstance +NdisIMDeregisterLayeredMiniport +NdisIMGetBindingContext +NdisIMGetDeviceContext +NdisIMInitializeDeviceInstance +NdisIMInitializeDeviceInstanceEx +NdisImmediateReadPciSlotInformation +NdisImmediateReadPortUchar +NdisImmediateReadPortUlong +NdisImmediateReadPortUshort +NdisImmediateReadSharedMemory +NdisImmediateWritePciSlotInformation +NdisImmediateWritePortUchar +NdisImmediateWritePortUlong +NdisImmediateWritePortUshort +NdisImmediateWriteSharedMemory +NdisIMQueueMiniportCallback +NdisIMRegisterLayeredMiniport +NdisIMRevertBack +NdisIMSwitchToMiniport +NdisInitAnsiString +NdisInitializeEvent +NdisInitializeReadWriteLock +NdisInitializeString +NdisInitializeTimer +NdisInitializeWrapper +NdisInitUnicodeString +;NdisInterlockedAddLargeInterger ? +NdisInterlockedAddUlong +NdisInterlockedDecrement +NdisInterlockedIncrement +NdisInterlockedInsertHeadList +NdisInterlockedInsertTailList +NdisInterlockedPopEntrySList +NdisInterlockedPushEntrySList +NdisInterlockedRemoveHeadList +NdisMAllocateMapRegisters +NdisMAllocateSharedMemory +NdisMAllocateSharedMemoryAsync +NdisMapFile +NdisMapIoSpace +;NdisMatchPdoWithPacket ? +NdisMCancelTimer +NdisMCloseLog +NdisMCmActivateVc +NdisMCmCreateVc +NdisMCmDeactivateVc +NdisMCmDeleteVc +NdisMCmRegisterAddressFamily +NdisMCmRequest +NdisMCoActivateVcComplete +NdisMCoDeactivateVcComplete +NdisMCoIndicateReceivePacket +NdisMCoIndicateStatus +NdisMCompleteBufferPhysicalMapping +NdisMCoReceiveComplete +NdisMCoRequestComplete +NdisMCoSendComplete +NdisMCreateLog +NdisMDeregisterAdapterShutdownHandler +NdisMDeregisterDevice +NdisMDeregisterDmaChannel +NdisMDeregisterInterrupt +NdisMDeregisterIoPortRange +NdisMFlushLog +NdisMFreeMapRegisters +NdisMFreeSharedMemory +NdisMGetDeviceProperty +NdisMGetDmaAlignment +NdisMIndicateStatus +NdisMIndicateStatusComplete +NdisMInitializeScatterGatherDma +NdisMInitializeTimer +NdisMMapIoSpace +NdisMPciAssignResources +NdisMPromoteMiniport +NdisMQueryAdapterInstanceName +NdisMQueryAdapterResources +NdisMQueryInformationComplete +NdisMReadDmaCounter +NdisMRegisterAdapterShutdownHandler +NdisMRegisterDevice +NdisMRegisterDmaChannel +NdisMRegisterInterrupt +NdisMRegisterIoPortRange +NdisMRegisterMiniport +NdisMRegisterUnloadHandler +NdisMRemoveMiniport +NdisMResetComplete +NdisMSendComplete +NdisMSendResourcesAvailable +NdisMSetAttributes +NdisMSetAttributesEx +NdisMSetInformationComplete +NdisMSetMiniportSecondary +NdisMSetPeriodicTimer +NdisMSetTimer +NdisMSleep +NdisMStartBufferPhysicalMapping +NdisMSynchronizeWithInterrupt +NdisMTransferDataComplete +NdisMUnmapIoSpace +NdisMWanIndicateReceive +NdisMWanIndicateReceiveComplete +NdisMWanSendComplete +NdisMWriteLogData +NdisOpenAdapter +NdisOpenConfiguration +NdisOpenConfigurationKeyByIndex +NdisOpenConfigurationKeyByName +NdisOpenFile +NdisOpenProtocolConfiguration +;NdisOverrideBusNumber ? +NdisPacketPoolUsage +NdisPciAssignResources +NdisQueryAdapterInstanceName +;NdisQueryBindInstanceName? +NdisQueryBuffer +NdisQueryBufferOffset +NdisQueryBufferSafe +NdisQueryMapRegisterCount +NdisReadConfiguration +NdisReadEisaSlotInformation +NdisReadEisaSlotInformationEx +NdisReadMcaPosInformation +NdisReadNetworkAddress +NdisReadPciSlotInformation +NdisReadPcmciaAttributeMemory +;NdisReEnumerateProtocolBindings ? +NdisRegisterAdapter +NdisRegisterAdapterShutdownHandler +NdisRegisterProtocol +;NdisRegisterTdiCallBack ? +NdisReleaseAdapterResources +NdisReleaseReadWriteLock +NdisReleaseSpinLock +NdisRequest +NdisReset +NdisResetEvent +NdisReturnPackets +NdisSend +NdisSendPackets +NdisSetEvent +;NdisSetPacketPoolProtocolId ? +;NdisSetProtocolFilter ? +NdisSetTimer +NdisSetupDmaTransfer +NdisSystemProcessorCount +NdisTerminateWrapper +NdisTransferData +NdisUnchainBufferAtBack +NdisUnchainBufferAtFront +NdisUnicodeStringToAnsiString +NdisUnmapFile +NdisUpcaseUnicodeString +NdisUpdateSharedMemory +NdisWaitEvent +NdisWriteConfiguration +NdisWriteErrorLogEntry +NdisWritePciSlotInformation +NdisWritePcmciaAttributeMemory +TrFilterDprIndicateReceive +TrFilterDprIndicateReceiveComplete +NdisScheduleWorkItem + +; EOF diff --git a/reactos/drivers/network/ndis/ndis.def b/reactos/drivers/network/ndis/ndis-i386.def similarity index 100% rename from reactos/drivers/network/ndis/ndis.def rename to reactos/drivers/network/ndis/ndis-i386.def diff --git a/reactos/drivers/network/ndis/ndis.rbuild b/reactos/drivers/network/ndis/ndis.rbuild index 0a71cd309e3..d4268854b7d 100644 --- a/reactos/drivers/network/ndis/ndis.rbuild +++ b/reactos/drivers/network/ndis/ndis.rbuild @@ -1,7 +1,7 @@ - + include From 0fe845850a7d46d6f4f0e4e6113064925302d0df Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 22:58:20 +0000 Subject: [PATCH 066/388] fix definition for NdisCopyLookaheadData on AMD64 svn path=/branches/ros-amd64-bringup/; revision=34868 --- reactos/include/ddk/ndis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ddk/ndis.h b/reactos/include/ddk/ndis.h index 6e140ad425c..41239f502f9 100644 --- a/reactos/include/ddk/ndis.h +++ b/reactos/include/ddk/ndis.h @@ -1589,7 +1589,7 @@ NdisCopyFromPacketToPacket( * IN ULONG ReceiveFlags); */ -#ifdef _M_IX86 +#if defined(_M_IX86) || defined(_M_AMD64) #define NdisCopyLookaheadData(Destination, Source, Length, MacOptions) \ RtlCopyMemory(Destination, Source, Length) #else From feeb330648a4b1254376fa05229ae802d2c7c0db Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 23:26:26 +0000 Subject: [PATCH 067/388] tcpip: - fix some pointer to ULONG casts svn path=/branches/ros-amd64-bringup/; revision=34870 --- reactos/drivers/network/tcpip/tcpip/dispatch.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/reactos/drivers/network/tcpip/tcpip/dispatch.c b/reactos/drivers/network/tcpip/tcpip/dispatch.c index bee2e63c181..59107bb8cfd 100644 --- a/reactos/drivers/network/tcpip/tcpip/dispatch.c +++ b/reactos/drivers/network/tcpip/tcpip/dispatch.c @@ -662,7 +662,7 @@ NTSTATUS DispTdiQueryInformation( AddressInfo = (PTDI_ADDRESS_INFO)MmGetSystemAddressForMdl(Irp->MdlAddress); - switch ((ULONG)IrpSp->FileObject->FsContext2) { + switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE: AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; break; @@ -713,7 +713,7 @@ NTSTATUS DispTdiQueryInformation( AddressInfo = (PTDI_CONNECTION_INFORMATION) MmGetSystemAddressForMdl(Irp->MdlAddress); - switch ((ULONG)IrpSp->FileObject->FsContext2) { + switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE: AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; break; @@ -1007,12 +1007,16 @@ NTSTATUS DispTdiSendDatagram( (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send))); if( (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send) ) + { + ULONG DataUsed = 0; Status = (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send)( Request.Handle.AddressHandle, DgramInfo->SendDatagramInformation, DataBuffer, BufferSize, - &Irp->IoStatus.Information); + &DataUsed); + Irp->IoStatus.Information = DataUsed; + } else Status = STATUS_UNSUCCESSFUL; @@ -1279,7 +1283,7 @@ NTSTATUS DispTdiQueryInformationEx( TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; - switch ((ULONG)IrpSp->FileObject->FsContext2) { + switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE: Request.Handle.AddressHandle = TranContext->Handle.AddressHandle; break; @@ -1454,7 +1458,7 @@ NTSTATUS DispTdiSetInformationEx( TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; Info = (PTCP_REQUEST_SET_INFORMATION_EX)Irp->AssociatedIrp.SystemBuffer; - switch ((ULONG)IrpSp->FileObject->FsContext2) { + switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE: Request.Handle.AddressHandle = TranContext->Handle.AddressHandle; break; From 1e029cfce4019c109b328c910a0ed90f86ba2756 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 27 Jul 2008 23:32:41 +0000 Subject: [PATCH 068/388] - fix bzip2 include to make ip compile - comment out some stuff in SEH asm code to make it compile, it's useless code anyway - add some hack exports to ntoskrnl - use private ntoskrnl rbuild File svn path=/branches/ros-amd64-bringup/; revision=34871 --- reactos/ReactOS-amd64.rbuild | 8 ++++++++ reactos/lib/3rdparty/bzip2/bzlib.h | 4 +++- reactos/lib/pseh/amd64/framebased.S | 4 ++-- reactos/ntoskrnl/ntoskrnl_amd64.def | 8 ++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 44859b4c579..32930f78c1c 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -108,6 +108,14 @@ + + + + + + + + diff --git a/reactos/lib/3rdparty/bzip2/bzlib.h b/reactos/lib/3rdparty/bzip2/bzlib.h index 0d8fd6b77e9..f60a40b2e98 100644 --- a/reactos/lib/3rdparty/bzip2/bzlib.h +++ b/reactos/lib/3rdparty/bzip2/bzlib.h @@ -112,7 +112,9 @@ typedef #ifdef _WIN32 # include -# define WINAPI __stdcall +# ifndef WINAPI +# define WINAPI __stdcall +# endif # ifdef small /* windows.h define small to char */ # undef small diff --git a/reactos/lib/pseh/amd64/framebased.S b/reactos/lib/pseh/amd64/framebased.S index b7d8607ce8d..98e3390f5fe 100644 --- a/reactos/lib/pseh/amd64/framebased.S +++ b/reactos/lib/pseh/amd64/framebased.S @@ -59,9 +59,9 @@ __SEHGlobalUnwind: push 0 // ReturnValue push 0 // ExceptionRecord - push .RestoreRegisters // TargetIp +// push .RestoreRegisters // TargetIp push rbx // TargetFrame - call [__SEHRtlUnwind] +// call [__SEHRtlUnwind] .RestoreRegisters: pop rdi diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index 6fa7363a8ba..ac918517eb8 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -5,6 +5,14 @@ EXPORTS ; KeQuerySystemTime +KfAcquireSpinLock +KfReleaseSpinLock +KeRaiseIrql +KefAcquireSpinLockAtDpcLevel +KefReleaseSpinLockFromDpcLevel +KeInitializeSpinLock +KeGetCurrentProcessorNumber +RtlConvertUlongToLargeInteger ; ; original: CcCanIWrite From 5f3d2cfa5094305dd94da4383076cc6c8fdaeac7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 00:32:21 +0000 Subject: [PATCH 069/388] class2: fix ULONG to pointer cast svn path=/branches/ros-amd64-bringup/; revision=34874 --- reactos/drivers/storage/class/class2/class2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/storage/class/class2/class2.c b/reactos/drivers/storage/class/class2/class2.c index 00ad4f1e1a3..5125892c72a 100644 --- a/reactos/drivers/storage/class/class2/class2.c +++ b/reactos/drivers/storage/class/class2/class2.c @@ -1316,7 +1316,7 @@ Return Value: // of original IRP. // - nextIrpStack->Parameters.Others.Argument1 = (PVOID) irpCount; + nextIrpStack->Parameters.Others.Argument1 = (PVOID)(ULONG_PTR) irpCount; for (i = 0; i < irpCount; i++) { From 37d520af6e89c33c1367b136ce62e87fc6fb1da1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 00:34:07 +0000 Subject: [PATCH 070/388] - add missing export RtlExtended integerMultiply to ntoskrnl - build class2, atapi and scsiport drivers svn path=/branches/ros-amd64-bringup/; revision=34875 --- reactos/ReactOS-amd64.rbuild | 16 ++++++++++++---- reactos/ntoskrnl/ntoskrnl_amd64.def | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 32930f78c1c..22a9362a03b 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -117,13 +117,21 @@ - - - + + + + + + + + + + + - + diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index ac918517eb8..c33766b3782 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -13,6 +13,7 @@ KefReleaseSpinLockFromDpcLevel KeInitializeSpinLock KeGetCurrentProcessorNumber RtlConvertUlongToLargeInteger +RtlExtendedIntegerMultiply ; ; original: CcCanIWrite From 57ad09577740611b69ed089ea791daab05306732 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 00:47:28 +0000 Subject: [PATCH 071/388] - add another missing export to ntoskrnl_amd64.def - fix LARGE_INTEGER to pointer cast - add more drivers to build svn path=/branches/ros-amd64-bringup/; revision=34877 --- reactos/ReactOS-amd64.rbuild | 22 ++++++++++++++++------ reactos/drivers/storage/floppy/floppy.c | 2 +- reactos/ntoskrnl/ntoskrnl_amd64.def | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 22a9362a03b..2e9041fd40d 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -93,14 +93,12 @@ - - - - - - + + + + @@ -116,11 +114,23 @@ + + + + + + + + + + + + diff --git a/reactos/drivers/storage/floppy/floppy.c b/reactos/drivers/storage/floppy/floppy.c index 6c3e980b99b..75cff27fc18 100644 --- a/reactos/drivers/storage/floppy/floppy.c +++ b/reactos/drivers/storage/floppy/floppy.c @@ -520,7 +520,7 @@ static NTSTATUS NTAPI ConfigCallback(PVOID Context, if(AddressSpace == 0) gControllerInfo[gNumberOfControllers].BaseAddress = MmMapIoSpace(TranslatedAddress, FDC_PORT_BYTES, MmNonCached); else - gControllerInfo[gNumberOfControllers].BaseAddress = (PUCHAR)TranslatedAddress.u.LowPart; + gControllerInfo[gNumberOfControllers].BaseAddress = (PUCHAR)(ULONG_PTR)TranslatedAddress.QuadPart; } else if(PartialDescriptor->Type == CmResourceTypeDma) diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index c33766b3782..4296053b8ea 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -14,6 +14,7 @@ KeInitializeSpinLock KeGetCurrentProcessorNumber RtlConvertUlongToLargeInteger RtlExtendedIntegerMultiply +KeQueryTickCount ; ; original: CcCanIWrite From e1d52bced397eb97a5fda0fa1b6256f1967ca72b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 01:26:56 +0000 Subject: [PATCH 072/388] add another export we need in ntoskrnl svn path=/branches/ros-amd64-bringup/; revision=34880 --- reactos/ntoskrnl/ntoskrnl_amd64.def | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index 4296053b8ea..c58b219e414 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -15,6 +15,7 @@ KeGetCurrentProcessorNumber RtlConvertUlongToLargeInteger RtlExtendedIntegerMultiply KeQueryTickCount +KeQueryInterruptTime ; ; original: CcCanIWrite From db30576dfbe47e1378a02edae6454af8ca668181 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 01:50:22 +0000 Subject: [PATCH 073/388] another Interlocked fix, still it's not all perfect svn path=/branches/ros-amd64-bringup/; revision=34882 --- reactos/include/ddk/winddk.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 40596ee7685..f7a9f9b45cd 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5693,6 +5693,7 @@ typedef struct _PCIBUSDATA #if !defined(__INTERLOCKED_DECLARED) #define __INTERLOCKED_DECLARED +#if defined(NO_INTERLOCKED_INTRINSICS) NTKERNELAPI LONG FASTCALL @@ -5726,6 +5727,7 @@ FASTCALL InterlockedExchangeAdd( IN OUT LONG volatile *Addend, IN LONG Value); +#endif /* * PVOID From 007a3b2a397063d0f9e6f402cc65a8036ab3271d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 01:51:56 +0000 Subject: [PATCH 074/388] moar drivers svn path=/branches/ros-amd64-bringup/; revision=34883 --- reactos/ReactOS-amd64.rbuild | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 2e9041fd40d..ff8e1823fea 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -106,6 +106,9 @@ + + + From b423bf7a95865cc6bd46684c30b5cd41d0b46c7a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 02:18:46 +0000 Subject: [PATCH 075/388] Now after loading all the drivers we come to where we setup the page directory. This is good, but I'm too tired to look into this now.... svn path=/branches/ros-amd64-bringup/; revision=34888 --- reactos/boot/freeldr/freeldr/include/freeldr.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index ccf5daf544f..f18ad73e381 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -107,6 +107,10 @@ #define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n") #endif +#ifdef _M_AMD64 +#define KeAmd64EraseFlags(x) __asm__ __volatile__("pushq $0 ; popfq\n") +#endif + VOID BootMain(LPSTR CmdLine); VOID RunLoader(VOID); From 0f5918792066c12483a3c582f37411d0157416ce Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 14:05:45 +0000 Subject: [PATCH 076/388] move the inlined InterlockedAnd/Or from rtl to winbase.h and rename it to InterlockedAnd/Or_Inline svn path=/branches/ros-amd64-bringup/; revision=34900 --- reactos/include/psdk/winbase.h | 55 ++++++++++++++++++++++++++++++++-- reactos/lib/rtl/srw.c | 45 ---------------------------- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index 6b7315c8495..fdb865c6160 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -1707,7 +1707,7 @@ VOID WINAPI InitializeSRWLock(PSRWLOCK); #ifndef __INTERLOCKED_DECLARED #define __INTERLOCKED_DECLARED -#if defined (_M_AMD64) +#if defined (_M_AMD64) || defined (_M_IA64) #define InterlockedAnd _InterlockedAnd #define InterlockedOr _InterlockedOr @@ -1737,7 +1737,8 @@ VOID WINAPI InitializeSRWLock(PSRWLOCK); #define InterlockedCompareExchange64 _InterlockedCompareExchange64 #define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64 #define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64 -#else + +#else // !(defined (_M_AMD64) || defined (_M_IA64)) LONG WINAPI InterlockedOr(IN OUT LONG volatile *,LONG); LONG WINAPI InterlockedAnd(IN OUT LONG volatile *,LONG); @@ -1769,8 +1770,56 @@ PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER); PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY); #endif -#endif /* !defined(_WIN64) */ +#endif // !(defined (_M_AMD64) || defined (_M_IA64)) + +#if !defined(InterlockedAnd) +#define InterlockedAnd InterlockedAnd_Inline +FORCEINLINE +LONG +InterlockedAnd_Inline(IN OUT volatile LONG *Target, + IN LONG Set) +{ + LONG i; + LONG j; + + j = *Target; + do { + i = j; + j = _InterlockedCompareExchange((PLONG)Target, + i & Set, + i); + + } while (i != j); + + return j; +} +#endif + +#if !defined(InterlockedOr) +#define InterlockedOr InterlockedOr_Inline +FORCEINLINE +LONG +InterlockedOr_Inline(IN OUT volatile LONG *Target, + IN LONG Set) +{ + LONG i; + LONG j; + + j = *Target; + do { + i = j; + j = _InterlockedCompareExchange((PLONG)Target, + i | Set, + i); + + } while (i != j); + + return j; +} +#endif + #endif /* __INTERLOCKED_DECLARED */ + BOOL WINAPI IsBadCodePtr(FARPROC); BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT_PTR); BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT_PTR); diff --git a/reactos/lib/rtl/srw.c b/reactos/lib/rtl/srw.c index a7a4eee636b..4fe2e57b529 100644 --- a/reactos/lib/rtl/srw.c +++ b/reactos/lib/rtl/srw.c @@ -18,51 +18,6 @@ #define NDEBUG #include -/* FIXME *********************************************************************/ - -/* FIXME: Interlocked functions that need to be made into a public header */ -#if 0 -FORCEINLINE -LONG -InterlockedAnd(IN OUT volatile LONG *Target, - IN LONG Set) -{ - LONG i; - LONG j; - - j = *Target; - do { - i = j; - j = _InterlockedCompareExchange((PLONG)Target, - i & Set, - i); - - } while (i != j); - - return j; -} - -FORCEINLINE -LONG -InterlockedOr(IN OUT volatile LONG *Target, - IN LONG Set) -{ - LONG i; - LONG j; - - j = *Target; - do { - i = j; - j = _InterlockedCompareExchange((PLONG)Target, - i | Set, - i); - - } while (i != j); - - return j; -} -#endif - /* FUNCTIONS *****************************************************************/ #ifdef _WIN64 From 1de2bbcd36257ad7a73bce0ce338f02a5644f991 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 14:46:08 +0000 Subject: [PATCH 077/388] fix interlocked stuff in winddk, maybe not 100%, but better now svn path=/branches/ros-amd64-bringup/; revision=34903 --- reactos/include/ddk/winddk.h | 36 +++++++++++++++----- reactos/ntoskrnl/include/internal/ntoskrnl.h | 2 +- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index f7a9f9b45cd..a5f24146366 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5693,6 +5693,7 @@ typedef struct _PCIBUSDATA #if !defined(__INTERLOCKED_DECLARED) #define __INTERLOCKED_DECLARED +#if defined (_X86_) #if defined(NO_INTERLOCKED_INTRINSICS) NTKERNELAPI LONG @@ -5727,20 +5728,31 @@ FASTCALL InterlockedExchangeAdd( IN OUT LONG volatile *Addend, IN LONG Value); -#endif +#else // !defined(NO_INTERLOCKED_INTRINSICS) + +#define InterlockedExchange _InterlockedExchange +#define InterlockedIncrement _InterlockedIncrement +#define InterlockedDecrement _InterlockedDecrement +#define InterlockedExchangeAdd _InterlockedExchangeAdd +#define InterlockedCompareExchange (LONG)_InterlockedCompareExchange +#define InterlockedOr _InterlockedOr +#define InterlockedAnd _InterlockedAnd +#define InterlockedXor _InterlockedXor + +#endif // !defined(NO_INTERLOCKED_INTRINSICS) + +#endif // defined (_X86_) + +#if !defined (_WIN64) /* * PVOID * InterlockedExchangePointer( * IN OUT PVOID VOLATILE *Target, * IN PVOID Value) */ -#if defined (_M_AMD64) -#define InterlockedExchangePointer _InterlockedExchangePointer -#else #define InterlockedExchangePointer(Target, Value) \ ((PVOID) InterlockedExchange((PLONG) Target, (LONG) Value)) -#endif /* * PVOID @@ -5749,16 +5761,20 @@ InterlockedExchangeAdd( * IN PVOID Exchange, * IN PVOID Comparand) */ -#if defined (_M_AMD64) -#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer -#else #define InterlockedCompareExchangePointer(Destination, Exchange, Comparand) \ ((PVOID) InterlockedCompareExchange((PLONG) Destination, (LONG) Exchange, (LONG) Comparand)) -#endif #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd((LONG *)a, b) #define InterlockedIncrementSizeT(a) InterlockedIncrement((LONG *)a) #define InterlockedDecrementSizeT(a) InterlockedDecrement((LONG *)a) + +#endif // !defined (_WIN64) + +#if defined (_M_AMD64) + +#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG *)a, b) +#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONGLONG *)a) +#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONGLONG *)a) #define InterlockedAnd _InterlockedAnd #define InterlockedOr _InterlockedOr #define InterlockedXor _InterlockedXor @@ -5791,6 +5807,8 @@ InterlockedExchangeAdd( #define QueryDepthSList(Head) ExQueryDepthSList(Head) #endif // !defined(_WINBASE_ +#endif // _M_AMD64 + #endif /* !__INTERLOCKED_DECLARED */ NTKERNELAPI diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 6e1232cbfef..f8da962d533 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -30,7 +30,7 @@ // #define InterlockedDecrement _InterlockedDecrement #define InterlockedIncrement _InterlockedIncrement -#define InterlockedCompareExchange _InterlockedCompareExchange +#define InterlockedCompareExchange (LONG)_InterlockedCompareExchange #define InterlockedExchange _InterlockedExchange #define InterlockedExchangeAdd _InterlockedExchangeAdd From c89e519b74393ce3631fe1001bf37d766c65554b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 28 Jul 2008 14:48:07 +0000 Subject: [PATCH 078/388] Fix x86 ntoskrnl build. Fix TreeView_EnsureVisible macro. svn path=/branches/ros-amd64-bringup/; revision=34905 --- reactos/include/ddk/winddk.h | 11 ----------- reactos/include/psdk/commctrl.h | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index a5f24146366..35e52d69b5d 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5796,17 +5796,6 @@ InterlockedExchangeAdd( #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer #define InterlockedExchangePointer _InterlockedExchangePointer -#define ExInterlockedPopEntrySList(Head, Lock) ExpInterlockedPopEntrySList(Head) -#define ExInterlockedPushEntrySList(Head, Entry, Lock) ExpInterlockedPushEntrySList(Head, Entry) -#define ExInterlockedFlushSList(Head) ExpInterlockedFlushSList(Head) - -#if !defined(_WINBASE_) -#define InterlockedPopEntrySList(Head) ExpInterlockedPopEntrySList(Head) -#define InterlockedPushEntrySList(Head, Entry) ExpInterlockedPushEntrySList(Head, Entry) -#define InterlockedFlushSList(Head) ExpInterlockedFlushSList(Head) -#define QueryDepthSList(Head) ExQueryDepthSList(Head) -#endif // !defined(_WINBASE_ - #endif // _M_AMD64 #endif /* !__INTERLOCKED_DECLARED */ diff --git a/reactos/include/psdk/commctrl.h b/reactos/include/psdk/commctrl.h index 32018f223db..10426fa791f 100644 --- a/reactos/include/psdk/commctrl.h +++ b/reactos/include/psdk/commctrl.h @@ -2812,7 +2812,7 @@ typedef struct tagTVKEYDOWN (LPARAM)(HTREEITEM)(hitem)) #define TreeView_EnsureVisible(hwnd, hitem) \ - (BOOL)SNDMSGA((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(UINT)(hitem)) + (BOOL)SNDMSGA((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem)) #define TreeView_SortChildrenCB(hwnd, psort, recurse) \ (BOOL)SNDMSGA((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \ From a0c7e902abc01b2645cb5cf7619893881a904b95 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 28 Jul 2008 14:50:17 +0000 Subject: [PATCH 079/388] Warning and error fixes. svn path=/branches/ros-amd64-bringup/; revision=34906 --- reactos/base/applications/calc/winmain.c | 4 ++-- reactos/base/applications/network/ftp/cmds.c | 8 ++++---- reactos/base/applications/network/ftp/fake.h | 7 +------ reactos/base/applications/network/ftp/ftp.c | 8 ++++---- reactos/base/applications/network/ftp/ftp_var.h | 6 +----- reactos/base/applications/network/ftp/main.c | 12 ++++++------ reactos/base/applications/network/network.rbuild | 4 +--- reactos/base/applications/network/ping/ping.c | 4 ++-- reactos/base/applications/network/tracert/tracert.c | 4 ++-- reactos/base/applications/notepad/dialog.c | 2 +- reactos/base/applications/notepad/dialog.h | 2 +- 11 files changed, 25 insertions(+), 36 deletions(-) diff --git a/reactos/base/applications/calc/winmain.c b/reactos/base/applications/calc/winmain.c index d4c57f5e66e..0727c15a39b 100644 --- a/reactos/base/applications/calc/winmain.c +++ b/reactos/base/applications/calc/winmain.c @@ -854,7 +854,7 @@ static char *ReadConversion(const char *formula) return str; } -static LRESULT CALLBACK DlgStatProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) +static INT_PTR CALLBACK DlgStatProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { TCHAR buffer[SIZEOF(calc.buffer)]; DWORD n; @@ -1224,7 +1224,7 @@ static LRESULT CALLBACK SubclassButtonProc(HWND hWnd, WPARAM wp, LPARAM lp) return 1L; } -static LRESULT CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) +static INT_PTR CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { unsigned int x; RECT rc; diff --git a/reactos/base/applications/network/ftp/cmds.c b/reactos/base/applications/network/ftp/cmds.c index b2763caccb3..0470d472c3c 100644 --- a/reactos/base/applications/network/ftp/cmds.c +++ b/reactos/base/applications/network/ftp/cmds.c @@ -417,7 +417,7 @@ void mput(argc, argv) if (!*tp) { tp = cp; tp2 = tmpbuf; - while ((*tp2 = *tp) != (int) NULL) { + while ((*tp2 = *tp)) { if (isupper(*tp2)) { *tp2 = 'a' + *tp2 - 'A'; } @@ -574,7 +574,7 @@ usage: if (!*tp) { tp = argv[2]; tp2 = tmpbuf; - while ((*tp2 = *tp) != (int) NULL) { + while ((*tp2 = *tp)) { if (isupper(*tp2)) { *tp2 = 'a' + *tp2 - 'A'; } @@ -716,7 +716,7 @@ void mget(argc, argv) if (!*tp) { tp = cp; tp2 = tmpbuf; - while ((*tp2 = *tp) != (int) NULL) { + while ((*tp2 = *tp)) { if (isupper(*tp2)) { *tp2 = 'a' + *tp2 - 'A'; } @@ -1687,7 +1687,7 @@ void disconnect() if (!connected) return; (void) command("QUIT"); - cout = (int) NULL; + cout = 0; connected = 0; data = -1; if (!proxy) { diff --git a/reactos/base/applications/network/ftp/fake.h b/reactos/base/applications/network/ftp/fake.h index 68c94cc749f..b29212bec49 100644 --- a/reactos/base/applications/network/ftp/fake.h +++ b/reactos/base/applications/network/ftp/fake.h @@ -9,9 +9,4 @@ #define strcasecmp strcmp #define strncasecmp strnicmp -struct timezone { - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; - -int gettimeofday(struct timeval *tv, struct timezone *tz); +void __cdecl _tzset(void); diff --git a/reactos/base/applications/network/ftp/ftp.c b/reactos/base/applications/network/ftp/ftp.c index cc217365028..12e77439279 100644 --- a/reactos/base/applications/network/ftp/ftp.c +++ b/reactos/base/applications/network/ftp/ftp.c @@ -295,7 +295,7 @@ int command(const char *fmt, ...) printf("\n"); (void) fflush(stdout); } - if (cout == (int) NULL) { + if (cout == 0) { perror ("No control connection for command"); code = -1; return (0); @@ -583,7 +583,7 @@ null();// (void) signal(SIGPIPE, oldintp); return; } dout = dataconn(mode); - if (dout == (int)NULL) + if (!dout) goto abort; (void) gettimeofday(&start, (struct timezone *)0); null();// oldintp = signal(SIGPIPE, SIG_IGN); @@ -888,7 +888,7 @@ null();// (void) signal(SIGINT, oldintr); } } din = dataconn("r"); - if (din == (int)NULL) + if (!din) goto abort; if (strcmp(local, "-") == 0) fout = stdout; @@ -1272,7 +1272,7 @@ int dataconn(const char *mode) if (s < 0) { perror("ftp: accept"); (void) closesocket(data), data = -1; - return (int) (NULL); + return 0; } if(closesocket(data)) { int iret=WSAGetLastError (); diff --git a/reactos/base/applications/network/ftp/ftp_var.h b/reactos/base/applications/network/ftp/ftp_var.h index c18d1541cab..b22a9d62d19 100644 --- a/reactos/base/applications/network/ftp/ftp_var.h +++ b/reactos/base/applications/network/ftp/ftp_var.h @@ -2,6 +2,7 @@ #include "fake.h" #include "prototypes.h" #include +#include //typedef void (*Sig_t)(int); @@ -49,11 +50,6 @@ #define STRU_R 2 #define STRU_P 3 -#define SIGQUIT 1 -#define SIGPIPE 2 -#define SIGALRM 3 - - #define FORM_N 1 #define FORM_T 2 #define FORM_C 3 diff --git a/reactos/base/applications/network/ftp/main.c b/reactos/base/applications/network/ftp/main.c index d83a04183ca..aaf42d12e6e 100644 --- a/reactos/base/applications/network/ftp/main.c +++ b/reactos/base/applications/network/ftp/main.c @@ -264,9 +264,9 @@ void lostpeer(void) extern int data; if (connected) { - if (cout != (int) NULL) { + if (cout) { closesocket(cout); - cout = (int) NULL; + cout = 0; } if (data >= 0) { (void) shutdown(data, 1+1); @@ -277,9 +277,9 @@ void lostpeer(void) } pswitch(1); if (connected) { - if (cout != (int)NULL) { + if (cout) { closesocket(cout); - cout = (int) NULL; + cout = 0; } connected = 0; } @@ -538,7 +538,7 @@ void help(argc, argv) char *argv[]; { extern struct cmd cmdtab[]; - register struct cmd *c; + struct cmd *c; if (argc == 1) { register int i, j, w, k; @@ -591,7 +591,7 @@ void help(argc, argv) else if (c == (struct cmd *)0) printf("?Invalid help command %s\n", arg); else - printf("%-*s\t%s\n", HELPINDENT, + printf("%-*s\t%s\n", (int)HELPINDENT, c->c_name, c->c_help); } (void) fflush(stdout); diff --git a/reactos/base/applications/network/network.rbuild b/reactos/base/applications/network/network.rbuild index bdf9d883d7c..e6567ade9b8 100644 --- a/reactos/base/applications/network/network.rbuild +++ b/reactos/base/applications/network/network.rbuild @@ -28,9 +28,7 @@ - - - + diff --git a/reactos/base/applications/network/ping/ping.c b/reactos/base/applications/network/ping/ping.c index c86f7a5103a..da98c5cbaba 100644 --- a/reactos/base/applications/network/ping/ping.c +++ b/reactos/base/applications/network/ping/ping.c @@ -233,7 +233,7 @@ static BOOL ParseCmdline(int argc, char* argv[]) DataSize = GetULONG2(&argv[i][2], argv[i + 1], &i); if (DataSize > ICMP_MAXSIZE - sizeof(ICMP_ECHO_PACKET)) { - printf("Bad value for option -l, valid range is from 0 to %d.\n", + printf("Bad value for option -l, valid range is from 0 to %I64d.\n", ICMP_MAXSIZE - sizeof(ICMP_ECHO_PACKET)); return FALSE; } @@ -466,7 +466,7 @@ static BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from) } - printf("Reply from %s: bytes=%d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr), + printf("Reply from %s: bytes=%I64d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr), size - IphLength - sizeof(ICMP_ECHO_PACKET), Sign, Time, IpHeader->TTL); if (RelativeTime.QuadPart < MinRTT.QuadPart || !MinRTTSet) { diff --git a/reactos/base/applications/network/tracert/tracert.c b/reactos/base/applications/network/tracert/tracert.c index b04729c59cb..e04f982ddab 100644 --- a/reactos/base/applications/network/tracert/tracert.c +++ b/reactos/base/applications/network/tracert/tracert.c @@ -396,7 +396,7 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id, process id %d"), TTLExceedHdr->OrigIcmpHeader.id, GetCurrentProcessId()); return -1; } - _tprintf(_T("%3Ld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); + _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); return 0; case ECHO_REPLY : @@ -407,7 +407,7 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id %d, process id %d"), IcmpHdr->icmpheader.id, GetCurrentProcessId()); return -1; } - _tprintf(_T("%3Ld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); + _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); return 1; case DEST_UNREACHABLE : diff --git a/reactos/base/applications/notepad/dialog.c b/reactos/base/applications/notepad/dialog.c index f5586021186..21be3355c80 100644 --- a/reactos/base/applications/notepad/dialog.c +++ b/reactos/base/applications/notepad/dialog.c @@ -928,7 +928,7 @@ VOID DIALOG_HelpHelp(VOID) #ifdef _MSC_VER #pragma warning(disable : 4100) #endif -BOOL CALLBACK +INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { HWND hLicenseEditWnd; diff --git a/reactos/base/applications/notepad/dialog.h b/reactos/base/applications/notepad/dialog.h index 8808d928824..893e4daf7e2 100644 --- a/reactos/base/applications/notepad/dialog.h +++ b/reactos/base/applications/notepad/dialog.h @@ -55,7 +55,7 @@ VOID DIALOG_HelpAboutWine(VOID); VOID DIALOG_TimeDate(VOID); -BOOL CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); /* utility functions */ VOID ShowLastError(void); From fdd31121db2189ad2de39cd476a14d4608dc0598 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 15:14:30 +0000 Subject: [PATCH 080/388] - #if out vista api for now - fix advapi and kernel32 spec files. They need more review though. - fix NtUserGetThreadState This fixes x86 build. svn path=/branches/ros-amd64-bringup/; revision=34907 --- reactos/dll/win32/advapi32/advapi32.spec | 20 +++++++----- reactos/dll/win32/kernel32/kernel32.spec | 9 +++--- reactos/dll/win32/kernel32/synch/critical.c | 3 +- reactos/subsystems/win32/win32k/ntuser/misc.c | 31 ++++++++++--------- 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/reactos/dll/win32/advapi32/advapi32.spec b/reactos/dll/win32/advapi32/advapi32.spec index 1ccf85c4338..f8ae684f6a5 100644 --- a/reactos/dll/win32/advapi32/advapi32.spec +++ b/reactos/dll/win32/advapi32/advapi32.spec @@ -7,13 +7,13 @@ @ stdcall AccessCheckAndAuditAlarmA(str ptr str str ptr long ptr long ptr ptr ptr) @ stdcall AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr) @ stub AccessCheckByType #(ptr ptr long long ptr long ptr ptr ptr ptr ptr) - @ stub AccessCheckByTypeAndAuditAlarmA - @ stub AccessCheckByTypeAndAuditAlarmW + @ stdcall AccessCheckByTypeAndAuditAlarmA(str ptr str str ptr ptr long long long ptr long ptr long ptr ptr ptr) + @ stdcall AccessCheckByTypeAndAuditAlarmW(wstr ptr wstr wstr ptr ptr long long long ptr long ptr long ptr ptr ptr) @ stub AccessCheckByTypeResultList - @ stub AccessCheckByTypeResultListAndAuditAlarmA - @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleA - @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW - @ stub AccessCheckByTypeResultListAndAuditAlarmW + @ stdcall AccessCheckByTypeResultListAndAuditAlarmA(str ptr str str ptr long long long long ptr long ptr long ptr ptr ptr) + @ stdcall AccessCheckByTypeResultListAndAuditAlarmByHandleA(str ptr ptr str str ptr long long long long ptr long ptr long ptr ptr ptr) + @ stdcall AccessCheckByTypeResultListAndAuditAlarmByHandleW(wstr ptr ptr wstr wstr ptr long long long long ptr long ptr long ptr ptr ptr) + @ stdcall AccessCheckByTypeResultListAndAuditAlarmW(wstr ptr wstr wstr ptr long long long long ptr long ptr long ptr ptr ptr) @ stdcall AddAccessAllowedAce (ptr long long ptr) @ stdcall AddAccessAllowedAceEx (ptr long long long ptr) @ stub AddAccessAllowedObjectAce @@ -243,8 +243,8 @@ @ stdcall GetFileSecurityW(wstr long ptr long ptr) @ stub GetInformationCodeAuthzLevelW @ stub GetInformationCodeAuthzPolicyW - @ stub GetInheritanceSourceA - @ stdcall GetInheritanceSourceW (ptr long long long ptr long ptr ptr ptr ptr) + @ stdcall GetInheritanceSourceA(str long long long ptr long ptr ptr ptr ptr) + @ stdcall GetInheritanceSourceW(wstr long long long ptr long ptr ptr ptr ptr) @ stdcall GetKernelObjectSecurity(long long ptr long ptr) @ stdcall GetLengthSid(ptr) @ stub GetLocalManagedApplicationData @@ -448,6 +448,7 @@ @ stub QueryAllTracesA @ stub QueryAllTracesW @ stub QueryRecoveryAgentsOnEncryptedFile + @ stdcall QuerySecurityAccessMask(long ptr) @ stdcall QueryServiceConfig2A(long long ptr long ptr) @ stdcall QueryServiceConfig2W(long long ptr long ptr) @ stdcall QueryServiceConfigA(long ptr long ptr) @@ -467,6 +468,8 @@ @ stdcall RegCloseKey(long) @ stdcall RegConnectRegistryA(str long ptr) @ stdcall RegConnectRegistryW(wstr long ptr) + @ stdcall RegCopyTreeA(ptr str ptr) + @ stdcall RegCopyTreeW(ptr wstr ptr) @ stdcall RegCreateKeyA(long str ptr) @ stdcall RegCreateKeyExA(long str long ptr long long ptr ptr ptr) @ stdcall RegCreateKeyExW(long wstr long ptr long long ptr ptr ptr) @@ -572,6 +575,7 @@ @ stdcall SetNamedSecurityInfoW(wstr long ptr ptr ptr ptr ptr) @ stdcall SetPrivateObjectSecurity(long ptr ptr ptr long) @ stub SetPrivateObjectSecurityEx + @ stdcall SetSecurityAccessMask(long ptr) @ stdcall SetSecurityDescriptorControl(ptr long long) @ stdcall SetSecurityDescriptorDacl(ptr long ptr long) @ stdcall SetSecurityDescriptorGroup (ptr ptr long) diff --git a/reactos/dll/win32/kernel32/kernel32.spec b/reactos/dll/win32/kernel32/kernel32.spec index 4c930596490..be042123c53 100644 --- a/reactos/dll/win32/kernel32/kernel32.spec +++ b/reactos/dll/win32/kernel32/kernel32.spec @@ -120,8 +120,8 @@ @ stdcall CreateRemoteThread(long ptr long ptr long long ptr) @ stdcall CreateSemaphoreA(ptr long long str) @ stdcall CreateSemaphoreW(ptr long long wstr) -@ stdcall CreateSemaphoreExA(ptr long long long str long long) -@ stdcall CreateSemaphoreExW(ptr long long long wstr long long) +@ stdcall CreateSemaphoreExA(ptr long long str long long) +@ stdcall CreateSemaphoreExW(ptr long long wstr long long) @ stdcall CreateSocketHandle() @ stdcall CreateSymbolicLinkA(str str long) @ stdcall CreateSymbolicLinkW(wstr wstr long) @@ -311,7 +311,7 @@ @ stdcall GetConsoleCP() @ stub GetConsoleCharType @ stdcall GetConsoleCommandHistoryA(long long long) #check -@ stdcall GetConsoleCommandHistoryLengthA(long long long)#check +@ stdcall GetConsoleCommandHistoryLengthA(long)#check @ stdcall GetConsoleCommandHistoryLengthW(long)#check @ stdcall GetConsoleCommandHistoryW(long long long)#check @ stdcall GetConsoleCursorInfo(long ptr) @@ -399,6 +399,7 @@ @ stdcall GetLocalTime(ptr) @ stdcall GetLocaleInfoA(long long ptr long) @ stdcall GetLocaleInfoW(long long ptr long) +@ stdcall GetLocaleInfoEx(wstr long wstr long) @ stdcall GetLogicalDriveStringsA(long ptr) @ stdcall GetLogicalDriveStringsW(long ptr) @ stdcall GetLogicalDrives() @@ -575,7 +576,7 @@ @ stdcall InitAtomTable(long) @ stdcall InitializeCriticalSection(ptr) @ stdcall InitializeCriticalSectionAndSpinCount(ptr long) -@ stdcall InitializeCriticalSectionEx(ptr long long) +#@ stdcall InitializeCriticalSectionEx(ptr long long) @ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead @ stdcall InitializeSRWLock(ptr) ntdll.RtlInitializeSRWLock @ stdcall InterlockedCompareExchange (ptr long long) diff --git a/reactos/dll/win32/kernel32/synch/critical.c b/reactos/dll/win32/kernel32/synch/critical.c index ce3844d6a67..65e24bbd356 100644 --- a/reactos/dll/win32/kernel32/synch/critical.c +++ b/reactos/dll/win32/kernel32/synch/critical.c @@ -58,11 +58,12 @@ InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, /* * @implemented */ +#if 0 BOOL WINAPI InitializeCriticalSectionEx( CRITICAL_SECTION *crit, DWORD spincount, DWORD flags ) { NTSTATUS ret = RtlInitializeCriticalSectionEx( crit, spincount, flags ); if (ret) RtlRaiseStatus( ret ); return !ret; } - +#endif /* EOF */ diff --git a/reactos/subsystems/win32/win32k/ntuser/misc.c b/reactos/subsystems/win32/win32k/ntuser/misc.c index 68fce8b573c..81caf18fc60 100644 --- a/reactos/subsystems/win32/win32k/ntuser/misc.c +++ b/reactos/subsystems/win32/win32k/ntuser/misc.c @@ -21,7 +21,7 @@ DWORD_PTR STDCALL NtUserGetThreadState( DWORD Routine) { - DECLARE_RETURN(DWORD_PTR); + DWORD_PTR ret = 0; DPRINT("Enter NtUserGetThreadState\n"); if (Routine != THREADSTATE_GETTHREADINFO) @@ -37,26 +37,29 @@ NtUserGetThreadState( { case THREADSTATE_GETTHREADINFO: GetW32ThreadInfo(); - RETURN(0); - + break; case THREADSTATE_FOCUSWINDOW: - RETURN( (DWORD_PTR)IntGetThreadFocusWindow()); + ret = (DWORD_PTR)IntGetThreadFocusWindow(); + break; case THREADSTATE_CAPTUREWINDOW: /* FIXME should use UserEnterShared */ - RETURN( (DWORD_PTR)IntGetCapture()); + ret = (DWORD_PTR)IntGetCapture(); + break; case THREADSTATE_PROGMANWINDOW: - RETURN( (DWORD_PTR)GetW32ThreadInfo()->Desktop->hProgmanWindow); + ret = (DWORD_PTR)GetW32ThreadInfo()->Desktop->hProgmanWindow; + break; case THREADSTATE_TASKMANWINDOW: - RETURN( (DWORD_PTR)GetW32ThreadInfo()->Desktop->hTaskManWindow); + ret = (DWORD_PTR)GetW32ThreadInfo()->Desktop->hTaskManWindow; + break; case THREADSTATE_ACTIVEWINDOW: - RETURN ( (DWORD_PTR)UserGetActiveWindow()); + ret = (DWORD_PTR)UserGetActiveWindow(); + break; } - RETURN( 0); -CLEANUP: - DPRINT("Leave NtUserGetThreadState, ret=%i\n",_ret_); + DPRINT("Leave NtUserGetThreadState, ret=%i\n", ret); UserLeave(); - END_CLEANUP; + + return ret; } @@ -124,7 +127,7 @@ NtUserGetGUIThreadInfo( if(idThread) { - Status = PsLookupThreadByThreadId((HANDLE)idThread, &Thread); + Status = PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)idThread, &Thread); if(!NT_SUCCESS(Status)) { SetLastWin32Error(ERROR_ACCESS_DENIED); @@ -416,7 +419,7 @@ GetW32ProcessInfo(VOID) (ULONG_PTR)W32Process->HeapMappings.UserMapping; pi->psi = gpsi; - if (InterlockedCompareExchangePointer(&W32Process->ProcessInfo, + if (InterlockedCompareExchangePointer((PVOID*)&W32Process->ProcessInfo, pi, NULL) != NULL) { From 2c0f5fbba4ace8ba7a340f54fa5d920efae86976 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 15:19:17 +0000 Subject: [PATCH 081/388] some 64 bit fixes in win32k svn path=/branches/ros-amd64-bringup/; revision=34908 --- reactos/subsystems/win32/win32k/ntuser/hook.c | 8 ++++---- reactos/subsystems/win32/win32k/ntuser/kbdlayout.c | 4 ++-- reactos/subsystems/win32/win32k/ntuser/menu.c | 6 +++--- reactos/subsystems/win32/win32k/ntuser/painting.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/hook.c b/reactos/subsystems/win32/win32k/ntuser/hook.c index 76c292d8906..417dc3211b4 100644 --- a/reactos/subsystems/win32/win32k/ntuser/hook.c +++ b/reactos/subsystems/win32/win32k/ntuser/hook.c @@ -273,7 +273,7 @@ IntCallLowLevelHook(INT HookId, INT Code, WPARAM wParam, LPARAM lParam, PHOOK Ho /* FIXME should get timeout from * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */ - Status = co_MsqSendMessage(((PW32THREAD)Hook->Thread->Tcb.Win32Thread)->MessageQueue, (HWND) Code, HookId, + Status = co_MsqSendMessage(((PW32THREAD)Hook->Thread->Tcb.Win32Thread)->MessageQueue, (HWND)(INT_PTR) Code, HookId, wParam, lParam, 5000, TRUE, TRUE, &uResult); return NT_SUCCESS(Status) ? uResult : 0; @@ -903,7 +903,7 @@ CLEANUP: HHOOK STDCALL NtUserSetWindowsHookAW( - int idHook, + int idHook, HOOKPROC lpfn, BOOL Ansi) { @@ -957,7 +957,7 @@ NtUserSetWindowsHookEx( } Mod = NULL; Global = FALSE; - if (! NT_SUCCESS(PsLookupThreadByThreadId((HANDLE) ThreadId, &Thread))) + if (! NT_SUCCESS(PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)ThreadId, &Thread))) { DPRINT1("Invalid thread id 0x%x\n", ThreadId); SetLastWin32Error(ERROR_INVALID_PARAMETER); @@ -1170,5 +1170,5 @@ CLEANUP: UserLeave(); END_CLEANUP; } - + /* EOF */ diff --git a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c index 1cb4928c92a..b11ffa071f2 100644 --- a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c +++ b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c @@ -228,7 +228,7 @@ static PKBL UserLoadDllAndCreateKbl(DWORD LocaleId) hKl |= 0xe001 << 16; /* FIXME */ else hKl |= hKl << 16; - NewKbl->hkl = (HKL) hKl; + NewKbl->hkl = (HKL)(ULONG_PTR) hKl; NewKbl->klid = LocaleId; NewKbl->Flags = 0; NewKbl->RefCount = 0; @@ -450,7 +450,7 @@ UserGetKeyboardLayout( return W32Thread->KeyboardLayout->hkl; } - Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread); + Status = PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)dwThreadId, &Thread); if(!NT_SUCCESS(Status)) { SetLastWin32Error(ERROR_INVALID_PARAMETER); diff --git a/reactos/subsystems/win32/win32k/ntuser/menu.c b/reactos/subsystems/win32/win32k/ntuser/menu.c index 21e8f3586be..50c50d78c64 100644 --- a/reactos/subsystems/win32/win32k/ntuser/menu.c +++ b/reactos/subsystems/win32/win32k/ntuser/menu.c @@ -1954,7 +1954,7 @@ NtUserGetMenuBarInfo( RETURN(FALSE); } - hMenu = (HMENU)WindowObject->Wnd->IDMenu; + hMenu = (HMENU)(DWORD_PTR)WindowObject->Wnd->IDMenu; if (!(MenuObject = UserGetMenuObject(hMenu))) { @@ -2257,7 +2257,7 @@ NtUserHiliteMenuItem( RETURN(FALSE); } - if(Window->Wnd->IDMenu == (UINT)hMenu) + if(Window->Wnd->IDMenu == (UINT)(UINT_PTR)hMenu) { RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite)); } @@ -2664,7 +2664,7 @@ NtUserThunkedMenuItemInfo( if bInsert == TRUE call NtUserInsertMenuItem() else NtUserSetMenuItemInfo() */ if (bInsert) return UserInsertMenuItem(hMenu, uItem, fByPosition, lpmii); - + UNIMPLEMENTED return 0; } diff --git a/reactos/subsystems/win32/win32k/ntuser/painting.c b/reactos/subsystems/win32/win32k/ntuser/painting.c index cd9b474d1cc..121028da0ec 100644 --- a/reactos/subsystems/win32/win32k/ntuser/painting.c +++ b/reactos/subsystems/win32/win32k/ntuser/painting.c @@ -1682,7 +1682,7 @@ BOOL UserDrawCaption( && !(Wnd->ExStyle & WS_EX_TOOLWINDOW); } else - HasIcon = (BOOL) hIcon; + HasIcon = (hIcon != 0); IconWidth = UserGetSystemMetrics(SM_CXSIZE) + Padding; From a5d18f835c60d160c1c5ca2b6a6602d4878402d5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 15:30:31 +0000 Subject: [PATCH 082/388] some more win32k 64 bit fixes svn path=/branches/ros-amd64-bringup/; revision=34909 --- reactos/subsystems/win32/win32k/ntuser/callback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/callback.c b/reactos/subsystems/win32/win32k/ntuser/callback.c index fbb2f856e3e..808db183a0c 100644 --- a/reactos/subsystems/win32/win32k/ntuser/callback.c +++ b/reactos/subsystems/win32/win32k/ntuser/callback.c @@ -439,7 +439,7 @@ co_IntCallHookProc(INT HookId, { RtlCopyMemory(Extra, ClassName->Buffer, ClassName->Length); CbtCreatewndExtra->Cs.lpszClass = - (LPCWSTR) MAKELONG(Extra - (PCHAR) CbtCreatewndExtra, 1); + (LPCWSTR)(ULONG_PTR) MAKELONG(Extra - (PCHAR) CbtCreatewndExtra, 1); Extra += ClassName->Length; *((WCHAR *) Extra) = L'\0'; } @@ -562,7 +562,7 @@ co_IntCallEventProc(HWINEVENTHOOK hook, IntRestoreTebWndCallback (hWnd, pWnd); IntCbFreeMemory(Argument); - + if (!NT_SUCCESS(Status)) { return 0; From f677303425ad562fc8e7dedd7e1b4b97bff0e0c0 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 21:39:55 +0000 Subject: [PATCH 083/388] - add missing 64 bit intrinsic Interlocked functions - readd Interlocked definitions to winddk.h that someone stole svn path=/branches/ros-amd64-bringup/; revision=34916 --- reactos/include/ddk/winddk.h | 11 +++++++++++ reactos/include/psdk/intrin_x86.h | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 35e52d69b5d..a5f24146366 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5796,6 +5796,17 @@ InterlockedExchangeAdd( #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer #define InterlockedExchangePointer _InterlockedExchangePointer +#define ExInterlockedPopEntrySList(Head, Lock) ExpInterlockedPopEntrySList(Head) +#define ExInterlockedPushEntrySList(Head, Entry, Lock) ExpInterlockedPushEntrySList(Head, Entry) +#define ExInterlockedFlushSList(Head) ExpInterlockedFlushSList(Head) + +#if !defined(_WINBASE_) +#define InterlockedPopEntrySList(Head) ExpInterlockedPopEntrySList(Head) +#define InterlockedPushEntrySList(Head, Entry) ExpInterlockedPushEntrySList(Head, Entry) +#define InterlockedFlushSList(Head) ExpInterlockedFlushSList(Head) +#define QueryDepthSList(Head) ExQueryDepthSList(Head) +#endif // !defined(_WINBASE_ + #endif // _M_AMD64 #endif /* !__INTERLOCKED_DECLARED */ diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index e30367e44b8..6bd172e5981 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -147,6 +147,13 @@ static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(vo return __sync_fetch_and_add(Addend, Value); } +#if defined(_M_AMD64) +static __inline__ __attribute__((always_inline)) long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value) +{ + return __sync_fetch_and_add(Addend, Value); +} +#endif + static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) { return __sync_fetch_and_and(value, mask); @@ -471,6 +478,18 @@ static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(vo return _InterlockedExchangeAdd16(lpAddend, 1) + 1; } +#if defined(_M_AMD64) +static __inline__ __attribute__((always_inline)) long long _InterlockedDecrement64(volatile long long * const lpAddend) +{ + return _InterlockedExchangeAdd(lpAddend, -1) - 1; +} + +static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement64(volatile long long * const lpAddend) +{ + return _InterlockedExchangeAdd64(lpAddend, 1) + 1; +} +#endif + static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b) { unsigned char retval; From ad2827f5f40174e0ac7637786c4770f37232a790 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 21:42:32 +0000 Subject: [PATCH 084/388] fix hal build svn path=/branches/ros-amd64-bringup/; revision=34917 --- reactos/hal/hal/hal.rbuild | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/reactos/hal/hal/hal.rbuild b/reactos/hal/hal/hal.rbuild index 83daee13152..aa0a6fabc75 100644 --- a/reactos/hal/hal/hal.rbuild +++ b/reactos/hal/hal/hal.rbuild @@ -11,8 +11,8 @@ hal.rc hal.spec - - + + include @@ -22,7 +22,7 @@ hal.rc hal.spec - + @@ -32,4 +32,15 @@ + + + + include + ntoskrnl + + hal.c + hal.rc + hal.spec + + From 4a8be83925e9084ff0064b3ccc9c65f12d992f29 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 21:43:28 +0000 Subject: [PATCH 085/388] fix ntoskrnl build svn path=/branches/ros-amd64-bringup/; revision=34918 --- reactos/ntoskrnl/amd64stubs.c | 1 + reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index 598b07f4061..7e3f0dc6de3 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -1,6 +1,7 @@ #define STUB(x) void x() {} +STUB(KdpEnableSafeMem) STUB(KfLowerIrql) STUB(KeRaiseIrql) STUB(KeLowerIrql) diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index 5dd58a8fb2a..c7d1349067d 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -13,7 +13,7 @@ - + . From 57fe9d163dff9f0d9b8347d2001e8f14bd9e63d6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 28 Jul 2008 22:00:17 +0000 Subject: [PATCH 086/388] fix _InterlockedDecrement64 svn path=/branches/ros-amd64-bringup/; revision=34919 --- reactos/include/psdk/intrin_x86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 6bd172e5981..6ae583fb968 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -481,7 +481,7 @@ static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(vo #if defined(_M_AMD64) static __inline__ __attribute__((always_inline)) long long _InterlockedDecrement64(volatile long long * const lpAddend) { - return _InterlockedExchangeAdd(lpAddend, -1) - 1; + return _InterlockedExchangeAdd64(lpAddend, -1) - 1; } static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement64(volatile long long * const lpAddend) From 98797fa1bfe8e60321d45254de7d4aca86e97f35 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 29 Jul 2008 15:22:17 +0000 Subject: [PATCH 087/388] - fix InterlockedExchangeAddSizeT - fix __writecrx instrinsics - fix some mmtypes svn path=/branches/ros-amd64-bringup/; revision=34925 --- reactos/include/ddk/winddk.h | 2 +- reactos/include/ndk/amd64/mmtypes.h | 92 ++++++++++++----------------- reactos/include/ndk/arch/mmtypes.h | 4 +- reactos/include/psdk/intrin_x86.h | 17 ++++++ 4 files changed, 60 insertions(+), 55 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index a5f24146366..37df8515841 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5772,7 +5772,7 @@ InterlockedExchangeAdd( #if defined (_M_AMD64) -#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG *)a, b) +#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONGLONG *)a, (LONGLONG)b) #define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONGLONG *)a) #define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONGLONG *)a) #define InterlockedAnd _InterlockedAnd diff --git a/reactos/include/ndk/amd64/mmtypes.h b/reactos/include/ndk/amd64/mmtypes.h index 88f8c51e76f..a1af46be561 100644 --- a/reactos/include/ndk/amd64/mmtypes.h +++ b/reactos/include/ndk/amd64/mmtypes.h @@ -1,18 +1,20 @@ /*++ NDK Version: 0095 Copyright (c) Alex Ionescu. All rights reserved. +Copyright (c) Timo Kreuzer All rights reserved. Header Name: - mmtypes.h (X86) + mmtypes.h (AMD64) Abstract: - i386 Type definitions for the Memory Manager + AMD64 Type definitions for the Memory Manager Author: Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004 + Timo Kreuzer (timo.kreuzer@reactos.com) 29-Jul-2008 --*/ @@ -42,30 +44,27 @@ C_ASSERT(MM_ALLOCATION_GRANULARITY && C_ASSERT(MM_ALLOCATION_GRANULARITY >= PAGE_SIZE); #endif -// -// PAE SEG0 Base? -// -#define KSEG0_BASE_PAE 0xE0000000 - // // Page Table Entry Definitions // -typedef struct _HARDWARE_PTE_X86 +typedef struct _HARDWARE_PTE_AMD64 { - ULONG Valid:1; - ULONG Write:1; - ULONG Owner:1; - ULONG WriteThrough:1; - ULONG CacheDisable:1; - ULONG Accessed:1; - ULONG Dirty:1; - ULONG LargePage:1; - ULONG Global:1; - ULONG CopyOnWrite:1; - ULONG Prototype: 1; - ULONG reserved: 1; - ULONG PageFrameNumber:20; -} HARDWARE_PTE_X86, *PHARDWARE_PTE_X86; + ULONGLONG Valid:1; + ULONGLONG Write:1; + ULONGLONG Owner:1; + ULONGLONG WriteThrough:1; + ULONGLONG CacheDisable:1; + ULONGLONG Accessed:1; + ULONGLONG Dirty:1; + ULONGLONG LargePage:1; + ULONGLONG Global:1; + ULONGLONG CopyOnWrite:1; + ULONGLONG Prototype: 1; + ULONGLONG reserved1: 1; + ULONGLONG PageFrameNumber:40; + ULONGLONG reserved2:11; + ULONGLONG NoExecute:1; +} HARDWARE_PTE_AMD64, *PHARDWARE_PTE_AMD64; typedef struct _MMPTE_SOFTWARE { @@ -124,46 +123,33 @@ typedef struct _MMPTE_LIST typedef struct _MMPTE_HARDWARE { - ULONG Valid:1; - ULONG Write:1; - ULONG Owner:1; - ULONG WriteThrough:1; - ULONG CacheDisable:1; - ULONG Accessed:1; - ULONG Dirty:1; - ULONG LargePage:1; - ULONG Global:1; - ULONG CopyOnWrite:1; - ULONG Prototype:1; - ULONG reserved:1; - ULONG PageFrameNumber:20; + ULONGLONG Valid:1; + ULONGLONG Write:1; + ULONGLONG Owner:1; + ULONGLONG WriteThrough:1; + ULONGLONG CacheDisable:1; + ULONGLONG Accessed:1; + ULONGLONG Dirty:1; + ULONGLONG LargePage:1; + ULONGLONG Global:1; + ULONGLONG CopyOnWrite:1; + ULONGLONG Prototype: 1; + ULONGLONG reserved1: 1; + ULONGLONG PageFrameNumber:40; + ULONGLONG reserved2:11; + ULONGLONG NoExecute:1; } MMPTE_HARDWARE, *PMMPTE_HARDWARE; #else -typedef struct _MMPTE_HARDWARE -{ - ULONG Valid:1; - ULONG Writable:1; - ULONG Owner:1; - ULONG WriteThrough:1; - ULONG CacheDisable:1; - ULONG Accessed:1; - ULONG Dirty:1; - ULONG LargePage:1; - ULONG Global:1; - ULONG CopyOnWrite:1; - ULONG Prototype:1; - ULONG Write:1; - ULONG PageFrameNumber:20; -} MMPTE_HARDWARE, *PMMPTE_HARDWARE; +#error MMPTE_HARDWARE undeclared #endif // // Use the right PTE structure // -#define HARDWARE_PTE HARDWARE_PTE_X86 -#define PHARDWARE_PTE PHARDWARE_PTE_X86 +#define HARDWARE_PTE HARDWARE_PTE_AMD64 +#define PHARDWARE_PTE PHARDWARE_PTE_AMD64 #endif diff --git a/reactos/include/ndk/arch/mmtypes.h b/reactos/include/ndk/arch/mmtypes.h index 41df8085086..e83c9579e64 100644 --- a/reactos/include/ndk/arch/mmtypes.h +++ b/reactos/include/ndk/arch/mmtypes.h @@ -22,12 +22,14 @@ Author: // // Include the right file for this architecture. // -#if defined(_M_IX86) || defined(_M_AMD64) +#if defined(_M_IX86) #include #elif defined(_M_PPC) #include #elif defined(_M_ARM) #include +#elif defined(_M_AMD64) +#include #else #error "Unknown processor" #endif diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 6ae583fb968..aa5ed0b4b4a 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -1078,6 +1078,22 @@ static __inline__ __attribute__((always_inline)) unsigned long __readcr4(void) return value; } +#ifdef _M_AMD64 +static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr0" : : [Data] "q" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr3" : : [Data] "q" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) : "memory"); +} +#else static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) { __asm__("mov %[Data], %%cr0" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); @@ -1092,6 +1108,7 @@ static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned { __asm__("mov %[Data], %%cr4" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); } +#endif static __inline__ __attribute__((always_inline)) void __invlpg(void * const Address) { From 96888c6a6a4d43ab13e964cdb899b2e5dad0924c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 29 Jul 2008 15:30:15 +0000 Subject: [PATCH 088/388] remove useless cast svn path=/branches/ros-amd64-bringup/; revision=34926 --- reactos/include/ddk/winddk.h | 2 +- reactos/ntoskrnl/include/internal/ntoskrnl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 37df8515841..176f77e139d 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5735,7 +5735,7 @@ InterlockedExchangeAdd( #define InterlockedIncrement _InterlockedIncrement #define InterlockedDecrement _InterlockedDecrement #define InterlockedExchangeAdd _InterlockedExchangeAdd -#define InterlockedCompareExchange (LONG)_InterlockedCompareExchange +#define InterlockedCompareExchange _InterlockedCompareExchange #define InterlockedOr _InterlockedOr #define InterlockedAnd _InterlockedAnd #define InterlockedXor _InterlockedXor diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index f8da962d533..6e1232cbfef 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -30,7 +30,7 @@ // #define InterlockedDecrement _InterlockedDecrement #define InterlockedIncrement _InterlockedIncrement -#define InterlockedCompareExchange (LONG)_InterlockedCompareExchange +#define InterlockedCompareExchange _InterlockedCompareExchange #define InterlockedExchange _InterlockedExchange #define InterlockedExchangeAdd _InterlockedExchangeAdd From 256098d25462354fefeb006be36357d752f9b19f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 29 Jul 2008 19:09:56 +0000 Subject: [PATCH 089/388] I reworked the pagetable code a little. Now the first tables are static .bss tables. Later before switching to the kernel, we create a proper 4 level page table. Here we allocate the needed pages. Remove obsolete meminit hack. Add a few useful debug prints to setupldr and comment out return, when ext2 wasn't loaded. We now reach the point where we jump to ntoskrnl, but ntoskrnl is in a bad shape ;-) svn path=/branches/ros-amd64-bringup/; revision=34937 --- .../boot/freeldr/freeldr/arch/amd64/arch.S | 15 +- .../boot/freeldr/freeldr/arch/amd64/loader.c | 227 ++++++++---------- reactos/boot/freeldr/freeldr/arch/amd64/mb.S | 30 +-- .../freeldr/include/arch/amd64/amd64.h | 61 ++--- .../boot/freeldr/freeldr/include/reactos.h | 4 + reactos/boot/freeldr/freeldr/mm/meminit.c | 3 - .../boot/freeldr/freeldr/reactos/setupldr.c | 8 +- 7 files changed, 157 insertions(+), 191 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S index 5ddc4eb8610..a0c9b74044b 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S @@ -99,22 +99,27 @@ x86_16_BuildPageTables: pusha push es - mov ax, PML4_SEG + /* Get segment of pml4 */ + mov eax, offset _pml4_startup + shr eax, 4 mov es, ax cld xor di, di /* One entry in the PML4 pointing to PDP */ - mov eax, (PDP_PAGENUM << 12) | 0x00f + mov eax, offset _pdp_startup + or eax, 0x00f stosd + /* clear rest */ xor eax, eax mov cx, 0x03ff rep stosd /* One entry in the PDP pointing to PD */ - mov eax, (PD_PAGENUM << 12) | 0x00f + mov eax, offset _pd_startup + or eax, 0x00f stosd - + /* clear rest */ xor eax, eax mov ecx, 0x03ff rep stosd @@ -159,7 +164,7 @@ x86_16_SwitchToLong: mov eax, 0x00a0 // Set PAE and PGE: 10100000b mov cr4, eax - mov edx, PML4_ADDRESS // Point cr3 at PML4 + mov edx, offset _pml4_startup // Point cr3 at PML4 mov cr3, edx mov ecx, 0xC0000080 // Specify EFER MSR diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index adb50e986bf..9e629232f11 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -22,18 +22,15 @@ #define NDEBUG #include -#undef DbgPrint +//#undef DbgPrint /* Page Directory and Tables for non-PAE Systems */ -extern PAGE_DIRECTORY_X86 startup_pagedirectory; -extern PAGE_DIRECTORY_X86 lowmem_pagetable; -extern PAGE_DIRECTORY_X86 kernel_pagetable; -extern PAGE_DIRECTORY_X86 hyperspace_pagetable; -extern PAGE_DIRECTORY_X86 apic_pagetable; -extern PAGE_DIRECTORY_X86 kpcr_pagetable; -extern PAGE_DIRECTORY_X86 kuser_pagetable; +extern ULONG_PTR NextModuleBase; extern ULONG_PTR KernelBase; extern ROS_KERNEL_ENTRY_POINT KernelEntryPoint; + +PPAGE_DIRECTORY_AMD64 pPML4; + /* FUNCTIONS *****************************************************************/ /*++ @@ -56,57 +53,94 @@ VOID NTAPI FrLdrStartup(ULONG Magic) { - ASSERT(FALSE); -#if 0 /* Disable Interrupts */ _disable(); /* Re-initalize EFLAGS */ - Ke386EraseFlags(); + KeAmd64EraseFlags(); /* Initialize the page directory */ FrLdrSetupPageDirectory(); - /* Initialize Paging, Write-Protection and Load NTOSKRNL */ - FrLdrSetupPae(Magic); -#endif -} + /* Set the new PML4 */ + __writecr3((ULONGLONG)pPML4); -/*++ - * FrLdrSetupPae - * INTERNAL - * - * Configures PAE on a MP System, and sets the PDBR if it's supported, or if - * the system is UP. - * - * Params: - * Magic - Multiboot Magic - * - * Returns: - * None. - * - * Remarks: - * None. - * - *--*/ -VOID -FASTCALL -FrLdrSetupPae(ULONG Magic) -{ -#if 0 - ULONG_PTR PageDirectoryBaseAddress = (ULONG_PTR)&startup_pagedirectory; - - /* Set the PDBR */ - __writecr3(PageDirectoryBaseAddress); - - /* Enable Paging and Write Protect*/ - __writecr0(__readcr0() | X86_CR0_PG | X86_CR0_WP); +DbgPrint((DPRINT_WARNING, "Jumping to kernel @ %p.\n", KernelEntryPoint)); /* Jump to Kernel */ (*KernelEntryPoint)(Magic, &LoaderBlock); -#endif + } +PPAGE_DIRECTORY_AMD64 +FrLdrGetOrCreatePageDir(PPAGE_DIRECTORY_AMD64 pDir, ULONG Index) +{ + PPAGE_DIRECTORY_AMD64 pSubDir; + + if (!pDir) + return NULL; + + if (!pDir->Pde[Index].Valid) + { + pSubDir = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory); + if (!pSubDir) + return NULL; + RtlZeroMemory(pSubDir, PAGE_SIZE); + pDir->Pde[Index].PageFrameNumber = (ULONGLONG)pSubDir / PAGE_SIZE; + pDir->Pde[Index].Valid = 1; + pDir->Pde[Index].Write = 1; + } + else + { + pSubDir = (PPAGE_DIRECTORY_AMD64)((ULONGLONG)(pDir->Pde[Index].PageFrameNumber) * PAGE_SIZE); + } + return pSubDir; +} + +BOOLEAN +FrLdrMapSinglePage(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress) +{ + PPAGE_DIRECTORY_AMD64 pDir3, pDir2, pDir1; + ULONG Index; + + pDir3 = FrLdrGetOrCreatePageDir(pPML4, VAtoIndex4(VirtualAddress)); + pDir2 = FrLdrGetOrCreatePageDir(pDir3, VAtoIndex3(VirtualAddress)); + pDir1 = FrLdrGetOrCreatePageDir(pDir2, VAtoIndex2(VirtualAddress)); + + if (!pDir1) + return FALSE; + + Index = VAtoIndex1(VirtualAddress); + if (pDir1->Pde[Index].Valid) + { + return FALSE; + } + + pDir1->Pde[Index].Valid = 1; + pDir1->Pde[Index].Write = 1; + pDir1->Pde[Index].PageFrameNumber = PhysicalAddress / PAGE_SIZE; + + return TRUE; +} + +ULONG +FrLdrMapRangeOfPages(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress, ULONG cPages) +{ + ULONG i; + + for (i = 0; i < cPages; i++) + { + if (!FrLdrMapSinglePage(VirtualAddress, PhysicalAddress)) + { + return i; + } + VirtualAddress += PAGE_SIZE; + PhysicalAddress += PAGE_SIZE; + } + return i; +} + + /*++ * FrLdrSetupPageDirectory * INTERNAL @@ -128,89 +162,38 @@ VOID FASTCALL FrLdrSetupPageDirectory(VOID) { -#if 0 - PPAGE_DIRECTORY_X86 PageDir; - ULONG KernelPageTableIndex; - ULONG i; + ULONG KernelPages; - /* Get the Kernel Table Index */ - KernelPageTableIndex = KernelBase >> PDE_SHIFT; + /* Allocate a Page for the PML4 */ + pPML4 = MmAllocateMemoryWithType(4096, LoaderSpecialMemory); - /* Get the Startup Page Directory */ - PageDir = (PPAGE_DIRECTORY_X86)&startup_pagedirectory; + ASSERT(pPML4); - /* Set up the Low Memory PDE */ - PageDir->Pde[LowMemPageTableIndex].Valid = 1; - PageDir->Pde[LowMemPageTableIndex].Write = 1; - PageDir->Pde[LowMemPageTableIndex].PageFrameNumber = PaPtrToPfn(lowmem_pagetable); + /* The page tables are located at 0xfffff68000000000 + * We create a recursive self mapping through all 4 levels at + * virtual address 0xfffff6fb7dbedf68 */ + pPML4->Pde[VAtoIndex4(PML4_BASE)].Valid = 1; + pPML4->Pde[VAtoIndex4(PML4_BASE)].Write = 1; + pPML4->Pde[VAtoIndex4(PML4_BASE)].PageFrameNumber = PtrToPfn(PML4_BASE); - /* Set up the Kernel PDEs */ - PageDir->Pde[KernelPageTableIndex].Valid = 1; - PageDir->Pde[KernelPageTableIndex].Write = 1; - PageDir->Pde[KernelPageTableIndex].PageFrameNumber = PaPtrToPfn(kernel_pagetable); - PageDir->Pde[KernelPageTableIndex + 1].Valid = 1; - PageDir->Pde[KernelPageTableIndex + 1].Write = 1; - PageDir->Pde[KernelPageTableIndex + 1].PageFrameNumber = PaPtrToPfn(kernel_pagetable + 4096); + ASSERT(VAtoIndex4(PML4_BASE) == 0x1ed); + ASSERT(VAtoIndex3(PML4_BASE) == 0x1ed); + ASSERT(VAtoIndex2(PML4_BASE) == 0x1ed); + ASSERT(VAtoIndex1(PML4_BASE) == 0x1ed); - /* Set up the Startup PDE */ - PageDir->Pde[StartupPageTableIndex].Valid = 1; - PageDir->Pde[StartupPageTableIndex].Write = 1; - PageDir->Pde[StartupPageTableIndex].PageFrameNumber = PaPtrToPfn(startup_pagedirectory); + /* Setup low memory pages */ + if (FrLdrMapRangeOfPages(0, 0, 1024) < 1024) + { + DbgPrint((DPRINT_WARNING, "Could not map low memory pages.\n")); + } - /* Set up the Hyperspace PDE */ - PageDir->Pde[HyperspacePageTableIndex].Valid = 1; - PageDir->Pde[HyperspacePageTableIndex].Write = 1; - PageDir->Pde[HyperspacePageTableIndex].PageFrameNumber = PaPtrToPfn(hyperspace_pagetable); + /* Setup kernel pages */ + KernelPages = (ROUND_TO_PAGES(NextModuleBase - KERNEL_BASE_PHYS) / PAGE_SIZE); + DbgPrint((DPRINT_WARNING, "Trying to map %d pages for kernel.\n", KernelPages)); + if (FrLdrMapRangeOfPages(KernelBase, KERNEL_BASE_PHYS, KernelPages) != KernelPages) + { + DbgPrint((DPRINT_WARNING, "Could not map %d kernel pages.\n", KernelPages)); + } - /* Set up the HAL PDE */ - PageDir->Pde[HalPageTableIndex].Valid = 1; - PageDir->Pde[HalPageTableIndex].Write = 1; - PageDir->Pde[HalPageTableIndex].PageFrameNumber = PaPtrToPfn(apic_pagetable); - - /* Set up Low Memory PTEs */ - PageDir = (PPAGE_DIRECTORY_X86)&lowmem_pagetable; - for (i=0; i<1024; i++) - { - PageDir->Pde[i].Valid = 1; - PageDir->Pde[i].Write = 1; - PageDir->Pde[i].Owner = 1; - PageDir->Pde[i].PageFrameNumber = PaToPfn(i * PAGE_SIZE); - } - - /* Set up Kernel PTEs */ - PageDir = (PPAGE_DIRECTORY_X86)&kernel_pagetable; - for (i=0; i<1536; i++) - { - PageDir->Pde[i].Valid = 1; - PageDir->Pde[i].Write = 1; - PageDir->Pde[i].PageFrameNumber = PaToPfn(KERNEL_BASE_PHYS + i * PAGE_SIZE); - } - - /* Setup APIC Base */ - PageDir = (PPAGE_DIRECTORY_X86)&apic_pagetable; - PageDir->Pde[0].Valid = 1; - PageDir->Pde[0].Write = 1; - PageDir->Pde[0].CacheDisable = 1; - PageDir->Pde[0].WriteThrough = 1; - PageDir->Pde[0].PageFrameNumber = PaToPfn(HAL_BASE); - PageDir->Pde[0x200].Valid = 1; - PageDir->Pde[0x200].Write = 1; - PageDir->Pde[0x200].CacheDisable = 1; - PageDir->Pde[0x200].WriteThrough = 1; - PageDir->Pde[0x200].PageFrameNumber = PaToPfn(HAL_BASE + KERNEL_BASE_PHYS); - - /* Setup KUSER_SHARED_DATA Base */ - PageDir->Pde[0x1F0].Valid = 1; - PageDir->Pde[0x1F0].Write = 1; - PageDir->Pde[0x1F0].PageFrameNumber = 2; - - /* Setup KPCR Base*/ - PageDir->Pde[0x1FF].Valid = 1; - PageDir->Pde[0x1FF].Write = 1; - PageDir->Pde[0x1FF].PageFrameNumber = 1; - - /* Zero shared data */ - RtlZeroMemory((PVOID)(2 << MM_PAGE_SHIFT), PAGE_SIZE); -#endif } diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/mb.S b/reactos/boot/freeldr/freeldr/arch/amd64/mb.S index d87e45758b8..bdb4f5106c9 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/mb.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/mb.S @@ -28,16 +28,12 @@ * Here we assume the kernel is loaded at 1mb * This boots the kernel */ - .code32 + .code64 .globl _PageDirectoryStart - .globl _startup_pagedirectory - .globl _lowmem_pagetable - .globl _kernel_pagetable - .globl _hyperspace_pagetable - .globl _apic_pagetable - .globl _kpcr_pagetable - .globl _kuser_pagetable + .globl _pml4_startup + .globl _pdp_startup + .globl _pd_startup .globl _PageDirectoryEnd @@ -55,25 +51,13 @@ EXTERN(_reactos_memory_map) .bss _PageDirectoryStart: -_startup_pagedirectory: +_pml4_startup: .fill 4096, 1, 0 -_lowmem_pagetable: +_pdp_startup: .fill 4096, 1, 0 -_kernel_pagetable: - .fill 2*4096, 1, 0 - -_hyperspace_pagetable: +_pd_startup: .fill 4096, 1, 0 - -_apic_pagetable: - .fill 4096, 1, 0 - -_kpcr_pagetable: - .fill 4096, 1, 0 - -_kuser_pagetable: - .fill 4096, 1, 0 _PageDirectoryEnd: diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index e4509016e98..9aa40284546 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -23,51 +23,38 @@ #define STACK64ADDR 0x74000 /* The 64-bit stack top will be at 0x74000 */ +/* Long mode selectors */ #define LMODE_CS 0x08 #define LMODE_DS 0x10 -/* Where we put out initial page tables */ -#define PML4_PAGENUM 60 // Put it high enough so it doesn't interfere with freeldr +#define VA_MASK 0x0000FFFFFFFFFFFFUL +#define PML4_SHIFT (12+9+9+9) +#define PDP_SHIFT (12+9+9) +#define PD_SHIFT (12+9) +#define PT_SHIFT 12 -#define PAGESIZE 4096 -#define PDP_PAGENUM (PML4_PAGENUM + 1) -#define PD_PAGENUM (PDP_PAGENUM + 1) -#define PML4_ADDRESS (PML4_PAGENUM * PAGESIZE) -#define PDP_ADDRESS (PDP_PAGENUM * PAGESIZE) -#define PML4_SEG (PML4_ADDRESS / 16) -#define PML4_PAGES 3 -#define PAGETABLE_SIZE PML4_PAGES * PAGESIZE +#define PtrToPfn(p) \ + ((((ULONGLONG)p) >> PT_SHIFT) & 0xffffffffffULL) + +#define VAtoIndex4(va) (((va) >> PML4_SHIFT) & 0x1FF) +#define VAtoIndex3(va) (((va) >> PDP_SHIFT) & 0x1FF) +#define VAtoIndex2(va) (((va) >> PD_SHIFT) & 0x1FF) +#define VAtoIndex1(va) (((va) >> PT_SHIFT) & 0x1FF) + +#define PAGETABLE_BASE 0xfffff68000000000ULL +#define PML4_BASE 0xfffff6fb7dbedf68ULL +#define HYPERSPACE_BASE 0xfffff70000000000ULL +#define HAL_BASE 0xffffffff80000000ULL +#define APIC_BASE 0xffffffffff000000ULL // FIXME + +#define NUM_PAGES_KERNEL -#if 0 #ifndef ASM -typedef struct +typedef struct _PAGE_DIRECTORY_AMD64 { - unsigned long long rax; - unsigned long long rbx; - unsigned long long rcx; - unsigned long long rdx; + HARDWARE_PTE Pde[512]; +} PAGE_DIRECTORY_AMD64, *PPAGE_DIRECTORY_AMD64; - unsigned long long rsi; - unsigned long long rdi; - - unsigned long long r8; - unsigned long long r9; - unsigned long long r10; - unsigned long long r11; - unsigned long long r12; - unsigned long long r13; - unsigned long long r14; - unsigned long long r15; - - unsigned short ds; - unsigned short es; - unsigned short fs; - unsigned short gs; - - unsigned long long rflags; - -} QWORDREGS; -#endif /* ! ASM */ #endif #endif /* __AMD64_AMD64_H_ */ diff --git a/reactos/boot/freeldr/freeldr/include/reactos.h b/reactos/boot/freeldr/freeldr/include/reactos.h index 837b11cd449..d38a3cb1631 100644 --- a/reactos/boot/freeldr/freeldr/include/reactos.h +++ b/reactos/boot/freeldr/freeldr/include/reactos.h @@ -23,6 +23,8 @@ /* Base Addres of Kernel in Physical Memory */ #define KERNEL_BASE_PHYS 0x800000 +#if !defined(_M_AMD64) + /* Bits to shift to convert a Virtual Address into an Offset in the Page Table */ #define PFN_SHIFT 12 @@ -53,6 +55,8 @@ typedef struct _PAGE_DIRECTORY_X86 HARDWARE_PTE Pde[1024]; } PAGE_DIRECTORY_X86, *PPAGE_DIRECTORY_X86; +#endif + /////////////////////////////////////////////////////////////////////////////////////// // // ReactOS Loading Functions diff --git a/reactos/boot/freeldr/freeldr/mm/meminit.c b/reactos/boot/freeldr/freeldr/mm/meminit.c index 0b41dd7b1fe..2efab391158 100644 --- a/reactos/boot/freeldr/freeldr/mm/meminit.c +++ b/reactos/boot/freeldr/freeldr/mm/meminit.c @@ -106,9 +106,6 @@ BOOLEAN MmInitializeMemoryManager(VOID) MmMarkPagesInLookupTable(PageLookupTableAddress, 0x90, 0x10, LoaderOsloaderHeap); // Disk read buffer for int 13h. DISKREADBUFFER MmMarkPagesInLookupTable(PageLookupTableAddress, 0xA0, 0x60, LoaderFirmwarePermanent); // ROM / Video MmMarkPagesInLookupTable(PageLookupTableAddress, 0xFFF, 1, LoaderSpecialMemory); // unusable memory -#if defined (_M_AMD64) - MmMarkPagesInLookupTable(PageLookupTableAddress, PML4_PAGENUM, PML4_PAGES, LoaderSpecialMemory); // the page table -#endif #elif __arm__ MmMarkPagesInLookupTable(PageLookupTableAddress, 0x00, 1, LoaderFirmwarePermanent); // arm exception handlers MmMarkPagesInLookupTable(PageLookupTableAddress, 0x01, 7, LoaderFirmwareTemporary); // arm board block + freeldr stack + cmdline diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index f36ddded09d..f2163f2f3c4 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -406,7 +406,10 @@ VOID RunLoader(VOID) /* Load ext2.sys (could be loaded by the setup prog!) */ if (!LoadDriver(SourcePath, "ext2.sys")) - return; + { + DbgPrint((DPRINT_WARNING, "Could not load ext2\n")); +// return; + } /* Load additional files specified in txtsetup.inf */ if (InfFindFirstLine(InfHandle, @@ -423,7 +426,10 @@ VOID RunLoader(VOID) if (strcmp(Media, "x") == 0) { if (!LoadDriver(SourcePath, DriverName)) + { + DbgPrint((DPRINT_WARNING, "could not load %s, %s\n", SourcePath, DriverName)); return; + } } } } while (InfFindNextLine(&InfContext, &InfContext)); From a23e33144d3ac8e49e540737b12762c52d4c27de Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 30 Jul 2008 00:25:15 +0000 Subject: [PATCH 090/388] fix several ULONG / ULONG_PTR / SIZE_T issues. svn path=/branches/ros-amd64-bringup/; revision=34939 --- reactos/ntoskrnl/mm/cont.c | 2 +- reactos/ntoskrnl/mm/iospace.c | 6 +++--- reactos/ntoskrnl/mm/mdlsup.c | 4 ++-- reactos/ntoskrnl/mm/mm.c | 4 ++-- reactos/ntoskrnl/mm/mminit.c | 2 +- reactos/ntoskrnl/mm/ncache.c | 2 +- reactos/ntoskrnl/mm/pool.c | 8 ++++---- reactos/ntoskrnl/mm/procsup.c | 2 +- reactos/ntoskrnl/mm/region.c | 2 +- reactos/ntoskrnl/mm/rpoolmgr.h | 4 ++-- reactos/ntoskrnl/mm/section.c | 10 ++++++---- reactos/ntoskrnl/mm/sysldr.c | 4 ++-- reactos/ntoskrnl/mm/virtual.c | 16 ++++++++-------- 13 files changed, 34 insertions(+), 32 deletions(-) diff --git a/reactos/ntoskrnl/mm/cont.c b/reactos/ntoskrnl/mm/cont.c index 899c7ffefa0..4000a9b455d 100644 --- a/reactos/ntoskrnl/mm/cont.c +++ b/reactos/ntoskrnl/mm/cont.c @@ -225,7 +225,7 @@ MmFreeContiguousMemory(IN PVOID BaseAddress) */ VOID STDCALL MmFreeContiguousMemorySpecifyCache(IN PVOID BaseAddress, - IN ULONG NumberOfBytes, + IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType) { MmLockAddressSpace(MmGetKernelAddressSpace()); diff --git a/reactos/ntoskrnl/mm/iospace.c b/reactos/ntoskrnl/mm/iospace.c index e19d5ce2d9d..2e78a2f7d0e 100644 --- a/reactos/ntoskrnl/mm/iospace.c +++ b/reactos/ntoskrnl/mm/iospace.c @@ -137,7 +137,7 @@ MmMapIoSpace (IN PHYSICAL_ADDRESS PhysicalAddress, */ VOID STDCALL MmUnmapIoSpace (IN PVOID BaseAddress, - IN ULONG NumberOfBytes) + IN SIZE_T NumberOfBytes) { LONG Offset; PVOID Address = BaseAddress; @@ -163,7 +163,7 @@ MmUnmapIoSpace (IN PVOID BaseAddress, */ PVOID STDCALL MmMapVideoDisplay (IN PHYSICAL_ADDRESS PhysicalAddress, - IN ULONG NumberOfBytes, + IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType) { return MmMapIoSpace (PhysicalAddress, NumberOfBytes, (BOOLEAN)CacheType); @@ -175,7 +175,7 @@ MmMapVideoDisplay (IN PHYSICAL_ADDRESS PhysicalAddress, */ VOID STDCALL MmUnmapVideoDisplay (IN PVOID BaseAddress, - IN ULONG NumberOfBytes) + IN SIZE_T NumberOfBytes) { MmUnmapIoSpace (BaseAddress, NumberOfBytes); } diff --git a/reactos/ntoskrnl/mm/mdlsup.c b/reactos/ntoskrnl/mm/mdlsup.c index f806031f9ec..1de4283f8f3 100644 --- a/reactos/ntoskrnl/mm/mdlsup.c +++ b/reactos/ntoskrnl/mm/mdlsup.c @@ -81,7 +81,7 @@ PMDL NTAPI MmCreateMdl(IN PMDL Mdl, IN PVOID Base, - IN ULONG Length) + IN SIZE_T Length) { ULONG Size; @@ -107,7 +107,7 @@ MmCreateMdl(IN PMDL Mdl, ULONG NTAPI MmSizeOfMdl(IN PVOID Base, - IN ULONG Length) + IN SIZE_T Length) { /* Return the MDL size */ return sizeof(MDL) + (ADDRESS_AND_SIZE_TO_SPAN_PAGES(Base, Length) * sizeof(PFN_NUMBER)); diff --git a/reactos/ntoskrnl/mm/mm.c b/reactos/ntoskrnl/mm/mm.c index 85001b0a288..3d442cee761 100644 --- a/reactos/ntoskrnl/mm/mm.c +++ b/reactos/ntoskrnl/mm/mm.c @@ -14,7 +14,7 @@ /* GLOBALS *****************************************************************/ -ULONG MmUserProbeAddress = 0; +ULONG_PTR MmUserProbeAddress = 0; PVOID MmHighestUserAddress = NULL; PBOOLEAN Mm64BitPhysicalAddress = FALSE; PVOID MmSystemRangeStart = NULL; @@ -394,7 +394,7 @@ NTSTATUS NTAPI NtResetWriteWatch(IN HANDLE ProcessHandle, IN PVOID BaseAddress, - IN ULONG RegionSize) + IN SIZE_T RegionSize) { UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index b606a086a3b..d32e00e4a12 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -374,7 +374,7 @@ MmInit1(VOID) if (MiDbgEnableMdDump) MiDbgDumpMemoryDescriptors(); /* Set the page directory */ - PsGetCurrentProcess()->Pcb.DirectoryTableBase.LowPart = (ULONG)MmGetPageDirectory(); + PsGetCurrentProcess()->Pcb.DirectoryTableBase.QuadPart = (ULONG_PTR)MmGetPageDirectory(); /* Get the size of FreeLDR's image allocations */ MmBootImageSize = KeLoaderBlock->Extension->LoaderPagesSpanned; diff --git a/reactos/ntoskrnl/mm/ncache.c b/reactos/ntoskrnl/mm/ncache.c index 66eed2ebe8b..947b2fcc79f 100644 --- a/reactos/ntoskrnl/mm/ncache.c +++ b/reactos/ntoskrnl/mm/ncache.c @@ -115,7 +115,7 @@ MmFreeNonCachedPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, * @implemented */ VOID STDCALL MmFreeNonCachedMemory (IN PVOID BaseAddress, - IN ULONG NumberOfBytes) + IN SIZE_T NumberOfBytes) { MmLockAddressSpace(MmGetKernelAddressSpace()); MmFreeMemoryAreaByPtr(MmGetKernelAddressSpace(), diff --git a/reactos/ntoskrnl/mm/pool.c b/reactos/ntoskrnl/mm/pool.c index 743bca6c121..a651f76b583 100644 --- a/reactos/ntoskrnl/mm/pool.c +++ b/reactos/ntoskrnl/mm/pool.c @@ -50,7 +50,7 @@ EiAllocatePool(POOL_TYPE PoolType, * @implemented */ PVOID STDCALL -ExAllocatePool (POOL_TYPE PoolType, ULONG NumberOfBytes) +ExAllocatePool (POOL_TYPE PoolType, SIZE_T NumberOfBytes) /* * FUNCTION: Allocates pool memory of a specified type and returns a pointer * to the allocated block. This routine is used for general purpose allocation @@ -99,7 +99,7 @@ ExAllocatePool (POOL_TYPE PoolType, ULONG NumberOfBytes) * @implemented */ PVOID STDCALL -ExAllocatePoolWithTag (POOL_TYPE PoolType, ULONG NumberOfBytes, ULONG Tag) +ExAllocatePoolWithTag (POOL_TYPE PoolType, SIZE_T NumberOfBytes, ULONG Tag) { PVOID Block; @@ -127,7 +127,7 @@ ExAllocatePoolWithTag (POOL_TYPE PoolType, ULONG NumberOfBytes, ULONG Tag) * @implemented */ PVOID STDCALL -ExAllocatePoolWithQuota (POOL_TYPE PoolType, ULONG NumberOfBytes) +ExAllocatePoolWithQuota (POOL_TYPE PoolType, SIZE_T NumberOfBytes) { return(ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, TAG_NONE)); } @@ -180,7 +180,7 @@ _SEH_FILTER(FreeAndGoOn) PVOID NTAPI ExAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType, - IN ULONG NumberOfBytes, + IN SIZE_T NumberOfBytes, IN ULONG Tag) { PEPROCESS Process; diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index b679a892856..50ffc310de1 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -384,7 +384,7 @@ MmCreatePeb(PEPROCESS Process) ImageConfigData = RtlImageDirectoryEntryToData(Peb->ImageBaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, - &ViewSize); + (PULONG)&ViewSize); ProbeForRead(ImageConfigData, sizeof(IMAGE_LOAD_CONFIG_DIRECTORY), diff --git a/reactos/ntoskrnl/mm/region.c b/reactos/ntoskrnl/mm/region.c index d74184f9b74..41e97516216 100644 --- a/reactos/ntoskrnl/mm/region.c +++ b/reactos/ntoskrnl/mm/region.c @@ -238,7 +238,7 @@ MmAlterRegion(PMM_AVL_TABLE AddressSpace, PVOID BaseAddress, VOID NTAPI -MmInitializeRegion(PLIST_ENTRY RegionListHead, ULONG Length, ULONG Type, +MmInitializeRegion(PLIST_ENTRY RegionListHead, SIZE_T Length, ULONG Type, ULONG Protect) { PMM_REGION Region; diff --git a/reactos/ntoskrnl/mm/rpoolmgr.h b/reactos/ntoskrnl/mm/rpoolmgr.h index 2935ab8274b..89ff06351cc 100644 --- a/reactos/ntoskrnl/mm/rpoolmgr.h +++ b/reactos/ntoskrnl/mm/rpoolmgr.h @@ -12,7 +12,7 @@ typedef unsigned long rulong; -#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize) +#define R_IS_POOL_PTR(pool,ptr) (((void*)(ULONG_PTR)(ptr) >= pool->UserBase) && ((ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize))) #define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) ) #define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz >= sizeof(R_FREE) && sz < pool->UserSize ) @@ -712,7 +712,7 @@ RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align ) if ( R_IS_POOL_PTR(pool,NumberOfBytes) ) { R_DEBUG("red zone verification requested for block 0x%X\n", NumberOfBytes ); - RUsedRedZoneCheck(pool,RBodyToHdr((void*)NumberOfBytes), (char*)NumberOfBytes, __FILE__, __LINE__ ); + RUsedRedZoneCheck(pool,RBodyToHdr((void*)(ULONG_PTR)NumberOfBytes), (char*)(ULONG_PTR)NumberOfBytes, __FILE__, __LINE__ ); R_RELEASE_MUTEX(pool); return NULL; } diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 08fa53002a0..cffbfb3c6e4 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -2382,6 +2382,7 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject, LARGE_INTEGER Offset; CHAR Buffer; FILE_STANDARD_INFORMATION FileInfo; + ULONG Length; /* * Create the section @@ -2444,7 +2445,8 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject, FileStandardInformation, sizeof(FILE_STANDARD_INFORMATION), &FileInfo, - &Iosb.Information); + &Length); + Iosb.Information = Length; if (!NT_SUCCESS(Status)) { ObDereferenceObject(Section); @@ -4188,8 +4190,8 @@ NTSTATUS STDCALL NtQuerySection(IN HANDLE SectionHandle, IN SECTION_INFORMATION_CLASS SectionInformationClass, OUT PVOID SectionInformation, - IN ULONG SectionInformationLength, - OUT PULONG ResultLength OPTIONAL) + IN SIZE_T SectionInformationLength, + OUT PSIZE_T ResultLength OPTIONAL) { PROS_SECTION_OBJECT Section; KPROCESSOR_MODE PreviousMode; @@ -4740,7 +4742,7 @@ MmForceSectionClosed ( NTSTATUS STDCALL MmMapViewInSystemSpace (IN PVOID SectionObject, OUT PVOID * MappedBase, - IN OUT PULONG ViewSize) + IN OUT PSIZE_T ViewSize) { PROS_SECTION_OBJECT Section; PMM_AVL_TABLE AddressSpace; diff --git a/reactos/ntoskrnl/mm/sysldr.c b/reactos/ntoskrnl/mm/sysldr.c index aacc93c4836..32a5fb8da38 100644 --- a/reactos/ntoskrnl/mm/sysldr.c +++ b/reactos/ntoskrnl/mm/sysldr.c @@ -647,7 +647,7 @@ MiSnapThunk(IN PVOID DllBase, ForwardName->Hint = 0; /* Set the new address */ - *(PULONG)&ForwardThunk.u1.AddressOfData = (ULONG)ForwardName; + ForwardThunk.u1.AddressOfData = (ULONG_PTR)ForwardName; /* Snap the forwarder */ Status = MiSnapThunk(LdrEntry->DllBase, @@ -1289,7 +1289,7 @@ MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); - PsNtosImageBase = (ULONG)LdrEntry->DllBase; + PsNtosImageBase = (ULONG_PTR)LdrEntry->DllBase; /* Loop the loader block */ while (NextEntry != ListHead) diff --git a/reactos/ntoskrnl/mm/virtual.c b/reactos/ntoskrnl/mm/virtual.c index b3e9f6f9da0..81f55033e17 100644 --- a/reactos/ntoskrnl/mm/virtual.c +++ b/reactos/ntoskrnl/mm/virtual.c @@ -678,8 +678,8 @@ NTAPI NtReadVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, OUT PVOID Buffer, - IN ULONG NumberOfBytesToRead, - OUT PULONG NumberOfBytesRead OPTIONAL) + IN SIZE_T NumberOfBytesToRead, + OUT PSIZE_T NumberOfBytesRead OPTIONAL) { KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); PEPROCESS Process; @@ -765,8 +765,8 @@ NTAPI NtWriteVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN PVOID Buffer, - IN ULONG NumberOfBytesToWrite, - OUT PULONG NumberOfBytesWritten OPTIONAL) + IN SIZE_T NumberOfBytesToWrite, + OUT PSIZE_T NumberOfBytesWritten OPTIONAL) { KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); PEPROCESS Process; @@ -950,8 +950,8 @@ NtQueryVirtualMemory(IN HANDLE ProcessHandle, IN PVOID Address, IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass, OUT PVOID VirtualMemoryInformation, - IN ULONG Length, - OUT PULONG UnsafeResultLength) + IN SIZE_T Length, + OUT PSIZE_T UnsafeResultLength) { NTSTATUS Status = STATUS_SUCCESS; ULONG ResultLength = 0; @@ -1062,8 +1062,8 @@ NTSTATUS NTAPI NtUnlockVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, - IN ULONG NumberOfBytesToUnlock, - OUT PULONG NumberOfBytesUnlocked OPTIONAL) + IN SIZE_T NumberOfBytesToUnlock, + OUT PSIZE_T NumberOfBytesUnlocked OPTIONAL) { UNIMPLEMENTED; if (NumberOfBytesUnlocked) *NumberOfBytesUnlocked = 0; From 1bbf3fa9ac2266c5eb98a29eb091e261ee1f6572 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 30 Jul 2008 00:30:00 +0000 Subject: [PATCH 091/388] - fix ExQueryPoolBlockSize prototype - make KI_USER_SHARED_DATA and IMAGE_ORDINAL_FLAG64 a ULONGLONG - fix definition if IMAGE_OPTIONAL_HEADER64 - add KPCR structure - add __readcrx intrinsics - svn path=/branches/ros-amd64-bringup/; revision=34940 --- reactos/include/ddk/ntifs.h | 2 +- reactos/include/ddk/winddk.h | 30 +++++++++- reactos/include/psdk/intrin_x86.h | 91 +++++++++++++++++++++---------- reactos/include/psdk/winnt.h | 4 +- 4 files changed, 93 insertions(+), 34 deletions(-) diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index 53ab4a08fb8..8ad9a418bd3 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -2499,7 +2499,7 @@ ExDisableResourceBoostLite ( ); NTKERNELAPI -ULONG +SIZE_T NTAPI ExQueryPoolBlockSize ( IN PVOID PoolBlock, diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 176f77e139d..598094d4799 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5485,7 +5485,28 @@ KeGetCurrentThread( #define PROFILE_LEVEL 15 #define HIGH_LEVEL 15 -#define KI_USER_SHARED_DATA 0xFFFFF78000000000 +#define KI_USER_SHARED_DATA 0xFFFFF78000000000ULL + +typedef struct _KPCR +{ + NT_TIB NtTib; + struct _KPRCB *CurrentPrcb; + ULONG64 SavedRcx; + ULONG64 SavedR11; + KIRQL Irql; + UCHAR SecondLevelCacheAssociativity; + UCHAR Number; + UCHAR Fill0; + ULONG Irr; + ULONG IrrActive; + ULONG Idr; + USHORT MajorVersion; + USHORT MinorVersion; + ULONG StallScaleFactor; + union _KIDTENTRY64 *IdtBase; + union _KGDTENTRY64 *GdtBase; + struct _KTSS64 *TssBase; +} KPCR, *PKPCR; typedef struct _KFLOATING_SAVE { ULONG Dummy; @@ -5503,6 +5524,13 @@ NTAPI KeGetCurrentThread( VOID); +FORCEINLINE +ULONG +KeGetCurrentProcessorNumber(VOID) +{ + return (ULONG)__readgsbyte(FIELD_OFFSET(KPCR, Number)); +} + #elif defined(__PowerPC__) typedef ULONG PFN_NUMBER, *PPFN_NUMBER; diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index aa5ed0b4b4a..a78a262f093 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -1050,6 +1050,67 @@ static __inline__ __attribute__((always_inline)) void _enable(void) /*** Protected memory management ***/ + +#ifdef _M_AMD64 +static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr0" : : [Data] "q" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr3" : : [Data] "q" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr0(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr0, %q[value]" : [value] "=q" (value)); + return value; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr2(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr2, %q[value]" : [value] "=q" (value)); + return value; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr3(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr3, %q[value]" : [value] "=q" (value)); + return value; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr4(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr4, %q[value]" : [value] "=q" (value)); + return value; +} + +#else +static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) +{ + __asm__("mov %[Data], %%cr0" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) +{ + __asm__("mov %[Data], %%cr3" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) +{ + __asm__("mov %[Data], %%cr4" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); +} + static __inline__ __attribute__((always_inline)) unsigned long __readcr0(void) { unsigned long value; @@ -1078,36 +1139,6 @@ static __inline__ __attribute__((always_inline)) unsigned long __readcr4(void) return value; } -#ifdef _M_AMD64 -static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) -{ - __asm__("movq %q[Data], %%cr0" : : [Data] "q" (Data) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) -{ - __asm__("movq %q[Data], %%cr3" : : [Data] "q" (Data) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) -{ - __asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) : "memory"); -} -#else -static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr0" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr3" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr4" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} #endif static __inline__ __attribute__((always_inline)) void __invlpg(void * const Address) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index f7b6c05f73f..4a11311df38 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -3388,7 +3388,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER64 { WORD MinorImageVersion; WORD MajorSubsystemVersion; WORD MinorSubsystemVersion; - DWORD Reserved1; + DWORD Win32VersionValue; DWORD SizeOfImage; DWORD SizeOfHeaders; DWORD CheckSum; @@ -3647,7 +3647,7 @@ typedef struct _IMAGE_THUNK_DATA32 { } IMAGE_THUNK_DATA32; typedef IMAGE_THUNK_DATA32 *PIMAGE_THUNK_DATA32; -#define IMAGE_ORDINAL_FLAG64 0x8000000000000000 +#define IMAGE_ORDINAL_FLAG64 0x8000000000000000ULL #define IMAGE_ORDINAL_FLAG32 0x80000000 #define IMAGE_ORDINAL64(Ordinal) (Ordinal & 0xffff) #define IMAGE_ORDINAL32(Ordinal) (Ordinal & 0xffff) From bed58e73c90a4ab35dd308b4f49a5ed9fd581860 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 30 Jul 2008 00:31:41 +0000 Subject: [PATCH 092/388] - fix usage of InterlockedExchangeAddSizeT svn path=/branches/ros-amd64-bringup/; revision=34941 --- reactos/ntoskrnl/include/internal/ex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index 6f173ded0af..3881a335703 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -934,8 +934,8 @@ ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock) ASSERT(PushLock->Waiting || PushLock->Shared == 0); /* Unlock the pushlock */ - OldValue.Value = InterlockedExchangeAddSizeT((PLONG)PushLock, - -(LONG)EX_PUSH_LOCK_LOCK); + OldValue.Value = InterlockedExchangeAddSizeT((PSIZE_T)PushLock, + -(SIZE_T)EX_PUSH_LOCK_LOCK); /* Sanity checks */ ASSERT(OldValue.Locked); From 9318fe48a0eece6299be2ff4641686bf09baefea Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 30 Jul 2008 00:54:12 +0000 Subject: [PATCH 093/388] - add stubbed out mm/amd64/page.c - add amd64 specific mm.h - add a temp hack (can't inline a function with SEH atm) - add baseaddress and entrypoint to ntoskrnl rbuild - add all mm files to ntoskrnl rbuild - update subs file svn path=/branches/ros-amd64-bringup/; revision=34942 --- reactos/ntoskrnl/amd64stubs.c | 128 -------- reactos/ntoskrnl/include/internal/amd64/mm.h | 2 +- reactos/ntoskrnl/include/internal/ntoskrnl.h | 12 + reactos/ntoskrnl/mm/amd64/page.c | 323 +++++++++++++++++++ reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 29 +- 5 files changed, 353 insertions(+), 141 deletions(-) create mode 100644 reactos/ntoskrnl/mm/amd64/page.c diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index 7e3f0dc6de3..4c98dddfdec 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -15,39 +15,25 @@ STUB(KeNumberProcessors) STUB(KeBugcheckCallbackListHead) STUB(NtAdjustGroupsToken) STUB(NtAdjustPrivilegesToken) -STUB(NtAllocateUserPhysicalPages) -STUB(NtAreMappedFilesTheSame) -STUB(MmUserProbeAddress) -STUB(MmSizeOfMdl) -STUB(MmBuildMdlForNonPagedPool) -STUB(MmMapViewOfSection) STUB(ExpInterlockedPushEntrySList) -STUB(ExAllocatePool) -STUB(ExFreePool) -STUB(ExFreePoolWithTag) -STUB(ExAllocatePoolWithTag) STUB(PsGetCurrentThreadId) STUB(NtContinue) STUB(NtCreateEvent) STUB(NtCreateMutant) -STUB(NtCreateSection) STUB(NtCreateSemaphore) STUB(NtCreateThread) STUB(NtCreateTimer) STUB(NtCreateToken) STUB(NtDebugContinue) STUB(NtDuplicateToken) -STUB(NtExtendSection) STUB(NtFilterToken) STUB(NtFlushInstructionCache) -STUB(NtFreeUserPhysicalPages) STUB(NtDebugActiveProcess) STUB(KeActiveProcessors) STUB(KeDisableInterrupts) STUB(KiSwapContext) STUB(KeContextToTrapFrame) STUB(KiDispatchException) -STUB(MmSystemRangeStart) STUB(MiGetUserPageDirectoryCount) STUB(MmStats) STUB(PsCreateSystemThread) @@ -55,7 +41,6 @@ STUB(ExAcquireResourceLock) STUB(ExReleaseResourceLock) STUB(MiNonPagedPoolLength) STUB(MiNonPagedPoolStart) -STUB(MmGetPfnForProcess) STUB(KiInitializeUserApc) STUB(KiComputeTimerTableIndex) STUB(KeBugcheckReasonCallbackListHead) @@ -67,42 +52,30 @@ STUB(NtCompareTokens) STUB(NtCreateDebugObject) STUB(NtCreateIoCompletion) STUB(NtEnumerateSystemEnvironmentValuesEx) -STUB(NtFlushVirtualMemory) -STUB(NtGetWriteWatch) STUB(NtImpersonateAnonymousToken) -STUB(NtLockVirtualMemory) -STUB(NtMapUserPhysicalPages) -STUB(NtMapUserPhysicalPagesScatter) -STUB(NtMapViewOfSection) STUB(NtOpenEvent) STUB(NtOpenIoCompletion) STUB(NtOpenMutant) -STUB(NtOpenSection) STUB(NtOpenSemaphore) STUB(NtOpenThread) STUB(NtOpenThreadToken) STUB(NtOpenTimer) -STUB(NtProtectVirtualMemory) STUB(NtPulseEvent) STUB(NtQueryEvent) STUB(NtQueryInformationToken) STUB(NtQueryIoCompletion) STUB(NtQueryMutant) -STUB(NtQuerySection) STUB(NtQuerySemaphore) STUB(NtQuerySystemEnvironmentValue) STUB(NtQuerySystemEnvironmentValueEx) STUB(NtQuerySystemInformation) STUB(NtQueryTimer) -STUB(NtQueryVirtualMemory) STUB(NtRaiseException) -STUB(NtReadVirtualMemory) STUB(NtReleaseMutant) STUB(NtReleaseSemaphore) STUB(NtRemoveIoCompletion) STUB(NtRemoveProcessDebug) STUB(NtResetEvent) -STUB(NtResetWriteWatch) STUB(NtSetEvent) STUB(NtSetEventBoostPriority) STUB(NtSetInformationTokenNtSetInformationDebugObject) @@ -112,32 +85,22 @@ STUB(NtSetSystemEnvironmentValue) STUB(NtSetSystemEnvironmentValueEx) STUB(NtSetSystemInformation) STUB(NtSetTimer) -STUB(NtUnlockVirtualMemory) -STUB(NtUnmapViewOfSection) STUB(NtVdmControl) STUB(NtWaitForDebugEvent) -STUB(NtWriteVirtualMemory) STUB(NtGetCurrentProcessorNumber) STUB(NtOpenThreadTokenEx) STUB(NtSetInformationDebugObject) STUB(NtSetInformationToken) STUB(KiSwapProcess) -STUB(MmUpdatePageDir) STUB(KeGetCurrentProcessorNumber) -STUB(MmDeleteKernelStack) -STUB(MmCreateKernelStack) STUB(Ke386InitThreadWithContext) -STUB(MmUnmapLockedPages) STUB(ExpInterlockedPopEntrySList) -STUB(MmGetPhysicalAddress) -STUB(MmFreeSectionSegments) STUB(ExAllocateFromNPagedLookasideList) STUB(ExInitializeNPagedLookasideList) STUB(SeTokenType) STUB(RtlGetCallersAddress) STUB(RtlCompareMemory) STUB(DbgkpSendApiMessage) -STUB(MmGetFileNameForSection) STUB(DbgkpTraceLevel) STUB(ExpInitializeEventImplementation) STUB(ExpInitializeMutantImplementation) @@ -145,31 +108,23 @@ STUB(ExpInitializeSemaphoreImplementation) STUB(ExpInitializeTimerImplementation) STUB(ExpEnvironmentLock) STUB(ExpFirmwareTableProviderListHead) -STUB(MmSectionObjectType) STUB(IoAcquireCancelSpinLock) STUB(IoReleaseCancelSpinLock) STUB(ExInterlockedInsertTailList) STUB(ExInterlockedRemoveHeadList) STUB(ExInterlockedAddLargeStatistic) -STUB(MmProbeAndLockPages) STUB(IopCompletionMapping) STUB(CmpInitializeMachineDependentConfiguration) STUB(ExpInitLookasideLists) STUB(ExpFirmwareTableResource) -STUB(MmMapViewInSystemSpace) STUB(MmNumberOfPhysicalPages) -STUB(MmInitSystem) STUB(RtlInitializeRangeListPackage) STUB(ExInitPoolLookasidePointers) STUB(KiInitializeBugCheck) -STUB(MmHighestUserAddress) STUB(DbgkInitialize) -STUB(MmCreateMdl) STUB(MmMapLockedPage) STUB(PsThreadType) -STUB(MiShutdownMemoryManager) STUB(ExfInterlockedCompareExchange64) -STUB(ExAllocatePoolWithQuotaTag) STUB(ExInitializePagedLookasideList) STUB(ExInterlockedInsertHeadList) STUB(IoCheckEaBufferValidity) @@ -179,58 +134,28 @@ STUB(IoCompletionType) STUB(IoCompletionPacketLookaside) STUB(CancelSpinLock) STUB(KdbpCliInit) -STUB(MmUnlockPages) STUB(KeDisconnectInterrupt) STUB(KeInitializeInterrupt) -STUB(MmUnmapViewOfSection) STUB(MiFreeDescriptor) STUB(MmPfnDatabase) STUB(MmHighestPhysicalPage) -STUB(MmIsPagePresent) -STUB(MmCreateVirtualMappingForKernel) -STUB(MmSetPageProtect) STUB(MiFreeDescriptorOrg) -STUB(MmMapLockedPages) STUB(_PsThreadType) STUB(_ExEventObjectType) -STUB(MmCreateHyperspaceMapping) -STUB(MmDeleteHyperspaceMapping) -STUB(MmCreateVirtualMapping) -STUB(MmRawDeleteVirtualMapping) -STUB(MmIsPageSwapEntry) -STUB(MmDeletePageFileMapping) STUB(KeRosDumpStackFrames) STUB(RtlWalkFrameChain) -STUB(MmCommitPagedPoolAddress) -STUB(MmIsDirtyPage) -STUB(MmSetDirtyPage) -STUB(MmSetCleanPage) -STUB(MmPageOutSectionView) -STUB(MmAllocateSection) -STUB(MmDeleteVirtualMapping) STUB(ExSystemLookasideListHead) STUB(PspGetOrSetContextKernelRoutine) STUB(PspW32ThreadCallout) STUB(ExTimerRundown) STUB(KeConnectInterrupt) -STUB(MmWritePageSectionView) STUB(ExInitializeSystemLookasideList) STUB(KeRaiseUserException) STUB(PsIsThreadTerminating) STUB(ExMutantObjectType) STUB(_ExSemaphoreObjectType) -STUB(MmCleanProcessAddressSpace) -STUB(MmDeleteProcessAddressSpace) -STUB(MmDeleteTeb) STUB(DbgkClearProcessDebugObject) -STUB(MmSetMemoryPriorityProcess) -STUB(MmInitializeHandBuiltProcess) -STUB(MmInitializeHandBuiltProcess2) -STUB(MmInitializeProcessAddressSpace) -STUB(MmCreatePeb) -STUB(MmQuerySystemSize) STUB(KeFeatureBits) -STUB(MmGetFileObjectForSection) STUB(SepTokenObjectType) STUB(SeExchangePrimaryToken) STUB(SeIsTokenChild) @@ -255,7 +180,6 @@ STUB(RtlpUnlockAtomTable) STUB(PspW32ProcessCallout) STUB(DbgkDebugObjectType) STUB(DbgkCopyProcessDebugPort) -STUB(MmCreateProcessAddressSpace) STUB(SeAssignPrimaryToken) STUB(SeDeassignPrimaryToken) STUB(SepCreateSystemProcessToken) @@ -287,15 +211,12 @@ STUB(RtlUnwind) STUB(RtlpCreateAtomHandle) STUB(RtlInitializeContext) STUB(RtlpCurrentPeb) - STUB(DbgCommandString) STUB(ExAcquireRundownProtection) STUB(ExAcquireRundownProtectionCacheAware) STUB(ExAcquireRundownProtectionCacheAwareEx) STUB(ExAcquireRundownProtectionEx) STUB(ExAllocateFromPagedLookasideList) -STUB(ExAllocatePoolWithQuota) -STUB(ExAllocatePoolWithTagPriority) STUB(ExDeleteNPagedLookasideList) STUB(ExDeletePagedLookasideList) STUB(ExEnterCriticalRegionAndAcquireResourceShared) @@ -311,7 +232,6 @@ STUB(ExInterlockedPopEntryList) STUB(ExInterlockedPushEntryList) STUB(ExIsProcessorFeaturePresent) STUB(ExQueryDepthSList) -STUB(ExQueryPoolBlockSize) STUB(ExRaiseException) STUB(ExRaiseStatus) STUB(ExReInitializeRundownProtection) @@ -418,51 +338,11 @@ STUB(KeWaitForMutexObject) STUB(KfRaiseIrql) STUB(KiBugCheckData) STUB(KiCpuId) -STUB(Mm64BitPhysicalAddress) -STUB(MmAdjustWorkingSetSize) -STUB(MmAdvanceMdl) -STUB(MmAllocateContiguousMemory) -STUB(MmAllocateContiguousMemorySpecifyCache) -STUB(MmAllocateMappingAddress) -STUB(MmAllocateNonCachedMemory) -STUB(MmAllocatePagesForMdl) STUB(MmAllocatePagesForMdlEx) -STUB(MmCanFileBeTruncated) STUB(MmCommitSessionMappedView) STUB(MmCreateMirror) -STUB(MmCreateSection) -STUB(MmDisableModifiedWriteOfSection) -STUB(MmFlushImageSection) -STUB(MmForceSectionClosed) -STUB(MmFreeContiguousMemory) -STUB(MmFreeContiguousMemorySpecifyCache) -STUB(MmFreeMappingAddress) -STUB(MmFreeNonCachedMemory) -STUB(MmFreePagesFromMdl) -STUB(MmGetVirtualForPhysical) -STUB(MmGrowKernelStack) -STUB(MmIsAddressValid) STUB(MmIsIoSpaceActive) -STUB(MmIsNonPagedSystemAddressValid) -STUB(MmIsThisAnNtAsSystem) STUB(MmLockPagableImageSection) -STUB(MmMapLockedPagesSpecifyCache) -STUB(MmMapLockedPagesWithReservedMapping) -STUB(MmMapMemoryDumpMdl) -STUB(MmMapVideoDisplay) -STUB(MmMapViewInSessionSpace) -STUB(MmPrefetchPages) -STUB(MmProbeAndLockProcessPages) -STUB(MmProbeAndLockSelectedPages) -STUB(MmProtectMdlSystemAddress) -STUB(MmSecureVirtualMemory) -STUB(MmSetAddressRangeModified) -STUB(MmSetBankedSection) -STUB(MmUnmapReservedMapping) -STUB(MmUnmapVideoDisplay) -STUB(MmUnmapViewInSessionSpace) -STUB(MmUnmapViewInSystemSpace) -STUB(MmUnsecureVirtualMemory) STUB(NlsOemLeadByteInfo) STUB(ObDeleteCapturedInsertInfo) STUB(ObSetHandleAttributes) @@ -564,11 +444,3 @@ STUB(KeAcquireInStackQueuedSpinLock) STUB(KeReleaseInStackQueuedSpinLock) STUB(KfAcquireSpinLock) STUB(KeBugCheck) -STUB(MmMapIoSpace) -STUB(MmUnmapIoSpace) -STUB(MmFindRegion) -STUB(MmAlterRegion) -STUB(MmInitializeRegion) -STUB(MmDisableVirtualMapping) -STUB(MmCreatePageFileMapping) -STUB(MmEnableVirtualMapping) diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h index 44867629e4b..c106a2f45c1 100644 --- a/reactos/ntoskrnl/include/internal/amd64/mm.h +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -6,7 +6,7 @@ #define __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H struct _EPROCESS; -PULONG MmGetPageDirectory(VOID); +PULONG_PTR MmGetPageDirectory(VOID); #define PAGE_MASK(x) ((x)&(~0xfff)) #define PAE_PAGE_MASK(x) ((x)&(~0xfffLL)) diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 6e1232cbfef..d3507a3492f 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -35,9 +35,13 @@ #define InterlockedExchangeAdd _InterlockedExchangeAdd #include "ke.h" +#ifdef _M_AMD64 +#include "amd64/mm.h" +#else #include "i386/mm.h" #include "i386/fpu.h" #include "i386/v86m.h" +#endif #include "ob.h" #include "mm.h" #include "ex.h" @@ -136,7 +140,11 @@ typedef struct _INFORMATION_CLASS_INFO #define IQS(TypeQuery, TypeSet, AlignmentQuery, AlignmentSet, Flags) \ { sizeof(TypeQuery), sizeof(TypeSet), sizeof(AlignmentQuery), sizeof(AlignmentSet), Flags } +#ifndef _M_AMD64 FORCEINLINE +#else +static inline +#endif NTSTATUS DefaultSetInfoBufferCheck(ULONG Class, const INFORMATION_CLASS_INFO *ClassList, @@ -186,7 +194,11 @@ DefaultSetInfoBufferCheck(ULONG Class, return Status; } +#ifndef _M_AMD64 FORCEINLINE +#else +static inline +#endif NTSTATUS DefaultQueryInfoBufferCheck(ULONG Class, const INFORMATION_CLASS_INFO *ClassList, diff --git a/reactos/ntoskrnl/mm/amd64/page.c b/reactos/ntoskrnl/mm/amd64/page.c new file mode 100644 index 00000000000..ab0f0836369 --- /dev/null +++ b/reactos/ntoskrnl/mm/amd64/page.c @@ -0,0 +1,323 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/mm/i386/page.c + * PURPOSE: Low level memory managment manipulation + * + * PROGRAMMERS: David Welch (welch@cwcom.net) + */ + +/* INCLUDES ***************************************************************/ + +#include +#define NDEBUG +#include + +#if defined (ALLOC_PRAGMA) +#pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) +#pragma alloc_text(INIT, MiInitPageDirectoryMap) +#endif + + +/* GLOBALS *****************************************************************/ + + + +/* FUNCTIONS ***************************************************************/ + +BOOLEAN MmUnmapPageTable(PULONG Pt); + +ULONG_PTR +NTAPI +MiFlushTlbIpiRoutine(ULONG_PTR Address) +{ + UNIMPLEMENTED; + return 0; +} + +VOID +MiFlushTlb(PULONG Pt, PVOID Address) +{ + UNIMPLEMENTED; +} + + + +PULONG_PTR +MmGetPageDirectory(VOID) +{ + return (PULONG_PTR)__readcr3(); +} + +static ULONG +ProtectToPTE(ULONG flProtect) +{ + +} + +NTSTATUS +NTAPI +Mmi386ReleaseMmInfo(PEPROCESS Process) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS +NTAPI +MmInitializeHandBuiltProcess(IN PEPROCESS Process, + IN PLARGE_INTEGER DirectoryTableBase) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +BOOLEAN +STDCALL +MmCreateProcessAddressSpace(IN ULONG MinWs, + IN PEPROCESS Process, + IN PLARGE_INTEGER DirectoryTableBase) +{ + UNIMPLEMENTED; + return 0; +} + +VOID +NTAPI +MmDeletePageTable(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +MmFreePageTable(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; +} + +BOOLEAN MmUnmapPageTable(PULONG Pt) +{ + UNIMPLEMENTED; + return FALSE; +} + +PFN_TYPE +NTAPI +MmGetPfnForProcess(PEPROCESS Process, + PVOID Address) +{ + UNIMPLEMENTED; + return 0; +} + +VOID +NTAPI +MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +MmRawDeleteVirtualMapping(PVOID Address) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, + BOOLEAN* WasDirty, PPFN_TYPE Page) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, + SWAPENTRY* SwapEntry) +{ + UNIMPLEMENTED; +} + +BOOLEAN +Mmi386MakeKernelPageTableGlobal(PVOID PAddress) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOLEAN +NTAPI +MmIsDirtyPage(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOLEAN +NTAPI +MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; + return 0; +} + +VOID +NTAPI +MmSetCleanPage(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +MmSetDirtyPage(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; +} + +BOOLEAN +NTAPI +MmIsPagePresent(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; + return 0; +} + +BOOLEAN +NTAPI +MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; + return 0; +} + +NTSTATUS +NTAPI +MmCreateVirtualMappingForKernel(PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS +NTAPI +MmCreatePageFileMapping(PEPROCESS Process, + PVOID Address, + SWAPENTRY SwapEntry) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + + +NTSTATUS +NTAPI +MmCreateVirtualMappingUnsafe(PEPROCESS Process, + PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS +NTAPI +MmCreateVirtualMapping(PEPROCESS Process, + PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount) +{ + UNIMPLEMENTED; + return STATUS_UNSUCCESSFUL; +} + +ULONG +NTAPI +MmGetPageProtect(PEPROCESS Process, PVOID Address) +{ + UNIMPLEMENTED; + return 0; +} + +VOID +NTAPI +MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) +{ + UNIMPLEMENTED; +} + +/* + * @implemented + */ +PHYSICAL_ADDRESS STDCALL +MmGetPhysicalAddress(PVOID vaddr) +{ + PHYSICAL_ADDRESS ret = {{0}}; + UNIMPLEMENTED; + return ret; +} + +PVOID +NTAPI +MmCreateHyperspaceMapping(PFN_TYPE Page) +{ + UNIMPLEMENTED; + return NULL; +} + +PFN_TYPE +NTAPI +MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) +{ + UNIMPLEMENTED; + return 0; +} + +PFN_TYPE +NTAPI +MmDeleteHyperspaceMapping(PVOID Address) +{ + UNIMPLEMENTED; + return 0; +} + +VOID +NTAPI +MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) +{ + UNIMPLEMENTED; +} + +VOID +INIT_FUNCTION +NTAPI +MmInitGlobalKernelPageDirectory(VOID) +{ + UNIMPLEMENTED; +} + +VOID +INIT_FUNCTION +NTAPI +MiInitPageDirectoryMap(VOID) +{ + UNIMPLEMENTED; +} + +/* EOF */ diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index c7d1349067d..1632d1b3b57 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -1,6 +1,6 @@ - + @@ -358,20 +358,25 @@ page.c + + + page.c + + anonmem.c aspace.c balance.c - + cont.c drvlck.c freelist.c - + iospace.c kmap.c marea.c - - - + mdlsup.c + mm.c + mminit.c mpw.c - + ncache.c npool.c pagefile.c pageop.c @@ -380,15 +385,15 @@ paging.c pe.c physical.c - + pool.c ppool.c - - + procsup.c + region.c rmap.c - + section.c sysldr.c verifier.c - + virtual.c wset.c elf32.c From a7c2391db977427131006f022b994fc4ef3bf53f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 30 Jul 2008 21:05:32 +0000 Subject: [PATCH 094/388] getting sloppy. svn path=/branches/ros-amd64-bringup/; revision=34965 --- reactos/subsystems/win32/win32k/ntuser/simplecall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/simplecall.c b/reactos/subsystems/win32/win32k/ntuser/simplecall.c index c6b91452720..36b9590972d 100644 --- a/reactos/subsystems/win32/win32k/ntuser/simplecall.c +++ b/reactos/subsystems/win32/win32k/ntuser/simplecall.c @@ -174,14 +174,14 @@ NtUserCallOneParam( case ONEPARAM_ROUTINE_GETMENU: { PWINDOW_OBJECT Window; - DWORD DWORD_PTR; + DWORD_PTR Result; if(!(Window = UserGetWindowObject((HWND)Param))) { RETURN( FALSE); } - Result = (DWORD_PTR)Window->Wnd->IDMenu; + Result = Window->Wnd->IDMenu; RETURN( Result); } From 11c478e6d251f7ffebbe86dd003a7d57ee2d6f53 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 30 Jul 2008 23:59:02 +0000 Subject: [PATCH 095/388] - add some definitions to winddk.h - amd64/ketypes.h: KSEG0_BASE is where the kernel is loaded, on amd64 this is not equal to MM_LOWEST_SYSTEM_ADDRESS (FFFF080000000000, which is not even a valid canocical address), but it's 0xfffff80000000000) - add a field for a DbgPrint function pointer to the ROS_LOADER_PARAMETER_BLOCK for early debug prints in ntoskrnl - hack PCR svn path=/branches/ros-amd64-bringup/; revision=34967 --- reactos/include/ddk/winddk.h | 29 ++++++++++++++++++++++++++++- reactos/include/ndk/amd64/ketypes.h | 7 +++++-- reactos/include/reactos/rosldr.h | 1 + 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 598094d4799..7814febcb58 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5485,7 +5485,34 @@ KeGetCurrentThread( #define PROFILE_LEVEL 15 #define HIGH_LEVEL 15 -#define KI_USER_SHARED_DATA 0xFFFFF78000000000ULL +#define PAGE_SIZE 0x1000 +#define PAGE_SHIFT 12L +#define PTI_SHIFT 12L +#define PDI_SHIFT 21L +#define PPI_SHIFT 30L +#define PXI_SHIFT 39L +#define PTE_PER_PAGE 512 +#define PDE_PER_PAGE 512 +#define PPE_PER_PAGE 512 +#define PXE_PER_PAGE 512 +#define PTI_MASK_AMD64 (PTE_PER_PAGE - 1) +#define PDI_MASK_AMD64 (PDE_PER_PAGE - 1) +#define PPI_MASK (PPE_PER_PAGE - 1) +#define PXI_MASK (PXE_PER_PAGE - 1) + +#define PXE_BASE 0xFFFFF6FB7DBED000ULL +#define PXE_SELFMAP 0xFFFFF6FB7DBEDF68ULL +#define PPE_BASE 0xFFFFF6FB7DA00000ULL +#define PDE_BASE 0xFFFFF6FB40000000ULL +#define PTE_BASE 0xFFFFF68000000000ULL +#define PXE_TOP 0xFFFFF6FB7DBEDFFFULL +#define PPE_TOP 0xFFFFF6FB7DBFFFFFULL +#define PDE_TOP 0xFFFFF6FB7FFFFFFFULL +#define PTE_TOP 0xFFFFF6FFFFFFFFFFULL + +#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000 +#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xFFFF080000000000ULL +#define KI_USER_SHARED_DATA 0xFFFFF78000000000ULL typedef struct _KPCR { diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index b48f1578b91..9cb0684a8b8 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -1,10 +1,11 @@ /*++ NDK Version: 0098 Copyright (c) Alex Ionescu. All rights reserved. +Copyright (c) Timo Kreuzer. All rights reserved. Header Name: - ketypes.h (X86) + ketypes.h (AMD64) Abstract: @@ -13,6 +14,7 @@ Abstract: Author: Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006 + Timo Kreuzer (timo.kreuzer@reactos.org) - Updated - 30-Jul-2008 --*/ @@ -28,6 +30,7 @@ Author: // //#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS)) //#define PCR ((volatile KPCR * const)K0IPCR) +#define PCR 0 // HACK //#if defined(CONFIG_SMP) || defined(NT_BUILD) //#undef KeGetPcr //#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C)) @@ -131,7 +134,7 @@ Author: // // Static Kernel-Mode Address start (use MM_KSEG0_BASE for actual) // -#define KSEG0_BASE 0xffff080000000000ULL +#define KSEG0_BASE 0xfffff80000000000ULL // // Synchronization-level IRQL diff --git a/reactos/include/reactos/rosldr.h b/reactos/include/reactos/rosldr.h index 0663a26091f..7360c31bda1 100644 --- a/reactos/include/reactos/rosldr.h +++ b/reactos/include/reactos/rosldr.h @@ -45,6 +45,7 @@ typedef struct _ROS_LOADER_PARAMETER_BLOCK ULONG_PTR PageDirectoryEnd; ULONG_PTR KernelBase; ULONG_PTR ArchExtra; + ULONG (*FrLdrDbgPrint)(const char *Format, ...); } ROS_LOADER_PARAMETER_BLOCK, *PROS_LOADER_PARAMETER_BLOCK; extern BOOLEAN AcpiTableDetected; From 1a092630eace2e2f25c974174e8c8a7d63f42105 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 31 Jul 2008 00:06:49 +0000 Subject: [PATCH 096/388] feeldr: - add a funtion to display the loader block - initialize pointer to DbgPrint in the loader block svn path=/branches/ros-amd64-bringup/; revision=34968 --- .../boot/freeldr/freeldr/arch/amd64/loader.c | 60 ++++++++++++++----- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 9e629232f11..180cc4fb07b 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -22,7 +22,7 @@ #define NDEBUG #include -//#undef DbgPrint +#undef DbgPrint /* Page Directory and Tables for non-PAE Systems */ extern ULONG_PTR NextModuleBase; @@ -33,6 +33,33 @@ PPAGE_DIRECTORY_AMD64 pPML4; /* FUNCTIONS *****************************************************************/ +void +DumpLoaderBlock() +{ + DbgPrint("LoaderBlock @ %p.\n", &LoaderBlock); + DbgPrint("Flags = 0x%x.\n", LoaderBlock.Flags); + DbgPrint("MemLower = 0x%p.\n", (PVOID)LoaderBlock.MemLower); + DbgPrint("MemHigher = 0x%p.\n", (PVOID)LoaderBlock.MemHigher); + DbgPrint("BootDevice = 0x%x.\n", LoaderBlock.BootDevice); + DbgPrint("CommandLine = %s.\n", LoaderBlock.CommandLine); + DbgPrint("ModsCount = 0x%x.\n", LoaderBlock.ModsCount); + DbgPrint("ModsAddr = 0x%p.\n", LoaderBlock.ModsAddr); + DbgPrint("Syms = 0x%s.\n", LoaderBlock.Syms); + DbgPrint("MmapLength = 0x%x.\n", LoaderBlock.MmapLength); + DbgPrint("MmapAddr = 0x%p.\n", (PVOID)LoaderBlock.MmapAddr); + DbgPrint("RdLength = 0x%x.\n", LoaderBlock.RdLength); + DbgPrint("RdAddr = 0x%p.\n", (PVOID)LoaderBlock.RdAddr); + DbgPrint("DrivesCount = 0x%x.\n", LoaderBlock.DrivesCount); + DbgPrint("DrivesAddr = 0x%p.\n", (PVOID)LoaderBlock.DrivesAddr); + DbgPrint("ConfigTable = 0x%x.\n", LoaderBlock.ConfigTable); + DbgPrint("BootLoaderName = 0x%x.\n", LoaderBlock.BootLoaderName); + DbgPrint("PageDirectoryStart = 0x%p.\n", (PVOID)LoaderBlock.PageDirectoryStart); + DbgPrint("PageDirectoryEnd = 0x%p.\n", (PVOID)LoaderBlock.PageDirectoryEnd); + DbgPrint("KernelBase = 0x%p.\n", (PVOID)LoaderBlock.KernelBase); + DbgPrint("ArchExtra = 0x%p.\n", (PVOID)LoaderBlock.ArchExtra); + +} + /*++ * FrLdrStartup * INTERNAL @@ -53,22 +80,26 @@ VOID NTAPI FrLdrStartup(ULONG Magic) { - /* Disable Interrupts */ - _disable(); + /* Disable Interrupts */ + _disable(); - /* Re-initalize EFLAGS */ - KeAmd64EraseFlags(); + /* Re-initalize EFLAGS */ + KeAmd64EraseFlags(); - /* Initialize the page directory */ - FrLdrSetupPageDirectory(); + /* Initialize the page directory */ + FrLdrSetupPageDirectory(); - /* Set the new PML4 */ - __writecr3((ULONGLONG)pPML4); + /* Set the new PML4 */ + __writecr3((ULONGLONG)pPML4); -DbgPrint((DPRINT_WARNING, "Jumping to kernel @ %p.\n", KernelEntryPoint)); + LoaderBlock.FrLdrDbgPrint = DbgPrint; - /* Jump to Kernel */ - (*KernelEntryPoint)(Magic, &LoaderBlock); +// DumpLoaderBlock(); + + DbgPrint("Jumping to kernel @ %p.\n", KernelEntryPoint); + + /* Jump to Kernel */ + (*KernelEntryPoint)(Magic, &LoaderBlock); } @@ -184,15 +215,14 @@ FrLdrSetupPageDirectory(VOID) /* Setup low memory pages */ if (FrLdrMapRangeOfPages(0, 0, 1024) < 1024) { - DbgPrint((DPRINT_WARNING, "Could not map low memory pages.\n")); + DbgPrint("Could not map low memory pages.\n"); } /* Setup kernel pages */ KernelPages = (ROUND_TO_PAGES(NextModuleBase - KERNEL_BASE_PHYS) / PAGE_SIZE); - DbgPrint((DPRINT_WARNING, "Trying to map %d pages for kernel.\n", KernelPages)); if (FrLdrMapRangeOfPages(KernelBase, KERNEL_BASE_PHYS, KernelPages) != KernelPages) { - DbgPrint((DPRINT_WARNING, "Could not map %d kernel pages.\n", KernelPages)); + DbgPrint("Could not map %d kernel pages.\n", KernelPages); } } From a4011bc8b6a3a650ec91df0e3479bedfe9dde5ac Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 31 Jul 2008 00:35:26 +0000 Subject: [PATCH 097/388] - some ULONG / SIZE_T fixes - handle amd64 in PspCreateThread svn path=/branches/ros-amd64-bringup/; revision=34969 --- reactos/include/ndk/exfuncs.h | 6 +++--- reactos/ntoskrnl/ex/lookas.c | 4 ++-- reactos/ntoskrnl/include/internal/ke.h | 8 ++++---- reactos/ntoskrnl/io/iomgr/error.c | 4 ++-- reactos/ntoskrnl/io/iomgr/util.c | 4 ++-- reactos/ntoskrnl/ps/thread.c | 5 ++++- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/reactos/include/ndk/exfuncs.h b/reactos/include/ndk/exfuncs.h index b3ca9a4b487..b4f54fb8a3b 100644 --- a/reactos/include/ndk/exfuncs.h +++ b/reactos/include/ndk/exfuncs.h @@ -390,8 +390,8 @@ NTAPI NtQuerySystemInformation( IN SYSTEM_INFORMATION_CLASS SystemInformationClass, OUT PVOID SystemInformation, - IN SIZE_T Length, - OUT PSIZE_T ResultLength + IN ULONG Length, + OUT PULONG ResultLength ); NTSYSCALLAPI @@ -539,7 +539,7 @@ NTAPI NtSetSystemInformation( IN SYSTEM_INFORMATION_CLASS SystemInformationClass, IN PVOID SystemInformation, - IN SIZE_T SystemInformationLength + IN ULONG SystemInformationLength ); NTSYSCALLAPI diff --git a/reactos/ntoskrnl/ex/lookas.c b/reactos/ntoskrnl/ex/lookas.c index b733840ddae..f32e249d68e 100644 --- a/reactos/ntoskrnl/ex/lookas.c +++ b/reactos/ntoskrnl/ex/lookas.c @@ -222,7 +222,7 @@ ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, - IN ULONG Size, + IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth) { @@ -274,7 +274,7 @@ ExInitializePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, - IN ULONG Size, + IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth) { diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index d3f2a5f5efe..005dd5b5744 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -742,10 +742,10 @@ VOID NTAPI KeBugCheckWithTf( ULONG BugCheckCode, - ULONG BugCheckParameter1, - ULONG BugCheckParameter2, - ULONG BugCheckParameter3, - ULONG BugCheckParameter4, + ULONG_PTR BugCheckParameter1, + ULONG_PTR BugCheckParameter2, + ULONG_PTR BugCheckParameter3, + ULONG_PTR BugCheckParameter4, PKTRAP_FRAME Tf ); diff --git a/reactos/ntoskrnl/io/iomgr/error.c b/reactos/ntoskrnl/io/iomgr/error.c index b6899d3a95c..8488af4a0fb 100644 --- a/reactos/ntoskrnl/io/iomgr/error.c +++ b/reactos/ntoskrnl/io/iomgr/error.c @@ -214,10 +214,10 @@ IopLogWorker(IN PVOID Parameter) } /* Align the buffer */ - StringBuffer = (PVOID)ALIGN_UP(StringBuffer, WCHAR); + StringBuffer = ALIGN_UP_POINTER(StringBuffer, WCHAR); /* Set the offset for the driver's name to the current buffer */ - ErrorMessage->DriverNameOffset = (ULONG)(StringBuffer - + ErrorMessage->DriverNameOffset = (ULONG_PTR)(StringBuffer - (ULONG_PTR)ErrorMessage); /* Check how much space we have left for the device string */ diff --git a/reactos/ntoskrnl/io/iomgr/util.c b/reactos/ntoskrnl/io/iomgr/util.c index d9bbd860866..9506a49007f 100644 --- a/reactos/ntoskrnl/io/iomgr/util.c +++ b/reactos/ntoskrnl/io/iomgr/util.c @@ -50,8 +50,8 @@ IoGetInitialStack(VOID) */ VOID NTAPI -IoGetStackLimits(OUT PULONG LowLimit, - OUT PULONG HighLimit) +IoGetStackLimits(OUT PULONG_PTR LowLimit, + OUT PULONG_PTR HighLimit) { PKPRCB Prcb = KeGetCurrentPrcb(); ULONG_PTR DpcStack = (ULONG_PTR)(Prcb->DpcStack); diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 357ccf3fcab..0a50c3ee303 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -104,7 +104,7 @@ PspUserThreadStartup(IN PKSTART_ROUTINE StartRoutine, Prcb = KeGetCurrentPrcb(); NewCookie = Prcb->MmPageFaultCount ^ Prcb->InterruptTime ^ SystemTime.u.LowPart ^ SystemTime.u.HighPart ^ - (ULONG)&SystemTime; + (ULONG_PTR)&SystemTime; /* Set the new cookie*/ InterlockedCompareExchange((LONG*)&SharedUserData->Cookie, @@ -333,6 +333,9 @@ PspCreateThread(OUT PHANDLE ThreadHandle, #elif defined(_M_ARM) Thread->StartAddress = (PVOID)ThreadContext->Pc; Thread->Win32StartAddress = (PVOID)ThreadContext->R0; +#elif defined(_M_AMD64) + Thread->StartAddress = (PVOID)ThreadContext->Rip; + Thread->Win32StartAddress = (PVOID)ThreadContext->Rax; #else #error Unknown architecture #endif From 5a0c8727c260def48c8b6d661e115afb48d585bd Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 31 Jul 2008 02:16:59 +0000 Subject: [PATCH 098/388] - update KPCR and KIPCR - add KeGetPcr() and update KeGetCurrentProcessorNumber svn path=/branches/ros-amd64-bringup/; revision=34970 --- reactos/include/ddk/winddk.h | 46 ++++++++++++++++++------- reactos/include/ndk/amd64/ketypes.h | 53 +++++++++++++++-------------- 2 files changed, 61 insertions(+), 38 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 7814febcb58..8e6ade74107 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5516,23 +5516,38 @@ KeGetCurrentThread( typedef struct _KPCR { - NT_TIB NtTib; - struct _KPRCB *CurrentPrcb; - ULONG64 SavedRcx; - ULONG64 SavedR11; + union + { + NT_TIB NtTib; + struct + { + union _KGDTENTRY64 *GdtBase; + struct _KTSS64 *TssBase; + ULONG64 UserRsp; + struct _KPCR *Self; + struct _KPRCB *CurrentPrcb; + PKSPIN_LOCK_QUEUE LockArray; + PVOID Used_Self; + }; + }; + union _KIDTENTRY64 *IdtBase; + ULONG64 Unused[2]; KIRQL Irql; UCHAR SecondLevelCacheAssociativity; - UCHAR Number; + UCHAR ObsoleteNumber; UCHAR Fill0; - ULONG Irr; - ULONG IrrActive; - ULONG Idr; + ULONG Unused0[3]; USHORT MajorVersion; USHORT MinorVersion; ULONG StallScaleFactor; - union _KIDTENTRY64 *IdtBase; - union _KGDTENTRY64 *GdtBase; - struct _KTSS64 *TssBase; + PVOID Unused1[3]; + ULONG KernelReserved[15]; + ULONG SecondLevelCacheSize; + ULONG HalReserved[16]; + ULONG Unused2; + PVOID KdVersionBlock; + PVOID Unused3; + ULONG PcrAlign1[24]; } KPCR, *PKPCR; typedef struct _KFLOATING_SAVE { @@ -5551,11 +5566,18 @@ NTAPI KeGetCurrentThread( VOID); +FORCEINLINE +PKPCR +KeGetPcr(VOID) +{ + return (PKPCR)__readgsqword(FIELD_OFFSET(KPCR, Self)); +} + FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID) { - return (ULONG)__readgsbyte(FIELD_OFFSET(KPCR, Number)); + return (ULONG)__readgsword(0x184); } #elif defined(__PowerPC__) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 9cb0684a8b8..cb5b4c31096 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -635,41 +635,42 @@ typedef struct _KIPCR NT_TIB NtTib; struct { - struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; - PVOID Used_StackBase; - PVOID PerfGlobalGroupMask; - PVOID TssCopy; - ULONG ContextSwitches; - KAFFINITY SetMemberCopy; + union _KGDTENTRY64 *GdtBase; + struct _KTSS64 *TssBase; + ULONG64 UserRsp; + struct _KPCR *Self; + struct _KPRCB *CurrentPrcb; + PKSPIN_LOCK_QUEUE LockArray; PVOID Used_Self; }; }; - struct _KPCR *Self; - struct _KPRCB *Prcb; + union _KIDTENTRY64 *IdtBase; + ULONG64 Unused[2]; KIRQL Irql; - ULONG IRR; - ULONG IrrActive; - ULONG IDR; - PVOID KdVersionBlock; - PKIDTENTRY IDT; - PKGDTENTRY GDT; - struct _KTSS *TSS; + UCHAR SecondLevelCacheAssociativity; + UCHAR ObsoleteNumber; + UCHAR Fill0; + ULONG Unused0[3]; USHORT MajorVersion; USHORT MinorVersion; - KAFFINITY SetMember; ULONG StallScaleFactor; - UCHAR SparedUnused; - UCHAR Number; - UCHAR Reserved; - UCHAR L2CacheAssociativity; - ULONG VdmAlert; - ULONG KernelReserved[14]; + PVOID Unused1[3]; + ULONG KernelReserved[15]; ULONG SecondLevelCacheSize; ULONG HalReserved[16]; - ULONG InterruptMode; - UCHAR Spare1; - ULONG KernelReserved2[17]; - KPRCB PrcbData; + ULONG Unused2; + ULONG Fill1; + PVOID KdVersionBlock; // 0x108 + PVOID Unused3; + ULONG PcrAlign1[24]; + + ULONG Unknown1; // 0x178 + ULONG Unknown2; + ULONG Unknown3; + USHORT CpuNumber; // 0x184 + // hack: + ULONG ContextSwitches; + } KIPCR, *PKIPCR; #pragma pack(pop) From 4972cd28d6f23df5a50ace846feb2ee100caabf1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 31 Jul 2008 02:20:15 +0000 Subject: [PATCH 099/388] - do not define -nostartfiles for kernel, it looks like ld creates unaligned section pointers then - comment out RtlCapturestackLimits - use KeGetCurrentPrcb instead if KetGetPcr()->Prcb - fix use of KPCR->Prcb - use %p instead of %08x for ULONG_PTR - update stubs - add more files to build - add FrLdrDbgPrint prototype to ntoskrnl.h svn path=/branches/ros-amd64-bringup/; revision=34971 --- reactos/ReactOS-amd64.rbuild | 2 +- reactos/ntoskrnl/amd64stubs.c | 187 +------------------ reactos/ntoskrnl/ex/sysinfo.c | 9 +- reactos/ntoskrnl/include/internal/ntoskrnl.h | 2 + reactos/ntoskrnl/ke/bug.c | 7 +- reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 28 +-- reactos/ntoskrnl/rtl/libsupp.c | 2 +- 7 files changed, 37 insertions(+), 200 deletions(-) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index ff8e1823fea..5066ee968d8 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -17,7 +17,7 @@ - + -enable-stdcall-fixup diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index 4c98dddfdec..0d0263fad8b 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -9,26 +9,11 @@ STUB(KeRaiseIrqlToSynchLevel) STUB(KeRaiseIrqlToDpcLevel) STUB(KiIdleLoop) STUB(KeGetCurrentIrql) -STUB(KeBugCheckEx) STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch) STUB(KeNumberProcessors) STUB(KeBugcheckCallbackListHead) -STUB(NtAdjustGroupsToken) -STUB(NtAdjustPrivilegesToken) STUB(ExpInterlockedPushEntrySList) -STUB(PsGetCurrentThreadId) STUB(NtContinue) -STUB(NtCreateEvent) -STUB(NtCreateMutant) -STUB(NtCreateSemaphore) -STUB(NtCreateThread) -STUB(NtCreateTimer) -STUB(NtCreateToken) -STUB(NtDebugContinue) -STUB(NtDuplicateToken) -STUB(NtFilterToken) -STUB(NtFlushInstructionCache) -STUB(NtDebugActiveProcess) STUB(KeActiveProcessors) STUB(KeDisableInterrupts) STUB(KiSwapContext) @@ -36,7 +21,6 @@ STUB(KeContextToTrapFrame) STUB(KiDispatchException) STUB(MiGetUserPageDirectoryCount) STUB(MmStats) -STUB(PsCreateSystemThread) STUB(ExAcquireResourceLock) STUB(ExReleaseResourceLock) STUB(MiNonPagedPoolLength) @@ -46,90 +30,28 @@ STUB(KiComputeTimerTableIndex) STUB(KeBugcheckReasonCallbackListHead) STUB(BugCheckCallbackLock) STUB(NtCallbackReturn) -STUB(NtCancelTimer) -STUB(NtClearEvent) -STUB(NtCompareTokens) -STUB(NtCreateDebugObject) -STUB(NtCreateIoCompletion) -STUB(NtEnumerateSystemEnvironmentValuesEx) -STUB(NtImpersonateAnonymousToken) -STUB(NtOpenEvent) -STUB(NtOpenIoCompletion) -STUB(NtOpenMutant) -STUB(NtOpenSemaphore) -STUB(NtOpenThread) -STUB(NtOpenThreadToken) -STUB(NtOpenTimer) -STUB(NtPulseEvent) -STUB(NtQueryEvent) -STUB(NtQueryInformationToken) -STUB(NtQueryIoCompletion) -STUB(NtQueryMutant) -STUB(NtQuerySemaphore) -STUB(NtQuerySystemEnvironmentValue) -STUB(NtQuerySystemEnvironmentValueEx) -STUB(NtQuerySystemInformation) -STUB(NtQueryTimer) STUB(NtRaiseException) -STUB(NtReleaseMutant) -STUB(NtReleaseSemaphore) -STUB(NtRemoveIoCompletion) -STUB(NtRemoveProcessDebug) -STUB(NtResetEvent) -STUB(NtSetEvent) -STUB(NtSetEventBoostPriority) -STUB(NtSetInformationTokenNtSetInformationDebugObject) -STUB(NtSetIoCompletion) STUB(NtSetLdtEntries) -STUB(NtSetSystemEnvironmentValue) -STUB(NtSetSystemEnvironmentValueEx) -STUB(NtSetSystemInformation) -STUB(NtSetTimer) STUB(NtVdmControl) -STUB(NtWaitForDebugEvent) -STUB(NtGetCurrentProcessorNumber) -STUB(NtOpenThreadTokenEx) -STUB(NtSetInformationDebugObject) -STUB(NtSetInformationToken) STUB(KiSwapProcess) STUB(KeGetCurrentProcessorNumber) STUB(Ke386InitThreadWithContext) STUB(ExpInterlockedPopEntrySList) STUB(ExAllocateFromNPagedLookasideList) -STUB(ExInitializeNPagedLookasideList) -STUB(SeTokenType) STUB(RtlGetCallersAddress) STUB(RtlCompareMemory) -STUB(DbgkpSendApiMessage) -STUB(DbgkpTraceLevel) -STUB(ExpInitializeEventImplementation) -STUB(ExpInitializeMutantImplementation) -STUB(ExpInitializeSemaphoreImplementation) -STUB(ExpInitializeTimerImplementation) STUB(ExpEnvironmentLock) STUB(ExpFirmwareTableProviderListHead) -STUB(IoAcquireCancelSpinLock) -STUB(IoReleaseCancelSpinLock) STUB(ExInterlockedInsertTailList) STUB(ExInterlockedRemoveHeadList) STUB(ExInterlockedAddLargeStatistic) -STUB(IopCompletionMapping) STUB(CmpInitializeMachineDependentConfiguration) -STUB(ExpInitLookasideLists) STUB(ExpFirmwareTableResource) STUB(MmNumberOfPhysicalPages) -STUB(RtlInitializeRangeListPackage) -STUB(ExInitPoolLookasidePointers) -STUB(KiInitializeBugCheck) -STUB(DbgkInitialize) STUB(MmMapLockedPage) STUB(PsThreadType) STUB(ExfInterlockedCompareExchange64) -STUB(ExInitializePagedLookasideList) STUB(ExInterlockedInsertHeadList) -STUB(IoCheckEaBufferValidity) -STUB(ExEventObjectType) -STUB(IopDeleteIoCompletion) STUB(IoCompletionType) STUB(IoCompletionPacketLookaside) STUB(CancelSpinLock) @@ -140,97 +62,42 @@ STUB(MiFreeDescriptor) STUB(MmPfnDatabase) STUB(MmHighestPhysicalPage) STUB(MiFreeDescriptorOrg) -STUB(_PsThreadType) -STUB(_ExEventObjectType) +STUB(ExEventObjectType) STUB(KeRosDumpStackFrames) STUB(RtlWalkFrameChain) STUB(ExSystemLookasideListHead) STUB(PspGetOrSetContextKernelRoutine) -STUB(PspW32ThreadCallout) -STUB(ExTimerRundown) STUB(KeConnectInterrupt) -STUB(ExInitializeSystemLookasideList) STUB(KeRaiseUserException) -STUB(PsIsThreadTerminating) -STUB(ExMutantObjectType) STUB(_ExSemaphoreObjectType) -STUB(DbgkClearProcessDebugObject) STUB(KeFeatureBits) -STUB(SepTokenObjectType) -STUB(SeExchangePrimaryToken) -STUB(SeIsTokenChild) -STUB(SeTokenImpersonationLevel) -STUB(SeSubProcessToken) -STUB(SeAssignPrimaryToke) -STUB(SeCopyClientToken) -STUB(SepInitializeTokenImplementation) STUB(KiSystemService) STUB(KdpGdbStubInit) STUB(KdbpGetCommandLineSettings) STUB(KdbpSafeReadMemory) -STUB(RtlpAllocateMemory) STUB(RtlFillMemoryUlong) STUB(RtlCaptureContext) STUB(RtlpGetExceptionAddress) -STUB(RtlpCheckForActiveDebugger) STUB(RtlDispatchException) -STUB(RtlpFreeMemory) -STUB(RtlpLockAtomTable) -STUB(RtlpUnlockAtomTable) -STUB(PspW32ProcessCallout) STUB(DbgkDebugObjectType) -STUB(DbgkCopyProcessDebugPort) -STUB(SeAssignPrimaryToken) -STUB(SeDeassignPrimaryToken) -STUB(SepCreateSystemProcessToken) STUB(KdbEnterDebuggerException) STUB(KdbpCliModuleLoaded) -STUB(RtlpSetInDbgPrint) -STUB(CHECK_PAGED_CODE_RTL) -STUB(RtlpGetAtomEntry) -STUB(RtlpFreeAtomHandle) -STUB(RtlpFreeAtomTableEntry) -STUB(RtlpAllocAtomTableEntry) -STUB(RtlAcquirePebLock) -STUB(RtlpGetMode) -STUB(RtlReleasePebLock) -STUB(RtlEnterHeapLock) -STUB(RtlLeaveHeapLock) -STUB(RtlInitializeHeapLock) -STUB(LdrShutdownThread) -STUB(RtlpDestroyAtomHandleTable) -STUB(RtlpDestroyAtomTableLock) -STUB(RtlpFreeAtomTable) -STUB(RtlpAllocAtomTable) -STUB(RtlpInitAtomTableLock) -STUB(RtlpCreateAtomHandleTable) -STUB(RtlpAllocDeallocQueryBufferSize) -STUB(find_entry) -STUB(RtlDeleteHeapLock) STUB(RtlUnwind) -STUB(RtlpCreateAtomHandle) STUB(RtlInitializeContext) -STUB(RtlpCurrentPeb) STUB(DbgCommandString) STUB(ExAcquireRundownProtection) STUB(ExAcquireRundownProtectionCacheAware) STUB(ExAcquireRundownProtectionCacheAwareEx) STUB(ExAcquireRundownProtectionEx) STUB(ExAllocateFromPagedLookasideList) -STUB(ExDeleteNPagedLookasideList) -STUB(ExDeletePagedLookasideList) STUB(ExEnterCriticalRegionAndAcquireResourceShared) STUB(ExEnterCriticalRegionAndAcquireSharedWaitForExclusive) STUB(ExFreeToPagedLookasideList) -STUB(ExGetCurrentProcessorCounts) -STUB(ExGetCurrentProcessorCpuUsage) -STUB(ExGetPreviousMode) STUB(ExInitializeRundownProtection) STUB(ExInterlockedAddLargeInteger) STUB(ExInterlockedAddUlong) STUB(ExInterlockedPopEntryList) STUB(ExInterlockedPushEntryList) -STUB(ExIsProcessorFeaturePresent) STUB(ExQueryDepthSList) STUB(ExRaiseException) STUB(ExRaiseStatus) @@ -243,7 +110,6 @@ STUB(ExReleaseRundownProtectionEx) STUB(ExRundownCompleted) STUB(ExRundownCompletedCacheAware) STUB(ExSemaphoreObjectType) -STUB(ExVerifySuite) STUB(ExWaitForRundownProtectionRelease) STUB(ExWaitForRundownProtectionReleaseCacheAware) STUB(ExpInterlockedFlushSList) @@ -263,27 +129,12 @@ STUB(FsRtlUninitializeBaseMcb) STUB(HalDispatchTable) STUB(HeadlessDispatch) STUB(InitializeSListHead) -STUB(IoCheckDesiredAccess) -STUB(IoCheckFunctionAccess) -STUB(IoCheckQuerySetVolumeInformation) STUB(IoEnumerateRegisteredFiltersList) STUB(IoFileObjectType) STUB(IoForwardAndCatchIrp) -STUB(IoGetCurrentProcess) -STUB(IoGetDeviceToVerify) -STUB(IoGetInitialStack) STUB(IoGetPagingIoPriority) -STUB(IoGetStackLimits) STUB(IoIs32bitProcess) -STUB(IoIsSystemThread) -STUB(IoIsWdmVersionAvailable) -STUB(IoSetCompletionRoutineEx) -STUB(IoSetDeviceToVerify) -STUB(IoSetHardErrorOrVerifyDevice) -STUB(IoSetIoCompletion) -STUB(IoThreadToProcess) STUB(IoTranslateBusAddress) -STUB(IoValidateDeviceIoControlAccess) STUB(IoWMIDeviceObjectToProviderId) STUB(KdDebuggerEnabled) STUB(KdDebuggerNotPresent) @@ -294,12 +145,9 @@ STUB(KeAcquireQueuedSpinLockRaiseToSynch) STUB(KeAcquireSpinLockForDpc) STUB(KeAcquireSpinLockRaiseToDpc) STUB(KeAcquireSpinLockRaiseToSynch) -STUB(KeDeregisterBugCheckCallback) -STUB(KeDeregisterBugCheckReasonCallback) STUB(KeDeregisterNmiCallback) STUB(KeEnterCriticalRegion) STUB(KeEnterGuardedRegion) -STUB(KeEnterKernelDebugger) STUB(KeExpandKernelStackAndCallout) STUB(KeFlushEntireTb) STUB(KeGenericCallDpc) @@ -314,8 +162,6 @@ STUB(KeQueryActiveProcessors) STUB(KeQueryMultiThreadProcessorSet) STUB(KeQueryPrcbAddress) STUB(KeReadStateMutex) -STUB(KeRegisterBugCheckCallback) -STUB(KeRegisterBugCheckReasonCallback) STUB(KeRegisterNmiCallback) STUB(KeReleaseInStackQueuedSpinLockForDpc) STUB(KeReleaseQueuedSpinLock) @@ -355,35 +201,17 @@ STUB(PoRegisterDeviceNotify) STUB(PoRequestShutdownEvent) STUB(PoSetHiberRange) STUB(PoShutdownBugCheck) -STUB(PsEstablishWin32Callouts) STUB(PsGetCurrentProcess) STUB(PsGetCurrentProcessWow64Process) STUB(PsGetCurrentThread) -STUB(PsGetCurrentThreadPreviousMode) STUB(PsGetCurrentThreadProcess) STUB(PsGetCurrentThreadProcessId) -STUB(PsGetCurrentThreadStackBase) -STUB(PsGetCurrentThreadStackLimit) STUB(PsGetCurrentThreadTeb) -STUB(PsGetCurrentThreadWin32Thread) STUB(PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion) STUB(PsGetProcessSessionIdEx) STUB(PsGetProcessWow64Process) -STUB(PsGetThreadFreezeCount) -STUB(PsGetThreadHardErrorsAreDisabled) -STUB(PsGetThreadId) -STUB(PsGetThreadProcess) -STUB(PsGetThreadProcessId) -STUB(PsGetThreadSessionId) -STUB(PsGetThreadTeb) -STUB(PsGetThreadWin32Thread) STUB(PsIsSystemProcess) -STUB(PsIsSystemThread) -STUB(PsIsThreadImpersonating) -STUB(PsLookupThreadByThreadId) STUB(PsProcessType) -STUB(PsSetThreadHardErrorsAreDisabled) -STUB(PsSetThreadWin32Thread) STUB(PsWrapApcWow64Thread) STUB(RtlAnsiStringToUnicodeSize) STUB(RtlCompareMemoryUlong) @@ -409,14 +237,8 @@ STUB(RtlUnicodeStringToOemSize) STUB(RtlUnwindEx) STUB(RtlVirtualUnwind) STUB(RtlZeroMemory) -STUB(SeFilterToken) -STUB(SeQueryAuthenticationIdToken) -STUB(SeQueryInformationToken) -STUB(SeQuerySessionIdToken) STUB(SeReportSecurityEvent) STUB(SeSetAuditParameter) -STUB(SeTokenIsAdmin) -STUB(SeTokenIsRestricted) STUB(SeTokenObjectType) STUB(VfFailDeviceNode) STUB(VfFailDriver) @@ -443,4 +265,9 @@ STUB(KfReleaseSpinLock) STUB(KeAcquireInStackQueuedSpinLock) STUB(KeReleaseInStackQueuedSpinLock) STUB(KfAcquireSpinLock) -STUB(KeBugCheck) +STUB(KiSaveProcessorControlState) +STUB(KeProcessorArchitecture) +STUB(KeProcessorLevel) +STUB(KeProcessorRevision) +STUB(RtlpGetStackLimits) +STUB(KeSwitchKernelStack) diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index c89f60a6c2a..d36cdce75f9 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -899,7 +899,7 @@ QSI_DEF(SystemProcessorPerformanceInformation) } CurrentTime.QuadPart = KeQueryInterruptTime(); - Prcb = KeGetPcr()->Prcb; + Prcb = KeGetCurrentPrcb(); for (i = 0; i < KeNumberProcessors; i++) { Spi->IdleTime.QuadPart = (Prcb->IdleThread->KernelTime + Prcb->IdleThread->UserTime) * 100000LL; @@ -1195,7 +1195,11 @@ QSI_DEF(SystemInterruptInformation) for (i = 0; i < KeNumberProcessors; i++) { Prcb = KiProcessorBlock[i]; +#ifdef _M_AMD64 + Pcr = CONTAINING_RECORD(Prcb, KPCR, CurrentPrcb); +#else Pcr = CONTAINING_RECORD(Prcb, KPCR, Prcb); +#endif #ifdef _M_ARM // This code should probably be done differently sii->ContextSwitches = Pcr->ContextSwitches; #else @@ -1929,6 +1933,9 @@ NtFlushInstructionCache ( for (;;); #elif defined(_M_ARM) __asm__ __volatile__("mov r1, #0; mcr p15, 0, r1, c7, c5, 0"); +#elif defined(_M_AMD64) + DPRINT1("NtFlushInstructionCache() is not implemented\n"); + for (;;); #else #error Unknown architecture #endif diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index d3507a3492f..f1e26b22236 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -71,6 +71,8 @@ #include "hal.h" #include "arch/intrin_i.h" +ULONG (*FrLdrDbgPrint)(const char *Format, ...); + #include /* * Defines a descriptor as it appears in the processor tables diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 73cb0ae3671..870285b5fd2 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -227,7 +227,7 @@ KeRosCaptureUserStackBackTrace(IN ULONG FramesToSkip, return (USHORT)i; } - +#ifndef _M_AMD64 VOID FASTCALL KeRosDumpStackFrameArray(IN PULONG Frames, @@ -316,6 +316,7 @@ KeRosDumpStackFrames(IN PULONG Frame OPTIONAL, } } } +#endif VOID NTAPI @@ -725,8 +726,8 @@ KiDisplayBlueScreen(IN ULONG MessageId, /* Show the technical Data */ sprintf(AnsiName, - "\r\n\r\n*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)\r\n\r\n", - KiBugCheckData[0], + "\r\n\r\n*** STOP: 0x%p (0x%p,0x%p,0x%p,0x%p)\r\n\r\n", + (PVOID)KiBugCheckData[0], (PVOID)KiBugCheckData[1], (PVOID)KiBugCheckData[2], (PVOID)KiBugCheckData[3], diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index 1632d1b3b57..cd7ec8f133f 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -96,7 +96,7 @@ apc.c balmgr.c - + bug.c clock.c config.c devqueue.c @@ -170,7 +170,7 @@ dbgkutil.c - + dbgkobj.c zw.S @@ -187,7 +187,7 @@ callback.c dbgctrl.c efi.c - + event.c evtpair.c exintrin.c fastinterlck.c @@ -198,17 +198,17 @@ init.c keyedevt.c locale.c - - + lookas.c + mutant.c pushlock.c profile.c resource.c rundown.c - + sem.c shutdown.c - + sysinfo.c time.c - + timer.c uuid.c win32k.c work.c @@ -253,7 +253,7 @@ drvrlist.c error.c file.c - + iocomp.c ioevent.c iofunc.c iomdl.c @@ -266,7 +266,7 @@ ramdisk.c rawfs.c remlock.c - + util.c symlink.c volume.c @@ -437,8 +437,8 @@ quota.c security.c state.c - - + thread.c + win32.c @@ -446,7 +446,7 @@ rtlexcpt.c - + libsupp.c misc.c strtok.c @@ -459,7 +459,7 @@ sd.c semgr.c sid.c - + token.c diff --git a/reactos/ntoskrnl/rtl/libsupp.c b/reactos/ntoskrnl/rtl/libsupp.c index 4b4559df287..7ccf0e1cc05 100644 --- a/reactos/ntoskrnl/rtl/libsupp.c +++ b/reactos/ntoskrnl/rtl/libsupp.c @@ -211,7 +211,7 @@ RtlpHandleDpcStackException(IN PEXCEPTION_REGISTRATION_RECORD RegistrationFrame, return FALSE; } -#ifndef _ARM_ +#if !defined(_ARM_) && !defined(_AMD64_) BOOLEAN NTAPI From f9b1269405313f6aeebe499ba796d137e3928e49 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 31 Jul 2008 23:01:51 +0000 Subject: [PATCH 100/388] - fix usage of InterlockedExchangePointer - some ULONG / SIZE_T fixes - pushlocks have a union with a PVOID and an ULONG, use them instead of typecasting - use InterlockedAndPointer for a pushlock svn path=/branches/ros-amd64-bringup/; revision=34986 --- reactos/ntoskrnl/config/cmkcbncb.c | 4 +-- reactos/ntoskrnl/ex/handle.c | 16 ++++----- reactos/ntoskrnl/ex/init.c | 21 +++++------ reactos/ntoskrnl/ex/pushlock.c | 56 +++++++++++++++++------------- reactos/ntoskrnl/kdbg/kdb.c | 14 ++++---- reactos/ntoskrnl/se/audit.c | 2 +- reactos/ntoskrnl/se/lsa.c | 2 +- 7 files changed, 62 insertions(+), 53 deletions(-) diff --git a/reactos/ntoskrnl/config/cmkcbncb.c b/reactos/ntoskrnl/config/cmkcbncb.c index c7c85d0e827..17fe617b66d 100644 --- a/reactos/ntoskrnl/config/cmkcbncb.c +++ b/reactos/ntoskrnl/config/cmkcbncb.c @@ -903,7 +903,7 @@ EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody, for (i = 0; i < 4; i++) { /* Add it into the list */ - if (!InterlockedCompareExchangePointer(&KeyBody->KeyControlBlock-> + if (!InterlockedCompareExchangePointer((PVOID*)&KeyBody->KeyControlBlock-> KeyBodyArray[i], KeyBody, NULL)) @@ -959,7 +959,7 @@ DelistKeyBodyFromKCB(IN PCM_KEY_BODY KeyBody, for (i = 0; i < 4; i++) { /* Add it into the list */ - if (InterlockedCompareExchangePointer(&KeyBody->KeyControlBlock-> + if (InterlockedCompareExchangePointer((VOID*)&KeyBody->KeyControlBlock-> KeyBodyArray[i], NULL, KeyBody) == KeyBody) diff --git a/reactos/ntoskrnl/ex/handle.c b/reactos/ntoskrnl/ex/handle.c index 70d181edd42..20040f5cd7a 100644 --- a/reactos/ntoskrnl/ex/handle.c +++ b/reactos/ntoskrnl/ex/handle.c @@ -516,7 +516,7 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable, /* Write the new level and attempt to change the table code */ TableBase = ((ULONG_PTR)Mid) | 1; - Value = InterlockedExchangePointer(&HandleTable->TableCode, TableBase); + Value = InterlockedExchangePointer((PVOID*)&HandleTable->TableCode, (PVOID)TableBase); } else if (TableLevel == 1) { @@ -533,7 +533,7 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable, if (!Low) return FALSE; /* Update the table */ - Value = InterlockedExchangePointer(&SecondLevel[i], Low); + Value = InterlockedExchangePointer((PVOID*)&SecondLevel[i], Low); ASSERT(Value == NULL); } else @@ -560,7 +560,7 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable, /* Write the new table and change the table code */ TableBase = ((ULONG_PTR)High) | 2; - Value = InterlockedExchangePointer(&HandleTable->TableCode, + Value = InterlockedExchangePointer((PVOID*)&HandleTable->TableCode, (PVOID)TableBase); } } @@ -581,7 +581,7 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable, if (!Mid) return FALSE; /* Update the table pointer */ - Value = InterlockedExchangePointer(&ThirdLevel[i], Mid); + Value = InterlockedExchangePointer((PVOID*)&ThirdLevel[i], Mid); ASSERT(Value == NULL); } else @@ -596,7 +596,7 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable, if (!Low) return FALSE; /* Update the table pointer */ - Value = InterlockedExchangePointer(&ThirdLevel[i][j], Low); + Value = InterlockedExchangePointer((PVOID*)&ThirdLevel[i][j], Low); ASSERT(Value == NULL); } } @@ -886,8 +886,8 @@ ExpLockHandleTableEntry(IN PHANDLE_TABLE HandleTable, /* It's not locked, remove the lock bit to lock it */ NewValue = OldValue & ~EXHANDLE_TABLE_ENTRY_LOCK_BIT; if (InterlockedCompareExchangePointer(&HandleTableEntry->Object, - NewValue, - OldValue) == (PVOID)OldValue) + (PVOID)NewValue, + (PVOID)OldValue) == (PVOID)OldValue) { /* We locked it, get out */ return TRUE; @@ -1010,7 +1010,7 @@ ExDestroyHandle(IN PHANDLE_TABLE HandleTable, } /* Clear the handle */ - Object = InterlockedExchangePointer(&HandleTableEntry->Object, NULL); + Object = InterlockedExchangePointer((PVOID*)&HandleTableEntry->Object, NULL); /* Sanity checks */ ASSERT(Object != NULL); diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index c9243ff9d4a..d27022cc3b6 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -68,7 +68,7 @@ PVOID ExpNlsTableBase; ULONG ExpAnsiCodePageDataOffset, ExpOemCodePageDataOffset; ULONG ExpUnicodeCaseTableDataOffset; NLSTABLEINFO ExpNlsTableInfo; -ULONG ExpNlsTableSize; +SIZE_T ExpNlsTableSize; PVOID ExpNlsSectionPointer; /* CMOS Timer Sanity */ @@ -196,7 +196,7 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock) NTSTATUS Status; HANDLE NlsSection; PVOID SectionBase = NULL; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; LARGE_INTEGER SectionOffset = {{0}}; PLIST_ENTRY ListHead, NextEntry; PMEMORY_ALLOCATION_DESCRIPTOR MdBlock; @@ -369,7 +369,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer, OUT PCHAR *ProcessEnvironment) { NTSTATUS Status; - ULONG Size; + SIZE_T Size; PWSTR p; UNICODE_STRING NullString = RTL_CONSTANT_STRING(L""); UNICODE_STRING SmssName, Environment, SystemDriveString, DebugString; @@ -829,7 +829,7 @@ ExpInitializeExecutive(IN ULONG Cpu, PLDR_DATA_TABLE_ENTRY NtosEntry; PRTL_MESSAGE_RESOURCE_ENTRY MsgEntry; ANSI_STRING CsdString; - ULONG Remaining = 0; + SIZE_T Remaining = 0; PCHAR RcEnd = NULL; CHAR VersionBuffer [65]; @@ -1258,7 +1258,8 @@ Phase1InitializationDiscard(IN PVOID Context) PCHAR StringBuffer, EndBuffer, BeginBuffer, MpString = ""; PINIT_BUFFER InitBuffer; ANSI_STRING TempString; - ULONG LastTzBias, Size, Length, YearHack = 0, Disposition, MessageCode = 0; + ULONG LastTzBias, Size, YearHack = 0, Disposition, MessageCode = 0; + SIZE_T Length; PRTL_USER_PROCESS_INFORMATION ProcessInfo; KEY_VALUE_PARTIAL_INFORMATION KeyPartialInfo; UNICODE_STRING KeyName, DebugString; @@ -1738,7 +1739,7 @@ Phase1InitializationDiscard(IN PVOID Context) KeyValuePartialInformation, &KeyPartialInfo, sizeof(KeyPartialInfo), - &Length); + &Size); if (!NT_SUCCESS(Status)) AlternateShell = FALSE; } @@ -1890,17 +1891,17 @@ Phase1InitializationDiscard(IN PVOID Context) ZwClose(ProcessInfo->ProcessHandle); /* Free the initial process environment */ - Size = 0; + Length = 0; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID*)&Environment, - &Size, + &Length, MEM_RELEASE); /* Free the initial process parameters */ - Size = 0; + Length = 0; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID*)&ProcessParameters, - &Size, + &Length, MEM_RELEASE); /* Increase init phase */ diff --git a/reactos/ntoskrnl/ex/pushlock.c b/reactos/ntoskrnl/ex/pushlock.c index 07bd441d203..7ccce422f86 100644 --- a/reactos/ntoskrnl/ex/pushlock.c +++ b/reactos/ntoskrnl/ex/pushlock.c @@ -20,6 +20,12 @@ ULONG ExPushLockSpinCount; /* PRIVATE FUNCTIONS *********************************************************/ +#ifdef _WIN64 +#define InterlockedAndPointer(ptr,val) InterlockedAnd64((PLONGLONG)ptr,(LONGLONG)val) +#else +#define InterlockedAndPointer(ptr,val) InterlockedAnd((PLONG)ptr,(LONG)val) +#endif + /*++ * @name ExpInitializePushLocks * @@ -87,7 +93,7 @@ ExfWakePushLock(PEX_PUSH_LOCK PushLock, ASSERT(NewValue.Waiting); /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -97,7 +103,7 @@ ExfWakePushLock(PEX_PUSH_LOCK PushLock, } /* Save the First Block */ - FirstWaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + FirstWaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); WaitBlock = FirstWaitBlock; @@ -135,7 +141,7 @@ ExfWakePushLock(PEX_PUSH_LOCK PushLock, ASSERT(!NewValue.Waking); /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) break; @@ -154,7 +160,7 @@ ExfWakePushLock(PEX_PUSH_LOCK PushLock, ASSERT(PushLock->Waiting); /* Remove waking bit from pushlock */ - InterlockedAnd((PLONG)PushLock, ~EX_PUSH_LOCK_WAKING); + InterlockedAndPointer(&PushLock->Value, ~EX_PUSH_LOCK_WAKING); /* Leave the loop */ break; @@ -236,7 +242,7 @@ ExpOptimizePushLockList(PEX_PUSH_LOCK PushLock, } /* Get the wait block */ - WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); /* Loop the blocks */ @@ -270,7 +276,7 @@ ExpOptimizePushLockList(PEX_PUSH_LOCK PushLock, ASSERT(!NewValue.Waking); /* Update the value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); @@ -477,7 +483,7 @@ ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock) ASSERT(NewValue.Locked); /* Set the new value */ - if (InterlockedCompareExchangePointer(PushLock, + if (InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr) != OldValue.Ptr) { @@ -507,8 +513,8 @@ ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock) WaitBlock->ShareCount = 0; /* Set the current Wait Block pointer */ - WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR) - OldValue.Ptr &~ EX_PUSH_LOCK_PTR_BITS); + WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)( + OldValue.Value &~ EX_PUSH_LOCK_PTR_BITS); /* Point to ours */ NewValue.Value = (OldValue.Value & EX_PUSH_LOCK_MULTIPLE_SHARED) | @@ -563,7 +569,7 @@ ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock) /* Write the new value */ TempValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) @@ -655,7 +661,7 @@ ExfAcquirePushLockShared(PEX_PUSH_LOCK PushLock) ASSERT(NewValue.Locked); /* Set the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) @@ -680,8 +686,8 @@ ExfAcquirePushLockShared(PEX_PUSH_LOCK PushLock) if (OldValue.Waiting) { /* Set the current Wait Block pointer */ - WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR) - OldValue.Ptr &~ EX_PUSH_LOCK_PTR_BITS); + WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)( + OldValue.Value &~ EX_PUSH_LOCK_PTR_BITS); /* Nobody is the last waiter yet */ WaitBlock->Last = NULL; @@ -719,7 +725,7 @@ ExfAcquirePushLockShared(PEX_PUSH_LOCK PushLock) #endif /* Write the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Ptr != OldValue.Ptr) @@ -810,7 +816,7 @@ ExfReleasePushLock(PEX_PUSH_LOCK PushLock) } /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -824,7 +830,7 @@ ExfReleasePushLock(PEX_PUSH_LOCK PushLock) if (OldValue.MultipleShared) { /* Get the wait block */ - WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); /* Loop until we find the last wait block */ @@ -877,7 +883,7 @@ ExfReleasePushLock(PEX_PUSH_LOCK PushLock) ASSERT(NewValue.Waking && !NewValue.Locked && !NewValue.MultipleShared); /* Write the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -897,7 +903,7 @@ ExfReleasePushLock(PEX_PUSH_LOCK PushLock) /* Write the new value */ WakeValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) continue; @@ -950,7 +956,7 @@ ExfReleasePushLockShared(PEX_PUSH_LOCK PushLock) } /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -963,7 +969,7 @@ ExfReleasePushLockShared(PEX_PUSH_LOCK PushLock) if (OldValue.MultipleShared) { /* Get the wait block */ - WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); /* Loop until we find the last wait block */ @@ -1013,7 +1019,7 @@ ExfReleasePushLockShared(PEX_PUSH_LOCK PushLock) ASSERT(NewValue.Waking && !NewValue.Locked && !NewValue.MultipleShared); /* Write the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -1033,7 +1039,7 @@ ExfReleasePushLockShared(PEX_PUSH_LOCK PushLock) /* Write the new value */ WakeValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) continue; @@ -1087,7 +1093,7 @@ ExfReleasePushLockExclusive(PEX_PUSH_LOCK PushLock) /* Write the New Value. Save our original value for waking */ WakeValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); @@ -1108,7 +1114,7 @@ ExfReleasePushLockExclusive(PEX_PUSH_LOCK PushLock) ASSERT(NewValue.Waking && !NewValue.Waiting); /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); @@ -1152,7 +1158,7 @@ ExfTryToWakePushLock(PEX_PUSH_LOCK PushLock) NewValue.Waking = TRUE; /* Write the New Value */ - if (InterlockedCompareExchangePointer(PushLock, + if (InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr) == OldValue.Ptr) { diff --git a/reactos/ntoskrnl/kdbg/kdb.c b/reactos/ntoskrnl/kdbg/kdb.c index a07882a5e69..a4040563e10 100644 --- a/reactos/ntoskrnl/kdbg/kdb.c +++ b/reactos/ntoskrnl/kdbg/kdb.c @@ -201,6 +201,7 @@ KdbpKdbTrapFrameFromKernelStack(PVOID KernelStack, RtlZeroMemory(KdbTrapFrame, sizeof(KDB_KTRAP_FRAME)); StackPtr = (ULONG_PTR *) KernelStack; +#if _M_X86_ KdbTrapFrame->Tf.Ebp = StackPtr[3]; KdbTrapFrame->Tf.Edi = StackPtr[4]; KdbTrapFrame->Tf.Esi = StackPtr[5]; @@ -212,6 +213,7 @@ KdbpKdbTrapFrameFromKernelStack(PVOID KernelStack, KdbTrapFrame->Tf.SegDs = KGDT_R0_DATA; KdbTrapFrame->Tf.SegEs = KGDT_R0_DATA; KdbTrapFrame->Tf.SegGs = KGDT_R0_DATA; +#endif /* FIXME: what about the other registers??? */ } @@ -405,7 +407,7 @@ KdbpStepIntoInstruction(ULONG_PTR Eip) } /* Get the interrupt descriptor */ - if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc)))) + if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(ULONG_PTR)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc)))) { /*KdbpPrint("Couldn't access memory at 0x%p\n", (ULONG_PTR)Idtr.Base + (IntVect * 8));*/ return FALSE; @@ -1073,7 +1075,7 @@ KdbpAttachToThread( /* Get a pointer to the thread */ if (!NT_SUCCESS(PsLookupThreadByThreadId(ThreadId, &Thread))) { - KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG)ThreadId); + KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG_PTR)ThreadId); return FALSE; } Process = Thread->ThreadsProcess; @@ -1152,14 +1154,14 @@ KdbpAttachToProcess( /* Get a pointer to the process */ if (!NT_SUCCESS(PsLookupProcessByProcessId(ProcessId, &Process))) { - KdbpPrint("Invalid process id: 0x%08x\n", (ULONG)ProcessId); + KdbpPrint("Invalid process id: 0x%08x\n", (ULONG_PTR)ProcessId); return FALSE; } Entry = Process->ThreadListHead.Flink; if (Entry == &KdbCurrentProcess->ThreadListHead) { - KdbpPrint("No threads in process 0x%08x, cannot attach to process!\n", (ULONG)ProcessId); + KdbpPrint("No threads in process 0x%p, cannot attach to process!\n", ProcessId); return FALSE; } @@ -1200,7 +1202,7 @@ KdbpInternalEnter() SavedStackLimit = Thread->Tcb.StackLimit; SavedKernelStack = Thread->Tcb.KernelStack; Thread->Tcb.InitialStack = Thread->Tcb.StackBase = (char*)KdbStack + KDB_STACK_SIZE; - Thread->Tcb.StackLimit = (ULONG)KdbStack; + Thread->Tcb.StackLimit = (ULONG_PTR)KdbStack; Thread->Tcb.KernelStack = (char*)KdbStack + KDB_STACK_SIZE; /*KdbpPrint("Switching to KDB stack 0x%08x-0x%08x\n", Thread->Tcb.StackLimit, Thread->Tcb.StackBase);*/ @@ -1613,7 +1615,7 @@ continue_execution: TrapFrame->Dr6 &= ~0x0000e00f; /* Skip the current instruction */ - Context->Eip++; +// Context->Eip++; } return ContinueType; diff --git a/reactos/ntoskrnl/se/audit.c b/reactos/ntoskrnl/se/audit.c index de535b3f161..7ba66134257 100644 --- a/reactos/ntoskrnl/se/audit.c +++ b/reactos/ntoskrnl/se/audit.c @@ -137,7 +137,7 @@ SeLocateProcessImageName(IN PEPROCESS Process, if (NT_SUCCESS(Status)) { /* Set it */ - if (InterlockedCompareExchangePointer(&Process-> + if (InterlockedCompareExchangePointer((PVOID*)&Process-> SeAuditProcessCreationInfo, AuditName, NULL)) diff --git a/reactos/ntoskrnl/se/lsa.c b/reactos/ntoskrnl/se/lsa.c index d6ba8f07ac5..40d297f5a1a 100644 --- a/reactos/ntoskrnl/se/lsa.c +++ b/reactos/ntoskrnl/se/lsa.c @@ -49,7 +49,7 @@ NTSTATUS NTAPI LsaFreeReturnBuffer(PVOID Buffer) { - ULONG Size = 0; + SIZE_T Size = 0; return ZwFreeVirtualMemory(NtCurrentProcess(), &Buffer, &Size, From 82d72f9d046d11ba5ca94f3ddfeeed49a58d1c4b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 31 Jul 2008 23:04:35 +0000 Subject: [PATCH 101/388] - fix SECURITY_DESCRIPTOR_RELATIVE and KDPC_DATA svn path=/branches/ros-amd64-bringup/; revision=34987 --- reactos/include/ddk/ntifs.h | 8 ++++---- reactos/include/ndk/ketypes.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index 8ad9a418bd3..5fa32bbb1b0 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -787,10 +787,10 @@ typedef struct _SECURITY_DESCRIPTOR_RELATIVE { BYTE Revision; BYTE Sbz1; SECURITY_DESCRIPTOR_CONTROL Control; - DWORD Owner; - DWORD Group; - DWORD Sacl; - DWORD Dacl; + DWORD_PTR Owner; + DWORD_PTR Group; + DWORD_PTR Sacl; + DWORD_PTR Dacl; } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE; typedef enum _TOKEN_INFORMATION_CLASS { TokenUser=1,TokenGroups,TokenPrivileges,TokenOwner, diff --git a/reactos/include/ndk/ketypes.h b/reactos/include/ndk/ketypes.h index ea91b01da36..0d34d054a34 100644 --- a/reactos/include/ndk/ketypes.h +++ b/reactos/include/ndk/ketypes.h @@ -558,7 +558,7 @@ typedef enum _PROCESSOR_CACHE_TYPE typedef struct _KDPC_DATA { LIST_ENTRY DpcListHead; - ULONG DpcLock; + ULONG_PTR DpcLock; volatile ULONG DpcQueueDepth; ULONG DpcCount; } KDPC_DATA, *PKDPC_DATA; From 52ada299454b735eb8d3fd764d176444b3aa67c6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 1 Aug 2008 01:08:53 +0000 Subject: [PATCH 102/388] Fix macros that didn't have brackets around the argument. Add FrLdrDbgPrint for debugprints. Use ULONG_PTR instead of ULONG for memory offsets and pointer values. Use RosLoaderBlock->KernelBase instead of hardcoded value for the beginning of the kernel. Now we reach KiSystemStartupReal. svn path=/branches/ros-amd64-bringup/; revision=34989 --- reactos/ntoskrnl/ke/freeldr.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/reactos/ntoskrnl/ke/freeldr.c b/reactos/ntoskrnl/ke/freeldr.c index ce70a634c0c..7e5395ec748 100644 --- a/reactos/ntoskrnl/ke/freeldr.c +++ b/reactos/ntoskrnl/ke/freeldr.c @@ -15,10 +15,10 @@ #ifdef _M_PPC #include #define KERNEL_RVA(x) RVA(x,0x80800000) -#define KERNEL_DESCRIPTOR_PAGE(x) (((ULONG_PTR)x + KernelBase) >> PAGE_SHIFT) +#define KERNEL_DESCRIPTOR_PAGE(x) (((ULONG_PTR)(x) + KernelBase) >> PAGE_SHIFT) #else #define KERNEL_RVA(x) RVA(x,KSEG0_BASE) -#define KERNEL_DESCRIPTOR_PAGE(x) (((ULONG_PTR)x &~ KSEG0_BASE) >> PAGE_SHIFT) +#define KERNEL_DESCRIPTOR_PAGE(x) (((ULONG_PTR)(x) & ~KSEG0_BASE) >> PAGE_SHIFT) #endif typedef struct _BIOS_MEMORY_DESCRIPTOR @@ -29,6 +29,9 @@ typedef struct _BIOS_MEMORY_DESCRIPTOR /* GLOBALS *******************************************************************/ +/* Function pointer for early debug prints */ +ULONG (*FrLdrDbgPrint)(const char *Format, ...); + /* FreeLDR Loader Data */ PROS_LOADER_PARAMETER_BLOCK KeRosLoaderBlock; BOOLEAN AcpiTableDetected; @@ -869,7 +872,7 @@ KiRosBuildArcMemoryList(VOID) VOID NTAPI KiRosFixupComponentTree(IN PCONFIGURATION_COMPONENT_DATA p, - IN ULONG i) + IN ULONG_PTR i) { PCONFIGURATION_COMPONENT pp; @@ -1144,7 +1147,7 @@ KiRosFrldrLpbToNtLpb(IN PROS_LOADER_PARAMETER_BLOCK RosLoaderBlock, /* Now mark the remainder of the FreeLDR 6MB area as "in use" */ KiRosAllocateNtDescriptor(LoaderMemoryData, KERNEL_DESCRIPTOR_PAGE(RosEntry->ModEnd), - KERNEL_DESCRIPTOR_PAGE((0x80800000 + 0x600000)) - + KERNEL_DESCRIPTOR_PAGE((RosLoaderBlock->KernelBase + 0x600000)) - KERNEL_DESCRIPTOR_PAGE(RosEntry->ModEnd), 0, &Base); @@ -1297,12 +1300,15 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, /* Save pointer to ROS Block */ KeRosLoaderBlock = LoaderBlock; + /* Get debugging function */ + FrLdrDbgPrint = LoaderBlock->FrLdrDbgPrint; + /* Save memory manager data */ KeMemoryMapRangeCount = 0; if (LoaderBlock->Flags & MB_FLAGS_MMAP_INFO) { /* We have a memory map from the nice BIOS */ - ent = ((PULONG)(LoaderBlock->MmapAddr - sizeof(ULONG))); + ent = ((PULONG)(LoaderBlock->MmapAddr - sizeof(ULONG))); // FIXME: this is ugly size = *ent; i = 0; @@ -1323,13 +1329,13 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, /* Save data */ LoaderBlock->MmapLength = KeMemoryMapRangeCount * sizeof(ADDRESS_RANGE); - LoaderBlock->MmapAddr = (ULONG)KeMemoryMap; + LoaderBlock->MmapAddr = (ULONG_PTR)KeMemoryMap; } else { /* Nothing from BIOS */ LoaderBlock->MmapLength = 0; - LoaderBlock->MmapAddr = (ULONG)KeMemoryMap; + LoaderBlock->MmapAddr = (ULONG_PTR)KeMemoryMap; } #if defined(_M_IX86) From a20a7005ef18597a8619537c1345c0fc2ce30762 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 1 Aug 2008 22:18:58 +0000 Subject: [PATCH 103/388] use constants from winddk and get rid of private definitions. svn path=/branches/ros-amd64-bringup/; revision=35021 --- .../boot/freeldr/freeldr/arch/amd64/loader.c | 19 +++++++------------ .../freeldr/include/arch/amd64/amd64.h | 16 +++++----------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 180cc4fb07b..bf23c4bafc9 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -134,14 +134,14 @@ FrLdrMapSinglePage(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress) PPAGE_DIRECTORY_AMD64 pDir3, pDir2, pDir1; ULONG Index; - pDir3 = FrLdrGetOrCreatePageDir(pPML4, VAtoIndex4(VirtualAddress)); - pDir2 = FrLdrGetOrCreatePageDir(pDir3, VAtoIndex3(VirtualAddress)); - pDir1 = FrLdrGetOrCreatePageDir(pDir2, VAtoIndex2(VirtualAddress)); + pDir3 = FrLdrGetOrCreatePageDir(pPML4, VAtoPXI(VirtualAddress)); + pDir2 = FrLdrGetOrCreatePageDir(pDir3, VAtoPPI(VirtualAddress)); + pDir1 = FrLdrGetOrCreatePageDir(pDir2, VAtoPDI(VirtualAddress)); if (!pDir1) return FALSE; - Index = VAtoIndex1(VirtualAddress); + Index = VAtoPTI(VirtualAddress); if (pDir1->Pde[Index].Valid) { return FALSE; @@ -203,14 +203,9 @@ FrLdrSetupPageDirectory(VOID) /* The page tables are located at 0xfffff68000000000 * We create a recursive self mapping through all 4 levels at * virtual address 0xfffff6fb7dbedf68 */ - pPML4->Pde[VAtoIndex4(PML4_BASE)].Valid = 1; - pPML4->Pde[VAtoIndex4(PML4_BASE)].Write = 1; - pPML4->Pde[VAtoIndex4(PML4_BASE)].PageFrameNumber = PtrToPfn(PML4_BASE); - - ASSERT(VAtoIndex4(PML4_BASE) == 0x1ed); - ASSERT(VAtoIndex3(PML4_BASE) == 0x1ed); - ASSERT(VAtoIndex2(PML4_BASE) == 0x1ed); - ASSERT(VAtoIndex1(PML4_BASE) == 0x1ed); + pPML4->Pde[VAtoPXI(PXE_BASE)].Valid = 1; + pPML4->Pde[VAtoPXI(PXE_BASE)].Write = 1; + pPML4->Pde[VAtoPXI(PXE_BASE)].PageFrameNumber = PtrToPfn(PXE_BASE); /* Setup low memory pages */ if (FrLdrMapRangeOfPages(0, 0, 1024) < 1024) diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index 9aa40284546..d574b2692a5 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -28,21 +28,15 @@ #define LMODE_DS 0x10 #define VA_MASK 0x0000FFFFFFFFFFFFUL -#define PML4_SHIFT (12+9+9+9) -#define PDP_SHIFT (12+9+9) -#define PD_SHIFT (12+9) -#define PT_SHIFT 12 #define PtrToPfn(p) \ - ((((ULONGLONG)p) >> PT_SHIFT) & 0xffffffffffULL) + ((((ULONGLONG)p) >> PAGE_SHIFT) & 0xffffffffffULL) -#define VAtoIndex4(va) (((va) >> PML4_SHIFT) & 0x1FF) -#define VAtoIndex3(va) (((va) >> PDP_SHIFT) & 0x1FF) -#define VAtoIndex2(va) (((va) >> PD_SHIFT) & 0x1FF) -#define VAtoIndex1(va) (((va) >> PT_SHIFT) & 0x1FF) +#define VAtoPXI(va) (((va) >> PXI_SHIFT) & 0x1FF) +#define VAtoPPI(va) (((va) >> PPI_SHIFT) & 0x1FF) +#define VAtoPDI(va) (((va) >> PDI_SHIFT) & 0x1FF) +#define VAtoPTI(va) (((va) >> PTI_SHIFT) & 0x1FF) -#define PAGETABLE_BASE 0xfffff68000000000ULL -#define PML4_BASE 0xfffff6fb7dbedf68ULL #define HYPERSPACE_BASE 0xfffff70000000000ULL #define HAL_BASE 0xffffffff80000000ULL #define APIC_BASE 0xffffffffff000000ULL // FIXME From 21cfe5cb0184a77b09011c974e83de81b6b2a1ed Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 5 Aug 2008 21:25:29 +0000 Subject: [PATCH 104/388] implement byteswap intrinsics svn path=/branches/ros-amd64-bringup/; revision=35135 --- reactos/include/psdk/intrin_x86.h | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index a78a262f093..7e62aa931ed 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -910,6 +910,44 @@ static __inline__ __attribute__((always_inline)) unsigned long long __ull_rshift return retval; } +static __inline__ __attribute__((always_inline)) unsigned short _byteswap_ushort(unsigned short value) +{ + unsigned short retval; + __asm__("rorw $8, %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value)); + return retval; +} + +static __inline__ __attribute__((always_inline)) unsigned long _byteswap_ulong(unsigned long value) +{ + unsigned long retval; + __asm__("bswapl %[retval]" : [retval] "=rm" (retval) : "[retval]" (value)); + return retval; +} + +#ifdef _M_AMD64 +static __inline__ __attribute__((always_inline)) unsigned __int64 _byteswap_uint64(unsigned __int64 value) +{ + unsigned __int64 retval; + __asm__("bswapq %[retval]" : [retval] "=rm" (retval) : "[retval]" (value)); + return retval; +} +#else +static __inline__ __attribute__((always_inline)) unsigned __int64 _byteswap_uint64(unsigned __int64 value) +{ + union { + __int64 int64part; + struct { + unsigned long lowpart; + unsigned long hipart; + }; + } retval; + retval.int64part = value; + __asm__("bswapl %[lowpart]\n" + "bswapl %[hipart]\n" + : [lowpart] "=rm" (retval.hipart), [hipart] "=rm" (retval.lowpart) : "[lowpart]" (retval.lowpart), "[hipart]" (retval.hipart) ); + return retval.int64part; +} +#endif /*** 64-bit math ***/ static __inline__ __attribute__((always_inline)) long long __emul(const int a, const int b) From 33423c898540b4f92e3bf7a5abe2c25d9a2c05c7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 5 Aug 2008 21:50:25 +0000 Subject: [PATCH 105/388] use a do-nothing-seh as on arm svn path=/branches/ros-amd64-bringup/; revision=35136 --- reactos/include/reactos/libs/pseh/framebased.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/reactos/libs/pseh/framebased.h b/reactos/include/reactos/libs/pseh/framebased.h index ea2c2e4cf2d..4d74292105c 100644 --- a/reactos/include/reactos/libs/pseh/framebased.h +++ b/reactos/include/reactos/libs/pseh/framebased.h @@ -172,7 +172,7 @@ static _SEHPortableTryLevel_t * const _SEHPortableTryLevel = 0; STMT_; \ } -#ifdef _ARM_ +#if defined(_ARM_) || defined(_x86_64) #define _SEH_TRY \ for(;;) \ From 1cd21f9e2a4855807983dd50b560d78d82981168 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 7 Aug 2008 17:59:46 +0000 Subject: [PATCH 106/388] add macro definitions for KeQuerySystemTime, KeQueryTickCount and KeQueryInterruptTime to ddk, remove corresponding exports from ntoskrnl svn path=/branches/ros-amd64-bringup/; revision=35167 --- reactos/include/ddk/winddk.h | 26 ++++++++++++++++++++------ reactos/ntoskrnl/ntoskrnl_amd64.def | 3 --- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 8e6ade74107..dccdadc64b4 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5514,6 +5514,18 @@ KeGetCurrentThread( #define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xFFFF080000000000ULL #define KI_USER_SHARED_DATA 0xFFFFF78000000000ULL +#define SharedUserData ((PKUSER_SHARED_DATA const)KI_USER_SHARED_DATA) +#define SharedInterruptTime (&SharedUserData->InterruptTime) +#define SharedSystemTime (&SharedUserData->SystemTime) +#define SharedTickCount (&SharedUserData->TickCount) + +#define KeQueryInterruptTime() \ + (*(volatile ULONG64*)SharedInterruptTime) +#define KeQuerySystemTime(CurrentCount) \ + *(ULONG64*)(CurrentCount) = *(volatile ULONG64*)SharedSystemTime +#define KeQueryTickCount(CurrentCount) \ + *(ULONG64*)(CurrentCount) = *(volatile ULONG64*)SharedTickCount + typedef struct _KPCR { union @@ -9634,12 +9646,6 @@ KePulseEvent( IN KPRIORITY Increment, IN BOOLEAN Wait); -NTKERNELAPI -ULONGLONG -NTAPI -KeQueryInterruptTime( - VOID); - NTHALAPI LARGE_INTEGER NTAPI @@ -9652,6 +9658,13 @@ NTAPI KeQueryPriorityThread( IN PRKTHREAD Thread); +#if !defined(_M_AMD64) +NTKERNELAPI +ULONGLONG +NTAPI +KeQueryInterruptTime( + VOID); + NTKERNELAPI VOID NTAPI @@ -9663,6 +9676,7 @@ VOID NTAPI KeQueryTickCount( OUT PLARGE_INTEGER TickCount); +#endif NTKERNELAPI ULONG diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index c58b219e414..0a82a805bbd 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -4,7 +4,6 @@ ; EXPORTS ; -KeQuerySystemTime KfAcquireSpinLock KfReleaseSpinLock KeRaiseIrql @@ -14,8 +13,6 @@ KeInitializeSpinLock KeGetCurrentProcessorNumber RtlConvertUlongToLargeInteger RtlExtendedIntegerMultiply -KeQueryTickCount -KeQueryInterruptTime ; ; original: CcCanIWrite From 3e915894d676bad655bf13cb9076268072e28e3e Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 13 Aug 2008 23:06:54 +0000 Subject: [PATCH 107/388] add _ELF_ property to rbuild file svn path=/branches/ros-amd64-bringup/; revision=35322 --- reactos/config-amd64.template.rbuild | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/config-amd64.template.rbuild b/reactos/config-amd64.template.rbuild index e683b9b8cce..9403c655322 100644 --- a/reactos/config-amd64.template.rbuild +++ b/reactos/config-amd64.template.rbuild @@ -77,4 +77,10 @@ --> + + + From bc3b4008a2867d6335cc3f1db532c146b5f0133e Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 13 Aug 2008 23:45:27 +0000 Subject: [PATCH 108/388] Update KIPCR, KPRCB, KTRAP_FRAME, KDESCRIPTOR, all based on vista x64 symbol files. Comment out some code for now that was using an old structure member. Enable some x86 specific external variables for amd64, too. Comment out a reference to prcb->DbugDpcTime, this is the only reference, so it's useless anyway. Comment out code for KiRundownThread for the moment. Comment out KeQuerySystemTime and KeQueryInterruptTime on amd64, they are resolved through macros and not exported.Remove kdb_expr.c from build. Add endless loop in KiSystemStartupReal, that's where we stop. svn path=/branches/ros-amd64-bringup/; revision=35323 --- reactos/include/ndk/amd64/ketypes.h | 557 +++++++++++---------- reactos/ntoskrnl/ex/lookas.c | 9 +- reactos/ntoskrnl/include/internal/ke.h | 2 +- reactos/ntoskrnl/include/internal/ke_x.h | 2 +- reactos/ntoskrnl/ke/amd64/kiinit.c | 3 + reactos/ntoskrnl/ke/clock.c | 2 + reactos/ntoskrnl/ke/dpc.c | 4 +- reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 2 +- 8 files changed, 320 insertions(+), 261 deletions(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index cb5b4c31096..92325a0ca82 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -14,7 +14,7 @@ Abstract: Author: Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006 - Timo Kreuzer (timo.kreuzer@reactos.org) - Updated - 30-Jul-2008 + Timo Kreuzer (timo.kreuzer@reactos.org) - Updated - 14-Aug-2008 --*/ @@ -150,41 +150,70 @@ Author: // typedef struct _KTRAP_FRAME { - ULONG DbgEbp; - ULONG DbgEip; - ULONG DbgArgMark; - ULONG DbgArgPointer; - ULONG TempSegCs; - ULONG TempEsp; - ULONG Dr0; - ULONG Dr1; - ULONG Dr2; - ULONG Dr3; - ULONG Dr6; - ULONG Dr7; - ULONG SegGs; - ULONG SegEs; - ULONG SegDs; - ULONG Edx; - ULONG Ecx; - ULONG Eax; - ULONG PreviousPreviousMode; - struct _EXCEPTION_REGISTRATION_RECORD FAR *ExceptionList; - ULONG SegFs; - ULONG Edi; - ULONG Esi; - ULONG Ebx; - ULONG Ebp; - ULONG ErrCode; - ULONG Eip; - ULONG SegCs; + UINT64 P1Home; + UINT64 P2Home; + UINT64 P3Home; + UINT64 P4Home; + UINT64 P5; + CHAR PreviousMode; + UCHAR PreviousIrql; + UCHAR FaultIndicator; + UCHAR ExceptionActive; + ULONG MxCsr; + UINT64 Rax; + UINT64 Rcx; + UINT64 Rdx; + UINT64 R8; + UINT64 R9; + UINT64 R10; + UINT64 R11; + UINT64 GsBase; + UINT64 GsSwap; + M128A Xmm0; + M128A Xmm1; + M128A Xmm2; + M128A Xmm3; + M128A Xmm4; + M128A Xmm5; + UINT64 FaultAddress; + UINT64 ContextRecord; + UINT64 TimeStampCKCL; + UINT64 Dr0; + UINT64 Dr1; + UINT64 Dr2; + UINT64 Dr3; + UINT64 Dr6; + UINT64 Dr7; + UINT64 DebugControl; + UINT64 LastBranchToRip; + UINT64 LastBranchFromRip; + UINT64 LastExceptionToRip; + UINT64 LastExceptionFromRip; + UINT64 LastBranchControl; + ULONG LastBranchMSR; + USHORT SegDs; + USHORT SegEs; + USHORT SegFs; + USHORT SegGs; + UINT64 TrapFrame; + UINT64 Rbx; + UINT64 Rdi; + UINT64 Rsi; + UINT64 Rbp; + UINT64 ErrorCode; + UINT64 ExceptionFrame; + UINT64 TimeStampKlog; + UINT64 Rip; + USHORT SegCs; + UCHAR Fill0; + UCHAR Logging; + USHORT Fill1[2]; ULONG EFlags; - ULONG HardwareEsp; - ULONG HardwareSegSs; - ULONG V86Es; - ULONG V86Ds; - ULONG V86Fs; - ULONG V86Gs; + ULONG Fill2; + UINT64 Rsp; + USHORT SegSs; + USHORT Fill3; + LONG CodePatchCycle; } KTRAP_FRAME, *PKTRAP_FRAME; // @@ -284,24 +313,14 @@ typedef struct _KIDTENTRY USHORT ExtendedOffset; } KIDTENTRY, *PKIDTENTRY; -typedef struct _DESCRIPTOR +typedef struct _KDESCRIPTOR { - USHORT Pad; + USHORT Pad[3]; USHORT Limit; - ULONG Base; + PVOID Base; } KDESCRIPTOR, *PKDESCRIPTOR; #ifndef NTOS_MODE_USER -// -// Macro to get current KPRCB -// -FORCEINLINE -struct _KPRCB * -KeGetCurrentPrcb(VOID) -{ -// return (struct _KPRCB *)(ULONG_PTR)__readgsqword(FIELD_OFFSET(KPCR, Prcb)); - return 0; -} // // FN/FX (FPU) Save Area Structures @@ -352,21 +371,33 @@ typedef struct _FX_SAVE_AREA // typedef struct _KSPECIAL_REGISTERS { - ULONG Cr0; - ULONG Cr2; - ULONG Cr3; - ULONG Cr4; - ULONG KernelDr0; - ULONG KernelDr1; - ULONG KernelDr2; - ULONG KernelDr3; - ULONG KernelDr6; - ULONG KernelDr7; - KDESCRIPTOR Gdtr; - KDESCRIPTOR Idtr; + UINT64 Cr0; + UINT64 Cr2; + UINT64 Cr3; + UINT64 Cr4; + UINT64 KernelDr0; + UINT64 KernelDr1; + UINT64 KernelDr2; + UINT64 KernelDr3; + UINT64 KernelDr6; + UINT64 KernelDr7; + struct _KDESCRIPTOR Gdtr; + struct _KDESCRIPTOR Idtr; USHORT Tr; USHORT Ldtr; - ULONG Reserved[6]; + ULONG MxCsr; + UINT64 DebugControl; + UINT64 LastBranchToRip; + UINT64 LastBranchFromRip; + UINT64 LastExceptionToRip; + UINT64 LastExceptionFromRip; + UINT64 Cr8; + UINT64 MsrGsBase; + UINT64 MsrGsSwap; + UINT64 MsrStar; + UINT64 MsrLStar; + UINT64 MsrCStar; + UINT64 MsrSyscallMask; } KSPECIAL_REGISTERS, *PKSPECIAL_REGISTERS; // @@ -374,99 +405,206 @@ typedef struct _KSPECIAL_REGISTERS // typedef struct _KPROCESSOR_STATE { - CONTEXT ContextFrame; KSPECIAL_REGISTERS SpecialRegisters; + CONTEXT ContextFrame; } KPROCESSOR_STATE, *PKPROCESSOR_STATE; +typedef struct _GENERAL_LOOKASIDE_POOL +{ + union + { + SLIST_HEADER ListHead; + SINGLE_LIST_ENTRY SingleListHead; + }; + USHORT Depth; + USHORT MaximumDepth; + ULONG TotalAllocates; + union + { + ULONG AllocateMisses; + ULONG AllocateHits; + }; + union + { + ULONG TotalFrees; + ULONG FreeMisses; + }; + ULONG FreeHits; + POOL_TYPE Type; + ULONG Tag; + ULONG Size; + union + { + PVOID AllocateEx; + PVOID Allocate; + }; + union + { + PVOID FreeEx; + PVOID Free; + }; + LIST_ENTRY ListEntry; + ULONG LastTotalAllocates; + union + { + ULONG LastAllocateMisses; + ULONG LastAllocateHits; + }; + ULONG Future[2]; +} GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL; + +typedef struct _KREQUEST_PACKET +{ + PVOID CurrentPacket[3]; + PVOID WorkerRoutine; +} KREQUEST_PACKET, *PKREQUEST_PACKET; + +typedef struct _REQUEST_MAILBOX +{ + INT64 RequestSummary; + KREQUEST_PACKET RequestPacket; + PVOID Virtual[7]; +} REQUEST_MAILBOX, *PREQUEST_MAILBOX; + // // Processor Region Control Block // #pragma pack(push,4) typedef struct _KPRCB { - USHORT MinorVersion; - USHORT MajorVersion; + ULONG MxCsr; + USHORT Number; + UCHAR InterruptRequest; + UCHAR IdleHalt; struct _KTHREAD *CurrentThread; struct _KTHREAD *NextThread; struct _KTHREAD *IdleThread; - UCHAR Number; - UCHAR Reserved; - USHORT BuildType; - KAFFINITY SetMember; + UCHAR NestingLevel; + UCHAR Group; + UCHAR PrcbPad00[6]; + UINT64 RspBase; + UINT64 PrcbLock; + UINT64 SetMember; + KPROCESSOR_STATE ProcessorState; UCHAR CpuType; UCHAR CpuID; USHORT CpuStep; - KPROCESSOR_STATE ProcessorState; - ULONG KernelReserved[16]; - ULONG HalReserved[16]; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) + UCHAR CpuStepping; + UCHAR CpuModel; + ULONG MHz; + UINT64 HalReserved[8]; + USHORT MinorVersion; + USHORT MajorVersion; + UCHAR BuildType; + UCHAR CpuVendor; + UCHAR CoresPerPhysicalProcessor; + UCHAR LogicalProcessorsPerCore; + ULONG ApicMask; ULONG CFlushSize; - UCHAR PrcbPad0[88]; -#else - UCHAR PrcbPad0[92]; -#endif + PVOID AcpiReserved; + ULONG InitialApicId; + ULONG Stride; + UINT64 PrcbPad01[3]; KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]; - struct _KTHREAD *NpxThread; - ULONG InterruptCount; - ULONG KernelTime; - ULONG UserTime; - ULONG DpcTime; - ULONG DebugDpcTime; - ULONG InterruptTime; - ULONG AdjustDpcThreshold; - ULONG PageColor; - UCHAR SkipTick; - UCHAR DebuggerSavedIRQL; -#if (NTDDI_VERSION >= NTDDI_WS03) - UCHAR NodeColor; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - UCHAR PollSlot; -#else - UCHAR Spare1; -#endif - ULONG NodeShiftedColor; -#else - UCHAR Spare1[6]; -#endif - struct _KNODE *ParentNode; - ULONG MultiThreadProcessorSet; - struct _KPRCB *MultiThreadSetMaster; -#if (NTDDI_VERSION >= NTDDI_WS03) - ULONG SecondaryColorMask; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - ULONG DpcTimeLimit; -#else - LONG Sleeping; -#endif -#else - ULONG ThreadStartCount[2]; -#endif + PP_LOOKASIDE_LIST PPLookasideList[16]; + GENERAL_LOOKASIDE_POOL PPNPagedLookasideList[32]; + GENERAL_LOOKASIDE_POOL PPPagedLookasideList[32]; + UINT64 PacketBarrier; + SINGLE_LIST_ENTRY DeferredReadyListHead; + LONG MmPageFaultCount; + LONG MmCopyOnWriteCount; + LONG MmTransitionCount; + LONG MmDemandZeroCount; + LONG MmPageReadCount; + LONG MmPageReadIoCount; + LONG MmDirtyPagesWriteCount; + LONG MmDirtyWriteIoCount; + LONG MmMappedPagesWriteCount; + LONG MmMappedWriteIoCount; + ULONG KeSystemCalls; + ULONG KeContextSwitches; ULONG CcFastReadNoWait; ULONG CcFastReadWait; ULONG CcFastReadNotPossible; ULONG CcCopyReadNoWait; ULONG CcCopyReadWait; ULONG CcCopyReadNoWaitMiss; -#if (NTDDI_VERSION < NTDDI_LONGHORN) - ULONG KeAlignmentFixupCount; -#endif - ULONG SpareCounter0; -#if (NTDDI_VERSION < NTDDI_LONGHORN) - ULONG KeDcacheFlushCount; - ULONG KeExceptionDispatchCount; - ULONG KeFirstLevelTbFills; - ULONG KeFloatingEmulationCount; - ULONG KeIcacheFlushCount; - ULONG KeSecondLevelTbFills; - ULONG KeSystemCalls; -#endif - volatile ULONG IoReadOperationCount; - volatile ULONG IoWriteOperationCount; - volatile ULONG IoOtherOperationCount; + LONG LookasideIrpFloat; + LONG IoReadOperationCount; + LONG IoWriteOperationCount; + LONG IoOtherOperationCount; LARGE_INTEGER IoReadTransferCount; LARGE_INTEGER IoWriteTransferCount; LARGE_INTEGER IoOtherTransferCount; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) + UINT64 TargetSet; + ULONG IpiFrozen; + UCHAR PrcbPad3[116]; + REQUEST_MAILBOX RequestMailbox[64]; + UINT64 SenderSummary; + UCHAR PrcbPad4[120]; + KDPC_DATA DpcData[2]; + PVOID DpcStack; + PVOID SparePtr0; + LONG MaximumDpcQueueDepth; + ULONG DpcRequestRate; + ULONG MinimumDpcRate; + UCHAR DpcInterruptRequested; + UCHAR DpcThreadRequested; + UCHAR DpcRoutineActive; + UCHAR DpcThreadActive; + UINT64 TimerHand; + UINT64 TimerRequest; + LONG TickOffset; + LONG MasterOffset; + ULONG DpcLastCount; + UCHAR ThreadDpcEnable; + UCHAR QuantumEnd; + UCHAR PrcbPad50; + UCHAR IdleSchedule; + LONG DpcSetEventRequest; + ULONG KeExceptionDispatchCount; + KEVENT DpcEvent; + PVOID PrcbPad51; + KDPC CallDpc; + LONG ClockKeepAlive; + UCHAR ClockCheckSlot; + UCHAR ClockPollCycle; + UCHAR PrcbPad6[2]; + LONG DpcWatchdogPeriod; + LONG DpcWatchdogCount; + UINT64 PrcbPad70[2]; + LIST_ENTRY WaitListHead; + UINT64 WaitLock; + ULONG ReadySummary; + ULONG QueueIndex; + UINT64 PrcbPad71[12]; + LIST_ENTRY DispatcherReadyListHead[32]; + ULONG InterruptCount; + ULONG KernelTime; + ULONG UserTime; + ULONG DpcTime; + ULONG InterruptTime; + ULONG AdjustDpcThreshold; + UCHAR SkipTick; + UCHAR DebuggerSavedIRQL; + UCHAR PollSlot; + UCHAR PrcbPad80[5]; + ULONG DpcTimeCount; + ULONG DpcTimeLimit; + ULONG PeriodicCount; + ULONG PeriodicBias; + UINT64 PrcbPad81[2]; + struct _KNODE *ParentNode; + UINT64 MultiThreadProcessorSet; + struct _KPRCB *MultiThreadSetMaster; + UINT64 StartCycles; + LONG MmSpinLockOrdering; + ULONG PageColor; + ULONG NodeColor; + ULONG NodeShiftedColor; + ULONG SecondaryColorMask; + LONG Sleeping; + UINT64 CycleTime; ULONG CcFastMdlReadNoWait; ULONG CcFastMdlReadWait; ULONG CcFastMdlReadNotPossible; @@ -493,137 +631,36 @@ typedef struct _KPRCB ULONG CcMdlReadNoWaitMiss; ULONG CcMdlReadWaitMiss; ULONG CcReadAheadIos; + LONG MmCacheTransitionCount; + LONG MmCacheReadCount; + LONG MmCacheIoCount; + ULONG PrcbPad91[3]; + PROCESSOR_POWER_STATE PowerState; ULONG KeAlignmentFixupCount; - ULONG KeExceptionDispatchCount; - ULONG KeSystemCalls; - ULONG PrcbPad1[3]; -#else - ULONG SpareCounter1[8]; -#endif - PP_LOOKASIDE_LIST PPLookasideList[16]; - PP_LOOKASIDE_LIST PPNPagedLookasideList[32]; - PP_LOOKASIDE_LIST PPPagedLookasideList[32]; - volatile ULONG PacketBarrier; - volatile ULONG ReverseStall; - PVOID IpiFrame; - UCHAR PrcbPad2[52]; - volatile PVOID CurrentPacket[3]; - volatile ULONG TargetSet; - volatile PKIPI_WORKER WorkerRoutine; - volatile ULONG IpiFrozen; - UCHAR PrcbPad3[40]; - volatile ULONG RequestSummary; - volatile struct _KPRCB *SignalDone; - UCHAR PrcbPad4[56]; - struct _KDPC_DATA DpcData[2]; - PVOID DpcStack; - ULONG MaximumDpcQueueDepth; - ULONG DpcRequestRate; - ULONG MinimumDpcRate; - volatile UCHAR DpcInterruptRequested; - volatile UCHAR DpcThreadRequested; - volatile UCHAR DpcRoutineActive; - volatile UCHAR DpcThreadActive; - ULONG PrcbLock; - ULONG DpcLastCount; - volatile ULONG TimerHand; - volatile ULONG TimerRequest; - PVOID DpcThread; - KEVENT DpcEvent; - UCHAR ThreadDpcEnable; - volatile BOOLEAN QuantumEnd; - UCHAR PrcbPad50; - volatile UCHAR IdleSchedule; - LONG DpcSetEventRequest; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - LONG Sleeping; - ULONG PeriodicCount; - ULONG PeriodicBias; - UCHAR PrcbPad5[6]; -#else - UCHAR PrcbPad5[18]; -#endif - LONG TickOffset; - KDPC CallDpc; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - LONG ClockKeepAlive; - UCHAR ClockCheckSlot; - UCHAR ClockPollCycle; - UCHAR PrcbPad6[2]; - LONG DpcWatchdogPeriod; - LONG DpcWatchDogCount; - LONG ThreadWatchdogPeriod; - LONG ThreadWatchDogCount; - ULONG PrcbPad70[2]; -#else - ULONG PrcbPad7[8]; -#endif - LIST_ENTRY WaitListHead; - ULONG ReadySummary; - ULONG QueueIndex; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - SINGLE_LIST_ENTRY DeferredReadyListHead; - ULONGLONG StartCycles; - ULONGLONG CycleTime; - ULONGLONG PrcbPad71[3]; - LIST_ENTRY DispatcherReadyListHead[32]; -#else - LIST_ENTRY DispatcherReadyListHead[32]; - SINGLE_LIST_ENTRY DeferredReadyListHead; - ULONG PrcbPad72[11]; -#endif - PVOID ChainedInterruptList; - LONG LookasideIrpFloat; - volatile LONG MmPageFaultCount; - volatile LONG MmCopyOnWriteCount; - volatile LONG MmTransitionCount; - volatile LONG MmCacheTransitionCount; - volatile LONG MmDemandZeroCount; - volatile LONG MmPageReadCount; - volatile LONG MmPageReadIoCount; - volatile LONG MmCacheReadCount; - volatile LONG MmCacheIoCount; - volatile LONG MmDirtyPagesWriteCount; - volatile LONG MmDirtyWriteIoCount; - volatile LONG MmMappedPagesWriteCount; - volatile LONG MmMappedWriteIoCount; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) + UCHAR VendorString[13]; + UCHAR PrcbPad10[3]; + ULONG FeatureBits; + LARGE_INTEGER UpdateSignature; + KDPC DpcWatchdogDpc; + KTIMER DpcWatchdogTimer; + CACHE_DESCRIPTOR Cache[5]; + ULONG CacheCount; ULONG CachedCommit; ULONG CachedResidentAvailable; PVOID HyperPte; - UCHAR CpuVendor; - UCHAR PrcbPad9[3]; -#else - ULONG SpareFields0[1]; -#endif - CHAR VendorString[13]; - UCHAR InitialApicId; - UCHAR LogicalProcessorsPerPhysicalProcessor; - ULONG MHz; - ULONG FeatureBits; - LARGE_INTEGER UpdateSignature; - volatile LARGE_INTEGER IsrTime; - LARGE_INTEGER SpareField1; - FX_SAVE_AREA NpxSaveArea; - PROCESSOR_POWER_STATE PowerState; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - KDPC DpcWatchdogDoc; - KTIMER DpcWatchdogTimer; PVOID WheaInfo; PVOID EtwSupport; SLIST_HEADER InterruptObjectPool; - LARGE_INTEGER HyperCallPagePhysical; - LARGE_INTEGER HyperCallPageVirtual; + SLIST_HEADER HypercallPageList; + PVOID HypercallPageVirtual; + PVOID VirtualApicAssist; + UINT64* StatisticsPage; PVOID RateControl; - CACHE_DESCRIPTOR Cache[5]; - ULONG CacheCount; - ULONG CacheProcessorMask[5]; - UCHAR LogicalProcessorsPerCore; - UCHAR PrcbPad8[3]; - ULONG PackageProcessorSet; - ULONG CoreProcessorSet; -#endif -} KPRCB, *PKPRCB; + UINT64 CacheProcessorMask[5]; + UINT64 PackageProcessorSet; + UINT64 CoreProcessorSet; +} + KPRCB, *PKPRCB; // // Processor Control Region @@ -664,10 +701,9 @@ typedef struct _KIPCR PVOID Unused3; ULONG PcrAlign1[24]; - ULONG Unknown1; // 0x178 - ULONG Unknown2; - ULONG Unknown3; - USHORT CpuNumber; // 0x184 + ULONG Fill2; // 0x178 + KPRCB Prcb; + // hack: ULONG ContextSwitches; @@ -726,5 +762,16 @@ typedef struct _KTSS // i386 CPUs don't have exception frames // typedef struct _KEXCEPTION_FRAME KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; + +// +// Macro to get current KPRCB +// +FORCEINLINE +struct _KPRCB * +KeGetCurrentPrcb(VOID) +{ + return (struct _KPRCB *)(ULONG_PTR)__readgsqword(FIELD_OFFSET(KIPCR, Prcb)); +} + #endif #endif diff --git a/reactos/ntoskrnl/ex/lookas.c b/reactos/ntoskrnl/ex/lookas.c index f32e249d68e..73edf6e83d4 100644 --- a/reactos/ntoskrnl/ex/lookas.c +++ b/reactos/ntoskrnl/ex/lookas.c @@ -74,16 +74,23 @@ ExInitPoolLookasidePointers(VOID) InitializeSListHead(&Entry->ListHead); /* Bind to PRCB */ +#ifdef _M_AMD64 + // FIXME +#else Prcb->PPNPagedLookasideList[i].P = Entry; Prcb->PPNPagedLookasideList[i].L = Entry; - +#endif /* Initialize the paged list */ Entry = &ExpSmallPagedPoolLookasideLists[i]; InitializeSListHead(&Entry->ListHead); /* Bind to PRCB */ +#ifdef _M_AMD64 + // FIXME +#else Prcb->PPPagedLookasideList[i].P = Entry; Prcb->PPPagedLookasideList[i].L = Entry; +#endif } } diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index 005dd5b5744..302417e1051 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -105,7 +105,7 @@ extern PULONG KiInterruptTemplateObject; extern PULONG KiInterruptTemplateDispatch; extern PULONG KiInterruptTemplate2ndDispatch; extern ULONG KiUnexpectedEntrySize; -#ifdef _M_IX86 +#if defined(_M_IX86) || defined(_M_AMD64) extern PVOID Ki386IopmSaveArea; extern ULONG KeI386EFlagsAndMaskV86; extern ULONG KeI386EFlagsOrMaskV86; diff --git a/reactos/ntoskrnl/include/internal/ke_x.h b/reactos/ntoskrnl/include/internal/ke_x.h index 65984ff0609..8d584f4c7f5 100644 --- a/reactos/ntoskrnl/include/internal/ke_x.h +++ b/reactos/ntoskrnl/include/internal/ke_x.h @@ -350,7 +350,7 @@ FORCEINLINE VOID KiRundownThread(IN PKTHREAD Thread) { -#if defined(_M_IX86) || defined(_M_AMD64) +#if defined(_M_IX86) /* Check if this is the NPX Thread */ if (KeGetCurrentPrcb()->NpxThread == Thread) { diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index b2ed5f6910f..9247b445f4e 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -656,6 +656,9 @@ VOID NTAPI KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { + FrLdrDbgPrint("Enter KiSystemStartupReal()\n"); + for(;;); + #if 0 ULONG Cpu; PKTHREAD InitialThread; diff --git a/reactos/ntoskrnl/ke/clock.c b/reactos/ntoskrnl/ke/clock.c index ee4255f9eaa..ead761da5c8 100644 --- a/reactos/ntoskrnl/ke/clock.c +++ b/reactos/ntoskrnl/ke/clock.c @@ -197,6 +197,7 @@ KeQueryTickCount(IN PLARGE_INTEGER TickCount) } } +#ifndef _M_AMD64 /* * @implemented */ @@ -239,6 +240,7 @@ KeQueryInterruptTime(VOID) /* Return the time value */ return CurrentTime.QuadPart; } +#endif /* * @implemented diff --git a/reactos/ntoskrnl/ke/dpc.c b/reactos/ntoskrnl/ke/dpc.c index cf81fcd113c..ee64bf11d7d 100644 --- a/reactos/ntoskrnl/ke/dpc.c +++ b/reactos/ntoskrnl/ke/dpc.c @@ -456,10 +456,10 @@ KiRetireDpcList(IN PKPRCB Prcb) /* Decrease the queue depth */ DpcData->DpcQueueDepth--; - +#ifndef _M_AMD64 /* Clear DPC Time */ Prcb->DebugDpcTime = 0; - +#endif /* Release the lock */ KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock); diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index cd7ec8f133f..7dc6fd73114 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -296,7 +296,7 @@ - kdb_expr.c + kdb_keyboard.c kdb_serial.c From 803292ae6c98538361b99cdd4d73633d419ce035 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 14 Aug 2008 00:24:46 +0000 Subject: [PATCH 109/388] Update add KGDTENTRY64 and KIDTENTRY64 to replace KGDTENTRY and KIDTENTRY, remove FNSAVE_FORMAT, FXSAVE_FORMAT and FX_SAVE_AREA svn path=/branches/ros-amd64-bringup/; revision=35324 --- reactos/include/ndk/amd64/ketypes.h | 126 +++++++++++----------------- 1 file changed, 51 insertions(+), 75 deletions(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 92325a0ca82..724caa9423c 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -254,34 +254,42 @@ typedef struct _LDT_ENTRY // // GDT Entry Definition // -typedef struct _KGDTENTRY +typedef union _KGDTENTRY64 { - USHORT LimitLow; - USHORT BaseLow; - union + struct { - struct + USHORT LimitLow; + USHORT BaseLow; + union { - UCHAR BaseMid; - UCHAR Flags1; - UCHAR Flags2; - UCHAR BaseHi; - } Bytes; - struct - { - ULONG BaseMid:8; - ULONG Type:5; - ULONG Dpl:2; - ULONG Pres:1; - ULONG LimitHi:4; - ULONG Sys:1; - ULONG Reserved_0:1; - ULONG Default_Big:1; - ULONG Granularity:1; - ULONG BaseHi:8; - } Bits; - } HighWord; -} KGDTENTRY, *PKGDTENTRY; + struct + { + UCHAR BaseMiddle; + UCHAR Flags1; + UCHAR Flags2; + UCHAR BaseHigh; + } Bytes; + struct + { + ULONG BaseMiddle:8; + ULONG Type:5; + ULONG Dpl:2; + ULONG Present:1; + ULONG LimitHigh:4; + ULONG System:1; + ULONG LongMode:1; + ULONG DefaultBig:1; + ULONG Granularity:1; + ULONG BaseHigh:8; + } Bits; + }; + ULONG BaseUpper; + ULONG MustBeZero; + }; + UINT64 Alignment; +} KGDTENTRY64, *PKGDTENTRY64; +#define KGDTENTRY KGDTENTRY64 +#define PKGDTENTRY PKGDTENTRY64 // // IDT Entry Access Definition @@ -305,13 +313,25 @@ typedef struct _KIDT_ACCESS // // IDT Entry Definition // -typedef struct _KIDTENTRY +typedef union _KIDTENTRY64 { - USHORT Offset; - USHORT Selector; - USHORT Access; - USHORT ExtendedOffset; -} KIDTENTRY, *PKIDTENTRY; + struct + { + USHORT OffsetLow; + USHORT Selector; + USHORT IstIndex:3; + USHORT Reserved0:5; + USHORT Type:5; + USHORT Dpl:2; + USHORT Present:1; + USHORT OffsetMiddle; + ULONG OffsetHigh; + ULONG Reserved1; + }; + UINT64 Alignment; +} KIDTENTRY64, *PKIDTENTRY64; +#define KIDTENTRY KIDTENTRY64 +#define PKIDTENTRY PKIDTENTRY64 typedef struct _KDESCRIPTOR { @@ -322,50 +342,6 @@ typedef struct _KDESCRIPTOR #ifndef NTOS_MODE_USER -// -// FN/FX (FPU) Save Area Structures -// -typedef struct _FNSAVE_FORMAT -{ - ULONG ControlWord; - ULONG StatusWord; - ULONG TagWord; - ULONG ErrorOffset; - ULONG ErrorSelector; - ULONG DataOffset; - ULONG DataSelector; - UCHAR RegisterArea[80]; -} FNSAVE_FORMAT, *PFNSAVE_FORMAT; - -typedef struct _FXSAVE_FORMAT -{ - USHORT ControlWord; - USHORT StatusWord; - USHORT TagWord; - USHORT ErrorOpcode; - ULONG ErrorOffset; - ULONG ErrorSelector; - ULONG DataOffset; - ULONG DataSelector; - ULONG MXCsr; - ULONG MXCsrMask; - UCHAR RegisterArea[128]; - UCHAR Reserved3[128]; - UCHAR Reserved4[224]; - UCHAR Align16Byte[8]; -} FXSAVE_FORMAT, *PFXSAVE_FORMAT; - -typedef struct _FX_SAVE_AREA -{ - union - { - FNSAVE_FORMAT FnArea; - FXSAVE_FORMAT FxArea; - } U; - ULONG NpxSavedCpu; - ULONG Cr0NpxState; -} FX_SAVE_AREA, *PFX_SAVE_AREA; - // // Special Registers Structure (outside of CONTEXT) // From 931280fae6aa641de005b63121221d6a346fc113 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 14 Aug 2008 02:24:14 +0000 Subject: [PATCH 110/388] add NtCurrentTeb inline function svn path=/branches/ros-amd64-bringup/; revision=35325 --- reactos/include/ndk/psfuncs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/include/ndk/psfuncs.h b/reactos/include/ndk/psfuncs.h index fecdd6de8f6..67b48a1782b 100644 --- a/reactos/include/ndk/psfuncs.h +++ b/reactos/include/ndk/psfuncs.h @@ -315,6 +315,11 @@ NtCurrentTeb(VOID) return ret; #endif } +#elif defined (_M_AMD64) +FORCEINLINE struct _TEB * NtCurrentTeb(VOID) +{ + return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self)); +} #endif #else struct _TEB * NtCurrentTeb(void); From d3c3d4d5764926136dcfbc5c294e02d5f4c8979d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 14 Aug 2008 02:43:52 +0000 Subject: [PATCH 111/388] add LDT_ENTRY to winnt.h svn path=/branches/ros-amd64-bringup/; revision=35326 --- reactos/include/psdk/winnt.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 4a11311df38..d9bf6aa3c4b 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -2002,6 +2002,38 @@ typedef struct _ACL_SIZE_INFORMATION { DWORD AclBytesFree; } ACL_SIZE_INFORMATION; +#ifndef _LDT_ENTRY_DEFINED +#define _LDT_ENTRY_DEFINED +typedef struct _LDT_ENTRY +{ + USHORT LimitLow; + USHORT BaseLow; + union + { + struct + { + UCHAR BaseMid; + UCHAR Flags1; + UCHAR Flags2; + UCHAR BaseHi; + } Bytes; + struct + { + ULONG BaseMid:8; + ULONG Type:5; + ULONG Dpl:2; + ULONG Pres:1; + ULONG LimitHi:4; + ULONG Sys:1; + ULONG Reserved_0:1; + ULONG Default_Big:1; + ULONG Granularity:1; + ULONG BaseHi:8; + } Bits; + } HighWord; +} LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY; +#endif + /* FIXME: add more machines */ #if defined(__i386__) && !defined(__PowerPC__) #define SIZE_OF_80387_REGISTERS 80 From a0b08b14c84a457ad3fe96b59a9a90981308fd18 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 14 Aug 2008 22:58:22 +0000 Subject: [PATCH 112/388] NDK: update 64bit mm structures, based on win2003 and vista symbol files svn path=/branches/ros-amd64-bringup/; revision=35347 --- reactos/include/ndk/amd64/mmtypes.h | 208 ++++++++++++++++++---------- 1 file changed, 134 insertions(+), 74 deletions(-) diff --git a/reactos/include/ndk/amd64/mmtypes.h b/reactos/include/ndk/amd64/mmtypes.h index a1af46be561..3f8a66a4ad2 100644 --- a/reactos/include/ndk/amd64/mmtypes.h +++ b/reactos/include/ndk/amd64/mmtypes.h @@ -14,7 +14,7 @@ Abstract: Author: Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004 - Timo Kreuzer (timo.kreuzer@reactos.com) 29-Jul-2008 + Timo Kreuzer (timo.kreuzer@reactos.com) 15-Aug-2008 --*/ @@ -47,109 +47,169 @@ C_ASSERT(MM_ALLOCATION_GRANULARITY >= PAGE_SIZE); // // Page Table Entry Definitions // -typedef struct _HARDWARE_PTE_AMD64 +typedef struct _HARDWARE_PTE { - ULONGLONG Valid:1; - ULONGLONG Write:1; - ULONGLONG Owner:1; - ULONGLONG WriteThrough:1; - ULONGLONG CacheDisable:1; - ULONGLONG Accessed:1; - ULONGLONG Dirty:1; - ULONGLONG LargePage:1; - ULONGLONG Global:1; - ULONGLONG CopyOnWrite:1; - ULONGLONG Prototype: 1; - ULONGLONG reserved1: 1; - ULONGLONG PageFrameNumber:40; - ULONGLONG reserved2:11; - ULONGLONG NoExecute:1; -} HARDWARE_PTE_AMD64, *PHARDWARE_PTE_AMD64; + ULONG64 Valid:1; + ULONG64 Write:1; + ULONG64 Owner:1; + ULONG64 WriteThrough:1; + ULONG64 CacheDisable:1; + ULONG64 Accessed:1; + ULONG64 Dirty:1; + ULONG64 LargePage:1; + ULONG64 Global:1; + ULONG64 CopyOnWrite:1; + ULONG64 Prototype:1; + ULONG64 reserved0:1; + ULONG64 PageFrameNumber:28; + ULONG64 reserved1:12; + ULONG64 SoftwareWsIndex:11; + ULONG64 NoExecute:1; +} HARDWARE_PTE, *PHARDWARE_PTE; typedef struct _MMPTE_SOFTWARE { - ULONG Valid:1; - ULONG PageFileLow:4; - ULONG Protection:5; - ULONG Prototype:1; - ULONG Transition:1; - ULONG PageFileHigh:20; -} MMPTE_SOFTWARE; + ULONG64 Valid:1; + ULONG64 PageFileLow:4; + ULONG64 Protection:5; + ULONG64 Prototype:1; + ULONG64 Transition:1; + ULONG64 UsedPageTableEntries:10; + ULONG64 Reserved:10; + ULONG64 PageFileHigh:32; +} MMPTE_SOFTWARE, *PMMPTE_SOFTWARE; typedef struct _MMPTE_TRANSITION { - ULONG Valid:1; - ULONG Write:1; - ULONG Owner:1; - ULONG WriteThrough:1; - ULONG CacheDisable:1; - ULONG Protection:5; - ULONG Prototype:1; - ULONG Transition:1; - ULONG PageFrameNumber:20; + ULONG64 Valid:1; + ULONG64 Write:1; + ULONG64 Owner:1; + ULONG64 WriteThrough:1; + ULONG64 CacheDisable:1; + ULONG64 Protection:5; + ULONG64 Prototype:1; + ULONG64 Transition:1; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + ULONG64 PageFrameNumber:36; + ULONG64 Unused:16; +#else + ULONG64 PageFrameNumber:28; + ULONG64 Unused:24; +#endif } MMPTE_TRANSITION; typedef struct _MMPTE_PROTOTYPE { - ULONG Valid:1; - ULONG ProtoAddressLow:7; - ULONG ReadOnly:1; - ULONG WhichPool:1; - ULONG Prototype:1; - ULONG ProtoAddressHigh:21; + ULONG64 Valid:1; + ULONG64 Unused0:7; + ULONG64 ReadOnly:1; + ULONG64 Unused1:1; + ULONG64 Prototype:1; + ULONG64 Protection:5; + LONG64 ProtoAddress:48; } MMPTE_PROTOTYPE; typedef struct _MMPTE_SUBSECTION { - ULONG Valid:1; - ULONG SubsectionAddressLow:4; - ULONG Protection:5; - ULONG Prototype:1; - ULONG SubsectionAddressHigh:20; - ULONG WhichPool:1; + ULONG64 Valid:1; + ULONG64 Unused0:4; + ULONG64 Protection:5; + ULONG64 Prototype:1; + ULONG64 Unused1:5; + LONG64 SubsectionAddress:48; } MMPTE_SUBSECTION; typedef struct _MMPTE_LIST { - ULONG Valid:1; - ULONG OneEntry:1; - ULONG filler0:8; - ULONG NextEntry:20; - ULONG Prototype:1; - ULONG filler1:1; + ULONG64 Valid:1; + ULONG64 OneEntry:1; + ULONG64 filler0:3; + ULONG64 Protection:5; + ULONG64 Prototype:1; + ULONG64 Transition:1; + ULONG64 filler1:20; + ULONG64 NextEntry:32; } MMPTE_LIST; #ifndef CONFIG_SMP typedef struct _MMPTE_HARDWARE { - ULONGLONG Valid:1; - ULONGLONG Write:1; - ULONGLONG Owner:1; - ULONGLONG WriteThrough:1; - ULONGLONG CacheDisable:1; - ULONGLONG Accessed:1; - ULONGLONG Dirty:1; - ULONGLONG LargePage:1; - ULONGLONG Global:1; - ULONGLONG CopyOnWrite:1; - ULONGLONG Prototype: 1; - ULONGLONG reserved1: 1; - ULONGLONG PageFrameNumber:40; - ULONGLONG reserved2:11; - ULONGLONG NoExecute:1; + ULONG64 Valid:1; + ULONG64 Write:1; + ULONG64 Owner:1; + ULONG64 WriteThrough:1; + ULONG64 CacheDisable:1; + ULONG64 Accessed:1; + ULONG64 Dirty:1; + ULONG64 LargePage:1; + ULONG64 Global:1; + ULONG64 CopyOnWrite:1; + ULONG64 Prototype:1; + ULONG64 reserved0:1; + ULONG64 PageFrameNumber:28; + ULONG64 reserved1:12; + ULONG64 SoftwareWsIndex:11; + ULONG64 NoExecute:1; } MMPTE_HARDWARE, *PMMPTE_HARDWARE; #else -#error MMPTE_HARDWARE undeclared +typedef struct _MMPTE_HARDWARE +{ + ULONG64 Valid:1; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + ULONG64 Dirty1:1; +#else + ULONG64 Writable:1; +#endif + ULONG64 Owner:1; + ULONG64 WriteThrough:1; + ULONG64 CacheDisable:1; + ULONG64 Accessed:1; + ULONG64 Dirty:1; + ULONG64 LargePage:1; + ULONG64 Global:1; + ULONG64 CopyOnWrite:1; + ULONG64 Prototype:1; + ULONG64 Write:1; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + ULONG64 PageFrameNumber:36; + ULONG64 reserved1:4; +#else + ULONG64 PageFrameNumber:28; + ULONG64 reserved1:12; +#endif + ULONG64 SoftwareWsIndex:11; + ULONG64 NoExecute:1; +} MMPTE_HARDWARE, *PMMPTE_HARDWARE; #endif -// -// Use the right PTE structure -// -#define HARDWARE_PTE HARDWARE_PTE_AMD64 -#define PHARDWARE_PTE PHARDWARE_PTE_AMD64 - +typedef struct _MMPTE_HARDWARE_LARGEPAGE +{ + ULONG64 Valid:1; + ULONG64 Write:1; + ULONG64 Owner:1; + ULONG64 WriteThrough:1; + ULONG64 CacheDisable:1; + ULONG64 Accessed:1; + ULONG64 Dirty:1; + ULONG64 LargePage:1; + ULONG64 Global:1; + ULONG64 CopyOnWrite:1; + ULONG64 Prototype:1; + ULONG64 reserved0:1; + ULONG64 PAT:1; + ULONG64 reserved1:8; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + ULONG64 PageFrameNumber:27; + ULONG64 reserved2:16; +#else + ULONG64 PageFrameNumber:19; + ULONG64 reserved2:24; #endif +} MMPTE_HARDWARE_LARGEPAGE, *PMMPTE_HARDWARE_LARGEPAGE; + + +#endif // !AMD64_MMTYPES_H From ea1d7436f15b459eda87589eeb564eb4caeb2734 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 15 Aug 2008 01:00:03 +0000 Subject: [PATCH 113/388] NDK: update KPRCB based on win2003 and vista symbol files svn path=/branches/ros-amd64-bringup/; revision=35348 --- reactos/include/ndk/amd64/ketypes.h | 118 ++++++++++++++++++++++++++-- 1 file changed, 113 insertions(+), 5 deletions(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 724caa9423c..6acdfb18c80 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -385,6 +385,7 @@ typedef struct _KPROCESSOR_STATE CONTEXT ContextFrame; } KPROCESSOR_STATE, *PKPROCESSOR_STATE; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) typedef struct _GENERAL_LOOKASIDE_POOL { union @@ -428,6 +429,9 @@ typedef struct _GENERAL_LOOKASIDE_POOL }; ULONG Future[2]; } GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL; +#else +#define GENERAL_LOOKASIDE_POOL PP_LOOKASIDE_LIST +#endif typedef struct _KREQUEST_PACKET { @@ -449,39 +453,72 @@ typedef struct _REQUEST_MAILBOX typedef struct _KPRCB { ULONG MxCsr; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) USHORT Number; +#else + UCHAR Number; + UCHAR NestingLevel; +#endif UCHAR InterruptRequest; UCHAR IdleHalt; struct _KTHREAD *CurrentThread; struct _KTHREAD *NextThread; struct _KTHREAD *IdleThread; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) UCHAR NestingLevel; UCHAR Group; UCHAR PrcbPad00[6]; +#else + UINT64 UserRsp; +#endif UINT64 RspBase; UINT64 PrcbLock; UINT64 SetMember; KPROCESSOR_STATE ProcessorState; - UCHAR CpuType; - UCHAR CpuID; + CHAR CpuType; + CHAR CpuID; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + union + { + USHORT CpuStep; + struct + { + UCHAR CpuStepping; + UCHAR CpuModel; + }; + }; +#else USHORT CpuStep; - UCHAR CpuStepping; - UCHAR CpuModel; +#endif ULONG MHz; UINT64 HalReserved[8]; USHORT MinorVersion; USHORT MajorVersion; UCHAR BuildType; UCHAR CpuVendor; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) UCHAR CoresPerPhysicalProcessor; UCHAR LogicalProcessorsPerCore; +#else + UCHAR InitialApicId; + UCHAR LogicalProcessorsPerPhysicalProcessor; +#endif ULONG ApicMask; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) ULONG CFlushSize; +#else + UCHAR CFlushSize; + UCHAR PrcbPad0x[3]; +#endif PVOID AcpiReserved; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) ULONG InitialApicId; ULONG Stride; UINT64 PrcbPad01[3]; - KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]; +#else + UINT64 PrcbPad00[4]; +#endif + KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]; // 2003: 33, vista:49 PP_LOOKASIDE_LIST PPLookasideList[16]; GENERAL_LOOKASIDE_POOL PPNPagedLookasideList[32]; GENERAL_LOOKASIDE_POOL PPPagedLookasideList[32]; @@ -490,13 +527,21 @@ typedef struct _KPRCB LONG MmPageFaultCount; LONG MmCopyOnWriteCount; LONG MmTransitionCount; +#if (NTDDI_VERSION < NTDDI_LONGHORN) + LONG MmCacheTransitionCount; +#endif LONG MmDemandZeroCount; LONG MmPageReadCount; LONG MmPageReadIoCount; +#if (NTDDI_VERSION < NTDDI_LONGHORN) + LONG MmCacheReadCount; + LONG MmCacheIoCount; +#endif LONG MmDirtyPagesWriteCount; LONG MmDirtyWriteIoCount; LONG MmMappedPagesWriteCount; LONG MmMappedWriteIoCount; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) ULONG KeSystemCalls; ULONG KeContextSwitches; ULONG CcFastReadNoWait; @@ -506,12 +551,20 @@ typedef struct _KPRCB ULONG CcCopyReadWait; ULONG CcCopyReadNoWaitMiss; LONG LookasideIrpFloat; +#else + LONG LookasideIrpFloat; + ULONG KeSystemCalls; +#endif LONG IoReadOperationCount; LONG IoWriteOperationCount; LONG IoOtherOperationCount; LARGE_INTEGER IoReadTransferCount; LARGE_INTEGER IoWriteTransferCount; LARGE_INTEGER IoOtherTransferCount; +#if (NTDDI_VERSION < NTDDI_LONGHORN) + ULONG KeContextSwitches; + UCHAR PrcbPad2[12]; +#endif UINT64 TargetSet; ULONG IpiFrozen; UCHAR PrcbPad3[116]; @@ -520,7 +573,11 @@ typedef struct _KPRCB UCHAR PrcbPad4[120]; KDPC_DATA DpcData[2]; PVOID DpcStack; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) PVOID SparePtr0; +#else + PVOID SavedRsp; +#endif LONG MaximumDpcQueueDepth; ULONG DpcRequestRate; ULONG MinimumDpcRate; @@ -538,10 +595,18 @@ typedef struct _KPRCB UCHAR PrcbPad50; UCHAR IdleSchedule; LONG DpcSetEventRequest; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) ULONG KeExceptionDispatchCount; +#else + LONG PrcbPad40; + PVOID DpcThread; +#endif KEVENT DpcEvent; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) PVOID PrcbPad51; +#endif KDPC CallDpc; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) LONG ClockKeepAlive; UCHAR ClockCheckSlot; UCHAR ClockPollCycle; @@ -549,11 +614,18 @@ typedef struct _KPRCB LONG DpcWatchdogPeriod; LONG DpcWatchdogCount; UINT64 PrcbPad70[2]; +#else + UINT64 PrcbPad7[4]; +#endif LIST_ENTRY WaitListHead; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) UINT64 WaitLock; +#endif ULONG ReadySummary; ULONG QueueIndex; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) UINT64 PrcbPad71[12]; +#endif LIST_ENTRY DispatcherReadyListHead[32]; ULONG InterruptCount; ULONG KernelTime; @@ -564,22 +636,29 @@ typedef struct _KPRCB UCHAR SkipTick; UCHAR DebuggerSavedIRQL; UCHAR PollSlot; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) UCHAR PrcbPad80[5]; ULONG DpcTimeCount; ULONG DpcTimeLimit; ULONG PeriodicCount; ULONG PeriodicBias; UINT64 PrcbPad81[2]; +#else + UCHAR PrcbPad8[13]; +#endif struct _KNODE *ParentNode; UINT64 MultiThreadProcessorSet; struct _KPRCB *MultiThreadSetMaster; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) UINT64 StartCycles; LONG MmSpinLockOrdering; ULONG PageColor; ULONG NodeColor; ULONG NodeShiftedColor; ULONG SecondaryColorMask; +#endif LONG Sleeping; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) UINT64 CycleTime; ULONG CcFastMdlReadNoWait; ULONG CcFastMdlReadWait; @@ -635,6 +714,35 @@ typedef struct _KPRCB UINT64 CacheProcessorMask[5]; UINT64 PackageProcessorSet; UINT64 CoreProcessorSet; +#else + ULONG PrcbPad90[1]; + ULONG DebugDpcTime; + ULONG PageColor; + ULONG NodeColor; + ULONG NodeShiftedColor; + ULONG SecondaryColorMask; + UCHAR PrcbPad9[12]; + ULONG CcFastReadNoWait; + ULONG CcFastReadWait; + ULONG CcFastReadNotPossible; + ULONG CcCopyReadNoWait; + ULONG CcCopyReadWait; + ULONG CcCopyReadNoWaitMiss; + ULONG KeAlignmentFixupCount; + ULONG KeDcacheFlushCount; + ULONG KeExceptionDispatchCount; + ULONG KeFirstLevelTbFills; + ULONG KeFloatingEmulationCount; + ULONG KeIcacheFlushCount; + ULONG KeSecondLevelTbFills; + UCHAR VendorString[13]; + UCHAR PrcbPad10[2]; + ULONG FeatureBits; + LARGE_INTEGER UpdateSignature; + PROCESSOR_POWER_STATE PowerState; + CACHE_DESCRIPTOR Cache[5]; + ULONG CacheCount; +#endif } KPRCB, *PKPRCB; From ed1b8451581fd62da46cc57461b3badb58612b97 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 15 Aug 2008 02:05:18 +0000 Subject: [PATCH 114/388] NDK: update PEB definition based in win2003 and vista 32/64 bit symbols svn path=/branches/ros-amd64-bringup/; revision=35349 --- reactos/include/ndk/pstypes.h | 52 ++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/reactos/include/ndk/pstypes.h b/reactos/include/ndk/pstypes.h index 77498367863..b8db1343cab 100644 --- a/reactos/include/ndk/pstypes.h +++ b/reactos/include/ndk/pstypes.h @@ -576,16 +576,22 @@ typedef struct _PEB UCHAR ReadImageFileExecOptions; UCHAR BeingDebugged; #if (NTDDI_VERSION >= NTDDI_WS03) - struct + union { - UCHAR ImageUsesLargePages:1; + UCHAR BitField; + struct + { + UCHAR ImageUsesLargePages:1; #if (NTDDI_VERSION >= NTDDI_LONGHORN) - UCHAR IsProtectedProcess:1; - UCHAR IsLegacyProcess:1; - UCHAR SpareBits:5; + UCHAR IsProtectedProcess:1; + UCHAR IsLegacyProcess:1; + UCHAR IsImageDynamicallyRelocated:1; + UCHAR SkipPatchingUser32Forwarders:1; + UCHAR SpareBits:3; #else - UCHAR SpareBits:7; + UCHAR SpareBits:7; #endif + }; }; #else BOOLEAN SpareBool; @@ -600,7 +606,18 @@ typedef struct _PEB struct _RTL_CRITICAL_SECTION *FastPebLock; PVOID AltThunkSListPtr; PVOID IFEOKey; - ULONG Spare; + union + { + ULONG CrossProcessFlags; + struct + { + ULONG ProcessInJob:1; + ULONG ProcessInitializing:1; + ULONG ProcessUsingVEH:1; + ULONG ProcessUsingVCH:1; + ULONG ReservedBits0:28; + }; + }; union { PVOID* KernelCallbackTable; @@ -608,6 +625,7 @@ typedef struct _PEB }; ULONG SystemReserved[1]; ULONG SpareUlong; + ULONG_PTR SparePebPtr0; #else PVOID FastPebLock; PPEBLOCKROUTINE FastPebLockRoutine; @@ -616,13 +634,17 @@ typedef struct _PEB PVOID* KernelCallbackTable; PVOID EventLogSection; PVOID EventLog; -#endif PPEB_FREE_BLOCK FreeList; +#endif ULONG TlsExpansionCounter; PVOID TlsBitmap; ULONG TlsBitmapBits[0x2]; PVOID ReadOnlySharedMemoryBase; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + PVOID HotpatchInformation; +#else PVOID ReadOnlySharedMemoryHeap; +#endif PVOID* ReadOnlyStaticServerData; PVOID AnsiCodePageData; PVOID OemCodePageData; @@ -630,10 +652,10 @@ typedef struct _PEB ULONG NumberOfProcessors; ULONG NtGlobalFlag; LARGE_INTEGER CriticalSectionTimeout; - ULONG HeapSegmentReserve; - ULONG HeapSegmentCommit; - ULONG HeapDeCommitTotalFreeThreshold; - ULONG HeapDeCommitFreeBlockThreshold; + ULONG_PTR HeapSegmentReserve; + ULONG_PTR HeapSegmentCommit; + ULONG_PTR HeapDeCommitTotalFreeThreshold; + ULONG_PTR HeapDeCommitFreeBlockThreshold; ULONG NumberOfHeaps; ULONG MaximumNumberOfHeaps; PVOID* ProcessHeaps; @@ -654,7 +676,11 @@ typedef struct _PEB ULONG ImageSubSystemMajorVersion; ULONG ImageSubSystemMinorVersion; ULONG ImageProcessAffinityMask; +#ifdef _WIN64 + ULONG GdiHandleBuffer[0x3c]; +#else ULONG GdiHandleBuffer[0x22]; +#endif PPOST_PROCESS_INIT_ROUTINE PostProcessInitRoutine; struct _RTL_BITMAP *TlsExpansionBitmap; ULONG TlsExpansionBitmapBits[0x20]; @@ -669,7 +695,7 @@ typedef struct _PEB struct _ASSEMBLY_STORAGE_MAP *ProcessAssemblyStorageMap; struct _ACTIVATION_CONTEXT_DATA *SystemDefaultActivationContextData; struct _ASSEMBLY_STORAGE_MAP *SystemAssemblyStorageMap; - ULONG MinimumStackCommit; + ULONG_PTR MinimumStackCommit; #endif #if (NTDDI_VERSION >= NTDDI_WS03) PVOID *FlsCallback; From 5ba5164dd3ef1c04699d4115f61660c564366651 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 15 Aug 2008 11:24:10 +0000 Subject: [PATCH 115/388] try to fix build svn path=/branches/ros-amd64-bringup/; revision=35351 --- reactos/base/applications/network/ftp/fake.c | 6 +- .../applications/network/tracert/tracert.c | 4 +- .../boot/freeldr/freeldr/reactos/setupldr.c | 11 - reactos/lib/sdk/crt/stdio/lnx_sprintf.c | 1410 ++++++++--------- 4 files changed, 711 insertions(+), 720 deletions(-) diff --git a/reactos/base/applications/network/ftp/fake.c b/reactos/base/applications/network/ftp/fake.c index f8d0c8cdadf..b08d56c7f9a 100644 --- a/reactos/base/applications/network/ftp/fake.c +++ b/reactos/base/applications/network/ftp/fake.c @@ -1,5 +1,6 @@ #include -#include +//#include +#include #include #include "fake.h" #include "prototypes.h" @@ -307,12 +308,13 @@ int access(const char *filename, int accessmethod) #define EPOCHFILETIME (116444736000000000LL) #endif -int gettimeofday(struct timeval *tv, struct timezone *tz) +int gettimeofday(struct timeval *tv, void *tz0) { FILETIME ft; LARGE_INTEGER li; __int64 t; static int tzflag; + struct timezone *tz = tz0; if (tv) { diff --git a/reactos/base/applications/network/tracert/tracert.c b/reactos/base/applications/network/tracert/tracert.c index e04f982ddab..f852bfd1fef 100644 --- a/reactos/base/applications/network/tracert/tracert.c +++ b/reactos/base/applications/network/tracert/tracert.c @@ -396,7 +396,7 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id, process id %d"), TTLExceedHdr->OrigIcmpHeader.id, GetCurrentProcessId()); return -1; } - _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); + _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); return 0; case ECHO_REPLY : @@ -407,7 +407,7 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id %d, process id %d"), IcmpHdr->icmpheader.id, GetCurrentProcessId()); return -1; } - _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); + _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); return 1; case DEST_UNREACHABLE : diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index dcc4bc0f4dc..f1f1f508ba3 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -289,17 +289,6 @@ VOID RunLoader(VOID) return; } - /* Load fastfat.sys (could be loaded by the setup prog!) */ - if (!LoadDriver(SourcePath, "fastfat.sys")) - return; - - /* Load ext2.sys (could be loaded by the setup prog!) */ - if (!LoadDriver(SourcePath, "ext2.sys")) - { - DbgPrint((DPRINT_WARNING, "Could not load ext2\n")); -// return; - } - /* Load additional files specified in txtsetup.inf */ if (InfFindFirstLine(InfHandle, "SourceDisksFiles", diff --git a/reactos/lib/sdk/crt/stdio/lnx_sprintf.c b/reactos/lib/sdk/crt/stdio/lnx_sprintf.c index 3b48479e7c7..11981ddf439 100644 --- a/reactos/lib/sdk/crt/stdio/lnx_sprintf.c +++ b/reactos/lib/sdk/crt/stdio/lnx_sprintf.c @@ -1,705 +1,705 @@ -/* - * PROGRAMMERS: David Welch - * Eric Kohl - * - * TODO: - * - Verify the implementation of '%Z'. - */ - -/* - * linux/lib/vsprintf.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ -/* - * Wirzenius wrote this portably, Torvalds fucked it up :-) - */ - -#include - -#include -#include - -#define ZEROPAD 1 /* pad with zero */ -#define SIGN 2 /* unsigned/signed long */ -#define PLUS 4 /* show plus */ -#define SPACE 8 /* space if plus */ -#define LEFT 16 /* left justified */ -#define SPECIAL 32 /* 0x */ -#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ -#define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */ - -static -__inline -int -do_div(long long *n, int base) -{ - int a; - a = ((unsigned long long) *n) % (unsigned) base; - *n = ((unsigned long long) *n) / (unsigned) base; - return a; -} - - -static int skip_atoi(const char **s) -{ - int i=0; - - while (isdigit(**s)) - i = i*10 + *((*s)++) - '0'; - return i; -} - - -static char * -number(char * buf, char * end, long long num, int base, int size, int precision, int type) -{ - char c,sign,tmp[66]; - const char *digits; - const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; - const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - int i; - - digits = (type & LARGE) ? large_digits : small_digits; - if (type & LEFT) - type &= ~ZEROPAD; - if (base < 2 || base > 36) - return 0; - c = (type & ZEROPAD) ? '0' : ' '; - sign = 0; - if (type & SIGN) { - if (num < 0) { - sign = '-'; - num = -num; - size--; - } else if (type & PLUS) { - sign = '+'; - size--; - } else if (type & SPACE) { - sign = ' '; - size--; - } - } - - if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { - if (base == 16) - size -= 2; - - } - i = 0; - if ((num == 0) && (precision !=0)) - tmp[i++] = '0'; - else while (num != 0) - tmp[i++] = digits[do_div(&num,base)]; - if (i > precision) - precision = i; - size -= precision; - if (!(type&(ZEROPAD+LEFT))) { - while(size-->0) { - if (buf <= end) - *buf = ' '; - ++buf; - } - } - if (sign) { - if (buf <= end) - *buf = sign; - ++buf; - } - - if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { - if (base==16) { - if (buf <= end) - *buf = '0'; - ++buf; - if (buf <= end) - *buf = digits[33]; - ++buf; - } - } - - if (!(type & LEFT)) { - while (size-- > 0) { - if (buf <= end) - *buf = c; - ++buf; - } - } - while (i < precision--) { - if (buf <= end) - *buf = '0'; - ++buf; - } - while (i-- > 0) { - if (buf <= end) - *buf = tmp[i]; - ++buf; - } - while (size-- > 0) { - if (buf <= end) - *buf = ' '; - ++buf; - } - - return buf; -} - -static char * -numberf(char * buf, char * end, double num, int base, int size, int precision, int type) -{ - char c,sign,tmp[66]; - const char *digits; - const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; - const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - int i; - long long x; - - /* FIXME - the float version of number is direcly copy of number - */ - - digits = (type & LARGE) ? large_digits : small_digits; - if (type & LEFT) - type &= ~ZEROPAD; - if (base < 2 || base > 36) - return 0; - c = (type & ZEROPAD) ? '0' : ' '; - sign = 0; - if (type & SIGN) { - if (num < 0) { - sign = '-'; - num = -num; - size--; - } else if (type & PLUS) { - sign = '+'; - size--; - } else if (type & SPACE) { - sign = ' '; - size--; - } - } - if (type & SPECIAL) { - if (base == 16) - size -= 2; - else if (base == 8) - size--; - } - i = 0; - if (num == 0) - tmp[i++] = '0'; - else while (num != 0) - { - x = num; - tmp[i++] = digits[do_div(&x,base)]; - num=x; - } - if (i > precision) - precision = i; - size -= precision; - if (!(type&(ZEROPAD+LEFT))) { - while(size-->0) { - if (buf <= end) - *buf = ' '; - ++buf; - } - } - if (sign) { - if (buf <= end) - *buf = sign; - ++buf; - } - if (type & SPECIAL) { - if (base==8) { - if (buf <= end) - *buf = '0'; - ++buf; - } else if (base==16) { - if (buf <= end) - *buf = '0'; - ++buf; - if (buf <= end) - *buf = digits[33]; - ++buf; - } - } - if (!(type & LEFT)) { - while (size-- > 0) { - if (buf <= end) - *buf = c; - ++buf; - } - } - while (i < precision--) { - if (buf <= end) - *buf = '0'; - ++buf; - } - while (i-- > 0) { - if (buf <= end) - *buf = tmp[i]; - ++buf; - } - while (size-- > 0) { - if (buf <= end) - *buf = ' '; - ++buf; - } - return buf; -} - -static char* -string(char* buf, char* end, const char* s, int len, int field_width, int precision, int flags) -{ - int i; - char c; - - c = (flags & ZEROPAD) ? '0' : ' '; - - if (s == NULL) - { - s = ""; - len = 6; - } - else - { - if (len == -1) - { - len = 0; - while ((unsigned int)len < (unsigned int)precision && s[len]) - len++; - } - else - { - if ((unsigned int)len > (unsigned int)precision) - len = precision; - } - } - if (!(flags & LEFT)) - while (len < field_width--) - { - if (buf <= end) - *buf = c; - ++buf; - } - for (i = 0; i < len; ++i) - { - if (buf <= end) - *buf = *s++; - ++buf; - } - while (len < field_width--) - { - if (buf <= end) - *buf = ' '; - ++buf; - } - return buf; -} - -static char* -stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int precision, int flags) -{ - int i; - char c; - - c = (flags & ZEROPAD) ? '0' : ' '; - - if (sw == NULL) - { - sw = L""; - len = 6; - } - else - { - if (len == -1) - { - len = 0; - while ((unsigned int)len < (unsigned int)precision && sw[len]) - len++; - } - else - { - if ((unsigned int)len > (unsigned int)precision) - len = precision; - } - } - if (!(flags & LEFT)) - while (len < field_width--) - { - if (buf <= end) - *buf = c; - buf++; - } - for (i = 0; i < len; ++i) - { - if (buf <= end) - *buf = (unsigned char)(*sw++); - buf++; - } - while (len < field_width--) - { - if (buf <= end) - *buf = ' '; - buf++; - } - return buf; -} - -/* - * @implemented - */ -int __cdecl lnx_vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) -{ - int len; - unsigned long long num; - double _double; - - int base; - char *str, *end; - const char *s; - const wchar_t *sw; - - int flags; /* flags to number() */ - - int field_width; /* width of output field */ - int precision; /* min. # of digits for integers; max - number of chars for from string */ - int qualifier; /* 'h', 'l', 'L', 'I' or 'w' for integer fields */ - - /* clear the string buffer with zero so we do not need NULL terment it at end */ - - str = buf; - end = buf + cnt - 1; - if (end < buf - 1) { - end = ((char *) -1); - cnt = end - buf + 1; - } - - for ( ; *fmt ; ++fmt) { - if (*fmt != '%') { - if (str <= end) - *str = *fmt; - ++str; - continue; - } - - /* process flags */ - flags = 0; - repeat: - ++fmt; /* this also skips first '%' */ - switch (*fmt) { - case '-': flags |= LEFT; goto repeat; - case '+': flags |= PLUS; goto repeat; - case ' ': flags |= SPACE; goto repeat; - case '#': flags |= SPECIAL; goto repeat; - case '0': flags |= ZEROPAD; goto repeat; - } - - /* get field width */ - field_width = -1; - if (isdigit(*fmt)) - field_width = skip_atoi(&fmt); - else if (*fmt == '*') { - ++fmt; - /* it's the next argument */ - field_width = va_arg(args, int); - if (field_width < 0) { - field_width = -field_width; - flags |= LEFT; - } - } - - /* get the precision */ - precision = -1; - if (*fmt == '.') { - ++fmt; - if (isdigit(*fmt)) - precision = skip_atoi(&fmt); - else if (*fmt == '*') { - ++fmt; - /* it's the next argument */ - precision = va_arg(args, int); - } - if (precision < 0) - precision = 0; - } - - /* get the conversion qualifier */ - qualifier = -1; - if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') { - qualifier = *fmt; - ++fmt; - } else if (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4') { - qualifier = *fmt; - fmt += 3; - } else if (*fmt == 'I' && *(fmt+1) == '3' && *(fmt+2) == '2') { - qualifier = 'l'; - fmt += 3; - } else if (*fmt == 'F' && *(fmt+1) == 'p') { - fmt += 1; - flags |= REMOVEHEX; - } - - /* default base */ - base = 10; - - switch (*fmt) { - case 'c': /* finished */ - if (qualifier == 'l' || qualifier == 'w') { - wchar_t sw1[2]; - /* print unicode string */ - sw1[0] = (wchar_t) va_arg(args, int); - sw1[1] = 0; - str = stringw(str, end, (wchar_t *)&sw1, -1, field_width, precision, flags); - } else { - char s1[2]; - /* print ascii string */ - s1[0] = ( unsigned char) va_arg(args, int); - s1[1] = 0; - str = string(str, end, (char *)&s1, -1, field_width, precision, flags); - } - continue; - - case 'C': /* finished */ - if (!(flags & LEFT)) - while (--field_width > 0) { - if (str <= end) - *str = ' '; - ++str; - } - if (qualifier == 'h') { - if (str <= end) - *str = (unsigned char) va_arg(args, int); - ++str; - } else { - if (str <= end) - *str = (unsigned char)(wchar_t) va_arg(args, int); - ++str; - } - while (--field_width > 0) { - if (str <= end) - *str = ' '; - ++str; - } - continue; - - case 's': /* finished */ - if (qualifier == 'l' || qualifier == 'w') { - /* print unicode string */ - sw = va_arg(args, wchar_t *); - str = stringw(str, end, sw, -1, field_width, precision, flags); - } else { - /* print ascii string */ - s = va_arg(args, char *); - str = string(str, end, s, -1, field_width, precision, flags); - } - continue; - - case 'S': - if (qualifier == 'h') { - /* print ascii string */ - s = va_arg(args, char *); - str = string(str, end, s, -1, field_width, precision, flags); - } else { - /* print unicode string */ - sw = va_arg(args, wchar_t *); - str = stringw(str, end, sw, -1, field_width, precision, flags); - } - continue; - - case 'Z': - if (qualifier == 'w') { - /* print counted unicode string */ - PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING); - if ((pus == NULL) || (pus->Buffer == NULL)) { - sw = NULL; - len = -1; - } else { - sw = pus->Buffer; - len = pus->Length / sizeof(WCHAR); - } - str = stringw(str, end, sw, len, field_width, precision, flags); - } else { - /* print counted ascii string */ - PANSI_STRING pus = va_arg(args, PANSI_STRING); - if ((pus == NULL) || (pus->Buffer == NULL)) { - s = NULL; - len = -1; - } else { - s = pus->Buffer; - len = pus->Length; - } - str = string(str, end, s, len, field_width, precision, flags); - } - continue; - - case 'p': - if ((flags & LARGE) == 0) - flags |= LARGE; - - if (field_width == -1) { - field_width = 2 * sizeof(void *); - flags |= ZEROPAD; - } - str = number(str, end, - (unsigned long) va_arg(args, void *), 16, - field_width, precision, flags); - continue; - - case 'n': - /* FIXME: What does C99 say about the overflow case here? */ - if (qualifier == 'l') { - long * ip = va_arg(args, long *); - *ip = (str - buf); - } else { - int * ip = va_arg(args, int *); - *ip = (str - buf); - } - continue; - - /* float number formats - set up the flags and "break" */ - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': - _double = (double)va_arg(args, double); - if ( _isnan(_double) ) { - s = "Nan"; - len = 3; - while ( len > 0 ) { - if (str <= end) - *str = *s++; - ++str; - len --; - } - } else if ( _isinf(_double) < 0 ) { - s = "-Inf"; - len = 4; - while ( len > 0 ) { - if (str <= end) - *str = *s++; - ++str; - len --; - } - } else if ( _isinf(_double) > 0 ) { - s = "+Inf"; - len = 4; - while ( len > 0 ) { - if (str <= end) - *str = *s++; - ++str; - len --; - } - } else { - if ( precision == -1 ) - precision = 6; - str = numberf(str, end, (int)_double, base, field_width, precision, flags); - } - - continue; - - - /* integer number formats - set up the flags and "break" */ - case 'o': - base = 8; - break; - - case 'b': - base = 2; - break; - - case 'X': - flags |= LARGE; - case 'x': - base = 16; - break; - - case 'd': - case 'i': - flags |= SIGN; - case 'u': - break; - - default: - if (*fmt) { - if (str <= end) - *str = *fmt; - ++str; - } else - --fmt; - continue; - } - - if (qualifier == 'I') - num = va_arg(args, unsigned long long); - else if (qualifier == 'l') { - if (flags & SIGN) - num = va_arg(args, long); - else - num = va_arg(args, unsigned long); - } - else if (qualifier == 'h') { - if (flags & SIGN) - num = va_arg(args, int); - else - num = va_arg(args, unsigned int); - } - else { - if (flags & SIGN) - num = va_arg(args, int); - else - num = va_arg(args, unsigned int); - } - str = number(str, end, num, base, field_width, precision, flags); - } - if (str <= end) - *str = '\0'; - else if (cnt > 0) - /* don't write out a null byte if the buf size is zero */ - *end = '\0'; - return str-buf; -} - - -/* - * @implemented - */ -int lnx_sprintf(char * buf, const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - i=lnx_vsnprintf(buf,MAXLONG,fmt,args); - va_end(args); - return i; -} - -#if 0 -/* - * @implemented - */ -int _snprintf(char * buf, size_t cnt, const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - i=_vsnprintf(buf,cnt,fmt,args); - va_end(args); - return i; -} - - -/* - * @implemented - */ -int __cdecl vsprintf(char *buf, const char *fmt, va_list args) -{ - return _vsnprintf(buf,MAXLONG,fmt,args); -} -#endif -/* EOF */ +/* + * PROGRAMMERS: David Welch + * Eric Kohl + * + * TODO: + * - Verify the implementation of '%Z'. + */ + +/* + * linux/lib/vsprintf.c + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ +/* + * Wirzenius wrote this portably, Torvalds fucked it up :-) + */ + +#include + +#include +#include + +#define ZEROPAD 1 /* pad with zero */ +#define SIGN 2 /* unsigned/signed long */ +#define PLUS 4 /* show plus */ +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ +#define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */ + +static +__inline +int +do_div(long long *n, int base) +{ + int a; + a = ((unsigned long long) *n) % (unsigned) base; + *n = ((unsigned long long) *n) / (unsigned) base; + return a; +} + + +static int skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + return i; +} + + +static char * +number(char * buf, char * end, long long num, int base, int size, int precision, int type) +{ + char c,sign,tmp[66]; + const char *digits; + const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; + const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return 0; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if (num < 0) { + sign = '-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; + } + } + + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { + if (base == 16) + size -= 2; + + } + i = 0; + if ((num == 0) && (precision !=0)) + tmp[i++] = '0'; + else while (num != 0) + tmp[i++] = digits[do_div(&num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + } + if (sign) { + if (buf <= end) + *buf = sign; + ++buf; + } + + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { + if (base==16) { + if (buf <= end) + *buf = '0'; + ++buf; + if (buf <= end) + *buf = digits[33]; + ++buf; + } + } + + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + + return buf; +} + +static char * +numberf(char * buf, char * end, double num, int base, int size, int precision, int type) +{ + char c,sign,tmp[66]; + const char *digits; + const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; + const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + long long x; + + /* FIXME + the float version of number is direcly copy of number + */ + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return 0; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if (num < 0) { + sign = '-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; + } + } + if (type & SPECIAL) { + if (base == 16) + size -= 2; + else if (base == 8) + size--; + } + i = 0; + if (num == 0) + tmp[i++] = '0'; + else while (num != 0) + { + x = num; + tmp[i++] = digits[do_div(&x,base)]; + num=x; + } + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + } + if (sign) { + if (buf <= end) + *buf = sign; + ++buf; + } + if (type & SPECIAL) { + if (base==8) { + if (buf <= end) + *buf = '0'; + ++buf; + } else if (base==16) { + if (buf <= end) + *buf = '0'; + ++buf; + if (buf <= end) + *buf = digits[33]; + ++buf; + } + } + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + return buf; +} + +static char* +string(char* buf, char* end, const char* s, int len, int field_width, int precision, int flags) +{ + int i; + char c; + + c = (flags & ZEROPAD) ? '0' : ' '; + + if (s == NULL) + { + s = ""; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && s[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + if (buf <= end) + *buf = c; + ++buf; + } + for (i = 0; i < len; ++i) + { + if (buf <= end) + *buf = *s++; + ++buf; + } + while (len < field_width--) + { + if (buf <= end) + *buf = ' '; + ++buf; + } + return buf; +} + +static char* +stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int precision, int flags) +{ + int i; + char c; + + c = (flags & ZEROPAD) ? '0' : ' '; + + if (sw == NULL) + { + sw = L""; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && sw[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + if (buf <= end) + *buf = c; + buf++; + } + for (i = 0; i < len; ++i) + { + if (buf <= end) + *buf = (unsigned char)(*sw++); + buf++; + } + while (len < field_width--) + { + if (buf <= end) + *buf = ' '; + buf++; + } + return buf; +} + +/* + * @implemented + */ +int __cdecl lnx_vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) +{ + int len; + unsigned long long num; + double _double; + + int base; + char *str, *end; + const char *s; + const wchar_t *sw; + + int flags; /* flags to number() */ + + int field_width; /* width of output field */ + int precision; /* min. # of digits for integers; max + number of chars for from string */ + int qualifier; /* 'h', 'l', 'L', 'I' or 'w' for integer fields */ + + /* clear the string buffer with zero so we do not need NULL terment it at end */ + + str = buf; + end = buf + cnt - 1; + if (end < buf - 1) { + end = ((char *) -1); + cnt = end - buf + 1; + } + + for ( ; *fmt ; ++fmt) { + if (*fmt != '%') { + if (str <= end) + *str = *fmt; + ++str; + continue; + } + + /* process flags */ + flags = 0; + repeat: + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + case '-': flags |= LEFT; goto repeat; + case '+': flags |= PLUS; goto repeat; + case ' ': flags |= SPACE; goto repeat; + case '#': flags |= SPECIAL; goto repeat; + case '0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + if (field_width < 0) { + field_width = -field_width; + flags |= LEFT; + } + } + + /* get the precision */ + precision = -1; + if (*fmt == '.') { + ++fmt; + if (isdigit(*fmt)) + precision = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + precision = va_arg(args, int); + } + if (precision < 0) + precision = 0; + } + + /* get the conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') { + qualifier = *fmt; + ++fmt; + } else if (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4') { + qualifier = *fmt; + fmt += 3; + } else if (*fmt == 'I' && *(fmt+1) == '3' && *(fmt+2) == '2') { + qualifier = 'l'; + fmt += 3; + } else if (*fmt == 'F' && *(fmt+1) == 'p') { + fmt += 1; + flags |= REMOVEHEX; + } + + /* default base */ + base = 10; + + switch (*fmt) { + case 'c': /* finished */ + if (qualifier == 'l' || qualifier == 'w') { + wchar_t sw1[2]; + /* print unicode string */ + sw1[0] = (wchar_t) va_arg(args, int); + sw1[1] = 0; + str = stringw(str, end, (wchar_t *)&sw1, -1, field_width, precision, flags); + } else { + char s1[2]; + /* print ascii string */ + s1[0] = ( unsigned char) va_arg(args, int); + s1[1] = 0; + str = string(str, end, (char *)&s1, -1, field_width, precision, flags); + } + continue; + + case 'C': /* finished */ + if (!(flags & LEFT)) + while (--field_width > 0) { + if (str <= end) + *str = ' '; + ++str; + } + if (qualifier == 'h') { + if (str <= end) + *str = (unsigned char) va_arg(args, int); + ++str; + } else { + if (str <= end) + *str = (unsigned char)(wchar_t) va_arg(args, int); + ++str; + } + while (--field_width > 0) { + if (str <= end) + *str = ' '; + ++str; + } + continue; + + case 's': /* finished */ + if (qualifier == 'l' || qualifier == 'w') { + /* print unicode string */ + sw = va_arg(args, wchar_t *); + str = stringw(str, end, sw, -1, field_width, precision, flags); + } else { + /* print ascii string */ + s = va_arg(args, char *); + str = string(str, end, s, -1, field_width, precision, flags); + } + continue; + + case 'S': + if (qualifier == 'h') { + /* print ascii string */ + s = va_arg(args, char *); + str = string(str, end, s, -1, field_width, precision, flags); + } else { + /* print unicode string */ + sw = va_arg(args, wchar_t *); + str = stringw(str, end, sw, -1, field_width, precision, flags); + } + continue; + + case 'Z': + if (qualifier == 'w') { + /* print counted unicode string */ + PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING); + if ((pus == NULL) || (pus->Buffer == NULL)) { + sw = NULL; + len = -1; + } else { + sw = pus->Buffer; + len = pus->Length / sizeof(WCHAR); + } + str = stringw(str, end, sw, len, field_width, precision, flags); + } else { + /* print counted ascii string */ + PANSI_STRING pus = va_arg(args, PANSI_STRING); + if ((pus == NULL) || (pus->Buffer == NULL)) { + s = NULL; + len = -1; + } else { + s = pus->Buffer; + len = pus->Length; + } + str = string(str, end, s, len, field_width, precision, flags); + } + continue; + + case 'p': + if ((flags & LARGE) == 0) + flags |= LARGE; + + if (field_width == -1) { + field_width = 2 * sizeof(void *); + flags |= ZEROPAD; + } + str = number(str, end, + (unsigned long) va_arg(args, void *), 16, + field_width, precision, flags); + continue; + + case 'n': + /* FIXME: What does C99 say about the overflow case here? */ + if (qualifier == 'l') { + long * ip = va_arg(args, long *); + *ip = (str - buf); + } else { + int * ip = va_arg(args, int *); + *ip = (str - buf); + } + continue; + + /* float number formats - set up the flags and "break" */ + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + _double = (double)va_arg(args, double); + if ( _isnan(_double) ) { + s = "Nan"; + len = 3; + while ( len > 0 ) { + if (str <= end) + *str = *s++; + ++str; + len --; + } + } else if ( _isinf(_double) < 0 ) { + s = "-Inf"; + len = 4; + while ( len > 0 ) { + if (str <= end) + *str = *s++; + ++str; + len --; + } + } else if ( _isinf(_double) > 0 ) { + s = "+Inf"; + len = 4; + while ( len > 0 ) { + if (str <= end) + *str = *s++; + ++str; + len --; + } + } else { + if ( precision == -1 ) + precision = 6; + str = numberf(str, end, (int)_double, base, field_width, precision, flags); + } + + continue; + + + /* integer number formats - set up the flags and "break" */ + case 'o': + base = 8; + break; + + case 'b': + base = 2; + break; + + case 'X': + flags |= LARGE; + case 'x': + base = 16; + break; + + case 'd': + case 'i': + flags |= SIGN; + case 'u': + break; + + default: + if (*fmt) { + if (str <= end) + *str = *fmt; + ++str; + } else + --fmt; + continue; + } + + if (qualifier == 'I') + num = va_arg(args, unsigned long long); + else if (qualifier == 'l') { + if (flags & SIGN) + num = va_arg(args, long); + else + num = va_arg(args, unsigned long); + } + else if (qualifier == 'h') { + if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } + else { + if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } + str = number(str, end, num, base, field_width, precision, flags); + } + if (str <= end) + *str = '\0'; + else if (cnt > 0) + /* don't write out a null byte if the buf size is zero */ + *end = '\0'; + return str-buf; +} + + +/* + * @implemented + */ +int lnx_sprintf(char * buf, const char *fmt, ...) +{ + va_list args; + int i; + + va_start(args, fmt); + i=lnx_vsnprintf(buf,MAXLONG,fmt,args); + va_end(args); + return i; +} + +#if 0 +/* + * @implemented + */ +int _snprintf(char * buf, size_t cnt, const char *fmt, ...) +{ + va_list args; + int i; + + va_start(args, fmt); + i=_vsnprintf(buf,cnt,fmt,args); + va_end(args); + return i; +} + + +/* + * @implemented + */ +int __cdecl vsprintf(char *buf, const char *fmt, va_list args) +{ + return _vsnprintf(buf,MAXLONG,fmt,args); +} +#endif +/* EOF */ From bb7874923429b27d3f795149aa9d1e5d092f0977 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 15 Aug 2008 23:40:42 +0000 Subject: [PATCH 116/388] The TEB member is called ClientID not Cid on all Windows versions I could check (XP, 2k3, vista). svn path=/branches/ros-amd64-bringup/; revision=35359 --- reactos/dll/ntdll/csr/api.c | 2 +- reactos/dll/ntdll/csr/connect.c | 2 +- reactos/dll/win32/gdi32/main/dllmain.c | 2 +- reactos/dll/win32/kernel32/file/pipe.c | 2 +- reactos/dll/win32/kernel32/process/proc.c | 2 +- reactos/dll/win32/kernel32/thread/thread.c | 2 +- reactos/dll/win32/user32/windows/window.c | 4 ++-- reactos/include/ndk/pstypes.h | 2 +- reactos/lib/rtl/critical.c | 12 ++++++------ reactos/lib/rtl/dbgbuffer.c | 2 +- reactos/lib/rtl/resource.c | 10 +++++----- reactos/ntoskrnl/mm/procsup.c | 2 +- reactos/subsystems/win32/win32k/ntuser/event.c | 8 ++++---- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/reactos/dll/ntdll/csr/api.c b/reactos/dll/ntdll/csr/api.c index ad1033fd72a..20e0ae7cbf1 100644 --- a/reactos/dll/ntdll/csr/api.c +++ b/reactos/dll/ntdll/csr/api.c @@ -73,7 +73,7 @@ CsrIdentifyAlertableThread (VOID) /* Set up the data for CSR */ DbgBreakPoint(); IdentifyAlertableThread = &ApiMessage.IdentifyAlertableThread; - IdentifyAlertableThread->Cid = NtCurrentTeb()->Cid; + IdentifyAlertableThread->Cid = NtCurrentTeb()->ClientId; /* Call it */ Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, diff --git a/reactos/dll/ntdll/csr/connect.c b/reactos/dll/ntdll/csr/connect.c index 658cd3c1030..dc6bb7c49fd 100644 --- a/reactos/dll/ntdll/csr/connect.c +++ b/reactos/dll/ntdll/csr/connect.c @@ -152,7 +152,7 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage, { /* This is a server-to-server call. Save our CID and do a direct call */ DbgBreakPoint(); - ApiMessage->Header.ClientId = NtCurrentTeb()->Cid; + ApiMessage->Header.ClientId = NtCurrentTeb()->ClientId; Status = CsrServerApiRoutine(&ApiMessage->Header, &ApiMessage->Header); diff --git a/reactos/dll/win32/gdi32/main/dllmain.c b/reactos/dll/win32/gdi32/main/dllmain.c index 0e06d490e34..afd9764e912 100644 --- a/reactos/dll/win32/gdi32/main/dllmain.c +++ b/reactos/dll/win32/gdi32/main/dllmain.c @@ -48,7 +48,7 @@ GdiProcessSetup (VOID) GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; GdiDevCaps = &GdiSharedHandleTable->DevCaps; - CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess; + CurrentProcessId = NtCurrentTeb()->ClientId.UniqueProcess; GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList; GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer; } diff --git a/reactos/dll/win32/kernel32/file/pipe.c b/reactos/dll/win32/kernel32/file/pipe.c index a44f2c42681..fe4ff1e00d8 100644 --- a/reactos/dll/win32/kernel32/file/pipe.c +++ b/reactos/dll/win32/kernel32/file/pipe.c @@ -55,7 +55,7 @@ CreatePipe(PHANDLE hReadPipe, /* Create the pipe name */ swprintf(Buffer, L"\\Device\\NamedPipe\\Win32Pipes.%08x.%08x", - NtCurrentTeb()->Cid.UniqueProcess, + NtCurrentTeb()->ClientId.UniqueProcess, PipeId); RtlInitUnicodeString(&PipeName, Buffer); diff --git a/reactos/dll/win32/kernel32/process/proc.c b/reactos/dll/win32/kernel32/process/proc.c index 06e5f21a35e..7fe90e6844a 100644 --- a/reactos/dll/win32/kernel32/process/proc.c +++ b/reactos/dll/win32/kernel32/process/proc.c @@ -272,7 +272,7 @@ GetCurrentThread(VOID) DWORD STDCALL GetCurrentProcessId(VOID) { - return((DWORD)GetTeb()->Cid.UniqueProcess); + return((DWORD)GetTeb()->ClientId.UniqueProcess); } diff --git a/reactos/dll/win32/kernel32/thread/thread.c b/reactos/dll/win32/kernel32/thread/thread.c index c208aa9d9f4..4f6e01ea6f4 100644 --- a/reactos/dll/win32/kernel32/thread/thread.c +++ b/reactos/dll/win32/kernel32/thread/thread.c @@ -319,7 +319,7 @@ DWORD WINAPI GetCurrentThreadId(VOID) { - return (DWORD)(NtCurrentTeb()->Cid).UniqueThread; + return (DWORD)(NtCurrentTeb()->ClientId).UniqueThread; } /* diff --git a/reactos/dll/win32/user32/windows/window.c b/reactos/dll/win32/user32/windows/window.c index f598c38f999..6fe94533d6d 100644 --- a/reactos/dll/win32/user32/windows/window.c +++ b/reactos/dll/win32/user32/windows/window.c @@ -1313,8 +1313,8 @@ GetWindowThreadProcessId(HWND hWnd, { // We are current. //FIXME("Current!\n"); if ( lpdwProcessId ) - *lpdwProcessId = (DWORD)NtCurrentTeb()->Cid.UniqueProcess; - Ret = (DWORD)NtCurrentTeb()->Cid.UniqueThread; + *lpdwProcessId = (DWORD)NtCurrentTeb()->ClientId.UniqueProcess; + Ret = (DWORD)NtCurrentTeb()->ClientId.UniqueThread; } else { // Ask kernel for info. diff --git a/reactos/include/ndk/pstypes.h b/reactos/include/ndk/pstypes.h index b8db1343cab..4a640b70891 100644 --- a/reactos/include/ndk/pstypes.h +++ b/reactos/include/ndk/pstypes.h @@ -755,7 +755,7 @@ typedef struct _TEB { NT_TIB Tib; PVOID EnvironmentPointer; - CLIENT_ID Cid; + CLIENT_ID ClientId; PVOID ActiveRpcHandle; PVOID ThreadLocalStoragePointer; struct _PEB *ProcessEnvironmentBlock; diff --git a/reactos/lib/rtl/critical.c b/reactos/lib/rtl/critical.c index 5dda956f6f6..da7314429a1 100644 --- a/reactos/lib/rtl/critical.c +++ b/reactos/lib/rtl/critical.c @@ -310,7 +310,7 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) DPRINT("Freeing from Buffer: %p. Entry: %lu inside Process: %p\n", DebugInfo, EntryId, - NtCurrentTeb()->Cid.UniqueProcess); + NtCurrentTeb()->ClientId.UniqueProcess); RtlpDebugInfoFreeList[EntryId] = FALSE; } else { @@ -318,7 +318,7 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) /* It's a dynamic one, so free from the heap */ DPRINT("Freeing from Heap: %p inside Process: %p\n", DebugInfo, - NtCurrentTeb()->Cid.UniqueProcess); + NtCurrentTeb()->ClientId.UniqueProcess); RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo); } @@ -424,7 +424,7 @@ NTSTATUS NTAPI RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) { - HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; + HANDLE Thread = (HANDLE)NtCurrentTeb()->ClientId.UniqueThread; /* Try to Lock it */ if (_InterlockedIncrement(&CriticalSection->LockCount) != 0) { @@ -522,7 +522,7 @@ RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection, CritcalSectionDebugData = RtlpAllocateDebugInfo(); DPRINT("Allocated Debug Data: %p inside Process: %p\n", CritcalSectionDebugData, - NtCurrentTeb()->Cid.UniqueProcess); + NtCurrentTeb()->ClientId.UniqueProcess); if (!CritcalSectionDebugData) { @@ -657,11 +657,11 @@ RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) -1) == -1) { /* It's ours */ - CriticalSection->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + CriticalSection->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; CriticalSection->RecursionCount = 1; return TRUE; - } else if (CriticalSection->OwningThread == NtCurrentTeb()->Cid.UniqueThread) { + } else if (CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) { /* It's already ours */ _InterlockedIncrement(&CriticalSection->LockCount); diff --git a/reactos/lib/rtl/dbgbuffer.c b/reactos/lib/rtl/dbgbuffer.c index e2390a82d28..92e6fe504c4 100644 --- a/reactos/lib/rtl/dbgbuffer.c +++ b/reactos/lib/rtl/dbgbuffer.c @@ -234,7 +234,7 @@ RtlQueryProcessDebugInformation(IN ULONG ProcessId, IN OUT PRTL_DEBUG_INFORMATION Buf) { NTSTATUS Status = STATUS_SUCCESS; - ULONG Pid = (ULONG_PTR) NtCurrentTeb()->Cid.UniqueProcess; + ULONG Pid = (ULONG_PTR) NtCurrentTeb()->ClientId.UniqueProcess; Buf->Flags = DebugInfoMask; Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION); diff --git a/reactos/lib/rtl/resource.c b/reactos/lib/rtl/resource.c index 2861b6bc8b4..8a21e0aefbc 100644 --- a/reactos/lib/rtl/resource.c +++ b/reactos/lib/rtl/resource.c @@ -94,7 +94,7 @@ start: } else if (Resource->NumberActive < 0) /* exclusive lock in progress */ { - if (Resource->OwningThread == NtCurrentTeb()->Cid.UniqueThread) + if (Resource->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) { retVal = TRUE; Resource->NumberActive--; @@ -120,7 +120,7 @@ wait: goto wait; } if (retVal == TRUE) - Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; done: RtlLeaveCriticalSection(&Resource->Lock); return retVal; @@ -141,7 +141,7 @@ start: RtlEnterCriticalSection(&Resource->Lock); if (Resource->NumberActive < 0) { - if (Resource->OwningThread == NtCurrentTeb()->Cid.UniqueThread) + if (Resource->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) { Resource->NumberActive--; retVal = TRUE; @@ -218,7 +218,7 @@ RtlConvertSharedToExclusive(PRTL_RESOURCE Resource) if (Resource->NumberActive == 1) { - Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; Resource->NumberActive = -1; } else @@ -233,7 +233,7 @@ RtlConvertSharedToExclusive(PRTL_RESOURCE Resource) return; RtlEnterCriticalSection(&Resource->Lock); - Resource->OwningThread = NtCurrentTeb()->Cid.UniqueThread; + Resource->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; Resource->NumberActive = -1; } RtlLeaveCriticalSection(&Resource->Lock); diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index 50ffc310de1..ae9e8d55ac0 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -452,7 +452,7 @@ MmCreateTeb(PEPROCESS Process, Teb->Tib.Self = (PNT_TIB)Teb; /* Set TEB Data */ - Teb->Cid = *ClientId; + Teb->ClientId = *ClientId; Teb->RealClientId = *ClientId; Teb->ProcessEnvironmentBlock = Process->Peb; Teb->CurrentLocale = PsDefaultThreadLocaleId; diff --git a/reactos/subsystems/win32/win32k/ntuser/event.c b/reactos/subsystems/win32/win32k/ntuser/event.c index 5c379685435..12cca3a551b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/event.c +++ b/reactos/subsystems/win32/win32k/ntuser/event.c @@ -155,7 +155,7 @@ co_EVENT_CallEvents( DWORD event, hwnd, pEP->idObject, pEP->idChild, - (DWORD)(NtCurrentTeb()->Cid).UniqueThread, + (DWORD)(NtCurrentTeb()->ClientId).UniqueThread, (DWORD)EngGetTickCount(), pEH->Proc); return Result; @@ -185,14 +185,14 @@ IntNotifyWinEvent( if ((pEH->Thread != PsGetCurrentThread()) && (pEH->Thread != NULL)) { // if all process || all thread || other thread same process if (!(pEH->idProcess) || !(pEH->idThread) || - ((DWORD)(NtCurrentTeb()->Cid).UniqueProcess == pEH->idProcess)) + ((DWORD)(NtCurrentTeb()->ClientId).UniqueProcess == pEH->idProcess)) { Result = IntCallLowLevelEvent(pEH, Event, Window->hSelf, idObject, idChild); } }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process) else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) && ( ((pEH->idProcess && - (DWORD)(NtCurrentTeb()->Cid).UniqueProcess == pEH->idProcess) && + (DWORD)(NtCurrentTeb()->ClientId).UniqueProcess == pEH->idProcess) && !(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) || !pEH->idProcess ) ) { @@ -201,7 +201,7 @@ IntNotifyWinEvent( Window->hSelf, idObject, idChild, - (DWORD)(NtCurrentTeb()->Cid).UniqueThread, + (DWORD)(NtCurrentTeb()->ClientId).UniqueThread, (DWORD)EngGetTickCount(), pEH->Proc); } From 20f583f4cb4b1994918b64900574ea8f7cf33a06 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 16 Aug 2008 00:16:54 +0000 Subject: [PATCH 117/388] - comment out ext2.sys in textsetup.sif, as it doesn't load - fix stupid error when creating page directory - fix PtrToPfn() based on updated mm types - some enhancements svn path=/branches/ros-amd64-bringup/; revision=35360 --- reactos/boot/bootdata/txtsetup.sif | 2 +- reactos/boot/freeldr/freeldr/arch/amd64/loader.c | 6 +++--- reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif index 1c1bcf39602..2677de59f1b 100644 --- a/reactos/boot/bootdata/txtsetup.sif +++ b/reactos/boot/bootdata/txtsetup.sif @@ -33,7 +33,7 @@ pci.sys=,,,,,,,,,,,,4 scsiport.sys=,,,,,,x,,,,,,4 uniata.sys=,,,,,,,,,,,,4 fastfat.sys=,,,,,,x,,,,,,4 -ext2.sys=,,,,,,x,,,,,,4 +;ext2.sys=,,,,,,x,,,,,,4 [HardwareIdsDatabase] *PNP0C08 = acpi diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index bf23c4bafc9..87517ff9e47 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -117,7 +117,7 @@ FrLdrGetOrCreatePageDir(PPAGE_DIRECTORY_AMD64 pDir, ULONG Index) if (!pSubDir) return NULL; RtlZeroMemory(pSubDir, PAGE_SIZE); - pDir->Pde[Index].PageFrameNumber = (ULONGLONG)pSubDir / PAGE_SIZE; + pDir->Pde[Index].PageFrameNumber = PtrToPfn(pSubDir); pDir->Pde[Index].Valid = 1; pDir->Pde[Index].Write = 1; } @@ -196,7 +196,7 @@ FrLdrSetupPageDirectory(VOID) ULONG KernelPages; /* Allocate a Page for the PML4 */ - pPML4 = MmAllocateMemoryWithType(4096, LoaderSpecialMemory); + pPML4 = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory); ASSERT(pPML4); @@ -205,7 +205,7 @@ FrLdrSetupPageDirectory(VOID) * virtual address 0xfffff6fb7dbedf68 */ pPML4->Pde[VAtoPXI(PXE_BASE)].Valid = 1; pPML4->Pde[VAtoPXI(PXE_BASE)].Write = 1; - pPML4->Pde[VAtoPXI(PXE_BASE)].PageFrameNumber = PtrToPfn(PXE_BASE); + pPML4->Pde[VAtoPXI(PXE_BASE)].PageFrameNumber = PtrToPfn(pPML4); /* Setup low memory pages */ if (FrLdrMapRangeOfPages(0, 0, 1024) < 1024) diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index d574b2692a5..af4e4e13e8e 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -30,7 +30,7 @@ #define VA_MASK 0x0000FFFFFFFFFFFFUL #define PtrToPfn(p) \ - ((((ULONGLONG)p) >> PAGE_SHIFT) & 0xffffffffffULL) + ((((ULONGLONG)p) >> PAGE_SHIFT) & 0xfffffffULL) #define VAtoPXI(va) (((va) >> PXI_SHIFT) & 0x1FF) #define VAtoPPI(va) (((va) >> PPI_SHIFT) & 0x1FF) From 928f5c10015d5e993e7134a4c5eb9fceddd1cdd5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 16 Aug 2008 00:17:52 +0000 Subject: [PATCH 118/388] fix KIPCR svn path=/branches/ros-amd64-bringup/; revision=35361 --- reactos/include/ndk/amd64/ketypes.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 6acdfb18c80..308d0152bd0 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -784,9 +784,8 @@ typedef struct _KIPCR PVOID KdVersionBlock; // 0x108 PVOID Unused3; ULONG PcrAlign1[24]; - - ULONG Fill2; // 0x178 - KPRCB Prcb; + ULONG Fill2[2]; // 0x178 + KPRCB Prcb; // 0x180 // hack: ULONG ContextSwitches; From b00f5679d2afe3a6e552f6533a7e8c7d483b2d88 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 16 Aug 2008 00:18:27 +0000 Subject: [PATCH 119/388] - fix pointer to ulong cast svn path=/branches/ros-amd64-bringup/; revision=35362 --- reactos/lib/sdk/crt/stdio/lnx_sprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/lib/sdk/crt/stdio/lnx_sprintf.c b/reactos/lib/sdk/crt/stdio/lnx_sprintf.c index 11981ddf439..7f12c7933a8 100644 --- a/reactos/lib/sdk/crt/stdio/lnx_sprintf.c +++ b/reactos/lib/sdk/crt/stdio/lnx_sprintf.c @@ -544,7 +544,7 @@ int __cdecl lnx_vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) flags |= ZEROPAD; } str = number(str, end, - (unsigned long) va_arg(args, void *), 16, + (uintptr_t) va_arg(args, void *), 16, field_width, precision, flags); continue; From 1e73720601064418b1121d20cba82b042f7d7abf Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 18 Aug 2008 21:50:55 +0000 Subject: [PATCH 120/388] - Remove obsolete LDT_ENTRY - replace KTSS with KTSS64 - update some KGDT_xxx constants svn path=/branches/ros-amd64-bringup/; revision=35436 --- reactos/include/ndk/amd64/ketypes.h | 103 ++++++---------------------- 1 file changed, 22 insertions(+), 81 deletions(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 308d0152bd0..381121f4379 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -58,16 +58,13 @@ Author: // #define RPL_MASK 0x0003 #define MODE_MASK 0x0001 -#define KGDT_R0_CODE 0x8 -#define KGDT_R0_DATA 0x10 -#define KGDT_R3_CODE 0x18 -#define KGDT_R3_DATA 0x20 -#define KGDT_TSS 0x28 -#define KGDT_R0_PCR 0x30 -#define KGDT_R3_TEB 0x38 -#define KGDT_LDT 0x48 -#define KGDT_DF_TSS 0x50 -#define KGDT_NMI_TSS 0x58 +#define KGDT_64_R0_CODE 0x0010 +#define KGDT_64_R0_SS 0x0018 +#define KGDT_64_DATA 0x0028 // 2b +#define KGDT_64_R3_CODE 0x0030 // 33 +#define KGDT_32_R3_TEB 0x0050 // 53 + +#define KGDT_TSS 0x0038 // ?? // // CR4 @@ -216,40 +213,6 @@ typedef struct _KTRAP_FRAME LONG CodePatchCycle; } KTRAP_FRAME, *PKTRAP_FRAME; -// -// LDT Entry Definition -// -#ifndef _LDT_ENTRY_DEFINED -#define _LDT_ENTRY_DEFINED -typedef struct _LDT_ENTRY -{ - USHORT LimitLow; - USHORT BaseLow; - union - { - struct - { - UCHAR BaseMid; - UCHAR Flags1; - UCHAR Flags2; - UCHAR BaseHi; - } Bytes; - struct - { - ULONG BaseMid:8; - ULONG Type:5; - ULONG Dpl:2; - ULONG Pres:1; - ULONG LimitHi:4; - ULONG Sys:1; - ULONG Reserved_0:1; - ULONG Default_Big:1; - ULONG Granularity:1; - ULONG BaseHi:8; - } Bits; - } HighWord; -} LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY; -#endif // // GDT Entry Definition @@ -802,44 +765,22 @@ typedef struct _KiIoAccessMap UCHAR IoMap[8196]; } KIIO_ACCESS_MAP; -typedef struct _KTSS + +#pragma pack(push,4) +typedef struct _KTSS64 { - USHORT Backlink; - USHORT Reserved0; - ULONG Esp0; - USHORT Ss0; - USHORT Reserved1; - ULONG NotUsed1[4]; - ULONG CR3; - ULONG Eip; - ULONG EFlags; - ULONG Eax; - ULONG Ecx; - ULONG Edx; - ULONG Ebx; - ULONG Esp; - ULONG Ebp; - ULONG Esi; - ULONG Edi; - USHORT Es; - USHORT Reserved2; - USHORT Cs; - USHORT Reserved3; - USHORT Ss; - USHORT Reserved4; - USHORT Ds; - USHORT Reserved5; - USHORT Fs; - USHORT Reserved6; - USHORT Gs; - USHORT Reserved7; - USHORT LDT; - USHORT Reserved8; - USHORT Flags; - USHORT IoMapBase; - KIIO_ACCESS_MAP IoMaps[1]; - UCHAR IntDirectionMap[32]; -} KTSS, *PKTSS; + /* 000 */ ULONG Reserved0; + /* 004 */ UINT64 Rsp0; + /* 00c */ UINT64 Rsp1; + /* 014 */ UINT64 Rsp2; + /* 01c */ UINT64 Ist[8]; + /* 05c */ UINT64 Reserved1; + /* 064 */ USHORT Reserved2; + /* 066 */ USHORT IoMapBase; +} KTSS64, *PKTSS64; +#pragma pack(pop) +#define KTSS KTSS64 +#define PKTSS PKTSS64 // // i386 CPUs don't have exception frames From 2c01ac73834c4c72466bf6fb8afd3f16d1a32da4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 02:33:14 +0000 Subject: [PATCH 121/388] Get rid of the _X86_ define by using a -U compiler switch. This way it also works with PCHs, that before didn't like the #undef svn path=/branches/ros-amd64-bringup/; revision=35442 --- reactos/ReactOS-amd64.rbuild | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 5066ee968d8..cab9b3eceab 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -19,6 +19,7 @@ -enable-stdcall-fixup + -U_X86_ -Os From efb208d11ba8bd4252b702efc192bd411e4c887d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 02:39:19 +0000 Subject: [PATCH 122/388] - revert 34796, an old hack to #undef _X86_ on amd64 builds, not needed any longer svn path=/branches/ros-amd64-bringup/; revision=35443 --- reactos/include/psdk/basetsd.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/reactos/include/psdk/basetsd.h b/reactos/include/psdk/basetsd.h index 770f30bde47..e6e99a53236 100644 --- a/reactos/include/psdk/basetsd.h +++ b/reactos/include/psdk/basetsd.h @@ -8,11 +8,6 @@ #ifndef __int64 #define __int64 long long #endif -#if defined(_M_AMD64) || defined(__x86_64__) -#if defined(_X86_) -#undef _X86_ -#endif -#endif #endif #if defined(_WIN64) From e113754dbf5e2e0479c5e8042e4b1248173b018c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 02:41:01 +0000 Subject: [PATCH 123/388] add an additional case for _AMD64_ now that we have _X86_ not defined anymore svn path=/branches/ros-amd64-bringup/; revision=35444 --- reactos/ntoskrnl/ex/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 59c103cbeb2..bba774dbf5e 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -1238,6 +1238,9 @@ ExpInitializeExecutive(IN ULONG Cpu, #elif defined(_ARM_) SharedUserData->ImageNumberLow = IMAGE_FILE_MACHINE_ARM; SharedUserData->ImageNumberHigh = IMAGE_FILE_MACHINE_ARM; +#elif defined(_AMD64_) + SharedUserData->ImageNumberLow = IMAGE_FILE_MACHINE_AMD64; + SharedUserData->ImageNumberHigh = IMAGE_FILE_MACHINE_AMD64; #else #error "Unsupported ReactOS Target" #endif From 53fee22a845dce2e04aee79deaf3b634d8f228a6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 03:00:59 +0000 Subject: [PATCH 124/388] change the gdt in freeldr, so we will have the same longmode cs later in the kernel. svn path=/branches/ros-amd64-bringup/; revision=35445 --- reactos/boot/freeldr/freeldr/arch/amd64/arch.S | 9 +++++---- reactos/boot/freeldr/freeldr/include/arch.h | 2 ++ reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h | 6 ++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S index a0c9b74044b..33910ffeb6c 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/arch.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/arch.S @@ -267,15 +267,16 @@ code64ret: .quad 0 gdt: - .quad 0x0000000000000000 - .quad 0x0020980000000000 - .quad 0x0000900000000000 + .quad 0x0000000000000000 /* 00: NULL descriptor */ + .quad 0x0000000000000000 /* 08: */ + .quad 0x0020980000000000 /* 10: long mode cs */ + .quad 0x0000900000000000 /* 18: long mode ds */ .word 0xFFFF, 0x0000, 0x9E00, 0x0000 /* 16-bit real mode CS */ .word 0xFFFF, 0x0000, 0x9200, 0x0000 /* 16-bit real mode DS */ /* GDT table pointer */ gdtptr: - .word 0x27 /* Limit */ + .word 0x2f /* Limit */ .long gdt /* Base Address */ diff --git a/reactos/boot/freeldr/freeldr/include/arch.h b/reactos/boot/freeldr/freeldr/include/arch.h index ed1189fbb83..79feafe3a47 100644 --- a/reactos/boot/freeldr/freeldr/include/arch.h +++ b/reactos/boot/freeldr/freeldr/include/arch.h @@ -25,12 +25,14 @@ #include #endif +#if defined (_M_IX86) /* 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 */ +#endif #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 */ diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index af4e4e13e8e..e2fd4903227 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -24,8 +24,10 @@ #define STACK64ADDR 0x74000 /* The 64-bit stack top will be at 0x74000 */ /* Long mode selectors */ -#define LMODE_CS 0x08 -#define LMODE_DS 0x10 +#define LMODE_CS 0x10 +#define LMODE_DS 0x18 +#define RMODE_CS 0x20 /* RMode code selector, base 0 limit 64k */ +#define RMODE_DS 0x28 /* RMode data selector, base 0 limit 64k */ #define VA_MASK 0x0000FFFFFFFFFFFFUL From c56d24853e38d803a707d1435937026bf453f286 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 19:07:13 +0000 Subject: [PATCH 125/388] Move some architecture specific code from KiRosPrepareForSystemStartup into KiArchInitSystem, defined for each architecture. Enable KiRosBuildReservedMemoryMap for _M_AMD64 svn path=/branches/ros-amd64-bringup/; revision=35458 --- reactos/ntoskrnl/ke/freeldr.c | 35 ++++--------------------------- reactos/ntoskrnl/ke/i386/cpu.c | 21 +++++++++++++++++++ reactos/ntoskrnl/ke/powerpc/cpu.c | 16 ++++++++++++++ 3 files changed, 41 insertions(+), 31 deletions(-) diff --git a/reactos/ntoskrnl/ke/freeldr.c b/reactos/ntoskrnl/ke/freeldr.c index cfad4899975..91add777cc6 100644 --- a/reactos/ntoskrnl/ke/freeldr.c +++ b/reactos/ntoskrnl/ke/freeldr.c @@ -949,7 +949,7 @@ KiRosFrldrLpbToNtLpb(IN PROS_LOADER_PARAMETER_BLOCK RosLoaderBlock, /* Build entries for ReactOS memory ranges, which uses ARC Descriptors */ KiRosBuildOsMemoryMap(); -#ifdef _M_IX86 +#if defined(_M_IX86) || defined(_M_AMD64) /* Build entries for the reserved map, which uses ARC Descriptors */ KiRosBuildReservedMemoryMap(); #endif @@ -1266,36 +1266,6 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, { PLOADER_PARAMETER_BLOCK NtLoaderBlock; ULONG size, i = 0, *ent; -#if defined(_M_IX86) - PKTSS Tss; - PKGDTENTRY TssEntry; - - /* Load the GDT and IDT */ - Ke386SetGlobalDescriptorTable(*(PKDESCRIPTOR)&KiGdtDescriptor.Limit); - Ke386SetInterruptDescriptorTable(*(PKDESCRIPTOR)&KiIdtDescriptor.Limit); - - /* Initialize the boot TSS */ - Tss = &KiBootTss; - TssEntry = &KiBootGdt[KGDT_TSS / sizeof(KGDTENTRY)]; - TssEntry->HighWord.Bits.Type = I386_TSS; - TssEntry->HighWord.Bits.Pres = 1; - TssEntry->HighWord.Bits.Dpl = 0; - TssEntry->BaseLow = (USHORT)((ULONG_PTR)Tss & 0xFFFF); - TssEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)Tss >> 16); - TssEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)Tss >> 24); -#endif - -#if defined(_M_PPC) - // Zero bats. We might have residual bats set that will interfere with - // our mapping of ofwldr. - for (i = 0; i < 4; i++) - { - SetBat(i, 0, 0, 0); SetBat(i, 1, 0, 0); - } - KiSetupSyscallHandler(); - DbgPrint("Kernel Power (%08x)\n", LoaderBlock); - DbgPrint("ArchExtra (%08x)!\n", LoaderBlock->ArchExtra); -#endif /* Save pointer to ROS Block */ KeRosLoaderBlock = LoaderBlock; @@ -1303,6 +1273,9 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, /* Get debugging function */ FrLdrDbgPrint = LoaderBlock->FrLdrDbgPrint; + /* Per architecture initialisazion code */ + KiArchInitSystem(); + /* Save memory manager data */ KeMemoryMapRangeCount = 0; if (LoaderBlock->Flags & MB_FLAGS_MMAP_INFO) diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index d5f9298b685..221e246490c 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -1036,3 +1036,24 @@ KeSaveStateForHibernate(IN PKPROCESSOR_STATE State) /* Capture the control state */ KiSaveProcessorControlState(State); } + +VOID +KiArchInitSystem() +{ + PKTSS Tss; + PKGDTENTRY TssEntry; + + /* Load the GDT and IDT */ + Ke386SetGlobalDescriptorTable(*(PKDESCRIPTOR)&KiGdtDescriptor.Limit); + Ke386SetInterruptDescriptorTable(*(PKDESCRIPTOR)&KiIdtDescriptor.Limit); + + /* Initialize the boot TSS */ + Tss = &KiBootTss; + TssEntry = &KiBootGdt[KGDT_TSS / sizeof(KGDTENTRY)]; + TssEntry->HighWord.Bits.Type = I386_TSS; + TssEntry->HighWord.Bits.Pres = 1; + TssEntry->HighWord.Bits.Dpl = 0; + TssEntry->BaseLow = (USHORT)((ULONG_PTR)Tss & 0xFFFF); + TssEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)Tss >> 16); + TssEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)Tss >> 24); +} diff --git a/reactos/ntoskrnl/ke/powerpc/cpu.c b/reactos/ntoskrnl/ke/powerpc/cpu.c index 71185a50435..c4691887d10 100644 --- a/reactos/ntoskrnl/ke/powerpc/cpu.c +++ b/reactos/ntoskrnl/ke/powerpc/cpu.c @@ -275,3 +275,19 @@ KeSaveStateForHibernate(IN PKPROCESSOR_STATE State) /* Capture the control state */ KiSaveProcessorControlState(State); } + +VOID +KiArchInitSystem() +{ + ULONG i; + + // Zero bats. We might have residual bats set that will interfere with + // our mapping of ofwldr. + for (i = 0; i < 4; i++) + { + SetBat(i, 0, 0, 0); SetBat(i, 1, 0, 0); + } + KiSetupSyscallHandler(); + DbgPrint("Kernel Power (%08x)\n", KeRosLoaderBlock); + DbgPrint("ArchExtra (%08x)!\n", KeRosLoaderBlock->ArchExtra); +} From 408520c38cbbfc84d7a2c8e044d1c2e686cca5a7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 19:08:45 +0000 Subject: [PATCH 126/388] forgot this one svn path=/branches/ros-amd64-bringup/; revision=35459 --- reactos/ntoskrnl/include/internal/arch/ke.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/ntoskrnl/include/internal/arch/ke.h b/reactos/ntoskrnl/include/internal/arch/ke.h index 1d2e3a006e3..459caae6644 100644 --- a/reactos/ntoskrnl/include/internal/arch/ke.h +++ b/reactos/ntoskrnl/include/internal/arch/ke.h @@ -33,6 +33,8 @@ #error "Unknown processor" #endif +VOID KiArchInitSystem(VOID); + #endif /* __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H */ /* EOF */ From 235811bd2a9afe6722a77bb5b4d84c2a2f047926 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 19:28:12 +0000 Subject: [PATCH 127/388] Update amd64 prototypes for KeGetCurrentIrql, KfRaiseIrql, KfLowerIrql, KeRaiseIrqlToDpcLevel, KeRaiseIrqlToSynchLevel, KeLowerIrql, KeRaiseIrql svn path=/branches/ros-amd64-bringup/; revision=35460 --- reactos/include/ddk/winddk.h | 41 ++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index da4119e9663..3324c1361d5 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5580,12 +5580,6 @@ typedef struct _KFLOATING_SAVE { ULONG Dummy; } KFLOATING_SAVE, *PKFLOATING_SAVE; -NTKERNELAPI -KIRQL -KeGetCurrentIrql ( - VOID - ); - NTKERNELAPI PRKTHREAD NTAPI @@ -9966,6 +9960,41 @@ KeRaiseIrqlToSynchLevel( #define KeLowerIrql(a) KfLowerIrql(a) #define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a) +#elif defined(_M_AMD64) + +NTKERNELAPI +KIRQL +KeGetCurrentIrql( + VOID); + +NTKERNELAPI +VOID +KfLowerIrql( + IN KIRQL NewIrql); + +NTKERNELAPI +KIRQL +KfRaiseIrql( + IN KIRQL NewIrql); + +NTKERNELAPI +KIRQL +KeRaiseIrqlToDpcLevel( + VOID); + +NTKERNELAPI +KIRQL +KeRaiseIrqlToSynchLevel( + VOID); + +NTKERNELAPI +VOID +KeLowerIrql( + IN KIRQL NewIrql); + +#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a) + + #elif defined(__PowerPC__) NTHALAPI From d4fd437f763e372375814d5ead17f741d8372405 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 19 Aug 2008 19:56:28 +0000 Subject: [PATCH 128/388] - fix usage of InterlockedExchangePointer - fix ULONG -> pointer cast svn path=/branches/ros-amd64-bringup/; revision=35461 --- reactos/ntoskrnl/ps/kill.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index 042b0c987d0..0a15b7c3849 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -177,7 +177,7 @@ PspReapRoutine(IN PVOID Context) do { /* Write magic value and return the next entry to process */ - NextEntry = InterlockedExchangePointer(&PspReaperListHead.Flink, + NextEntry = InterlockedExchangePointer((PVOID*)&PspReaperListHead.Flink, (PVOID)1); ASSERT((NextEntry != NULL) && (NextEntry != (PVOID)1)); @@ -200,9 +200,9 @@ PspReapRoutine(IN PVOID Context) } while ((NextEntry != NULL) && (NextEntry != (PVOID)1)); /* Remove magic value, keep looping if it got changed */ - } while (InterlockedCompareExchangePointer(&PspReaperListHead.Flink, - 0, - 1) != (PVOID)1); + } while (InterlockedCompareExchangePointer((PVOID*)&PspReaperListHead.Flink, + (PVOID)0, + (PVOID)1) != (PVOID)1); } VOID @@ -403,7 +403,7 @@ PspExitThread(IN NTSTATUS ExitStatus) PEPROCESS CurrentProcess; PETHREAD Thread, OtherThread, PreviousThread = NULL; PVOID DeallocationStack; - ULONG Dummy; + ULONG_PTR Dummy; BOOLEAN Last = FALSE; PTERMINATION_PORT TerminationPort, NextPort; PLIST_ENTRY FirstEntry, CurrentEntry; @@ -880,7 +880,7 @@ PsExitSpecialApc(IN PKAPC Apc, if (Apc->SystemArgument2) { /* Free the APC */ - Status = (NTSTATUS)Apc->NormalContext; + Status = (NTSTATUS)(ULONG_PTR)Apc->NormalContext; PspExitApcRundown(Apc); /* Terminate the Thread */ @@ -985,7 +985,7 @@ PspTerminateThreadByPointer(IN PETHREAD Thread, PspExitApcRundown, PspExitNormalApc, KernelMode, - (PVOID)ExitStatus); + (PVOID)(ULONG_PTR)ExitStatus); /* Insert it into the APC Queue */ if (!KeInsertQueueApc(Apc, Apc, NULL, 2)) From a215070e56ee98d51b5a5be7af18d027390cd198 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 20 Aug 2008 22:38:23 +0000 Subject: [PATCH 129/388] revert my last commit to avoid polluting other files with hack code. I am also not going to need that piece of code for amd64. svn path=/branches/ros-amd64-bringup/; revision=35492 --- reactos/ntoskrnl/ke/freeldr.c | 33 ++++++++++++++++++++++++++++--- reactos/ntoskrnl/ke/i386/cpu.c | 21 -------------------- reactos/ntoskrnl/ke/powerpc/cpu.c | 16 --------------- 3 files changed, 30 insertions(+), 40 deletions(-) diff --git a/reactos/ntoskrnl/ke/freeldr.c b/reactos/ntoskrnl/ke/freeldr.c index 91add777cc6..20a27758a59 100644 --- a/reactos/ntoskrnl/ke/freeldr.c +++ b/reactos/ntoskrnl/ke/freeldr.c @@ -1266,6 +1266,36 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, { PLOADER_PARAMETER_BLOCK NtLoaderBlock; ULONG size, i = 0, *ent; +#if defined(_M_IX86) + PKTSS Tss; + PKGDTENTRY TssEntry; + + /* Load the GDT and IDT */ + Ke386SetGlobalDescriptorTable(*(PKDESCRIPTOR)&KiGdtDescriptor.Limit); + Ke386SetInterruptDescriptorTable(*(PKDESCRIPTOR)&KiIdtDescriptor.Limit); + + /* Initialize the boot TSS */ + Tss = &KiBootTss; + TssEntry = &KiBootGdt[KGDT_TSS / sizeof(KGDTENTRY)]; + TssEntry->HighWord.Bits.Type = I386_TSS; + TssEntry->HighWord.Bits.Pres = 1; + TssEntry->HighWord.Bits.Dpl = 0; + TssEntry->BaseLow = (USHORT)((ULONG_PTR)Tss & 0xFFFF); + TssEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)Tss >> 16); + TssEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)Tss >> 24); +#endif + +#if defined(_M_PPC) + // Zero bats. We might have residual bats set that will interfere with + // our mapping of ofwldr. + for (i = 0; i < 4; i++) + { + SetBat(i, 0, 0, 0); SetBat(i, 1, 0, 0); + } + KiSetupSyscallHandler(); + DbgPrint("Kernel Power (%08x)\n", LoaderBlock); + DbgPrint("ArchExtra (%08x)!\n", LoaderBlock->ArchExtra); +#endif /* Save pointer to ROS Block */ KeRosLoaderBlock = LoaderBlock; @@ -1273,9 +1303,6 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, /* Get debugging function */ FrLdrDbgPrint = LoaderBlock->FrLdrDbgPrint; - /* Per architecture initialisazion code */ - KiArchInitSystem(); - /* Save memory manager data */ KeMemoryMapRangeCount = 0; if (LoaderBlock->Flags & MB_FLAGS_MMAP_INFO) diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index 221e246490c..d5f9298b685 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -1036,24 +1036,3 @@ KeSaveStateForHibernate(IN PKPROCESSOR_STATE State) /* Capture the control state */ KiSaveProcessorControlState(State); } - -VOID -KiArchInitSystem() -{ - PKTSS Tss; - PKGDTENTRY TssEntry; - - /* Load the GDT and IDT */ - Ke386SetGlobalDescriptorTable(*(PKDESCRIPTOR)&KiGdtDescriptor.Limit); - Ke386SetInterruptDescriptorTable(*(PKDESCRIPTOR)&KiIdtDescriptor.Limit); - - /* Initialize the boot TSS */ - Tss = &KiBootTss; - TssEntry = &KiBootGdt[KGDT_TSS / sizeof(KGDTENTRY)]; - TssEntry->HighWord.Bits.Type = I386_TSS; - TssEntry->HighWord.Bits.Pres = 1; - TssEntry->HighWord.Bits.Dpl = 0; - TssEntry->BaseLow = (USHORT)((ULONG_PTR)Tss & 0xFFFF); - TssEntry->HighWord.Bytes.BaseMid = (UCHAR)((ULONG_PTR)Tss >> 16); - TssEntry->HighWord.Bytes.BaseHi = (UCHAR)((ULONG_PTR)Tss >> 24); -} diff --git a/reactos/ntoskrnl/ke/powerpc/cpu.c b/reactos/ntoskrnl/ke/powerpc/cpu.c index c4691887d10..71185a50435 100644 --- a/reactos/ntoskrnl/ke/powerpc/cpu.c +++ b/reactos/ntoskrnl/ke/powerpc/cpu.c @@ -275,19 +275,3 @@ KeSaveStateForHibernate(IN PKPROCESSOR_STATE State) /* Capture the control state */ KiSaveProcessorControlState(State); } - -VOID -KiArchInitSystem() -{ - ULONG i; - - // Zero bats. We might have residual bats set that will interfere with - // our mapping of ofwldr. - for (i = 0; i < 4; i++) - { - SetBat(i, 0, 0, 0); SetBat(i, 1, 0, 0); - } - KiSetupSyscallHandler(); - DbgPrint("Kernel Power (%08x)\n", KeRosLoaderBlock); - DbgPrint("ArchExtra (%08x)!\n", KeRosLoaderBlock->ArchExtra); -} From bfb63a8031b863001a0b513d638e86ba27d0f57d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 20 Aug 2008 22:48:47 +0000 Subject: [PATCH 130/388] Setup a page for the Idt and a page for the gdt + tss. Setup the newly created gdt accordingly. Set gdtr and idtr. svn path=/branches/ros-amd64-bringup/; revision=35493 --- .../boot/freeldr/freeldr/arch/amd64/loader.c | 55 +++++++++++++++++++ .../freeldr/include/arch/amd64/amd64.h | 36 ++++++++++++ 2 files changed, 91 insertions(+) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 87517ff9e47..504ee11b6d4 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -27,9 +27,11 @@ /* Page Directory and Tables for non-PAE Systems */ extern ULONG_PTR NextModuleBase; extern ULONG_PTR KernelBase; +ULONG_PTR GdtBase, IdtBase, TssBase; extern ROS_KERNEL_ENTRY_POINT KernelEntryPoint; PPAGE_DIRECTORY_AMD64 pPML4; +PVOID pIdt, pGdt; /* FUNCTIONS *****************************************************************/ @@ -92,6 +94,8 @@ FrLdrStartup(ULONG Magic) /* Set the new PML4 */ __writecr3((ULONGLONG)pPML4); + FrLdrSetupGdtIdt(); + LoaderBlock.FrLdrDbgPrint = DbgPrint; // DumpLoaderBlock(); @@ -220,5 +224,56 @@ FrLdrSetupPageDirectory(VOID) DbgPrint("Could not map %d kernel pages.\n", KernelPages); } + /* Setup a page for the idt */ + pIdt = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory); + IdtBase = KernelBase + KernelPages * PAGE_SIZE; + if (!FrLdrMapSinglePage(IdtBase, (ULONGLONG)pIdt)) + { + DbgPrint("Could not map idt page.\n", KernelPages); + } + + /* Setup a page for the gdt & tss */ + pGdt = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory); + GdtBase = IdtBase + PAGE_SIZE; + TssBase = GdtBase + 20 * sizeof(ULONG64); // FIXME: don't hardcode + if (!FrLdrMapSinglePage(GdtBase, (ULONGLONG)pGdt)) + { + DbgPrint("Could not map idt page.\n", KernelPages); + } + + } +VOID +FrLdrSetupGdtIdt() +{ + PKGDTENTRY64 Entry; + KDESCRIPTOR Desc; + + RtlZeroMemory(pGdt, PAGE_SIZE); + + /* Setup KGDT_64_R0_CODE */ + Entry = KiGetGdtEntry(pGdt, KGDT_64_R0_CODE); + *(PULONG64)Entry = 0x0020980000000000ULL; + + /* Setup TSS entry */ + Entry = KiGetGdtEntry(pGdt, KGDT_TSS); + KiInitGdtEntry(Entry, TssBase, I386_TSS, 0); + + /* Setup the gdt descriptor */ + Desc.Limit = 12 * sizeof(ULONG64) - 1; + Desc.Base = (PVOID)GdtBase; + + /* Set the new Gdt */ + __lgdt(&Desc.Limit); + DbgPrint("Gdtr.Base = %p\n", Desc.Base); + + /* Setup the idt descriptor */ + Desc.Limit = 12 * sizeof(ULONG64) - 1; + Desc.Base = (PVOID)IdtBase; + + /* Set the new Idt */ + __lidt(&Desc.Limit); + DbgPrint("Idtr.Base = %p\n", Desc.Base); + +} diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index e2fd4903227..ddd869f6435 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -51,6 +51,42 @@ typedef struct _PAGE_DIRECTORY_AMD64 HARDWARE_PTE Pde[512]; } PAGE_DIRECTORY_AMD64, *PPAGE_DIRECTORY_AMD64; +VOID +FORCEINLINE +__lgdt(void *gdt) +{ + asm volatile ("lgdt %0\n" : : "m"(*(short*)gdt)); +} + +VOID +FORCEINLINE +__lidt(void *idt) +{ + asm volatile ("lidt %0\n" : : "m"(*(short*)idt)); +} + +PKGDTENTRY64 +FORCEINLINE +KiGetGdtEntry(PVOID pGdt, USHORT Index) +{ + return (PKGDTENTRY64)((ULONG64)pGdt + (Index & ~RPL_MASK)); +} + +VOID +FORCEINLINE +KiInitGdtEntry(PKGDTENTRY64 Entry, ULONG64 Base, UCHAR Type, UCHAR Dpl) +{ + Entry->Bits.Type = Type; + Entry->Bits.Present = 1; + Entry->Bits.Dpl = Dpl; + Entry->BaseLow = (USHORT)(Base & 0xFFFF); + Entry->Bytes.BaseMiddle = (UCHAR)(Base >> 16); + Entry->Bytes.BaseHigh = (UCHAR)(Base >> 24); + Entry->BaseUpper = (ULONG)(Base >> 32); +} + +VOID FrLdrSetupGdtIdt(); + #endif #endif /* __AMD64_AMD64_H_ */ From 9576c5f7f636ab0d42adef76f040a600bdd4a236 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 20 Aug 2008 22:55:59 +0000 Subject: [PATCH 131/388] - Add X86_MSR_GSBASE, X86_MSR_KERNEL_GSBASE constants - Add KIDT_INIT structure for the idt init table - Add prototypes for ISRs svn path=/branches/ros-amd64-bringup/; revision=35494 --- reactos/ntoskrnl/include/internal/amd64/ke.h | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/reactos/ntoskrnl/include/internal/amd64/ke.h b/reactos/ntoskrnl/include/internal/amd64/ke.h index 23b04db4039..39cbbfc21ef 100644 --- a/reactos/ntoskrnl/include/internal/amd64/ke.h +++ b/reactos/ntoskrnl/include/internal/amd64/ke.h @@ -43,10 +43,21 @@ #define FRAME_EDITED 0xFFF8 +#define X86_MSR_GSBASE 0xC0000101 +#define X86_MSR_KERNEL_GSBASE 0xC0000102 + #ifndef __ASM__ #include "intrin_i.h" +typedef struct _KIDT_INIT +{ + UCHAR InterruptId; + UCHAR Dpl; + UCHAR Type; + PVOID ServiceRoutine; +} KIDT_INIT, *PKIDT_INIT; + //#define KeArchFnInit() Ke386FnInit() #define KeArchFnInit() DbgPrint("KeArchFnInit is unimplemented!\n"); #define KeArchHaltProcessor() Ke386HaltProcessor() @@ -67,6 +78,31 @@ Ki386InitializeTss( IN PKGDTENTRY Gdt ); +VOID KiDivideErrorFault(); +VOID KiDebugTrapOrFault(); +VOID KiNmiInterrupt(); +VOID KiBreakpointTrap(); +VOID KiOverflowTrap(); +VOID KiBoundFault(); +VOID KiInvalidOpcodeFault(); +VOID KiNpxNotAvailableFault(); +VOID KiDoubleFaultAbort(); +VOID KiNpxSegmentOverrunAbort(); +VOID KiInvalidTssFault(); +VOID KiSegmentNotPresentFault(); +VOID KiStackFault(); +VOID KiGeneralProtectionFault(); +VOID KiPageFault(); +VOID KiFloatingErrorFault(); +VOID KiAlignmentFault(); +VOID KiMcheckAbort(); +VOID KiXmmException(); +VOID KiApcInterrupt(); +VOID KiRaiseAssertion(); +VOID KiDebugServiceTrap(); +VOID KiDpcInterrupt(); +VOID KiIpiInterrupt(); + VOID KiGdtPrepareForApplicationProcessorInit(ULONG Id); VOID From 29e9dfd5d65541dd889b80469b814b4d6c5454d5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 20 Aug 2008 23:48:28 +0000 Subject: [PATCH 132/388] Also initialize data segment descriptor in the gdt. svn path=/branches/ros-amd64-bringup/; revision=35495 --- reactos/boot/freeldr/freeldr/arch/amd64/loader.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 504ee11b6d4..59127de3e13 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -256,6 +256,10 @@ FrLdrSetupGdtIdt() Entry = KiGetGdtEntry(pGdt, KGDT_64_R0_CODE); *(PULONG64)Entry = 0x0020980000000000ULL; + /* Setup KGDT_64_DATA */ + Entry = KiGetGdtEntry(pGdt, KGDT_64_DATA); + *(PULONG64)Entry = 0x0000F00000000000ULL; + /* Setup TSS entry */ Entry = KiGetGdtEntry(pGdt, KGDT_TSS); KiInitGdtEntry(Entry, TssBase, I386_TSS, 0); From 0d5cd90543e97fbf820ae638ddd429cfbb913bb2 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 20 Aug 2008 23:54:52 +0000 Subject: [PATCH 133/388] Fix KiSystemStartupReal, KiGetMachineBootPointers and KiInitializePcr. Add trap.S for ISRs (unimplemented). Add except.c with KiInterruptInitTable and KeInitExceptions, initializing the IDT. Add irql.c for IRQL functions (unimplemented). Update stubs file. Based on info from http://www.msuiche.net/papers/Windows_Vista_64bits_and_unexported_kernel_symbols.pdf. We now reach KiSetupStackAndInitializeKernel, but there's a few things still missing. svn path=/branches/ros-amd64-bringup/; revision=35496 --- reactos/ntoskrnl/amd64stubs.c | 13 +- reactos/ntoskrnl/ke/amd64/cpu.c | 59 ++++++ reactos/ntoskrnl/ke/amd64/except.c | 90 ++++++++++ reactos/ntoskrnl/ke/amd64/irql.c | 70 ++++++++ reactos/ntoskrnl/ke/amd64/kiinit.c | 198 ++++++++++----------- reactos/ntoskrnl/ke/amd64/trap.S | 131 ++++++++++++++ reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 4 + reactos/ntoskrnl/ntoskrnl_amd64.def | 1 - 8 files changed, 457 insertions(+), 109 deletions(-) create mode 100644 reactos/ntoskrnl/ke/amd64/cpu.c create mode 100644 reactos/ntoskrnl/ke/amd64/except.c create mode 100644 reactos/ntoskrnl/ke/amd64/irql.c create mode 100644 reactos/ntoskrnl/ke/amd64/trap.S diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index 603d082b802..94b8ba197f3 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -1,17 +1,13 @@ +unsigned long (*FrLdrDbgPrint)(const char *Format, ...); + -#define STUB(x) void x() {} + +#define STUB(x) void x() {FrLdrDbgPrint("Sorry, %s is only a stub!\n", __FUNCTION__);} STUB(KdpEnableSafeMem) -STUB(KfLowerIrql) -STUB(KeRaiseIrql) -STUB(KeLowerIrql) -STUB(KeRaiseIrqlToSynchLevel) -STUB(KeRaiseIrqlToDpcLevel) STUB(KiIdleLoop) -STUB(KeGetCurrentIrql) STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch) -STUB(KeNumberProcessors) STUB(KeBugcheckCallbackListHead) STUB(ExpInterlockedPushEntrySList) STUB(NtContinue) @@ -173,7 +169,6 @@ STUB(KeUpdateRunTime) STUB(KeUpdateSystemTime) STUB(KeUserModeCallback) STUB(KeWaitForMutexObject) -STUB(KfRaiseIrql) STUB(KiBugCheckData) STUB(KiCpuId) STUB(MmCommitSessionMappedView) diff --git a/reactos/ntoskrnl/ke/amd64/cpu.c b/reactos/ntoskrnl/ke/amd64/cpu.c new file mode 100644 index 00000000000..4e49b13e67c --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/cpu.c @@ -0,0 +1,59 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/amd64/cpu.c + * PURPOSE: Routines for CPU-level support + * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +/* The Boot TSS */ +KTSS64 KiBootTss; + +/* The TSS to use for Double Fault Traps (INT 0x9) */ +UCHAR KiDoubleFaultTSS[KTSS_IO_MAPS]; + +/* The TSS to use for NMI Fault Traps (INT 0x2) */ +UCHAR KiNMITSS[KTSS_IO_MAPS]; + +/* CPU Features and Flags */ +ULONG KeI386MachineType; + +CHAR KeNumberProcessors = 0; + +/* FUNCTIONS *****************************************************************/ + + +VOID +FASTCALL +Ki386InitializeTss(IN PKTSS Tss, + IN PKIDTENTRY Idt, + IN PKGDTENTRY Gdt) +{ + // UNIMPLEMENTED; +} + +VOID +NTAPI +KeFlushCurrentTb(VOID) +{ + /* Flush the TLB by resetting CR3 */ + __writecr3(__readcr3()); +} + +VOID +NTAPI +KiInitializeMachineType(VOID) +{ + /* Set the Machine Type we got from NTLDR */ + KeI386MachineType = KeLoaderBlock->u.I386.MachineType & 0x000FF; +} + + diff --git a/reactos/ntoskrnl/ke/amd64/except.c b/reactos/ntoskrnl/ke/amd64/except.c new file mode 100644 index 00000000000..1de3a70a6b6 --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/except.c @@ -0,0 +1,90 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/i386/exp.c + * PURPOSE: Exception Dispatching and Context<->Trap Frame Conversion + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + * Gregor Anich + * Skywing (skywing@valhallalegends.com) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +KIDT_INIT KiInterruptInitTable[] = +{ + {0x00, 0x00, 0x00, KiDivideErrorFault}, + {0x01, 0x00, 0x00, KiDebugTrapOrFault}, + {0x02, 0x00, 0x03, KiNmiInterrupt}, + {0x03, 0x03, 0x00, KiBreakpointTrap}, + {0x04, 0x03, 0x00, KiOverflowTrap}, + {0x05, 0x00, 0x00, KiBoundFault}, + {0x06, 0x00, 0x00, KiInvalidOpcodeFault}, + {0x07, 0x00, 0x00, KiNpxNotAvailableFault}, + {0x08, 0x00, 0x01, KiDoubleFaultAbort}, + {0x09, 0x00, 0x00, KiNpxSegmentOverrunAbort}, + {0x0A, 0x00, 0x00, KiInvalidTssFault}, + {0x0B, 0x00, 0x00, KiSegmentNotPresentFault}, + {0x0C, 0x00, 0x00, KiStackFault}, + {0x0D, 0x00, 0x00, KiGeneralProtectionFault}, + {0x0E, 0x00, 0x00, KiPageFault}, + {0x10, 0x00, 0x00, KiFloatingErrorFault}, + {0x11, 0x00, 0x00, KiAlignmentFault}, + {0x12, 0x00, 0x02, KiMcheckAbort}, + {0x13, 0x00, 0x00, KiXmmException}, + {0x1F, 0x00, 0x00, KiApcInterrupt}, + {0x2C, 0x03, 0x00, KiRaiseAssertion}, + {0x2D, 0x03, 0x00, KiDebugServiceTrap}, + {0x2F, 0x00, 0x00, KiDpcInterrupt}, + {0xE1, 0x00, 0x00, KiIpiInterrupt}, + {0, 0} +}; + +KIDTENTRY64 KiIdt[256]; +KDESCRIPTOR KiIdtDescriptor = {{0}, sizeof(KiIdt) - 1, KiIdt}; + +/* FUNCTIONS *****************************************************************/ + + + +VOID +INIT_FUNCTION +NTAPI +KeInitExceptions(VOID) +{ + int i, j; + + /* Initialize the Idt */ + for (j = i = 0; i < 256; i++) + { + ULONG64 Offset; + + if (KiInterruptInitTable[j].InterruptId == i) + { + Offset = (ULONG64)KiInterruptInitTable[j].ServiceRoutine; + KiIdt[i].Dpl = KiInterruptInitTable[j].Dpl; + j++; + } + else + { + Offset = (ULONG64)KiUnexpectedInterrupt; + KiIdt[i].Dpl = 0; + } + KiIdt[i].OffsetLow = Offset & 0xffff; + KiIdt[i].Selector = KGDT_64_R0_CODE; + KiIdt[i].Type = 0x0e; + KiIdt[i].IstIndex = 0; + KiIdt[i].Reserved0 = 0; + KiIdt[i].Present = 1; + KiIdt[i].OffsetMiddle = (Offset >> 16) & 0xffff; + KiIdt[i].OffsetHigh = (Offset >> 32); + KiIdt[i].Reserved1 = 0; + } + +} + diff --git a/reactos/ntoskrnl/ke/amd64/irql.c b/reactos/ntoskrnl/ke/amd64/irql.c new file mode 100644 index 00000000000..7a511eda2d1 --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/irql.c @@ -0,0 +1,70 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Routines for IRQL-level support + * PROGRAMMERS: Timo Kreuzer + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include + +#undef UNIMPLEMENTED + +#define UNIMPLEMENTED \ + FrLdrDbgPrint("Sorry, %s is unimplemented!\n", __FUNCTION__) + +/* FUNCTIONS ****************************************************************/ + +#undef KeGetCurrentIrql +NTKERNELAPI +KIRQL +KeGetCurrentIrql(VOID) +{ + UNIMPLEMENTED; + return 0; +} + + +NTKERNELAPI +VOID +KfLowerIrql(IN KIRQL NewIrql) +{ + UNIMPLEMENTED; +} + +NTKERNELAPI +KIRQL +KfRaiseIrql(IN KIRQL NewIrql) +{ + UNIMPLEMENTED; + return 0; +} + +NTKERNELAPI +KIRQL +KeRaiseIrqlToDpcLevel(VOID) +{ + UNIMPLEMENTED; + return 0; +} + +NTKERNELAPI +KIRQL +KeRaiseIrqlToSynchLevel(VOID) +{ + UNIMPLEMENTED; + return 0; +} + +NTKERNELAPI +VOID +KeLowerIrql(IN KIRQL NewIrql) +{ + UNIMPLEMENTED; + return 0; +} + +/* EOF */ diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index 9247b445f4e..f1e7bd6757c 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -22,6 +22,8 @@ KSPIN_LOCK Ki486CompatibilityLock; extern ULONG KeMemoryMapRangeCount; extern ADDRESS_RANGE KeMemoryMap[64]; +KIPCR KiInitialPcr; + /* FUNCTIONS *****************************************************************/ VOID @@ -331,57 +333,48 @@ KiInitializePcr(IN ULONG ProcessorNumber, IN PKTHREAD IdleThread, IN PVOID DpcStack) { -#if 0 - /* Setup the TIB */ - Pcr->NtTib.ExceptionList = EXCEPTION_CHAIN_END; - Pcr->NtTib.StackBase = 0; - Pcr->NtTib.StackLimit = 0; - Pcr->NtTib.Self = NULL; - /* Set the Current Thread */ - Pcr->PrcbData.CurrentThread = IdleThread; + Pcr->Prcb.CurrentThread = IdleThread; /* Set pointers to ourselves */ Pcr->Self = (PKPCR)Pcr; - Pcr->Prcb = &Pcr->PrcbData; + Pcr->CurrentPrcb = &Pcr->Prcb; /* Set the PCR Version */ Pcr->MajorVersion = PCR_MAJOR_VERSION; Pcr->MinorVersion = PCR_MINOR_VERSION; /* Set the PCRB Version */ - Pcr->PrcbData.MajorVersion = 1; - Pcr->PrcbData.MinorVersion = 1; + Pcr->Prcb.MajorVersion = 1; + Pcr->Prcb.MinorVersion = 1; /* Set the Build Type */ - Pcr->PrcbData.BuildType = 0; + Pcr->Prcb.BuildType = 0; #ifndef CONFIG_SMP - Pcr->PrcbData.BuildType |= PRCB_BUILD_UNIPROCESSOR; + Pcr->Prcb.BuildType |= PRCB_BUILD_UNIPROCESSOR; #endif #ifdef DBG - Pcr->PrcbData.BuildType |= PRCB_BUILD_DEBUG; + Pcr->Prcb.BuildType |= PRCB_BUILD_DEBUG; #endif /* Set the Processor Number and current Processor Mask */ - Pcr->PrcbData.Number = (UCHAR)ProcessorNumber; - Pcr->PrcbData.SetMember = 1 << ProcessorNumber; + Pcr->Prcb.Number = (UCHAR)ProcessorNumber; + Pcr->Prcb.SetMember = 1 << ProcessorNumber; /* Set the PRCB for this Processor */ - KiProcessorBlock[ProcessorNumber] = Pcr->Prcb; + KiProcessorBlock[ProcessorNumber] = &Pcr->Prcb; /* Start us out at PASSIVE_LEVEL */ - Pcr->Irql = PASSIVE_LEVEL; +// Pcr->Irql = PASSIVE_LEVEL; /* Set the GDI, IDT, TSS and DPC Stack */ - Pcr->GDT = (PVOID)Gdt; - Pcr->IDT = Idt; - Pcr->TSS = Tss; - Pcr->TssCopy = Tss; - Pcr->PrcbData.DpcStack = DpcStack; + Pcr->GdtBase = (PVOID)Gdt; + Pcr->IdtBase = Idt; + Pcr->TssBase = Tss; + Pcr->Prcb.DpcStack = DpcStack; /* Setup the processor set */ - Pcr->PrcbData.MultiThreadProcessorSet = Pcr->PrcbData.SetMember; -#endif + Pcr->Prcb.MultiThreadProcessorSet = Pcr->Prcb.SetMember; } VOID @@ -616,14 +609,20 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, IN PKIPCR *Pcr, IN PKTSS *Tss) { -#if 0 - KDESCRIPTOR GdtDescriptor = {0}, IdtDescriptor = {0}; - KGDTENTRY TssSelector, PcrSelector; - USHORT Tr = 0, Fs; + KDESCRIPTOR GdtDescriptor = {{0},0,0}, IdtDescriptor = {{0},0,0}; + KGDTENTRY64 TssSelector; + USHORT Tr = 0; /* Get GDT and IDT descriptors */ - Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&GdtDescriptor.Limit); - Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&IdtDescriptor.Limit); + Ke386GetGlobalDescriptorTable(GdtDescriptor.Limit); + Ke386GetInterruptDescriptorTable(IdtDescriptor.Limit); + + // FIXME: for some strange reason the gdt needs some time before it's finished... + if (!GdtDescriptor.Base) + { + FrLdrDbgPrint("1. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit); + } + FrLdrDbgPrint("2. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit); /* Save IDT and GDT */ *Gdt = (PKGDTENTRY)GdtDescriptor.Base; @@ -632,24 +631,15 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, /* Get TSS and FS Selectors */ Ke386GetTr(Tr); if (Tr != KGDT_TSS) Tr = KGDT_TSS; // FIXME: HACKHACK - Fs = Ke386GetFs(); - - /* Get PCR Selector, mask it and get its GDT Entry */ - PcrSelector = *(PKGDTENTRY)((ULONG_PTR)*Gdt + (Fs & ~RPL_MASK)); - - /* Get the KPCR itself */ - *Pcr = (PKIPCR)(ULONG_PTR)(PcrSelector.BaseLow | - PcrSelector.HighWord.Bytes.BaseMid << 16 | - PcrSelector.HighWord.Bytes.BaseHi << 24); /* Get TSS Selector, mask it and get its GDT Entry */ TssSelector = *(PKGDTENTRY)((ULONG_PTR)*Gdt + (Tr & ~RPL_MASK)); /* Get the KTSS itself */ *Tss = (PKTSS)(ULONG_PTR)(TssSelector.BaseLow | - TssSelector.HighWord.Bytes.BaseMid << 16 | - TssSelector.HighWord.Bytes.BaseHi << 24); -#endif + TssSelector.Bytes.BaseMiddle << 16 | + TssSelector.Bytes.BaseHigh << 24 | + (ULONG64)TssSelector.BaseUpper << 32); } VOID @@ -657,26 +647,30 @@ NTAPI KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { FrLdrDbgPrint("Enter KiSystemStartupReal()\n"); - for(;;); -#if 0 ULONG Cpu; PKTHREAD InitialThread; - ULONG InitialStack; + ULONG64 InitialStack; PKGDTENTRY Gdt; PKIDTENTRY Idt; - KIDTENTRY NmiEntry, DoubleFaultEntry; +// KIDTENTRY NmiEntry, DoubleFaultEntry; PKTSS Tss; PKIPCR Pcr; /* Save the loader block and get the current CPU */ KeLoaderBlock = LoaderBlock; + + /* Get Pcr from loader block */ +// Pcr = CONTAINING_RECORD(LoaderBlock->Prcb, KIPCR, Prcb); + Pcr = &KiInitialPcr; + Cpu = KeNumberProcessors; - if (!Cpu) + if (Cpu == 0) { - /* If this is the boot CPU, set FS and the CPU Number*/ - Ke386SetFs(KGDT_R0_PCR); - __writefsdword(KPCR_PROCESSOR_NUMBER, Cpu); + /* If this is the boot CPU, set GS base and the CPU Number*/ + __writemsr(X86_MSR_GSBASE, (ULONG64)Pcr); + __writemsr(X86_MSR_KERNEL_GSBASE, (ULONG64)Pcr); + Pcr->Prcb.Number = Cpu; /* Set the initial stack and idle thread as well */ LoaderBlock->KernelStack = (ULONG_PTR)P0BootStack; @@ -684,7 +678,7 @@ KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } /* Save the initial thread and stack */ - InitialStack = LoaderBlock->KernelStack; + InitialStack = LoaderBlock->KernelStack; // Chekme InitialThread = (PKTHREAD)LoaderBlock->Thread; /* Clean the APC List Head */ @@ -694,53 +688,59 @@ KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) KiInitializeMachineType(); /* Skip initial setup if this isn't the Boot CPU */ - if (Cpu) goto AppCpuInit; + if (Cpu == 0) + { + /* Get GDT, IDT, PCR and TSS pointers */ + KiGetMachineBootPointers(&Gdt, &Idt, &Pcr, &Tss); - /* Get GDT, IDT, PCR and TSS pointers */ - KiGetMachineBootPointers(&Gdt, &Idt, &Pcr, &Tss); +FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); - /* Setup the TSS descriptors and entries */ - Ki386InitializeTss(Tss, Idt, Gdt); + /* Setup the TSS descriptors and entries */ + Ki386InitializeTss(Tss, Idt, Gdt); - /* Initialize the PCR */ - RtlZeroMemory(Pcr, PAGE_SIZE); - KiInitializePcr(Cpu, - Pcr, - Idt, - Gdt, - Tss, - InitialThread, - KiDoubleFaultStack); + /* Initialize the PCR */ + RtlZeroMemory(Pcr, PAGE_SIZE); + KiInitializePcr(Cpu, + Pcr, + Idt, + Gdt, + Tss, + InitialThread, + KiDoubleFaultStack); - /* Set us as the current process */ - InitialThread->ApcState.Process = &KiInitialProcess.Pcb; + /* Set us as the current process */ + InitialThread->ApcState.Process = &KiInitialProcess.Pcb; - /* Clear DR6/7 to cleanup bootloader debugging */ - __writefsdword(KPCR_TEB, 0); - __writefsdword(KPCR_DR6, 0); - __writefsdword(KPCR_DR7, 0); + /* Clear DR6/7 to cleanup bootloader debugging */ + Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr6 = 0; + Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr7 = 0; - /* Setup the IDT */ - KeInitExceptions(); + /* Setup the IDT */ + KeInitExceptions(); - /* Load Ring 3 selectors for DS/ES */ - Ke386SetDs(KGDT_R3_DATA | RPL_MASK); - Ke386SetEs(KGDT_R3_DATA | RPL_MASK); + /* Load Ring 3 selectors for DS/ES/FS */ + Ke386SetDs(KGDT_64_DATA | RPL_MASK); + Ke386SetEs(KGDT_64_DATA | RPL_MASK); +// Ke386SetFs(KGDT_32_R3_TEB | RPL_MASK); - /* Save NMI and double fault traps */ - RtlCopyMemory(&NmiEntry, &Idt[2], sizeof(KIDTENTRY)); - RtlCopyMemory(&DoubleFaultEntry, &Idt[8], sizeof(KIDTENTRY)); + /* LDT is unused */ + Ke386SetLocalDescriptorTable(0); - /* Copy kernel's trap handlers */ - RtlCopyMemory(Idt, - (PVOID)KiIdtDescriptor.Base, - KiIdtDescriptor.Limit + 1); + /* Save NMI and double fault traps */ +// RtlCopyMemory(&NmiEntry, &Idt[2], sizeof(KIDTENTRY)); +// RtlCopyMemory(&DoubleFaultEntry, &Idt[8], sizeof(KIDTENTRY)); + + /* Copy kernel's trap handlers */ +// RtlCopyMemory(Idt, +// (PVOID)KiIdtDescriptor.Base, +// KiIdtDescriptor.Limit + 1); + + /* Restore NMI and double fault */ +// RtlCopyMemory(&Idt[2], &NmiEntry, sizeof(KIDTENTRY)); +// RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY)); + } - /* Restore NMI and double fault */ - RtlCopyMemory(&Idt[2], &NmiEntry, sizeof(KIDTENTRY)); - RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY)); -AppCpuInit: /* Loop until we can release the freeze lock */ do { @@ -749,26 +749,24 @@ AppCpuInit: } while(InterlockedBitTestAndSet((PLONG)&KiFreezeExecutionLock, 0)); /* Setup CPU-related fields */ - __writefsdword(KPCR_NUMBER, Cpu); - __writefsdword(KPCR_SET_MEMBER, 1 << Cpu); - __writefsdword(KPCR_SET_MEMBER_COPY, 1 << Cpu); - __writefsdword(KPCR_PRCB_SET_MEMBER, 1 << Cpu); + Pcr->Prcb.Number = Cpu; + Pcr->Prcb.SetMember = 1 << Cpu; /* Initialize the Processor with HAL */ - HalInitializeProcessor(Cpu, KeLoaderBlock); +// HalInitializeProcessor(Cpu, KeLoaderBlock); /* Set active processors */ - KeActiveProcessors |= __readfsdword(KPCR_SET_MEMBER); + KeActiveProcessors |= 1 << Cpu; KeNumberProcessors++; /* Check if this is the boot CPU */ - if (!Cpu) + if (Cpu == 0) { /* Initialize debugging system */ - KdInitSystem(0, KeLoaderBlock); +// KdInitSystem(0, KeLoaderBlock); /* Check for break-in */ - if (KdPollBreakIn()) DbgBreakPointWithStatus(1); +// if (KdPollBreakIn()) DbgBreakPointWithStatus(1); } /* Raise to HIGH_LEVEL */ @@ -777,12 +775,14 @@ AppCpuInit: /* Align stack and make space for the trap frame and NPX frame */ InitialStack &= ~(KTRAP_FRAME_ALIGN - 1); +FrLdrDbgPrint("Before KiSetupStackAndInitializeKernel\n"); +for(;;); + /* Switch to new kernel stack and start kernel bootstrapping */ KiSetupStackAndInitializeKernel(&KiInitialProcess.Pcb, InitialThread, (PVOID)InitialStack, - (PKPRCB)__readfsdword(KPCR_PRCB), + &Pcr->Prcb, (CCHAR)Cpu, KeLoaderBlock); -#endif } diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S new file mode 100644 index 00000000000..5c43aae70ca --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -0,0 +1,131 @@ +/* + * FILE: ntoskrnl/ke/amd64/trap.S + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: System Traps, Entrypoints and Exitpoints + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + * NOTE: See asmmacro.S for the shared entry/exit code. + */ + +/* INCLUDES ******************************************************************/ + +//#include +//#include +.intel_syntax noprefix +.code64 + +/* GLOBALS *******************************************************************/ + +.data + +_MsgGeneralProtFault: +.ascii "General protection fault at %p!\n\0" + +_MsgBreakpointTrap: +.ascii "BreakpointTrap at %p\n\0" + +_MsgUnexpectedInterrupt: +.ascii "UnexpectedInterrupt\n\0" + + +/* SOFTWARE INTERRUPT SERVICES ***********************************************/ +.text +.code64 + +.global _KiDivideErrorFault +_KiDivideErrorFault: + +.global _KiDebugTrapOrFault +_KiDebugTrapOrFault: + +.global _KiNmiInterrupt +_KiNmiInterrupt: + +.global _KiBreakpointTrap +_KiBreakpointTrap: +// mov rdx, [rsp] + sub rsp, 0x10 +// movabs rcx, offset _MsgBreakpointTrap +// movabs rax, offset _FrLdrDbgPrint +// call [rax] + add rsp, 0x10 + iret + +.global _KiOverflowTrap +_KiOverflowTrap: + +.global _KiBoundFault +_KiBoundFault: + +.global _KiInvalidOpcodeFault +_KiInvalidOpcodeFault: + +.global _KiNpxNotAvailableFault +_KiNpxNotAvailableFault: + +.global _KiDoubleFaultAbort +_KiDoubleFaultAbort: + +.global _KiNpxSegmentOverrunAbort +_KiNpxSegmentOverrunAbort: + +.global _KiInvalidTssFault +_KiInvalidTssFault: + +.global _KiSegmentNotPresentFault +_KiSegmentNotPresentFault: + +.global _KiStackFault +_KiStackFault: + +jmp $ + + +.global _KiGeneralProtectionFault +_KiGeneralProtectionFault: + mov rdx, 0 + mov dx, ss + movabs rcx, offset _MsgGeneralProtFault + movabs rax, offset _FrLdrDbgPrint + call [rax] + jmp $ + + +.global _KiPageFault +_KiPageFault: + +.global _KiFloatingErrorFault +_KiFloatingErrorFault: + +.global _KiAlignmentFault +_KiAlignmentFault: + +.global _KiMcheckAbort +_KiMcheckAbort: + +.global _KiXmmException +_KiXmmException: + +.global _KiApcInterrupt +_KiApcInterrupt: + + +.global _KiRaiseAssertion +_KiRaiseAssertion: + +.global _KiDebugServiceTrap +_KiDebugServiceTrap: + +.global _KiDpcInterrupt +_KiDpcInterrupt: + + +.global _KiIpiInterrupt +_KiIpiInterrupt: + iret + +.global _KiUnexpectedInterrupt +_KiUnexpectedInterrupt: + movabs rcx, offset _MsgUnexpectedInterrupt + movabs rax, offset _FrLdrDbgPrint + call [rax] + jmp $ diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index a8e6365861f..3c010044f10 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -91,7 +91,11 @@ boot.S + cpu.c + except.c + irql.c kiinit.c + trap.S apc.c diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index 0a82a805bbd..828417e6603 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -6,7 +6,6 @@ EXPORTS ; KfAcquireSpinLock KfReleaseSpinLock -KeRaiseIrql KefAcquireSpinLockAtDpcLevel KefReleaseSpinLockFromDpcLevel KeInitializeSpinLock From c00498727e252f702b67a0cce7758ffe4e512b79 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 13:30:00 +0000 Subject: [PATCH 134/388] Implement __readcr8, __writecr8, __lidt and __sidt intrinsics. svn path=/branches/ros-amd64-bringup/; revision=35504 --- reactos/include/psdk/intrin_x86.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 7e62aa931ed..01d4d08dcce 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -1105,6 +1105,11 @@ static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned __asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) : "memory"); } +static __inline__ __attribute__((always_inline)) void __writecr8(const unsigned long long Data) +{ + __asm__("movq %q[Data], %%cr8" : : [Data] "q" (Data) : "memory"); +} + static __inline__ __attribute__((always_inline)) unsigned long long __readcr0(void) { unsigned long long value; @@ -1133,6 +1138,13 @@ static __inline__ __attribute__((always_inline)) unsigned long long __readcr4(vo return value; } +static __inline__ __attribute__((always_inline)) unsigned long long __readcr8(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=q" (value)); + return value; +} + #else static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) { @@ -1218,6 +1230,16 @@ static __inline__ __attribute__((always_inline)) void __wbinvd(void) __asm__ __volatile__("wbinvd"); } +static __inline__ __attribute__((always_inline)) void __lidt(void *Source) +{ + __asm__ __volatile__("lidt %0" : : "m"(*(short*)Source)); +} + +static __inline__ __attribute__((always_inline)) void __sidt(void *Destination) +{ + __asm__ __volatile__("sidt %0" : : "m"(*(short*)Destination)); +} + #endif /* KJK_INTRIN_X86_H_ */ /* EOF */ From ae1ea8b5931ad8f90ce3ba1f0467e42df2c8da58 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 13:30:39 +0000 Subject: [PATCH 135/388] Remove private __lidt definition. svn path=/branches/ros-amd64-bringup/; revision=35505 --- reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index ddd869f6435..05f483ad396 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -58,13 +58,6 @@ __lgdt(void *gdt) asm volatile ("lgdt %0\n" : : "m"(*(short*)gdt)); } -VOID -FORCEINLINE -__lidt(void *idt) -{ - asm volatile ("lidt %0\n" : : "m"(*(short*)idt)); -} - PKGDTENTRY64 FORCEINLINE KiGetGdtEntry(PVOID pGdt, USHORT Index) From bebc0f9c06b4cdcd44b54874c26c0153801e12df Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 13:33:57 +0000 Subject: [PATCH 136/388] Implement KeGetCurrentIrql as intrinsic. svn path=/branches/ros-amd64-bringup/; revision=35506 --- reactos/include/ddk/winddk.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 3324c1361d5..f93c579a9d8 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -9962,10 +9962,19 @@ KeRaiseIrqlToSynchLevel( #elif defined(_M_AMD64) +/* NTKERNELAPI KIRQL KeGetCurrentIrql( VOID); +*/ +FORCEINLINE +KIRQL +_KeGetCurrentIrql(VOID) +{ + return (KIRQL)__readcr8(); +} +#define KeGetCurrentIrql _KeGetCurrentIrql NTKERNELAPI VOID From c4c7933979bb322556fd026be3419a00325622bb Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 18:04:23 +0000 Subject: [PATCH 137/388] On SMP builds SYNCH_LEVEL is (IPI_LEVEL - 2) or 12 svn path=/branches/ros-amd64-bringup/; revision=35509 --- reactos/include/ndk/amd64/ketypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 381121f4379..be6cee6d7eb 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -139,7 +139,7 @@ Author: #ifndef CONFIG_SMP #define SYNCH_LEVEL DISPATCH_LEVEL #else -#define SYNCH_LEVEL (IPI_LEVEL - 1) +#define SYNCH_LEVEL (IPI_LEVEL - 2) #endif // From 56d9201788c095f82fce5d9106969a8d51e1fbdc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 18:07:45 +0000 Subject: [PATCH 138/388] Make KeGetCurrentIrql, KeLowerIrql, KfRaiseIrql, KeRaiseIrql, KeRaiseIrqlToDpcLevel and KeRaiseIrqlToSynchLevel intrinsics as in the WDK 2008. svn path=/branches/ros-amd64-bringup/; revision=35510 --- reactos/include/ddk/winddk.h | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index f93c579a9d8..8de50fb808f 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -9962,47 +9962,47 @@ KeRaiseIrqlToSynchLevel( #elif defined(_M_AMD64) -/* -NTKERNELAPI -KIRQL -KeGetCurrentIrql( - VOID); -*/ FORCEINLINE KIRQL -_KeGetCurrentIrql(VOID) +KeGetCurrentIrql(VOID) { return (KIRQL)__readcr8(); } -#define KeGetCurrentIrql _KeGetCurrentIrql -NTKERNELAPI +FORCEINLINE VOID -KfLowerIrql( - IN KIRQL NewIrql); +KeLowerIrql(IN KIRQL NewIrql) +{ + ASSERT(KeGetCurrentIrql() >= NewIrql); + __writecr8(NewIrql); +} -NTKERNELAPI +FORCEINLINE KIRQL -KfRaiseIrql( - IN KIRQL NewIrql); - -NTKERNELAPI -KIRQL -KeRaiseIrqlToDpcLevel( - VOID); - -NTKERNELAPI -KIRQL -KeRaiseIrqlToSynchLevel( - VOID); - -NTKERNELAPI -VOID -KeLowerIrql( - IN KIRQL NewIrql); +KfRaiseIrql(IN KIRQL NewIrql) +{ + KIRQL OldIrql; + OldIrql = __readcr8(); + ASSERT(OldIrql <= NewIrql); + __writecr8(NewIrql); + return OldIrql; +} #define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a) +FORCEINLINE +KIRQL +KeRaiseIrqlToDpcLevel(VOID) +{ + return KfRaiseIrql(DISPATCH_LEVEL); +} + +FORCEINLINE +KIRQL +KeRaiseIrqlToSynchLevel(VOID) +{ + return KfRaiseIrql(12); // SYNCH_LEVEL = IPI_LEVEL - 2 +} #elif defined(__PowerPC__) From 5e2d40364e813bd40ce8d8702f93005877dd46c1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 18:10:08 +0000 Subject: [PATCH 139/388] fix build ;-) svn path=/branches/ros-amd64-bringup/; revision=35511 --- reactos/ntoskrnl/ke/amd64/boot.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S index 82e0b054b4c..d3064c92b3d 100644 --- a/reactos/ntoskrnl/ke/amd64/boot.S +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -76,7 +76,7 @@ _KiSetupStackAndInitializeKernel: /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ sti mov rcx, DISPATCH_LEVEL - call _KfLowerIrql + mov cr8, rcx /* Set the right wait IRQL */ mov byte ptr [rbx+KTHREAD_WAIT_IRQL], DISPATCH_LEVEL; From 7e667e38c44227e2e86b36719bfcc6f951bfbcda Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 18:13:42 +0000 Subject: [PATCH 140/388] Implement KxGetCurrentIrql, KxLowerIrql, KxRaiseIrql and KxRaiseIrqlToDpcLevel and use them for the Ke/Kf exports. svn path=/branches/ros-amd64-bringup/; revision=35512 --- reactos/ntoskrnl/ke/amd64/irql.c | 65 +++++++++-------------------- reactos/ntoskrnl/ntoskrnl_amd64.def | 8 ++-- 2 files changed, 24 insertions(+), 49 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/irql.c b/reactos/ntoskrnl/ke/amd64/irql.c index 7a511eda2d1..53dcd3890b6 100644 --- a/reactos/ntoskrnl/ke/amd64/irql.c +++ b/reactos/ntoskrnl/ke/amd64/irql.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * PURPOSE: Routines for IRQL-level support + * PURPOSE: Routines for IRQL support * PROGRAMMERS: Timo Kreuzer */ @@ -11,60 +11,35 @@ #define NDEBUG #include -#undef UNIMPLEMENTED - -#define UNIMPLEMENTED \ - FrLdrDbgPrint("Sorry, %s is unimplemented!\n", __FUNCTION__) - /* FUNCTIONS ****************************************************************/ -#undef KeGetCurrentIrql NTKERNELAPI KIRQL -KeGetCurrentIrql(VOID) +KxGetCurrentIrql(VOID) { - UNIMPLEMENTED; - return 0; -} - - -NTKERNELAPI -VOID -KfLowerIrql(IN KIRQL NewIrql) -{ - UNIMPLEMENTED; -} - -NTKERNELAPI -KIRQL -KfRaiseIrql(IN KIRQL NewIrql) -{ - UNIMPLEMENTED; - return 0; -} - -NTKERNELAPI -KIRQL -KeRaiseIrqlToDpcLevel(VOID) -{ - UNIMPLEMENTED; - return 0; -} - -NTKERNELAPI -KIRQL -KeRaiseIrqlToSynchLevel(VOID) -{ - UNIMPLEMENTED; - return 0; + return KeGetCurrentIrql(); } NTKERNELAPI VOID -KeLowerIrql(IN KIRQL NewIrql) +KxLowerIrql(IN KIRQL NewIrql) { - UNIMPLEMENTED; - return 0; + KeLowerIrql(NewIrql); } +NTKERNELAPI +KIRQL +KxRaiseIrql(IN KIRQL NewIrql) +{ + return KfRaiseIrql(NewIrql); +} + +NTKERNELAPI +KIRQL +KxRaiseIrqlToDpcLevel(VOID) +{ + return KeRaiseIrqlToDpcLevel(); +} + + /* EOF */ diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index 828417e6603..4bd04a00ff9 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -565,7 +565,7 @@ KeFindConfigurationNextEntry KeFlushEntireTb KeFlushQueuedDpcs KeGenericCallDpc -KeGetCurrentIrql +KeGetCurrentIrql=KxGetCurrentIrql KeGetCurrentThread KeGetRecommendedSharedDataAlignment KeInitializeApc @@ -596,7 +596,7 @@ KeLastBranchMSR KeLeaveCriticalRegion KeLeaveGuardedRegion KeLoaderBlock -KeLowerIrql +KeLowerIrql=KxLowerIrql KeNumberProcessors KeProfileInterruptWithSource KePulseEvent @@ -606,7 +606,7 @@ KeQueryPrcbAddress KeQueryPriorityThread KeQueryRuntimeThread KeQueryTimeIncrement -KeRaiseIrqlToDpcLevel +KeRaiseIrqlToDpcLevel=KxRaiseIrqlToDpcLevel KeRaiseUserException KeReadStateEvent KeReadStateMutant @@ -676,7 +676,7 @@ KeUserModeCallback KeWaitForMultipleObjects KeWaitForMutexObject KeWaitForSingleObject -KfRaiseIrql +KfRaiseIrql=KxRaiseIrql KiBugCheckData KiCheckForKernelApcDelivery KiCpuId From 9cc6529e5e8eac8b78120624f9f89005d4ffc0f8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 18:15:23 +0000 Subject: [PATCH 141/388] Add KeSetCurrentIrql svn path=/branches/ros-amd64-bringup/; revision=35513 --- reactos/ntoskrnl/include/internal/amd64/intrin_i.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h index 7da484c15f9..a09c4acdc31 100644 --- a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -7,6 +7,8 @@ #define LOCK "" #endif +#define KeSetCurrentIrql(x) __writecr8(x) + #if defined(__GNUC__) #define Ke386SetInterruptDescriptorTable(X) \ From d733da9c08f3a0cda704d00f1e6aaf9b8d16bda9 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 20:24:34 +0000 Subject: [PATCH 142/388] Fix hal build svn path=/branches/ros-amd64-bringup/; revision=35515 --- reactos/hal/hal/hal.rbuild | 2 +- reactos/hal/halamd64/generic/hal.c | 105 +---------------------------- 2 files changed, 4 insertions(+), 103 deletions(-) diff --git a/reactos/hal/hal/hal.rbuild b/reactos/hal/hal/hal.rbuild index aa0a6fabc75..df21161f11b 100644 --- a/reactos/hal/hal/hal.rbuild +++ b/reactos/hal/hal/hal.rbuild @@ -36,9 +36,9 @@ include + halamd64_generic ntoskrnl - hal.c hal.rc hal.spec diff --git a/reactos/hal/halamd64/generic/hal.c b/reactos/hal/halamd64/generic/hal.c index d72a8b77896..c951feebfdc 100644 --- a/reactos/hal/halamd64/generic/hal.c +++ b/reactos/hal/halamd64/generic/hal.c @@ -29,46 +29,6 @@ ULONG HalpCurrentTimeIncrement, HalpNextTimeIncrement, HalpNextIntervalCount; ULONG _KdComPortInUse = 0; -ULONG HalpIrqlTable[HIGH_LEVEL + 1] = -{ - 0xFFFFFFFF, // IRQL 0 PASSIVE_LEVEL - 0xFFFFFFFD, // IRQL 1 APC_LEVEL - 0xFFFFFFF9, // IRQL 2 DISPATCH_LEVEL - 0xFFFFFFD9, // IRQL 3 - 0xFFFFFF99, // IRQL 4 - 0xFFFFFF19, // IRQL 5 - 0xFFFFFE19, // IRQL 6 - 0xFFFFFC19, // IRQL 7 - 0xFFFFF819, // IRQL 8 - 0xFFFFF019, // IRQL 9 - 0xFFFFE019, // IRQL 10 - 0xFFFFC019, // IRQL 11 - 0xFFFF8019, // IRQL 12 - 0xFFFF0019, // IRQL 13 - 0xFFFE0019, // IRQL 14 - 0xFFFC0019, // IRQL 15 -}; - -UCHAR HalpMaskTable[HIGH_LEVEL + 1] = -{ - PROFILE_LEVEL, // INT 0 WATCHDOG - APC_LEVEL, // INT 1 SOFTWARE INTERRUPT - DISPATCH_LEVEL,// INT 2 COMM RX - IPI_LEVEL, // INT 3 COMM TX - CLOCK_LEVEL, // INT 4 TIMER 0 - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13 -}; - /* FUNCTIONS *****************************************************************/ NTSTATUS @@ -802,42 +762,6 @@ KeStallExecutionProcessor(IN ULONG Microseconds) return; } -VOID -FASTCALL -KfLowerIrql(IN KIRQL NewIrql) -{ - UNIMPLEMENTED; - return; -} - -KIRQL -FASTCALL -KfRaiseIrql(IN KIRQL NewIrql) -{ - UNIMPLEMENTED; - return; -} - - - -KIRQL -KeRaiseIrqlToDpcLevel(VOID) -{ - // - // Call the generic routine - // - return KfRaiseIrql(DISPATCH_LEVEL); -} - -KIRQL -KeRaiseIrqlToSynchLevel(VOID) -{ - // - // Call the generic routine - // - return KfRaiseIrql(DISPATCH_LEVEL); -} - BOOLEAN HalpProcessorIdentified; BOOLEAN HalpTestCleanSupported; @@ -862,29 +786,6 @@ HalSweepIcache(VOID) return; } -/* - * @implemented - */ -#undef KeGetCurrentIrql -KIRQL -NTAPI -KeGetCurrentIrql(VOID) -{ - UNIMPLEMENTED; - return; -} - -/* - * @implemented - */ -VOID -NTAPI -KeLowerIrql(KIRQL NewIrql) -{ - /* Call the fastcall function */ - KfLowerIrql(NewIrql); -} - /* * @implemented */ @@ -952,7 +853,7 @@ KfReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL OldIrql) { /* Simply lower IRQL back */ - KfLowerIrql(OldIrql); + KeLowerIrql(OldIrql); } /* @@ -1010,7 +911,7 @@ KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql) { /* Simply lower IRQL back */ - KfLowerIrql(OldIrql); + KeLowerIrql(OldIrql); } /* @@ -1021,7 +922,7 @@ FASTCALL KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) { /* Simply lower IRQL back */ - KfLowerIrql(LockHandle->OldIrql); + KeLowerIrql(LockHandle->OldIrql); } /* From 0aaed0f7382452be402ff31e281af42554b48156 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 21:10:17 +0000 Subject: [PATCH 143/388] Update syscall stubs svn path=/branches/ros-amd64-bringup/; revision=35517 --- reactos/tools/nci/ncitool.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/reactos/tools/nci/ncitool.c b/reactos/tools/nci/ncitool.c index 543b4c732b7..d3d89014a85 100644 --- a/reactos/tools/nci/ncitool.c +++ b/reactos/tools/nci/ncitool.c @@ -53,9 +53,9 @@ " call *(%%ecx)\n" \ " ret $0x%x\n\n" -#define UserModeStub_amd64 " movq $0x%x, %%rax\n" \ - " movq $KUSER_SHARED_SYSCALL, %%rcx\n" \ - " call *(%%rcx)\n" \ +#define UserModeStub_amd64 " movl $0x%x, %%eax\n" \ + " movq %%rcx, %%r10\n" \ + " syscall\n" \ " ret $0x%x\n\n" #define UserModeStub_ppc " stwu 1,-16(1)\n" \ @@ -99,10 +99,7 @@ " call _KiSystemService\n" \ " ret $0x%x\n\n" -#define KernelModeStub_amd64 " movq $0x%x, %%rax\n" \ - " leaq 4(%%rsp), %%rdx\n" \ - " pushfq\n" \ - " pushq $KGDT_R0_CODE\n" \ +#define KernelModeStub_amd64 " movl $0x%x, %%eax\n" \ " call _KiSystemService\n" \ " ret $0x%x\n\n" From 734fd03c8162816e0743bec0150c0135c32dd93a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Aug 2008 21:16:57 +0000 Subject: [PATCH 144/388] Implement KiSystemStartup in C instead of asm, implement KiSwapStack intrinsic, get rid of KiSetupStackandInitializeKernel, instead do the work in KiSystemStartupReal in C. Move Stack definitions into trap.S and get rid of the whole boot.S file. Comment out the sync loop for the moment and add a comment why it doesn't work (InterlockedBitTestAndSet64 doesn't work correctly). svn path=/branches/ros-amd64-bringup/; revision=35518 --- .../include/internal/amd64/intrin_i.h | 11 +++ reactos/ntoskrnl/ke/amd64/boot.S | 86 ------------------- reactos/ntoskrnl/ke/amd64/kiinit.c | 52 ++++++++--- reactos/ntoskrnl/ke/amd64/trap.S | 15 ++++ reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 1 - 5 files changed, 66 insertions(+), 99 deletions(-) delete mode 100644 reactos/ntoskrnl/ke/amd64/boot.S diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h index a09c4acdc31..9aa185c37ba 100644 --- a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -11,6 +11,17 @@ #if defined(__GNUC__) +ULONG64 +FORCEINLINE +KiSwapStack(ULONG64 NewStack) +{ + ULONG64 OldStack; + asm volatile ("movq %%rsp, %[oldstack]\n movq %[newstack], %%rsp\n" + : [oldstack] "=rm" (OldStack) + : [newstack] "rm" (NewStack)); + return OldStack; +} + #define Ke386SetInterruptDescriptorTable(X) \ __asm__("lidt %0\n\t" \ : /* no outputs */ \ diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S deleted file mode 100644 index d3064c92b3d..00000000000 --- a/reactos/ntoskrnl/ke/amd64/boot.S +++ /dev/null @@ -1,86 +0,0 @@ -/* - * FILE: ntoskrnl/ke/i386/boot.S - * COPYRIGHT: See COPYING in the top level directory - * PURPOSE: FreeLDR Wrapper Bootstrap Code and Bootstrap Trampoline - * PROGRAMMERs: Alex Ionescu (alex@relsoft.net) - * Thomas Weidenmueller - */ - -/* INCLUDES ******************************************************************/ - -#include -.intel_syntax noprefix -.code64 - -/* GLOBALS *******************************************************************/ - -.bss -.align 16 - -/* Kernel Boot Stack */ -.globl _P0BootStack -.space KERNEL_STACK_SIZE -_P0BootStack: - -/* Kernel Double-Fault and Temporary DPC Stack */ -.globl _KiDoubleFaultStack -.space KERNEL_STACK_SIZE -_KiDoubleFaultStack: - -/* FUNCTIONS *****************************************************************/ -.global _KiSystemStartup -.text -.func KiSystemStartup -_KiSystemStartup: - - /* NTLDR Boot: Call the main kernel initialization */ - test rcx, 0x80000000 - jnz _KiSystemStartupReal - - /* FREELDR Boot: Cal the FreeLDR wrapper */ - jmp _KiRosPrepareForSystemStartup -.endfunc - -/** - * VOID - * KiSetupStackAndInitializeKernel( - * esp+4 = ? -> rcx - * esp+8 = ? -> rdx - * PVOID pNewstack // esp+12 = new stack -> r8 - * esp+16 -> r9 - * esp+20 -> rsp + 8 - * esp+24 -> rsp + 16? - */ -.globl _KiSetupStackAndInitializeKernel -.func KiSetupStackAndInitializeKernel -_KiSetupStackAndInitializeKernel: - - /* Save current stack */ - mov rsi, rsp - - /* Setup the new stack */ - mov rsp, r8 - sub rsp, NPX_FRAME_LENGTH + KTRAP_FRAME_ALIGN + KTRAP_FRAME_LENGTH - push CR0_EM + CR0_TS + CR0_MP - - /* Copy stack parameters to the new stack */ - push [rsi + 16] - push [rsi + 8] - xor rbp, rbp - call _KiInitializeKernel - - /* Set the priority of this thread to 0 */ - mov rbx, PCR[KPCR_CURRENT_THREAD] - mov byte ptr [rbx+KTHREAD_PRIORITY], 0 - - /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ - sti - mov rcx, DISPATCH_LEVEL - mov cr8, rcx - - /* Set the right wait IRQL */ - mov byte ptr [rbx+KTHREAD_WAIT_IRQL], DISPATCH_LEVEL; - - /* Jump into the idle loop */ - jmp _KiIdleLoop -.endfunc diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index f1e7bd6757c..5d16072155d 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -366,6 +366,7 @@ KiInitializePcr(IN ULONG ProcessorNumber, /* Start us out at PASSIVE_LEVEL */ // Pcr->Irql = PASSIVE_LEVEL; + KeSetCurrentIrql(PASSIVE_LEVEL); /* Set the GDI, IDT, TSS and DPC Stack */ Pcr->GdtBase = (PVOID)Gdt; @@ -386,6 +387,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess, IN CCHAR Number, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { + FrLdrDbgPrint("Enter KiInitializeKernel\n"); #if 0 BOOLEAN NpxPresent; ULONG FeatureBits; @@ -642,6 +644,17 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, (ULONG64)TssSelector.BaseUpper << 32); } +// Hack +VOID KiRosPrepareForSystemStartup(ULONG, PROS_LOADER_PARAMETER_BLOCK); + +VOID +NTAPI +KiSystemStartup(IN ULONG_PTR Dummy, + IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock) +{ + KiRosPrepareForSystemStartup(Dummy, LoaderBlock); +} + VOID NTAPI KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -740,13 +753,15 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); // RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY)); } - +#if 0 // FIXME: InterlockedBitTestAndSet64 is broken! It needs to be specified + // that it should reference an absolute address! /* Loop until we can release the freeze lock */ do { /* Loop until execution can continue */ while (*(volatile PKSPIN_LOCK*)&KiFreezeExecutionLock == (PVOID)1); - } while(InterlockedBitTestAndSet((PLONG)&KiFreezeExecutionLock, 0)); + } while(InterlockedBitTestAndSet64((PLONG64)&KiFreezeExecutionLock, 0)); +#endif /* Setup CPU-related fields */ Pcr->Prcb.Number = Cpu; @@ -773,16 +788,29 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); KfRaiseIrql(HIGH_LEVEL); /* Align stack and make space for the trap frame and NPX frame */ - InitialStack &= ~(KTRAP_FRAME_ALIGN - 1); + InitialStack &= ~(16 - 1); -FrLdrDbgPrint("Before KiSetupStackAndInitializeKernel\n"); -for(;;); + /* Switch to new kernel Stack */ + KiSwapStack(InitialStack); - /* Switch to new kernel stack and start kernel bootstrapping */ - KiSetupStackAndInitializeKernel(&KiInitialProcess.Pcb, - InitialThread, - (PVOID)InitialStack, - &Pcr->Prcb, - (CCHAR)Cpu, - KeLoaderBlock); + /* Initialize kernel */ + KiInitializeKernel(&KiInitialProcess.Pcb, + InitialThread, + (PVOID)InitialStack, + &Pcr->Prcb, + (CCHAR)Cpu, + KeLoaderBlock); + + /* Set the priority of this thread to 0 */ + InitialThread->Priority = 0; + + /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ + _enable(); + KeLowerIrql(DISPATCH_LEVEL); + + /* Set the right wait IRQL */ + InitialThread->WaitIrql = DISPATCH_LEVEL; + + /* Jump into the idle loop */ + KiIdleLoop(); } diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S index 5c43aae70ca..02145c03d73 100644 --- a/reactos/ntoskrnl/ke/amd64/trap.S +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -13,8 +13,23 @@ .intel_syntax noprefix .code64 +#define KERNEL_STACK_SIZE 0x6000 + /* GLOBALS *******************************************************************/ +.bss +.align 16 + +/* Kernel Boot Stack */ +.globl _P0BootStack +.space KERNEL_STACK_SIZE +_P0BootStack: + +/* Kernel Double-Fault and Temporary DPC Stack */ +.globl _KiDoubleFaultStack +.space KERNEL_STACK_SIZE +_KiDoubleFaultStack: + .data _MsgGeneralProtFault: diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index 3c010044f10..26b64a0e83a 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -90,7 +90,6 @@ - boot.S cpu.c except.c irql.c From 3c6891fdc8512e60085357e302db03fa277a84ad Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 22 Aug 2008 10:07:57 +0000 Subject: [PATCH 145/388] revert my last change, yes it IS a stupid idea to mess with the stack in the middle of a C function.... svn path=/branches/ros-amd64-bringup/; revision=35524 --- .../include/internal/amd64/intrin_i.h | 11 --- reactos/ntoskrnl/ke/amd64/boot.S | 86 +++++++++++++++++++ reactos/ntoskrnl/ke/amd64/kiinit.c | 52 +++-------- reactos/ntoskrnl/ke/amd64/trap.S | 15 ---- reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 1 + 5 files changed, 99 insertions(+), 66 deletions(-) create mode 100644 reactos/ntoskrnl/ke/amd64/boot.S diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h index 9aa185c37ba..a09c4acdc31 100644 --- a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -11,17 +11,6 @@ #if defined(__GNUC__) -ULONG64 -FORCEINLINE -KiSwapStack(ULONG64 NewStack) -{ - ULONG64 OldStack; - asm volatile ("movq %%rsp, %[oldstack]\n movq %[newstack], %%rsp\n" - : [oldstack] "=rm" (OldStack) - : [newstack] "rm" (NewStack)); - return OldStack; -} - #define Ke386SetInterruptDescriptorTable(X) \ __asm__("lidt %0\n\t" \ : /* no outputs */ \ diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S new file mode 100644 index 00000000000..d3064c92b3d --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -0,0 +1,86 @@ +/* + * FILE: ntoskrnl/ke/i386/boot.S + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: FreeLDR Wrapper Bootstrap Code and Bootstrap Trampoline + * PROGRAMMERs: Alex Ionescu (alex@relsoft.net) + * Thomas Weidenmueller + */ + +/* INCLUDES ******************************************************************/ + +#include +.intel_syntax noprefix +.code64 + +/* GLOBALS *******************************************************************/ + +.bss +.align 16 + +/* Kernel Boot Stack */ +.globl _P0BootStack +.space KERNEL_STACK_SIZE +_P0BootStack: + +/* Kernel Double-Fault and Temporary DPC Stack */ +.globl _KiDoubleFaultStack +.space KERNEL_STACK_SIZE +_KiDoubleFaultStack: + +/* FUNCTIONS *****************************************************************/ +.global _KiSystemStartup +.text +.func KiSystemStartup +_KiSystemStartup: + + /* NTLDR Boot: Call the main kernel initialization */ + test rcx, 0x80000000 + jnz _KiSystemStartupReal + + /* FREELDR Boot: Cal the FreeLDR wrapper */ + jmp _KiRosPrepareForSystemStartup +.endfunc + +/** + * VOID + * KiSetupStackAndInitializeKernel( + * esp+4 = ? -> rcx + * esp+8 = ? -> rdx + * PVOID pNewstack // esp+12 = new stack -> r8 + * esp+16 -> r9 + * esp+20 -> rsp + 8 + * esp+24 -> rsp + 16? + */ +.globl _KiSetupStackAndInitializeKernel +.func KiSetupStackAndInitializeKernel +_KiSetupStackAndInitializeKernel: + + /* Save current stack */ + mov rsi, rsp + + /* Setup the new stack */ + mov rsp, r8 + sub rsp, NPX_FRAME_LENGTH + KTRAP_FRAME_ALIGN + KTRAP_FRAME_LENGTH + push CR0_EM + CR0_TS + CR0_MP + + /* Copy stack parameters to the new stack */ + push [rsi + 16] + push [rsi + 8] + xor rbp, rbp + call _KiInitializeKernel + + /* Set the priority of this thread to 0 */ + mov rbx, PCR[KPCR_CURRENT_THREAD] + mov byte ptr [rbx+KTHREAD_PRIORITY], 0 + + /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ + sti + mov rcx, DISPATCH_LEVEL + mov cr8, rcx + + /* Set the right wait IRQL */ + mov byte ptr [rbx+KTHREAD_WAIT_IRQL], DISPATCH_LEVEL; + + /* Jump into the idle loop */ + jmp _KiIdleLoop +.endfunc diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index 5d16072155d..f1e7bd6757c 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -366,7 +366,6 @@ KiInitializePcr(IN ULONG ProcessorNumber, /* Start us out at PASSIVE_LEVEL */ // Pcr->Irql = PASSIVE_LEVEL; - KeSetCurrentIrql(PASSIVE_LEVEL); /* Set the GDI, IDT, TSS and DPC Stack */ Pcr->GdtBase = (PVOID)Gdt; @@ -387,7 +386,6 @@ KiInitializeKernel(IN PKPROCESS InitProcess, IN CCHAR Number, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - FrLdrDbgPrint("Enter KiInitializeKernel\n"); #if 0 BOOLEAN NpxPresent; ULONG FeatureBits; @@ -644,17 +642,6 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, (ULONG64)TssSelector.BaseUpper << 32); } -// Hack -VOID KiRosPrepareForSystemStartup(ULONG, PROS_LOADER_PARAMETER_BLOCK); - -VOID -NTAPI -KiSystemStartup(IN ULONG_PTR Dummy, - IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock) -{ - KiRosPrepareForSystemStartup(Dummy, LoaderBlock); -} - VOID NTAPI KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -753,15 +740,13 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); // RtlCopyMemory(&Idt[8], &DoubleFaultEntry, sizeof(KIDTENTRY)); } -#if 0 // FIXME: InterlockedBitTestAndSet64 is broken! It needs to be specified - // that it should reference an absolute address! + /* Loop until we can release the freeze lock */ do { /* Loop until execution can continue */ while (*(volatile PKSPIN_LOCK*)&KiFreezeExecutionLock == (PVOID)1); - } while(InterlockedBitTestAndSet64((PLONG64)&KiFreezeExecutionLock, 0)); -#endif + } while(InterlockedBitTestAndSet((PLONG)&KiFreezeExecutionLock, 0)); /* Setup CPU-related fields */ Pcr->Prcb.Number = Cpu; @@ -788,29 +773,16 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); KfRaiseIrql(HIGH_LEVEL); /* Align stack and make space for the trap frame and NPX frame */ - InitialStack &= ~(16 - 1); + InitialStack &= ~(KTRAP_FRAME_ALIGN - 1); - /* Switch to new kernel Stack */ - KiSwapStack(InitialStack); +FrLdrDbgPrint("Before KiSetupStackAndInitializeKernel\n"); +for(;;); - /* Initialize kernel */ - KiInitializeKernel(&KiInitialProcess.Pcb, - InitialThread, - (PVOID)InitialStack, - &Pcr->Prcb, - (CCHAR)Cpu, - KeLoaderBlock); - - /* Set the priority of this thread to 0 */ - InitialThread->Priority = 0; - - /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ - _enable(); - KeLowerIrql(DISPATCH_LEVEL); - - /* Set the right wait IRQL */ - InitialThread->WaitIrql = DISPATCH_LEVEL; - - /* Jump into the idle loop */ - KiIdleLoop(); + /* Switch to new kernel stack and start kernel bootstrapping */ + KiSetupStackAndInitializeKernel(&KiInitialProcess.Pcb, + InitialThread, + (PVOID)InitialStack, + &Pcr->Prcb, + (CCHAR)Cpu, + KeLoaderBlock); } diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S index 02145c03d73..5c43aae70ca 100644 --- a/reactos/ntoskrnl/ke/amd64/trap.S +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -13,23 +13,8 @@ .intel_syntax noprefix .code64 -#define KERNEL_STACK_SIZE 0x6000 - /* GLOBALS *******************************************************************/ -.bss -.align 16 - -/* Kernel Boot Stack */ -.globl _P0BootStack -.space KERNEL_STACK_SIZE -_P0BootStack: - -/* Kernel Double-Fault and Temporary DPC Stack */ -.globl _KiDoubleFaultStack -.space KERNEL_STACK_SIZE -_KiDoubleFaultStack: - .data _MsgGeneralProtFault: diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index 26b64a0e83a..3c010044f10 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -90,6 +90,7 @@ + boot.S cpu.c except.c irql.c From adc315d4ccdd8ccddd1df28062f007b9ba2c7746 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 22 Aug 2008 10:54:47 +0000 Subject: [PATCH 146/388] Fix _interlockedbittest intrinsics. For some strange reason they were working correctly on x86, the compiler seemed to know "what it means". But that doesn't work on amd64, here we need *a as "=m" operand, not a. svn path=/branches/ros-amd64-bringup/; revision=35525 --- reactos/include/psdk/intrin_x86.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 01d4d08dcce..1ee99d6fbb5 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -493,7 +493,7 @@ static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b) { unsigned char retval; - __asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory"); + __asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory"); return retval; } @@ -501,7 +501,7 @@ static __inline__ __attribute__((always_inline)) unsigned char _interlockedbitte static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset64(volatile long long * a, const long long b) { unsigned char retval; - __asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory"); + __asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory"); return retval; } #endif @@ -509,7 +509,7 @@ static __inline__ __attribute__((always_inline)) unsigned char _interlockedbitte static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset(volatile long * a, const long b) { unsigned char retval; - __asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory"); + __asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory"); return retval; } @@ -517,7 +517,7 @@ static __inline__ __attribute__((always_inline)) unsigned char _interlockedbitte static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset64(volatile long long * a, const long long b) { unsigned char retval; - __asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory"); + __asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory"); return retval; } #endif From cecff4323b86397a78b496221c119e4df576117b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 22 Aug 2008 11:13:51 +0000 Subject: [PATCH 147/388] Move KiSystemStartup again to kiinit.c, implement an intermediate function KiInitializeKernelAndGotoIdleLoop that is now called from the asm function KiSetupStackAndInitializeKernel. This way we avoid using "hardcoded" constants. svn path=/branches/ros-amd64-bringup/; revision=35526 --- reactos/ntoskrnl/ke/amd64/boot.S | 53 +++++++++------------------- reactos/ntoskrnl/ke/amd64/kiinit.c | 55 ++++++++++++++++++++++++++---- 2 files changed, 66 insertions(+), 42 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S index d3064c92b3d..ef33b63eb0a 100644 --- a/reactos/ntoskrnl/ke/amd64/boot.S +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -28,28 +28,18 @@ _P0BootStack: _KiDoubleFaultStack: /* FUNCTIONS *****************************************************************/ -.global _KiSystemStartup + .text -.func KiSystemStartup -_KiSystemStartup: - - /* NTLDR Boot: Call the main kernel initialization */ - test rcx, 0x80000000 - jnz _KiSystemStartupReal - - /* FREELDR Boot: Cal the FreeLDR wrapper */ - jmp _KiRosPrepareForSystemStartup -.endfunc /** * VOID * KiSetupStackAndInitializeKernel( - * esp+4 = ? -> rcx - * esp+8 = ? -> rdx - * PVOID pNewstack // esp+12 = new stack -> r8 - * esp+16 -> r9 - * esp+20 -> rsp + 8 - * esp+24 -> rsp + 16? + * IN PKPROCESS InitProcess, + * IN PKTHREAD InitThread, + * IN PVOID IdleStack, + * IN PKPRCB Prcb, + * IN CCHAR Number, + * IN PLOADER_PARAMETER_BLOCK LoaderBlock) */ .globl _KiSetupStackAndInitializeKernel .func KiSetupStackAndInitializeKernel @@ -60,27 +50,18 @@ _KiSetupStackAndInitializeKernel: /* Setup the new stack */ mov rsp, r8 - sub rsp, NPX_FRAME_LENGTH + KTRAP_FRAME_ALIGN + KTRAP_FRAME_LENGTH - push CR0_EM + CR0_TS + CR0_MP /* Copy stack parameters to the new stack */ - push [rsi + 16] - push [rsi + 8] - xor rbp, rbp - call _KiInitializeKernel + sub rsp, 0x38 + mov rdi, rsp + movsq + movsq + movsq + movsq + movsq + movsq + movsq - /* Set the priority of this thread to 0 */ - mov rbx, PCR[KPCR_CURRENT_THREAD] - mov byte ptr [rbx+KTHREAD_PRIORITY], 0 + jmp _KiInitializeKernelAndGotoIdleLoop - /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ - sti - mov rcx, DISPATCH_LEVEL - mov cr8, rcx - - /* Set the right wait IRQL */ - mov byte ptr [rbx+KTHREAD_WAIT_IRQL], DISPATCH_LEVEL; - - /* Jump into the idle loop */ - jmp _KiIdleLoop .endfunc diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index f1e7bd6757c..9bde7fb410a 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -366,6 +366,7 @@ KiInitializePcr(IN ULONG ProcessorNumber, /* Start us out at PASSIVE_LEVEL */ // Pcr->Irql = PASSIVE_LEVEL; + KeSetCurrentIrql(PASSIVE_LEVEL); /* Set the GDI, IDT, TSS and DPC Stack */ Pcr->GdtBase = (PVOID)Gdt; @@ -386,6 +387,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess, IN CCHAR Number, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { + FrLdrDbgPrint("Enter KiInitializeKernel\n"); #if 0 BOOLEAN NpxPresent; ULONG FeatureBits; @@ -642,6 +644,17 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, (ULONG64)TssSelector.BaseUpper << 32); } +// Hack +VOID KiRosPrepareForSystemStartup(ULONG, PROS_LOADER_PARAMETER_BLOCK); + +VOID +NTAPI +KiSystemStartup(IN ULONG_PTR Dummy, + IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock) +{ + KiRosPrepareForSystemStartup(Dummy, LoaderBlock); +} + VOID NTAPI KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -746,7 +759,7 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); { /* Loop until execution can continue */ while (*(volatile PKSPIN_LOCK*)&KiFreezeExecutionLock == (PVOID)1); - } while(InterlockedBitTestAndSet((PLONG)&KiFreezeExecutionLock, 0)); + } while(InterlockedBitTestAndSet64((PLONG64)&KiFreezeExecutionLock, 0)); /* Setup CPU-related fields */ Pcr->Prcb.Number = Cpu; @@ -772,11 +785,9 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); /* Raise to HIGH_LEVEL */ KfRaiseIrql(HIGH_LEVEL); - /* Align stack and make space for the trap frame and NPX frame */ - InitialStack &= ~(KTRAP_FRAME_ALIGN - 1); - -FrLdrDbgPrint("Before KiSetupStackAndInitializeKernel\n"); -for(;;); + /* Align stack and make space for the trap frame */ + InitialStack -= sizeof(KTRAP_FRAME) + 0x100; // FIXME + InitialStack &= ~(16 - 1); /* Switch to new kernel stack and start kernel bootstrapping */ KiSetupStackAndInitializeKernel(&KiInitialProcess.Pcb, @@ -786,3 +797,35 @@ for(;;); (CCHAR)Cpu, KeLoaderBlock); } + + +VOID +NTAPI +KiInitializeKernelAndGotoIdleLoop(IN PKPROCESS InitProcess, + IN PKTHREAD InitThread, + IN PVOID IdleStack, + IN PKPRCB Prcb, + IN CCHAR Number, + IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + /* Initialize kernel */ + KiInitializeKernel(InitProcess, + InitThread, + IdleStack, + Prcb, + Number, + KeLoaderBlock); + + /* Set the priority of this thread to 0 */ + InitThread->Priority = 0; + + /* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */ + _enable(); + KeLowerIrql(DISPATCH_LEVEL); + + /* Set the right wait IRQL */ + InitThread->WaitIrql = DISPATCH_LEVEL; + + /* Jump into the idle loop */ + KiIdleLoop(); +} From c5cef89ee945425ce37f18fd9bac14c69c827dda Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 22 Aug 2008 12:20:01 +0000 Subject: [PATCH 148/388] Fix handling of stack svn path=/branches/ros-amd64-bringup/; revision=35527 --- reactos/ntoskrnl/ke/amd64/boot.S | 1 + reactos/ntoskrnl/ke/amd64/kiinit.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S index ef33b63eb0a..cb3f393a999 100644 --- a/reactos/ntoskrnl/ke/amd64/boot.S +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -50,6 +50,7 @@ _KiSetupStackAndInitializeKernel: /* Setup the new stack */ mov rsp, r8 + sub rsp, 0x300 // FIXME /* Copy stack parameters to the new stack */ sub rsp, 0x38 diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index 9bde7fb410a..d784d7d7b0d 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -694,6 +694,9 @@ KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) InitialStack = LoaderBlock->KernelStack; // Chekme InitialThread = (PKTHREAD)LoaderBlock->Thread; + /* Align stack to 16 bytes */ + InitialStack &= ~(16 - 1); + /* Clean the APC List Head */ InitializeListHead(&InitialThread->ApcState.ApcListHead[KernelMode]); @@ -785,10 +788,6 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); /* Raise to HIGH_LEVEL */ KfRaiseIrql(HIGH_LEVEL); - /* Align stack and make space for the trap frame */ - InitialStack -= sizeof(KTRAP_FRAME) + 0x100; // FIXME - InitialStack &= ~(16 - 1); - /* Switch to new kernel stack and start kernel bootstrapping */ KiSetupStackAndInitializeKernel(&KiInitialProcess.Pcb, InitialThread, From 71d0b42136c7c23c1681cd29ba9f7bbbeee3da03 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 22 Aug 2008 13:06:39 +0000 Subject: [PATCH 149/388] LdrPEProcessImportDirectoryEntry: ULONG -> ULONG_PTR to fix imports. svn path=/branches/ros-amd64-bringup/; revision=35528 --- reactos/boot/freeldr/freeldr/reactos/imageldr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/reactos/imageldr.c b/reactos/boot/freeldr/freeldr/reactos/imageldr.c index 9aed1ed8e2d..7e985b7ff59 100644 --- a/reactos/boot/freeldr/freeldr/reactos/imageldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/imageldr.c @@ -348,7 +348,7 @@ LdrPEProcessImportDirectoryEntry(PVOID DriverBase, PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory) { PVOID* ImportAddressList; - PULONG FunctionNameList; + PULONG_PTR FunctionNameList; if (ImportModuleDirectory == NULL || ImportModuleDirectory->Name == 0) { @@ -361,11 +361,11 @@ LdrPEProcessImportDirectoryEntry(PVOID DriverBase, /* Get the list of functions to import. */ if (ImportModuleDirectory->OriginalFirstThunk != 0) { - FunctionNameList = (PULONG)RVA(DriverBase, ImportModuleDirectory->OriginalFirstThunk); + FunctionNameList = (PULONG_PTR)RVA(DriverBase, ImportModuleDirectory->OriginalFirstThunk); } else { - FunctionNameList = (PULONG)RVA(DriverBase, ImportModuleDirectory->FirstThunk); + FunctionNameList = (PULONG_PTR)RVA(DriverBase, ImportModuleDirectory->FirstThunk); } /* Walk through function list and fixup addresses. */ From a09e2d91b695e4d0057acaba9f5e7b51fe4abe4f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 23 Aug 2008 01:18:07 +0000 Subject: [PATCH 150/388] Fix __readmsr and __writemsr on amd64 svn path=/branches/ros-amd64-bringup/; revision=35546 --- reactos/include/psdk/intrin_x86.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 1ee99d6fbb5..5a268e6bb9d 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -1200,14 +1200,24 @@ static __inline__ __attribute__((always_inline)) void __invlpg(void * const Addr /*** System operations ***/ static __inline__ __attribute__((always_inline)) unsigned long long __readmsr(const int reg) { +#ifdef _M_AMD64 + unsigned long low, high; + __asm__ __volatile__("rdmsr" : "=a" (low), "=d" (high) : "c" (reg)); + return (high << 32) | low; +#else unsigned long long retval; __asm__ __volatile__("rdmsr" : "=A" (retval) : "c" (reg)); return retval; +#endif } static __inline__ __attribute__((always_inline)) void __writemsr(const unsigned long Register, const unsigned long long Value) { +#ifdef _M_AMD64 + __asm__ __volatile__("wrmsr" : : "a" (Value), "d" (Value >> 32), "c" (Register)); +#else __asm__ __volatile__("wrmsr" : : "A" (Value), "c" (Register)); +#endif } static __inline__ __attribute__((always_inline)) unsigned long long __readpmc(const int counter) From 8082ce88e510f74ad7ab6465b9b3439d9ed7e555 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 23 Aug 2008 01:19:34 +0000 Subject: [PATCH 151/388] Setup KUSER_SHARED_DATA. svn path=/branches/ros-amd64-bringup/; revision=35547 --- reactos/boot/freeldr/freeldr/arch/amd64/loader.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 59127de3e13..2744e7e38ea 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -198,6 +198,7 @@ FASTCALL FrLdrSetupPageDirectory(VOID) { ULONG KernelPages; + PVOID UserSharedData; /* Allocate a Page for the PML4 */ pPML4 = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory); @@ -238,9 +239,15 @@ FrLdrSetupPageDirectory(VOID) TssBase = GdtBase + 20 * sizeof(ULONG64); // FIXME: don't hardcode if (!FrLdrMapSinglePage(GdtBase, (ULONGLONG)pGdt)) { - DbgPrint("Could not map idt page.\n", KernelPages); + DbgPrint("Could not map gdt page.\n", KernelPages); } + /* Setup KUSER_SHARED_DATA page */ + UserSharedData = MmAllocateMemoryWithType(PAGE_SIZE, LoaderSpecialMemory); + if (!FrLdrMapSinglePage(KI_USER_SHARED_DATA, (ULONG64)UserSharedData)) + { + DbgPrint("Could not map KUSER_SHARED_DATA page.\n", KernelPages); + } } From 5190b9223266d4d55b95a2a8455e2aa48cf4ad14 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 23 Aug 2008 01:31:51 +0000 Subject: [PATCH 152/388] Fix Ke386SaveFlags and Ke386RestoreFlags. Rename KIDT_INIT's 3rd member to IstIndex and use it in KeInitExceptions. svn path=/branches/ros-amd64-bringup/; revision=35548 --- reactos/ntoskrnl/include/internal/amd64/intrin_i.h | 4 ++-- reactos/ntoskrnl/include/internal/amd64/ke.h | 2 +- reactos/ntoskrnl/ke/amd64/except.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h index a09c4acdc31..908d2eea9a7 100644 --- a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -48,8 +48,8 @@ : /* no outputs */ \ : "m" (X)); -#define Ke386SaveFlags(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */) -#define Ke386RestoreFlags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") +#define Ke386SaveFlags(x) __asm__ __volatile__("pushfq ; popq %0":"=g" (x): /* no input */) +#define Ke386RestoreFlags(x) __asm__ __volatile__("pushq %0 ; popfq": /* no output */ :"g" (x):"memory") #define _Ke386GetSeg(N) ({ \ unsigned int __d; \ diff --git a/reactos/ntoskrnl/include/internal/amd64/ke.h b/reactos/ntoskrnl/include/internal/amd64/ke.h index 39cbbfc21ef..42a5a353ae5 100644 --- a/reactos/ntoskrnl/include/internal/amd64/ke.h +++ b/reactos/ntoskrnl/include/internal/amd64/ke.h @@ -54,7 +54,7 @@ typedef struct _KIDT_INIT { UCHAR InterruptId; UCHAR Dpl; - UCHAR Type; + UCHAR IstIndex; PVOID ServiceRoutine; } KIDT_INIT, *PKIDT_INIT; diff --git a/reactos/ntoskrnl/ke/amd64/except.c b/reactos/ntoskrnl/ke/amd64/except.c index 1de3a70a6b6..c21905471be 100644 --- a/reactos/ntoskrnl/ke/amd64/except.c +++ b/reactos/ntoskrnl/ke/amd64/except.c @@ -42,7 +42,7 @@ KIDT_INIT KiInterruptInitTable[] = {0x2D, 0x03, 0x00, KiDebugServiceTrap}, {0x2F, 0x00, 0x00, KiDpcInterrupt}, {0xE1, 0x00, 0x00, KiIpiInterrupt}, - {0, 0} + {0, 0, 0, 0} }; KIDTENTRY64 KiIdt[256]; @@ -68,17 +68,18 @@ KeInitExceptions(VOID) { Offset = (ULONG64)KiInterruptInitTable[j].ServiceRoutine; KiIdt[i].Dpl = KiInterruptInitTable[j].Dpl; + KiIdt[i].IstIndex = KiInterruptInitTable[j].IstIndex; j++; } else { Offset = (ULONG64)KiUnexpectedInterrupt; KiIdt[i].Dpl = 0; + KiIdt[i].IstIndex = 0; } KiIdt[i].OffsetLow = Offset & 0xffff; KiIdt[i].Selector = KGDT_64_R0_CODE; KiIdt[i].Type = 0x0e; - KiIdt[i].IstIndex = 0; KiIdt[i].Reserved0 = 0; KiIdt[i].Present = 1; KiIdt[i].OffsetMiddle = (Offset >> 16) & 0xffff; From 4e33928816b7cbd430d9046e3336311a5dc70460 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 23 Aug 2008 02:11:09 +0000 Subject: [PATCH 153/388] Implement KiSetProcessorType, KiGetCpuVendor, KiGetFeatureBits, KiGetCacheInformation, KiSetCr0Bits and KiInitializeTss based on x86 implementation. Fix and enable Code in KiInitalizeKernel, enable call to HalInitializeProcessor. svn path=/branches/ros-amd64-bringup/; revision=35549 --- reactos/ntoskrnl/include/internal/amd64/ke.h | 3 +- reactos/ntoskrnl/ke/amd64/cpu.c | 463 ++++++++++++++++++- reactos/ntoskrnl/ke/amd64/kiinit.c | 60 +-- 3 files changed, 475 insertions(+), 51 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/ke.h b/reactos/ntoskrnl/include/internal/amd64/ke.h index 42a5a353ae5..fc830fa95d8 100644 --- a/reactos/ntoskrnl/include/internal/amd64/ke.h +++ b/reactos/ntoskrnl/include/internal/amd64/ke.h @@ -75,7 +75,8 @@ FASTCALL Ki386InitializeTss( IN PKTSS Tss, IN PKIDTENTRY Idt, - IN PKGDTENTRY Gdt + IN PKGDTENTRY Gdt, + IN UINT64 Stack ); VOID KiDivideErrorFault(); diff --git a/reactos/ntoskrnl/ke/amd64/cpu.c b/reactos/ntoskrnl/ke/amd64/cpu.c index 4e49b13e67c..6259094a6fa 100644 --- a/reactos/ntoskrnl/ke/amd64/cpu.c +++ b/reactos/ntoskrnl/ke/amd64/cpu.c @@ -12,32 +12,475 @@ #define NDEBUG #include +/* FIXME: Local EFLAGS defines not used anywhere else */ +#define EFLAGS_IOPL 0x3000 +#define EFLAGS_NF 0x4000 +#define EFLAGS_RF 0x10000 +#define EFLAGS_ID 0x200000 + /* GLOBALS *******************************************************************/ /* The Boot TSS */ KTSS64 KiBootTss; -/* The TSS to use for Double Fault Traps (INT 0x9) */ -UCHAR KiDoubleFaultTSS[KTSS_IO_MAPS]; - -/* The TSS to use for NMI Fault Traps (INT 0x2) */ -UCHAR KiNMITSS[KTSS_IO_MAPS]; - /* CPU Features and Flags */ +ULONG KeI386CpuType; +ULONG KeI386CpuStep; ULONG KeI386MachineType; - +ULONG KeI386NpxPresent = 1; +ULONG KeI386XMMIPresent = 0; +ULONG KeI386FxsrPresent = 0; CHAR KeNumberProcessors = 0; +BOOLEAN KiI386PentiumLockErrataPresent; +BOOLEAN KiSMTProcessorsPresent; + +/* CPU Signatures */ +static const CHAR CmpIntelID[] = "GenuineIntel"; +static const CHAR CmpAmdID[] = "AuthenticAMD"; +static const CHAR CmpCyrixID[] = "CyrixInstead"; +static const CHAR CmpTransmetaID[] = "GenuineTMx86"; +static const CHAR CmpCentaurID[] = "CentaurHauls"; +static const CHAR CmpRiseID[] = "RiseRiseRise"; /* FUNCTIONS *****************************************************************/ +VOID +NTAPI +KiSetProcessorType(VOID) +{ + ULONG64 EFlags; + int Reg[4]; + ULONG Stepping, Type; + + /* Start by assuming no CPUID data */ + KeGetCurrentPrcb()->CpuID = 0; + + /* Save EFlags */ + Ke386SaveFlags(EFlags); + + /* Do CPUID 1 now */ + __cpuid(Reg, 1); + + /* + * Get the Stepping and Type. The stepping contains both the + * Model and the Step, while the Type contains the returned Type. + * We ignore the family. + * + * For the stepping, we convert this: zzzzzzxy into this: x0y + */ + Stepping = Reg[0] & 0xF0; + Stepping <<= 4; + Stepping += (Reg[0] & 0xFF); + Stepping &= 0xF0F; + Type = Reg[0] & 0xF00; + Type >>= 8; + + /* Save them in the PRCB */ + KeGetCurrentPrcb()->CpuID = TRUE; + KeGetCurrentPrcb()->CpuType = (UCHAR)Type; + KeGetCurrentPrcb()->CpuStep = (USHORT)Stepping; + + /* Restore EFLAGS */ + Ke386RestoreFlags(EFlags); +} + +ULONG +NTAPI +KiGetCpuVendor(VOID) +{ + PKPRCB Prcb = KeGetCurrentPrcb(); + ULONG Vendor[5]; + ULONG Temp; + + /* Assume no Vendor ID and fail if no CPUID Support. */ + Prcb->VendorString[0] = 0; + if (!Prcb->CpuID) return 0; + + /* Get the Vendor ID and null-terminate it */ + __cpuid(Vendor, 0); + Vendor[4] = 0; + + /* Re-arrange vendor string */ + Temp = Vendor[2]; + Vendor[2] = Vendor[3]; + Vendor[3] = Temp; + + /* Copy it to the PRCB and null-terminate it again */ + RtlCopyMemory(Prcb->VendorString, + &Vendor[1], + sizeof(Prcb->VendorString) - sizeof(CHAR)); + Prcb->VendorString[sizeof(Prcb->VendorString) - sizeof(CHAR)] = ANSI_NULL; + + /* Now check the CPU Type */ + if (!strcmp(Prcb->VendorString, CmpIntelID)) + { + return CPU_INTEL; + } + else if (!strcmp(Prcb->VendorString, CmpAmdID)) + { + return CPU_AMD; + } + else if (!strcmp(Prcb->VendorString, CmpCyrixID)) + { + DPRINT1("Cyrix CPUs not fully supported\n"); + return 0; + } + else if (!strcmp(Prcb->VendorString, CmpTransmetaID)) + { + DPRINT1("Transmeta CPUs not fully supported\n"); + return 0; + } + else if (!strcmp(Prcb->VendorString, CmpCentaurID)) + { + DPRINT1("VIA CPUs not fully supported\n"); + return 0; + } + else if (!strcmp(Prcb->VendorString, CmpRiseID)) + { + DPRINT1("Rise CPUs not fully supported\n"); + return 0; + } + + /* Invalid CPU */ + return 0; +} + +ULONG +NTAPI +KiGetFeatureBits(VOID) +{ + PKPRCB Prcb = KeGetCurrentPrcb(); + ULONG Vendor; + ULONG FeatureBits = KF_WORKING_PTE; + ULONG Reg[4]; + BOOLEAN ExtendedCPUID = TRUE; + ULONG CpuFeatures = 0; + + /* Get the Vendor ID */ + Vendor = KiGetCpuVendor(); + + /* Make sure we got a valid vendor ID at least. */ + if (!Vendor) return FeatureBits; + + /* Get the CPUID Info. Features are in Reg[3]. */ + __cpuid(Reg, 1); + + /* Set the initial APIC ID */ + Prcb->InitialApicId = (UCHAR)(Reg[1] >> 24); + + /* Check for AMD CPU */ + if (Vendor == CPU_AMD) + { + /* Check if this is a K5 or higher. */ + if ((Reg[0] & 0x0F00) >= 0x0500) + { + /* Check if this is a K5 specifically. */ + if ((Reg[0] & 0x0F00) == 0x0500) + { + /* Get the Model Number */ + switch (Reg[0] & 0x00F0) + { + /* Check if this is the Model 1 */ + case 0x0010: + + /* Check if this is Step 0 or 1. They don't support PGE */ + if ((Reg[0] & 0x000F) > 0x03) break; + + case 0x0000: + + /* Model 0 doesn't support PGE at all. */ + Reg[3] &= ~0x2000; + break; + + case 0x0080: + + /* K6-2, Step 8 and over have support for MTRR. */ + if ((Reg[0] & 0x000F) >= 0x8) FeatureBits |= KF_AMDK6MTRR; + break; + + case 0x0090: + + /* As does the K6-3 */ + FeatureBits |= KF_AMDK6MTRR; + break; + + default: + break; + } + } + } + else + { + /* Families below 5 don't support PGE, PSE or CMOV at all */ + Reg[3] &= ~(0x08 | 0x2000 | 0x8000); + + /* They also don't support advanced CPUID functions. */ + ExtendedCPUID = FALSE; + } + + /* Set the current features */ + CpuFeatures = Reg[3]; + } + + /* Now check if this is Intel */ + if (Vendor == CPU_INTEL) + { + /* Check if it's a P6 */ + if (Prcb->CpuType == 6) + { + /* Perform the special sequence to get the MicroCode Signature */ + __writemsr(0x8B, 0); + __writemsr(Reg, 1); + Prcb->UpdateSignature.QuadPart = __readmsr(0x8B); + } + else if (Prcb->CpuType == 5) + { + /* On P5, enable workaround for the LOCK errata. */ + KiI386PentiumLockErrataPresent = TRUE; + } + + /* Check for broken P6 with bad SMP PTE implementation */ + if (((Reg[0] & 0x0FF0) == 0x0610 && (Reg[0] & 0x000F) <= 0x9) || + ((Reg[0] & 0x0FF0) == 0x0630 && (Reg[0] & 0x000F) <= 0x4)) + { + /* Remove support for correct PTE support. */ + FeatureBits &= ~KF_WORKING_PTE; + } + + /* Check if the CPU is too old to support SYSENTER */ + if ((Prcb->CpuType < 6) || + ((Prcb->CpuType == 6) && (Prcb->CpuStep < 0x0303))) + { + /* Disable it */ + Reg[3] &= ~0x800; + } + + /* Set the current features */ + CpuFeatures = Reg[3]; + } + + /* Convert all CPUID Feature bits into our format */ + if (CpuFeatures & 0x00000002) FeatureBits |= KF_V86_VIS | KF_CR4; + if (CpuFeatures & 0x00000008) FeatureBits |= KF_LARGE_PAGE | KF_CR4; + if (CpuFeatures & 0x00000010) FeatureBits |= KF_RDTSC; + if (CpuFeatures & 0x00000100) FeatureBits |= KF_CMPXCHG8B; + if (CpuFeatures & 0x00000800) FeatureBits |= KF_FAST_SYSCALL; + if (CpuFeatures & 0x00001000) FeatureBits |= KF_MTRR; + if (CpuFeatures & 0x00002000) FeatureBits |= KF_GLOBAL_PAGE | KF_CR4; + if (CpuFeatures & 0x00008000) FeatureBits |= KF_CMOV; + if (CpuFeatures & 0x00010000) FeatureBits |= KF_PAT; + if (CpuFeatures & 0x00200000) FeatureBits |= KF_DTS; + if (CpuFeatures & 0x00800000) FeatureBits |= KF_MMX; + if (CpuFeatures & 0x01000000) FeatureBits |= KF_FXSR; + if (CpuFeatures & 0x02000000) FeatureBits |= KF_XMMI; + if (CpuFeatures & 0x04000000) FeatureBits |= KF_XMMI64; + + /* Check if the CPU has hyper-threading */ + if (CpuFeatures & 0x10000000) + { + /* Set the number of logical CPUs */ + Prcb->LogicalProcessorsPerPhysicalProcessor = (UCHAR)(Reg[1] >> 16); + if (Prcb->LogicalProcessorsPerPhysicalProcessor > 1) + { + /* We're on dual-core */ + KiSMTProcessorsPresent = TRUE; + } + } + else + { + /* We only have a single CPU */ + Prcb->LogicalProcessorsPerPhysicalProcessor = 1; + } + + /* Check if CPUID 0x80000000 is supported */ + if (ExtendedCPUID) + { + /* Do the call */ + __cpuid(Reg, 0x80000000); + if ((Reg[0] & 0xffffff00) == 0x80000000) + { + /* Check if CPUID 0x80000001 is supported */ + if (Reg[0] >= 0x80000001) + { + /* Check which extended features are available. */ + __cpuid(Reg, 0x80000001); + + /* Check if NX-bit is supported */ + if (Reg[3] & 0x00100000) FeatureBits |= KF_NX_BIT; + + /* Now handle each features for each CPU Vendor */ + switch (Vendor) + { + case CPU_AMD: + if (Reg[3] & 0x80000000) FeatureBits |= KF_3DNOW; + break; + } + } + } + } + + /* Return the Feature Bits */ + return FeatureBits; +} + +VOID +NTAPI +KiGetCacheInformation(VOID) +{ + PKIPCR Pcr = (PKIPCR)KeGetPcr(); + ULONG Vendor; + ULONG Data[4]; + ULONG CacheRequests = 0, i; + ULONG CurrentRegister; + UCHAR RegisterByte; + BOOLEAN FirstPass = TRUE; + + /* Set default L2 size */ + Pcr->SecondLevelCacheSize = 0; + + /* Get the Vendor ID and make sure we support CPUID */ + Vendor = KiGetCpuVendor(); + if (!Vendor) return; + + /* Check the Vendor ID */ + switch (Vendor) + { + /* Handle Intel case */ + case CPU_INTEL: + + /*Check if we support CPUID 2 */ + __cpuid(Data, 0); + if (Data[0] >= 2) + { + /* We need to loop for the number of times CPUID will tell us to */ + do + { + /* Do the CPUID call */ + __cpuid(Data, 2); + + /* Check if it was the first call */ + if (FirstPass) + { + /* + * The number of times to loop is the first byte. Read + * it and then destroy it so we don't get confused. + */ + CacheRequests = Data[0] & 0xFF; + Data[0] &= 0xFFFFFF00; + + /* Don't go over this again */ + FirstPass = FALSE; + } + + /* Loop all 4 registers */ + for (i = 0; i < 4; i++) + { + /* Get the current register */ + CurrentRegister = Data[i]; + + /* + * If the upper bit is set, then this register should + * be skipped. + */ + if (CurrentRegister & 0x80000000) continue; + + /* Keep looping for every byte inside this register */ + while (CurrentRegister) + { + /* Read a byte, skip a byte. */ + RegisterByte = (UCHAR)(CurrentRegister & 0xFF); + CurrentRegister >>= 8; + if (!RegisterByte) continue; + + /* + * Valid values are from 0x40 (0 bytes) to 0x49 + * (32MB), or from 0x80 to 0x89 (same size but + * 8-way associative. + */ + if (((RegisterByte > 0x40) && + (RegisterByte <= 0x49)) || + ((RegisterByte > 0x80) && + (RegisterByte <= 0x89))) + { + /* Mask out only the first nibble */ + RegisterByte &= 0x0F; + + /* Set the L2 Cache Size */ + Pcr->SecondLevelCacheSize = 0x10000 << + RegisterByte; + } + } + } + } while (--CacheRequests); + } + break; + + case CPU_AMD: + + /* Check if we support CPUID 0x80000006 */ + __cpuid(Data, 0x80000000); + if (Data[0] >= 6) + { + /* Get 2nd level cache and tlb size */ + __cpuid(Data, 0x80000006); + + /* Set the L2 Cache Size */ + Pcr->SecondLevelCacheSize = (Data[2] & 0xFFFF0000) >> 6; + } + break; + } +} + + +VOID +NTAPI +KiSetCR0Bits(VOID) +{ + ULONG64 Cr0; + + /* Save current CR0 */ + Cr0 = __readcr0(); + + /* If this is a 486, enable Write-Protection */ + if (KeGetCurrentPrcb()->CpuType > 3) Cr0 |= CR0_WP; + + /* Set new Cr0 */ + __writecr0(Cr0); +} + VOID FASTCALL -Ki386InitializeTss(IN PKTSS Tss, +Ki386InitializeTss(IN PKTSS64 Tss, IN PKIDTENTRY Idt, - IN PKGDTENTRY Gdt) + IN PKGDTENTRY Gdt, + IN UINT64 Stack) { - // UNIMPLEMENTED; + PKGDTENTRY TssEntry; + + /* Initialize the boot TSS entry */ + TssEntry = &Gdt[KGDT_TSS / sizeof(KGDTENTRY)]; + TssEntry->Bits.Type = I386_TSS; + TssEntry->Bits.Present = 1; + TssEntry->Bits.Dpl = 0; + + /* FIXME: I/O Map */ + + /* Load the task register */ + Ke386SetTr(KGDT_TSS); + + /* Setup stack pointer */ + Tss->Rsp0 = Stack; + + /* Setup a stack for Double Fault Traps */ + Tss->Ist[1] = PtrToUlong(KiDoubleFaultStack); + + /* Setup a stack for CheckAbort Traps */ + Tss->Ist[2] = PtrToUlong(KiDoubleFaultStack); + + /* Setup a stack for NMI Traps */ + Tss->Ist[3] = PtrToUlong(KiDoubleFaultStack); + } VOID diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index d784d7d7b0d..116c77bbd58 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -374,6 +374,8 @@ KiInitializePcr(IN ULONG ProcessorNumber, Pcr->TssBase = Tss; Pcr->Prcb.DpcStack = DpcStack; + Pcr->Prcb.RspBase = Tss->Rsp0; + /* Setup the processor set */ Pcr->Prcb.MultiThreadProcessorSet = Pcr->Prcb.SetMember; } @@ -387,13 +389,10 @@ KiInitializeKernel(IN PKPROCESS InitProcess, IN CCHAR Number, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - FrLdrDbgPrint("Enter KiInitializeKernel\n"); -#if 0 BOOLEAN NpxPresent; ULONG FeatureBits; - LARGE_INTEGER PageDirectory; + ULONG PageDirectory[2]; PVOID DpcStack; - ULONG Vendor[3]; /* Detect and set the CPU Type */ KiSetProcessorType(); @@ -401,14 +400,8 @@ KiInitializeKernel(IN PKPROCESS InitProcess, /* Set CR0 features based on detected CPU */ KiSetCR0Bits(); - /* Check if an FPU is present */ - NpxPresent = KiIsNpxPresent(); - /* Initialize the Power Management Support for this PRCB */ - PoInitializePrcb(Prcb); - - /* Bugcheck if this is a 386 CPU */ - if (Prcb->CpuType == 3) KeBugCheckEx(0x5D, 0x386, 0, 0, 0); +// PoInitializePrcb(Prcb); /* Get the processor features for the CPU */ FeatureBits = KiGetFeatureBits(); @@ -456,7 +449,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess, KiInitSpinLocks(Prcb, Number); /* Check if this is the Boot CPU */ - if (!Number) + if (Number == 0) { /* Set Node Data */ KeNodeBlock[0] = &KiNode0; @@ -474,20 +467,6 @@ KiInitializeKernel(IN PKPROCESS InitProcess, KeI386FxsrPresent = (KeFeatureBits & KF_FXSR) ? TRUE : FALSE; KeI386XMMIPresent = (KeFeatureBits & KF_XMMI) ? TRUE : FALSE; - /* Detect 8-byte compare exchange support */ - if (!(KeFeatureBits & KF_CMPXCHG8B)) - { - /* Copy the vendor string */ - RtlCopyMemory(Vendor, Prcb->VendorString, sizeof(Vendor)); - - /* Bugcheck the system. Windows *requires* this */ - KeBugCheckEx(0x5D, - (1 << 24 ) | (Prcb->CpuType << 16) | Prcb->CpuStep, - Vendor[0], - Vendor[1], - Vendor[2]); - } - /* Set the current MP Master KPRCB to the Boot PRCB */ Prcb->MultiThreadSetMaster = Prcb; @@ -503,11 +482,12 @@ KiInitializeKernel(IN PKPROCESS InitProcess, /* Initialize the Idle Process and the Process Listhead */ InitializeListHead(&KiProcessListHead); - PageDirectory.QuadPart = 0; + PageDirectory[0] = 0; + PageDirectory[1] = 0; KeInitializeProcess(InitProcess, 0, 0xFFFFFFFF, - &PageDirectory, + PageDirectory, FALSE); InitProcess->QuantumReset = MAXCHAR; } @@ -516,7 +496,8 @@ KiInitializeKernel(IN PKPROCESS InitProcess, /* FIXME */ DPRINT1("SMP Boot support not yet present\n"); } - +FrLdrDbgPrint("before KeInitializeThread\n"); +for(;;); /* Setup the Idle Thread */ KeInitializeThread(InitProcess, InitThread, @@ -577,14 +558,14 @@ KiInitializeKernel(IN PKPROCESS InitProcess, Prcb->DpcStack = DpcStack; /* Allocate the IOPM save area. */ - Ki386IopmSaveArea = ExAllocatePoolWithTag(PagedPool, - PAGE_SIZE * 2, - TAG('K', 'e', ' ', ' ')); - if (!Ki386IopmSaveArea) - { - /* Bugcheck. We need this for V86/VDM support. */ - KeBugCheckEx(NO_PAGES_AVAILABLE, 2, PAGE_SIZE * 2, 0, 0); - } +// Ki386IopmSaveArea = ExAllocatePoolWithTag(PagedPool, +// PAGE_SIZE * 2, +// TAG('K', 'e', ' ', ' ')); +// if (!Ki386IopmSaveArea) +// { +// /* Bugcheck. We need this for V86/VDM support. */ +// KeBugCheckEx(NO_PAGES_AVAILABLE, 2, PAGE_SIZE * 2, 0, 0); +// } } /* Raise to Dispatch */ @@ -601,7 +582,6 @@ KiInitializeKernel(IN PKPROCESS InitProcess, /* Raise back to HIGH_LEVEL and clear the PRCB for the loader block */ KfRaiseIrql(HIGH_LEVEL); LoaderBlock->Prcb = 0; -#endif } VOID @@ -712,7 +692,7 @@ KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); /* Setup the TSS descriptors and entries */ - Ki386InitializeTss(Tss, Idt, Gdt); + Ki386InitializeTss(Tss, Idt, Gdt, InitialStack); /* Initialize the PCR */ RtlZeroMemory(Pcr, PAGE_SIZE); @@ -769,7 +749,7 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); Pcr->Prcb.SetMember = 1 << Cpu; /* Initialize the Processor with HAL */ -// HalInitializeProcessor(Cpu, KeLoaderBlock); + HalInitializeProcessor(Cpu, KeLoaderBlock); /* Set active processors */ KeActiveProcessors |= 1 << Cpu; From 008f57628210e90b6f292a2882a7c2852ee1ff1b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 24 Aug 2008 02:41:12 +0000 Subject: [PATCH 154/388] stub out SEH, for real this time ;-) svn path=/branches/ros-amd64-bringup/; revision=35586 --- reactos/include/reactos/libs/pseh/framebased.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/reactos/libs/pseh/framebased.h b/reactos/include/reactos/libs/pseh/framebased.h index 4d74292105c..dde90f1522c 100644 --- a/reactos/include/reactos/libs/pseh/framebased.h +++ b/reactos/include/reactos/libs/pseh/framebased.h @@ -172,7 +172,7 @@ static _SEHPortableTryLevel_t * const _SEHPortableTryLevel = 0; STMT_; \ } -#if defined(_ARM_) || defined(_x86_64) +#if defined(_ARM_) || defined(_M_AMD64) #define _SEH_TRY \ for(;;) \ From e73537a4e7a1c861e7181b14c2bb1cd8f27d200a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 24 Aug 2008 02:44:29 +0000 Subject: [PATCH 155/388] Fix __readgsqword, it was using a long internally. Add volatile keyword to segment addressing intrinsics. Add "memory" to clobber list on all those that do write. svn path=/branches/ros-amd64-bringup/; revision=35587 --- reactos/include/psdk/intrin_x86.h | 66 +++++++++++++++---------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 5a268e6bb9d..e5495767c09 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -589,168 +589,168 @@ static __inline__ __attribute__((always_inline)) void __movsd(unsigned long * De static __inline__ __attribute__((always_inline)) void __writegsbyte(const unsigned long Offset, const unsigned char Data) { - __asm__("movb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("movb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __writegsword(const unsigned long Offset, const unsigned short Data) { - __asm__("movw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("movw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __writegsdword(const unsigned long Offset, const unsigned long Data) { - __asm__("movl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("movl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __writegsqword(const unsigned long Offset, const unsigned __int64 Data) { - __asm__("movq %q[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("movq %q[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) unsigned char __readgsbyte(const unsigned long Offset) { unsigned char value; - __asm__("movb %%gs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movb %%gs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } static __inline__ __attribute__((always_inline)) unsigned short __readgsword(const unsigned long Offset) { unsigned short value; - __asm__("movw %%gs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movw %%gs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } static __inline__ __attribute__((always_inline)) unsigned long __readgsdword(const unsigned long Offset) { unsigned long value; - __asm__("movl %%gs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movl %%gs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } static __inline__ __attribute__((always_inline)) unsigned __int64 __readgsqword(const unsigned long Offset) { - unsigned long value; - __asm__("movq %%gs:%a[Offset], %q[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + unsigned __int64 value; + __asm__ __volatile__("movq %%gs:%a[Offset], %q[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } static __inline__ __attribute__((always_inline)) void __incgsbyte(const unsigned long Offset) { - __asm__("incb %%gs:%a[Offset]" : : [Offset] "ir" (Offset)); + __asm__ __volatile__("incb %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } static __inline__ __attribute__((always_inline)) void __incgsword(const unsigned long Offset) { - __asm__("incw %%gs:%a[Offset]" : : [Offset] "ir" (Offset)); + __asm__ __volatile__("incw %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } static __inline__ __attribute__((always_inline)) void __incgsdword(const unsigned long Offset) { - __asm__("incl %%gs:%a[Offset]" : : [Offset] "ir" (Offset)); + __asm__ __volatile__("incl %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } /* NOTE: the bizarre implementation of __addgsxxx mimics the broken Visual C++ behavior */ static __inline__ __attribute__((always_inline)) void __addgsbyte(const unsigned long Offset, const unsigned char Data) { if(!__builtin_constant_p(Offset)) - __asm__("addb %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset)); + __asm__ __volatile__("addb %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else - __asm__("addb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("addb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __addgsword(const unsigned long Offset, const unsigned short Data) { if(!__builtin_constant_p(Offset)) - __asm__("addw %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset)); + __asm__ __volatile__("addw %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else - __asm__("addw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("addw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __addgsdword(const unsigned long Offset, const unsigned int Data) { if(!__builtin_constant_p(Offset)) - __asm__("addl %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset)); + __asm__ __volatile__("addl %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else - __asm__("addl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("addl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } #else /*** FS segment addressing ***/ static __inline__ __attribute__((always_inline)) void __writefsbyte(const unsigned long Offset, const unsigned char Data) { - __asm__("movb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("movb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __writefsword(const unsigned long Offset, const unsigned short Data) { - __asm__("movw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("movw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __writefsdword(const unsigned long Offset, const unsigned long Data) { - __asm__("movl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("movl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) unsigned char __readfsbyte(const unsigned long Offset) { unsigned char value; - __asm__("movb %%fs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movb %%fs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset) : "memory"); return value; } static __inline__ __attribute__((always_inline)) unsigned short __readfsword(const unsigned long Offset) { unsigned short value; - __asm__("movw %%fs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movw %%fs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } static __inline__ __attribute__((always_inline)) unsigned long __readfsdword(const unsigned long Offset) { unsigned long value; - __asm__("movl %%fs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); + __asm__ __volatile__("movl %%fs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset)); return value; } static __inline__ __attribute__((always_inline)) void __incfsbyte(const unsigned long Offset) { - __asm__("incb %%fs:%a[Offset]" : : [Offset] "ir" (Offset)); + __asm__ __volatile__("incb %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } static __inline__ __attribute__((always_inline)) void __incfsword(const unsigned long Offset) { - __asm__("incw %%fs:%a[Offset]" : : [Offset] "ir" (Offset)); + __asm__ __volatile__("incw %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } static __inline__ __attribute__((always_inline)) void __incfsdword(const unsigned long Offset) { - __asm__("incl %%fs:%a[Offset]" : : [Offset] "ir" (Offset)); + __asm__ __volatile__("incl %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } /* NOTE: the bizarre implementation of __addfsxxx mimics the broken Visual C++ behavior */ static __inline__ __attribute__((always_inline)) void __addfsbyte(const unsigned long Offset, const unsigned char Data) { if(!__builtin_constant_p(Offset)) - __asm__("addb %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset)); + __asm__ __volatile__("addb %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else - __asm__("addb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("addb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __addfsword(const unsigned long Offset, const unsigned short Data) { if(!__builtin_constant_p(Offset)) - __asm__("addw %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset)); + __asm__ __volatile__("addw %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else - __asm__("addw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("addw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __addfsdword(const unsigned long Offset, const unsigned int Data) { if(!__builtin_constant_p(Offset)) - __asm__("addl %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset)); + __asm__ __volatile__("addl %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); else - __asm__("addl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data)); + __asm__ __volatile__("addl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } #endif From 2e60f5db4f80e19e27db19eea06679cccd622355 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 24 Aug 2008 02:47:44 +0000 Subject: [PATCH 156/388] Fix KeGetCurrentPrcb() svn path=/branches/ros-amd64-bringup/; revision=35588 --- reactos/include/ndk/amd64/ketypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index be6cee6d7eb..82f7940a385 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -794,7 +794,7 @@ FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID) { - return (struct _KPRCB *)(ULONG_PTR)__readgsqword(FIELD_OFFSET(KIPCR, Prcb)); + return (struct _KPRCB *)__readgsqword(FIELD_OFFSET(KIPCR, CurrentPrcb)); } #endif From 427feb9557cb621568db77b65175ffe4e6076e17 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 24 Aug 2008 23:40:42 +0000 Subject: [PATCH 157/388] merge __readcr and __writecr x86 / x64 definitions, because they are the same. Implement __readdr and __writedr for x64. svn path=/branches/ros-amd64-bringup/; revision=35616 --- reactos/include/psdk/intrin_x86.h | 177 +++++++++++++++++------------- 1 file changed, 100 insertions(+), 77 deletions(-) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index e5495767c09..b528735cb75 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -1089,106 +1089,129 @@ static __inline__ __attribute__((always_inline)) void _enable(void) /*** Protected memory management ***/ +static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned __int64 Data) +{ + __asm__("mov %[Data], %%cr0" : : [Data] "q" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned __int64 Data) +{ + __asm__("mov %[Data], %%cr3" : : [Data] "q" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned __int64 Data) +{ + __asm__("mov %[Data], %%cr4" : : [Data] "q" (Data) : "memory"); +} + #ifdef _M_AMD64 -static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) +static __inline__ __attribute__((always_inline)) void __writecr8(const unsigned __int64 Data) { - __asm__("movq %q[Data], %%cr0" : : [Data] "q" (Data) : "memory"); + __asm__("mov %[Data], %%cr8" : : [Data] "q" (Data) : "memory"); } +#endif -static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) +static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr0(void) { - __asm__("movq %q[Data], %%cr3" : : [Data] "q" (Data) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) -{ - __asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr8(const unsigned long long Data) -{ - __asm__("movq %q[Data], %%cr8" : : [Data] "q" (Data) : "memory"); -} - -static __inline__ __attribute__((always_inline)) unsigned long long __readcr0(void) -{ - unsigned long long value; - __asm__ __volatile__("movq %%cr0, %q[value]" : [value] "=q" (value)); - return value; -} - -static __inline__ __attribute__((always_inline)) unsigned long long __readcr2(void) -{ - unsigned long long value; - __asm__ __volatile__("movq %%cr2, %q[value]" : [value] "=q" (value)); - return value; -} - -static __inline__ __attribute__((always_inline)) unsigned long long __readcr3(void) -{ - unsigned long long value; - __asm__ __volatile__("movq %%cr3, %q[value]" : [value] "=q" (value)); - return value; -} - -static __inline__ __attribute__((always_inline)) unsigned long long __readcr4(void) -{ - unsigned long long value; - __asm__ __volatile__("movq %%cr4, %q[value]" : [value] "=q" (value)); - return value; -} - -static __inline__ __attribute__((always_inline)) unsigned long long __readcr8(void) -{ - unsigned long long value; - __asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=q" (value)); - return value; -} - -#else -static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr0" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr3" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr4" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} - -static __inline__ __attribute__((always_inline)) unsigned long __readcr0(void) -{ - unsigned long value; + unsigned __int64 value; __asm__ __volatile__("mov %%cr0, %[value]" : [value] "=q" (value)); return value; } -static __inline__ __attribute__((always_inline)) unsigned long __readcr2(void) +static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr2(void) { - unsigned long value; + unsigned __int64 value; __asm__ __volatile__("mov %%cr2, %[value]" : [value] "=q" (value)); return value; } -static __inline__ __attribute__((always_inline)) unsigned long __readcr3(void) +static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr3(void) { - unsigned long value; + unsigned __int64 value; __asm__ __volatile__("mov %%cr3, %[value]" : [value] "=q" (value)); return value; } -static __inline__ __attribute__((always_inline)) unsigned long __readcr4(void) +static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr4(void) { - unsigned long value; + unsigned __int64 value; __asm__ __volatile__("mov %%cr4, %[value]" : [value] "=q" (value)); return value; } +#ifdef _M_AMD64 +static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr8(void) +{ + unsigned __int64 value; + __asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=q" (value)); + return value; +} +#endif + +#ifdef _M_AMD64 +static __inline__ __attribute__((always_inline)) unsigned __int64 __readdr(unsigned int reg) +{ + unsigned __int64 value; + switch (reg) + { + case 0: + __asm__ __volatile__("movq %%dr0, %q[value]" : [value] "=q" (value)); + break; + case 1: + __asm__ __volatile__("movq %%dr1, %q[value]" : [value] "=q" (value)); + break; + case 2: + __asm__ __volatile__("movq %%dr2, %q[value]" : [value] "=q" (value)); + break; + case 3: + __asm__ __volatile__("movq %%dr3, %q[value]" : [value] "=q" (value)); + break; + case 4: + __asm__ __volatile__("movq %%dr4, %q[value]" : [value] "=q" (value)); + break; + case 5: + __asm__ __volatile__("movq %%dr5, %q[value]" : [value] "=q" (value)); + break; + case 6: + __asm__ __volatile__("movq %%dr6, %q[value]" : [value] "=q" (value)); + break; + case 7: + __asm__ __volatile__("movq %%dr7, %q[value]" : [value] "=q" (value)); + break; + } + return value; +} + +static __inline__ __attribute__((always_inline)) void __writedr(unsigned reg, unsigned __int64 value) +{ + switch (reg) + { + case 0: + __asm__("movq %q[value], %%dr0" : : [value] "q" (value) : "memory"); + break; + case 1: + __asm__("movq %q[value], %%dr1" : : [value] "q" (value) : "memory"); + break; + case 2: + __asm__("movq %q[value], %%dr2" : : [value] "q" (value) : "memory"); + break; + case 3: + __asm__("movq %q[value], %%dr3" : : [value] "q" (value) : "memory"); + break; + case 4: + __asm__("movq %q[value], %%dr4" : : [value] "q" (value) : "memory"); + break; + case 5: + __asm__("movq %q[value], %%dr5" : : [value] "q" (value) : "memory"); + break; + case 6: + __asm__("movq %q[value], %%dr6" : : [value] "q" (value) : "memory"); + break; + case 7: + __asm__("movq %q[value], %%dr7" : : [value] "q" (value) : "memory"); + break; + } +} #endif static __inline__ __attribute__((always_inline)) void __invlpg(void * const Address) @@ -1247,7 +1270,7 @@ static __inline__ __attribute__((always_inline)) void __lidt(void *Source) static __inline__ __attribute__((always_inline)) void __sidt(void *Destination) { - __asm__ __volatile__("sidt %0" : : "m"(*(short*)Destination)); + __asm__ __volatile__("sidt %0" : : "m"(*(short*)Destination) : "memory"); } #endif /* KJK_INTRIN_X86_H_ */ From 1274624c6b0579c5169b75d2fa5a60ff11cfa9d3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 24 Aug 2008 23:51:55 +0000 Subject: [PATCH 158/388] Implement KiSaveProcessorControlState and KiRestoreProcessorControlState svn path=/branches/ros-amd64-bringup/; revision=35617 --- reactos/ntoskrnl/ke/amd64/cpu.c | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/reactos/ntoskrnl/ke/amd64/cpu.c b/reactos/ntoskrnl/ke/amd64/cpu.c index 6259094a6fa..cf93c2ea7b2 100644 --- a/reactos/ntoskrnl/ke/amd64/cpu.c +++ b/reactos/ntoskrnl/ke/amd64/cpu.c @@ -491,6 +491,86 @@ KeFlushCurrentTb(VOID) __writecr3(__readcr3()); } +VOID +NTAPI +KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState) +{ + /* Save the CR registers */ + __writecr0(ProcessorState->SpecialRegisters.Cr0); +// __writecr2(ProcessorState->SpecialRegisters.Cr2); + __writecr3(ProcessorState->SpecialRegisters.Cr3); + __writecr4(ProcessorState->SpecialRegisters.Cr4); + __writecr8(ProcessorState->SpecialRegisters.Cr8); + + /* Save the DR registers */ + __writedr(0, ProcessorState->SpecialRegisters.KernelDr0); + __writedr(1, ProcessorState->SpecialRegisters.KernelDr1); + __writedr(2, ProcessorState->SpecialRegisters.KernelDr2); + __writedr(3, ProcessorState->SpecialRegisters.KernelDr3); + __writedr(6, ProcessorState->SpecialRegisters.KernelDr6); + __writedr(7, ProcessorState->SpecialRegisters.KernelDr7); + + /* Save GDT, IDT, LDT and TSS */ + __lgdt(&ProcessorState->SpecialRegisters.Gdtr.Limit); + __lldt(&ProcessorState->SpecialRegisters.Ldtr); + __ltr(&ProcessorState->SpecialRegisters.Tr); + __lidt(&ProcessorState->SpecialRegisters.Idtr.Limit); + + __ldmxcsr(&ProcessorState->SpecialRegisters.MxCsr); +// ProcessorState->SpecialRegisters.DebugControl +// ProcessorState->SpecialRegisters.LastBranchToRip +// ProcessorState->SpecialRegisters.LastBranchFromRip +// ProcessorState->SpecialRegisters.LastExceptionToRip +// ProcessorState->SpecialRegisters.LastExceptionFromRip + __writemsr(X86_MSR_GSBASE, ProcessorState->SpecialRegisters.MsrGsBase); + __writemsr(X86_MSR_KERNEL_GSBASE, ProcessorState->SpecialRegisters.MsrGsSwap); + __writemsr(X86_MSR_STAR, ProcessorState->SpecialRegisters.MsrStar); + __writemsr(X86_MSR_LSTAR, ProcessorState->SpecialRegisters.MsrLStar); + __writemsr(X86_MSR_CSTAR, ProcessorState->SpecialRegisters.MsrCStar); + __writemsr(X86_MSR_SFMASK, ProcessorState->SpecialRegisters.MsrSyscallMask); + +} + +VOID +NTAPI +KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState) +{ + /* Save the CR registers */ + ProcessorState->SpecialRegisters.Cr0 = __readcr0(); + ProcessorState->SpecialRegisters.Cr2 = __readcr2(); + ProcessorState->SpecialRegisters.Cr3 = __readcr3(); + ProcessorState->SpecialRegisters.Cr4 = __readcr4(); + ProcessorState->SpecialRegisters.Cr8 = __readcr8(); + + /* Save the DR registers */ + ProcessorState->SpecialRegisters.KernelDr0 = __readdr(0); + ProcessorState->SpecialRegisters.KernelDr1 = __readdr(1); + ProcessorState->SpecialRegisters.KernelDr2 = __readdr(2); + ProcessorState->SpecialRegisters.KernelDr3 = __readdr(3); + ProcessorState->SpecialRegisters.KernelDr6 = __readdr(6); + ProcessorState->SpecialRegisters.KernelDr7 = __readdr(7); + + /* Save GDT, IDT, LDT and TSS */ + __sgdt(&ProcessorState->SpecialRegisters.Gdtr.Limit); + __sldt(&ProcessorState->SpecialRegisters.Ldtr); + __str(&ProcessorState->SpecialRegisters.Tr); + __sidt(&ProcessorState->SpecialRegisters.Idtr.Limit); + + __stmxcsr(&ProcessorState->SpecialRegisters.MxCsr); +// ProcessorState->SpecialRegisters.DebugControl = +// ProcessorState->SpecialRegisters.LastBranchToRip = +// ProcessorState->SpecialRegisters.LastBranchFromRip = +// ProcessorState->SpecialRegisters.LastExceptionToRip = +// ProcessorState->SpecialRegisters.LastExceptionFromRip = + ProcessorState->SpecialRegisters.MsrGsBase = __readmsr(X86_MSR_GSBASE); + ProcessorState->SpecialRegisters.MsrGsSwap = __readmsr(X86_MSR_KERNEL_GSBASE); + ProcessorState->SpecialRegisters.MsrStar = __readmsr(X86_MSR_STAR); + ProcessorState->SpecialRegisters.MsrLStar = __readmsr(X86_MSR_LSTAR); + ProcessorState->SpecialRegisters.MsrCStar = __readmsr(X86_MSR_CSTAR); + ProcessorState->SpecialRegisters.MsrSyscallMask = __readmsr(X86_MSR_SFMASK); +} + + VOID NTAPI KiInitializeMachineType(VOID) From 3ec5ec2e9422a5058c7c0ed38d008dbc9cc8ffdc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 00:10:15 +0000 Subject: [PATCH 159/388] Add X86_MSR constants, implement __lgdt, __sgdt, __lldt, __sldt, __ldmxcsr, __stmxcsr, __ltr, __str intrinsics. svn path=/branches/ros-amd64-bringup/; revision=35618 --- .../include/internal/amd64/intrin_i.h | 54 +++++++++++++------ reactos/ntoskrnl/include/internal/amd64/ke.h | 4 ++ 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h index 908d2eea9a7..2af9056f3f1 100644 --- a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -11,25 +11,45 @@ #if defined(__GNUC__) -#define Ke386SetInterruptDescriptorTable(X) \ - __asm__("lidt %0\n\t" \ - : /* no outputs */ \ - : "m" (X)); +static __inline__ __attribute__((always_inline)) void __lgdt(void *Source) +{ + __asm__ __volatile__("lgdt %0" : : "m"(*(short*)Source)); +} -#define Ke386GetInterruptDescriptorTable(X) \ - __asm__("sidt %0\n\t" \ - : /* no outputs */ \ - : "m" (X)); +static __inline__ __attribute__((always_inline)) void __sgdt(void *Destination) +{ + __asm__ __volatile__("sgdt %0" : : "m"(*(short*)Destination) : "memory"); +} -#define Ke386SetGlobalDescriptorTable(X) \ - __asm__("lgdt %0\n\t" \ - : /* no outputs */ \ - : "m" (X)); +static __inline__ __attribute__((always_inline)) void __lldt(void *Source) +{ + __asm__ __volatile__("lldt %0" : : "m"(*(short*)Source)); +} -#define Ke386GetGlobalDescriptorTable(X) \ - __asm__("sgdt %0\n\t" \ - : /* no outputs */ \ - : "m" (X)); +static __inline__ __attribute__((always_inline)) void __sldt(void *Destination) +{ + __asm__ __volatile__("sldt %0" : : "m"(*(short*)Destination) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __ldmxcsr(unsigned long *Source) +{ + __asm__ __volatile__("ldmxcsr %0" : : "m"(*Source)); +} + +static __inline__ __attribute__((always_inline)) void __stmxcsr(unsigned long *Destination) +{ + __asm__ __volatile__("stmxcsr %0" : : "m"(*Destination) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __ltr(unsigned short *Source) +{ + __asm__ __volatile__("ltr %0" : : "m"(*Source)); +} + +static __inline__ __attribute__((always_inline)) void __str(unsigned short *Destination) +{ + __asm__ __volatile__("str %0" : : "m"(*Destination) : "memory"); +} #define Ke386GetLocalDescriptorTable(X) \ __asm__("sldt %0\n\t" \ @@ -61,7 +81,7 @@ #define _Ke386GetDr(N) ({ \ unsigned int __d; \ - __asm__("movl %%dr" #N ",%0\n\t" :"=r" (__d)); \ + __asm__("movq %%dr" #N ",%0\n\t" :"=r" (__d)); \ __d; \ }) diff --git a/reactos/ntoskrnl/include/internal/amd64/ke.h b/reactos/ntoskrnl/include/internal/amd64/ke.h index fc830fa95d8..8ee91fb03d9 100644 --- a/reactos/ntoskrnl/include/internal/amd64/ke.h +++ b/reactos/ntoskrnl/include/internal/amd64/ke.h @@ -45,6 +45,10 @@ #define X86_MSR_GSBASE 0xC0000101 #define X86_MSR_KERNEL_GSBASE 0xC0000102 +#define X86_MSR_STAR 0xC0000081 +#define X86_MSR_LSTAR 0xC0000082 +#define X86_MSR_CSTAR 0xC0000083 +#define X86_MSR_SFMASK 0xC0000084 #ifndef __ASM__ From 001f91468e6a54fec7b1c8ef3e159ff1cf90f7c5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 00:12:33 +0000 Subject: [PATCH 160/388] - Fix comments and comment out stmxcsr, as it crashes for some reason. svn path=/branches/ros-amd64-bringup/; revision=35619 --- reactos/ntoskrnl/ke/amd64/cpu.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/cpu.c b/reactos/ntoskrnl/ke/amd64/cpu.c index cf93c2ea7b2..0b0efcbac1b 100644 --- a/reactos/ntoskrnl/ke/amd64/cpu.c +++ b/reactos/ntoskrnl/ke/amd64/cpu.c @@ -495,14 +495,14 @@ VOID NTAPI KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState) { - /* Save the CR registers */ + /* Restore the CR registers */ __writecr0(ProcessorState->SpecialRegisters.Cr0); // __writecr2(ProcessorState->SpecialRegisters.Cr2); __writecr3(ProcessorState->SpecialRegisters.Cr3); __writecr4(ProcessorState->SpecialRegisters.Cr4); __writecr8(ProcessorState->SpecialRegisters.Cr8); - /* Save the DR registers */ + /* Restore the DR registers */ __writedr(0, ProcessorState->SpecialRegisters.KernelDr0); __writedr(1, ProcessorState->SpecialRegisters.KernelDr1); __writedr(2, ProcessorState->SpecialRegisters.KernelDr2); @@ -510,7 +510,7 @@ KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState) __writedr(6, ProcessorState->SpecialRegisters.KernelDr6); __writedr(7, ProcessorState->SpecialRegisters.KernelDr7); - /* Save GDT, IDT, LDT and TSS */ + /* Restore GDT, IDT, LDT and TSS */ __lgdt(&ProcessorState->SpecialRegisters.Gdtr.Limit); __lldt(&ProcessorState->SpecialRegisters.Ldtr); __ltr(&ProcessorState->SpecialRegisters.Tr); @@ -522,6 +522,8 @@ KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState) // ProcessorState->SpecialRegisters.LastBranchFromRip // ProcessorState->SpecialRegisters.LastExceptionToRip // ProcessorState->SpecialRegisters.LastExceptionFromRip + + /* Restore MSRs */ __writemsr(X86_MSR_GSBASE, ProcessorState->SpecialRegisters.MsrGsBase); __writemsr(X86_MSR_KERNEL_GSBASE, ProcessorState->SpecialRegisters.MsrGsSwap); __writemsr(X86_MSR_STAR, ProcessorState->SpecialRegisters.MsrStar); @@ -556,12 +558,14 @@ KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState) __str(&ProcessorState->SpecialRegisters.Tr); __sidt(&ProcessorState->SpecialRegisters.Idtr.Limit); - __stmxcsr(&ProcessorState->SpecialRegisters.MxCsr); +// __stmxcsr(&ProcessorState->SpecialRegisters.MxCsr); // ProcessorState->SpecialRegisters.DebugControl = // ProcessorState->SpecialRegisters.LastBranchToRip = // ProcessorState->SpecialRegisters.LastBranchFromRip = // ProcessorState->SpecialRegisters.LastExceptionToRip = // ProcessorState->SpecialRegisters.LastExceptionFromRip = + + /* Save MSRs */ ProcessorState->SpecialRegisters.MsrGsBase = __readmsr(X86_MSR_GSBASE); ProcessorState->SpecialRegisters.MsrGsSwap = __readmsr(X86_MSR_KERNEL_GSBASE); ProcessorState->SpecialRegisters.MsrStar = __readmsr(X86_MSR_STAR); From 20ad38dd8ec4842d9cf77a3eaf76366c9c381fa3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 00:25:49 +0000 Subject: [PATCH 161/388] It's really not good coding style to pass an OUT parameter "by value" to a macro like Ke386GetGlobalDescriptorTable. The Funny thing is that due to a missing memory barrier this macro actually handled this like a "by value" parameter. Of cause this is totally incorrect and led to the strange results I was experiencing. Use __sgdt and __sidt instead and remove the old hack. svn path=/branches/ros-amd64-bringup/; revision=35620 --- reactos/ntoskrnl/ke/amd64/kiinit.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index 116c77bbd58..0e4a27765ca 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -497,7 +497,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess, DPRINT1("SMP Boot support not yet present\n"); } FrLdrDbgPrint("before KeInitializeThread\n"); -for(;;); + /* Setup the Idle Thread */ KeInitializeThread(InitProcess, InitThread, @@ -507,6 +507,7 @@ for(;;); NULL, NULL, IdleStack); +FrLdrDbgPrint("after KeInitializeThread\n"); InitThread->NextProcessor = Number; InitThread->Priority = HIGH_PRIORITY; InitThread->State = Running; @@ -596,15 +597,8 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, USHORT Tr = 0; /* Get GDT and IDT descriptors */ - Ke386GetGlobalDescriptorTable(GdtDescriptor.Limit); - Ke386GetInterruptDescriptorTable(IdtDescriptor.Limit); - - // FIXME: for some strange reason the gdt needs some time before it's finished... - if (!GdtDescriptor.Base) - { - FrLdrDbgPrint("1. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit); - } - FrLdrDbgPrint("2. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit); + __sgdt(&GdtDescriptor.Limit); + __sidt(&IdtDescriptor.Limit); /* Save IDT and GDT */ *Gdt = (PKGDTENTRY)GdtDescriptor.Base; From c305ef3554d517c41a197c0d4bc1c428626a6c35 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 01:06:49 +0000 Subject: [PATCH 162/388] Update stubs file svn path=/branches/ros-amd64-bringup/; revision=35621 --- reactos/ntoskrnl/amd64stubs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index 94b8ba197f3..6da6ea2ca71 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -32,7 +32,6 @@ STUB(NtSetLdtEntries) STUB(NtVdmControl) STUB(KiSwapProcess) STUB(KeGetCurrentProcessorNumber) -STUB(Ke386InitThreadWithContext) STUB(ExpInterlockedPopEntrySList) STUB(ExAllocateFromNPagedLookasideList) STUB(RtlGetCallersAddress) @@ -251,7 +250,6 @@ STUB(KfReleaseSpinLock) STUB(KeAcquireInStackQueuedSpinLock) STUB(KeReleaseInStackQueuedSpinLock) STUB(KfAcquireSpinLock) -STUB(KiSaveProcessorControlState) STUB(KeProcessorArchitecture) STUB(KeProcessorLevel) STUB(KeProcessorRevision) From 17c45a4cd26832c6f0a99c66ab52afae73f47b4d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 01:30:57 +0000 Subject: [PATCH 163/388] Move some Pcr init code into KiInitializePcr, use __sldt instead of Ke386SetLocaldescriptorTable, enable KdInitSystem svn path=/branches/ros-amd64-bringup/; revision=35622 --- reactos/ntoskrnl/ke/amd64/kiinit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index 0e4a27765ca..d480a27b68b 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -378,6 +378,10 @@ KiInitializePcr(IN ULONG ProcessorNumber, /* Setup the processor set */ Pcr->Prcb.MultiThreadProcessorSet = Pcr->Prcb.SetMember; + + /* Clear DR6/7 to cleanup bootloader debugging */ + Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr6 = 0; + Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr7 = 0; } VOID @@ -701,10 +705,6 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); /* Set us as the current process */ InitialThread->ApcState.Process = &KiInitialProcess.Pcb; - /* Clear DR6/7 to cleanup bootloader debugging */ - Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr6 = 0; - Pcr->Prcb.ProcessorState.SpecialRegisters.KernelDr7 = 0; - /* Setup the IDT */ KeInitExceptions(); @@ -714,7 +714,7 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); // Ke386SetFs(KGDT_32_R3_TEB | RPL_MASK); /* LDT is unused */ - Ke386SetLocalDescriptorTable(0); + __sldt(0); /* Save NMI and double fault traps */ // RtlCopyMemory(&NmiEntry, &Idt[2], sizeof(KIDTENTRY)); @@ -753,7 +753,7 @@ FrLdrDbgPrint("Gdt = %p, Idt = %p, Pcr = %p, Tss = %p\n", Gdt, Idt, Pcr, Tss); if (Cpu == 0) { /* Initialize debugging system */ -// KdInitSystem(0, KeLoaderBlock); + KdInitSystem(0, KeLoaderBlock); /* Check for break-in */ // if (KdPollBreakIn()) DbgBreakPointWithStatus(1); From 26ac2c8ab5899933f11ee88f80a26f8c2d67653b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 25 Aug 2008 20:52:17 +0000 Subject: [PATCH 164/388] Convert to spec file. svn path=/branches/ros-amd64-bringup/; revision=35642 --- reactos/dll/win32/userenv/userenv.def | 43 ------------------------ reactos/dll/win32/userenv/userenv.rbuild | 3 +- reactos/dll/win32/userenv/userenv.spec | 42 +++++++++++++++++++++++ 3 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 reactos/dll/win32/userenv/userenv.def create mode 100644 reactos/dll/win32/userenv/userenv.spec diff --git a/reactos/dll/win32/userenv/userenv.def b/reactos/dll/win32/userenv/userenv.def deleted file mode 100644 index 328ec2f3e18..00000000000 --- a/reactos/dll/win32/userenv/userenv.def +++ /dev/null @@ -1,43 +0,0 @@ -LIBRARY userenv.dll -EXPORTS -InitializeProfiles@0 @100 NONAME -CreateGroupA@8 @101 NONAME -CreateGroupW@8 @102 NONAME -DeleteGroupA@8 @103 NONAME -DeleteGroupW@8 @104 NONAME -AddItemA@36 @105 NONAME -AddItemW@36 @106 NONAME -DeleteItemA@16 @107 NONAME -DeleteItemW@16 @108 NONAME -CreateUserProfileA@8 @109 NONAME -CreateUserProfileW@8 @110 NONAME -CopyProfileDirectoryA@12 @111 NONAME -CopyProfileDirectoryW@12 @112 NONAME -AddDesktopItemA@32 @113 NONAME -AddDesktopItemW@32 @114 NONAME -DeleteDesktopItemA@8 @115 NONAME -DeleteDesktopItemW@8 @116 NONAME -CreateEnvironmentBlock@12 -DestroyEnvironmentBlock@4 -EnterCriticalPolicySection@4 -ExpandEnvironmentStringsForUserA@16 -ExpandEnvironmentStringsForUserW@16 -GetAllUsersProfileDirectoryA@8 -GetAllUsersProfileDirectoryW@8 -GetDefaultUserProfileDirectoryA@8 -GetDefaultUserProfileDirectoryW@8 -GetProfilesDirectoryA@8 -GetProfilesDirectoryW@8 -GetUserProfileDirectoryA@12 -GetUserProfileDirectoryW@12 -LeaveCriticalPolicySection@4 -LoadUserProfileA@8 -LoadUserProfileW@8 -RefreshPolicy@4 -RefreshPolicyEx@8 -RegisterGPNotification@8 -UnloadUserProfile@8 -UnregisterGPNotification@4 -WaitForUserPolicyForegroundProcessing@0 -WaitForMachinePolicyForegroundProcessing@0 -;EOF diff --git a/reactos/dll/win32/userenv/userenv.rbuild b/reactos/dll/win32/userenv/userenv.rbuild index 4fde1650648..bf0447a1715 100644 --- a/reactos/dll/win32/userenv/userenv.rbuild +++ b/reactos/dll/win32/userenv/userenv.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x0600 @@ -20,4 +20,5 @@ setup.c userenv.c userenv.rc + userenv.spec diff --git a/reactos/dll/win32/userenv/userenv.spec b/reactos/dll/win32/userenv/userenv.spec new file mode 100644 index 00000000000..694799bf1ff --- /dev/null +++ b/reactos/dll/win32/userenv/userenv.spec @@ -0,0 +1,42 @@ + @ stdcall CreateEnvironmentBlock(ptr ptr long) + @ stdcall DestroyEnvironmentBlock(ptr) + @ stdcall ExpandEnvironmentStringsForUserA(ptr str ptr long) + @ stdcall ExpandEnvironmentStringsForUserW(ptr wstr ptr long) + @ stdcall GetProfilesDirectoryA(ptr ptr) + @ stdcall GetProfilesDirectoryW(ptr ptr) + @ stub GetProfileType + @ stdcall GetUserProfileDirectoryA(ptr ptr ptr) + @ stdcall GetUserProfileDirectoryW(ptr ptr ptr) + @ stdcall LoadUserProfileA(ptr ptr) + @ stdcall LoadUserProfileW(ptr ptr) + @ stdcall RegisterGPNotification(long long) + @ stdcall UnloadUserProfile(ptr ptr) + @ stdcall UnregisterGPNotification(long) +100 stdcall -noname InitializeProfiles() +101 stdcall -noname CreateGroupA(str long) +102 stdcall -noname CreateGroupW(wstr long) +103 stdcall -noname DeleteGroupA(str long) +104 stdcall -noname DeleteGroupW(wstr long) +105 stdcall -noname AddItemA(str long str str str long str long long) +106 stdcall -noname AddItemW(wstr long wstr wstr wstr long wstr long long) +107 stdcall -noname DeleteItemA(str long str long) +108 stdcall -noname DeleteItemW(wstr long wstr long) +109 stdcall -noname CreateUserProfileA(ptr str) +110 stdcall -noname CreateUserProfileW(ptr wstr) +111 stdcall -noname CopyProfileDirectoryA(str str long) +112 stdcall -noname CopyProfileDirectoryW(wstr wstr long) +113 stdcall -noname AddDesktopItemA(long str str str long str long long) +114 stdcall -noname AddDesktopItemW(long wstr wstr wstr long wstr long long) +115 stdcall -noname DeleteDesktopItemA(long str) +116 stdcall -noname DeleteDesktopItemW(long wstr) + @ stdcall EnterCriticalPolicySection(long) + @ stdcall GetAllUsersProfileDirectoryA(str ptr) + @ stdcall GetAllUsersProfileDirectoryW(wstr ptr) + @ stdcall GetDefaultUserProfileDirectoryA(str ptr) + @ stdcall GetDefaultUserProfileDirectoryW(wstr ptr) + @ stdcall LeaveCriticalPolicySection(long) + @ stdcall RefreshPolicy(long) + @ stdcall RefreshPolicyEx(long long) + @ stdcall WaitForUserPolicyForegroundProcessing() + @ stdcall WaitForMachinePolicyForegroundProcessing() + From 2cd57c75dc3263a30b311cfb72245d32cf4a816d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 21:24:18 +0000 Subject: [PATCH 165/388] __readcr3() returns an unsigned __int64, fix x86 MmGetPageDirectory accordingly. svn path=/branches/ros-amd64-bringup/; revision=35644 --- reactos/ntoskrnl/mm/i386/page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index 6e6fdba36ec..a5a47a2ed20 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -95,7 +95,7 @@ MiFlushTlb(PULONG Pt, PVOID Address) PULONG MmGetPageDirectory(VOID) { - return (PULONG)__readcr3(); + return (PULONG)(ULONG_PTR)__readcr3(); } static ULONG From 3fa7c1f193b774fcf36053e798da5b677ca74a0d Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 25 Aug 2008 21:52:05 +0000 Subject: [PATCH 166/388] Fix some wrong declarations for 64bits. svn path=/branches/ros-amd64-bringup/; revision=35645 --- reactos/include/psdk/winnt.h | 4 ++++ reactos/include/psdk/winuser.h | 38 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 586f09c6ef0..6a96e9f1aaa 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -4438,7 +4438,11 @@ static __inline__ PVOID GetCurrentFiber(void) #elif defined (_M_AMD64) FORCEINLINE PVOID GetCurrentFiber(VOID) { + #ifdef NONAMELESSUNION + return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, DUMMYUNIONNAME.FiberData)); + #else return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData)); + #endif } #elif defined (_M_ARM) PVOID WINAPI GetCurrentFiber(VOID); diff --git a/reactos/include/psdk/winuser.h b/reactos/include/psdk/winuser.h index 435f7f9ffcb..437316bb8d7 100644 --- a/reactos/include/psdk/winuser.h +++ b/reactos/include/psdk/winuser.h @@ -3709,12 +3709,12 @@ BOOL WINAPI DestroyWindow(HWND); #define DialogBoxW(i,t,p,f) DialogBoxParamW(i,t,p,f,0) #define DialogBoxIndirectA(i,t,p,f) DialogBoxIndirectParamA(i,t,p,f,0) #define DialogBoxIndirectW(i,t,p,f) DialogBoxIndirectParamW(i,t,p,f,0) -int WINAPI DialogBoxIndirectParamA(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM); -int WINAPI DialogBoxIndirectParamW(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM); -int WINAPI DialogBoxParamA(HINSTANCE,LPCSTR,HWND,DLGPROC,LPARAM); -int WINAPI DialogBoxParamW(HINSTANCE,LPCWSTR,HWND,DLGPROC,LPARAM); -LONG WINAPI DispatchMessageA(const MSG*); -LONG WINAPI DispatchMessageW(const MSG*); +INT_PTR WINAPI DialogBoxIndirectParamA(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM); +INT_PTR WINAPI DialogBoxIndirectParamW(HINSTANCE,LPCDLGTEMPLATE,HWND,DLGPROC,LPARAM); +INT_PTR WINAPI DialogBoxParamA(HINSTANCE,LPCSTR,HWND,DLGPROC,LPARAM); +INT_PTR WINAPI DialogBoxParamW(HINSTANCE,LPCWSTR,HWND,DLGPROC,LPARAM); +LRESULT WINAPI DispatchMessageA(const MSG*); +LRESULT WINAPI DispatchMessageW(const MSG*); int WINAPI DlgDirListA(HWND,LPSTR,int,int,UINT); int WINAPI DlgDirListW(HWND,LPWSTR,int,int,UINT); int WINAPI DlgDirListComboBoxA(HWND,LPSTR,int,int,UINT); @@ -3747,7 +3747,7 @@ BOOL WINAPI EnableMenuItem(HMENU,UINT,UINT); BOOL WINAPI EnableScrollBar(HWND,UINT,UINT); BOOL WINAPI EnableWindow(HWND,BOOL); BOOL WINAPI EndDeferWindowPos(HDWP); -BOOL WINAPI EndDialog(HWND,int); +BOOL WINAPI EndDialog(HWND,INT_PTR); BOOL WINAPI EndMenu(void); BOOL WINAPI EndPaint(HWND,const PAINTSTRUCT*); #if (_WIN32_WINNT >= 0x0500) @@ -3804,8 +3804,8 @@ BOOL WINAPI GetClassInfoExW(HINSTANCE,LPCWSTR,LPWNDCLASSEXW); DWORD WINAPI GetClassLongA(HWND,int); DWORD WINAPI GetClassLongW(HWND,int); #ifdef _WIN64 -LONG_PTR WINAPI GetClassLongPtrA(HWND,int); -LONG_PTR WINAPI GetClassLongPtrW(HWND,int); +ULONG_PTR WINAPI GetClassLongPtrA(HWND,int); +ULONG_PTR WINAPI GetClassLongPtrW(HWND,int); #else #define GetClassLongPtrA GetClassLongA #define GetClassLongPtrW GetClassLongW @@ -3866,7 +3866,7 @@ int WINAPI GetMenuStringA(HMENU,UINT,LPSTR,int,UINT); int WINAPI GetMenuStringW(HMENU,UINT,LPWSTR,int,UINT); BOOL WINAPI GetMessageA(LPMSG,HWND,UINT,UINT); BOOL WINAPI GetMessageW(LPMSG,HWND,UINT,UINT); -LONG WINAPI GetMessageExtraInfo(void); +LPARAM WINAPI GetMessageExtraInfo(void); DWORD WINAPI GetMessagePos(void); LONG WINAPI GetMessageTime(void); #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0490) @@ -4001,8 +4001,8 @@ BOOL WINAPI IsWindowVisible(HWND); BOOL WINAPI IsWinEventHookInstalled(DWORD); #endif BOOL WINAPI IsZoomed(HWND); -VOID WINAPI keybd_event(BYTE,BYTE,DWORD,DWORD); -BOOL WINAPI KillTimer(HWND,UINT); +VOID WINAPI keybd_event(BYTE,BYTE,DWORD,ULONG_PTR); +BOOL WINAPI KillTimer(HWND,UINT_PTR); HACCEL WINAPI LoadAcceleratorsA(HINSTANCE,LPCSTR); HACCEL WINAPI LoadAcceleratorsW(HINSTANCE,LPCWSTR); HBITMAP WINAPI LoadBitmapA(HINSTANCE,LPCSTR); @@ -4114,16 +4114,16 @@ BOOL WINAPI ScreenToClient(HWND,LPPOINT); BOOL WINAPI ScrollDC(HDC,int,int,LPCRECT,LPCRECT,HRGN,LPRECT); BOOL WINAPI ScrollWindow(HWND,int,int,LPCRECT,LPCRECT); int WINAPI ScrollWindowEx(HWND,int,int,LPCRECT,LPCRECT,HRGN,LPRECT,UINT); -LONG WINAPI SendDlgItemMessageA(HWND,int,UINT,WPARAM,LPARAM); -LONG WINAPI SendDlgItemMessageW(HWND,int,UINT,WPARAM,LPARAM); +LRESULT WINAPI SendDlgItemMessageA(HWND,int,UINT,WPARAM,LPARAM); +LRESULT WINAPI SendDlgItemMessageW(HWND,int,UINT,WPARAM,LPARAM); #if (_WIN32_WINNT >= 0x0403) UINT WINAPI SendInput(UINT,LPINPUT,int); #endif LRESULT WINAPI SendMessageA(HWND,UINT,WPARAM,LPARAM); -BOOL WINAPI SendMessageCallbackA(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,DWORD); -BOOL WINAPI SendMessageCallbackW(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,DWORD); -LRESULT WINAPI SendMessageTimeoutA(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD); -LRESULT WINAPI SendMessageTimeoutW(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD); +BOOL WINAPI SendMessageCallbackA(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,ULONG_PTR); +BOOL WINAPI SendMessageCallbackW(HWND,UINT,WPARAM,LPARAM,SENDASYNCPROC,ULONG_PTR); +LRESULT WINAPI SendMessageTimeoutA(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD_PTR); +LRESULT WINAPI SendMessageTimeoutW(HWND,UINT,WPARAM,LPARAM,UINT,UINT,PDWORD_PTR); LRESULT WINAPI SendMessageW(HWND,UINT,WPARAM,LPARAM); BOOL WINAPI SendNotifyMessageA(HWND,UINT,WPARAM,LPARAM); BOOL WINAPI SendNotifyMessageW(HWND,UINT,WPARAM,LPARAM); @@ -4179,7 +4179,7 @@ HANDLE WINAPI SetSysColorsTemp(const COLORREF *, const HBRUSH *, int); #define SetSysModalWindow(h) (NULL) BOOL WINAPI SetSystemCursor(HCURSOR,DWORD); BOOL WINAPI SetThreadDesktop(HDESK); -UINT WINAPI SetTimer(HWND,UINT,UINT,TIMERPROC); +UINT_PTR WINAPI SetTimer(HWND,UINT_PTR,UINT,TIMERPROC); BOOL WINAPI SetUserObjectInformationA(HANDLE,int,PVOID,DWORD); BOOL WINAPI SetUserObjectInformationW(HANDLE,int,PVOID,DWORD); BOOL WINAPI SetUserObjectSecurity(HANDLE,PSECURITY_INFORMATION,PSECURITY_DESCRIPTOR); From ee74c1b45ed871634db87b974ae17de0701f0ef3 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 25 Aug 2008 23:55:29 +0000 Subject: [PATCH 167/388] Don't add stdcall decorations to amd64 syscalls. svn path=/branches/ros-amd64-bringup/; revision=35650 --- reactos/tools/nci/ncitool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/tools/nci/ncitool.c b/reactos/tools/nci/ncitool.c index d3d89014a85..4490e7f4b44 100644 --- a/reactos/tools/nci/ncitool.c +++ b/reactos/tools/nci/ncitool.c @@ -140,7 +140,7 @@ struct ncitool_data_t ncitool_data[] = { { "i386", 4, KernelModeStub_x86, UserModeStub_x86, ".global _%s@%d\n", "_%s@%d:\n" }, { "amd64", 4, KernelModeStub_amd64, UserModeStub_amd64, - ".global _%s@%d\n", "_%s@%d:\n" }, + ".global _%s\n", "_%s:\n" }, { "powerpc", 4, KernelModeStub_ppc, UserModeStub_ppc, "\t.globl %s\n", "%s:\n" }, { "mips", 4, KernelModeStub_mips, UserModeStub_mips, From 1a8d9f2429591c07abbcde17c8105d1c7aea5e56 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 25 Aug 2008 23:57:51 +0000 Subject: [PATCH 168/388] Don't error on non-32bit builds. Still needs port. svn path=/branches/ros-amd64-bringup/; revision=35651 --- reactos/tools/widl/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/tools/widl/server.c b/reactos/tools/widl/server.c index c866550240f..8dc1ebc2ecd 100644 --- a/reactos/tools/widl/server.c +++ b/reactos/tools/widl/server.c @@ -442,7 +442,7 @@ void write_server(ifref_list_t *ifaces) write_function_stubs(iface->iface, &proc_offset); print_server("#if !defined(__RPC_WIN32__)\n"); - print_server("#error Invalid build platform for this stub.\n"); + print_server("//#error Invalid build platform for this stub.\n"); print_server("#endif\n"); fprintf(server, "\n"); From 9abe4eb706a0cb864833a94950e2eafeff70184d Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 26 Aug 2008 00:26:42 +0000 Subject: [PATCH 169/388] More header fixes. svn path=/branches/ros-amd64-bringup/; revision=35652 --- reactos/include/psdk/prsht.h | 4 ++-- reactos/include/psdk/shellapi.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/include/psdk/prsht.h b/reactos/include/psdk/prsht.h index ed7f087e4e1..1a3f4def096 100644 --- a/reactos/include/psdk/prsht.h +++ b/reactos/include/psdk/prsht.h @@ -287,8 +287,8 @@ typedef struct _PSHNOTIFY { HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA); HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW); BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE); -int WINAPI PropertySheetA(LPCPROPSHEETHEADERA); -int WINAPI PropertySheetW(LPCPROPSHEETHEADERW); +INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA); +INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW); #define PropSheet_AddPage(d,p) SendMessage(d,PSM_ADDPAGE,0,(LPARAM)p) #define PropSheet_Apply(d) SendMessage(d,PSM_APPLY,0,0) #define PropSheet_CancelToClose(d) SendMessage(d,PSM_CANCELTOCLOSE,0,0) diff --git a/reactos/include/psdk/shellapi.h b/reactos/include/psdk/shellapi.h index 0ec5510a089..8ee54f0df5a 100644 --- a/reactos/include/psdk/shellapi.h +++ b/reactos/include/psdk/shellapi.h @@ -334,8 +334,8 @@ BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW); int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA); int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW); void WINAPI SHFreeNameMappings(HANDLE); -DWORD WINAPI SHGetFileInfoA(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT); -DWORD WINAPI SHGetFileInfoW(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); +DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT); +DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); BOOL WINAPI SHGetNewLinkInfoA(LPCSTR,LPCSTR,LPSTR,BOOL*,UINT); BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR,LPCWSTR,LPWSTR,BOOL*,UINT); HRESULT WINAPI SHQueryRecycleBinA(LPCSTR, LPSHQUERYRBINFO); From 69bb41bdc48727ae36c51b0a8b344a4035a1ef77 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 26 Aug 2008 02:19:29 +0000 Subject: [PATCH 170/388] Remove unneeded msvcrt dependancies(all win32 modules depend on msvcrt already) dbghelp: Don't use old style parameter lists. kernel32: Remove stdcall decorations from amd64 asm. user32: Convert to spec file. console: Convert to spec file. Misc WIN64 fixes. svn path=/branches/ros-amd64-bringup/; revision=35655 --- reactos/dll/3rdparty/mesa32/mesa32.rbuild | 1 - reactos/dll/cpl/appwiz-new/appwiz.rbuild | 1 - reactos/dll/cpl/appwiz/appwiz.rbuild | 1 - reactos/dll/cpl/console/console.def | 6 - reactos/dll/cpl/console/console.spec | 1 + reactos/dll/cpl/desk/desk.rbuild | 1 - reactos/dll/cpl/input/input.rbuild | 1 - reactos/dll/cpl/intl/intl.rbuild | 1 - reactos/dll/cpl/joy/joy.rbuild | 1 - reactos/dll/cpl/main/main.rbuild | 1 - reactos/dll/cpl/mmsys/mmsys.rbuild | 1 - reactos/dll/cpl/odbccp32/odbccp32.rbuild | 1 - reactos/dll/cpl/powercfg/powercfg.rbuild | 1 - reactos/dll/cpl/sysdm/sysdm.rbuild | 1 - reactos/dll/cpl/telephon/telephon.rbuild | 1 - reactos/dll/cpl/timedate/timedate.rbuild | 1 - reactos/dll/cpl/usrmgr/usrmgr.rbuild | 1 - reactos/dll/directx/ddraw/ddraw.rbuild | 1 - reactos/dll/directx/directx.rbuild | 3 - reactos/dll/directx/dsound/dsound.rbuild | 1 - reactos/dll/ntdll/def/ntdll_amd64.def | 1 + reactos/dll/shellext/deskadp/deskadp.rbuild | 1 - reactos/dll/shellext/deskmon/deskmon.rbuild | 1 - reactos/dll/shellext/fontext/fontext.rbuild | 1 - reactos/dll/win32/advapi32/advapi32.spec | 2 +- reactos/dll/win32/advapi32/sec/misc.c | 6 +- reactos/dll/win32/dbghelp/regex.c | 6 +- reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild | 1 - reactos/dll/win32/dnsapi/dnsapi.rbuild | 1 - reactos/dll/win32/gdi32/gdi32.rbuild | 4 +- reactos/dll/win32/glu32/glu32.rbuild | 1 - reactos/dll/win32/icmp/icmp.rbuild | 1 - reactos/dll/win32/kernel32/kernel32.spec | 10 +- reactos/dll/win32/kernel32/misc/dllmain.c | 10 +- reactos/dll/win32/kernel32/misc/errormsg.c | 4 +- reactos/dll/win32/kernel32/misc/toolhelp.c | 8 +- reactos/dll/win32/kernel32/synch/critical.c | 27 +- .../dll/win32/kernel32/thread/amd64/fiber.S | 4 +- .../dll/win32/kernel32/thread/amd64/thread.S | 8 +- reactos/dll/win32/msvcrt/msvcrt.def | 12 +- reactos/dll/win32/opengl32/opengl32.h | 2 - reactos/dll/win32/shell32/autocomplete.c | 2 +- reactos/dll/win32/shell32/changenotify.c | 6 +- .../dll/win32/user32/include/dde_private.h | 2 +- reactos/dll/win32/user32/include/user32.h | 2 +- reactos/dll/win32/user32/misc/dde.c | 2 +- reactos/dll/win32/user32/misc/ddeserver.c | 2 +- reactos/dll/win32/user32/user32.def | 743 ----------------- reactos/dll/win32/user32/user32.rbuild | 5 +- reactos/dll/win32/user32/user32.spec | 769 ++++++++++++++++++ reactos/dll/win32/user32/windows/draw.c | 2 +- reactos/dll/win32/user32/windows/menu.c | 8 +- .../dll/win32/winmm/midimap/midimap.rbuild | 1 - reactos/dll/win32/ws2_32/misc/stubs.c | 2 +- reactos/dll/win32/ws2_32/ws2_32.rbuild | 4 +- reactos/dll/win32/ws2_32/ws2_32.spec | 119 +++ 56 files changed, 971 insertions(+), 836 deletions(-) delete mode 100644 reactos/dll/cpl/console/console.def create mode 100644 reactos/dll/cpl/console/console.spec delete mode 100644 reactos/dll/win32/user32/user32.def create mode 100644 reactos/dll/win32/user32/user32.spec create mode 100644 reactos/dll/win32/ws2_32/ws2_32.spec diff --git a/reactos/dll/3rdparty/mesa32/mesa32.rbuild b/reactos/dll/3rdparty/mesa32/mesa32.rbuild index 5afb01eb1ba..88d4c16cef3 100644 --- a/reactos/dll/3rdparty/mesa32/mesa32.rbuild +++ b/reactos/dll/3rdparty/mesa32/mesa32.rbuild @@ -5,7 +5,6 @@ -enable-stdcall-fixup ntdll kernel32 - msvcrt user32 diff --git a/reactos/dll/cpl/appwiz-new/appwiz.rbuild b/reactos/dll/cpl/appwiz-new/appwiz.rbuild index e284dfb7a0b..1a77bdc7139 100644 --- a/reactos/dll/cpl/appwiz-new/appwiz.rbuild +++ b/reactos/dll/cpl/appwiz-new/appwiz.rbuild @@ -11,7 +11,6 @@ advapi32 user32 comctl32 - msvcrt ole32 uuid shell32 diff --git a/reactos/dll/cpl/appwiz/appwiz.rbuild b/reactos/dll/cpl/appwiz/appwiz.rbuild index 87ba21a755b..9c8370f5bd7 100644 --- a/reactos/dll/cpl/appwiz/appwiz.rbuild +++ b/reactos/dll/cpl/appwiz/appwiz.rbuild @@ -9,7 +9,6 @@ advapi32 user32 comctl32 - msvcrt ole32 uuid shell32 diff --git a/reactos/dll/cpl/console/console.def b/reactos/dll/cpl/console/console.def deleted file mode 100644 index c1622ec4db8..00000000000 --- a/reactos/dll/cpl/console/console.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY console.dll - -EXPORTS -CPlApplet - -; EOF diff --git a/reactos/dll/cpl/console/console.spec b/reactos/dll/cpl/console/console.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/console/console.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) diff --git a/reactos/dll/cpl/desk/desk.rbuild b/reactos/dll/cpl/desk/desk.rbuild index f62e42806cd..4fab693ed21 100644 --- a/reactos/dll/cpl/desk/desk.rbuild +++ b/reactos/dll/cpl/desk/desk.rbuild @@ -18,7 +18,6 @@ shell32 ntdll msimg32 - msvcrt uuid advmon.c appearance.c diff --git a/reactos/dll/cpl/input/input.rbuild b/reactos/dll/cpl/input/input.rbuild index c666613586a..2e28fdc6a90 100644 --- a/reactos/dll/cpl/input/input.rbuild +++ b/reactos/dll/cpl/input/input.rbuild @@ -9,7 +9,6 @@ advapi32 user32 comctl32 - msvcrt gdi32 input.c settings.c diff --git a/reactos/dll/cpl/intl/intl.rbuild b/reactos/dll/cpl/intl/intl.rbuild index bf29868a45b..e25acc8c93e 100644 --- a/reactos/dll/cpl/intl/intl.rbuild +++ b/reactos/dll/cpl/intl/intl.rbuild @@ -11,7 +11,6 @@ comctl32 advapi32 setupapi - msvcrt shell32 currency.c date.c diff --git a/reactos/dll/cpl/joy/joy.rbuild b/reactos/dll/cpl/joy/joy.rbuild index f277e79a79b..8acde89a882 100644 --- a/reactos/dll/cpl/joy/joy.rbuild +++ b/reactos/dll/cpl/joy/joy.rbuild @@ -10,7 +10,6 @@ advapi32 user32 comctl32 - msvcrt ole32 uuid shell32 diff --git a/reactos/dll/cpl/main/main.rbuild b/reactos/dll/cpl/main/main.rbuild index bebfe3e8b0f..6867590fc24 100644 --- a/reactos/dll/cpl/main/main.rbuild +++ b/reactos/dll/cpl/main/main.rbuild @@ -13,7 +13,6 @@ comdlg32 shell32 gdi32 - msvcrt keyboard.c main.c mouse.c diff --git a/reactos/dll/cpl/mmsys/mmsys.rbuild b/reactos/dll/cpl/mmsys/mmsys.rbuild index 80d234d1332..918a87a7d93 100644 --- a/reactos/dll/cpl/mmsys/mmsys.rbuild +++ b/reactos/dll/cpl/mmsys/mmsys.rbuild @@ -8,7 +8,6 @@ kernel32 user32 comctl32 - msvcrt devmgr gdi32 winmm diff --git a/reactos/dll/cpl/odbccp32/odbccp32.rbuild b/reactos/dll/cpl/odbccp32/odbccp32.rbuild index 2bfd476a5c0..925c1587b64 100644 --- a/reactos/dll/cpl/odbccp32/odbccp32.rbuild +++ b/reactos/dll/cpl/odbccp32/odbccp32.rbuild @@ -8,7 +8,6 @@ kernel32 user32 comctl32 - msvcrt odbccp32.c odbccp32.rc diff --git a/reactos/dll/cpl/powercfg/powercfg.rbuild b/reactos/dll/cpl/powercfg/powercfg.rbuild index 32de07e8079..a21c05da971 100644 --- a/reactos/dll/cpl/powercfg/powercfg.rbuild +++ b/reactos/dll/cpl/powercfg/powercfg.rbuild @@ -11,7 +11,6 @@ powrprof comctl32 shell32 - msvcrt advapi32 powercfg.c powershemes.c diff --git a/reactos/dll/cpl/sysdm/sysdm.rbuild b/reactos/dll/cpl/sysdm/sysdm.rbuild index 3794645b895..2e4e351fd4a 100644 --- a/reactos/dll/cpl/sysdm/sysdm.rbuild +++ b/reactos/dll/cpl/sysdm/sysdm.rbuild @@ -9,7 +9,6 @@ kernel32 advapi32 setupapi - msvcrt user32 gdi32 comctl32 diff --git a/reactos/dll/cpl/telephon/telephon.rbuild b/reactos/dll/cpl/telephon/telephon.rbuild index e5ca0f254fd..49e8e385d78 100644 --- a/reactos/dll/cpl/telephon/telephon.rbuild +++ b/reactos/dll/cpl/telephon/telephon.rbuild @@ -10,7 +10,6 @@ advapi32 user32 comctl32 - msvcrt ole32 uuid shell32 diff --git a/reactos/dll/cpl/timedate/timedate.rbuild b/reactos/dll/cpl/timedate/timedate.rbuild index e703d77a0ac..d90012a0b30 100644 --- a/reactos/dll/cpl/timedate/timedate.rbuild +++ b/reactos/dll/cpl/timedate/timedate.rbuild @@ -12,7 +12,6 @@ comctl32 ws2_32 iphlpapi - msvcrt clock.c dateandtime.c internettime.c diff --git a/reactos/dll/cpl/usrmgr/usrmgr.rbuild b/reactos/dll/cpl/usrmgr/usrmgr.rbuild index 798e1d53807..54783ddcaab 100644 --- a/reactos/dll/cpl/usrmgr/usrmgr.rbuild +++ b/reactos/dll/cpl/usrmgr/usrmgr.rbuild @@ -13,7 +13,6 @@ comctl32 ntdll netapi32 - msvcrt extra.c groupprops.c groups.c diff --git a/reactos/dll/directx/ddraw/ddraw.rbuild b/reactos/dll/directx/ddraw/ddraw.rbuild index d91a0f0d608..20dcb778553 100644 --- a/reactos/dll/directx/ddraw/ddraw.rbuild +++ b/reactos/dll/directx/ddraw/ddraw.rbuild @@ -14,7 +14,6 @@ ole32 user32 advapi32 - msvcrt pseh ddraw.rc diff --git a/reactos/dll/directx/directx.rbuild b/reactos/dll/directx/directx.rbuild index 4cee3b3737e..4623a61606e 100644 --- a/reactos/dll/directx/directx.rbuild +++ b/reactos/dll/directx/directx.rbuild @@ -44,7 +44,4 @@ - - - diff --git a/reactos/dll/directx/dsound/dsound.rbuild b/reactos/dll/directx/dsound/dsound.rbuild index 3053ec1308c..f27fe9b205f 100644 --- a/reactos/dll/directx/dsound/dsound.rbuild +++ b/reactos/dll/directx/dsound/dsound.rbuild @@ -17,7 +17,6 @@ ole32 winmm dxguid - msvcrt version.rc buffer.c capture.c diff --git a/reactos/dll/ntdll/def/ntdll_amd64.def b/reactos/dll/ntdll/def/ntdll_amd64.def index 3b1d2fbd903..6d1c9cb0639 100644 --- a/reactos/dll/ntdll/def/ntdll_amd64.def +++ b/reactos/dll/ntdll/def/ntdll_amd64.def @@ -581,6 +581,7 @@ RtlLookupElementGenericTable RtlLookupElementGenericTableAvl RtlLookupElementGenericTableFull RtlLookupElementGenericTableFullAvl +RtlLookupFunctionEntry ;WIN64 RtlMakeSelfRelativeSD RtlMapGenericMask RtlMergeRangeLists diff --git a/reactos/dll/shellext/deskadp/deskadp.rbuild b/reactos/dll/shellext/deskadp/deskadp.rbuild index 7a3d3c23c30..8b454cdd576 100644 --- a/reactos/dll/shellext/deskadp/deskadp.rbuild +++ b/reactos/dll/shellext/deskadp/deskadp.rbuild @@ -11,7 +11,6 @@ comctl32 ole32 uuid - msvcrt deskadp.c shxiface.c deskadp.rc diff --git a/reactos/dll/shellext/deskmon/deskmon.rbuild b/reactos/dll/shellext/deskmon/deskmon.rbuild index 443df5546fa..b78bcba1a99 100644 --- a/reactos/dll/shellext/deskmon/deskmon.rbuild +++ b/reactos/dll/shellext/deskmon/deskmon.rbuild @@ -11,7 +11,6 @@ comctl32 ole32 uuid - msvcrt deskmon.c shxiface.c deskmon.rc diff --git a/reactos/dll/shellext/fontext/fontext.rbuild b/reactos/dll/shellext/fontext/fontext.rbuild index 7986fee6620..c299cd8675a 100644 --- a/reactos/dll/shellext/fontext/fontext.rbuild +++ b/reactos/dll/shellext/fontext/fontext.rbuild @@ -10,7 +10,6 @@ gdi32 ole32 uuid - msvcrt shlwapi lz32 advapi32 diff --git a/reactos/dll/win32/advapi32/advapi32.spec b/reactos/dll/win32/advapi32/advapi32.spec index f8ae684f6a5..b601d258df2 100644 --- a/reactos/dll/win32/advapi32/advapi32.spec +++ b/reactos/dll/win32/advapi32/advapi32.spec @@ -415,7 +415,7 @@ @ stub MakeAbsoluteSD2 @ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall MakeSelfRelativeSD(ptr ptr ptr) - @ stdcall MapGenericMask (ptr ptr) NTDLL.RtlMapGenericMask + @ stdcall MapGenericMask(ptr ptr) ntdll.MapGenericMask @ stdcall NotifyBootConfigStatus(long) @ stdcall NotifyChangeEventLog (long long) @ stdcall ObjectCloseAuditAlarmA(str ptr long) diff --git a/reactos/dll/win32/advapi32/sec/misc.c b/reactos/dll/win32/advapi32/sec/misc.c index 2455a7c1608..06cfca8b134 100644 --- a/reactos/dll/win32/advapi32/sec/misc.c +++ b/reactos/dll/win32/advapi32/sec/misc.c @@ -185,7 +185,7 @@ CheckNtMartaPresent(VOID) { DWORD ErrorCode; - if (InterlockedCompareExchangePointer(&NtMarta, + if (InterlockedCompareExchangePointer((PVOID)&NtMarta, NULL, NULL) == NULL) { @@ -196,7 +196,7 @@ CheckNtMartaPresent(VOID) if (ErrorCode == ERROR_SUCCESS) { /* try change the NtMarta pointer */ - if (InterlockedCompareExchangePointer(&NtMarta, + if (InterlockedCompareExchangePointer((PVOID)&NtMarta, &NtMartaStatic, NULL) != NULL) { @@ -223,7 +223,7 @@ CheckNtMartaPresent(VOID) VOID UnloadNtMarta(VOID) { - if (InterlockedExchangePointer(&NtMarta, + if (InterlockedExchangePointer((PVOID)&NtMarta, NULL) != NULL) { FreeLibrary(NtMartaStatic.hDllInstance); diff --git a/reactos/dll/win32/dbghelp/regex.c b/reactos/dll/win32/dbghelp/regex.c index 0410e3ebf35..504b9b4dc1f 100644 --- a/reactos/dll/win32/dbghelp/regex.c +++ b/reactos/dll/win32/dbghelp/regex.c @@ -5790,11 +5790,7 @@ weak_alias (__regexec, regexec) from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (errcode, preg, errbuf, errbuf_size) - int errcode; - const regex_t *preg; - char *errbuf; - size_t errbuf_size; +regerror (int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) { const char *msg; size_t msg_size; diff --git a/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild b/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild index 6964d56c0a9..9ccf4e5979c 100644 --- a/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild +++ b/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild @@ -5,7 +5,6 @@ ntdll kernel32 - msvcrt ws2_32 iphlpapi dhcpcsvc.c diff --git a/reactos/dll/win32/dnsapi/dnsapi.rbuild b/reactos/dll/win32/dnsapi/dnsapi.rbuild index a1fbb53ffdf..ad4b273d6d7 100644 --- a/reactos/dll/win32/dnsapi/dnsapi.rbuild +++ b/reactos/dll/win32/dnsapi/dnsapi.rbuild @@ -9,7 +9,6 @@ ntdll kernel32 user32 - msvcrt ws2_32 iphlpapi diff --git a/reactos/dll/win32/gdi32/gdi32.rbuild b/reactos/dll/win32/gdi32/gdi32.rbuild index f5037eb2829..6bb303e1e1f 100644 --- a/reactos/dll/win32/gdi32/gdi32.rbuild +++ b/reactos/dll/win32/gdi32/gdi32.rbuild @@ -1,5 +1,5 @@ - - + + include 0x0600 diff --git a/reactos/dll/win32/glu32/glu32.rbuild b/reactos/dll/win32/glu32/glu32.rbuild index 3ce372d13ba..4668301fc52 100644 --- a/reactos/dll/win32/glu32/glu32.rbuild +++ b/reactos/dll/win32/glu32/glu32.rbuild @@ -14,7 +14,6 @@ opengl32 kernel32 gdi32 - msvcrt bezierEval.cc diff --git a/reactos/dll/win32/icmp/icmp.rbuild b/reactos/dll/win32/icmp/icmp.rbuild index 295a5653728..e490e9e7ce1 100644 --- a/reactos/dll/win32/icmp/icmp.rbuild +++ b/reactos/dll/win32/icmp/icmp.rbuild @@ -7,7 +7,6 @@ kernel32 ws2_32 wine - msvcrt icmp_main.c icmp.rc icmp.spec diff --git a/reactos/dll/win32/kernel32/kernel32.spec b/reactos/dll/win32/kernel32/kernel32.spec index be042123c53..a5471da0ecc 100644 --- a/reactos/dll/win32/kernel32/kernel32.spec +++ b/reactos/dll/win32/kernel32/kernel32.spec @@ -310,10 +310,10 @@ @ stdcall GetConsoleAliasesW(wstr long wstr) @ stdcall GetConsoleCP() @ stub GetConsoleCharType -@ stdcall GetConsoleCommandHistoryA(long long long) #check -@ stdcall GetConsoleCommandHistoryLengthA(long)#check -@ stdcall GetConsoleCommandHistoryLengthW(long)#check -@ stdcall GetConsoleCommandHistoryW(long long long)#check +@ stdcall GetConsoleCommandHistoryA(long long long) +@ stdcall GetConsoleCommandHistoryLengthA(long) +@ stdcall GetConsoleCommandHistoryLengthW(long) +@ stdcall GetConsoleCommandHistoryW(long long long) @ stdcall GetConsoleCursorInfo(long ptr) @ stub GetConsoleCursorMode @ stdcall GetConsoleDisplayMode(ptr) @@ -763,6 +763,8 @@ @ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory @ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory @ stdcall RtlUnwind(ptr ptr ptr long) ntdll.RtlUnwind +@ stdcall RtlVirtualUnwind(ptr ptr ptr long) ntdll.RtlVirtualUnwind +@ stdcall RtlLookupFunctionEntry(ptr ptr ptr) ntdll.RtlLookupFunctionEntry @ stdcall RtlZeroMemory(ptr long) ntdll.RtlZeroMemory @ stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr) @ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) diff --git a/reactos/dll/win32/kernel32/misc/dllmain.c b/reactos/dll/win32/kernel32/misc/dllmain.c index caa13c1b11d..34d09859c6f 100644 --- a/reactos/dll/win32/kernel32/misc/dllmain.c +++ b/reactos/dll/win32/kernel32/misc/dllmain.c @@ -394,6 +394,15 @@ DllMain(HANDLE hDll, return TRUE; } +//wtf +#ifdef _WIN64 +#undef InterlockedIncrement +#undef InterlockedDecrement +#undef InterlockedExchange +#undef InterlockedExchangeAdd +#undef InterlockedCompareExchange +#endif + LONG WINAPI InterlockedIncrement(IN OUT LONG volatile *lpAddend) @@ -408,7 +417,6 @@ InterlockedDecrement(IN OUT LONG volatile *lpAddend) return _InterlockedDecrement(lpAddend); } -#undef InterlockedExchange LONG WINAPI InterlockedExchange(IN OUT LONG volatile *Target, diff --git a/reactos/dll/win32/kernel32/misc/errormsg.c b/reactos/dll/win32/kernel32/misc/errormsg.c index 297f58e9eb7..d3fb5c8ce76 100644 --- a/reactos/dll/win32/kernel32/misc/errormsg.c +++ b/reactos/dll/win32/kernel32/misc/errormsg.c @@ -88,7 +88,7 @@ static LPSTR load_messageA( HMODULE module, UINT id, WORD lang ) TRACE("module = %p, id = %08x\n", module, id ); if (!module) module = GetModuleHandleW( NULL ); - Status = RtlFindMessage( module, (ULONG) RT_MESSAGETABLE, lang, id, &mre ); + Status = RtlFindMessage( module, (ULONG_PTR) RT_MESSAGETABLE, lang, id, &mre ); if (!NT_SUCCESS(Status)) return NULL; @@ -119,7 +119,7 @@ static LPWSTR load_messageW( HMODULE module, UINT id, WORD lang ) TRACE("module = %p, id = %08x\n", module, id ); if (!module) module = GetModuleHandleW( NULL ); - Status = RtlFindMessage( module, (ULONG) RT_MESSAGETABLE, lang, id, &mre ); + Status = RtlFindMessage( module, (ULONG_PTR) RT_MESSAGETABLE, lang, id, &mre ); if (!NT_SUCCESS(Status)) return NULL; diff --git a/reactos/dll/win32/kernel32/misc/toolhelp.c b/reactos/dll/win32/kernel32/misc/toolhelp.c index 1cac914d34a..c2773f7e6a4 100644 --- a/reactos/dll/win32/kernel32/misc/toolhelp.c +++ b/reactos/dll/win32/kernel32/misc/toolhelp.c @@ -400,11 +400,11 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags, ProcessListEntry->dwSize = sizeof(PROCESSENTRY32W); ProcessListEntry->cntUsage = 0; /* no longer used */ - ProcessListEntry->th32ProcessID = (ULONG)ProcessInfo->UniqueProcessId; + ProcessListEntry->th32ProcessID = (ULONG_PTR)ProcessInfo->UniqueProcessId; ProcessListEntry->th32DefaultHeapID = 0; /* no longer used */ ProcessListEntry->th32ModuleID = 0; /* no longer used */ ProcessListEntry->cntThreads = ProcessInfo->NumberOfThreads; - ProcessListEntry->th32ParentProcessID = (ULONG)ProcessInfo->InheritedFromUniqueProcessId; + ProcessListEntry->th32ParentProcessID = (ULONG_PTR)ProcessInfo->InheritedFromUniqueProcessId; ProcessListEntry->pcPriClassBase = ProcessInfo->BasePriority; ProcessListEntry->dwFlags = 0; /* no longer used */ if(ProcessInfo->ImageName.Buffer != NULL) @@ -447,8 +447,8 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags, { ThreadListEntry->dwSize = sizeof(THREADENTRY32); ThreadListEntry->cntUsage = 0; /* no longer used */ - ThreadListEntry->th32ThreadID = (ULONG)ThreadInfo->ClientId.UniqueThread; - ThreadListEntry->th32OwnerProcessID = (ULONG)ThreadInfo->ClientId.UniqueProcess; + ThreadListEntry->th32ThreadID = (ULONG_PTR)ThreadInfo->ClientId.UniqueThread; + ThreadListEntry->th32OwnerProcessID = (ULONG_PTR)ThreadInfo->ClientId.UniqueProcess; ThreadListEntry->tpBasePri = ThreadInfo->BasePriority; ThreadListEntry->tpDeltaPri = 0; /* no longer used */ ThreadListEntry->dwFlags = 0; /* no longer used */ diff --git a/reactos/dll/win32/kernel32/synch/critical.c b/reactos/dll/win32/kernel32/synch/critical.c index 65e24bbd356..ac5280a60bd 100644 --- a/reactos/dll/win32/kernel32/synch/critical.c +++ b/reactos/dll/win32/kernel32/synch/critical.c @@ -58,12 +58,27 @@ InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, /* * @implemented */ -#if 0 -BOOL WINAPI InitializeCriticalSectionEx( CRITICAL_SECTION *crit, DWORD spincount, DWORD flags ) +BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, + IN DWORD dwSpinCount, + IN DWORD flags ) { - NTSTATUS ret = RtlInitializeCriticalSectionEx( crit, spincount, flags ); - if (ret) RtlRaiseStatus( ret ); - return !ret; + NTSTATUS Status; + + /* FIXME: Flags ignored */ + + /* Initialize the critical section */ + Status = RtlInitializeCriticalSectionAndSpinCount( + (PRTL_CRITICAL_SECTION)lpCriticalSection, + dwSpinCount); + if (!NT_SUCCESS(Status)) + { + /* Set failure code */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Success */ + return TRUE; } -#endif + /* EOF */ diff --git a/reactos/dll/win32/kernel32/thread/amd64/fiber.S b/reactos/dll/win32/kernel32/thread/amd64/fiber.S index 00b3a17fb34..233174bcf78 100644 --- a/reactos/dll/win32/kernel32/thread/amd64/fiber.S +++ b/reactos/dll/win32/kernel32/thread/amd64/fiber.S @@ -12,10 +12,10 @@ #define CONTEXT_FULL 0x10007 #define CONTEXT_FLOATING_POINT 0xF -.globl _SwitchToFiber@4 +.globl _SwitchToFiber .intel_syntax noprefix -_SwitchToFiber@4: +_SwitchToFiber: /* Get the TEB */ mov edx, fs:[KGDT_R3_TEB] diff --git a/reactos/dll/win32/kernel32/thread/amd64/thread.S b/reactos/dll/win32/kernel32/thread/amd64/thread.S index 36bc0c31b14..320c798143f 100644 --- a/reactos/dll/win32/kernel32/thread/amd64/thread.S +++ b/reactos/dll/win32/kernel32/thread/amd64/thread.S @@ -6,11 +6,11 @@ * PROGRAMMER: Alex Ionescu (alex@relsoft.net) */ -.globl _BaseThreadStartupThunk@0 -.globl _BaseProcessStartThunk@0 +.globl _BaseThreadStartupThunk +.globl _BaseProcessStartThunk .intel_syntax noprefix -_BaseThreadStartupThunk@0: +_BaseThreadStartupThunk: /* Start out fresh */ xor rbp, rbp @@ -20,7 +20,7 @@ _BaseThreadStartupThunk@0: push 0 /* Return RIP */ jmp _BaseThreadStartup -_BaseProcessStartThunk@0: +_BaseProcessStartThunk: /* Start out fresh */ xor rbp, rbp diff --git a/reactos/dll/win32/msvcrt/msvcrt.def b/reactos/dll/win32/msvcrt/msvcrt.def index 977477266da..9d75329c60a 100644 --- a/reactos/dll/win32/msvcrt/msvcrt.def +++ b/reactos/dll/win32/msvcrt/msvcrt.def @@ -120,7 +120,7 @@ EXPORTS __fpecode @115 __getmainargs @116 __initenv @117 -; __iob_func @118 + __iob_func @118 __isascii @119 __iscsym @120 __iscsymf @121 @@ -271,10 +271,10 @@ EXPORTS _fileno @265 _findclose @266 _findfirst @267 -; _findfirst64 @268 + _findfirst64 @268 _findfirsti64 @269 _findnext @270 -; _findnext64 @271 + _findnext64 @271 _findnexti64 @272 _finite @273 _flsbuf @274 @@ -316,7 +316,7 @@ EXPORTS ; _getwche @310 _getws @311 _global_unwind2 @312 -; _gmtime64 @313 + _gmtime64 @313 _heapadd @314 _heapchk @315 _heapmin @316 @@ -372,7 +372,7 @@ EXPORTS _lfind @366 _loaddll @367 _local_unwind2 @368 -; _localtime64 @369 + _localtime64 @369 _lock @370 _locking @371 _logb @372 @@ -538,7 +538,7 @@ EXPORTS _tell @532 _telli64 @533 _tempnam @534 -; _time64 @535 + _time64 @535 _timezone @536 DATA _tolower @537 _toupper @538 diff --git a/reactos/dll/win32/opengl32/opengl32.h b/reactos/dll/win32/opengl32/opengl32.h index 6bee7837960..73b8a714e7c 100644 --- a/reactos/dll/win32/opengl32/opengl32.h +++ b/reactos/dll/win32/opengl32/opengl32.h @@ -11,9 +11,7 @@ #ifndef OPENGL32_PRIVATE_H #define OPENGL32_PRIVATE_H -#ifdef _MSC_VER #define snwprintf _snwprintf -#endif #ifdef __cplusplus extern "C" { diff --git a/reactos/dll/win32/shell32/autocomplete.c b/reactos/dll/win32/shell32/autocomplete.c index 0e3663fa9db..71cfffb8e5f 100644 --- a/reactos/dll/win32/shell32/autocomplete.c +++ b/reactos/dll/win32/shell32/autocomplete.c @@ -234,7 +234,7 @@ static HRESULT WINAPI IAutoComplete_fnInit( static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0}; TRACE("(%p)->(0x%08lx, %p, %s, %s)\n", - This, (long)hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete)); + This, hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete)); if (This->options & ACO_AUTOSUGGEST) TRACE(" ACO_AUTOSUGGEST\n"); if (This->options & ACO_AUTOAPPEND) TRACE(" ACO_AUTOAPPEND\n"); diff --git a/reactos/dll/win32/shell32/changenotify.c b/reactos/dll/win32/shell32/changenotify.c index 5784b8c5d3f..2bddd6ffb67 100644 --- a/reactos/dll/win32/shell32/changenotify.c +++ b/reactos/dll/win32/shell32/changenotify.c @@ -35,7 +35,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug = { 0, 0, &SHELL32_ChangenotifyCS, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": SHELL32_ChangenotifyCS") } + 0, 0, { (DWORD_PTR)0/*(__FILE__ ": SHELL32_ChangenotifyCS")*/ } }; static CRITICAL_SECTION SHELL32_ChangenotifyCS = { &critsect_debug, -1, 0, 0, 0, 0 }; @@ -225,7 +225,7 @@ SHChangeNotifyRegister( LeaveCriticalSection(&SHELL32_ChangenotifyCS); - return (ULONG)item; + return PtrToUlong(item); } /************************************************************************* @@ -239,7 +239,7 @@ BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify) EnterCriticalSection(&SHELL32_ChangenotifyCS); - node = FindNode((HANDLE)hNotify); + node = FindNode((HANDLE)UlongToPtr(hNotify)); if( node ) DeleteNode(node); diff --git a/reactos/dll/win32/user32/include/dde_private.h b/reactos/dll/win32/user32/include/dde_private.h index bf66d612cd8..c106715dd7f 100644 --- a/reactos/dll/win32/user32/include/dde_private.h +++ b/reactos/dll/win32/user32/include/dde_private.h @@ -212,7 +212,7 @@ extern WDML_CONV* WDML_GetConvFromWnd(HWND hWnd); extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic); extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode, - BOOL fBusy, BOOL fAck, UINT pmt, LPARAM lParam, UINT oldMsg); + BOOL fBusy, BOOL fAck, UINT_PTR pmt, LPARAM lParam, UINT oldMsg); extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, UINT wType, HSZ hszItem, UINT wFmt); extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, diff --git a/reactos/dll/win32/user32/include/user32.h b/reactos/dll/win32/user32/include/user32.h index 976241bce63..539c2a9637a 100644 --- a/reactos/dll/win32/user32/include/user32.h +++ b/reactos/dll/win32/user32/include/user32.h @@ -77,7 +77,7 @@ DesktopPtrToUser(PVOID Ptr) /* NOTE: This is slow as it requires a call to win32k. This should only be neccessary if a thread wants to access an object on a different desktop */ - return NtUserGetDesktopMapping(Ptr); + return (PVOID)NtUserGetDesktopMapping(Ptr); } } diff --git a/reactos/dll/win32/user32/misc/dde.c b/reactos/dll/win32/user32/misc/dde.c index a5617e9650e..b8a73dfce9f 100644 --- a/reactos/dll/win32/user32/misc/dde.c +++ b/reactos/dll/win32/user32/misc/dde.c @@ -46,7 +46,7 @@ CRITICAL_SECTION_DEBUG critsect_debug = { 0, 0, &WDML_CritSect, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": WDML_CritSect") } + 0, 0, { (DWORD_PTR)0/*(__FILE__ ": WDML_CritSect")*/ } }; CRITICAL_SECTION WDML_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 }; diff --git a/reactos/dll/win32/user32/misc/ddeserver.c b/reactos/dll/win32/user32/misc/ddeserver.c index 31db147cb45..7427390fa25 100644 --- a/reactos/dll/win32/user32/misc/ddeserver.c +++ b/reactos/dll/win32/user32/misc/ddeserver.c @@ -804,7 +804,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pX case DDE_FNOTPROCESSED: break; } - WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, (UINT)pXAct->hMem, 0, 0); + WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, (UINT_PTR)pXAct->hMem, 0, 0); return WDML_QS_HANDLED; } diff --git a/reactos/dll/win32/user32/user32.def b/reactos/dll/win32/user32/user32.def deleted file mode 100644 index ab4a7004921..00000000000 --- a/reactos/dll/win32/user32/user32.def +++ /dev/null @@ -1,743 +0,0 @@ -LIBRARY user32.dll - -EXPORTS -ActivateKeyboardLayout@8=NtUserActivateKeyboardLayout@8 -AdjustWindowRect@12 -AdjustWindowRectEx@16 -AlignRects@16 -AllowForegroundActivation@0 -AllowSetForegroundWindow@4 -AnimateWindow@12 -AnyPopup@0 -AppendMenuA@16 -AppendMenuW@16 -ArrangeIconicWindows@4 -AttachThreadInput@12 -BeginDeferWindowPos@4 -BeginPaint@8 -BlockInput@4 -BringWindowToTop@4 -BroadcastSystemMessage=BroadcastSystemMessageA@20 -BroadcastSystemMessageA@20 -BroadcastSystemMessageExA@24 -BroadcastSystemMessageExW@24 -BroadcastSystemMessageW@20 -;BuildReasonArray -;CalcMenuBar -CallMsgFilter=CallMsgFilterA@8 -CallMsgFilterA@8 -CallMsgFilterW@8 -CallNextHookEx@16 -CallWindowProcA@20 -CallWindowProcW@20 -CascadeChildWindows@8 -CascadeWindows@20 -ChangeClipboardChain@8 -ChangeDisplaySettingsA@8 -ChangeDisplaySettingsExA@20 -ChangeDisplaySettingsExW@20 -ChangeDisplaySettingsW@8 -ChangeMenuA@20 -ChangeMenuW@20 -CharLowerA@4 -CharLowerBuffA@8 -CharLowerBuffW@8 -CharLowerW@4 -CharNextA@4 -CharNextExA@12 -CharNextW@4 -CharPrevA@8 -CharPrevExA@16 -CharPrevW@8 -CharToOemA@8 -CharToOemBuffA@12 -CharToOemBuffW@12 -CharToOemW@8 -CharUpperA@4 -CharUpperBuffA@8 -CharUpperBuffW@8 -CharUpperW@4 -CheckDlgButton@12 -CheckMenuItem@12 -CheckMenuRadioItem@20 -CheckRadioButton@16 -ChildWindowFromPoint@12 -ChildWindowFromPointEx@16 -;CliImmSetHotKey -ClientThreadSetup@0 -ClientToScreen@8 -ClipCursor@4 -CloseClipboard@0 -CloseDesktop@4 -CloseWindow@4 -CloseWindowStation@4 -CopyAcceleratorTableA@12 -CopyAcceleratorTableW@12 -CopyCursor@4 -CopyIcon@4 -CopyImage@20 -CopyRect@8 -CountClipboardFormats@0 -CreateAcceleratorTableA@8 -CreateAcceleratorTableW@8 -CreateCaret@16 -CreateCursor@28 -CreateDesktopA@24 -CreateDesktopW@24 -CreateDialogIndirectParamA@20 -CreateDialogIndirectParamAorW@24 -CreateDialogIndirectParamW@20 -CreateDialogParamA@20 -CreateDialogParamW@20 -CreateIcon@28 -CreateIconFromResource@16 -CreateIconFromResourceEx@28 -CreateIconIndirect@4 -CreateMDIWindowA@40 -CreateMDIWindowW@40 -CreateMenu@0 -CreatePopupMenu@0 -;CreateSystemThreads -CreateWindowExA@48 -CreateWindowExW@48 -CreateWindowStationA@16 -CreateWindowStationW@16 -CsrBroadcastSystemMessageExW@24 -CtxInitUser32@0 -DdeAbandonTransaction@12 -DdeAccessData@8 -DdeAddData@16 -DdeClientTransaction@32 -DdeCmpStringHandles@8 -DdeConnect@16 -DdeConnectList@20 -DdeCreateDataHandle@28 -DdeCreateStringHandleA@12 -DdeCreateStringHandleW@12 -DdeDisconnect@4 -DdeDisconnectList@4 -DdeEnableCallback@12 -DdeFreeDataHandle@4 -DdeFreeStringHandle@8 -DdeGetData@16 -DdeGetLastError@4 -DdeGetQualityOfService@12 -DdeImpersonateClient@4 -DdeInitializeA@16 -DdeInitializeW@16 -DdeKeepStringHandle@8 -DdeNameService@16 -DdePostAdvise@12 -DdeQueryConvInfo@12 -DdeQueryNextServer@8 -DdeQueryStringA@20 -DdeQueryStringW@20 -DdeReconnect@4 -DdeSetQualityOfService@12 -DdeSetUserHandle@12 -DdeUnaccessData@4 -DdeUninitialize@4 -DefDlgProcA@16 -DefDlgProcW@16 -DefFrameProcA@20 -DefFrameProcW@20 -DefMDIChildProcA@16 -DefMDIChildProcW@16 -DefRawInputProc@12 -DefWindowProcA@16 -DefWindowProcW@16 -DeferWindowPos@32 -DeleteMenu@12 -DeregisterShellHookWindow@4 -DestroyAcceleratorTable@4 -DestroyCaret@0 -DestroyCursor@4 -DestroyIcon@4 -DestroyMenu@4 -;DestroyReasons -DestroyWindow@4 -;DeviceEventWorker -DialogBoxIndirectParamA@20 -DialogBoxIndirectParamAorW@24 -DialogBoxIndirectParamW@20 -DialogBoxParamA@20 -DialogBoxParamW@20 -DisableProcessWindowsGhosting@0 -DispatchMessageA@4 -DispatchMessageW@4 -DisplayExitWindowsWarnings@4 -DlgDirListA@20 -DlgDirListComboBoxA@20 -DlgDirListComboBoxW@20 -DlgDirListW@20 -DlgDirSelectComboBoxExA@16 -DlgDirSelectComboBoxExW@16 -DlgDirSelectExA@16 -DlgDirSelectExW@16 -DragDetect@12 -DragObject@20 -DrawAnimatedRects@16 -DrawCaption@16 -DrawCaptionTempA@28 -DrawCaptionTempW@28 -DrawEdge@16 -DrawFocusRect@8 -DrawFrame@16 -DrawFrameControl@16 -DrawIcon@16 -DrawIconEx@36 -DrawMenuBar@4 -DrawMenuBarTemp@20 -DrawStateA@40 -DrawStateW@40 -DrawTextA@20 -DrawTextExA@24 -DrawTextExW@24 -DrawTextW@20 -EditWndProc=EditWndProcA@16 -EmptyClipboard@0 -EnableMenuItem@12 -EnableScrollBar@12 -EnableWindow@8 -EndDeferWindowPos@4 -EndDialog@8 -EndMenu@0 -EndPaint@8 -EndTask@12 -EnterReaderModeHelper@4 -EnumChildWindows@12 -EnumClipboardFormats@4 -EnumDesktopWindows@12 -EnumDesktopsA@12 -EnumDesktopsW@12 -EnumDisplayDevicesA@16 -EnumDisplayDevicesW@16 -EnumDisplayMonitors@16 -EnumDisplaySettingsA@12 -EnumDisplaySettingsExA@16 -EnumDisplaySettingsExW@16 -EnumDisplaySettingsW@12 -EnumPropsA@8 -EnumPropsExA@12 -EnumPropsExW@12 -EnumPropsW@8 -EnumThreadWindows@12 -EnumWindowStationsA@8 -EnumWindowStationsW@8 -EnumWindows@8 -EqualRect@8 -ExcludeUpdateRgn@8 -ExitWindowsEx@8 -FillRect@12 -FindWindowA@8 -FindWindowExA@16 -FindWindowExW@16 -FindWindowW@8 -FlashWindow@8 -FlashWindowEx@4 -FrameRect@12 -FreeDDElParam@8 -;FullScreenControl -GetAccCursorInfo@4 -GetActiveWindow@0 -GetAltTabInfo=GetAltTabInfoA@20 -GetAltTabInfoA@20 -GetAltTabInfoW@20 -GetAncestor@8 -GetAppCompatFlags@4 -GetAppCompatFlags2@4 -GetAsyncKeyState@4 -GetCapture@0 -GetCaretBlinkTime@0 -GetCaretPos@4 -GetClassInfoA@12 -GetClassInfoExA@12 -GetClassInfoExW@12 -GetClassInfoW@12 -GetClassLongA@8 -GetClassLongW@8 -GetClassNameA@12 -GetClassNameW@12 -GetClassWord@8 -GetClientRect@8 -GetClipCursor@4 -GetClipboardData@4 -GetClipboardFormatNameA@12 -GetClipboardFormatNameW@12 -GetClipboardOwner@0 -GetClipboardSequenceNumber@0 -GetClipboardViewer@0 -GetComboBoxInfo@8 -GetCursor@0 -;GetCursorFrameInfo -GetCursorInfo@4 -GetCursorPos@4 -GetDC@4 -GetDCEx@12 -GetDesktopWindow@0 -GetDialogBaseUnits@0 -GetDlgCtrlID@4 -GetDlgItem@8 -GetDlgItemInt@16 -GetDlgItemTextA@16 -GetDlgItemTextW@16 -GetDoubleClickTime@0 -GetFocus@0 -GetForegroundWindow@0 -GetGUIThreadInfo@8 -GetGuiResources@8 -GetIconInfo@8 -GetInputDesktop@0 -GetInputState@0 -GetInternalWindowPos@12 -GetKBCodePage@0 -GetKeyNameTextA@12 -GetKeyNameTextW@12 -GetKeyState@4 -GetKeyboardLayout@4 -GetKeyboardLayoutList@8=NtUserGetKeyboardLayoutList@8 -GetKeyboardLayoutNameA@4 -GetKeyboardLayoutNameW@4 -GetKeyboardState@4 -GetKeyboardType@4 -GetLastActivePopup@4 -GetLastInputInfo@4 -GetLayeredWindowAttributes@16=NtUserGetLayeredWindowAttributes@16 -GetListBoxInfo@4 -GetMenu@4 -GetMenuBarInfo@16 -GetMenuCheckMarkDimensions@0 -GetMenuContextHelpId@4 -GetMenuDefaultItem@12 -GetMenuInfo@8 -GetMenuItemCount@4 -GetMenuItemID@8 -GetMenuItemInfoA@16 -GetMenuItemInfoW@16 -GetMenuItemRect@16 -GetMenuState@12 -GetMenuStringA@20 -GetMenuStringW@20 -GetMessageA@16 -GetMessageExtraInfo@0 -GetMessagePos@0 -GetMessageTime@0 -GetMessageW@16 -GetMonitorInfoA@8 -GetMonitorInfoW@8 -GetMouseMovePointsEx@20 -GetNextDlgGroupItem@12 -GetNextDlgTabItem@12 -GetOpenClipboardWindow@0 -GetParent@4 -GetPriorityClipboardFormat@8 -GetProcessDefaultLayout@4 -GetProcessWindowStation@0 -GetProgmanWindow@0 -GetPropA@8 -GetPropW@8 -GetQueueStatus@4 -GetRawInputBuffer@12 -GetRawInputData@20 -GetRawInputDeviceInfoA@16 -GetRawInputDeviceInfoW@16 -GetRawInputDeviceList@12 -;GetReasonTitleFromReasonCode -GetRegisteredRawInputDevices@12 -GetScrollBarInfo@12 -GetScrollInfo@12 -GetScrollPos@8 -GetScrollRange@16 -GetShellWindow@0 -GetSubMenu@8 -GetSysColor@4 -GetSysColorBrush@4 -GetSystemMenu@8 -GetSystemMetrics@4 -GetTabbedTextExtentA@20 -GetTabbedTextExtentW@20 -GetTaskmanWindow@0 -GetThreadDesktop@4 -GetTitleBarInfo@8 -GetTopWindow@4 -GetUpdateRect@12 -GetUpdateRgn@12 -GetUserObjectInformationA@20 -GetUserObjectInformationW@20 -GetUserObjectSecurity@20 -;GetWinStationInfo -GetWindow@8 -GetWindowContextHelpId@4 -GetWindowDC@4 -GetWindowInfo@8 -GetWindowLongA@8 -GetWindowLongW@8 -GetWindowModuleFileName=GetWindowModuleFileNameA@12 -GetWindowModuleFileNameA@12 -GetWindowModuleFileNameW@12 -GetWindowPlacement@8 -GetWindowRect@8 -GetWindowRgn@8 -GetWindowRgnBox@8 -GetWindowTextA@12 -GetWindowTextLengthA@4 -GetWindowTextLengthW@4 -GetWindowTextW@12 -GetWindowThreadProcessId@8 -GetWindowWord@8 -GrayStringA@36 -GrayStringW@36 -HideCaret@4=NtUserHideCaret@4 -HiliteMenuItem@16 -IMPGetIMEA@8 -IMPGetIMEW@8 -IMPQueryIMEA@4 -IMPQueryIMEW@4 -IMPSetIMEA@8 -IMPSetIMEW@8 -ImpersonateDdeClientWindow@8 -InSendMessage@0 -InSendMessageEx@4 -InflateRect@12 -InitializeLpkHooks@4 -InitializeWin32EntryTable@4 -InsertMenuA@20 -InsertMenuItemA@16 -InsertMenuItemW@16 -InsertMenuW@20 -InternalGetWindowText@12 -IntersectRect@12 -InvalidateRect@12=NtUserInvalidateRect@12 -InvalidateRgn@12 -InvertRect@8 -IsCharAlphaA@4 -IsCharAlphaNumericA@4 -IsCharAlphaNumericW@4 -IsCharAlphaW@4 -IsCharLowerA@4 -IsCharLowerW@4 -IsCharUpperA@4 -IsCharUpperW@4 -IsChild@8 -IsClipboardFormatAvailable@4 -IsDialogMessage=IsDialogMessageA@8 -IsDialogMessageA@8 -IsDialogMessageW@8 -IsDlgButtonChecked@8 -IsGUIThread@4 -IsHungAppWindow@4 -IsIconic@4 -IsMenu@4 -IsRectEmpty@4 -IsServerSideWindow@4 -IsWindow@4 -IsWindowEnabled@4 -IsWindowInDestroy@4 -IsWindowUnicode@4 -IsWindowVisible@4 -IsWinEventHookInstalled@4 -IsZoomed@4 -KillSystemTimer@8 -KillTimer@8 -LoadAcceleratorsA@8 -LoadAcceleratorsW@8 -LoadBitmapA@8 -LoadBitmapW@8 -LoadCursorA@8 -LoadCursorFromFileA@4 -LoadCursorFromFileW@4 -LoadCursorW@8 -LoadIconA@8 -LoadIconW@8 -LoadImageA@24 -LoadImageW@24 -LoadKeyboardLayoutA@8 -LoadKeyboardLayoutEx@12 -LoadKeyboardLayoutW@8 -LoadLocalFonts@0 -LoadMenuA@8 -LoadMenuIndirectA@4 -LoadMenuIndirectW@4 -LoadMenuW@8 -LoadRemoteFonts@0 -LoadStringA@16 -LoadStringW@16 -LockSetForegroundWindow@4 -LockWindowStation@4 -LockWindowUpdate@4 -LockWorkStation@0 -LookupIconIdFromDirectory@8 -LookupIconIdFromDirectoryEx@20 -MBToWCSEx@24 -MapDialogRect@8 -MapVirtualKeyA@8 -MapVirtualKeyExA@12 -MapVirtualKeyExW@12 -MapVirtualKeyW@8 -MapWindowPoints@16 -MB_GetString@4 -MenuItemFromPoint@16 -MenuWindowProcA@16 -MenuWindowProcW@16 -MessageBeep@4 -MessageBoxA@16 -MessageBoxExA@20 -MessageBoxExW@20 -MessageBoxIndirectA@4 -MessageBoxIndirectW@4 -MessageBoxTimeoutA@24 -MessageBoxTimeoutW@24 -MessageBoxW@16 -ModifyMenuA@20 -ModifyMenuW@20 -MonitorFromPoint@12 -MonitorFromRect@8 -MonitorFromWindow@8 -MoveWindow@24 -MsgWaitForMultipleObjects@20 -MsgWaitForMultipleObjectsEx@20 -NotifyWinEvent@16 -OemKeyScan@4 -OemToCharA@8 -OemToCharBuffA@12 -OemToCharBuffW@12 -OemToCharW@8 -OffsetRect@12 -OpenClipboard@4 -OpenDesktopA@16 -OpenDesktopW@16 -OpenIcon@4 -OpenInputDesktop@12 -OpenWindowStationA@12 -OpenWindowStationW@12 -PackDDElParam@12 -PaintDesktop@4 -;PaintMenuBar -PeekMessageA@20 -PeekMessageW@20 -PostMessageA@16 -PostMessageW@16 -PostQuitMessage@4 -PostThreadMessageA@16 -PostThreadMessageW@16 -PrintWindow@12 -PrivateCsrssManualGuiCheck@4 -PrivateCsrssInitialized@0 -PrivateExtractIconExA@20 -PrivateExtractIconExW@20 -PrivateExtractIconsA@32 -PrivateExtractIconsW@32 -;PrivateKDBreakPoint -;PrivateSetDbgTag -;PrivateSetRipFlags -PtInRect@12 -;QuerySendMessage -;QueryUserCounters -RealChildWindowFromPoint@12 -RealGetWindowClass=RealGetWindowClassA@12 -RealGetWindowClassA@12 -RealGetWindowClassW@12 -ReasonCodeNeedsBugID@4 -ReasonCodeNeedsComment@4 -;RecordShutdownReason -RedrawWindow@16 -RegisterClassA@4 -RegisterClassExA@4 -RegisterClassExW@4 -RegisterClassW@4 -RegisterClipboardFormatA@4 -RegisterClipboardFormatW@4 -RegisterDeviceNotificationA@12=RegisterDeviceNotificationW@12 -RegisterDeviceNotificationW@12 -RegisterHotKey@16 -RegisterLogonProcess@8 -RegisterMessagePumpHook@4 -RegisterRawInputDevices@12 -RegisterServicesProcess@4 -RegisterShellHookWindow@4 -RegisterSystemThread@8 -RegisterUserApiHook@8 -RegisterTasklist@4 -RegisterWindowMessageA@4 -RegisterWindowMessageW@4 -ReleaseCapture@0 -ReleaseDC@8 -RemoveMenu@12 -RemovePropA@8 -RemovePropW@8 -ReplyMessage@4 -;ResolveDesktopForWOW -ReuseDDElParam@20 -ScreenToClient@8 -ScrollChildren@16 -ScrollDC@28 -ScrollWindow@20 -ScrollWindowEx@32 -SendDlgItemMessageA@20 -SendDlgItemMessageW@20 -SendIMEMessageExA@8 -SendIMEMessageExW@8 -SendInput@12 -SendMessageA@16 -SendMessageCallbackA@24 -SendMessageCallbackW@24 -SendMessageTimeoutA@28 -SendMessageTimeoutW@28 -SendMessageW@16 -SendNotifyMessageA@16 -SendNotifyMessageW@16 -SetActiveWindow@4 -SetCapture@4 -SetCaretBlinkTime@4 -SetCaretPos@8 -SetClassLongA@12 -SetClassLongW@12 -SetClassWord@12 -SetClipboardData@8 -SetClipboardViewer@4 -;SetConsoleReserveKeys -SetCursor@4 -;SetCursorContents -SetCursorPos@8 -SetDebugErrorLevel@4 -SetDeskWallpaper@4 -SetDlgItemInt@16 -SetDlgItemTextA@12 -SetDlgItemTextW@12 -SetDoubleClickTime@4 -SetFocus@4 -SetForegroundWindow@4 -SetInternalWindowPos@16 -SetKeyboardState@4 -SetLastErrorEx@8 -SetLayeredWindowAttributes@16=NtUserSetLayeredWindowAttributes@16 -SetLogonNotifyWindow@8 -SetMenu@8 -SetMenuContextHelpId@8 -SetMenuDefaultItem@12 -SetMenuInfo@8 -SetMenuItemBitmaps@20 -SetMenuItemInfoA@16 -SetMenuItemInfoW@16 -SetMessageExtraInfo@4 -SetMessageQueue@4 -SetParent@8 -SetProcessDefaultLayout@4 -SetProcessWindowStation@4 -SetProgmanWindow@4 -SetPropA@12 -SetPropW@12 -SetRect@20 -SetRectEmpty@4 -SetScrollInfo@16 -SetScrollPos@16 -SetScrollRange@20 -SetShellWindow@4 -SetShellWindowEx@8 -SetSysColors@12 -SetSysColorsTemp@12 -SetSystemCursor@8 -SetSystemMenu@8 -SetSystemTimer@16 -SetTaskmanWindow@4 -SetThreadDesktop@4 -SetTimer@16 -SetUserObjectInformationA@16 -SetUserObjectInformationW@16 -SetUserObjectSecurity@12 -SetWinEventHook@28 -SetWindowContextHelpId@8 -SetWindowLongA@12 -SetWindowLongW@12 -SetWindowPlacement@8 -SetWindowPos@28 -SetWindowRgn@12 -SetWindowStationUser@16 -SetWindowTextA@8 -SetWindowTextW@8 -SetWindowWord@12 -SetWindowsHookA@8 -SetWindowsHookExA@16 -SetWindowsHookExW@16 -SetWindowsHookW@8 -ShowCaret@4=NtUserShowCaret@4 -ShowCursor@4 -ShowOwnedPopups@8 -ShowScrollBar@12 -ShowStartGlass@4 -ShowWindow@8 -ShowWindowAsync@8 -SoftModalMessageBox@4 -SubtractRect@12 -SwapMouseButton@4 -SwitchDesktop@4 -SwitchToThisWindow@8 -SystemParametersInfoA@16 -SystemParametersInfoW@16 -TabbedTextOutA@32 -TabbedTextOutW@32 -TileChildWindows@8 -TileWindows@20 -ToAscii@20 -ToAsciiEx@24 -ToUnicode@24 -ToUnicodeEx@28 -TrackMouseEvent@4 -TrackPopupMenu@28 -TrackPopupMenuEx@24 -TranslateAccelerator=TranslateAcceleratorA@12 -TranslateAcceleratorA@12 -TranslateAcceleratorW@12 -TranslateMDISysAccel@8 -TranslateMessage@4 -TranslateMessageEx@8 -UnhookWinEvent@4=NtUserUnhookWinEvent@4 -UnhookWindowsHook@8 -UnhookWindowsHookEx@4=NtUserUnhookWindowsHookEx@4 -UnionRect@12 -UnloadKeyboardLayout@4=NtUserUnloadKeyboardLayout@4 -UnlockWindowStation@4 -UnpackDDElParam@16 -UnregisterClassA@8 -UnregisterClassW@8 -UnregisterDeviceNotification@4 -UnregisterHotKey@8=NtUserUnregisterHotKey@8 -UnregisterMessagePumpHook@0 -UnregisterUserApiHook@0 -UpdateLayeredWindow@36 -UpdatePerUserSystemParameters@8 -UpdateWindow@4 -User32InitializeImmEntryTable@4 -UserClientDllInitialize=DllMain@12 -UserHandleGrantAccess@12 -;UserLpkPSMTextOut -;UserLpkTabbedTextOut -UserRealizePalette@4 -;UserRegisterWowHandlers -;VRipOutput -;VTagOutput -ValidateRect@8 -ValidateRgn@8 -VkKeyScanA@4 -VkKeyScanExA@8 -VkKeyScanExW@8 -VkKeyScanW@4 -WCSToMBEx@24 -WINNLSEnableIME@8 -WINNLSGetEnableStatus@4 -WINNLSGetIMEHotkey@4 -WaitForInputIdle@8 -WaitMessage@0 -;Win32PoolAllocationStats -WinHelpA@16 -WinHelpW@16 -WindowFromDC@4 -WindowFromPoint@8 -keybd_event@16 -mouse_event@20 -wsprintfA -wsprintfW -wvsprintfA@12 -wvsprintfW@12 - -; EOF diff --git a/reactos/dll/win32/user32/user32.rbuild b/reactos/dll/win32/user32/user32.rbuild index dcdd6727d1e..63c32e179af 100644 --- a/reactos/dll/win32/user32/user32.rbuild +++ b/reactos/dll/win32/user32/user32.rbuild @@ -1,5 +1,5 @@ - - + + . include include/reactos/subsys @@ -75,4 +75,5 @@ winpos.c user32.rc + user32.spec diff --git a/reactos/dll/win32/user32/user32.spec b/reactos/dll/win32/user32/user32.spec new file mode 100644 index 00000000000..e4c633eb052 --- /dev/null +++ b/reactos/dll/win32/user32/user32.spec @@ -0,0 +1,769 @@ +@ stdcall ActivateKeyboardLayout(long long) NtUserActivateKeyboardLayout +@ stdcall AdjustWindowRect(ptr long long) +@ stdcall AdjustWindowRectEx(ptr long long long) +@ stdcall AlignRects(ptr long long long) +@ stdcall AllowForegroundActivation() +@ stdcall AllowSetForegroundWindow (long) +@ stdcall AnimateWindow(long long long) +@ stdcall AnyPopup() +@ stdcall AppendMenuA(long long long ptr) +@ stdcall AppendMenuW(long long long ptr) +@ stdcall ArrangeIconicWindows(long) +@ stdcall AttachThreadInput(long long long) +@ stdcall BeginDeferWindowPos(long) +@ stdcall BeginPaint(long ptr) +@ stdcall BlockInput(long) +@ stdcall BringWindowToTop(long) +@ stdcall BroadcastSystemMessage(long ptr long long long) BroadcastSystemMessageA +@ stdcall BroadcastSystemMessageA(long ptr long long long) +@ stdcall BroadcastSystemMessageExA(long ptr long long long ptr) +@ stdcall BroadcastSystemMessageExW(long ptr long long long ptr) +@ stdcall BroadcastSystemMessageW(long ptr long long long) +# @ stub BuildReasonArray +@ stdcall CalcChildScroll(long long) +# @ stub CalcMenuBar +@ stdcall CallMsgFilter(ptr long) CallMsgFilterA +@ stdcall CallMsgFilterA(ptr long) +@ stdcall CallMsgFilterW(ptr long) +@ stdcall CallNextHookEx(long long long long) +@ stdcall CallWindowProcA(ptr long long long long) +@ stdcall CallWindowProcW(ptr long long long long) +@ stdcall CascadeChildWindows(long long) +@ stdcall CascadeWindows(long long ptr long ptr) +@ stdcall ChangeClipboardChain(long long) +@ stdcall ChangeDisplaySettingsA(ptr long) +@ stdcall ChangeDisplaySettingsExA(str ptr long long ptr) +@ stdcall ChangeDisplaySettingsExW(wstr ptr long long ptr) +@ stdcall ChangeDisplaySettingsW(ptr long) +@ stdcall ChangeMenuA(long long ptr long long) +@ stdcall ChangeMenuW(long long ptr long long) +@ stdcall CharLowerA(str) +@ stdcall CharLowerBuffA(str long) +@ stdcall CharLowerBuffW(wstr long) +@ stdcall CharLowerW(wstr) +@ stdcall CharNextA(str) +@ stdcall CharNextExA(long str long) +# @ stdcall CharNextExW(long wstr long) +@ stdcall CharNextW(wstr) +@ stdcall CharPrevA(str str) +@ stdcall CharPrevExA(long str str long) +# @ stdcall CharPrevExW(long wstr wstr long) +@ stdcall CharPrevW(wstr wstr) +@ stdcall CharToOemA(str ptr) +@ stdcall CharToOemBuffA(str ptr long) +@ stdcall CharToOemBuffW(wstr ptr long) +@ stdcall CharToOemW(wstr ptr) +@ stdcall CharUpperA(str) +@ stdcall CharUpperBuffA(str long) +@ stdcall CharUpperBuffW(wstr long) +@ stdcall CharUpperW(wstr) +@ stdcall CheckDlgButton(long long long) +@ stdcall CheckMenuItem(long long long) +@ stdcall CheckMenuRadioItem(long long long long long) +@ stdcall CheckRadioButton(long long long long) +@ stdcall ChildWindowFromPoint(long double) +@ stdcall ChildWindowFromPointEx(long double long) +@ stub CliImmSetHotKey +@ stub ClientThreadConnect +@ stub ClientThreadSetup +@ stdcall ClientToScreen(long ptr) +@ stdcall ClipCursor(ptr) +@ stdcall CloseClipboard() +@ stdcall CloseDesktop(long) +@ stdcall CloseWindow(long) +@ stdcall CloseWindowStation(long) +@ stdcall CopyAcceleratorTableA(long ptr long) +@ stdcall CopyAcceleratorTableW(long ptr long) +@ stdcall CopyIcon(long) +@ stdcall CopyImage(long long long long long) +@ stdcall CopyRect(ptr ptr) +@ stdcall CountClipboardFormats() +@ stdcall CreateAcceleratorTableA(ptr long) +@ stdcall CreateAcceleratorTableW(ptr long) +@ stdcall CreateCaret(long long long long) +@ stdcall CreateCursor(long long long long long ptr ptr) +@ stdcall CreateDesktopA(str str ptr long long ptr) +@ stdcall CreateDesktopW(wstr wstr ptr long long ptr) +@ stdcall CreateDialogIndirectParamA(long ptr long ptr long) +@ stdcall CreateDialogIndirectParamAorW(long ptr long ptr long long) +@ stdcall CreateDialogIndirectParamW(long ptr long ptr long) +@ stdcall CreateDialogParamA(long ptr long ptr long) +@ stdcall CreateDialogParamW(long ptr long ptr long) +@ stdcall CreateIcon(long long long long long ptr ptr) +@ stdcall CreateIconFromResource (ptr long long long) +@ stdcall CreateIconFromResourceEx(ptr long long long long long long) +@ stdcall CreateIconIndirect(ptr) +@ stdcall CreateMDIWindowA(ptr ptr long long long long long long long long) +@ stdcall CreateMDIWindowW(ptr ptr long long long long long long long long) +@ stdcall CreateMenu() +@ stdcall CreatePopupMenu() +# @ stub CreateSystemThreads +@ stdcall CreateWindowExA(long str str long long long long long long long long ptr) +@ stdcall CreateWindowExW(long wstr wstr long long long long long long long long ptr) +@ stdcall CreateWindowStationA(str long long ptr) +@ stdcall CreateWindowStationW(wstr long long ptr) +@ stdcall CsrBroadcastSystemMessageExW(long ptr long long long ptr) +@ stdcall CtxInitUser32() +@ stdcall DdeAbandonTransaction(long long long) +@ stdcall DdeAccessData(long ptr) +@ stdcall DdeAddData(long ptr long long) +@ stdcall DdeClientTransaction(ptr long long long long long long ptr) +@ stdcall DdeCmpStringHandles(long long) +@ stdcall DdeConnect(long long long ptr) +@ stdcall DdeConnectList(long long long long ptr) +@ stdcall DdeCreateDataHandle(long ptr long long long long long) +@ stdcall DdeCreateStringHandleA(long str long) +@ stdcall DdeCreateStringHandleW(long wstr long) +@ stdcall DdeDisconnect(long) +@ stdcall DdeDisconnectList(long) +@ stdcall DdeEnableCallback(long long long) +@ stdcall DdeFreeDataHandle(long) +@ stdcall DdeFreeStringHandle(long long) +@ stdcall DdeGetData(long ptr long long) +@ stdcall DdeGetLastError(long) +@ stdcall DdeGetQualityOfService(long long ptr) +@ stdcall DdeImpersonateClient(long) +@ stdcall DdeInitializeA(ptr ptr long long) +@ stdcall DdeInitializeW(ptr ptr long long) +@ stdcall DdeKeepStringHandle(long long) +@ stdcall DdeNameService(long long long long) +@ stdcall DdePostAdvise(long long long) +@ stdcall DdeQueryConvInfo(long long ptr) +@ stdcall DdeQueryNextServer(long long) +@ stdcall DdeQueryStringA(long long ptr long long) +@ stdcall DdeQueryStringW(long long ptr long long) +@ stdcall DdeReconnect(long) +@ stdcall DdeSetQualityOfService(long ptr ptr) +@ stdcall DdeSetUserHandle (long long long) +@ stdcall DdeUnaccessData(long) +@ stdcall DdeUninitialize(long) +@ stdcall DefDlgProcA(long long long long) +@ stdcall DefDlgProcW(long long long long) +@ stdcall DefFrameProcA(long long long long long) +@ stdcall DefFrameProcW(long long long long long) +@ stdcall DefMDIChildProcA(long long long long) +@ stdcall DefMDIChildProcW(long long long long) +@ stdcall DefRawInputProc(ptr long long) +@ stdcall DefWindowProcA(long long long long) +@ stdcall DefWindowProcW(long long long long) +@ stdcall DeferWindowPos(long long long long long long long long) +@ stdcall DeleteMenu(long long long) +@ stdcall DeregisterShellHookWindow (long) +@ stdcall DestroyAcceleratorTable(long) +@ stdcall DestroyCaret() +@ stdcall DestroyCursor(long) +@ stdcall DestroyIcon(long) +@ stdcall DestroyMenu(long) +# @ stub DestroyReasons +@ stdcall DestroyWindow(long) +# @ stub DeviceEventWorker +@ stdcall DialogBoxIndirectParamA(long ptr long ptr long) +@ stdcall DialogBoxIndirectParamAorW(long ptr long ptr long long) +@ stdcall DialogBoxIndirectParamW(long ptr long ptr long) +@ stdcall DialogBoxParamA(long str long ptr long) +@ stdcall DialogBoxParamW(long wstr long ptr long) +# @ stub DisableProcessWindowsGhosting +@ stdcall DispatchMessageA(ptr) +@ stdcall DispatchMessageW(ptr) +# @ stub DisplayExitWindowsWarnings +@ stdcall DlgDirListA(long str long long long) +@ stdcall DlgDirListComboBoxA(long ptr long long long) +@ stdcall DlgDirListComboBoxW(long ptr long long long) +@ stdcall DlgDirListW(long wstr long long long) +@ stdcall DlgDirSelectComboBoxExA(long ptr long long) +@ stdcall DlgDirSelectComboBoxExW(long ptr long long) +@ stdcall DlgDirSelectExA(long ptr long long) +@ stdcall DlgDirSelectExW(long ptr long long) +@ stdcall DragDetect(long double) +@ stdcall DragObject(long long long long long) +@ stdcall DrawAnimatedRects(long long ptr ptr) +@ stdcall DrawCaption(long long ptr long) +@ stdcall DrawCaptionTempA(long long ptr long long str long) +@ stdcall DrawCaptionTempW(long long ptr long long wstr long) +@ stdcall DrawEdge(long ptr long long) +@ stdcall DrawFocusRect(long ptr) +@ stub DrawFrame +@ stdcall DrawFrameControl(long ptr long long) +@ stdcall DrawIcon(long long long long) +@ stdcall DrawIconEx(long long long long long long long long long) +@ stdcall DrawMenuBar(long) +@ stdcall DrawMenuBarTemp(long long long long long) +@ stdcall DrawStateA(long long ptr long long long long long long long) +@ stdcall DrawStateW(long long ptr long long long long long long long) +@ stdcall DrawTextA(long str long ptr long) +@ stdcall DrawTextExA(long str long ptr long ptr) +@ stdcall DrawTextExW(long wstr long ptr long ptr) +@ stdcall DrawTextW(long wstr long ptr long) +@ stdcall EditWndProc(long long long long) EditWndProcA +@ stdcall EmptyClipboard() +@ stdcall EnableMenuItem(long long long) +@ stdcall EnableScrollBar(long long long) +@ stdcall EnableWindow(long long) +@ stdcall EndDeferWindowPos(long) +@ stdcall EndDialog(long long) +@ stdcall EndMenu() +@ stdcall EndPaint(long ptr) +@ stub EndTask +# @ stub EnterReaderModeHelper +@ stdcall EnumChildWindows(long ptr long) +@ stdcall EnumClipboardFormats(long) +@ stdcall EnumDesktopWindows(long ptr ptr) +@ stdcall EnumDesktopsA(ptr ptr long) +@ stdcall EnumDesktopsW(ptr ptr long) +@ stub EnumDisplayDeviceModesA #(str long ptr long) +@ stub EnumDisplayDeviceModesW #(wstr long ptr long) +@ stdcall EnumDisplayDevicesA(ptr long ptr long) +@ stdcall EnumDisplayDevicesW(ptr long ptr long) +@ stdcall EnumDisplayMonitors(long ptr ptr long) +@ stdcall EnumDisplaySettingsA(str long ptr) +@ stdcall EnumDisplaySettingsExA(str long ptr long) +@ stdcall EnumDisplaySettingsExW(wstr long ptr long) +@ stdcall EnumDisplaySettingsW(wstr long ptr ) +@ stdcall EnumPropsA(long ptr) +@ stdcall EnumPropsExA(long ptr long) +@ stdcall EnumPropsExW(long ptr long) +@ stdcall EnumPropsW(long ptr) +@ stdcall EnumThreadWindows(long ptr long) +@ stdcall EnumWindowStationsA(ptr long) +@ stdcall EnumWindowStationsW(ptr long) +@ stdcall EnumWindows(ptr long) +@ stdcall EqualRect(ptr ptr) +@ stdcall ExcludeUpdateRgn(long long) +@ stdcall ExitWindowsEx(long long) +@ stdcall FillRect(long ptr long) +@ stdcall FindWindowA(str str) +@ stdcall FindWindowExA(long long str str) +@ stdcall FindWindowExW(long long wstr wstr) +@ stdcall FindWindowW(wstr wstr) +@ stdcall FlashWindow(long long) +@ stdcall FlashWindowEx(ptr) +@ stdcall FrameRect(long ptr long) +@ stdcall FreeDDElParam(long long) +@ stdcall GetActiveWindow() +@ stdcall GetAltTabInfo(long long ptr ptr long) GetAltTabInfoA +@ stdcall GetAltTabInfoA(long long ptr ptr long) +@ stdcall GetAltTabInfoW(long long ptr ptr long) +@ stdcall GetAncestor(long long) +@ stdcall GetAppCompatFlags(long) +@ stdcall GetAppCompatFlags2(long) +@ stdcall GetAsyncKeyState(long) +@ stdcall GetCapture() +@ stdcall GetCaretBlinkTime() +@ stdcall GetCaretPos(ptr) +@ stdcall GetClassInfoA(long str ptr) +@ stdcall GetClassInfoExA(long str ptr) +@ stdcall GetClassInfoExW(long wstr ptr) +@ stdcall GetClassInfoW(long wstr ptr) +@ stdcall GetClassLongA(long long) +@ stdcall GetClassLongW(long long) +@ stub GetClassLongPtrA +@ stub GetClassLongPtrW +@ stdcall GetClassNameA(long ptr long) +@ stdcall GetClassNameW(long ptr long) +@ stdcall GetClassWord(long long) +@ stdcall GetClientRect(long long) +@ stdcall GetClipCursor(ptr) +@ stdcall GetClipboardData(long) +@ stdcall GetClipboardFormatNameA(long ptr long) +@ stdcall GetClipboardFormatNameW(long ptr long) +@ stdcall GetClipboardOwner() +@ stdcall GetClipboardSequenceNumber () +@ stdcall GetClipboardViewer() +@ stdcall GetComboBoxInfo(long ptr) +@ stdcall GetCursor() +# @ stub GetCursorFrameInfo +@ stdcall GetCursorInfo(ptr) +@ stdcall GetCursorPos(ptr) +@ stdcall GetDC(long) +@ stdcall GetDCEx(long long long) +@ stdcall GetDesktopWindow() +@ stdcall GetDialogBaseUnits() +@ stdcall GetDlgCtrlID(long) +@ stdcall GetDlgItem(long long) +@ stdcall GetDlgItemInt(long long ptr long) +@ stdcall GetDlgItemTextA(long long ptr long) +@ stdcall GetDlgItemTextW(long long ptr long) +@ stdcall GetDoubleClickTime() +@ stdcall GetFocus() +@ stdcall GetForegroundWindow() +@ stdcall GetGUIThreadInfo(long ptr) +@ stdcall GetGuiResources(long long) +@ stdcall GetIconInfo(long ptr) +@ stdcall GetInputDesktop() +@ stdcall GetInputState() +@ stdcall GetInternalWindowPos(long ptr ptr) +@ stdcall GetKBCodePage() +@ stdcall GetKeyNameTextA(long ptr long) +@ stdcall GetKeyNameTextW(long ptr long) +@ stdcall GetKeyState(long) +@ stdcall GetKeyboardLayout(long) +@ stdcall GetKeyboardLayoutList(long ptr) NtUserGetKeyboardLayoutList +@ stdcall GetKeyboardLayoutNameA(ptr) +@ stdcall GetKeyboardLayoutNameW(ptr) +@ stdcall GetKeyboardState(ptr) +@ stdcall GetKeyboardType(long) +@ stdcall GetLastActivePopup(long) +@ stdcall GetLastInputInfo(ptr) +@ stdcall GetLayeredWindowAttributes(long ptr ptr ptr) NtUserGetLayeredWindowAttributes +# @ stub GetListBoxInfo +@ stdcall GetMenu(long) +@ stdcall GetMenuBarInfo(long long long ptr) +@ stdcall GetMenuCheckMarkDimensions() +@ stdcall GetMenuContextHelpId(long) +@ stdcall GetMenuDefaultItem(long long long) +@ stub GetMenuIndex +@ stdcall GetMenuInfo(long ptr) +@ stdcall GetMenuItemCount(long) +@ stdcall GetMenuItemID(long long) +@ stdcall GetMenuItemInfoA(long long long ptr) +@ stdcall GetMenuItemInfoW(long long long ptr) +@ stdcall GetMenuItemRect(long long long ptr) +@ stdcall GetMenuState(long long long) +@ stdcall GetMenuStringA(long long ptr long long) +@ stdcall GetMenuStringW(long long ptr long long) +@ stdcall GetMessageA(ptr long long long) +@ stdcall GetMessageExtraInfo() +@ stdcall GetMessagePos() +@ stdcall GetMessageTime() +@ stdcall GetMessageW(ptr long long long) +@ stdcall GetMonitorInfoA(long ptr) +@ stdcall GetMonitorInfoW(long ptr) +@ stdcall GetMouseMovePointsEx(long ptr ptr long long) +@ stdcall GetNextDlgGroupItem(long long long) +@ stdcall GetNextDlgTabItem(long long long) +# @ stub GetNextQueueWindow +@ stdcall GetOpenClipboardWindow() +@ stdcall GetParent(long) +@ stdcall GetPriorityClipboardFormat(ptr long) +@ stdcall GetProcessDefaultLayout(ptr) +@ stdcall GetProcessWindowStation() +@ stdcall GetProgmanWindow () +@ stdcall GetPropA(long str) +@ stdcall GetPropW(long wstr) +@ stdcall GetQueueStatus(long) +@ stdcall GetRawInputBuffer(ptr ptr long) +@ stdcall GetRawInputData(ptr long ptr ptr long) +@ stdcall GetRawInputDeviceInfoA(ptr long ptr ptr) +@ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr) +@ stdcall GetRawInputDeviceList(ptr ptr long) +# @ stub GetReasonTitleFromReasonCode +@ stdcall GetRegisteredRawInputDevices(ptr ptr long) +@ stdcall GetScrollBarInfo(long long ptr) +@ stdcall GetScrollInfo(long long ptr) +@ stdcall GetScrollPos(long long) +@ stdcall GetScrollRange(long long ptr ptr) +@ stdcall GetShellWindow() +@ stdcall GetSubMenu(long long) +@ stdcall GetSysColor(long) +@ stdcall GetSysColorBrush(long) +@ stdcall GetSystemMenu(long long) +@ stdcall GetSystemMetrics(long) +@ stdcall GetTabbedTextExtentA(long str long long ptr) +@ stdcall GetTabbedTextExtentW(long wstr long long ptr) +@ stdcall GetTaskmanWindow () +@ stdcall GetThreadDesktop(long) +@ stdcall GetTitleBarInfo(long ptr) +@ stdcall GetTopWindow(long) +@ stdcall GetUpdateRect(long ptr long) +@ stdcall GetUpdateRgn(long long long) +@ stdcall GetUserObjectInformationA (long long ptr long ptr) +@ stdcall GetUserObjectInformationW (long long ptr long ptr) +@ stdcall GetUserObjectSecurity (long ptr ptr long ptr) +# @ stub GetWinStationInfo +@ stdcall GetWindow(long long) +@ stdcall GetWindowContextHelpId(long) +@ stdcall GetWindowDC(long) +@ stdcall GetWindowInfo(long ptr) +@ stdcall GetWindowLongA(long long) +@ stub GetWindowLongPtrA +@ stub GetWindowLongPtrW +@ stdcall GetWindowLongW(long long) +@ stdcall GetWindowModuleFileName(long ptr long) GetWindowModuleFileNameA +@ stdcall GetWindowModuleFileNameA(long ptr long) +@ stdcall GetWindowModuleFileNameW(long ptr long) +@ stdcall GetWindowPlacement(long ptr) +@ stdcall GetWindowRect(long ptr) +@ stdcall GetWindowRgn(long long) +@ stdcall GetWindowRgnBox(long ptr) +@ stdcall GetWindowTextA(long ptr long) +@ stdcall GetWindowTextLengthA(long) +@ stdcall GetWindowTextLengthW(long) +@ stdcall GetWindowTextW(long ptr long) +@ stdcall GetWindowThreadProcessId(long ptr) +@ stdcall GetWindowWord(long long) +@ stdcall GrayStringA(long long ptr long long long long long long) +@ stdcall GrayStringW(long long ptr long long long long long long) +# @ stub HasSystemSleepStarted +@ stdcall HideCaret(long) NtUserHideCaret +@ stdcall HiliteMenuItem(long long long long) +@ stdcall IMPGetIMEA(long ptr) +@ stdcall IMPGetIMEW(long ptr) +@ stdcall IMPQueryIMEA(ptr) +@ stdcall IMPQueryIMEW(ptr) +@ stdcall IMPSetIMEA(long ptr) +@ stdcall IMPSetIMEW(long ptr) +@ stdcall ImpersonateDdeClientWindow(long long) +@ stdcall InSendMessage() +@ stdcall InSendMessageEx(ptr) +@ stdcall InflateRect(ptr long long) +# @ stub InitSharedTable +# @ stub InitTask +# @ stub InitializeLpkHooks +# @ stub InitializeWin32EntryTable +@ stdcall InsertMenuA(long long long long ptr) +@ stdcall InsertMenuItemA(long long long ptr) +@ stdcall InsertMenuItemW(long long long ptr) +@ stdcall InsertMenuW(long long long long ptr) +@ stdcall InternalGetWindowText(long long long) +@ stdcall IntersectRect(ptr ptr ptr) +@ stdcall InvalidateRect(long ptr long) NtUserInvalidateRect +@ stdcall InvalidateRgn(long long long) +@ stdcall InvertRect(long ptr) +@ stdcall IsCharAlphaA(long) +@ stdcall IsCharAlphaNumericA(long) +@ stdcall IsCharAlphaNumericW(long) +@ stdcall IsCharAlphaW(long) +@ stdcall IsCharLowerA(long) +@ stdcall IsCharLowerW(long) +@ stdcall IsCharUpperA(long) +@ stdcall IsCharUpperW(long) +@ stdcall IsChild(long long) +@ stdcall IsClipboardFormatAvailable(long) +@ stdcall IsDialogMessage(long ptr) IsDialogMessageA +@ stdcall IsDialogMessageA(long ptr) +@ stdcall IsDialogMessageW(long ptr) +@ stdcall IsDlgButtonChecked(long long) +@ stdcall IsGUIThread(long) +@ stdcall IsHungAppWindow(long) +# @ stub IsHungThread +@ stdcall IsIconic(long) +@ stdcall IsMenu(long) +@ stdcall IsRectEmpty(ptr) +@ stdcall IsServerSideWindow(long) +@ stdcall IsWinEventHookInstalled(long) +@ stdcall IsWindow(long) +@ stdcall IsWindowEnabled(long) +@ stdcall IsWindowInDestroy(long) +@ stdcall IsWindowUnicode(long) +@ stdcall IsWindowVisible(long) +@ stdcall IsZoomed(long) +@ stdcall KillSystemTimer(long long) +@ stdcall KillTimer(long long) +@ stdcall LoadAcceleratorsA(long str) +@ stdcall LoadAcceleratorsW(long wstr) +@ stdcall LoadBitmapA(long str) +@ stdcall LoadBitmapW(long wstr) +@ stdcall LoadCursorA(long str) +@ stdcall LoadCursorFromFileA(str) +@ stdcall LoadCursorFromFileW(wstr) +@ stdcall LoadCursorW(long wstr) +@ stdcall LoadIconA(long str) +@ stdcall LoadIconW(long wstr) +@ stdcall LoadImageA(long str long long long long) +@ stdcall LoadImageW(long wstr long long long long) +@ stdcall LoadKeyboardLayoutA(str long) +# @ stub LoadKeyboardLayoutEx +@ stdcall LoadKeyboardLayoutW(wstr long) +@ stdcall LoadLocalFonts() +@ stdcall LoadMenuA(long str) +@ stdcall LoadMenuIndirectA(ptr) +@ stdcall LoadMenuIndirectW(ptr) +@ stdcall LoadMenuW(long wstr) +@ stub LoadRemoteFonts +@ stdcall LoadStringA(long long ptr long) +@ stdcall LoadStringW(long long ptr long) +@ stdcall LockSetForegroundWindow (long) +@ stub LockWindowStation +@ stdcall LockWindowUpdate(long) +@ stub LockWorkStation +@ stdcall LookupIconIdFromDirectory(ptr long) +@ stdcall LookupIconIdFromDirectoryEx(ptr long long long long) +@ stub MBToWCSEx +@ stdcall MB_GetString(ptr) +@ stdcall MapDialogRect(long ptr) +@ stdcall MapVirtualKeyA(long long) +@ stdcall MapVirtualKeyExA(long long long) +@ stdcall MapVirtualKeyExW(long long long) +@ stdcall MapVirtualKeyW(long long) +@ stdcall MapWindowPoints(long long ptr long) +@ stdcall MenuItemFromPoint(long long double) +@ stdcall MenuWindowProcA (long long long long) +@ stdcall MenuWindowProcW (long long long long) +@ stdcall MessageBeep(long) +@ stdcall MessageBoxA(long str str long) +@ stdcall MessageBoxExA(long str str long long) +@ stdcall MessageBoxExW(long wstr wstr long long) +@ stdcall MessageBoxIndirectA(ptr) +@ stdcall MessageBoxIndirectW(ptr) +# @ stub MessageBoxTimeoutA +# @ stub MessageBoxTimeoutW +@ stdcall MessageBoxW(long wstr wstr long) +# @ stub ModifyAccess +@ stdcall ModifyMenuA(long long long long ptr) +@ stdcall ModifyMenuW(long long long long ptr) +@ stdcall MonitorFromPoint(double long) +@ stdcall MonitorFromRect(ptr long) +@ stdcall MonitorFromWindow(long long) +@ stdcall MoveWindow(long long long long long long) +@ stdcall MsgWaitForMultipleObjects(long ptr long long long) +@ stdcall MsgWaitForMultipleObjectsEx(long ptr long long long) +@ stdcall NotifyWinEvent(long long long long) +@ stdcall OemKeyScan(long) +@ stdcall OemToCharA(ptr ptr) +@ stdcall OemToCharBuffA(ptr ptr long) +@ stdcall OemToCharBuffW(ptr ptr long) +@ stdcall OemToCharW(ptr ptr) +@ stdcall OffsetRect(ptr long long) +@ stdcall OpenClipboard(long) +@ stdcall OpenDesktopA(str long long long) +@ stdcall OpenDesktopW(wstr long long long) +@ stdcall OpenIcon(long) +@ stdcall OpenInputDesktop(long long long) +@ stdcall OpenWindowStationA(str long long) +@ stdcall OpenWindowStationW(wstr long long) +@ stdcall PackDDElParam(long long long) +@ stdcall PaintDesktop(long) +# @ stub PaintMenuBar +@ stdcall PeekMessageA(ptr long long long long) +@ stdcall PeekMessageW(ptr long long long long) +@ stub PlaySoundEvent +@ stdcall PostMessageA(long long long long) +@ stdcall PostMessageW(long long long long) +@ stdcall PostQuitMessage(long) +@ stdcall PostThreadMessageA(long long long long) +@ stdcall PostThreadMessageW(long long long long) +# @ stub PrintWindow +@ stdcall PrivateExtractIconExA(str long ptr ptr long) +@ stdcall PrivateExtractIconExW(wstr long ptr ptr long) +@ stdcall PrivateExtractIconsA (str long long long ptr ptr long long) +@ stdcall PrivateExtractIconsW (wstr long long long ptr ptr long long) +# @ stub PrivateSetDbgTag +# @ stub PrivateSetRipFlags +@ stdcall PtInRect(ptr double) +@ stub QuerySendMessage +# @ stub QueryUserCounters +@ stdcall RealChildWindowFromPoint(long double) +@ stdcall RealGetWindowClass(long ptr long) RealGetWindowClassA +@ stdcall RealGetWindowClassA(long ptr long) +@ stdcall RealGetWindowClassW(long ptr long) +# @ stub ReasonCodeNeedsBugID +# @ stub ReasonCodeNeedsComment +# @ stub RecordShutdownReason +@ stdcall RedrawWindow(long ptr long long) +@ stdcall RegisterClassA(ptr) +@ stdcall RegisterClassExA(ptr) +@ stdcall RegisterClassExW(ptr) +@ stdcall RegisterClassW(ptr) +@ stdcall RegisterClipboardFormatA(str) +@ stdcall RegisterClipboardFormatW(wstr) +@ stdcall RegisterDeviceNotificationA(long ptr long) RegisterDeviceNotificationW +@ stdcall RegisterDeviceNotificationW(long ptr long) +@ stdcall RegisterHotKey(long long long long) +@ stdcall RegisterLogonProcess(long long) +# @ stub RegisterMessagePumpHook +@ stub RegisterNetworkCapabilities +@ stdcall RegisterRawInputDevices(ptr long long) +@ stdcall RegisterServicesProcess(long) +@ stdcall RegisterShellHookWindow (long) +@ stdcall RegisterSystemThread(long long) +@ stdcall RegisterTasklist (long) +# @ stub RegisterUserApiHook +@ stdcall RegisterWindowMessageA(str) +@ stdcall RegisterWindowMessageW(wstr) +@ stdcall ReleaseCapture() +@ stdcall ReleaseDC(long long) +@ stdcall RemoveMenu(long long long) +@ stdcall RemovePropA(long str) +@ stdcall RemovePropW(long wstr) +@ stdcall ReplyMessage(long) +@ stub ResetDisplay +# @ stub ResolveDesktopForWOW +@ stdcall ReuseDDElParam(long long long long long) +@ stdcall ScreenToClient(long ptr) +@ stdcall ScrollChildren(long long long long) +@ stdcall ScrollDC(long long long ptr ptr long ptr) +@ stdcall ScrollWindow(long long long ptr ptr) +@ stdcall ScrollWindowEx(long long long ptr ptr long ptr long) +@ stdcall SendDlgItemMessageA(long long long long long) +@ stdcall SendDlgItemMessageW(long long long long long) +@ stdcall SendIMEMessageExA(long long) +@ stdcall SendIMEMessageExW(long long) +@ stdcall SendInput(long ptr long) +@ stdcall SendMessageA(long long long long) +@ stdcall SendMessageCallbackA(long long long long ptr long) +@ stdcall SendMessageCallbackW(long long long long ptr long) +@ stdcall SendMessageTimeoutA(long long long long long long ptr) +@ stdcall SendMessageTimeoutW(long long long long long long ptr) +@ stdcall SendMessageW(long long long long) +@ stdcall SendNotifyMessageA(long long long long) +@ stdcall SendNotifyMessageW(long long long long) +@ stub ServerSetFunctionPointers +@ stdcall SetActiveWindow(long) +@ stdcall SetCapture(long) +@ stdcall SetCaretBlinkTime(long) +@ stdcall SetCaretPos(long long) +@ stdcall SetClassLongA(long long long) +@ stub SetClassLongPtrA #(long long long) +@ stub SetClassLongPtrW #(long long long) +@ stdcall SetClassLongW(long long long) +@ stdcall SetClassWord(long long long) +@ stdcall SetClipboardData(long long) +@ stdcall SetClipboardViewer(long) +# @ stub SetConsoleReserveKeys +@ stdcall SetCursor(long) +@ stub SetCursorContents +@ stdcall SetCursorPos(long long) +@ stdcall SetDebugErrorLevel(long) +@ stdcall SetDeskWallPaper(ptr) +# @ stub SetDesktopBitmap +@ stdcall SetDlgItemInt(long long long long) +@ stdcall SetDlgItemTextA(long long str) +@ stdcall SetDlgItemTextW(long long wstr) +@ stdcall SetDoubleClickTime(long) +@ stdcall SetFocus(long) +@ stdcall SetForegroundWindow(long) +@ stdcall SetInternalWindowPos(long long ptr ptr) +@ stdcall SetKeyboardState(ptr) +@ stdcall SetLastErrorEx(long long) +@ stdcall SetLayeredWindowAttributes(ptr long long long) win32k.NtUserSetLayeredWindowAttributes +@ stdcall SetLogonNotifyWindow(long long) +@ stdcall SetMenu(long long) +@ stdcall SetMenuContextHelpId(long long) +@ stdcall SetMenuDefaultItem(long long long) +@ stdcall SetMenuInfo(long ptr) +@ stdcall SetMenuItemBitmaps(long long long long long) +@ stdcall SetMenuItemInfoA(long long long ptr) +@ stdcall SetMenuItemInfoW(long long long ptr) +@ stdcall SetMessageExtraInfo(long) +@ stdcall SetMessageQueue(long) +@ stdcall SetParent(long long) +@ stdcall SetProcessDefaultLayout(long) +@ stub SetProcessDPIAware +@ stdcall SetProcessWindowStation(long) +@ stdcall SetProgmanWindow (long) +@ stdcall SetPropA(long str long) +@ stdcall SetPropW(long wstr long) +@ stdcall SetRect(ptr long long long long) +@ stdcall SetRectEmpty(ptr) +@ stdcall SetScrollInfo(long long ptr long) +@ stdcall SetScrollPos(long long long long) +@ stdcall SetScrollRange(long long long long long) +@ stdcall SetShellWindow(long) +@ stdcall SetShellWindowEx (long long) +@ stdcall SetSysColors(long ptr ptr) +@ stdcall SetSysColorsTemp(ptr ptr long) +@ stdcall SetSystemCursor(long long) +@ stdcall SetSystemMenu(long long) +@ stdcall SetSystemTimer(long long long ptr) +@ stdcall SetTaskmanWindow (long) +@ stdcall SetThreadDesktop(long) +@ stdcall SetTimer(long long long ptr) +@ stdcall SetUserObjectInformationA(long long ptr long) +@ stdcall SetUserObjectInformationW(long long ptr long) +@ stdcall SetUserObjectSecurity(long ptr ptr) +@ stdcall SetWinEventHook(long long long ptr long long long) +@ stdcall SetWindowContextHelpId(long long) +@ stub SetWindowFullScreenState +@ stdcall SetWindowLongA(long long long) +@ stub SetWindowLongPtrA #(long long long) +@ stub SetWindowLongPtrW #(long long long) +@ stdcall SetWindowLongW(long long long) +@ stdcall SetWindowPlacement(long ptr) +@ stdcall SetWindowPos(long long long long long long long) +@ stdcall SetWindowRgn(long long long) +@ stdcall SetWindowStationUser(long long long long) +@ stdcall SetWindowText(long str) SetWindowTextA +@ stdcall SetWindowTextA(long str) +@ stdcall SetWindowTextW(long wstr) +@ stdcall SetWindowWord(long long long) +@ stdcall SetWindowsHookA(long ptr) +@ stdcall SetWindowsHookExA(long long long long) +@ stdcall SetWindowsHookExW(long long long long) +@ stdcall SetWindowsHookW(long ptr) +@ stdcall ShowCaret(long) +@ stdcall ShowCursor(long) +@ stdcall ShowOwnedPopups(long long) +@ stdcall ShowScrollBar(long long long) +@ stub ShowStartGlass +@ stdcall ShowWindow(long long) +@ stdcall ShowWindowAsync(long long) +# @ stub SoftModalMessageBox +@ stdcall SubtractRect(ptr ptr ptr) +@ stdcall SwapMouseButton(long) +@ stdcall SwitchDesktop(long) +@ stdcall SwitchToThisWindow(long long) +# @ stub SysErrorBox +@ stdcall SystemParametersInfoA(long long ptr long) +@ stdcall SystemParametersInfoW(long long ptr long) +@ stdcall TabbedTextOutA(long long long str long long ptr long) +@ stdcall TabbedTextOutW(long long long wstr long long ptr long) +@ stdcall TileChildWindows(long long) +@ stdcall TileWindows(long long ptr long ptr) +@ stdcall ToAscii(long long ptr ptr long) +@ stdcall ToAsciiEx(long long ptr ptr long long) +@ stdcall ToUnicode(long long ptr ptr long long) +@ stdcall ToUnicodeEx(long long ptr ptr long long long) +@ stdcall TrackMouseEvent(ptr) +@ stdcall TrackPopupMenu(long long long long long long ptr) +@ stdcall TrackPopupMenuEx(long long long long long ptr) +@ stdcall TranslateAccelerator(long long ptr) TranslateAcceleratorA +@ stdcall TranslateAcceleratorA(long long ptr) +@ stdcall TranslateAcceleratorW(long long ptr) +@ stdcall TranslateMDISysAccel(long ptr) +@ stdcall TranslateMessage(ptr) +# @ stub TranslateMessageEx +@ stdcall UnhookWinEvent(long) +@ stdcall UnhookWindowsHook(long ptr) +@ stdcall UnhookWindowsHookEx(long) +@ stdcall UnionRect(ptr ptr ptr) +@ stdcall UnloadKeyboardLayout(long) +@ stub UnlockWindowStation +@ stdcall UnpackDDElParam(long long ptr ptr) +@ stdcall UnregisterClassA(str long) +@ stdcall UnregisterClassW(wstr long) +@ stdcall UnregisterDeviceNotification(long) +@ stdcall UnregisterHotKey(long long) +# @ stub UnregisterMessagePumpHook +# @ stub UnregisterUserApiHook +@ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) +@ stdcall UpdatePerUserSystemParameters(long long) +@ stdcall UpdateWindow(long) +@ stdcall User32InitializeImmEntryTable(ptr) +@ stdcall UserClientDllInitialize(long long ptr) DllMain +@ stub UserHandleGrantAccess +# @ stub UserIsSystemResumeAutomatic +# @ stub UserLpkPSMTextOut +# @ stub UserLpkTabbedTextOut +@ stdcall UserRealizePalette(long) +@ stub UserRegisterWowHandlers +# @ stub UserSetDeviceHoldState +@ stdcall UserSignalProc(long long long long) +# @ stub VRipOutput +# @ stub VTagOutput +@ stdcall ValidateRect(long ptr) +@ stdcall ValidateRgn(long long) +@ stdcall VkKeyScanA(long) +@ stdcall VkKeyScanExA(long long) +@ stdcall VkKeyScanExW(long long) +@ stdcall VkKeyScanW(long) +@ stub WCSToMBEx +@ stdcall WINNLSEnableIME(long long) +@ stdcall WINNLSGetEnableStatus(long) +@ stdcall WINNLSGetIMEHotkey(long) +@ stub WNDPROC_CALLBACK +@ stdcall WaitForInputIdle(long long) +@ stdcall WaitMessage() +# @ stub Win32PoolAllocationStats +@ stdcall WinHelpA(long str long long) +@ stdcall WinHelpW(long wstr long long) +# @ stub WinOldAppHackoMatic +@ stdcall WindowFromDC(long) +@ stdcall WindowFromPoint(double) +# @ stub YieldTask +# @ stub _SetProcessDefaultLayout +@ stdcall keybd_event(long long long long) +@ stdcall mouse_event(long long long long long) +@ varargs wsprintfA(str str) +@ varargs wsprintfW(wstr wstr) +@ stdcall wvsprintfA(ptr str ptr) +@ stdcall wvsprintfW(ptr wstr ptr) diff --git a/reactos/dll/win32/user32/windows/draw.c b/reactos/dll/win32/user32/windows/draw.c index f635010d20f..ba2bca01c5b 100644 --- a/reactos/dll/win32/user32/windows/draw.c +++ b/reactos/dll/win32/user32/windows/draw.c @@ -1826,7 +1826,7 @@ FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr) if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1)) { - hbr = GetSysColorBrush((int)hbr - 1); + hbr = GetSysColorBrush(PtrToUlong(hbr) - 1); } if ((prevhbr = SelectObject(hDC, hbr)) == NULL) { diff --git a/reactos/dll/win32/user32/windows/menu.c b/reactos/dll/win32/user32/windows/menu.c index bf187f4c4e6..ce6a82b101e 100644 --- a/reactos/dll/win32/user32/windows/menu.c +++ b/reactos/dll/win32/user32/windows/menu.c @@ -4523,7 +4523,7 @@ InsertMenuA( HMENU hMenu, UINT uPosition, UINT uFlags, - UINT_PTR uIDNewItem, + UINT uIDNewItem, LPCSTR lpNewItem) { MENUITEMINFOA mii; @@ -4645,7 +4645,7 @@ InsertMenuW( HMENU hMenu, UINT uPosition, UINT uFlags, - UINT_PTR uIDNewItem, + UINT uIDNewItem, LPCWSTR lpNewItem) { MENUITEMINFOW mii; @@ -4784,7 +4784,7 @@ ModifyMenuA( HMENU hMnu, UINT uPosition, UINT uFlags, - UINT_PTR uIDNewItem, + UINT uIDNewItem, LPCSTR lpNewItem) { ROSMENUINFO mi; @@ -4831,7 +4831,7 @@ ModifyMenuW( HMENU hMnu, UINT uPosition, UINT uFlags, - UINT_PTR uIDNewItem, + UINT uIDNewItem, LPCWSTR lpNewItem) { ROSMENUINFO mi; diff --git a/reactos/dll/win32/winmm/midimap/midimap.rbuild b/reactos/dll/win32/winmm/midimap/midimap.rbuild index 901479650ef..6573f5d48bf 100644 --- a/reactos/dll/win32/winmm/midimap/midimap.rbuild +++ b/reactos/dll/win32/winmm/midimap/midimap.rbuild @@ -12,7 +12,6 @@ advapi32 user32 winmm - msvcrt midimap.c midimap.rc midimap.spec diff --git a/reactos/dll/win32/ws2_32/misc/stubs.c b/reactos/dll/win32/ws2_32/misc/stubs.c index 9418b53a4b1..1c77ef91fe6 100644 --- a/reactos/dll/win32/ws2_32/misc/stubs.c +++ b/reactos/dll/win32/ws2_32/misc/stubs.c @@ -31,7 +31,7 @@ getpeername(IN SOCKET s, return SOCKET_ERROR; } - if (!ReferenceProviderByHandle((HANDLE)s, &Provider)) + if (!ReferenceProviderByHandle((HANDLE)(ULONG_PTR)(s), &Provider)) { WSASetLastError(WSAENOTSOCK); return SOCKET_ERROR; diff --git a/reactos/dll/win32/ws2_32/ws2_32.rbuild b/reactos/dll/win32/ws2_32/ws2_32.rbuild index 1fa4a54bd0c..08d974ab554 100644 --- a/reactos/dll/win32/ws2_32/ws2_32.rbuild +++ b/reactos/dll/win32/ws2_32/ws2_32.rbuild @@ -1,5 +1,5 @@ - + include include/reactos/wine @@ -27,4 +27,6 @@ async.c ws2_32.rc + ws2_32.spec + diff --git a/reactos/dll/win32/ws2_32/ws2_32.spec b/reactos/dll/win32/ws2_32/ws2_32.spec new file mode 100644 index 00000000000..bbcafc0659b --- /dev/null +++ b/reactos/dll/win32/ws2_32/ws2_32.spec @@ -0,0 +1,119 @@ +1 stdcall accept(long ptr ptr) WS_accept +2 stdcall bind(long ptr long) WS_bind +3 stdcall closesocket(long) WS_closesocket +4 stdcall connect(long ptr long) WS_connect +5 stdcall getpeername(long ptr ptr) WS_getpeername +6 stdcall getsockname(long ptr ptr) WS_getsockname +7 stdcall getsockopt(long long long ptr ptr) WS_getsockopt +8 stdcall htonl(long) WS_htonl +9 stdcall htons(long) WS_htons +10 stdcall ioctlsocket(long long ptr) WS_ioctlsocket +11 stdcall inet_addr(str) WS_inet_addr +12 stdcall inet_ntoa(ptr) WS_inet_ntoa +13 stdcall listen(long long) WS_listen +14 stdcall ntohl(long) WS_ntohl +15 stdcall ntohs(long) WS_ntohs +16 stdcall recv(long ptr long long) WS_recv +17 stdcall recvfrom(long ptr long long ptr ptr) WS_recvfrom +18 stdcall select(long ptr ptr ptr ptr) WS_select +19 stdcall send(long ptr long long) WS_send +20 stdcall sendto(long ptr long long ptr long) WS_sendto +21 stdcall setsockopt(long long long ptr long) WS_setsockopt +22 stdcall shutdown(long long) WS_shutdown +23 stdcall socket(long long long) WS_socket +51 stdcall gethostbyaddr(ptr long long) WS_gethostbyaddr +52 stdcall gethostbyname(str) WS_gethostbyname +53 stdcall getprotobyname(str) WS_getprotobyname +54 stdcall getprotobynumber(long) WS_getprotobynumber +55 stdcall getservbyname(str str) WS_getservbyname +56 stdcall getservbyport(long str) WS_getservbyport +57 stdcall gethostname(ptr long) WS_gethostname + +101 stdcall WSAAsyncSelect(long long long long) +102 stdcall WSAAsyncGetHostByAddr(long long ptr long long ptr long) +103 stdcall WSAAsyncGetHostByName(long long str ptr long) +104 stdcall WSAAsyncGetProtoByNumber(long long long ptr long) +105 stdcall WSAAsyncGetProtoByName(long long str ptr long) +106 stdcall WSAAsyncGetServByPort(long long long str ptr long) +107 stdcall WSAAsyncGetServByName(long long str str ptr long) +108 stdcall WSACancelAsyncRequest(long) +109 stdcall WSASetBlockingHook(ptr) +110 stdcall WSAUnhookBlockingHook() +111 stdcall WSAGetLastError() +112 stdcall WSASetLastError(long) +113 stdcall WSACancelBlockingCall() +114 stdcall WSAIsBlocking() +115 stdcall WSAStartup(long ptr) +116 stdcall WSACleanup() + +151 stdcall __WSAFDIsSet(long ptr) + +500 stub WEP + +@ stdcall GetAddrInfoW(wstr wstr ptr ptr) +@ stdcall WSApSetPostRoutine(ptr) +@ stdcall WPUCompleteOverlappedRequest(long ptr long long ptr) +@ stdcall WSAAccept(long ptr ptr ptr long) +@ stdcall WSAAddressToStringA(ptr long ptr ptr ptr) +@ stdcall WSAAddressToStringW(ptr long ptr ptr ptr) +@ stdcall WSACloseEvent(long) +@ stdcall WSAConnect(long ptr long ptr ptr ptr ptr) +@ stdcall WSACreateEvent () +@ stdcall WSADuplicateSocketA(long long ptr) +@ stdcall WSADuplicateSocketW(long long ptr) +@ stdcall WSAEnumNameSpaceProvidersA(ptr ptr) +@ stdcall WSAEnumNameSpaceProvidersW(ptr ptr) +@ stdcall WSAEnumNetworkEvents(long long ptr) +@ stdcall WSAEnumProtocolsA(ptr ptr ptr) +@ stdcall WSAEnumProtocolsW(ptr ptr ptr) +@ stdcall WSAEventSelect(long long long) +@ stdcall WSAGetOverlappedResult(long ptr ptr long ptr) +@ stdcall WSAGetQOSByName(long ptr ptr) +@ stdcall WSAGetServiceClassInfoA(ptr ptr ptr ptr) +@ stdcall WSAGetServiceClassInfoW(ptr ptr ptr ptr) +@ stdcall WSAGetServiceClassNameByClassIdA(ptr ptr ptr) +@ stdcall WSAGetServiceClassNameByClassIdW(ptr ptr ptr) +@ stdcall WSAHtonl(long long ptr) +@ stdcall WSAHtons(long long ptr) +@ stdcall WSAInstallServiceClassA(ptr) +@ stdcall WSAInstallServiceClassW(ptr) +@ stdcall WSAIoctl(long long ptr long ptr long ptr ptr ptr) +@ stdcall WSAJoinLeaf(long ptr long ptr ptr ptr ptr long) +@ stdcall WSALookupServiceBeginA(ptr long ptr) +@ stdcall WSALookupServiceBeginW(ptr long ptr) +@ stdcall WSALookupServiceEnd(long) +@ stdcall WSALookupServiceNextA(long long ptr ptr) +@ stdcall WSALookupServiceNextW(long long ptr ptr) +@ stub WSANSPIoctl +@ stdcall WSANtohl(long long ptr) +@ stdcall WSANtohs(long long ptr) +@ stdcall WSAProviderConfigChange(ptr ptr ptr) +@ stdcall WSARecv(long ptr long ptr ptr ptr ptr) +@ stdcall WSARecvDisconnect(long ptr) +@ stdcall WSARecvFrom(long ptr long ptr ptr ptr ptr ptr ptr ) +@ stdcall WSARemoveServiceClass(ptr) +@ stdcall WSAResetEvent(long) kernel32.ResetEvent +@ stdcall WSASend(long ptr long ptr long ptr ptr) +@ stdcall WSASendDisconnect(long ptr) +@ stdcall WSASendTo(long ptr long ptr long ptr long ptr ptr) +@ stdcall WSASetEvent(long) kernel32.SetEvent +@ stdcall WSASetServiceA(ptr long long) +@ stdcall WSASetServiceW(ptr long long) +@ stdcall WSASocketA(long long long ptr long long) +@ stdcall WSASocketW(long long long ptr long long) +@ stdcall WSAStringToAddressA(str long ptr ptr ptr) +@ stdcall WSAStringToAddressW(wstr long ptr ptr ptr) +@ stdcall WSAWaitForMultipleEvents(long ptr long long long) kernel32.WaitForMultipleObjectsEx +@ stdcall WSCDeinstallProvider(ptr ptr) +@ stdcall WSCEnableNSProvider(ptr long) +@ stdcall WSCEnumProtocols(ptr ptr ptr ptr) +@ stdcall WSCGetProviderPath(ptr ptr ptr ptr) +@ stdcall WSCInstallNameSpace(wstr wstr long long ptr) +@ stdcall WSCInstallProvider(ptr wstr ptr long ptr) +@ stdcall WSCUnInstallNameSpace(ptr) +@ stub WSCUpdateProvider +@ stub WSCWriteNameSpaceOrder +@ stdcall WSCWriteProviderOrder(ptr long) +@ stdcall freeaddrinfo(ptr) WS_freeaddrinfo +@ stdcall getaddrinfo(str str ptr ptr) WS_getaddrinfo +@ stdcall getnameinfo(ptr long ptr long ptr long long) WS_getnameinfo From 40b2f18a1c15c52194c754498865cbb00af0cec6 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 26 Aug 2008 04:12:02 +0000 Subject: [PATCH 171/388] Fix tcpsvcs build. svn path=/branches/ros-amd64-bringup/; revision=35657 --- reactos/base/services/tcpsvcs/chargen.c | 2 +- reactos/base/services/tcpsvcs/daytime.c | 2 +- reactos/base/services/tcpsvcs/discard.c | 2 +- reactos/base/services/tcpsvcs/echo.c | 2 +- reactos/base/services/tcpsvcs/qotd.c | 2 +- reactos/base/services/tcpsvcs/skelserver.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/base/services/tcpsvcs/chargen.c b/reactos/base/services/tcpsvcs/chargen.c index 2f2b17124bd..d4306f391ae 100644 --- a/reactos/base/services/tcpsvcs/chargen.c +++ b/reactos/base/services/tcpsvcs/chargen.c @@ -96,7 +96,7 @@ DWORD WINAPI ChargenHandler(VOID* sock_) { INT retVal = 0; - SOCKET sock = (SOCKET)sock_; + SOCKET sock = (SOCKET)(UINT_PTR)sock_; if (!GenerateChars(sock)) { diff --git a/reactos/base/services/tcpsvcs/daytime.c b/reactos/base/services/tcpsvcs/daytime.c index 26d3c0d868f..c5e99384c77 100644 --- a/reactos/base/services/tcpsvcs/daytime.c +++ b/reactos/base/services/tcpsvcs/daytime.c @@ -30,7 +30,7 @@ DaytimeHandler(VOID* Sock_) time_t aclock; CHAR *pszTime; DWORD retVal = 0; - SOCKET Sock = (SOCKET)Sock_; + SOCKET Sock = (SOCKET)(UINT_PTR)Sock_; time(&aclock); localTime = localtime(&aclock); diff --git a/reactos/base/services/tcpsvcs/discard.c b/reactos/base/services/tcpsvcs/discard.c index 5a3324cf9b8..487059805e4 100644 --- a/reactos/base/services/tcpsvcs/discard.c +++ b/reactos/base/services/tcpsvcs/discard.c @@ -44,7 +44,7 @@ DWORD WINAPI DiscardHandler(VOID* sock_) { DWORD retVal = 0; - SOCKET sock = (SOCKET)sock_; + SOCKET sock = (SOCKET)(UINT_PTR)sock_; if (!RecieveIncomingPackets(sock)) { diff --git a/reactos/base/services/tcpsvcs/echo.c b/reactos/base/services/tcpsvcs/echo.c index 1fcca241d12..7188286e46d 100644 --- a/reactos/base/services/tcpsvcs/echo.c +++ b/reactos/base/services/tcpsvcs/echo.c @@ -69,7 +69,7 @@ DWORD WINAPI EchoHandler(VOID* sock_) { DWORD retVal = 0; - SOCKET sock = (SOCKET)sock_; + SOCKET sock = (SOCKET)(UINT_PTR)sock_; if (!EchoIncomingPackets(sock)) { diff --git a/reactos/base/services/tcpsvcs/qotd.c b/reactos/base/services/tcpsvcs/qotd.c index 94b69ddb0b5..22cdda17769 100644 --- a/reactos/base/services/tcpsvcs/qotd.c +++ b/reactos/base/services/tcpsvcs/qotd.c @@ -128,7 +128,7 @@ RetrieveQuote(SOCKET sock) DWORD WINAPI QotdHandler(VOID* sock_) { - SOCKET sock = (SOCKET)sock_; + SOCKET sock = (SOCKET)(UINT_PTR)sock_; DWORD retVal = 0; if (!RetrieveQuote(sock)) diff --git a/reactos/base/services/tcpsvcs/skelserver.c b/reactos/base/services/tcpsvcs/skelserver.c index f12cacbcb65..b1b84a907b5 100644 --- a/reactos/base/services/tcpsvcs/skelserver.c +++ b/reactos/base/services/tcpsvcs/skelserver.c @@ -95,7 +95,7 @@ AcceptConnections(SOCKET listeningSocket, if (!bShutdown) { - hThread = CreateThread(0, 0, lpService, (void*)sock, 0, NULL); + hThread = CreateThread(0, 0, lpService, (PVOID)(UINT_PTR)sock, 0, NULL); if (hThread != NULL) { CloseHandle(hThread); From 4d6c63b34366f74d7be694717a62145f2f30dfdc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Aug 2008 11:22:30 +0000 Subject: [PATCH 172/388] #undef Interlocked before implementing the functions on all architectures. svn path=/branches/ros-amd64-bringup/; revision=35666 --- reactos/dll/win32/kernel32/misc/dllmain.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/dllmain.c b/reactos/dll/win32/kernel32/misc/dllmain.c index 34d09859c6f..90e3d20819a 100644 --- a/reactos/dll/win32/kernel32/misc/dllmain.c +++ b/reactos/dll/win32/kernel32/misc/dllmain.c @@ -394,15 +394,7 @@ DllMain(HANDLE hDll, return TRUE; } -//wtf -#ifdef _WIN64 #undef InterlockedIncrement -#undef InterlockedDecrement -#undef InterlockedExchange -#undef InterlockedExchangeAdd -#undef InterlockedCompareExchange -#endif - LONG WINAPI InterlockedIncrement(IN OUT LONG volatile *lpAddend) @@ -410,6 +402,7 @@ InterlockedIncrement(IN OUT LONG volatile *lpAddend) return _InterlockedIncrement(lpAddend); } +#undef InterlockedDecrement LONG WINAPI InterlockedDecrement(IN OUT LONG volatile *lpAddend) @@ -417,6 +410,7 @@ InterlockedDecrement(IN OUT LONG volatile *lpAddend) return _InterlockedDecrement(lpAddend); } +#undef InterlockedExchange LONG WINAPI InterlockedExchange(IN OUT LONG volatile *Target, @@ -425,6 +419,7 @@ InterlockedExchange(IN OUT LONG volatile *Target, return _InterlockedExchange(Target, Value); } +#undef InterlockedExchangeAdd LONG WINAPI InterlockedExchangeAdd(IN OUT LONG volatile *Addend, @@ -433,6 +428,7 @@ InterlockedExchangeAdd(IN OUT LONG volatile *Addend, return _InterlockedExchangeAdd(Addend, Value); } +#undef InterlockedCompareExchange LONG WINAPI InterlockedCompareExchange(IN OUT LONG volatile *Destination, From 500dc4c37a6c8e29b8ac678bc8cef405ca29d16c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Aug 2008 12:01:58 +0000 Subject: [PATCH 173/388] Add D3DFMT_D32_LOCKABLE and D3DFMT_S8_LOCKABLE svn path=/branches/ros-amd64-bringup/; revision=35668 --- reactos/include/psdk/d3d9types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/include/psdk/d3d9types.h b/reactos/include/psdk/d3d9types.h index 4aae6f0b801..d4d4def9a02 100644 --- a/reactos/include/psdk/d3d9types.h +++ b/reactos/include/psdk/d3d9types.h @@ -822,6 +822,8 @@ typedef enum _D3DFORMAT { D3DFMT_L16 = 81, D3DFMT_D32F_LOCKABLE = 82, D3DFMT_D24FS8 = 83, + D3DFMT_D32_LOCKABLE = 84, + D3DFMT_S8_LOCKABLE = 85, D3DFMT_VERTEXDATA = 100, D3DFMT_INDEX16 = 101, From 405ba263511570b19c45605e6889d919577f4d37 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Aug 2008 20:51:14 +0000 Subject: [PATCH 174/388] Start a new strsafe lib. Nothing implemented so far, more something like a framework. The actual function implementation will be in the header, because the ms header allows to inline the functions. It uses recursive include to avoid code duplication. The lib uses these functions to generate the code. svn path=/branches/ros-amd64-bringup/; revision=35682 --- reactos/include/psdk/strsafe.h | 144 ++++++++++++++++++++++ reactos/lib/sdk/sdk.rbuild | 3 + reactos/lib/sdk/strsafe/StringCbCatA.c | 14 +++ reactos/lib/sdk/strsafe/StringCbCopyA.c | 14 +++ reactos/lib/sdk/strsafe/StringCbPrintfA.c | 19 +++ reactos/lib/sdk/strsafe/strsafe.rbuild | 8 ++ 6 files changed, 202 insertions(+) create mode 100644 reactos/include/psdk/strsafe.h create mode 100644 reactos/lib/sdk/strsafe/StringCbCatA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbPrintfA.c create mode 100644 reactos/lib/sdk/strsafe/strsafe.rbuild diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h new file mode 100644 index 00000000000..e8cf6008199 --- /dev/null +++ b/reactos/include/psdk/strsafe.h @@ -0,0 +1,144 @@ +#ifndef __STRSAFE_H_ +#define __STRSAFE_H_ + +#include +#include + +#if defined(STRSAFE_NO_CCH_FUNCTIONS) && defined(STRSAFE_NO_CB_FUNCTIONS) +#error Both STRSAFE_NO_CCH_FUNCTIONS and STRSAFE_NO_CB_FUNCTIONS are defined +#endif + + +#ifndef _HRESULT_DEFINED +#define _HRESULT_DEFINED +typedef long HRESULT; +#endif + +typedef char * STRSAFE_LPSTR; +typedef const char * STRSAFE_LPCSTR; +typedef wchar_t * STRSAFE_LPWSTR; +typedef const wchar_t * STRSAFE_LPCWSTR; +typedef unsigned long STRSAFE_DWORD; + +/* Implement for ansi and unicode */ +#define STRSAFE_PASS2 +#define STRSAFE_UNICODE 0 +# include +#undef STRSAFE_UNICODE +#define STRSAFE_UNICODE 1 +# include +#undef STRSAFE_UNICODE +#undef STRSAFE_PASS2 + +/* Now define the functions depending on UNICODE */ +#ifdef UNICODE +# define STRSAFE_UNICODE 1 +#else +# define STRSAFE_UNICODE 0 +#endif +#include +#undef STRSAFE_UNICODE + +#endif // !__STRSAFE_H_ + +/*****************************************************************************/ + +#if defined(STRSAFE_UNICODE) +#if (STRSAFE_UNICODE == 1) + +#define STRSAFE_LPTSTR STRSAFE_LPWSTR +#define STRSAFE_LPCTSTR STRSAFE_LPCWSTR + +#define StringCbCat StringCbCatW +#define StringCbCopy StringCbCopyW +#define StringCbVPrintf StringCbVPrintfW +#define StringCbPrintf StringCbPrintfW + +#else // (STRSAFE_UNICODE != 1) + +#define STRSAFE_LPTSTR STRSAFE_LPSTR +#define STRSAFE_LPCTSTR STRSAFE_LPCSTR + +#define StringCbCat StringCbCatA +#define StringCbCopy StringCbCopyA +#define StringCbVPrintf StringCbVPrintfA +#define StringCbPrintf StringCbPrintfA + +#endif // (STRSAFE_UNICODE != 1) +#endif // defined(STRSAFE_UNICODE) + +/*****************************************************************************/ + +#if defined (STRSAFE_PASS2) + +#ifdef STRSAFE_LIB + +/* Normal function prototypes only */ +#define STRSAFEAPI HRESULT __stdcall + +#ifndef STRSAFE_NO_CB_FUNCTIONS +STRSAFEAPI StringCbCat(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCbCopy(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCbVPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, va_list args); +STRSAFEAPI StringCbPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, ...); +#endif // !STRSAFE_NO_CB_FUNCTIONS + +#ifndef STRSAFE_NO_CCH_FUNCTIONS + +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#else // !STRSAFE_LIB + +/* Create inlined versions */ +#define STRSAFEAPI HRESULT static __inline__ + +#ifndef STRSAFE_NO_CB_FUNCTIONS + +STRSAFEAPI StringCbCat(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCbCopy(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCbVPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, va_list args) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCbPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCbVPrintf(pszDest, cbDest, pszFormat, args); + va_end(args); + return result; +} + +#endif // !STRSAFE_NO_CB_FUNCTIONS + +#ifndef STRSAFE_NO_CCH_FUNCTIONS + +#endif // !STRSAFE_NO_CCH_FUNCTIONS + +#endif // !STRSAFE_LIB + +/* Functions are implemented or defined, clear #defines for next pass */ +#undef StringCbCat +#undef StringCbCopy +#undef StringCbVPrintf +#undef StringCbPrintf + +#undef STRSAFE_LPTSTR +#undef STRSAFE_LPCTSTR + +#endif // defined (STRSAFE_PASS2) + diff --git a/reactos/lib/sdk/sdk.rbuild b/reactos/lib/sdk/sdk.rbuild index 671e0090dc3..c896f0ca8cf 100644 --- a/reactos/lib/sdk/sdk.rbuild +++ b/reactos/lib/sdk/sdk.rbuild @@ -14,6 +14,9 @@ + + + diff --git a/reactos/lib/sdk/strsafe/StringCbCatA.c b/reactos/lib/sdk/strsafe/StringCbCatA.c new file mode 100644 index 00000000000..13bffe15aec --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatA.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatA _StringCbCatA +#include + +#undef StringCbCatA +HRESULT __stdcall +StringCbCatA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCbCatA(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyA.c b/reactos/lib/sdk/strsafe/StringCbCopyA.c new file mode 100644 index 00000000000..03c2606018e --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyA.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyA _StringCbCopyA +#include + +#undef StringCbCopyA +HRESULT __stdcall +StringCbCopyA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCbCopyA(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCbPrintfA.c b/reactos/lib/sdk/strsafe/StringCbPrintfA.c new file mode 100644 index 00000000000..b72fc815103 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbPrintfA.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbPrintfA _StringCbPrintfA +#include + +#undef StringCbPrintfA +HRESULT __stdcall +StringCbPrintfA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCbVPrintfA(pszDest, cbDest, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/strsafe.rbuild b/reactos/lib/sdk/strsafe/strsafe.rbuild new file mode 100644 index 00000000000..bf744edafb3 --- /dev/null +++ b/reactos/lib/sdk/strsafe/strsafe.rbuild @@ -0,0 +1,8 @@ + + + + + StringCbCatA.c + StringCbCopyA.c + StringCbPrintfA.c + From 52846afa0e7ac70628ac00dfc58b028c338bf574 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Aug 2008 20:56:07 +0000 Subject: [PATCH 175/388] fix d3d9.def file and enable d3d8 and d3d9 to fix x86 build svn path=/branches/ros-amd64-bringup/; revision=35683 --- reactos/dll/directx/d3d9/d3d9.def | 2 +- reactos/dll/directx/directx.rbuild | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/dll/directx/d3d9/d3d9.def b/reactos/dll/directx/d3d9/d3d9.def index c42b78b1686..4ff82e14061 100644 --- a/reactos/dll/directx/d3d9/d3d9.def +++ b/reactos/dll/directx/d3d9/d3d9.def @@ -5,4 +5,4 @@ EXPORTS PSGPSampleTexture DebugSetLevel DebugSetMute - Direct3DCreate9 + Direct3DCreate9@4 diff --git a/reactos/dll/directx/directx.rbuild b/reactos/dll/directx/directx.rbuild index 4623a61606e..7d58dcf597a 100644 --- a/reactos/dll/directx/directx.rbuild +++ b/reactos/dll/directx/directx.rbuild @@ -1,9 +1,15 @@ + + + + + + From 2730ab38f8ae7f63e4be5b0d23f41b23bc78b8bf Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Aug 2008 20:58:04 +0000 Subject: [PATCH 176/388] If you change an rbuild file to use an arch-specific .def file, please also provide those .def files. svn path=/branches/ros-amd64-bringup/; revision=35684 --- reactos/dll/win32/gdi32/gdi32.rbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/gdi32/gdi32.rbuild b/reactos/dll/win32/gdi32/gdi32.rbuild index 6bb303e1e1f..a1924217ef1 100644 --- a/reactos/dll/win32/gdi32/gdi32.rbuild +++ b/reactos/dll/win32/gdi32/gdi32.rbuild @@ -1,5 +1,5 @@ - + include 0x0600 From 110717948ab53babd1e336367b19b7dd3380d694 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Aug 2008 21:29:31 +0000 Subject: [PATCH 177/388] Make kdcom x86 code 64bit compatible and use it for amd64, too. Add a DriverEntry to make ld happy. svn path=/branches/ros-amd64-bringup/; revision=35685 --- reactos/drivers/base/kdcom/amd64/kdbg.c | 360 ------------------------ reactos/drivers/base/kdcom/i386/kdbg.c | 16 +- reactos/drivers/base/kdcom/kdcom.rbuild | 2 +- 3 files changed, 14 insertions(+), 364 deletions(-) delete mode 100644 reactos/drivers/base/kdcom/amd64/kdbg.c diff --git a/reactos/drivers/base/kdcom/amd64/kdbg.c b/reactos/drivers/base/kdcom/amd64/kdbg.c deleted file mode 100644 index faf27be6e47..00000000000 --- a/reactos/drivers/base/kdcom/amd64/kdbg.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: drivers/base/kdcom/kdbg.c - * PURPOSE: Serial i/o functions for the kernel debugger. - * PROGRAMMER: Alex Ionescu - * Hervé Poussineau - */ - -/* INCLUDES *****************************************************************/ - -#define NOEXTAPI -#include -#define NDEBUG -#include -#include -#include -#include "arc/arc.h" -#include "windbgkd.h" -#include -#include /* port intrinsics */ - -typedef struct _KD_PORT_INFORMATION -{ - ULONG ComPort; - ULONG BaudRate; - ULONG BaseAddress; -} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION; - -BOOLEAN -NTAPI -KdPortInitializeEx( - IN PKD_PORT_INFORMATION PortInformation, - IN ULONG Unknown1, - IN ULONG Unknown2); - -BOOLEAN -NTAPI -KdPortGetByteEx( - IN PKD_PORT_INFORMATION PortInformation, - OUT PUCHAR ByteReceived); - -BOOLEAN -NTAPI -KdPortPollByteEx( - IN PKD_PORT_INFORMATION PortInformation, - OUT PUCHAR ByteReceived); - -VOID -NTAPI -KdPortPutByteEx( - IN PKD_PORT_INFORMATION PortInformation, - IN UCHAR ByteToSend); - -#define DEFAULT_BAUD_RATE 19200 - -#ifdef _M_IX86 -const ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; -#elif defined(_M_PPC) -const ULONG BaseArray[2] = {0, 0x800003f8}; -#elif defined(_M_MIPS) -const ULONG BaseArray[3] = {0, 0x80006000, 0x80007000}; -#elif defined(_M_ARM) -const ULONG BaseArray[2] = {0, 0xF1012000}; -#elif defined(_M_AMD64) -const ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; -#else -#error Unknown architecture -#endif - -/* MACROS *******************************************************************/ - -#define SER_RBR(x) ((PUCHAR)(x)+0) -#define SER_THR(x) ((PUCHAR)(x)+0) -#define SER_DLL(x) ((PUCHAR)(x)+0) -#define SER_IER(x) ((PUCHAR)(x)+1) -#define SR_IER_ERDA 0x01 -#define SR_IER_ETHRE 0x02 -#define SR_IER_ERLSI 0x04 -#define SR_IER_EMS 0x08 -#define SR_IER_ALL 0x0F -#define SER_DLM(x) ((PUCHAR)(x)+1) -#define SER_IIR(x) ((PUCHAR)(x)+2) -#define SER_FCR(x) ((PUCHAR)(x)+2) -#define SR_FCR_ENABLE_FIFO 0x01 -#define SR_FCR_CLEAR_RCVR 0x02 -#define SR_FCR_CLEAR_XMIT 0x04 -#define SER_LCR(x) ((PUCHAR)(x)+3) -#define SR_LCR_CS5 0x00 -#define SR_LCR_CS6 0x01 -#define SR_LCR_CS7 0x02 -#define SR_LCR_CS8 0x03 -#define SR_LCR_ST1 0x00 -#define SR_LCR_ST2 0x04 -#define SR_LCR_PNO 0x00 -#define SR_LCR_POD 0x08 -#define SR_LCR_PEV 0x18 -#define SR_LCR_PMK 0x28 -#define SR_LCR_PSP 0x38 -#define SR_LCR_BRK 0x40 -#define SR_LCR_DLAB 0x80 -#define SER_MCR(x) ((PUCHAR)(x)+4) -#define SR_MCR_DTR 0x01 -#define SR_MCR_RTS 0x02 -#define SR_MCR_OUT1 0x04 -#define SR_MCR_OUT2 0x08 -#define SR_MCR_LOOP 0x10 -#define SER_LSR(x) ((PUCHAR)(x)+5) -#define SR_LSR_DR 0x01 -#define SR_LSR_TBE 0x20 -#define SER_MSR(x) ((PUCHAR)(x)+6) -#define SR_MSR_CTS 0x10 -#define SR_MSR_DSR 0x20 -#define SER_SCR(x) ((PUCHAR)(x)+7) - - -/* GLOBAL VARIABLES *********************************************************/ - -/* STATIC VARIABLES *********************************************************/ - -//static KD_PORT_INFORMATION DefaultPort = { 0, 0, 0 }; - -/* The com port must only be initialized once! */ -//static BOOLEAN PortInitialized = FALSE; - - -/* STATIC FUNCTIONS *********************************************************/ - -/* -static BOOLEAN -KdpDoesComPortExist( - IN ULONG BaseAddress) -{ - UNIMPLEMENTED; - return FALSE; -} -*/ - -/* FUNCTIONS ****************************************************************/ - -NTSTATUS -DriverEntry( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPath) -{ - return STATUS_SUCCESS; -} - -/* HAL.KdPortInitialize */ -BOOLEAN -NTAPI -KdPortInitialize( - IN PKD_PORT_INFORMATION PortInformation, - IN ULONG Unknown1, - IN ULONG Unknown2) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* HAL.KdPortInitializeEx */ -BOOLEAN -NTAPI -KdPortInitializeEx( - IN PKD_PORT_INFORMATION PortInformation, - IN ULONG Unknown1, - IN ULONG Unknown2) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* HAL.KdPortGetByte */ -BOOLEAN -NTAPI -KdPortGetByte( - OUT PUCHAR ByteReceived) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* HAL.KdPortGetByteEx */ -BOOLEAN -NTAPI -KdPortGetByteEx( - IN PKD_PORT_INFORMATION PortInformation, - OUT PUCHAR ByteReceived) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* HAL.KdPortPollByte */ -BOOLEAN -NTAPI -KdPortPollByte( - OUT PUCHAR ByteReceived) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* HAL.KdPortPollByteEx */ -BOOLEAN -NTAPI -KdPortPollByteEx( - IN PKD_PORT_INFORMATION PortInformation, - OUT PUCHAR ByteReceived) -{ - UNIMPLEMENTED; - return FALSE; -} - -/* HAL.KdPortPutByte */ -VOID -NTAPI -KdPortPutByte( - IN UCHAR ByteToSend) -{ - UNIMPLEMENTED; - return; -} - -/* HAL.KdPortPutByteEx */ -VOID -NTAPI -KdPortPutByteEx( - IN PKD_PORT_INFORMATION PortInformation, - IN UCHAR ByteToSend) -{ - UNIMPLEMENTED; - return; -} - - -/* HAL.KdPortRestore */ -VOID -NTAPI -KdPortRestore(VOID) -{ - UNIMPLEMENTED; -} - - -/* HAL.KdPortSave */ -VOID -NTAPI -KdPortSave(VOID) -{ - UNIMPLEMENTED; -} - - -/* HAL.KdPortDisableInterrupts */ -BOOLEAN -NTAPI -KdPortDisableInterrupts(VOID) -{ - UNIMPLEMENTED; - return FALSE; -} - - - -/* HAL.KdPortEnableInterrupts */ -BOOLEAN -NTAPI -KdPortEnableInterrupts(VOID) -{ - UNIMPLEMENTED; - return FALSE; -} - - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -KdDebuggerInitialize0( - IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -KdDebuggerInitialize1( - IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -KdSave( - IN BOOLEAN SleepTransition) -{ - /* Nothing to do on COM ports */ - return STATUS_SUCCESS; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -KdRestore( - IN BOOLEAN SleepTransition) -{ - /* Nothing to do on COM ports */ - return STATUS_SUCCESS; -} - -/* - * @unimplemented - */ -VOID -NTAPI -KdSendPacket( - IN ULONG PacketType, - IN PSTRING MessageHeader, - IN PSTRING MessageData, - IN OUT PKD_CONTEXT Context) -{ - UNIMPLEMENTED; - return; -} - -/* - * @unimplemented - */ -KDSTATUS -NTAPI -KdReceivePacket( - IN ULONG PacketType, - OUT PSTRING MessageHeader, - OUT PSTRING MessageData, - OUT PULONG DataLength, - IN OUT PKD_CONTEXT Context) -{ - UNIMPLEMENTED; - return 0; -} - -/* EOF */ diff --git a/reactos/drivers/base/kdcom/i386/kdbg.c b/reactos/drivers/base/kdcom/i386/kdbg.c index b3e63edfc29..b50692f9508 100644 --- a/reactos/drivers/base/kdcom/i386/kdbg.c +++ b/reactos/drivers/base/kdcom/i386/kdbg.c @@ -24,7 +24,7 @@ typedef struct _KD_PORT_INFORMATION { ULONG ComPort; ULONG BaudRate; - ULONG BaseAddress; + ULONG_PTR BaseAddress; } KD_PORT_INFORMATION, *PKD_PORT_INFORMATION; BOOLEAN @@ -62,6 +62,8 @@ const ULONG BaseArray[2] = {0, 0x800003f8}; const ULONG BaseArray[3] = {0, 0x80006000, 0x80007000}; #elif defined(_M_ARM) const ULONG BaseArray[2] = {0, 0xF1012000}; +#elif defined(_M_AMD64) +const ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; #else #error Unknown architecture #endif @@ -126,7 +128,7 @@ static BOOLEAN PortInitialized = FALSE; static BOOLEAN KdpDoesComPortExist( - IN ULONG BaseAddress) + IN ULONG_PTR BaseAddress) { BOOLEAN found; UCHAR mcr; @@ -186,6 +188,14 @@ KdpDoesComPortExist( /* FUNCTIONS ****************************************************************/ +NTSTATUS +DriverEntry( + IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPath) +{ + return STATUS_SUCCESS; +} + /* HAL.KdPortInitialize */ BOOLEAN NTAPI @@ -245,7 +255,7 @@ KdPortInitializeEx( IN ULONG Unknown1, IN ULONG Unknown2) { - ULONG ComPortBase; + ULONG_PTR ComPortBase; CHAR buffer[80]; ULONG divisor; UCHAR lcr; diff --git a/reactos/drivers/base/kdcom/kdcom.rbuild b/reactos/drivers/base/kdcom/kdcom.rbuild index bb6a2f676a2..923eff59f79 100644 --- a/reactos/drivers/base/kdcom/kdcom.rbuild +++ b/reactos/drivers/base/kdcom/kdcom.rbuild @@ -17,7 +17,7 @@ - + kdbg.c From 736cebd3a6ea797c9f0817875acb5e8414a194e6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 26 Aug 2008 23:06:18 +0000 Subject: [PATCH 178/388] With a few more defines, strsafe.h can now implement all functions Cb/Cch, Ansi/Unicode from a single piece of code. Implement all Cb functions in the lib (depending on the unimplemented inline versions) svn path=/branches/ros-amd64-bringup/; revision=35689 --- reactos/include/psdk/strsafe.h | 271 ++++++++++++++++--- reactos/lib/sdk/strsafe/StringCbCatExA.c | 18 ++ reactos/lib/sdk/strsafe/StringCbCatExW.c | 18 ++ reactos/lib/sdk/strsafe/StringCbCatNA.c | 15 + reactos/lib/sdk/strsafe/StringCbCatNExA.c | 19 ++ reactos/lib/sdk/strsafe/StringCbCatNExW.c | 19 ++ reactos/lib/sdk/strsafe/StringCbCatNW.c | 15 + reactos/lib/sdk/strsafe/StringCbCatW.c | 14 + reactos/lib/sdk/strsafe/StringCbCopyExA.c | 17 ++ reactos/lib/sdk/strsafe/StringCbCopyExW.c | 18 ++ reactos/lib/sdk/strsafe/StringCbCopyNA.c | 15 + reactos/lib/sdk/strsafe/StringCbCopyNExA.c | 19 ++ reactos/lib/sdk/strsafe/StringCbCopyNExW.c | 19 ++ reactos/lib/sdk/strsafe/StringCbCopyNW.c | 15 + reactos/lib/sdk/strsafe/StringCbCopyW.c | 14 + reactos/lib/sdk/strsafe/StringCbGetsA.c | 13 + reactos/lib/sdk/strsafe/StringCbGetsExA.c | 16 ++ reactos/lib/sdk/strsafe/StringCbGetsExW.c | 16 ++ reactos/lib/sdk/strsafe/StringCbGetsW.c | 13 + reactos/lib/sdk/strsafe/StringCbLengthA.c | 14 + reactos/lib/sdk/strsafe/StringCbLengthW.c | 14 + reactos/lib/sdk/strsafe/StringCbPrintfExA.c | 22 ++ reactos/lib/sdk/strsafe/StringCbPrintfExW.c | 22 ++ reactos/lib/sdk/strsafe/StringCbPrintfW.c | 19 ++ reactos/lib/sdk/strsafe/StringCbVPrintfA.c | 15 + reactos/lib/sdk/strsafe/StringCbVPrintfExA.c | 18 ++ reactos/lib/sdk/strsafe/StringCbVPrintfExW.c | 18 ++ reactos/lib/sdk/strsafe/StringCbVPrintfW.c | 15 + reactos/lib/sdk/strsafe/strsafe.rbuild | 27 ++ 29 files changed, 716 insertions(+), 32 deletions(-) create mode 100644 reactos/lib/sdk/strsafe/StringCbCatExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCatExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCatNA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCatNExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCatNExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCatNW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCatW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyNA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyNExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyNExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyNW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbCopyW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbGetsA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbGetsExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbGetsExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbGetsW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbLengthA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbLengthW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbPrintfExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbPrintfExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbPrintfW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbVPrintfA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbVPrintfExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCbVPrintfExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCbVPrintfW.c diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index e8cf6008199..643388baa0b 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -20,24 +20,90 @@ typedef wchar_t * STRSAFE_LPWSTR; typedef const wchar_t * STRSAFE_LPCWSTR; typedef unsigned long STRSAFE_DWORD; -/* Implement for ansi and unicode */ #define STRSAFE_PASS2 + +/* Implement Cb functions for ansi and unicode */ +#define STRSAFE_CB +#define STRSAFE_CXX_CB(x) +#define STRSAFE_CXX_CCH(x) x *= sizeof(STRSAFE_TCHAR) #define STRSAFE_UNICODE 0 # include #undef STRSAFE_UNICODE #define STRSAFE_UNICODE 1 # include #undef STRSAFE_UNICODE +#undef STRSAFE_CXX +#undef STRSAFE_CB +#undef STRSAFE_CXX_CB +#undef STRSAFE_CXX_CCH + +/* Implement Cch functions for ansi and unicode */ +#define STRSAFE_CXX_CB(x) x /= sizeof(STRSAFE_TCHAR) +#define STRSAFE_CXX_CCH(x) +#define STRSAFE_UNICODE 0 +# include +#undef STRSAFE_UNICODE +#define STRSAFE_UNICODE 1 +# include +#undef STRSAFE_UNICODE +#undef STRSAFE_CXX_CB +#undef STRSAFE_CXX_CCH + #undef STRSAFE_PASS2 /* Now define the functions depending on UNICODE */ -#ifdef UNICODE -# define STRSAFE_UNICODE 1 -#else -# define STRSAFE_UNICODE 0 -#endif -#include -#undef STRSAFE_UNICODE +#if defined(UNICODE) + +#define StringCbCat StringCbCatW +#define StringCbCatEx StringCbCatExW +#define StringCbCatN StringCbCatNW +#define StringCbCatNEx StringCbCatNExW +#define StringCbCopy StringCbCopyW +#define StringCbCopyEx StringCbCopyExW +#define StringCbCopyN StringCbCopyNW +#define StringCbCopyNEx StringCbCopyNExW +#define StringCbGets StringCbGetsW +#define StringCbGetsEx StringCbGetsExW +#define StringCbLength StringCbLengthW +#define StringCbPrintf StringCbPrintfW +#define StringCbPrintfEx StringCbPrintfExW +#define StringCbVPrintf StringCbVPrintfW +#define StringCbVPrintfEx StringCbVPrintfExW +#define StringCchCat StringCchCatW +#define StringCchCatEx StringCchCatExW +#define StringCchCatN StringCchCatNW +#define StringCchCatNEx StringCchCatNExW +#define StringCchCopy StringCchCopyW +#define StringCchCopyEx StringCchCopyExW +#define StringCchCopyN StringCchCopyNW +#define StringCchCopyNEx StringCchCopyNExW +#define StringCchGets StringCchGetsW +#define StringCchGetsEx StringCchGetsExW +#define StringCchLength StringCchLengthW +#define StringCchPrintf StringCchPrintfW +#define StringCchPrintfEx StringCchPrintfExW +#define StringCchVPrintf StringCchVPrintfW +#define StringCchVPrintfEx StringCchVPrintfExW + +#else // !UNICODE + +#define StringCbCat StringCbCatA +#define StringCbCatEx StringCbCatExA +#define StringCbCatN StringCbCatNA +#define StringCbCatNEx StringCbCatNExA +#define StringCbCopy StringCbCopyA +#define StringCbCopyEx StringCbCopyExA +#define StringCbCopyN StringCbCopyNA +#define StringCbCopyNEx StringCbCopyNExA +#define StringCbGets StringCbGetsA +#define StringCbGetsEx StringCbGetsExA +#define StringCbLength StringCbLengthA +#define StringCbPrintf StringCbPrintfA +#define StringCbPrintfEx StringCbPrintfExA +#define StringCbVPrintf StringCbVPrintfA +#define StringCbVPrintfEx StringCbVPrintfExA + +#endif // !UNICODE #endif // !__STRSAFE_H_ @@ -48,21 +114,81 @@ typedef unsigned long STRSAFE_DWORD; #define STRSAFE_LPTSTR STRSAFE_LPWSTR #define STRSAFE_LPCTSTR STRSAFE_LPCWSTR +#define STRSAFE_TCHAR wchar_t -#define StringCbCat StringCbCatW -#define StringCbCopy StringCbCopyW -#define StringCbVPrintf StringCbVPrintfW -#define StringCbPrintf StringCbPrintfW +#if defined(STRSAFE_CB) +#define StringCxxCat StringCbCatW +#define StringCxxCatEx StringCbCatExW +#define StringCxxCatN StringCbCatNW +#define StringCxxCatNEx StringCbCatNExW +#define StringCxxCopy StringCbCopyW +#define StringCxxCopyEx StringCbCopyExW +#define StringCxxCopyN StringCbCopyNW +#define StringCxxCopyNEx StringCbCopyNExW +#define StringCxxGets StringCbGetsW +#define StringCxxGetsEx StringCbGetsExW +#define StringCxxLength StringCbLengthW +#define StringCxxPrintf StringCbPrintfW +#define StringCxxPrintfEx StringCbPrintfExW +#define StringCxxVPrintf StringCbVPrintfW +#define StringCxxVPrintfEx StringCbVPrintfExW +#else // !STRSAFE_CB +#define StringCxxCat StringCchCatW +#define StringCxxCatEx StringCchCatExW +#define StringCxxCatN StringCchCatNW +#define StringCxxCatNEx StringCchCatNExW +#define StringCxxCopy StringCchCopyW +#define StringCxxCopyEx StringCchCopyExW +#define StringCxxCopyN StringCchCopyNW +#define StringCxxCopyNEx StringCchCopyNExW +#define StringCxxGets StringCchGetsW +#define StringCxxGetsEx StringCchGetsExW +#define StringCxxLength StringCchLengthW +#define StringCxxPrintf StringCchPrintfW +#define StringCxxPrintfEx StringCchPrintfExW +#define StringCxxVPrintf StringCchVPrintfW +#define StringCxxVPrintfEx StringCchVPrintfExW +#endif // !STRSAFE_CB #else // (STRSAFE_UNICODE != 1) #define STRSAFE_LPTSTR STRSAFE_LPSTR #define STRSAFE_LPCTSTR STRSAFE_LPCSTR +#define STRSAFE_TCHAR char -#define StringCbCat StringCbCatA -#define StringCbCopy StringCbCopyA -#define StringCbVPrintf StringCbVPrintfA -#define StringCbPrintf StringCbPrintfA +#if defined(STRSAFE_CB) +#define StringCxxCat StringCbCatA +#define StringCxxCatEx StringCbCatExA +#define StringCxxCatN StringCbCatNA +#define StringCxxCatNEx StringCbCatNExA +#define StringCxxCopy StringCbCopyA +#define StringCxxCopyEx StringCbCopyExA +#define StringCxxCopyN StringCbCopyNA +#define StringCxxCopyNEx StringCbCopyNExA +#define StringCxxGets StringCbGetsA +#define StringCxxGetsEx StringCbGetsExA +#define StringCxxLength StringCbLengthA +#define StringCxxPrintf StringCbPrintfA +#define StringCxxPrintfEx StringCbPrintfExA +#define StringCxxVPrintf StringCbVPrintfA +#define StringCxxVPrintfEx StringCbVPrintfExA +#else // !STRSAFE_CB +#define StringCxxCat StringCchCatA +#define StringCxxCatEx StringCchCatExA +#define StringCxxCatN StringCchCatNA +#define StringCxxCatNEx StringCchCatNExA +#define StringCxxCopy StringCchCopyA +#define StringCxxCopyEx StringCchCopyExA +#define StringCxxCopyN StringCchCopyNA +#define StringCopyNEx StringCchCopyNExA +#define StringCxxGets StringCchGetsA +#define StringCxxGetsEx StringCchGetsExA +#define StringCxxLength StringCchLengthA +#define StringCxxPrintf StringCchPrintfA +#define StringCxxPrintfEx StringCchPrintfExA +#define StringCxxVPrintf StringCchVPrintfA +#define StringCxxVPrintfEx StringCchVPrintfExA +#endif // !STRSAFE_CB #endif // (STRSAFE_UNICODE != 1) #endif // defined(STRSAFE_UNICODE) @@ -77,10 +203,21 @@ typedef unsigned long STRSAFE_DWORD; #define STRSAFEAPI HRESULT __stdcall #ifndef STRSAFE_NO_CB_FUNCTIONS -STRSAFEAPI StringCbCat(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc); -STRSAFEAPI StringCbCopy(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc); -STRSAFEAPI StringCbVPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, va_list args); -STRSAFEAPI StringCbPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, ...); +STRSAFEAPI StringCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCatEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCatN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend); +STRSAFEAPI StringCatNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCopy(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCopyEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCopyN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc); +STRSAFEAPI StringCopyNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringGets(STRSAFE_LPTSTR pszDest, size_t cxDest); +STRSAFEAPI StringGetsEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringLength(STRSAFE_LPCTSTR psz, size_t cxMax, size_t *pcb); +STRSAFEAPI StringPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, ...); +STRSAFEAPI StringPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCTSTR pszFormat, ...); +STRSAFEAPI StringVPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, va_list args); +STRSAFEAPI StringVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, LPCTSTR pszFormat, va_list args); #endif // !STRSAFE_NO_CB_FUNCTIONS #ifndef STRSAFE_NO_CCH_FUNCTIONS @@ -95,30 +232,88 @@ STRSAFEAPI StringCbPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR #ifndef STRSAFE_NO_CB_FUNCTIONS -STRSAFEAPI StringCbCat(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc) +STRSAFEAPI StringCxxCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc) +{ + STRSAFE_CXX_CB(cxDest); + return 0; // FIXME +} + +STRSAFEAPI StringCxxCatEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) { return 0; // FIXME } -STRSAFEAPI -StringCbCopy(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc) +STRSAFEAPI StringCxxCatN(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend) { return 0; // FIXME } -STRSAFEAPI -StringCbVPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, va_list args) +STRSAFEAPI StringCxxCatNEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) { return 0; // FIXME } -STRSAFEAPI -StringCbPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, ...) +STRSAFEAPI StringCxxCopy(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxCopyEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxCopyN(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxCopyNEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxGets(STRSAFE_LPTSTR pszDest, size_t cbDest) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxGetsEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxLength(STRSAFE_LPCTSTR psz, size_t cbMax, size_t *pcb) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxVPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, va_list args) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCTSTR pszFormat, va_list args) +{ + return 0; // FIXME +} + +STRSAFEAPI StringCxxPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, ...) { HRESULT result; va_list args; va_start(args, pszFormat); - result = StringCbVPrintf(pszDest, cbDest, pszFormat, args); + result = StringCxxVPrintf(pszDest, cbDest, pszFormat, args); + va_end(args); + return result; +} + +STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCTSTR pszFormat, ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCxxVPrintfEx(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); va_end(args); return result; } @@ -132,13 +327,25 @@ StringCbPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, #endif // !STRSAFE_LIB /* Functions are implemented or defined, clear #defines for next pass */ -#undef StringCbCat -#undef StringCbCopy -#undef StringCbVPrintf -#undef StringCbPrintf +#undef StringCxxCat +#undef StringCxxCatEx +#undef StringCxxCatN +#undef StringCxxCatNEx +#undef StringCxxCopy +#undef StringCxxCopyEx +#undef StringCxxCopyN +#undef StringCxxCopyNEx +#undef StringCxxGets +#undef StringCxxGetsEx +#undef StringCxxLength +#undef StringCxxPrintf +#undef StringCxxPrintfEx +#undef StringCxxVPrintf +#undef StringCxxVPrintfEx #undef STRSAFE_LPTSTR #undef STRSAFE_LPCTSTR +#undef STRSAFE_TCHAR #endif // defined (STRSAFE_PASS2) diff --git a/reactos/lib/sdk/strsafe/StringCbCatExA.c b/reactos/lib/sdk/strsafe/StringCbCatExA.c new file mode 100644 index 00000000000..4869911d6a2 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatExA.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatExA _StringCbCatExA +#include + +#undef StringCbCatExA +HRESULT __stdcall +StringCbCatExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCbCatExA(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCatExW.c b/reactos/lib/sdk/strsafe/StringCbCatExW.c new file mode 100644 index 00000000000..4ab703a3d6b --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatExW.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatExW _StringCbCatExW +#include + +#undef StringCbCatExW +HRESULT __stdcall +StringCbCatExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCbCatExW(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCatNA.c b/reactos/lib/sdk/strsafe/StringCbCatNA.c new file mode 100644 index 00000000000..5d85ef48b9f --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatNA.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatNA _StringCbCatNA +#include + +#undef StringCbCatNA +HRESULT __stdcall +StringCbCatNA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbMaxAppend) +{ + /* Use the inlined version */ + return _StringCbCatNA(pszDest, cbDest, pszSrc, cbMaxAppend); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCatNExA.c b/reactos/lib/sdk/strsafe/StringCbCatNExA.c new file mode 100644 index 00000000000..06b2e9e30db --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatNExA.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatNExA _StringCbCatNExA +#include + +#undef StringCbCatNExA +HRESULT __stdcall +StringCbCatNExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCbCatNExA(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCatNExW.c b/reactos/lib/sdk/strsafe/StringCbCatNExW.c new file mode 100644 index 00000000000..295b9398602 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatNExW.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatNExW _StringCbCatNExW +#include + +#undef StringCbCatNExW +HRESULT __stdcall +StringCbCatNExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCbCatNExW(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCatNW.c b/reactos/lib/sdk/strsafe/StringCbCatNW.c new file mode 100644 index 00000000000..c65417f488b --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatNW.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatNW _StringCbCatNW +#include + +#undef StringCbCatNW +HRESULT __stdcall +StringCbCatNW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbMaxAppend) +{ + /* Use the inlined version */ + return _StringCbCatNW(pszDest, cbDest, pszSrc, cbMaxAppend); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCatW.c b/reactos/lib/sdk/strsafe/StringCbCatW.c new file mode 100644 index 00000000000..15964ab182d --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCatW.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCatW _StringCbCatW +#include + +#undef StringCbCatW +HRESULT __stdcall +StringCbCatW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCbCatW(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyExA.c b/reactos/lib/sdk/strsafe/StringCbCopyExA.c new file mode 100644 index 00000000000..abaf57779d6 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyExA.c @@ -0,0 +1,17 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyExA _StringCbCopyExA +#include + +#undef StringCbCopyExA +HRESULT __stdcall +StringCbCopyExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + /* Use the inlined version */ + return _StringCbCopyExA(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyExW.c b/reactos/lib/sdk/strsafe/StringCbCopyExW.c new file mode 100644 index 00000000000..a1af1fb2e7d --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyExW.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyExW _StringCbCopyExW +#include + +#undef StringCbCopyExW +HRESULT __stdcall +StringCbCopyExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCbCopyExW(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyNA.c b/reactos/lib/sdk/strsafe/StringCbCopyNA.c new file mode 100644 index 00000000000..2a9da912fd4 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyNA.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyNA _StringCbCopyNA +#include + +#undef StringCbCopyNA +HRESULT __stdcall +StringCbCopyNA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbSrc) +{ + /* Use the inlined version */ + return _StringCbCopyNA(pszDest, cbDest, pszSrc, cbSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyNExA.c b/reactos/lib/sdk/strsafe/StringCbCopyNExA.c new file mode 100644 index 00000000000..b82bfed1ac1 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyNExA.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyNExA _StringCbCopyNExA +#include + +#undef StringCbCopyNExA +HRESULT __stdcall +StringCbCopyNExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCbCopyNExA(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyNExW.c b/reactos/lib/sdk/strsafe/StringCbCopyNExW.c new file mode 100644 index 00000000000..00340d6c336 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyNExW.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyNExW _StringCbCopyNExW +#include + +#undef StringCbCopyNExW +HRESULT __stdcall +StringCbCopyNExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCbCopyNExW(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyNW.c b/reactos/lib/sdk/strsafe/StringCbCopyNW.c new file mode 100644 index 00000000000..788410b0537 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyNW.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyNW _StringCbCopyNW +#include + +#undef StringCbCopyNW +HRESULT __stdcall +StringCbCopyNW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbSrc) +{ + /* Use the inlined version */ + return _StringCbCopyNW(pszDest, cbDest, pszSrc, cbSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCbCopyW.c b/reactos/lib/sdk/strsafe/StringCbCopyW.c new file mode 100644 index 00000000000..14f812f8e53 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbCopyW.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbCopyW _StringCbCopyW +#include + +#undef StringCbCopyW +HRESULT __stdcall +StringCbCopyW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCbCopyW(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCbGetsA.c b/reactos/lib/sdk/strsafe/StringCbGetsA.c new file mode 100644 index 00000000000..2594563f804 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbGetsA.c @@ -0,0 +1,13 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbGetsA _StringCbGetsA +#include + +#undef StringCbGetsA +HRESULT __stdcall +StringCbGetsA( + STRSAFE_LPSTR pszDest, + size_t cbDest) +{ + /* Use the inlined version */ + return _StringCbGetsA(pszDest, cbDest); +} diff --git a/reactos/lib/sdk/strsafe/StringCbGetsExA.c b/reactos/lib/sdk/strsafe/StringCbGetsExA.c new file mode 100644 index 00000000000..54b77cc394b --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbGetsExA.c @@ -0,0 +1,16 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbGetsExA _StringCbGetsExA +#include + +#undef StringCbGetsExA +HRESULT __stdcall +StringCbGetsExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + /* Use the inlined version */ + return _StringCbGetsExA(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbGetsExW.c b/reactos/lib/sdk/strsafe/StringCbGetsExW.c new file mode 100644 index 00000000000..dc948f9a7f3 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbGetsExW.c @@ -0,0 +1,16 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbGetsExW _StringCbGetsExW +#include + +#undef StringCbGetsExW +HRESULT __stdcall +StringCbGetsExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + /* Use the inlined version */ + return _StringCbGetsExW(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCbGetsW.c b/reactos/lib/sdk/strsafe/StringCbGetsW.c new file mode 100644 index 00000000000..d948d255a58 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbGetsW.c @@ -0,0 +1,13 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbGetsW _StringCbGetsW +#include + +#undef StringCbGetsW +HRESULT __stdcall +StringCbGetsW( + STRSAFE_LPWSTR pszDest, + size_t cbDest) +{ + /* Use the inlined version */ + return _StringCbGetsW(pszDest, cbDest); +} diff --git a/reactos/lib/sdk/strsafe/StringCbLengthA.c b/reactos/lib/sdk/strsafe/StringCbLengthA.c new file mode 100644 index 00000000000..91d9b582f1e --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbLengthA.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbLengthA _StringCbLengthA +#include + +#undef StringCbLengthA +HRESULT __stdcall +StringCbLengthA( + STRSAFE_LPCSTR psz, + size_t cbMax, + size_t *pcb) +{ + /* Use the inlined version */ + return _StringCbLengthA(psz, cbMax, pcb); +} diff --git a/reactos/lib/sdk/strsafe/StringCbLengthW.c b/reactos/lib/sdk/strsafe/StringCbLengthW.c new file mode 100644 index 00000000000..0a29c27e002 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbLengthW.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbLengthW _StringCbLengthW +#include + +#undef StringCbLengthW +HRESULT __stdcall +StringCbLengthW( + STRSAFE_LPCWSTR psz, + size_t cbMax, + size_t *pcb) +{ + /* Use the inlined version */ + return _StringCbLengthW(psz, cbMax, pcb); +} diff --git a/reactos/lib/sdk/strsafe/StringCbPrintfExA.c b/reactos/lib/sdk/strsafe/StringCbPrintfExA.c new file mode 100644 index 00000000000..5fa7d836f49 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbPrintfExA.c @@ -0,0 +1,22 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbPrintfExA _StringCbPrintfExA +#include + +#undef StringCbPrintfExA +HRESULT __stdcall +StringCbPrintfExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCbVPrintfExA(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/StringCbPrintfExW.c b/reactos/lib/sdk/strsafe/StringCbPrintfExW.c new file mode 100644 index 00000000000..2a7aeb1c7b0 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbPrintfExW.c @@ -0,0 +1,22 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbPrintfExW _StringCbPrintfExW +#include + +#undef StringCbPrintfExW +HRESULT __stdcall +StringCbPrintfExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCWSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCbVPrintfExW(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/StringCbPrintfW.c b/reactos/lib/sdk/strsafe/StringCbPrintfW.c new file mode 100644 index 00000000000..c89461152a9 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbPrintfW.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbPrintfW _StringCbPrintfW +#include + +#undef StringCbPrintfW +HRESULT __stdcall +StringCbPrintfW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCbVPrintfW(pszDest, cbDest, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/StringCbVPrintfA.c b/reactos/lib/sdk/strsafe/StringCbVPrintfA.c new file mode 100644 index 00000000000..b5ff9464639 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbVPrintfA.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbVPrintfA _StringCbVPrintfA +#include + +#undef StringCbVPrintfA +HRESULT __stdcall +StringCbVPrintfA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCbVPrintfA(pszDest, cbDest, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/StringCbVPrintfExA.c b/reactos/lib/sdk/strsafe/StringCbVPrintfExA.c new file mode 100644 index 00000000000..bd0e17dbca7 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbVPrintfExA.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbVPrintfExA _StringCbVPrintfExA +#include + +#undef StringCbVPrintfExA +HRESULT __stdcall +StringCbVPrintfExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCbVPrintfExA(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/StringCbVPrintfExW.c b/reactos/lib/sdk/strsafe/StringCbVPrintfExW.c new file mode 100644 index 00000000000..d545d0fc57c --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbVPrintfExW.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbVPrintfExW _StringCbVPrintfExW +#include + +#undef StringCbVPrintfExW +HRESULT __stdcall +StringCbVPrintfExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCWSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCbVPrintfExW(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/StringCbVPrintfW.c b/reactos/lib/sdk/strsafe/StringCbVPrintfW.c new file mode 100644 index 00000000000..2b20c3ac24a --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCbVPrintfW.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CCH_FUNCTIONS +#define StringCbVPrintfW _StringCbVPrintfW +#include + +#undef StringCbVPrintfW +HRESULT __stdcall +StringCbVPrintfW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCbVPrintfW(pszDest, cbDest, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/strsafe.rbuild b/reactos/lib/sdk/strsafe/strsafe.rbuild index bf744edafb3..5ab609b5859 100644 --- a/reactos/lib/sdk/strsafe/strsafe.rbuild +++ b/reactos/lib/sdk/strsafe/strsafe.rbuild @@ -3,6 +3,33 @@ StringCbCatA.c + StringCbCatW.c + StringCbCatExA.c + StringCbCatExW.c + StringCbCatNA.c + StringCbCatNW.c + StringCbCatNExA.c + StringCbCatNExW.c StringCbCopyA.c + StringCbCopyW.c + StringCbCopyExA.c + StringCbCopyExW.c + StringCbCopyNA.c + StringCbCopyNW.c + StringCbCopyNExA.c + StringCbCopyNExW.c + StringCbGetsA.c + StringCbGetsW.c + StringCbGetsExA.c + StringCbGetsExW.c + StringCbLengthA.c + StringCbLengthW.c StringCbPrintfA.c + StringCbPrintfW.c + StringCbPrintfExA.c + StringCbPrintfExW.c + StringCbVPrintfA.c + StringCbVPrintfW.c + StringCbVPrintfExA.c + StringCbVPrintfExW.c From a687a429195f1e11a18c05770b23dda12ffa891c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 00:40:10 +0000 Subject: [PATCH 179/388] - Rework defines in strsafe a bit. - Implement StringCxxLength() svn path=/branches/ros-amd64-bringup/; revision=35690 --- reactos/include/psdk/strsafe.h | 251 ++++++++++++++++++++------------- 1 file changed, 151 insertions(+), 100 deletions(-) diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index 643388baa0b..99fbc493a56 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -8,6 +8,11 @@ #error Both STRSAFE_NO_CCH_FUNCTIONS and STRSAFE_NO_CB_FUNCTIONS are defined #endif +#define STRSAFE_MAX_CCH 2147483647 +#define STRSAFE_E_INVALID_PARAMETER ((HRESULT)0x80070057L) +#ifndef S_OK +#define S_OK ((HRESULT)0x00000000L) +#endif #ifndef _HRESULT_DEFINED #define _HRESULT_DEFINED @@ -24,35 +29,43 @@ typedef unsigned long STRSAFE_DWORD; /* Implement Cb functions for ansi and unicode */ #define STRSAFE_CB -#define STRSAFE_CXX_CB(x) -#define STRSAFE_CXX_CCH(x) x *= sizeof(STRSAFE_TCHAR) #define STRSAFE_UNICODE 0 # include #undef STRSAFE_UNICODE #define STRSAFE_UNICODE 1 # include #undef STRSAFE_UNICODE -#undef STRSAFE_CXX #undef STRSAFE_CB -#undef STRSAFE_CXX_CB -#undef STRSAFE_CXX_CCH /* Implement Cch functions for ansi and unicode */ -#define STRSAFE_CXX_CB(x) x /= sizeof(STRSAFE_TCHAR) -#define STRSAFE_CXX_CCH(x) #define STRSAFE_UNICODE 0 # include #undef STRSAFE_UNICODE #define STRSAFE_UNICODE 1 # include #undef STRSAFE_UNICODE -#undef STRSAFE_CXX_CB -#undef STRSAFE_CXX_CCH #undef STRSAFE_PASS2 /* Now define the functions depending on UNICODE */ #if defined(UNICODE) +# define STRSAFE_UNICODE 1 +#else +# define STRSAFE_UNICODE 0 +#endif +#include +#undef STRSAFE_UNICODE + +#endif // !__STRSAFE_H_ + +/*****************************************************************************/ + +#if defined(STRSAFE_UNICODE) +#if (STRSAFE_UNICODE == 1) + +#define STRSAFE_LPTSTR STRSAFE_LPWSTR +#define STRSAFE_LPCTSTR STRSAFE_LPCWSTR +#define STRSAFE_TCHAR wchar_t #define StringCbCat StringCbCatW #define StringCbCatEx StringCbCatExW @@ -85,7 +98,11 @@ typedef unsigned long STRSAFE_DWORD; #define StringCchVPrintf StringCchVPrintfW #define StringCchVPrintfEx StringCchVPrintfExW -#else // !UNICODE +#else // (STRSAFE_UNICODE != 1) + +#define STRSAFE_LPTSTR STRSAFE_LPSTR +#define STRSAFE_LPCTSTR STRSAFE_LPCSTR +#define STRSAFE_TCHAR char #define StringCbCat StringCbCatA #define StringCbCatEx StringCbCatExA @@ -102,93 +119,21 @@ typedef unsigned long STRSAFE_DWORD; #define StringCbPrintfEx StringCbPrintfExA #define StringCbVPrintf StringCbVPrintfA #define StringCbVPrintfEx StringCbVPrintfExA - -#endif // !UNICODE - -#endif // !__STRSAFE_H_ - -/*****************************************************************************/ - -#if defined(STRSAFE_UNICODE) -#if (STRSAFE_UNICODE == 1) - -#define STRSAFE_LPTSTR STRSAFE_LPWSTR -#define STRSAFE_LPCTSTR STRSAFE_LPCWSTR -#define STRSAFE_TCHAR wchar_t - -#if defined(STRSAFE_CB) -#define StringCxxCat StringCbCatW -#define StringCxxCatEx StringCbCatExW -#define StringCxxCatN StringCbCatNW -#define StringCxxCatNEx StringCbCatNExW -#define StringCxxCopy StringCbCopyW -#define StringCxxCopyEx StringCbCopyExW -#define StringCxxCopyN StringCbCopyNW -#define StringCxxCopyNEx StringCbCopyNExW -#define StringCxxGets StringCbGetsW -#define StringCxxGetsEx StringCbGetsExW -#define StringCxxLength StringCbLengthW -#define StringCxxPrintf StringCbPrintfW -#define StringCxxPrintfEx StringCbPrintfExW -#define StringCxxVPrintf StringCbVPrintfW -#define StringCxxVPrintfEx StringCbVPrintfExW -#else // !STRSAFE_CB -#define StringCxxCat StringCchCatW -#define StringCxxCatEx StringCchCatExW -#define StringCxxCatN StringCchCatNW -#define StringCxxCatNEx StringCchCatNExW -#define StringCxxCopy StringCchCopyW -#define StringCxxCopyEx StringCchCopyExW -#define StringCxxCopyN StringCchCopyNW -#define StringCxxCopyNEx StringCchCopyNExW -#define StringCxxGets StringCchGetsW -#define StringCxxGetsEx StringCchGetsExW -#define StringCxxLength StringCchLengthW -#define StringCxxPrintf StringCchPrintfW -#define StringCxxPrintfEx StringCchPrintfExW -#define StringCxxVPrintf StringCchVPrintfW -#define StringCxxVPrintfEx StringCchVPrintfExW -#endif // !STRSAFE_CB - -#else // (STRSAFE_UNICODE != 1) - -#define STRSAFE_LPTSTR STRSAFE_LPSTR -#define STRSAFE_LPCTSTR STRSAFE_LPCSTR -#define STRSAFE_TCHAR char - -#if defined(STRSAFE_CB) -#define StringCxxCat StringCbCatA -#define StringCxxCatEx StringCbCatExA -#define StringCxxCatN StringCbCatNA -#define StringCxxCatNEx StringCbCatNExA -#define StringCxxCopy StringCbCopyA -#define StringCxxCopyEx StringCbCopyExA -#define StringCxxCopyN StringCbCopyNA -#define StringCxxCopyNEx StringCbCopyNExA -#define StringCxxGets StringCbGetsA -#define StringCxxGetsEx StringCbGetsExA -#define StringCxxLength StringCbLengthA -#define StringCxxPrintf StringCbPrintfA -#define StringCxxPrintfEx StringCbPrintfExA -#define StringCxxVPrintf StringCbVPrintfA -#define StringCxxVPrintfEx StringCbVPrintfExA -#else // !STRSAFE_CB -#define StringCxxCat StringCchCatA -#define StringCxxCatEx StringCchCatExA -#define StringCxxCatN StringCchCatNA -#define StringCxxCatNEx StringCchCatNExA -#define StringCxxCopy StringCchCopyA -#define StringCxxCopyEx StringCchCopyExA -#define StringCxxCopyN StringCchCopyNA -#define StringCopyNEx StringCchCopyNExA -#define StringCxxGets StringCchGetsA -#define StringCxxGetsEx StringCchGetsExA -#define StringCxxLength StringCchLengthA -#define StringCxxPrintf StringCchPrintfA -#define StringCxxPrintfEx StringCchPrintfExA -#define StringCxxVPrintf StringCchVPrintfA -#define StringCxxVPrintfEx StringCchVPrintfExA -#endif // !STRSAFE_CB +#define StringCchCat StringCchCatA +#define StringCchCatEx StringCchCatExA +#define StringCchCatN StringCchCatNA +#define StringCchCatNEx StringCchCatNExA +#define StringCchCopy StringCchCopyA +#define StringCchCopyEx StringCchCopyExA +#define StringCchCopyN StringCchCopyNA +#define StringCchCopyNEx StringCchCopyNExA +#define StringCchGets StringCchGetsA +#define StringCchGetsEx StringCchGetsExA +#define StringCchLength StringCchLengthA +#define StringCchPrintf StringCchPrintfA +#define StringCchPrintfEx StringCchPrintfExA +#define StringCchVPrintf StringCchVPrintfA +#define StringCchVPrintfEx StringCchVPrintfExA #endif // (STRSAFE_UNICODE != 1) #endif // defined(STRSAFE_UNICODE) @@ -197,6 +142,52 @@ typedef unsigned long STRSAFE_DWORD; #if defined (STRSAFE_PASS2) +#if defined(STRSAFE_CB) + +#define STRSAFE_CXXtoCB(x) (x) +#define STRSAFE_CBtoCXX(x) (x) +#define STRSAFE_CXXtoCCH(x) (x)*sizeof(STRSAFE_TCHAR) +#define STRSAFE_CCHtoCXX(x) (x)/sizeof(STRSAFE_TCHAR) +#define StringCxxCat StringCbCat +#define StringCxxCatEx StringCbCatEx +#define StringCxxCatN StringCbCatN +#define StringCxxCatNEx StringCbCatNEx +#define StringCxxCopy StringCbCopy +#define StringCxxCopyEx StringCbCopyEx +#define StringCxxCopyN StringCbCopyN +#define StringCxxCopyNEx StringCbCopyNEx +#define StringCxxGets StringCbGets +#define StringCxxGetsEx StringCbGetsEx +#define StringCxxLength StringCbLength +#define StringCxxPrintf StringCbPrintf +#define StringCxxPrintfEx StringCbPrintfEx +#define StringCxxVPrintf StringCbVPrintf +#define StringCxxVPrintfEx StringCbVPrintfEx + +#else // !STRSAFE_CB + +#define STRSAFE_CXXtoCB(x) (x)/sizeof(STRSAFE_TCHAR) +#define STRSAFE_CBtoCXX(x) (x)*sizeof(STRSAFE_TCHAR) +#define STRSAFE_CXXtoCCH(x) (x) +#define STRSAFE_CCHtoCXX(x) (x) +#define StringCxxCat StringCchCat +#define StringCxxCatEx StringCchCatEx +#define StringCxxCatN StringCchCatN +#define StringCxxCatNEx StringCchCatNEx +#define StringCxxCopy StringCchCopy +#define StringCxxCopyEx StringCchCopyEx +#define StringCxxCopyN StringCchCopyN +#define StringCxxCopyNEx StringCchCopyNEx +#define StringCxxGets StringCchGets +#define StringCxxGetsEx StringCchGetsEx +#define StringCxxLength StringCchLength +#define StringCxxPrintf StringCchPrintf +#define StringCxxPrintfEx StringCchPrintfEx +#define StringCxxVPrintf StringCchVPrintf +#define StringCxxVPrintfEx StringCchVPrintfEx + +#endif // !STRSAFE_CB + #ifdef STRSAFE_LIB /* Normal function prototypes only */ @@ -234,7 +225,6 @@ STRSAFEAPI StringVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR STRSAFEAPI StringCxxCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc) { - STRSAFE_CXX_CB(cxDest); return 0; // FIXME } @@ -283,9 +273,34 @@ STRSAFEAPI StringCxxGetsEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTSTR return 0; // FIXME } -STRSAFEAPI StringCxxLength(STRSAFE_LPCTSTR psz, size_t cbMax, size_t *pcb) +STRSAFEAPI StringCxxLength(STRSAFE_LPCTSTR psz, size_t cxMax, size_t *pcx) { - return 0; // FIXME + size_t cch = STRSAFE_CXXtoCCH(cxMax); + + /* Default return on error */ + if (pcx) + *pcx = 0; + + if (!psz || cch > STRSAFE_MAX_CCH || cch == 0) + { + return STRSAFE_E_INVALID_PARAMETER; + } + + while (*psz != 0 && cch != 0) + { + cch--; + psz++; + } + + if (cch == 0) + { + return STRSAFE_E_INVALID_PARAMETER; + } + + if (pcx) + *pcx = cxMax - STRSAFE_CCHtoCXX(cch); + + return S_OK; } STRSAFEAPI StringCxxVPrintf(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszFormat, va_list args) @@ -343,9 +358,45 @@ STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTS #undef StringCxxVPrintf #undef StringCxxVPrintfEx +#undef StringCbCat +#undef StringCbCatEx +#undef StringCbCatN +#undef StringCbCatNEx +#undef StringCbCopy +#undef StringCbCopyEx +#undef StringCbCopyN +#undef StringCbCopyNEx +#undef StringCbGets +#undef StringCbGetsEx +#undef StringCbLength +#undef StringCbPrintf +#undef StringCbPrintfEx +#undef StringCbVPrintf +#undef StringCbVPrintfEx +#undef StringCchCat +#undef StringCchCatEx +#undef StringCchCatN +#undef StringCchCatNEx +#undef StringCchCopy +#undef StringCchCopyEx +#undef StringCchCopyN +#undef StringCchCopyNEx +#undef StringCchGets +#undef StringCchGetsEx +#undef StringCchLength +#undef StringCchPrintf +#undef StringCchPrintfEx +#undef StringCchVPrintf +#undef StringCchVPrintfEx + #undef STRSAFE_LPTSTR #undef STRSAFE_LPCTSTR #undef STRSAFE_TCHAR +#undef STRSAFE_CXXtoCB +#undef STRSAFE_CBtoCXX +#undef STRSAFE_CXXtoCCH +#undef STRSAFE_CCHtoCXX + #endif // defined (STRSAFE_PASS2) From 9c0ddbba15f378ec6c733c8320d7ccb02721fc42 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 01:47:34 +0000 Subject: [PATCH 180/388] Optimize and shorten StringCxxLength svn path=/branches/ros-amd64-bringup/; revision=35691 --- reactos/include/psdk/strsafe.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index 99fbc493a56..248c9afc2b4 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -286,11 +286,7 @@ STRSAFEAPI StringCxxLength(STRSAFE_LPCTSTR psz, size_t cxMax, size_t *pcx) return STRSAFE_E_INVALID_PARAMETER; } - while (*psz != 0 && cch != 0) - { - cch--; - psz++; - } + for (--psz; *(++psz) != 0 && --cch > 0;); if (cch == 0) { From 68c27c7f46711a676b334223bcbc245eb1df706a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 02:08:24 +0000 Subject: [PATCH 181/388] Fix some strsafe.h definitions. svn path=/branches/ros-amd64-bringup/; revision=35692 --- reactos/include/psdk/strsafe.h | 41 ++++++++++++++++------------------ 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index 248c9afc2b4..3cea5450bbb 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -28,6 +28,7 @@ typedef unsigned long STRSAFE_DWORD; #define STRSAFE_PASS2 /* Implement Cb functions for ansi and unicode */ +#ifndef STRSAFE_NO_CB_FUNCTIONS #define STRSAFE_CB #define STRSAFE_UNICODE 0 # include @@ -36,14 +37,17 @@ typedef unsigned long STRSAFE_DWORD; # include #undef STRSAFE_UNICODE #undef STRSAFE_CB +#endif // !STRSAFE_NO_CB_FUNCTIONS /* Implement Cch functions for ansi and unicode */ +#ifndef STRSAFE_NO_CCH_FUNCTIONS #define STRSAFE_UNICODE 0 # include #undef STRSAFE_UNICODE #define STRSAFE_UNICODE 1 # include #undef STRSAFE_UNICODE +#endif // !STRSAFE_NO_CCH_FUNCTIONS #undef STRSAFE_PASS2 @@ -193,28 +197,21 @@ typedef unsigned long STRSAFE_DWORD; /* Normal function prototypes only */ #define STRSAFEAPI HRESULT __stdcall -#ifndef STRSAFE_NO_CB_FUNCTIONS -STRSAFEAPI StringCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); -STRSAFEAPI StringCatEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); -STRSAFEAPI StringCatN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend); -STRSAFEAPI StringCatNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); -STRSAFEAPI StringCopy(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); -STRSAFEAPI StringCopyEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); -STRSAFEAPI StringCopyN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc); -STRSAFEAPI StringCopyNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); -STRSAFEAPI StringGets(STRSAFE_LPTSTR pszDest, size_t cxDest); -STRSAFEAPI StringGetsEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); -STRSAFEAPI StringLength(STRSAFE_LPCTSTR psz, size_t cxMax, size_t *pcb); -STRSAFEAPI StringPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, ...); -STRSAFEAPI StringPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCTSTR pszFormat, ...); -STRSAFEAPI StringVPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, va_list args); -STRSAFEAPI StringVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, LPCTSTR pszFormat, va_list args); -#endif // !STRSAFE_NO_CB_FUNCTIONS - -#ifndef STRSAFE_NO_CCH_FUNCTIONS - -#endif // !STRSAFE_NO_CCH_FUNCTIONS - +STRSAFEAPI StringCxxCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCxxCatEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxCatN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend); +STRSAFEAPI StringCxxCatNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxCopy(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCxxCopyEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxCopyN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc); +STRSAFEAPI StringCxxCopyNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxGets(STRSAFE_LPTSTR pszDest, size_t cxDest); +STRSAFEAPI StringCxxGetsEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxLength(STRSAFE_LPCTSTR psz, size_t cxMax, size_t *pcb); +STRSAFEAPI StringCxxPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, ...); +STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCTSTR pszFormat, ...); +STRSAFEAPI StringCxxVPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, va_list args); +STRSAFEAPI StringCxxVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, LPCTSTR pszFormat, va_list args); #else // !STRSAFE_LIB From 44f89698766100d7b03d46ad106c4cc5be1c0510 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 03:01:25 +0000 Subject: [PATCH 182/388] More fixes in strsafe.h svn path=/branches/ros-amd64-bringup/; revision=35693 --- reactos/include/psdk/strsafe.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index 3cea5450bbb..55f30700a35 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -218,8 +218,6 @@ STRSAFEAPI StringCxxVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPT /* Create inlined versions */ #define STRSAFEAPI HRESULT static __inline__ -#ifndef STRSAFE_NO_CB_FUNCTIONS - STRSAFEAPI StringCxxCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc) { return 0; // FIXME @@ -326,12 +324,6 @@ STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTS return result; } -#endif // !STRSAFE_NO_CB_FUNCTIONS - -#ifndef STRSAFE_NO_CCH_FUNCTIONS - -#endif // !STRSAFE_NO_CCH_FUNCTIONS - #endif // !STRSAFE_LIB /* Functions are implemented or defined, clear #defines for next pass */ From ae14158094f8e0866ce86671123e8ecf703e3773 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 03:03:39 +0000 Subject: [PATCH 183/388] Add Cch functions to strsafe lib. svn path=/branches/ros-amd64-bringup/; revision=35694 --- reactos/lib/sdk/strsafe/StringCchCatA.c | 14 +++++++++ reactos/lib/sdk/strsafe/StringCchCatExA.c | 18 +++++++++++ reactos/lib/sdk/strsafe/StringCchCatExW.c | 18 +++++++++++ reactos/lib/sdk/strsafe/StringCchCatNA.c | 15 ++++++++++ reactos/lib/sdk/strsafe/StringCchCatNExA.c | 19 ++++++++++++ reactos/lib/sdk/strsafe/StringCchCatNExW.c | 19 ++++++++++++ reactos/lib/sdk/strsafe/StringCchCatNW.c | 15 ++++++++++ reactos/lib/sdk/strsafe/StringCchCatW.c | 14 +++++++++ reactos/lib/sdk/strsafe/StringCchCopyA.c | 14 +++++++++ reactos/lib/sdk/strsafe/StringCchCopyExA.c | 17 +++++++++++ reactos/lib/sdk/strsafe/StringCchCopyExW.c | 18 +++++++++++ reactos/lib/sdk/strsafe/StringCchCopyNA.c | 15 ++++++++++ reactos/lib/sdk/strsafe/StringCchCopyNExA.c | 19 ++++++++++++ reactos/lib/sdk/strsafe/StringCchCopyNExW.c | 19 ++++++++++++ reactos/lib/sdk/strsafe/StringCchCopyNW.c | 15 ++++++++++ reactos/lib/sdk/strsafe/StringCchCopyW.c | 14 +++++++++ reactos/lib/sdk/strsafe/StringCchGetsA.c | 13 ++++++++ reactos/lib/sdk/strsafe/StringCchGetsExA.c | 16 ++++++++++ reactos/lib/sdk/strsafe/StringCchGetsExW.c | 16 ++++++++++ reactos/lib/sdk/strsafe/StringCchGetsW.c | 13 ++++++++ reactos/lib/sdk/strsafe/StringCchLengthA.c | 14 +++++++++ reactos/lib/sdk/strsafe/StringCchLengthW.c | 14 +++++++++ reactos/lib/sdk/strsafe/StringCchPrintfA.c | 19 ++++++++++++ reactos/lib/sdk/strsafe/StringCchPrintfExA.c | 22 ++++++++++++++ reactos/lib/sdk/strsafe/StringCchPrintfExW.c | 22 ++++++++++++++ reactos/lib/sdk/strsafe/StringCchPrintfW.c | 19 ++++++++++++ reactos/lib/sdk/strsafe/StringCchVPrintfA.c | 15 ++++++++++ reactos/lib/sdk/strsafe/StringCchVPrintfExA.c | 18 +++++++++++ reactos/lib/sdk/strsafe/StringCchVPrintfExW.c | 18 +++++++++++ reactos/lib/sdk/strsafe/StringCchVPrintfW.c | 15 ++++++++++ reactos/lib/sdk/strsafe/strsafe.rbuild | 30 +++++++++++++++++++ 31 files changed, 527 insertions(+) create mode 100644 reactos/lib/sdk/strsafe/StringCchCatA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCatExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCatExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCatNA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCatNExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCatNExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCatNW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCatW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyNA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyNExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyNExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyNW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchCopyW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchGetsA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchGetsExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchGetsExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchGetsW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchLengthA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchLengthW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchPrintfA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchPrintfExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchPrintfExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchPrintfW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchVPrintfA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchVPrintfExA.c create mode 100644 reactos/lib/sdk/strsafe/StringCchVPrintfExW.c create mode 100644 reactos/lib/sdk/strsafe/StringCchVPrintfW.c diff --git a/reactos/lib/sdk/strsafe/StringCchCatA.c b/reactos/lib/sdk/strsafe/StringCchCatA.c new file mode 100644 index 00000000000..dfb60227460 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatA.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatA _StringCchCatA +#include + +#undef StringCchCatA +HRESULT __stdcall +StringCchCatA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCchCatA(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCatExA.c b/reactos/lib/sdk/strsafe/StringCchCatExA.c new file mode 100644 index 00000000000..0b2d602a4c2 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatExA.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatExA _StringCchCatExA +#include + +#undef StringCchCatExA +HRESULT __stdcall +StringCchCatExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCchCatExA(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCatExW.c b/reactos/lib/sdk/strsafe/StringCchCatExW.c new file mode 100644 index 00000000000..029f6fb61a5 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatExW.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatExW _StringCchCatExW +#include + +#undef StringCchCatExW +HRESULT __stdcall +StringCchCatExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCchCatExW(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCatNA.c b/reactos/lib/sdk/strsafe/StringCchCatNA.c new file mode 100644 index 00000000000..f713b082e94 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatNA.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatNA _StringCchCatNA +#include + +#undef StringCchCatNA +HRESULT __stdcall +StringCbCatNA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbMaxAppend) +{ + /* Use the inlined version */ + return _StringCchCatNA(pszDest, cbDest, pszSrc, cbMaxAppend); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCatNExA.c b/reactos/lib/sdk/strsafe/StringCchCatNExA.c new file mode 100644 index 00000000000..d4a52395d1a --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatNExA.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatNExA _StringCchCatNExA +#include + +#undef StringCchCatNExA +HRESULT __stdcall +StringCchCatNExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCchCatNExA(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCatNExW.c b/reactos/lib/sdk/strsafe/StringCchCatNExW.c new file mode 100644 index 00000000000..afa88621a70 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatNExW.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatNExW _StringCchCatNExW +#include + +#undef StringCchCatNExW +HRESULT __stdcall +StringCchCatNExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCchCatNExW(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCatNW.c b/reactos/lib/sdk/strsafe/StringCchCatNW.c new file mode 100644 index 00000000000..79140b90174 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatNW.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatNW _StringCchCatNW +#include + +#undef StringCchCatNW +HRESULT __stdcall +StringCchCatNW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbMaxAppend) +{ + /* Use the inlined version */ + return _StringCchCatNW(pszDest, cbDest, pszSrc, cbMaxAppend); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCatW.c b/reactos/lib/sdk/strsafe/StringCchCatW.c new file mode 100644 index 00000000000..db175660692 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCatW.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCatW _StringCchCatW +#include + +#undef StringCchCatW +HRESULT __stdcall +StringCchCatW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCchCatW(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyA.c b/reactos/lib/sdk/strsafe/StringCchCopyA.c new file mode 100644 index 00000000000..1c148440316 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyA.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyA _StringCchCopyA +#include + +#undef StringCchCopyA +HRESULT __stdcall +StringCbCopyA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCchCopyA(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyExA.c b/reactos/lib/sdk/strsafe/StringCchCopyExA.c new file mode 100644 index 00000000000..8a3ea54b612 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyExA.c @@ -0,0 +1,17 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyExA _StringCchCopyExA +#include + +#undef StringCchCopyExA +HRESULT __stdcall +StringCchCopyExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + /* Use the inlined version */ + return _StringCchCopyExA(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyExW.c b/reactos/lib/sdk/strsafe/StringCchCopyExW.c new file mode 100644 index 00000000000..8d75ecaa71f --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyExW.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyExW _StringCchCopyExW +#include + +#undef StringCchCopyExW +HRESULT __stdcall +StringCchCopyExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCchCopyExW(pszDest, cbDest, pszSrc, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyNA.c b/reactos/lib/sdk/strsafe/StringCchCopyNA.c new file mode 100644 index 00000000000..ab25b72316d --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyNA.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyNA _StringCchCopyNA +#include + +#undef StringCchCopyNA +HRESULT __stdcall +StringCchCopyNA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbSrc) +{ + /* Use the inlined version */ + return _StringCchCopyNA(pszDest, cbDest, pszSrc, cbSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyNExA.c b/reactos/lib/sdk/strsafe/StringCchCopyNExA.c new file mode 100644 index 00000000000..83d1002954b --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyNExA.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyNExA _StringCchCopyNExA +#include + +#undef StringCchCopyNExA +HRESULT __stdcall +StringCchCopyNExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCchCopyNExA(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyNExW.c b/reactos/lib/sdk/strsafe/StringCchCopyNExW.c new file mode 100644 index 00000000000..072e591b770 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyNExW.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyNExW _StringCchCopyNExW +#include + +#undef StringCchCopyNExW +HRESULT __stdcall +StringCchCopyNExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) + +{ + /* Use the inlined version */ + return _StringCchCopyNExW(pszDest, cbDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyNW.c b/reactos/lib/sdk/strsafe/StringCchCopyNW.c new file mode 100644 index 00000000000..d9182fedc32 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyNW.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyNW _StringCchCopyNW +#include + +#undef StringCchCopyNW +HRESULT __stdcall +StringCchCopyNW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc, + size_t cbSrc) +{ + /* Use the inlined version */ + return _StringCchCopyNW(pszDest, cbDest, pszSrc, cbSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCchCopyW.c b/reactos/lib/sdk/strsafe/StringCchCopyW.c new file mode 100644 index 00000000000..930e8bedc0c --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchCopyW.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchCopyW _StringCchCopyW +#include + +#undef StringCchCopyW +HRESULT __stdcall +StringCchCopyW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszSrc) +{ + /* Use the inlined version */ + return _StringCchCopyW(pszDest, cbDest, pszSrc); +} diff --git a/reactos/lib/sdk/strsafe/StringCchGetsA.c b/reactos/lib/sdk/strsafe/StringCchGetsA.c new file mode 100644 index 00000000000..9977413d8eb --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchGetsA.c @@ -0,0 +1,13 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchGetsA _StringCchGetsA +#include + +#undef StringCchGetsA +HRESULT __stdcall +StringCchGetsA( + STRSAFE_LPSTR pszDest, + size_t cbDest) +{ + /* Use the inlined version */ + return _StringCchGetsA(pszDest, cbDest); +} diff --git a/reactos/lib/sdk/strsafe/StringCchGetsExA.c b/reactos/lib/sdk/strsafe/StringCchGetsExA.c new file mode 100644 index 00000000000..c1d2f6c0195 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchGetsExA.c @@ -0,0 +1,16 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchGetsExA _StringCchGetsExA +#include + +#undef StringCchGetsExA +HRESULT __stdcall +StringCchGetsExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + /* Use the inlined version */ + return _StringCchGetsExA(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchGetsExW.c b/reactos/lib/sdk/strsafe/StringCchGetsExW.c new file mode 100644 index 00000000000..9a0bc8270e9 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchGetsExW.c @@ -0,0 +1,16 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchGetsExW _StringCchGetsExW +#include + +#undef StringCchGetsExW +HRESULT __stdcall +StringCchGetsExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + /* Use the inlined version */ + return _StringCchGetsExW(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags); +} diff --git a/reactos/lib/sdk/strsafe/StringCchGetsW.c b/reactos/lib/sdk/strsafe/StringCchGetsW.c new file mode 100644 index 00000000000..786dc13cc8e --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchGetsW.c @@ -0,0 +1,13 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchGetsW _StringCchGetsW +#include + +#undef StringCchGetsW +HRESULT __stdcall +StringCchGetsW( + STRSAFE_LPWSTR pszDest, + size_t cbDest) +{ + /* Use the inlined version */ + return _StringCchGetsW(pszDest, cbDest); +} diff --git a/reactos/lib/sdk/strsafe/StringCchLengthA.c b/reactos/lib/sdk/strsafe/StringCchLengthA.c new file mode 100644 index 00000000000..b555e54a269 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchLengthA.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchLengthA _StringCchLengthA +#include + +#undef StringCchLengthA +HRESULT __stdcall +StringCchLengthA( + STRSAFE_LPCSTR psz, + size_t cbMax, + size_t *pcb) +{ + /* Use the inlined version */ + return _StringCchLengthA(psz, cbMax, pcb); +} diff --git a/reactos/lib/sdk/strsafe/StringCchLengthW.c b/reactos/lib/sdk/strsafe/StringCchLengthW.c new file mode 100644 index 00000000000..4f9e4cba350 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchLengthW.c @@ -0,0 +1,14 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchLengthW _StringCchLengthW +#include + +#undef StringCchLengthW +HRESULT __stdcall +StringCchLengthW( + STRSAFE_LPCWSTR psz, + size_t cbMax, + size_t *pcb) +{ + /* Use the inlined version */ + return _StringCchLengthW(psz, cbMax, pcb); +} diff --git a/reactos/lib/sdk/strsafe/StringCchPrintfA.c b/reactos/lib/sdk/strsafe/StringCchPrintfA.c new file mode 100644 index 00000000000..c0f5ebcd80d --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchPrintfA.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchPrintfA _StringCchPrintfA +#include + +#undef StringCchPrintfA +HRESULT __stdcall +StringCchPrintfA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCchVPrintfA(pszDest, cbDest, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/StringCchPrintfExA.c b/reactos/lib/sdk/strsafe/StringCchPrintfExA.c new file mode 100644 index 00000000000..1afd7041210 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchPrintfExA.c @@ -0,0 +1,22 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchPrintfExA _StringCchPrintfExA +#include + +#undef StringCchPrintfExA +HRESULT __stdcall +StringCchPrintfExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCchVPrintfExA(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/StringCchPrintfExW.c b/reactos/lib/sdk/strsafe/StringCchPrintfExW.c new file mode 100644 index 00000000000..ec65ad649c2 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchPrintfExW.c @@ -0,0 +1,22 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchPrintfExW _StringCchPrintfExW +#include + +#undef StringCchPrintfExW +HRESULT __stdcall +StringCchPrintfExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCWSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCchVPrintfExW(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/StringCchPrintfW.c b/reactos/lib/sdk/strsafe/StringCchPrintfW.c new file mode 100644 index 00000000000..b0a0fe1f2d8 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchPrintfW.c @@ -0,0 +1,19 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchPrintfW _StringCchPrintfW +#include + +#undef StringCchPrintfW +HRESULT __stdcall +StringCchPrintfW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszFormat, + ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCchVPrintfW(pszDest, cbDest, pszFormat, args); + va_end(args); + return result; +} diff --git a/reactos/lib/sdk/strsafe/StringCchVPrintfA.c b/reactos/lib/sdk/strsafe/StringCchVPrintfA.c new file mode 100644 index 00000000000..0119a7c7a54 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchVPrintfA.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchVPrintfA _StringCchVPrintfA +#include + +#undef StringCchVPrintfA +HRESULT __stdcall +StringCchVPrintfA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPCSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCchVPrintfA(pszDest, cbDest, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/StringCchVPrintfExA.c b/reactos/lib/sdk/strsafe/StringCchVPrintfExA.c new file mode 100644 index 00000000000..32a96764ce5 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchVPrintfExA.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchVPrintfExA _StringCchVPrintfExA +#include + +#undef StringCchVPrintfExA +HRESULT __stdcall +StringCchVPrintfExA( + STRSAFE_LPSTR pszDest, + size_t cbDest, + STRSAFE_LPSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCchVPrintfExA(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/StringCchVPrintfExW.c b/reactos/lib/sdk/strsafe/StringCchVPrintfExW.c new file mode 100644 index 00000000000..6ccf91f1965 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchVPrintfExW.c @@ -0,0 +1,18 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchVPrintfExW _StringCchVPrintfExW +#include + +#undef StringCchVPrintfExW +HRESULT __stdcall +StringCchVPrintfExW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPWSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCWSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCchVPrintfExW(pszDest, cbDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/StringCchVPrintfW.c b/reactos/lib/sdk/strsafe/StringCchVPrintfW.c new file mode 100644 index 00000000000..6e91035a7f3 --- /dev/null +++ b/reactos/lib/sdk/strsafe/StringCchVPrintfW.c @@ -0,0 +1,15 @@ +#define STRSAFE_NO_CB_FUNCTIONS +#define StringCchVPrintfW _StringCchVPrintfW +#include + +#undef StringCchVPrintfW +HRESULT __stdcall +StringCchVPrintfW( + STRSAFE_LPWSTR pszDest, + size_t cbDest, + STRSAFE_LPCWSTR pszFormat, + va_list args) +{ + /* Use the inlined version */ + return _StringCchVPrintfW(pszDest, cbDest, pszFormat, args); +} diff --git a/reactos/lib/sdk/strsafe/strsafe.rbuild b/reactos/lib/sdk/strsafe/strsafe.rbuild index 5ab609b5859..f0dc17fffd7 100644 --- a/reactos/lib/sdk/strsafe/strsafe.rbuild +++ b/reactos/lib/sdk/strsafe/strsafe.rbuild @@ -32,4 +32,34 @@ StringCbVPrintfW.c StringCbVPrintfExA.c StringCbVPrintfExW.c + StringCchCatA.c + StringCchCatW.c + StringCchCatExA.c + StringCchCatExW.c + StringCchCatNA.c + StringCchCatNW.c + StringCchCatNExA.c + StringCchCatNExW.c + StringCchCopyA.c + StringCchCopyW.c + StringCchCopyExA.c + StringCchCopyExW.c + StringCchCopyNA.c + StringCchCopyNW.c + StringCchCopyNExA.c + StringCchCopyNExW.c + StringCchGetsA.c + StringCchGetsW.c + StringCchGetsExA.c + StringCchGetsExW.c + StringCchLengthA.c + StringCchLengthW.c + StringCchPrintfA.c + StringCchPrintfW.c + StringCchPrintfExA.c + StringCchPrintfExW.c + StringCchVPrintfA.c + StringCchVPrintfW.c + StringCchVPrintfExA.c + StringCchVPrintfExW.c From fb545753bec73624fd48cfb27443de36899121f5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 14:16:04 +0000 Subject: [PATCH 184/388] enhance macros svn path=/branches/ros-amd64-bringup/; revision=35696 --- reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index 05f483ad396..4e4fb7000b4 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -34,10 +34,10 @@ #define PtrToPfn(p) \ ((((ULONGLONG)p) >> PAGE_SHIFT) & 0xfffffffULL) -#define VAtoPXI(va) (((va) >> PXI_SHIFT) & 0x1FF) -#define VAtoPPI(va) (((va) >> PPI_SHIFT) & 0x1FF) -#define VAtoPDI(va) (((va) >> PDI_SHIFT) & 0x1FF) -#define VAtoPTI(va) (((va) >> PTI_SHIFT) & 0x1FF) +#define VAtoPXI(va) ((((ULONG64)va) >> PXI_SHIFT) & 0x1FF) +#define VAtoPPI(va) ((((ULONG64)va) >> PPI_SHIFT) & 0x1FF) +#define VAtoPDI(va) ((((ULONG64)va) >> PDI_SHIFT) & 0x1FF) +#define VAtoPTI(va) ((((ULONG64)va) >> PTI_SHIFT) & 0x1FF) #define HYPERSPACE_BASE 0xfffff70000000000ULL #define HAL_BASE 0xffffffff80000000ULL From 978a868544b129f1f65278b4b9559777eb07881f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 15:37:36 +0000 Subject: [PATCH 185/388] - Convert PortAddress from ULONG to PUCHAR - Fix some int <-> pointer casts - remove useless #if __i386__ - use %p for pointer sized prints svn path=/branches/ros-amd64-bringup/; revision=35703 --- .../boot/freeldr/freeldr/arch/i386/hardware.c | 50 +++++++++---------- .../boot/freeldr/freeldr/arch/i386/hwacpi.c | 4 +- .../boot/freeldr/freeldr/arch/i386/hwpci.c | 4 +- .../boot/freeldr/freeldr/arch/i386/i386disk.c | 6 +-- .../boot/freeldr/freeldr/arch/i386/pcdisk.c | 8 +-- .../boot/freeldr/freeldr/arch/i386/pcmem.c | 4 +- .../boot/freeldr/freeldr/arch/i386/pcvideo.c | 6 +-- 7 files changed, 39 insertions(+), 43 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c index 33cbc6e9a23..1ffe911c994 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c @@ -779,21 +779,21 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, } static VOID -InitializeSerialPort(ULONG Port, +InitializeSerialPort(PUCHAR Port, ULONG LineControl) { - WRITE_PORT_UCHAR((PUCHAR)Port + 3, 0x80); /* set DLAB on */ - WRITE_PORT_UCHAR((PUCHAR)Port, 0x60); /* speed LO byte */ - WRITE_PORT_UCHAR((PUCHAR)Port + 1, 0); /* speed HI byte */ - WRITE_PORT_UCHAR((PUCHAR)Port + 3, LineControl); - WRITE_PORT_UCHAR((PUCHAR)Port + 1, 0); /* set comm and DLAB to 0 */ - WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x09); /* DR int enable */ - READ_PORT_UCHAR((PUCHAR)Port + 5); /* clear error bits */ + WRITE_PORT_UCHAR(Port + 3, 0x80); /* set DLAB on */ + WRITE_PORT_UCHAR(Port, 0x60); /* speed LO byte */ + WRITE_PORT_UCHAR(Port + 1, 0); /* speed HI byte */ + WRITE_PORT_UCHAR(Port + 3, LineControl); + WRITE_PORT_UCHAR(Port + 1, 0); /* set comm and DLAB to 0 */ + WRITE_PORT_UCHAR(Port + 4, 0x09); /* DR int enable */ + READ_PORT_UCHAR(Port + 5); /* clear error bits */ } static ULONG -DetectSerialMouse(ULONG Port) +DetectSerialMouse(PUCHAR Port) { CHAR Buffer[4]; ULONG i; @@ -801,8 +801,8 @@ DetectSerialMouse(ULONG Port) UCHAR LineControl; /* Shutdown mouse or something like that */ - LineControl = READ_PORT_UCHAR((PUCHAR)Port + 4); - WRITE_PORT_UCHAR((PUCHAR)Port + 4, (LineControl & ~0x02) | 0x01); + LineControl = READ_PORT_UCHAR(Port + 4); + WRITE_PORT_UCHAR(Port + 4, (LineControl & ~0x02) | 0x01); StallExecutionProcessor(100000); /* @@ -812,18 +812,18 @@ DetectSerialMouse(ULONG Port) * therefore we must give up after some time. */ TimeOut = 200; - while (READ_PORT_UCHAR((PUCHAR)Port + 5) & 0x01) + while (READ_PORT_UCHAR(Port + 5) & 0x01) { if (--TimeOut == 0) return MOUSE_TYPE_NONE; - READ_PORT_UCHAR((PUCHAR)Port); + READ_PORT_UCHAR(Port); } /* * Send modem control with 'Data Terminal Ready', 'Request To Send' and * 'Output Line 2' message. This enables mouse to identify. */ - WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x0b); + WRITE_PORT_UCHAR(Port + 4, 0x0b); /* Wait 10 milliseconds for the mouse getting ready */ StallExecutionProcessor(10000); @@ -832,14 +832,14 @@ DetectSerialMouse(ULONG Port) TimeOut = 200; for (i = 0; i < 4; i++) { - while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut > 0)) + while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0)) { StallExecutionProcessor(1000); --TimeOut; if (TimeOut == 0) return MOUSE_TYPE_NONE; } - Buffer[i] = READ_PORT_UCHAR((PUCHAR)Port); + Buffer[i] = READ_PORT_UCHAR(Port); } DbgPrint((DPRINT_HWDETECT, @@ -891,26 +891,26 @@ DetectSerialMouse(ULONG Port) static ULONG -GetSerialMousePnpId(ULONG Port, char *Buffer) +GetSerialMousePnpId(PUCHAR Port, char *Buffer) { ULONG TimeOut; ULONG i = 0; char c; char x; - WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x09); + WRITE_PORT_UCHAR(Port + 4, 0x09); /* Wait 10 milliseconds for the mouse getting ready */ StallExecutionProcessor(10000); - WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x0b); + WRITE_PORT_UCHAR(Port + 4, 0x0b); StallExecutionProcessor(10000); for (;;) { TimeOut = 200; - while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut > 0)) + while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0)) { StallExecutionProcessor(1000); --TimeOut; @@ -920,7 +920,7 @@ GetSerialMousePnpId(ULONG Port, char *Buffer) } } - c = READ_PORT_UCHAR((PUCHAR)Port); + c = READ_PORT_UCHAR(Port); if (c == 0x08 || c == 0x28) break; } @@ -931,14 +931,14 @@ GetSerialMousePnpId(ULONG Port, char *Buffer) for (;;) { TimeOut = 200; - while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut > 0)) + while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0)) { StallExecutionProcessor(1000); --TimeOut; if (TimeOut == 0) return 0; } - c = READ_PORT_UCHAR((PUCHAR)Port); + c = READ_PORT_UCHAR(Port); Buffer[i++] = c; if (c == x) break; @@ -952,7 +952,7 @@ GetSerialMousePnpId(ULONG Port, char *Buffer) static VOID DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey, - ULONG Base) + PUCHAR Base) { CM_PARTIAL_RESOURCE_LIST PartialResourceList; char Buffer[256]; @@ -1227,7 +1227,7 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey) if (!Rs232PortInUse(Base)) { /* Detect serial mouse */ - DetectSerialPointerPeripheral(ControllerKey, Base); + DetectSerialPointerPeripheral(ControllerKey, UlongToPtr(Base)); } ControllerNumber++; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c b/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c index 76c115de322..39f163ea4d2 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c @@ -30,7 +30,7 @@ FindAcpiBios(VOID) /* Find the 'Root System Descriptor Table Pointer' */ Ptr = (PUCHAR)0xE0000; - while ((ULONG)Ptr < 0x100000) + while ((ULONG_PTR)Ptr < 0x100000) { if (!memcmp(Ptr, "RSD PTR ", 8)) { @@ -39,7 +39,7 @@ FindAcpiBios(VOID) return (PRSDP_DESCRIPTOR)Ptr; } - Ptr = (PUCHAR)((ULONG)Ptr + 0x10); + Ptr = (PUCHAR)((ULONG_PTR)Ptr + 0x10); } DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n")); diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c b/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c index b31e8975329..0d5e3062027 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c @@ -71,7 +71,7 @@ GetPciIrqRoutingTable(VOID) ULONG i; Table = (PPCI_IRQ_ROUTING_TABLE)0xF0000; - while ((ULONG)Table < 0x100000) + while ((ULONG_PTR)Table < 0x100000) { if (Table->Signature == 0x52495024) { @@ -98,7 +98,7 @@ GetPciIrqRoutingTable(VOID) return Table; } - Table = (PPCI_IRQ_ROUTING_TABLE)((ULONG)Table + 0x10); + Table = (PPCI_IRQ_ROUTING_TABLE)((ULONG_PTR)Table + 0x10); } return NULL; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c b/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c index a3122564169..3a0874c84d3 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c @@ -26,8 +26,6 @@ // FUNCTIONS ///////////////////////////////////////////////////////////////////////////////////////////// -#ifdef __i386__ - BOOLEAN DiskResetController(ULONG DriveNumber) { REGS RegsIn; @@ -177,7 +175,7 @@ BOOLEAN DiskGetExtendedDriveParameters(ULONG DriveNumber, PVOID Buffer, USHORT B DbgPrint((DPRINT_DISK, "EED configuration parameters: %x:%x\n", Ptr[13], Ptr[14])); if (Ptr[13] != 0xffff && Ptr[14] != 0xffff) { - PUCHAR SpecPtr = (PUCHAR)((Ptr[13] << 4) + Ptr[14]); + PUCHAR SpecPtr = (PUCHAR)(ULONG_PTR)((Ptr[13] << 4) + Ptr[14]); DbgPrint((DPRINT_DISK, "SpecPtr: %x\n", SpecPtr)); DbgPrint((DPRINT_DISK, "physical I/O port base address: %x\n", *(PUSHORT)&SpecPtr[0])); DbgPrint((DPRINT_DISK, "disk-drive control port address: %x\n", *(PUSHORT)&SpecPtr[2])); @@ -198,6 +196,4 @@ BOOLEAN DiskGetExtendedDriveParameters(ULONG DriveNumber, PVOID Buffer, USHORT B return TRUE; } -#endif /* defined __i386__ */ - /* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c b/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c index 5d3d917af99..cd35497cc6b 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c @@ -83,8 +83,8 @@ static BOOLEAN PcDiskReadLogicalSectorsLBA(ULONG DriveNumber, ULONGLONG SectorNu Packet->PacketSize = sizeof(I386_DISK_ADDRESS_PACKET); Packet->Reserved = 0; Packet->LBABlockCount = SectorCount; - Packet->TransferBufferOffset = ((ULONG)Buffer) & 0x0F; - Packet->TransferBufferSegment = ((ULONG)Buffer) >> 4; + Packet->TransferBufferOffset = ((ULONG_PTR)Buffer) & 0x0F; + Packet->TransferBufferSegment = ((ULONG_PTR)Buffer) >> 4; Packet->LBAStartBlock = SectorNumber; // BIOS int 0x13, function 42h - IBM/MS INT 13 Extensions - EXTENDED READ @@ -211,8 +211,8 @@ static BOOLEAN PcDiskReadLogicalSectorsCHS(ULONG DriveNumber, ULONGLONG SectorNu RegsIn.b.cl = (PhysicalSector + ((PhysicalTrack & 0x300) >> 2)); RegsIn.b.dh = PhysicalHead; RegsIn.b.dl = DriveNumber; - RegsIn.w.es = ((ULONG)Buffer) >> 4; - RegsIn.w.bx = ((ULONG)Buffer) & 0x0F; + RegsIn.w.es = ((ULONG_PTR)Buffer) >> 4; + RegsIn.w.bx = ((ULONG_PTR)Buffer) & 0x0F; // // Perform the read diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c b/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c index a0c4d357782..df4eb565666 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c @@ -194,8 +194,8 @@ PcMemGetBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize) /* Copy data to caller's buffer */ RtlCopyMemory(&BiosMemoryMap[MapCount], (PVOID)BIOSCALLBUFFER, Regs.x.ecx); - DbgPrint((DPRINT_MEMORY, "BaseAddress: 0x%x%x\n", BiosMemoryMap[MapCount].BaseAddress)); - DbgPrint((DPRINT_MEMORY, "Length: 0x%x%x\n", BiosMemoryMap[MapCount].Length)); + DbgPrint((DPRINT_MEMORY, "BaseAddress: 0x%p\n", (PVOID)BiosMemoryMap[MapCount].BaseAddress)); + DbgPrint((DPRINT_MEMORY, "Length: 0x%p\n", (PVOID)BiosMemoryMap[MapCount].Length)); DbgPrint((DPRINT_MEMORY, "Type: 0x%x\n", BiosMemoryMap[MapCount].Type)); DbgPrint((DPRINT_MEMORY, "Reserved: 0x%x\n", BiosMemoryMap[MapCount].Reserved)); DbgPrint((DPRINT_MEMORY, "\n")); diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c index a65cbddd09a..7b36383e237 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c @@ -361,7 +361,7 @@ PcVideoSetVerticalResolution(ULONG ScanLines) static VOID PcVideoSet480ScanLines(VOID) { - int CRTC; + INT_PTR CRTC; /* Read CRTC port */ CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC); @@ -418,7 +418,7 @@ PcVideoSet480ScanLines(VOID) static VOID PcVideoSetDisplayEnd(VOID) { - int CRTC; + INT_PTR CRTC; /* Read CRTC port */ CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC); @@ -1054,7 +1054,7 @@ PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y) { USHORT *BufPtr; - BufPtr = (USHORT *) (VIDEOTEXT_MEM_ADDRESS + Y * BytesPerScanLine + X * 2); + BufPtr = (USHORT *) (ULONG_PTR)(VIDEOTEXT_MEM_ADDRESS + Y * BytesPerScanLine + X * 2); *BufPtr = ((USHORT) Attr << 8) | (Ch & 0xff); } From 951d7d64e8cb9a09aecbabb0abeb61dfb3a035d3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 15:41:38 +0000 Subject: [PATCH 186/388] - implement stub EnableA20 - define MachInit to PcMachInit - use i386 versions of machine dependend code for amd64 -> 13 files / 160 kb less svn path=/branches/ros-amd64-bringup/; revision=35704 --- .../freeldr/freeldr/arch/amd64/hardware.c | 1893 ----------------- .../boot/freeldr/freeldr/arch/amd64/hwacpi.c | 130 -- .../boot/freeldr/freeldr/arch/amd64/hwapm.c | 98 - .../boot/freeldr/freeldr/arch/amd64/hwpci.c | 346 --- .../freeldr/freeldr/arch/amd64/i386disk.c | 199 -- .../boot/freeldr/freeldr/arch/amd64/i386rtl.c | 87 - .../boot/freeldr/freeldr/arch/amd64/i386vid.c | 244 --- .../boot/freeldr/freeldr/arch/amd64/loader.c | 6 + .../boot/freeldr/freeldr/arch/amd64/mach.c | 70 - .../boot/freeldr/freeldr/arch/amd64/pccons.c | 128 -- .../boot/freeldr/freeldr/arch/amd64/pcdisk.c | 455 ---- .../boot/freeldr/freeldr/arch/amd64/pcmem.c | 249 --- .../boot/freeldr/freeldr/arch/amd64/pcrtc.c | 104 - .../boot/freeldr/freeldr/arch/amd64/pcvideo.c | 1122 ---------- .../boot/freeldr/freeldr/freeldr_arch.rbuild | 9 +- .../freeldr/include/arch/amd64/machpc.h | 1 + 16 files changed, 12 insertions(+), 5129 deletions(-) delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/hardware.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/hwacpi.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/hwapm.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/hwpci.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/i386disk.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/i386rtl.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/i386vid.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/mach.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/pccons.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/pcdisk.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/pcmem.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/pcrtc.c delete mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/pcvideo.c diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/hardware.c b/reactos/boot/freeldr/freeldr/arch/amd64/hardware.c deleted file mode 100644 index f3a890d3b14..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/hardware.c +++ /dev/null @@ -1,1893 +0,0 @@ -/* - * FreeLoader - * - * Copyright (C) 2003, 2004 Eric Kohl - * - * 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 - -#define NDEBUG -#include - -#define MILLISEC (10) -#define PRECISION (8) - -#define HZ (100) -#define CLOCK_TICK_RATE (1193182) -#define LATCH (CLOCK_TICK_RATE / HZ) - - -/* No Mouse */ -#define MOUSE_TYPE_NONE 0 -/* Microsoft Mouse with 2 buttons */ -#define MOUSE_TYPE_MICROSOFT 1 -/* Logitech Mouse with 3 buttons */ -#define MOUSE_TYPE_LOGITECH 2 -/* Microsoft Wheel Mouse (aka Z Mouse) */ -#define MOUSE_TYPE_WHEELZ 3 -/* Mouse Systems Mouse */ -#define MOUSE_TYPE_MOUSESYSTEMS 4 - - -/* PS2 stuff */ - -/* Controller registers. */ -#define CONTROLLER_REGISTER_STATUS 0x64 -#define CONTROLLER_REGISTER_CONTROL 0x64 -#define CONTROLLER_REGISTER_DATA 0x60 - -/* Controller commands. */ -#define CONTROLLER_COMMAND_READ_MODE 0x20 -#define CONTROLLER_COMMAND_WRITE_MODE 0x60 -#define CONTROLLER_COMMAND_GET_VERSION 0xA1 -#define CONTROLLER_COMMAND_MOUSE_DISABLE 0xA7 -#define CONTROLLER_COMMAND_MOUSE_ENABLE 0xA8 -#define CONTROLLER_COMMAND_TEST_MOUSE 0xA9 -#define CONTROLLER_COMMAND_SELF_TEST 0xAA -#define CONTROLLER_COMMAND_KEYBOARD_TEST 0xAB -#define CONTROLLER_COMMAND_KEYBOARD_DISABLE 0xAD -#define CONTROLLER_COMMAND_KEYBOARD_ENABLE 0xAE -#define CONTROLLER_COMMAND_WRITE_MOUSE_OUTPUT_BUFFER 0xD3 -#define CONTROLLER_COMMAND_WRITE_MOUSE 0xD4 - -/* Controller status */ -#define CONTROLLER_STATUS_OUTPUT_BUFFER_FULL 0x01 -#define CONTROLLER_STATUS_INPUT_BUFFER_FULL 0x02 -#define CONTROLLER_STATUS_SELF_TEST 0x04 -#define CONTROLLER_STATUS_COMMAND 0x08 -#define CONTROLLER_STATUS_UNLOCKED 0x10 -#define CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL 0x20 -#define CONTROLLER_STATUS_GENERAL_TIMEOUT 0x40 -#define CONTROLLER_STATUS_PARITY_ERROR 0x80 -#define AUX_STATUS_OUTPUT_BUFFER_FULL (CONTROLLER_STATUS_OUTPUT_BUFFER_FULL | \ - CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) - -/* Timeout in ms for sending to keyboard controller. */ -#define CONTROLLER_TIMEOUT 250 - -static CHAR Hex[] = "0123456789abcdef"; -static unsigned int delay_count = 1; - -extern ULONG reactos_disk_count; -extern ARC_DISK_SIGNATURE reactos_arc_disk_info[]; -extern char reactos_arc_strings[32][256]; - -/* FUNCTIONS ****************************************************************/ - - -static VOID -__StallExecutionProcessor(ULONG Loops) -{ - volatile register unsigned int i; - for (i = 0; i < Loops; i++); -} - - -VOID StallExecutionProcessor(ULONG Microseconds) -{ - ULONGLONG LoopCount = ((ULONGLONG)delay_count * (ULONGLONG)Microseconds) / 1000ULL; - __StallExecutionProcessor((ULONG)LoopCount); -} - - -static ULONG -Read8254Timer(VOID) -{ - ULONG Count; - - WRITE_PORT_UCHAR((PUCHAR)0x43, 0x00); - Count = READ_PORT_UCHAR((PUCHAR)0x40); - Count |= READ_PORT_UCHAR((PUCHAR)0x40) << 8; - - return Count; -} - - -static VOID -WaitFor8254Wraparound(VOID) -{ - ULONG CurCount; - ULONG PrevCount = ~0; - LONG Delta; - - CurCount = Read8254Timer(); - - do - { - PrevCount = CurCount; - CurCount = Read8254Timer(); - Delta = CurCount - PrevCount; - - /* - * This limit for delta seems arbitrary, but it isn't, it's - * slightly above the level of error a buggy Mercury/Neptune - * chipset timer can cause. - */ - } - while (Delta < 300); -} - - -VOID -HalpCalibrateStallExecution(VOID) -{ - ULONG i; - ULONG calib_bit; - ULONG CurCount; - - /* Initialise timer interrupt with MILLISECOND ms interval */ - WRITE_PORT_UCHAR((PUCHAR)0x43, 0x34); /* binary, mode 2, LSB/MSB, ch 0 */ - WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH & 0xff); /* LSB */ - WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH >> 8); /* MSB */ - - /* Stage 1: Coarse calibration */ - - WaitFor8254Wraparound(); - - delay_count = 1; - - do { - delay_count <<= 1; /* Next delay count to try */ - - WaitFor8254Wraparound(); - - __StallExecutionProcessor(delay_count); /* Do the delay */ - - CurCount = Read8254Timer(); - } while (CurCount > LATCH / 2); - - delay_count >>= 1; /* Get bottom value for delay */ - - /* Stage 2: Fine calibration */ - - calib_bit = delay_count; /* Which bit are we going to test */ - - for(i=0;i>= 1; /* Next bit to calibrate */ - if(!calib_bit) break; /* If we have done all bits, stop */ - - delay_count |= calib_bit; /* Set the bit in delay_count */ - - WaitFor8254Wraparound(); - - __StallExecutionProcessor(delay_count); /* Do the delay */ - - CurCount = Read8254Timer(); - if (CurCount <= LATCH / 2) /* If a tick has passed, turn the */ - delay_count &= ~calib_bit; /* calibrated bit back off */ - } - - /* We're finished: Do the finishing touches */ - delay_count /= (MILLISEC / 2); /* Calculate delay_count for 1ms */ -} - -static VOID -DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PNP_BIOS_DEVICE_NODE DeviceNode; - PCM_PNP_BIOS_INSTALLATION_CHECK InstData; - PCONFIGURATION_COMPONENT_DATA BusKey; - ULONG x; - ULONG NodeSize = 0; - ULONG NodeCount = 0; - UCHAR NodeNumber; - ULONG FoundNodeCount; - int i; - ULONG PnpBufferSize; - ULONG Size; - char *Ptr; - - InstData = (PCM_PNP_BIOS_INSTALLATION_CHECK)PnpBiosSupported(); - if (InstData == NULL || strncmp((CHAR*)InstData->Signature, "$PnP", 4)) - { - DbgPrint((DPRINT_HWDETECT, "PnP-BIOS not supported\n")); - return; - } - DbgPrint((DPRINT_HWDETECT, "Signature '%c%c%c%c'\n", - InstData->Signature[0], InstData->Signature[1], - InstData->Signature[2], InstData->Signature[3])); - - - x = PnpBiosGetDeviceNodeCount(&NodeSize, &NodeCount); - NodeCount &= 0xFF; // needed since some fscked up BIOSes return - // wrong info (e.g. Mac Virtual PC) - // e.g. look: http://my.execpc.com/~geezer/osd/pnp/pnp16.c - if (x != 0 || NodeSize == 0 || NodeCount == 0) - { - DbgPrint((DPRINT_HWDETECT, "PnP-BIOS failed to enumerate device nodes\n")); - return; - } - DbgPrint((DPRINT_HWDETECT, "PnP-BIOS supported\n")); - DbgPrint((DPRINT_HWDETECT, "MaxNodeSize %u NodeCount %u\n", NodeSize, NodeCount)); - DbgPrint((DPRINT_HWDETECT, "Estimated buffer size %u\n", NodeSize * NodeCount)); - - /* Create component key */ - FldrCreateComponentKey(SystemKey, - L"MultifunctionAdapter", - *BusNumber, - AdapterClass, - MultiFunctionAdapter, - &BusKey); - (*BusNumber)++; - - /* Set the component information */ - FldrSetComponentInformation(BusKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Set the identifier */ - FldrSetIdentifier(BusKey, "PNP BIOS"); - - /* Set 'Configuration Data' value */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + (NodeSize * NodeCount); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - memset(PartialResourceList, 0, Size); - - /* Initialize resource descriptor */ - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 1; - PartialResourceList->PartialDescriptors[0].Type = - CmResourceTypeDeviceSpecific; - PartialResourceList->PartialDescriptors[0].ShareDisposition = - CmResourceShareUndetermined; - - Ptr = (char *)(((ULONG_PTR)&PartialResourceList->PartialDescriptors[0]) + - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - - /* Set instalation check data */ - memcpy (Ptr, InstData, sizeof(CM_PNP_BIOS_INSTALLATION_CHECK)); - Ptr += sizeof(CM_PNP_BIOS_INSTALLATION_CHECK); - - /* Copy device nodes */ - FoundNodeCount = 0; - PnpBufferSize = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK); - for (i = 0; i < 0xFF; i++) - { - NodeNumber = (UCHAR)i; - - x = PnpBiosGetDeviceNode(&NodeNumber, (PVOID)DISKREADBUFFER); - if (x == 0) - { - DeviceNode = (PCM_PNP_BIOS_DEVICE_NODE)DISKREADBUFFER; - - DbgPrint((DPRINT_HWDETECT, - "Node: %u Size %u (0x%x)\n", - DeviceNode->Node, - DeviceNode->Size, - DeviceNode->Size)); - - memcpy (Ptr, - DeviceNode, - DeviceNode->Size); - - Ptr += DeviceNode->Size; - PnpBufferSize += DeviceNode->Size; - - FoundNodeCount++; - if (FoundNodeCount >= NodeCount) - break; - } - } - - /* Set real data size */ - PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = - PnpBufferSize; - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSize; - - DbgPrint((DPRINT_HWDETECT, "Real buffer size: %u\n", PnpBufferSize)); - DbgPrint((DPRINT_HWDETECT, "Resource size: %u\n", Size)); - - FldrSetConfigurationData(BusKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); -} - - - -static VOID -SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey, - ULONG DriveNumber) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry; - EXTENDED_GEOMETRY ExtGeometry; - GEOMETRY Geometry; - ULONG Size; - - /* Set 'Configuration Data' value */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_DISK_GEOMETRY_DEVICE_DATA); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate a full resource descriptor\n")); - return; - } - - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 1; - PartialResourceList->PartialDescriptors[0].Type = - CmResourceTypeDeviceSpecific; -// PartialResourceList->PartialDescriptors[0].ShareDisposition = -// PartialResourceList->PartialDescriptors[0].Flags = - PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = - sizeof(CM_DISK_GEOMETRY_DEVICE_DATA); - - /* Get pointer to geometry data */ - DiskGeometry = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST)); - - /* Get the disk geometry */ - ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY); - if (DiskGetExtendedDriveParameters(DriveNumber, &ExtGeometry, ExtGeometry.Size)) - { - DiskGeometry->BytesPerSector = ExtGeometry.BytesPerSector; - DiskGeometry->NumberOfCylinders = ExtGeometry.Cylinders; - DiskGeometry->SectorsPerTrack = ExtGeometry.SectorsPerTrack; - DiskGeometry->NumberOfHeads = ExtGeometry.Heads; - } - else if(MachDiskGetDriveGeometry(DriveNumber, &Geometry)) - { - DiskGeometry->BytesPerSector = Geometry.BytesPerSector; - DiskGeometry->NumberOfCylinders = Geometry.Cylinders; - DiskGeometry->SectorsPerTrack = Geometry.Sectors; - DiskGeometry->NumberOfHeads = Geometry.Heads; - } - else - { - DbgPrint((DPRINT_HWDETECT, "Reading disk geometry failed\n")); - MmHeapFree(PartialResourceList); - return; - } - DbgPrint((DPRINT_HWDETECT, - "Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n", - DriveNumber, - DiskGeometry->NumberOfCylinders, - DiskGeometry->NumberOfHeads, - DiskGeometry->SectorsPerTrack, - DiskGeometry->BytesPerSector)); - - FldrSetConfigurationData(DiskKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); -} - - -static VOID -SetHarddiskIdentifier(PCONFIGURATION_COMPONENT_DATA DiskKey, - ULONG DriveNumber) -{ - PMASTER_BOOT_RECORD Mbr; - ULONG *Buffer; - ULONG i; - ULONG Checksum; - ULONG Signature; - CHAR Identifier[20]; - CHAR ArcName[256]; - - /* Read the MBR */ - if (!MachDiskReadLogicalSectors(DriveNumber, 0ULL, 1, (PVOID)DISKREADBUFFER)) - { - DbgPrint((DPRINT_HWDETECT, "Reading MBR failed\n")); - return; - } - - Buffer = (ULONG*)DISKREADBUFFER; - Mbr = (PMASTER_BOOT_RECORD)DISKREADBUFFER; - - Signature = Mbr->Signature; - DbgPrint((DPRINT_HWDETECT, "Signature: %x\n", Signature)); - - /* Calculate the MBR checksum */ - Checksum = 0; - for (i = 0; i < 128; i++) - { - Checksum += Buffer[i]; - } - Checksum = ~Checksum + 1; - DbgPrint((DPRINT_HWDETECT, "Checksum: %x\n", Checksum)); - - /* Fill out the ARC disk block */ - reactos_arc_disk_info[reactos_disk_count].Signature = Signature; - reactos_arc_disk_info[reactos_disk_count].CheckSum = Checksum; - sprintf(ArcName, "multi(0)disk(0)rdisk(%lu)", reactos_disk_count); - strcpy(reactos_arc_strings[reactos_disk_count], ArcName); - reactos_arc_disk_info[reactos_disk_count].ArcName = - reactos_arc_strings[reactos_disk_count]; - reactos_disk_count++; - - /* Convert checksum and signature to identifier string */ - Identifier[0] = Hex[(Checksum >> 28) & 0x0F]; - Identifier[1] = Hex[(Checksum >> 24) & 0x0F]; - Identifier[2] = Hex[(Checksum >> 20) & 0x0F]; - Identifier[3] = Hex[(Checksum >> 16) & 0x0F]; - Identifier[4] = Hex[(Checksum >> 12) & 0x0F]; - Identifier[5] = Hex[(Checksum >> 8) & 0x0F]; - Identifier[6] = Hex[(Checksum >> 4) & 0x0F]; - Identifier[7] = Hex[Checksum & 0x0F]; - Identifier[8] = '-'; - Identifier[9] = Hex[(Signature >> 28) & 0x0F]; - Identifier[10] = Hex[(Signature >> 24) & 0x0F]; - Identifier[11] = Hex[(Signature >> 20) & 0x0F]; - Identifier[12] = Hex[(Signature >> 16) & 0x0F]; - Identifier[13] = Hex[(Signature >> 12) & 0x0F]; - Identifier[14] = Hex[(Signature >> 8) & 0x0F]; - Identifier[15] = Hex[(Signature >> 4) & 0x0F]; - Identifier[16] = Hex[Signature & 0x0F]; - Identifier[17] = '-'; - Identifier[18] = 'A'; - Identifier[19] = 0; - DbgPrint((DPRINT_HWDETECT, "Identifier: %s\n", Identifier)); - - /* Set identifier */ - FldrSetIdentifier(DiskKey, Identifier); -} - -static ULONG -GetFloppyCount(VOID) -{ - UCHAR Data; - - WRITE_PORT_UCHAR((PUCHAR)0x70, 0x10); - Data = READ_PORT_UCHAR((PUCHAR)0x71); - - return ((Data & 0xF0) ? 1 : 0) + ((Data & 0x0F) ? 1 : 0); -} - - -static UCHAR -GetFloppyType(UCHAR DriveNumber) -{ - UCHAR Data; - - WRITE_PORT_UCHAR((PUCHAR)0x70, 0x10); - Data = READ_PORT_UCHAR((PUCHAR)0x71); - - if (DriveNumber == 0) - return Data >> 4; - else if (DriveNumber == 1) - return Data & 0x0F; - - return 0; -} - - -static PVOID -GetInt1eTable(VOID) -{ - PUSHORT SegPtr = (PUSHORT)0x7A; - PUSHORT OfsPtr = (PUSHORT)0x78; - - return (PVOID)((ULONG_PTR)(((ULONG)(*SegPtr)) << 4) + (ULONG)(*OfsPtr)); -} - - -static VOID -DetectBiosFloppyPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - PCM_FLOPPY_DEVICE_DATA FloppyData; - CHAR Identifier[20]; - PCONFIGURATION_COMPONENT_DATA PeripheralKey; - ULONG Size; - ULONG FloppyNumber; - UCHAR FloppyType; - ULONG MaxDensity[6] = {0, 360, 1200, 720, 1440, 2880}; - PUCHAR Ptr; - - for (FloppyNumber = 0; FloppyNumber < 2; FloppyNumber++) - { - FloppyType = GetFloppyType(FloppyNumber); - - if ((FloppyType > 5) || (FloppyType == 0)) - continue; - - DiskResetController(FloppyNumber); - - Ptr = GetInt1eTable(); - - FldrCreateComponentKey(ControllerKey, - L"FloppyDiskPeripheral", - FloppyNumber, - PeripheralClass, - FloppyDiskPeripheral, - &PeripheralKey); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(PeripheralKey, - Input | Output, - FloppyNumber, - 0xFFFFFFFF); - - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_FLOPPY_DEVICE_DATA); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 1; - - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypeDeviceSpecific; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_FLOPPY_DEVICE_DATA); - - FloppyData = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST)); - FloppyData->Version = 2; - FloppyData->Revision = 0; - FloppyData->MaxDensity = MaxDensity[FloppyType]; - FloppyData->MountDensity = 0; - RtlCopyMemory(&FloppyData->StepRateHeadUnloadTime, - Ptr, - 11); - FloppyData->MaximumTrackValue = (FloppyType == 1) ? 39 : 79; - FloppyData->DataTransferRate = 0; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - /* Set 'Identifier' value */ - sprintf(Identifier, "FLOPPY%ld", FloppyNumber + 1); - FldrSetIdentifier(PeripheralKey, Identifier); - } -} - - -static VOID -DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey, - PCONFIGURATION_COMPONENT_DATA ControllerKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - ULONG Size; - ULONG FloppyCount; - - FloppyCount = GetFloppyCount(); - DbgPrint((DPRINT_HWDETECT, - "Floppy count: %u\n", - FloppyCount)); - - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + - 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - memset(PartialResourceList, 0, Size); - - /* Initialize resource descriptor */ - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 3; - - /* Set IO Port */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypePort; - PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; - PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; - PartialDescriptor->u.Port.Start.LowPart = 0x03F0; - PartialDescriptor->u.Port.Start.HighPart = 0x0; - PartialDescriptor->u.Port.Length = 8; - - /* Set Interrupt */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; - PartialDescriptor->Type = CmResourceTypeInterrupt; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; - PartialDescriptor->u.Interrupt.Level = 6; - PartialDescriptor->u.Interrupt.Vector = 6; - PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF; - - /* Set DMA channel */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[2]; - PartialDescriptor->Type = CmResourceTypeDma; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->Flags = 0; - PartialDescriptor->u.Dma.Channel = 2; - PartialDescriptor->u.Dma.Port = 0; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - if (FloppyCount) DetectBiosFloppyPeripheral(ControllerKey); -} - -static VOID -DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, - PCONFIGURATION_COMPONENT_DATA BusKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_INT13_DRIVE_PARAMETER Int13Drives; - GEOMETRY Geometry; - PCONFIGURATION_COMPONENT_DATA DiskKey, ControllerKey; - ULONG DiskCount; - ULONG Size; - ULONG i; - BOOLEAN Changed; - - /* Count the number of visible drives */ - DiskReportError(FALSE); - DiskCount = 0; - - /* There are some really broken BIOSes out there. There are even BIOSes - * that happily report success when you ask them to read from non-existent - * harddisks. So, we set the buffer to known contents first, then try to - * read. If the BIOS reports success but the buffer contents haven't - * changed then we fail anyway */ - memset((PVOID) DISKREADBUFFER, 0xcd, 512); - while (MachDiskReadLogicalSectors(0x80 + DiskCount, 0ULL, 1, (PVOID)DISKREADBUFFER)) - { - Changed = FALSE; - for (i = 0; ! Changed && i < 512; i++) - { - Changed = ((PUCHAR)DISKREADBUFFER)[i] != 0xcd; - } - if (! Changed) - { - DbgPrint((DPRINT_HWDETECT, "BIOS reports success for disk %d but data didn't change\n", - (int)DiskCount)); - break; - } - DiskCount++; - memset((PVOID) DISKREADBUFFER, 0xcd, 512); - } - DiskReportError(TRUE); - DbgPrint((DPRINT_HWDETECT, "BIOS reports %d harddisk%s\n", - (int)DiskCount, (DiskCount == 1) ? "": "s")); - - FldrCreateComponentKey(BusKey, - L"DiskController", - 0, - ControllerClass, - DiskController, - &ControllerKey); - DbgPrint((DPRINT_HWDETECT, "Created key: DiskController\\0\n")); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(ControllerKey, - Output | Input | Removable, - 0, - 0xFFFFFFFF); - - DetectBiosFloppyController(BusKey, ControllerKey); - - /* Allocate resource descriptor */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount; - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 1; - PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific; - PartialResourceList->PartialDescriptors[0].ShareDisposition = 0; - PartialResourceList->PartialDescriptors[0].Flags = 0; - PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = - sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount; - - /* Get harddisk Int13 geometry data */ - Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST)); - for (i = 0; i < DiskCount; i++) - { - if (MachDiskGetDriveGeometry(0x80 + i, &Geometry)) - { - Int13Drives[i].DriveSelect = 0x80 + i; - Int13Drives[i].MaxCylinders = Geometry.Cylinders - 1; - Int13Drives[i].SectorsPerTrack = Geometry.Sectors; - Int13Drives[i].MaxHeads = Geometry.Heads - 1; - Int13Drives[i].NumberDrives = DiskCount; - - DbgPrint((DPRINT_HWDETECT, - "Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n", - 0x80 + i, - Geometry.Cylinders - 1, - Geometry.Heads -1, - Geometry.Sectors, - Geometry.BytesPerSector)); - } - } - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(SystemKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - /* Create and fill subkey for each harddisk */ - for (i = 0; i < DiskCount; i++) - { - /* Create disk key */ - FldrCreateComponentKey(ControllerKey, - L"DiskPeripheral", - i, - PeripheralClass, - DiskPeripheral, - &DiskKey); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(DiskKey, - Output | Input, - 0, - 0xFFFFFFFF); - - /* Set disk values */ - SetHarddiskConfigurationData(DiskKey, 0x80 + i); - SetHarddiskIdentifier(DiskKey, 0x80 + i); - } -} - -static VOID -InitializeSerialPort(ULONG Port, - ULONG LineControl) -{ - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 3, 0x80); /* set DLAB on */ - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port, 0x60); /* speed LO byte */ - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 1, 0); /* speed HI byte */ - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 3, LineControl); - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 1, 0); /* set comm and DLAB to 0 */ - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 4, 0x09); /* DR int enable */ - READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 5); /* clear error bits */ -} - - -static ULONG -DetectSerialMouse(ULONG Port) -{ - CHAR Buffer[4]; - ULONG i; - ULONG TimeOut; - UCHAR LineControl; - - /* Shutdown mouse or something like that */ - LineControl = READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 4); - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 4, (LineControl & ~0x02) | 0x01); - StallExecutionProcessor(100000); - - /* - * Clear buffer - * Maybe there is no serial port although BIOS reported one (this - * is the case on Apple hardware), or the serial port is misbehaving, - * therefore we must give up after some time. - */ - TimeOut = 200; - while (READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 5) & 0x01) - { - if (--TimeOut == 0) - return MOUSE_TYPE_NONE; - READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port); - } - - /* - * Send modem control with 'Data Terminal Ready', 'Request To Send' and - * 'Output Line 2' message. This enables mouse to identify. - */ - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 4, 0x0b); - - /* Wait 10 milliseconds for the mouse getting ready */ - StallExecutionProcessor(10000); - - /* Read first four bytes, which contains Microsoft Mouse signs */ - TimeOut = 200; - for (i = 0; i < 4; i++) - { - while (((READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 5) & 1) == 0) && (TimeOut > 0)) - { - StallExecutionProcessor(1000); - --TimeOut; - if (TimeOut == 0) - return MOUSE_TYPE_NONE; - } - Buffer[i] = READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port); - } - - DbgPrint((DPRINT_HWDETECT, - "Mouse data: %x %x %x %x\n", - Buffer[0],Buffer[1],Buffer[2],Buffer[3])); - - /* Check that four bytes for signs */ - for (i = 0; i < 4; ++i) - { - if (Buffer[i] == 'B') - { - /* Sign for Microsoft Ballpoint */ -// DbgPrint("Microsoft Ballpoint device detected\n"); -// DbgPrint("THIS DEVICE IS NOT SUPPORTED, YET\n"); - return MOUSE_TYPE_NONE; - } - else if (Buffer[i] == 'M') - { - /* Sign for Microsoft Mouse protocol followed by button specifier */ - if (i == 3) - { - /* Overflow Error */ - return MOUSE_TYPE_NONE; - } - - switch (Buffer[i + 1]) - { - case '3': - DbgPrint((DPRINT_HWDETECT, - "Microsoft Mouse with 3-buttons detected\n")); - return MOUSE_TYPE_LOGITECH; - - case 'Z': - DbgPrint((DPRINT_HWDETECT, - "Microsoft Wheel Mouse detected\n")); - return MOUSE_TYPE_WHEELZ; - - /* case '2': */ - default: - DbgPrint((DPRINT_HWDETECT, - "Microsoft Mouse with 2-buttons detected\n")); - return MOUSE_TYPE_MICROSOFT; - } - } - } - - return MOUSE_TYPE_NONE; -} - - -static ULONG -GetSerialMousePnpId(ULONG Port, char *Buffer) -{ - ULONG TimeOut; - ULONG i = 0; - char c; - char x; - - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 4, 0x09); - - /* Wait 10 milliseconds for the mouse getting ready */ - StallExecutionProcessor(10000); - - WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 4, 0x0b); - - StallExecutionProcessor(10000); - - for (;;) - { - TimeOut = 200; - while (((READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 5) & 1) == 0) && (TimeOut > 0)) - { - StallExecutionProcessor(1000); - --TimeOut; - if (TimeOut == 0) - { - return 0; - } - } - - c = READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port); - if (c == 0x08 || c == 0x28) - break; - } - - Buffer[i++] = c; - x = c + 1; - - for (;;) - { - TimeOut = 200; - while (((READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port + 5) & 1) == 0) && (TimeOut > 0)) - { - StallExecutionProcessor(1000); - --TimeOut; - if (TimeOut == 0) - return 0; - } - c = READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)Port); - Buffer[i++] = c; - if (c == x) - break; - if (i >= 256) - break; - } - - return i; -} - - -static VOID -DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey, - ULONG Base) -{ - CM_PARTIAL_RESOURCE_LIST PartialResourceList; - char Buffer[256]; - CHAR Identifier[256]; - PCONFIGURATION_COMPONENT_DATA PeripheralKey; - ULONG MouseType; - ULONG Length; - ULONG i; - ULONG j; - ULONG k; - - DbgPrint((DPRINT_HWDETECT, - "DetectSerialPointerPeripheral()\n")); - - Identifier[0] = 0; - - InitializeSerialPort(Base, 2); - MouseType = DetectSerialMouse(Base); - - if (MouseType != MOUSE_TYPE_NONE) - { - Length = GetSerialMousePnpId(Base, Buffer); - DbgPrint((DPRINT_HWDETECT, - "PnP ID length: %u\n", - Length)); - - if (Length != 0) - { - /* Convert PnP sting to ASCII */ - if (Buffer[0] == 0x08) - { - for (i = 0; i < Length; i++) - Buffer[i] += 0x20; - } - Buffer[Length] = 0; - - DbgPrint((DPRINT_HWDETECT, - "PnP ID string: %s\n", - Buffer)); - - /* Copy PnpId string */ - for (i = 0; i < 7; i++) - { - Identifier[i] = Buffer[3+i]; - } - memcpy(&Identifier[7], - L" - ", - 3 * sizeof(WCHAR)); - - /* Skip device serial number */ - i = 10; - if (Buffer[i] == '\\') - { - for (j = ++i; i < Length; ++i) - { - if (Buffer[i] == '\\') - break; - } - if (i >= Length) - i -= 3; - } - - /* Skip PnP class */ - if (Buffer[i] == '\\') - { - for (j = ++i; i < Length; ++i) - { - if (Buffer[i] == '\\') - break; - } - - if (i >= Length) - i -= 3; - } - - /* Skip compatible PnP Id */ - if (Buffer[i] == '\\') - { - for (j = ++i; i < Length; ++i) - { - if (Buffer[i] == '\\') - break; - } - if (Buffer[j] == '*') - ++j; - if (i >= Length) - i -= 3; - } - - /* Get product description */ - if (Buffer[i] == '\\') - { - for (j = ++i; i < Length; ++i) - { - if (Buffer[i] == ';') - break; - } - if (i >= Length) - i -= 3; - if (i > j + 1) - { - for (k = 0; k < i - j; k++) - { - Identifier[k + 10] = Buffer[k + j]; - } - Identifier[10 + (i-j)] = 0; - } - } - - DbgPrint((DPRINT_HWDETECT, - "Identifier string: %s\n", - Identifier)); - } - - if (Length == 0 || strlen(Identifier) < 11) - { - switch (MouseType) - { - case MOUSE_TYPE_LOGITECH: - strcpy (Identifier, - "LOGITECH SERIAL MOUSE"); - break; - - case MOUSE_TYPE_WHEELZ: - strcpy (Identifier, - "MICROSOFT SERIAL MOUSE WITH WHEEL"); - break; - - case MOUSE_TYPE_MICROSOFT: - default: - strcpy (Identifier, - "MICROSOFT SERIAL MOUSE"); - break; - } - } - - /* Create 'PointerPeripheral' key */ - FldrCreateComponentKey(ControllerKey, - L"PointerPeripheral", - 0, - PeripheralClass, - PointerPeripheral, - &PeripheralKey); - DbgPrint((DPRINT_HWDETECT, - "Created key: PointerPeripheral\\0\n")); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(PeripheralKey, - Input, - 0, - 0xFFFFFFFF); - - /* Set 'Configuration Data' value */ - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - PartialResourceList.Version = 1; - PartialResourceList.Revision = 1; - PartialResourceList.Count = 0; - - FldrSetConfigurationData(PeripheralKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) - - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - - /* Set 'Identifier' value */ - FldrSetIdentifier(PeripheralKey, Identifier); - } -} - - -static VOID -DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - PCM_SERIAL_DEVICE_DATA SerialDeviceData; - ULONG Irq[4] = {4, 3, 4, 3}; - ULONG Base; - CHAR Buffer[80]; - PUSHORT BasePtr; - ULONG ControllerNumber = 0; - PCONFIGURATION_COMPONENT_DATA ControllerKey; - ULONG i; - ULONG Size; - - DbgPrint((DPRINT_HWDETECT, "DetectSerialPorts()\n")); - - ControllerNumber = 0; - BasePtr = (PUSHORT)0x400; - for (i = 0; i < 4; i++, BasePtr++) - { - Base = (ULONG)*BasePtr; - if (Base == 0) - continue; - - DbgPrint((DPRINT_HWDETECT, - "Found COM%u port at 0x%x\n", - i + 1, - Base)); - - /* Create controller key */ - FldrCreateComponentKey(BusKey, - L"SerialController", - ControllerNumber, - ControllerClass, - SerialController, - &ControllerKey); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(ControllerKey, - Output | Input | ConsoleIn | ConsoleOut, - ControllerNumber, - 0xFFFFFFFF); - - /* Build full device descriptor */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + - 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + - sizeof(CM_SERIAL_DEVICE_DATA); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - continue; - } - memset(PartialResourceList, 0, Size); - - /* Initialize resource descriptor */ - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 3; - - /* Set IO Port */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypePort; - PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; - PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; - PartialDescriptor->u.Port.Start.LowPart = Base; - PartialDescriptor->u.Port.Start.HighPart = 0x0; - PartialDescriptor->u.Port.Length = 7; - - /* Set Interrupt */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; - PartialDescriptor->Type = CmResourceTypeInterrupt; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; - PartialDescriptor->u.Interrupt.Level = Irq[i]; - PartialDescriptor->u.Interrupt.Vector = 0; - PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF; - - /* Set serial data (device specific) */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[2]; - PartialDescriptor->Type = CmResourceTypeDeviceSpecific; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->Flags = 0; - PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_SERIAL_DEVICE_DATA); - - SerialDeviceData = - (PCM_SERIAL_DEVICE_DATA)&PartialResourceList->PartialDescriptors[3]; - SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */ - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - /* Set 'Identifier' value */ - sprintf(Buffer, "COM%ld", i + 1); - FldrSetIdentifier(ControllerKey, Buffer); - DbgPrint((DPRINT_HWDETECT, - "Created value: Identifier %s\n", - Buffer)); - - if (!Rs232PortInUse(Base)) - { - /* Detect serial mouse */ - DetectSerialPointerPeripheral(ControllerKey, Base); - } - - ControllerNumber++; - } -} - - -static VOID -DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - ULONG Irq[3] = {7, 5, (ULONG)-1}; - CHAR Buffer[80]; - PCONFIGURATION_COMPONENT_DATA ControllerKey; - PUSHORT BasePtr; - ULONG Base; - ULONG ControllerNumber; - ULONG i; - ULONG Size; - - DbgPrint((DPRINT_HWDETECT, "DetectParallelPorts() called\n")); - - ControllerNumber = 0; - BasePtr = (PUSHORT)0x408; - for (i = 0; i < 3; i++, BasePtr++) - { - Base = (ULONG)*BasePtr; - if (Base == 0) - continue; - - DbgPrint((DPRINT_HWDETECT, - "Parallel port %u: %x\n", - ControllerNumber, - Base)); - - /* Create controller key */ - FldrCreateComponentKey(BusKey, - L"ParallelController", - ControllerNumber, - ControllerClass, - ParallelController, - &ControllerKey); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(ControllerKey, - Output, - ControllerNumber, - 0xFFFFFFFF); - - /* Build full device descriptor */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST); - if (Irq[i] != (ULONG)-1) - Size += sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - continue; - } - memset(PartialResourceList, 0, Size); - - /* Initialize resource descriptor */ - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = (Irq[i] != (ULONG)-1) ? 2 : 1; - - /* Set IO Port */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypePort; - PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; - PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; - PartialDescriptor->u.Port.Start.LowPart = Base; - PartialDescriptor->u.Port.Start.HighPart = 0x0; - PartialDescriptor->u.Port.Length = 3; - - /* Set Interrupt */ - if (Irq[i] != (ULONG)-1) - { - PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; - PartialDescriptor->Type = CmResourceTypeInterrupt; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; - PartialDescriptor->u.Interrupt.Level = Irq[i]; - PartialDescriptor->u.Interrupt.Vector = 0; - PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF; - } - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - /* Set 'Identifier' value */ - sprintf(Buffer, "PARALLEL%ld", i + 1); - FldrSetIdentifier(ControllerKey, Buffer); - DbgPrint((DPRINT_HWDETECT, - "Created value: Identifier %s\n", - Buffer)); - - ControllerNumber++; - } - - DbgPrint((DPRINT_HWDETECT, "DetectParallelPorts() done\n")); -} - - -static BOOLEAN -DetectKeyboardDevice(VOID) -{ - UCHAR Status; - UCHAR Scancode; - ULONG Loops; - BOOLEAN Result = TRUE; - - /* Identify device */ - WRITE_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA, - 0xF2); - - /* Wait for reply */ - for (Loops = 0; Loops < 100; Loops++) - { - StallExecutionProcessor(10000); - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) != 0) - break; - } - - if ((Status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) == 0) - { - /* PC/XT keyboard or no keyboard */ - Result = FALSE; - } - - Scancode = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA); - if (Scancode != 0xFA) - { - /* No ACK received */ - Result = FALSE; - } - - StallExecutionProcessor(10000); - - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) == 0) - { - /* Found AT keyboard */ - return Result; - } - - Scancode = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA); - if (Scancode != 0xAB) - { - /* No 0xAB received */ - Result = FALSE; - } - - StallExecutionProcessor(10000); - - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) == 0) - { - /* No byte in buffer */ - Result = FALSE; - } - - Scancode = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA); - if (Scancode != 0x41) - { - /* No 0x41 received */ - Result = FALSE; - } - - /* Found MF-II keyboard */ - return Result; -} - - -static VOID -DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - PCM_KEYBOARD_DEVICE_DATA KeyboardData; - PCONFIGURATION_COMPONENT_DATA PeripheralKey; - ULONG Size; - - /* HACK: don't call DetectKeyboardDevice() as it fails in Qemu 0.8.2 */ - if (TRUE || DetectKeyboardDevice()) - { - /* Create controller key */ - FldrCreateComponentKey(ControllerKey, - L"KeyboardPeripheral", - 0, - PeripheralClass, - KeyboardPeripheral, - &PeripheralKey); - DbgPrint((DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n")); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(PeripheralKey, - Input | ConsoleIn, - 0, - 0xFFFFFFFF); - - /* Set 'Configuration Data' value */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_KEYBOARD_DEVICE_DATA); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 1; - - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypeDeviceSpecific; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_KEYBOARD_DEVICE_DATA); - - KeyboardData = (PCM_KEYBOARD_DEVICE_DATA)(PartialDescriptor + 1); - KeyboardData->Version = 1; - KeyboardData->Revision = 1; - KeyboardData->Type = 4; - KeyboardData->Subtype = 0; - KeyboardData->KeyboardFlags = 0x20; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - /* Set 'Identifier' value */ - FldrSetIdentifier(PeripheralKey, "PCAT_ENHANCED"); - } -} - - -static VOID -DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - PCONFIGURATION_COMPONENT_DATA ControllerKey; - ULONG Size; - - /* Create controller key */ - FldrCreateComponentKey(BusKey, - L"KeyboardController", - 0, - ControllerClass, - KeyboardController, - &ControllerKey); - DbgPrint((DPRINT_HWDETECT, "Created key: KeyboardController\\0\n")); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(ControllerKey, - Input | ConsoleIn, - 0, - 0xFFFFFFFF); - - /* Set 'Configuration Data' value */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + - 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 3; - - /* Set Interrupt */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypeInterrupt; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; - PartialDescriptor->u.Interrupt.Level = 1; - PartialDescriptor->u.Interrupt.Vector = 0; - PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF; - - /* Set IO Port 0x60 */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; - PartialDescriptor->Type = CmResourceTypePort; - PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; - PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; - PartialDescriptor->u.Port.Start.LowPart = 0x60; - PartialDescriptor->u.Port.Start.HighPart = 0x0; - PartialDescriptor->u.Port.Length = 1; - - /* Set IO Port 0x64 */ - PartialDescriptor = &PartialResourceList->PartialDescriptors[2]; - PartialDescriptor->Type = CmResourceTypePort; - PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; - PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; - PartialDescriptor->u.Port.Start.LowPart = 0x64; - PartialDescriptor->u.Port.Start.HighPart = 0x0; - PartialDescriptor->u.Port.Length = 1; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - DetectKeyboardPeripheral(ControllerKey); -} - - -static VOID -PS2ControllerWait(VOID) -{ - ULONG Timeout; - UCHAR Status; - - for (Timeout = 0; Timeout < CONTROLLER_TIMEOUT; Timeout++) - { - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_INPUT_BUFFER_FULL) == 0) - return; - - /* Sleep for one millisecond */ - StallExecutionProcessor(1000); - } -} - - -static BOOLEAN -DetectPS2AuxPort(VOID) -{ -#if 1 - /* Current detection is too unreliable. Just do as if - * the PS/2 aux port is always present - */ - return TRUE; -#else - ULONG Loops; - UCHAR Status; - - /* Put the value 0x5A in the output buffer using the - * "WriteAuxiliary Device Output Buffer" command (0xD3). - * Poll the Status Register for a while to see if the value really turns up - * in the Data Register. If the KEYBOARD_STATUS_MOUSE_OBF bit is also set - * to 1 in the Status Register, we assume this controller has an - * Auxiliary Port (a.k.a. Mouse Port). - */ - PS2ControllerWait(); - WRITE_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_CONTROL, - CONTROLLER_COMMAND_WRITE_MOUSE_OUTPUT_BUFFER); - PS2ControllerWait(); - - /* 0x5A is a random dummy value */ - WRITE_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA, - 0x5A); - - for (Loops = 0; Loops < 10; Loops++) - { - StallExecutionProcessor(10000); - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) != 0) - break; - } - - READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA); - - return (Status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL); -#endif -} - - -static BOOLEAN -DetectPS2AuxDevice(VOID) -{ - UCHAR Scancode; - UCHAR Status; - ULONG Loops; - BOOLEAN Result = TRUE; - - PS2ControllerWait(); - WRITE_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_CONTROL, - CONTROLLER_COMMAND_WRITE_MOUSE); - PS2ControllerWait(); - - /* Identify device */ - WRITE_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA, - 0xF2); - - /* Wait for reply */ - for (Loops = 0; Loops < 100; Loops++) - { - StallExecutionProcessor(10000); - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) != 0) - break; - } - - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) == 0) - Result = FALSE; - - Scancode = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA); - if (Scancode != 0xFA) - Result = FALSE; - - StallExecutionProcessor(10000); - - Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS); - if ((Status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) == 0) - Result = FALSE; - - Scancode = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA); - if (Scancode != 0x00) - Result = FALSE; - - return Result; -} - - -static VOID -DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey) -{ - CM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCONFIGURATION_COMPONENT_DATA ControllerKey; - PCONFIGURATION_COMPONENT_DATA PeripheralKey; - - if (DetectPS2AuxPort()) - { - DbgPrint((DPRINT_HWDETECT, "Detected PS2 port\n")); - - /* Create controller key */ - FldrCreateComponentKey(BusKey, - L"PointerController", - 0, - ControllerClass, - PointerController, - &ControllerKey); - DbgPrint((DPRINT_HWDETECT, "Created key: PointerController\\0\n")); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(ControllerKey, - Input, - 0, - 0xFFFFFFFF); - - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - - /* Initialize resource descriptor */ - PartialResourceList.Version = 1; - PartialResourceList.Revision = 1; - PartialResourceList.Count = 1; - - /* Set Interrupt */ - PartialResourceList.PartialDescriptors[0].Type = CmResourceTypeInterrupt; - PartialResourceList.PartialDescriptors[0].ShareDisposition = CmResourceShareUndetermined; - PartialResourceList.PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED; - PartialResourceList.PartialDescriptors[0].u.Interrupt.Level = 12; - PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 0; - PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST)); - - if (DetectPS2AuxDevice()) - { - DbgPrint((DPRINT_HWDETECT, "Detected PS2 mouse\n")); - - /* Create peripheral key */ - FldrCreateComponentKey(ControllerKey, - L"PointerPeripheral", - 0, - ControllerClass, - PointerPeripheral, - &PeripheralKey); - DbgPrint((DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n")); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(PeripheralKey, - Input, - 0, - 0xFFFFFFFF); - - /* Initialize resource descriptor */ - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - PartialResourceList.Version = 1; - PartialResourceList.Revision = 1; - PartialResourceList.Count = 0; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) - - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - - /* Set 'Identifier' value */ - FldrSetIdentifier(PeripheralKey, "MICROSOFT PS2 MOUSE"); - } - } -} - - -static VOID -DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey) -{ - CHAR Buffer[80]; - PCONFIGURATION_COMPONENT_DATA ControllerKey; - USHORT VesaVersion; - - FldrCreateComponentKey(BusKey, - L"DisplayController", - 0, - ControllerClass, - DisplayController, - &ControllerKey); - DbgPrint((DPRINT_HWDETECT, "Created key: DisplayController\\0\n")); - - /* Set 'ComponentInformation' value */ - FldrSetComponentInformation(ControllerKey, - 0x00, - 0, - 0xFFFFFFFF); - - /* FIXME: Set 'ComponentInformation' value */ - - VesaVersion = BiosIsVesaSupported(); - if (VesaVersion != 0) - { - DbgPrint((DPRINT_HWDETECT, - "VESA version %c.%c\n", - (VesaVersion >> 8) + '0', - (VesaVersion & 0xFF) + '0')); - } - else - { - DbgPrint((DPRINT_HWDETECT, - "VESA not supported\n")); - } - - if (VesaVersion >= 0x0200) - { - strcpy(Buffer, - "VBE Display"); - } - else - { - strcpy(Buffer, - "VGA Display"); - } - - /* Set 'Identifier' value */ - FldrSetIdentifier(ControllerKey, Buffer); - - /* FIXME: Add display peripheral (monitor) data */ -} - - -static VOID -DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCONFIGURATION_COMPONENT_DATA BusKey; - ULONG Size; - - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - L"MultifunctionAdapter", - *BusNumber, - AdapterClass, - MultiFunctionAdapter, - &BusKey); - - /* Set 'Component Information' value similar to my NT4 box */ - FldrSetComponentInformation(BusKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Increment bus number */ - (*BusNumber)++; - - /* Set 'Identifier' value */ - FldrSetIdentifier(BusKey, "ISA"); - - /* Set 'Configuration Data' value */ - Size = sizeof(CM_PARTIAL_RESOURCE_LIST) - - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - PartialResourceList = MmHeapAlloc(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 0; - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, PartialResourceList, Size); - MmHeapFree(PartialResourceList); - - /* Detect ISA/BIOS devices */ - DetectBiosDisks(SystemKey, BusKey); - - DetectSerialPorts(BusKey); - - DetectParallelPorts(BusKey); - - DetectKeyboardController(BusKey); - - DetectPS2Mouse(BusKey); - - DetectDisplayController(BusKey); - - /* FIXME: Detect more ISA devices */ -} - - -PCONFIGURATION_COMPONENT_DATA -PcHwDetect(VOID) -{ - PCONFIGURATION_COMPONENT_DATA SystemKey; - ULONG BusNumber = 0; - - DbgPrint((DPRINT_HWDETECT, "DetectHardware()\n")); - - /* Create the 'System' key */ - FldrCreateSystemKey(&SystemKey); - - /* Set empty component information */ - FldrSetComponentInformation(SystemKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Detect buses */ - DetectPciBios(SystemKey, &BusNumber); - DetectApmBios(SystemKey, &BusNumber); - DetectPnpBios(SystemKey, &BusNumber); - DetectIsaBios(SystemKey, &BusNumber); - DetectAcpiBios(SystemKey, &BusNumber); - - DbgPrint((DPRINT_HWDETECT, "DetectHardware() Done\n")); - - return SystemKey; -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/hwacpi.c b/reactos/boot/freeldr/freeldr/arch/amd64/hwacpi.c deleted file mode 100644 index 39f163ea4d2..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/hwacpi.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * FreeLoader - * - * Copyright (C) 2004 Eric Kohl - * - * 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 -#include - -BOOLEAN AcpiPresent = FALSE; - -static PRSDP_DESCRIPTOR -FindAcpiBios(VOID) -{ - PUCHAR Ptr; - - /* Find the 'Root System Descriptor Table Pointer' */ - Ptr = (PUCHAR)0xE0000; - while ((ULONG_PTR)Ptr < 0x100000) - { - if (!memcmp(Ptr, "RSD PTR ", 8)) - { - DbgPrint((DPRINT_HWDETECT, "ACPI supported\n")); - - return (PRSDP_DESCRIPTOR)Ptr; - } - - Ptr = (PUCHAR)((ULONG_PTR)Ptr + 0x10); - } - - DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n")); - - return NULL; -} - - -VOID -DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) -{ - PCONFIGURATION_COMPONENT_DATA BiosKey; - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - PRSDP_DESCRIPTOR Rsdp; - PACPI_BIOS_DATA AcpiBiosData; - BIOS_MEMORY_MAP BiosMemoryMap[32]; - ULONG BiosMemoryMapEntryCount, TableSize; - - Rsdp = FindAcpiBios(); - - if (Rsdp) - { - /* Set up the flag in the loader block */ - AcpiPresent = TRUE; - LoaderBlock.Flags |= MB_FLAGS_ACPI_TABLE; - - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - L"MultifunctionAdapter", - *BusNumber, - AdapterClass, - MultiFunctionAdapter, - &BiosKey); - - /* Set 'Component Information' */ - FldrSetComponentInformation(BiosKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Get BIOS memory map */ - RtlZeroMemory(BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32); - BiosMemoryMapEntryCount = MachGetMemoryMap(BiosMemoryMap, - sizeof(BiosMemoryMap) / sizeof(BIOS_MEMORY_MAP)); - - /* Calculate the table size */ - TableSize = BiosMemoryMapEntryCount * sizeof(BIOS_MEMORY_MAP) + - sizeof(ACPI_BIOS_DATA) - sizeof(BIOS_MEMORY_MAP); - - /* Set 'Configuration Data' value */ - PartialResourceList = - MmHeapAlloc(sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize); - memset(PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize); - PartialResourceList->Version = 0; - PartialResourceList->Revision = 0; - PartialResourceList->Count = 1; - - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypeDeviceSpecific; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->u.DeviceSpecificData.DataSize = TableSize; - - /* Fill the table */ - AcpiBiosData = (PACPI_BIOS_DATA)&PartialResourceList->PartialDescriptors[1]; - AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address; - AcpiBiosData->Count = BiosMemoryMapEntryCount; - memcpy(AcpiBiosData->MemoryMap, BiosMemoryMap, - BiosMemoryMapEntryCount * sizeof(BIOS_MEMORY_MAP)); - - DbgPrint((DPRINT_HWDETECT, "RSDT %p, data size %x\n", Rsdp->rsdt_physical_address, - TableSize)); - - FldrSetConfigurationData(BiosKey, - PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize - ); - - /* Increment bus number */ - (*BusNumber)++; - - /* Set 'Identifier' value */ - FldrSetIdentifier(BiosKey, "ACPI BIOS"); - MmFreeMemory(PartialResourceList); - } -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/hwapm.c b/reactos/boot/freeldr/freeldr/arch/amd64/hwapm.c deleted file mode 100644 index 4296c76164c..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/hwapm.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * FreeLoader - * - * Copyright (C) 2004 Eric Kohl - * - * 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 - -#define NDEBUG -#include - -static BOOLEAN -FindApmBios(VOID) -{ - REGS RegsIn; - REGS RegsOut; - - RegsIn.b.ah = 0x53; - RegsIn.b.al = 0x00; - RegsIn.w.bx = 0x0000; - - Int386(0x15, &RegsIn, &RegsOut); - - if (INT386_SUCCESS(RegsOut)) - { - DbgPrint((DPRINT_HWDETECT, "Found APM BIOS\n")); - DbgPrint((DPRINT_HWDETECT, "AH: %x\n", RegsOut.b.ah)); - DbgPrint((DPRINT_HWDETECT, "AL: %x\n", RegsOut.b.al)); - DbgPrint((DPRINT_HWDETECT, "BH: %x\n", RegsOut.b.bh)); - DbgPrint((DPRINT_HWDETECT, "BL: %x\n", RegsOut.b.bl)); - DbgPrint((DPRINT_HWDETECT, "CX: %x\n", RegsOut.w.cx)); - - return TRUE; - } - - DbgPrint((DPRINT_HWDETECT, "No APM BIOS found\n")); - - return FALSE; -} - - -VOID -DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) -{ - PCONFIGURATION_COMPONENT_DATA BiosKey; - CM_PARTIAL_RESOURCE_LIST PartialResourceList; - - if (FindApmBios()) - { - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - L"MultifunctionAdapter", - *BusNumber, - AdapterClass, - MultiFunctionAdapter, - &BiosKey); - - /* Set 'Component Information' */ - FldrSetComponentInformation(BiosKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Set 'Configuration Data' value */ - memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); - PartialResourceList.Version = 0; - PartialResourceList.Revision = 0; - PartialResourceList.Count = 0; - FldrSetConfigurationData(BiosKey, - &PartialResourceList, - sizeof(CM_PARTIAL_RESOURCE_LIST) - - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - - /* Increment bus number */ - (*BusNumber)++; - - /* Set 'Identifier' value */ - FldrSetIdentifier(BiosKey, "APM"); - } - - /* FIXME: Add configuration data */ -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/hwpci.c b/reactos/boot/freeldr/freeldr/arch/amd64/hwpci.c deleted file mode 100644 index de293334c5f..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/hwpci.c +++ /dev/null @@ -1,346 +0,0 @@ -/* - * FreeLoader - * - * Copyright (C) 2004 Eric Kohl - * - * 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 - -#define NDEBUG -#include - -typedef struct _ROUTING_SLOT -{ - UCHAR BusNumber; - UCHAR DeviceNumber; - UCHAR LinkA; - USHORT BitmapA; - UCHAR LinkB; - USHORT BitmapB; - UCHAR LinkC; - USHORT BitmapC; - UCHAR LinkD; - USHORT BitmapD; - UCHAR SlotNumber; - UCHAR Reserved; -} __attribute__((packed)) ROUTING_SLOT, *PROUTING_SLOT; - -typedef struct _PCI_IRQ_ROUTING_TABLE -{ - ULONG Signature; - USHORT Version; - USHORT Size; - UCHAR RouterBus; - UCHAR RouterSlot; - USHORT ExclusiveIRQs; - ULONG CompatibleRouter; - ULONG MiniportData; - UCHAR Reserved[11]; - UCHAR Checksum; - ROUTING_SLOT Slot[1]; -} __attribute__((packed)) PCI_IRQ_ROUTING_TABLE, *PPCI_IRQ_ROUTING_TABLE; - -typedef struct _PCI_REGISTRY_INFO -{ - UCHAR MajorRevision; - UCHAR MinorRevision; - UCHAR NoBuses; - UCHAR HardwareMechanism; -} PCI_REGISTRY_INFO, *PPCI_REGISTRY_INFO; - -static PPCI_IRQ_ROUTING_TABLE -GetPciIrqRoutingTable(VOID) -{ - PPCI_IRQ_ROUTING_TABLE Table; - PUCHAR Ptr; - ULONG Sum; - ULONG i; - - Table = (PPCI_IRQ_ROUTING_TABLE)0xF0000; - while ((ULONG_PTR)Table < 0x100000) - { - if (Table->Signature == 0x52495024) - { - DbgPrint((DPRINT_HWDETECT, - "Found signature\n")); - - Ptr = (PUCHAR)Table; - Sum = 0; - for (i = 0; i < Table->Size; i++) - { - Sum += Ptr[i]; - } - - if ((Sum & 0xFF) != 0) - { - DbgPrint((DPRINT_HWDETECT, - "Invalid routing table\n")); - return NULL; - } - - DbgPrint((DPRINT_HWDETECT, - "Valid checksum\n")); - - return Table; - } - - Table = (PPCI_IRQ_ROUTING_TABLE)((ULONG_PTR)Table + 0x10); - } - - return NULL; -} - - -static BOOLEAN -FindPciBios(PPCI_REGISTRY_INFO BusData) -{ - REGS RegsIn; - REGS RegsOut; - - RegsIn.b.ah = 0xB1; /* Subfunction B1h */ - RegsIn.b.al = 0x01; /* PCI BIOS present */ - - Int386(0x1A, &RegsIn, &RegsOut); - - if (INT386_SUCCESS(RegsOut) && RegsOut.d.edx == 0x20494350 && RegsOut.b.ah == 0) - { - DbgPrint((DPRINT_HWDETECT, "Found PCI bios\n")); - - DbgPrint((DPRINT_HWDETECT, "AL: %x\n", RegsOut.b.al)); - DbgPrint((DPRINT_HWDETECT, "BH: %x\n", RegsOut.b.bh)); - DbgPrint((DPRINT_HWDETECT, "BL: %x\n", RegsOut.b.bl)); - DbgPrint((DPRINT_HWDETECT, "CL: %x\n", RegsOut.b.cl)); - - BusData->NoBuses = RegsOut.b.cl + 1; - BusData->MajorRevision = RegsOut.b.bh; - BusData->MinorRevision = RegsOut.b.bl; - BusData->HardwareMechanism = RegsOut.b.cl; - - return TRUE; - } - - - DbgPrint((DPRINT_HWDETECT, "No PCI bios found\n")); - - return FALSE; -} - - -static VOID -DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - PPCI_IRQ_ROUTING_TABLE Table; - PCONFIGURATION_COMPONENT_DATA TableKey; - ULONG Size; - - Table = GetPciIrqRoutingTable(); - if (Table != NULL) - { - DbgPrint((DPRINT_HWDETECT, "Table size: %u\n", Table->Size)); - - FldrCreateComponentKey(BusKey, - L"RealModeIrqRoutingTable", - 0, - PeripheralClass, - RealModeIrqRoutingTable, - &TableKey); - - /* Set 'Component Information' */ - FldrSetComponentInformation(TableKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Set 'Identifier' value */ - FldrSetIdentifier(TableKey, "PCI Real-mode IRQ Routing Table"); - - /* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) + - 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size; - PartialResourceList = MmAllocateMemory(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 2; - - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypeBusNumber; - PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; - PartialDescriptor->u.BusNumber.Start = 0; - PartialDescriptor->u.BusNumber.Length = 1; - - PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; - PartialDescriptor->Type = CmResourceTypeDeviceSpecific; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->u.DeviceSpecificData.DataSize = Table->Size; - - memcpy(&PartialResourceList->PartialDescriptors[2], - Table, Table->Size); - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(TableKey, PartialResourceList, Size); - MmFreeMemory(PartialResourceList); - } -} - - -VOID -DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) -{ - PCM_PARTIAL_RESOURCE_LIST PartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; - PCI_REGISTRY_INFO BusData; - PCONFIGURATION_COMPONENT_DATA BiosKey; - ULONG Size; - PCONFIGURATION_COMPONENT_DATA BusKey; - ULONG i; - CHAR szPci[] = "PCI"; - - /* Report the PCI BIOS */ - if (FindPciBios(&BusData)) - { - /* Create new bus key */ - FldrCreateComponentKey(SystemKey, - L"MultifunctionAdapter", - *BusNumber, - AdapterClass, - MultiFunctionAdapter, - &BiosKey); - - /* Set 'Component Information' */ - FldrSetComponentInformation(BiosKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Increment bus number */ - (*BusNumber)++; - - /* Set 'Identifier' value */ - FldrSetIdentifier(BiosKey, "PCI BIOS"); - - /* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, - PartialDescriptors); - PartialResourceList = MmAllocateMemory(Size); - if (PartialResourceList == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BiosKey, PartialResourceList, Size); - MmFreeMemory(PartialResourceList); - - DetectPciIrqRoutingTable(BiosKey); - - /* Report PCI buses */ - for (i = 0; i < (ULONG)BusData.NoBuses; i++) - { - /* Create the bus key */ - FldrCreateComponentKey(SystemKey, - L"MultifunctionAdapter", - *BusNumber, - AdapterClass, - MultiFunctionAdapter, - &BusKey); - - /* Set 'Component Information' */ - FldrSetComponentInformation(BusKey, - 0x0, - 0x0, - 0xFFFFFFFF); - - /* Check if this is the first bus */ - if (i == 0) - { - /* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, - PartialDescriptors) + - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + - sizeof(PCI_REGISTRY_INFO); - PartialResourceList = MmAllocateMemory(Size); - if (!PartialResourceList) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - PartialResourceList->Version = 1; - PartialResourceList->Revision = 1; - PartialResourceList->Count = 1; - PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; - PartialDescriptor->Type = CmResourceTypeDeviceSpecific; - PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; - PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(PCI_REGISTRY_INFO); - memcpy(&PartialResourceList->PartialDescriptors[1], - &BusData, - sizeof(PCI_REGISTRY_INFO)); - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, PartialResourceList, Size); - MmFreeMemory(PartialResourceList); - } - else - { - /* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, - PartialDescriptors); - PartialResourceList = MmAllocateMemory(Size); - if (!PartialResourceList) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } - - /* Initialize resource descriptor */ - memset(PartialResourceList, 0, Size); - - /* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, PartialResourceList, Size); - MmFreeMemory(PartialResourceList); - } - - /* Increment bus number */ - (*BusNumber)++; - - /* Set 'Identifier' value */ - FldrSetIdentifier(BusKey, szPci); - } - } -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386disk.c b/reactos/boot/freeldr/freeldr/arch/amd64/i386disk.c deleted file mode 100644 index 3a0874c84d3..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/i386disk.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 - -#define NDEBUG -#include - -///////////////////////////////////////////////////////////////////////////////////////////// -// FUNCTIONS -///////////////////////////////////////////////////////////////////////////////////////////// - -BOOLEAN DiskResetController(ULONG DriveNumber) -{ - REGS RegsIn; - REGS RegsOut; - - DbgPrint((DPRINT_DISK, "DiskResetController(0x%x) DISK OPERATION FAILED -- RESETTING CONTROLLER\n", DriveNumber)); - - // BIOS Int 13h, function 0 - Reset disk system - // AH = 00h - // DL = drive (if bit 7 is set both hard disks and floppy disks reset) - // Return: - // AH = status - // CF clear if successful - // CF set on error - RegsIn.b.ah = 0x00; - RegsIn.b.dl = DriveNumber; - - // Reset the disk controller - Int386(0x13, &RegsIn, &RegsOut); - - return INT386_SUCCESS(RegsOut); -} - -BOOLEAN DiskInt13ExtensionsSupported(ULONG DriveNumber) -{ - REGS RegsIn; - REGS RegsOut; - - DbgPrint((DPRINT_DISK, "DiskInt13ExtensionsSupported()\n")); - - // IBM/MS INT 13 Extensions - INSTALLATION CHECK - // AH = 41h - // BX = 55AAh - // DL = drive (80h-FFh) - // Return: - // CF set on error (extensions not supported) - // AH = 01h (invalid function) - // CF clear if successful - // BX = AA55h if installed - // AH = major version of extensions - // 01h = 1.x - // 20h = 2.0 / EDD-1.0 - // 21h = 2.1 / EDD-1.1 - // 30h = EDD-3.0 - // AL = internal use - // CX = API subset support bitmap - // DH = extension version (v2.0+ ??? -- not present in 1.x) - // - // Bitfields for IBM/MS INT 13 Extensions API support bitmap - // Bit 0, extended disk access functions (AH=42h-44h,47h,48h) supported - // Bit 1, removable drive controller functions (AH=45h,46h,48h,49h,INT 15/AH=52h) supported - // Bit 2, enhanced disk drive (EDD) functions (AH=48h,AH=4Eh) supported - // extended drive parameter table is valid - // Bits 3-15 reserved - RegsIn.b.ah = 0x41; - RegsIn.w.bx = 0x55AA; - RegsIn.b.dl = DriveNumber; - - // Reset the disk controller - Int386(0x13, &RegsIn, &RegsOut); - - if (!INT386_SUCCESS(RegsOut)) - { - // CF set on error (extensions not supported) - return FALSE; - } - - if (RegsOut.w.bx != 0xAA55) - { - // BX = AA55h if installed - return FALSE; - } - - // Note: - // The original check is too strict because some BIOSes report that - // extended disk access functions are not suported when booting - // from a CD (e.g. Phoenix BIOS v6.00PG). Argh! -#if 0 - if (!(RegsOut.w.cx & 0x0001)) - { - // CX = API subset support bitmap - // Bit 0, extended disk access functions (AH=42h-44h,47h,48h) supported - return FALSE; - } -#endif - - // Use this relaxed check instead - if (RegsOut.w.cx == 0x0000) - { - // CX = API subset support bitmap - return FALSE; - } - - return TRUE; -} - -VOID DiskStopFloppyMotor(VOID) -{ - WRITE_PORT_UCHAR((PUCHAR)0x3F2, 0); -} - -BOOLEAN DiskGetExtendedDriveParameters(ULONG DriveNumber, PVOID Buffer, USHORT BufferSize) -{ - REGS RegsIn; - REGS RegsOut; - PUSHORT Ptr = (PUSHORT)(BIOSCALLBUFFER); - - DbgPrint((DPRINT_DISK, "DiskGetExtendedDriveParameters()\n")); - - // Initialize transfer buffer - *Ptr = BufferSize; - - // BIOS Int 13h, function 48h - Get drive parameters - // AH = 48h - // DL = drive (bit 7 set for hard disk) - // DS:SI = result buffer - // Return: - // CF set on error - // AH = status (07h) - // CF clear if successful - // AH = 00h - // DS:SI -> result buffer - RegsIn.b.ah = 0x48; - RegsIn.b.dl = DriveNumber; - RegsIn.x.ds = BIOSCALLBUFSEGMENT; // DS:SI -> result buffer - RegsIn.w.si = BIOSCALLBUFOFFSET; - - // Get drive parameters - Int386(0x13, &RegsIn, &RegsOut); - - if (!INT386_SUCCESS(RegsOut)) - { - return FALSE; - } - - memcpy(Buffer, Ptr, BufferSize); - - DbgPrint((DPRINT_DISK, "size of buffer: %x\n", Ptr[0])); - DbgPrint((DPRINT_DISK, "information flags: %x\n", Ptr[1])); - DbgPrint((DPRINT_DISK, "number of physical cylinders on drive: %u\n", *(PULONG)&Ptr[2])); - DbgPrint((DPRINT_DISK, "number of physical heads on drive: %u\n", *(PULONG)&Ptr[4])); - DbgPrint((DPRINT_DISK, "number of physical sectors per track: %u\n", *(PULONG)&Ptr[6])); - DbgPrint((DPRINT_DISK, "total number of sectors on drive: %I64u\n", *(unsigned long long*)&Ptr[8])); - DbgPrint((DPRINT_DISK, "bytes per sector: %u\n", Ptr[12])); - if (Ptr[0] >= 0x1e) - { - DbgPrint((DPRINT_DISK, "EED configuration parameters: %x:%x\n", Ptr[13], Ptr[14])); - if (Ptr[13] != 0xffff && Ptr[14] != 0xffff) - { - PUCHAR SpecPtr = (PUCHAR)(ULONG_PTR)((Ptr[13] << 4) + Ptr[14]); - DbgPrint((DPRINT_DISK, "SpecPtr: %x\n", SpecPtr)); - DbgPrint((DPRINT_DISK, "physical I/O port base address: %x\n", *(PUSHORT)&SpecPtr[0])); - DbgPrint((DPRINT_DISK, "disk-drive control port address: %x\n", *(PUSHORT)&SpecPtr[2])); - DbgPrint((DPRINT_DISK, "drive flags: %x\n", SpecPtr[4])); - DbgPrint((DPRINT_DISK, "proprietary information: %x\n", SpecPtr[5])); - DbgPrint((DPRINT_DISK, "IRQ for drive: %u\n", SpecPtr[6])); - DbgPrint((DPRINT_DISK, "sector count for multi-sector transfers: %u\n", SpecPtr[7])); - DbgPrint((DPRINT_DISK, "DMA control: %x\n", SpecPtr[8])); - DbgPrint((DPRINT_DISK, "programmed I/O control: %x\n", SpecPtr[9])); - DbgPrint((DPRINT_DISK, "drive options: %x\n", *(PUSHORT)&SpecPtr[10])); - } - } - if (Ptr[0] >= 0x42) - { - DbgPrint((DPRINT_DISK, "signature: %x\n", Ptr[15])); - } - - return TRUE; -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386rtl.c b/reactos/boot/freeldr/freeldr/arch/amd64/i386rtl.c deleted file mode 100644 index ff3ac988a37..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/i386rtl.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 - -void PcBeep(void) -{ - sound(700); - delay(200); - sound(0); -} - -void delay(unsigned msec) -{ - REGS Regs; - unsigned usec; - unsigned msec_this; - - // Int 15h AH=86h - // BIOS - WAIT (AT,PS) - // - // AH = 86h - // CX:DX = interval in microseconds - // Return: - // CF clear if successful (wait interval elapsed) - // CF set on error or AH=83h wait already in progress - // AH = status (see #00496) - - // Note: The resolution of the wait period is 977 microseconds on - // many systems because many BIOSes use the 1/1024 second fast - // interrupt from the AT real-time clock chip which is available on INT 70; - // because newer BIOSes may have much more precise timers available, it is - // not possible to use this function accurately for very short delays unless - // the precise behavior of the BIOS is known (or found through testing) - - while (msec) - { - msec_this = msec; - - if (msec_this > 4000) - { - msec_this = 4000; - } - - usec = msec_this * 1000; - - Regs.b.ah = 0x86; - Regs.w.cx = usec >> 16; - Regs.w.dx = usec & 0xffff; - Int386(0x15, &Regs, &Regs); - - msec -= msec_this; - } -} - -void sound(int freq) -{ - int scale; - - if (freq == 0) - { - WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) & ~3); - return; - } - - scale = 1193046 / freq; - WRITE_PORT_UCHAR((PUCHAR)0x43, 0xb6); - WRITE_PORT_UCHAR((PUCHAR)0x42, scale & 0xff); - WRITE_PORT_UCHAR((PUCHAR)0x42, scale >> 8); - WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) | 3); -} diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/i386vid.c b/reactos/boot/freeldr/freeldr/arch/amd64/i386vid.c deleted file mode 100644 index 1c33ee6804e..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/i386vid.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * Portions from Linux video.S - Display adapter & video mode setup, version 2.13 (14-May-99) - * Copyright (C) 1995 -- 1999 Martin Mares - * Based on the original setup.S code (C) Linus Torvalds and Mats Anderson - * - * 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 - -#define NDEBUG -#include - -typedef struct -{ - UCHAR Signature[4]; // (ret) signature ("VESA") - // (call) VESA 2.0 request signature ("VBE2"), required to receive - // version 2.0 info - USHORT VesaVersion; // VESA version number (one-digit minor version -- 0102h = v1.2) - ULONG OemNamePtr; // pointer to OEM name - // "761295520" for ATI - ULONG Capabilities; // capabilities flags (see #00078) - ULONG SupportedModeListPtr; // pointer to list of supported VESA and OEM video modes - // (list of words terminated with FFFFh) - USHORT TotalVideoMemory; // total amount of video memory in 64K blocks - - // ---VBE v1.x --- - //UCHAR Reserved[236]; - - // ---VBE v2.0 --- - USHORT OemSoftwareVersion; // OEM software version (BCD, high byte = major, low byte = minor) - ULONG VendorNamePtr; // pointer to vendor name - ULONG ProductNamePtr; // pointer to product name - ULONG ProductRevisionStringPtr; // pointer to product revision string - USHORT VBE_AF_Version; // (if capabilities bit 3 set) VBE/AF version (BCD) - // 0100h for v1.0P - ULONG AcceleratedModeListPtr; // (if capabilities bit 3 set) pointer to list of supported - // accelerated video modes (list of words terminated with FFFFh) - UCHAR Reserved[216]; // reserved for VBE implementation - UCHAR ScratchPad[256]; // OEM scratchpad (for OEM strings, etc.) -} PACKED VESA_SVGA_INFO, *PVESA_SVGA_INFO; - -// Bitfields for VESA capabilities: -// -// Bit(s) Description (Table 00078) -// 0 DAC can be switched into 8-bit mode -// 1 non-VGA controller -// 2 programmed DAC with blank bit (i.e. only during blanking interval) -// 3 (VBE v3.0) controller supports hardware stereoscopic signalling -// 3 controller supports VBE/AF v1.0P extensions -// 4 (VBE v3.0) if bit 3 set: -// =0 stereo signalling via external VESA stereo connector -// =1 stereo signalling via VESA EVC connector -// 4 (VBE/AF v1.0P) must call EnableDirectAccess to access framebuffer -// 5 (VBE/AF v1.0P) controller supports hardware mouse cursor -// 6 (VBE/AF v1.0P) controller supports hardware clipping -// 7 (VBE/AF v1.0P) controller supports transparent BitBLT -// 8-31 reserved (0) - -// Notes: The list of supported video modes is stored in the reserved -// portion of the SuperVGA information record by some implementations, -// and it may thus be necessary to either copy the mode list or use a -// different buffer for all subsequent VESA calls. Not all of the video -// modes in the list of mode numbers may be supported, e.g. if they require -// more memory than currently installed or are not supported by the -// attached monitor. Check any mode you intend to use through AX=4F01h first.. -// The 1.1 VESA document specifies 242 reserved bytes at the end, so the -// buffer should be 262 bytes to ensure that it is not overrun; for v2.0, -// the buffer should be 512 bytes. The S3 specific video modes will most -// likely follow the FFFFh terminator at the end of the standard modes. -// A search must then be made to find them, FFFFh will also terminate this -// second list. In some cases, only a "stub" VBE may be present, supporting -// only AX=4F00h; this case may be assumed if the list of supported video modes -// is empty (consisting of a single word of FFFFh) -#if 0 -static VOID BiosSetVideoFont8x16(VOID) -{ - REGS Regs; - - // Int 10h AX=1114h - // VIDEO - TEXT-MODE CHARGEN - LOAD ROM 8x16 CHARACTER SET (VGA) - // - // AX = 1114h - // BL = block to load - // Return: - // Nothing - Regs.w.ax = 0x1114; - Regs.b.bl = 0; - Int386(0x10, &Regs, &Regs); -} - -static VOID VideoSetTextCursorPosition(ULONG X, ULONG Y) -{ -} - -static ULONG VideoGetTextCursorPositionX(VOID) -{ - REGS Regs; - - // Int 10h AH=03h - // VIDEO - GET CURSOR POSITION AND SIZE - // - // AH = 03h - // BH = page number - // 0-3 in modes 2&3 - // 0-7 in modes 0&1 - // 0 in graphics modes - // Return: - // AX = 0000h (Phoenix BIOS) - // CH = start scan line - // CL = end scan line - // DH = row (00h is top) - // DL = column (00h is left) - Regs.b.ah = 0x03; - Regs.b.bh = 0x00; - Int386(0x10, &Regs, &Regs); - - return Regs.b.dl; -} - -static ULONG VideoGetTextCursorPositionY(VOID) -{ - REGS Regs; - - // Int 10h AH=03h - // VIDEO - GET CURSOR POSITION AND SIZE - // - // AH = 03h - // BH = page number - // 0-3 in modes 2&3 - // 0-7 in modes 0&1 - // 0 in graphics modes - // Return: - // AX = 0000h (Phoenix BIOS) - // CH = start scan line - // CL = end scan line - // DH = row (00h is top) - // DL = column (00h is left) - Regs.b.ah = 0x03; - Regs.b.bh = 0x00; - Int386(0x10, &Regs, &Regs); - - return Regs.b.dh; -} -#endif - -USHORT BiosIsVesaSupported(VOID) -{ - REGS Regs; - PVESA_SVGA_INFO SvgaInfo = (PVESA_SVGA_INFO)BIOSCALLBUFFER; - //USHORT* VideoModes; - //USHORT Index; - - DbgPrint((DPRINT_UI, "BiosIsVesaSupported()\n")); - - RtlZeroMemory(SvgaInfo, sizeof(VESA_SVGA_INFO)); - - // Make sure we receive version 2.0 info - SvgaInfo->Signature[0] = 'V'; - SvgaInfo->Signature[1] = 'B'; - SvgaInfo->Signature[2] = 'E'; - SvgaInfo->Signature[3] = '2'; - - // Int 10h AX=4F00h - // VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION - // - // AX = 4F00h - // ES:DI -> buffer for SuperVGA information (see #00077) - // Return: - // AL = 4Fh if function supported - // AH = status - // 00h successful - // ES:DI buffer filled - // 01h failed - // ---VBE v2.0--- - // 02h function not supported by current hardware configuration - // 03h function invalid in current video mode - // - // Determine whether VESA BIOS extensions are present and the - // capabilities supported by the display adapter - // - // Installation check;VESA SuperVGA - Regs.w.ax = 0x4F00; - Regs.w.es = BIOSCALLBUFSEGMENT; - Regs.w.di = BIOSCALLBUFOFFSET; - Int386(0x10, &Regs, &Regs); - - DbgPrint((DPRINT_UI, "AL = 0x%x\n", Regs.b.al)); - DbgPrint((DPRINT_UI, "AH = 0x%x\n", Regs.b.ah)); - - if (Regs.w.ax != 0x004F) - { - DbgPrint((DPRINT_UI, "Failed.\n")); - return 0x0000; - } - - DbgPrint((DPRINT_UI, "Supported.\n")); - DbgPrint((DPRINT_UI, "SvgaInfo->Signature[4] = %c%c%c%c\n", SvgaInfo->Signature[0], SvgaInfo->Signature[1], SvgaInfo->Signature[2], SvgaInfo->Signature[3])); - DbgPrint((DPRINT_UI, "SvgaInfo->VesaVersion = v%d.%d\n", ((SvgaInfo->VesaVersion >> 8) & 0xFF), (SvgaInfo->VesaVersion & 0xFF))); - DbgPrint((DPRINT_UI, "SvgaInfo->OemNamePtr = 0x%x\n", SvgaInfo->OemNamePtr)); - DbgPrint((DPRINT_UI, "SvgaInfo->Capabilities = 0x%x\n", SvgaInfo->Capabilities)); - DbgPrint((DPRINT_UI, "SvgaInfo->VideoMemory = %dK\n", SvgaInfo->TotalVideoMemory * 64)); - DbgPrint((DPRINT_UI, "---VBE v2.0 ---\n")); - DbgPrint((DPRINT_UI, "SvgaInfo->OemSoftwareVersion = v%d.%d\n", ((SvgaInfo->OemSoftwareVersion >> 8) & 0x0F) + (((SvgaInfo->OemSoftwareVersion >> 12) & 0x0F) * 10), (SvgaInfo->OemSoftwareVersion & 0x0F) + (((SvgaInfo->OemSoftwareVersion >> 4) & 0x0F) * 10))); - DbgPrint((DPRINT_UI, "SvgaInfo->VendorNamePtr = 0x%x\n", SvgaInfo->VendorNamePtr)); - DbgPrint((DPRINT_UI, "SvgaInfo->ProductNamePtr = 0x%x\n", SvgaInfo->ProductNamePtr)); - DbgPrint((DPRINT_UI, "SvgaInfo->ProductRevisionStringPtr = 0x%x\n", SvgaInfo->ProductRevisionStringPtr)); - DbgPrint((DPRINT_UI, "SvgaInfo->VBE/AF Version = 0x%x (BCD WORD)\n", SvgaInfo->VBE_AF_Version)); - - //DbgPrint((DPRINT_UI, "\nSupported VESA and OEM video modes:\n")); - //VideoModes = (USHORT*)SvgaInfo->SupportedModeListPtr; - //for (Index=0; VideoModes[Index]!=0xFFFF; Index++) - //{ - // DbgPrint((DPRINT_UI, "Mode %d: 0x%x\n", Index, VideoModes[Index])); - //} - - //if (SvgaInfo->VesaVersion >= 0x0200) - //{ - // DbgPrint((DPRINT_UI, "\nSupported accelerated video modes (VESA v2.0):\n")); - // VideoModes = (USHORT*)SvgaInfo->AcceleratedModeListPtr; - // for (Index=0; VideoModes[Index]!=0xFFFF; Index++) - // { - // DbgPrint((DPRINT_UI, "Mode %d: 0x%x\n", Index, VideoModes[Index])); - // } - //} - - DbgPrint((DPRINT_UI, "\n")); - - return SvgaInfo->VesaVersion; -} diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 2744e7e38ea..4fce28d60da 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -35,6 +35,12 @@ PVOID pIdt, pGdt; /* FUNCTIONS *****************************************************************/ +void +EnableA20() +{ + /* Already done */ +} + void DumpLoaderBlock() { diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/mach.c b/reactos/boot/freeldr/freeldr/arch/amd64/mach.c deleted file mode 100644 index 21ba1d4bce0..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/mach.c +++ /dev/null @@ -1,70 +0,0 @@ -/* $Id: machpc.c 32173 2008-02-07 00:43:09Z ros-arm-bringup $ - * - * FreeLoader - * - * 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 - -VOID -MachInit(const char *CmdLine) -{ -// EnableA20(); -//DbgPrint((DPRINT_MEMORY, "MachInit.\n")); - /* Setup vtbl */ - MachVtbl.ConsPutChar = PcConsPutChar; - MachVtbl.ConsKbHit = PcConsKbHit; - MachVtbl.ConsGetCh = PcConsGetCh; - MachVtbl.VideoClearScreen = PcVideoClearScreen; - MachVtbl.VideoSetDisplayMode = PcVideoSetDisplayMode; - MachVtbl.VideoGetDisplaySize = PcVideoGetDisplaySize; - MachVtbl.VideoGetBufferSize = PcVideoGetBufferSize; - MachVtbl.VideoSetTextCursorPosition = PcVideoSetTextCursorPosition; - MachVtbl.VideoSetTextCursorPosition = PcVideoSetTextCursorPosition; - MachVtbl.VideoHideShowTextCursor = PcVideoHideShowTextCursor; - MachVtbl.VideoPutChar = PcVideoPutChar; - MachVtbl.VideoCopyOffScreenBufferToVRAM = PcVideoCopyOffScreenBufferToVRAM; - MachVtbl.VideoIsPaletteFixed = PcVideoIsPaletteFixed; - MachVtbl.VideoSetPaletteColor = PcVideoSetPaletteColor; - MachVtbl.VideoGetPaletteColor = PcVideoGetPaletteColor; - MachVtbl.VideoSync = PcVideoSync; - MachVtbl.Beep = PcBeep; - MachVtbl.PrepareForReactOS = PcPrepareForReactOS; - MachVtbl.GetMemoryMap = PcMemGetMemoryMap; - MachVtbl.DiskGetBootVolume = DiskGetBootVolume; - MachVtbl.DiskGetSystemVolume = DiskGetSystemVolume; - MachVtbl.DiskGetBootPath = DiskGetBootPath; - MachVtbl.DiskGetBootDevice = DiskGetBootDevice; - MachVtbl.DiskBootingFromFloppy = DiskBootingFromFloppy; - MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath; - MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors; - MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry; - MachVtbl.DiskGetDriveGeometry = PcDiskGetDriveGeometry; - MachVtbl.DiskGetCacheableBlockCount = PcDiskGetCacheableBlockCount; - MachVtbl.RTCGetCurrentDateTime = PcRTCGetCurrentDateTime; - MachVtbl.HwDetect = PcHwDetect; -} - -VOID -PcPrepareForReactOS(IN BOOLEAN Setup) -{ - // - // On PC, prepare video and turn off the floppy motor - // -// PcVideoPrepareForReactOS(Setup); -// DiskStopFloppyMotor(); -} -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/pccons.c b/reactos/boot/freeldr/freeldr/arch/amd64/pccons.c deleted file mode 100644 index a146f01b33f..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/pccons.c +++ /dev/null @@ -1,128 +0,0 @@ -/* $Id: pccons.c 21917 2006-05-16 23:09:41Z hpoussin $ - * - * FreeLoader - * - * 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 - -#define TEXTMODE_BUFFER 0xb8000 -#define TEXTMODE_BUFFER_SIZE 0x8000 - -#define TEXT_COLS 80 -#define TEXT_LINES 25 - -VOID -PcConsPutChar(int Ch) -{ - REGS Regs; - - /* If we are displaying a CR '\n' then do a LF also */ - if ('\n' == Ch) - { - /* Display the LF */ - PcConsPutChar('\r'); - } - - /* If we are displaying a TAB '\t' then display 8 spaces ' ' */ - if ('\t' == Ch) - { - /* Display the 8 spaces ' ' */ - PcConsPutChar(' '); - PcConsPutChar(' '); - PcConsPutChar(' '); - PcConsPutChar(' '); - PcConsPutChar(' '); - PcConsPutChar(' '); - PcConsPutChar(' '); - PcConsPutChar(' '); - return; - } - - /* Int 10h AH=0Eh - * VIDEO - TELETYPE OUTPUT - * - * AH = 0Eh - * AL = character to write - * BH = page number - * BL = foreground color (graphics modes only) - */ - Regs.b.ah = 0x0E; - Regs.b.al = Ch; - Regs.w.bx = 1; - Int386(0x10, &Regs, &Regs); -} - -BOOLEAN -PcConsKbHit(VOID) -{ - REGS Regs; - - /* Int 16h AH=01h - * KEYBOARD - CHECK FOR KEYSTROKE - * - * AH = 01h - * Return: - * ZF set if no keystroke available - * ZF clear if keystroke available - * AH = BIOS scan code - * AL = ASCII character - */ - Regs.b.ah = 0x01; - Int386(0x16, &Regs, &Regs); - - return 0 == (Regs.x.eflags & I386FLAG_ZF); -} - -int -PcConsGetCh(void) -{ - REGS Regs; - static BOOLEAN ExtendedKey = FALSE; - static char ExtendedScanCode = 0; - - /* If the last time we were called an - * extended key was pressed then return - * that keys scan code. */ - if (ExtendedKey) - { - ExtendedKey = FALSE; - return ExtendedScanCode; - } - - /* Int 16h AH=00h - * KEYBOARD - GET KEYSTROKE - * - * AH = 00h - * Return: - * AH = BIOS scan code - * AL = ASCII character - */ - Regs.b.ah = 0x00; - Int386(0x16, &Regs, &Regs); - - /* Check for an extended keystroke */ - if (0 == Regs.b.al) - { - ExtendedKey = TRUE; - ExtendedScanCode = Regs.b.ah; - } - - /* Return keystroke */ - return Regs.b.al; -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/pcdisk.c b/reactos/boot/freeldr/freeldr/arch/amd64/pcdisk.c deleted file mode 100644 index cd35497cc6b..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/pcdisk.c +++ /dev/null @@ -1,455 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 - -#define NDEBUG -#include - -typedef struct -{ - UCHAR PacketSize; // 00h - Size of packet (10h or 18h) - UCHAR Reserved; // 01h - Reserved (0) - USHORT LBABlockCount; // 02h - Number of blocks to transfer (max 007Fh for Phoenix EDD) - USHORT TransferBufferOffset; // 04h - Transfer buffer offset (seg:off) - USHORT TransferBufferSegment; // Transfer buffer segment (seg:off) - ULONGLONG LBAStartBlock; // 08h - Starting absolute block number - //ULONGLONG TransferBuffer64; // 10h - (EDD-3.0, optional) 64-bit flat address of transfer buffer - // used if DWORD at 04h is FFFFh:FFFFh - // Commented since some earlier BIOSes refuse to work with - // such extended structure -} PACKED I386_DISK_ADDRESS_PACKET, *PI386_DISK_ADDRESS_PACKET; - -///////////////////////////////////////////////////////////////////////////////////////////// -// FUNCTIONS -///////////////////////////////////////////////////////////////////////////////////////////// - -static BOOLEAN PcDiskResetController(ULONG DriveNumber) -{ - REGS RegsIn; - REGS RegsOut; - - DbgPrint((DPRINT_DISK, "PcDiskResetController(0x%x) DISK OPERATION FAILED -- RESETTING CONTROLLER\n", DriveNumber)); - - // BIOS Int 13h, function 0 - Reset disk system - // AH = 00h - // DL = drive (if bit 7 is set both hard disks and floppy disks reset) - // Return: - // AH = status - // CF clear if successful - // CF set on error - RegsIn.b.ah = 0x00; - RegsIn.b.dl = DriveNumber; - - // Reset the disk controller - Int386(0x13, &RegsIn, &RegsOut); - - return INT386_SUCCESS(RegsOut); -} - -static BOOLEAN PcDiskReadLogicalSectorsLBA(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer) -{ - REGS RegsIn; - REGS RegsOut; - ULONG RetryCount; - PI386_DISK_ADDRESS_PACKET Packet = (PI386_DISK_ADDRESS_PACKET)(BIOSCALLBUFFER); - - DbgPrint((DPRINT_DISK, "PcDiskReadLogicalSectorsLBA() DriveNumber: 0x%x SectorNumber: %I64d SectorCount: %d Buffer: 0x%x\n", DriveNumber, SectorNumber, SectorCount, Buffer)); - - // BIOS int 0x13, function 42h - IBM/MS INT 13 Extensions - EXTENDED READ - RegsIn.b.ah = 0x42; // Subfunction 42h - RegsIn.b.dl = DriveNumber; // Drive number in DL (0 - floppy, 0x80 - harddisk) - RegsIn.x.ds = BIOSCALLBUFSEGMENT; // DS:SI -> disk address packet - RegsIn.w.si = BIOSCALLBUFOFFSET; - - // Setup disk address packet - RtlZeroMemory(Packet, sizeof(I386_DISK_ADDRESS_PACKET)); - Packet->PacketSize = sizeof(I386_DISK_ADDRESS_PACKET); - Packet->Reserved = 0; - Packet->LBABlockCount = SectorCount; - Packet->TransferBufferOffset = ((ULONG_PTR)Buffer) & 0x0F; - Packet->TransferBufferSegment = ((ULONG_PTR)Buffer) >> 4; - Packet->LBAStartBlock = SectorNumber; - - // BIOS int 0x13, function 42h - IBM/MS INT 13 Extensions - EXTENDED READ - // Return: - // CF clear if successful - // AH = 00h - // CF set on error - // AH = error code - // disk address packet's block count field set to the - // number of blocks successfully transferred - - // Retry 3 times - for (RetryCount=0; RetryCount<3; RetryCount++) - { - Int386(0x13, &RegsIn, &RegsOut); - - // If it worked return TRUE - if (INT386_SUCCESS(RegsOut)) - { - return TRUE; - } - // If it was a corrected ECC error then the data is still good - else if (RegsOut.b.ah == 0x11) - { - return TRUE; - } - // If it failed the do the next retry - else - { - PcDiskResetController(DriveNumber); - - continue; - } - } - - // If we get here then the read failed - DiskError("Disk Read Failed in LBA mode", RegsOut.b.ah); - - return FALSE; -} - -static BOOLEAN PcDiskReadLogicalSectorsCHS(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer) -{ - ULONG PhysicalSector; - ULONG PhysicalHead; - ULONG PhysicalTrack; - GEOMETRY DriveGeometry; - ULONG NumberOfSectorsToRead; - REGS RegsIn; - REGS RegsOut; - ULONG RetryCount; - - DbgPrint((DPRINT_DISK, "PcDiskReadLogicalSectorsCHS()\n")); - - // - // Get the drive geometry - // - if (!MachDiskGetDriveGeometry(DriveNumber, &DriveGeometry) || - DriveGeometry.Sectors == 0 || - DriveGeometry.Heads == 0) - { - return FALSE; - } - - while (SectorCount) - { - - // - // Calculate the physical disk offsets - // - PhysicalSector = 1 + (SectorNumber % DriveGeometry.Sectors); - PhysicalHead = (SectorNumber / DriveGeometry.Sectors) % DriveGeometry.Heads; - PhysicalTrack = (SectorNumber / DriveGeometry.Sectors) / DriveGeometry.Heads; - - // - // Calculate how many sectors we need to read this round - // - if (PhysicalSector > 1) - { - if (SectorCount >= (DriveGeometry.Sectors - (PhysicalSector - 1))) - NumberOfSectorsToRead = (DriveGeometry.Sectors - (PhysicalSector - 1)); - else - NumberOfSectorsToRead = SectorCount; - } - else - { - if (SectorCount >= DriveGeometry.Sectors) - NumberOfSectorsToRead = DriveGeometry.Sectors; - else - NumberOfSectorsToRead = SectorCount; - } - - // - // Make sure the read is within the geometry boundaries - // - if ((PhysicalHead >= DriveGeometry.Heads) || - (PhysicalTrack >= DriveGeometry.Cylinders) || - ((NumberOfSectorsToRead + PhysicalSector) > (DriveGeometry.Sectors + 1)) || - (PhysicalSector > DriveGeometry.Sectors)) - { - DiskError("Disk read exceeds drive geometry limits.", 0); - return FALSE; - } - - // BIOS Int 13h, function 2 - Read Disk Sectors - // AH = 02h - // AL = number of sectors to read (must be nonzero) - // CH = low eight bits of cylinder number - // CL = sector number 1-63 (bits 0-5) - // high two bits of cylinder (bits 6-7, hard disk only) - // DH = head number - // DL = drive number (bit 7 set for hard disk) - // ES:BX -> data buffer - // Return: - // CF set on error - // if AH = 11h (corrected ECC error), AL = burst length - // CF clear if successful - // AH = status - // AL = number of sectors transferred - // (only valid if CF set for some BIOSes) - RegsIn.b.ah = 0x02; - RegsIn.b.al = NumberOfSectorsToRead; - RegsIn.b.ch = (PhysicalTrack & 0xFF); - RegsIn.b.cl = (PhysicalSector + ((PhysicalTrack & 0x300) >> 2)); - RegsIn.b.dh = PhysicalHead; - RegsIn.b.dl = DriveNumber; - RegsIn.w.es = ((ULONG_PTR)Buffer) >> 4; - RegsIn.w.bx = ((ULONG_PTR)Buffer) & 0x0F; - - // - // Perform the read - // Retry 3 times - // - for (RetryCount=0; RetryCount<3; RetryCount++) - { - Int386(0x13, &RegsIn, &RegsOut); - - // If it worked break out - if (INT386_SUCCESS(RegsOut)) - { - break; - } - // If it was a corrected ECC error then the data is still good - else if (RegsOut.b.ah == 0x11) - { - break; - } - // If it failed the do the next retry - else - { - PcDiskResetController(DriveNumber); - - continue; - } - } - - // If we retried 3 times then fail - if (RetryCount >= 3) - { - DiskError("Disk Read Failed in CHS mode, after retrying 3 times", RegsOut.b.ah); - return FALSE; - } - - // I have learned that not all bioses return - // the sector read count in the AL register (at least mine doesn't) - // even if the sectors were read correctly. So instead - // of checking the sector read count we will rely solely - // on the carry flag being set on error - - Buffer = (PVOID)((ULONG_PTR)Buffer + (NumberOfSectorsToRead * DriveGeometry.BytesPerSector)); - SectorCount -= NumberOfSectorsToRead; - SectorNumber += NumberOfSectorsToRead; - } - - return TRUE; -} - -static BOOLEAN PcDiskInt13ExtensionsSupported(ULONG DriveNumber) -{ - static ULONG LastDriveNumber = 0xffffffff; - static BOOLEAN LastSupported; - REGS RegsIn; - REGS RegsOut; - - DbgPrint((DPRINT_DISK, "PcDiskInt13ExtensionsSupported()\n")); - - if (DriveNumber == LastDriveNumber) - { - DbgPrint((DPRINT_DISK, "Using cached value %s for drive 0x%x\n", LastSupported ? "TRUE" : "FALSE", DriveNumber)); - return LastSupported; - } - - // Some BIOSes report that extended disk access functions are not supported - // when booting from a CD (e.g. Phoenix BIOS v6.00PG and Insyde BIOS shipping - // with Intel Macs). Therefore we just return TRUE if we're booting from a CD - - // we can assume that all El Torito capable BIOSes support INT 13 extensions. - // We simply detect whether we're booting from CD by checking whether the drive - // number is >= 0x90. It's 0x90 on the Insyde BIOS, and 0x9F on most other BIOSes. - if (DriveNumber >= 0x90) - { - LastSupported = TRUE; - return TRUE; - } - - LastDriveNumber = DriveNumber; - - // IBM/MS INT 13 Extensions - INSTALLATION CHECK - // AH = 41h - // BX = 55AAh - // DL = drive (80h-FFh) - // Return: - // CF set on error (extensions not supported) - // AH = 01h (invalid function) - // CF clear if successful - // BX = AA55h if installed - // AH = major version of extensions - // 01h = 1.x - // 20h = 2.0 / EDD-1.0 - // 21h = 2.1 / EDD-1.1 - // 30h = EDD-3.0 - // AL = internal use - // CX = API subset support bitmap - // DH = extension version (v2.0+ ??? -- not present in 1.x) - // - // Bitfields for IBM/MS INT 13 Extensions API support bitmap - // Bit 0, extended disk access functions (AH=42h-44h,47h,48h) supported - // Bit 1, removable drive controller functions (AH=45h,46h,48h,49h,INT 15/AH=52h) supported - // Bit 2, enhanced disk drive (EDD) functions (AH=48h,AH=4Eh) supported - // extended drive parameter table is valid - // Bits 3-15 reserved - RegsIn.b.ah = 0x41; - RegsIn.w.bx = 0x55AA; - RegsIn.b.dl = DriveNumber; - - // Reset the disk controller - Int386(0x13, &RegsIn, &RegsOut); - - if (!INT386_SUCCESS(RegsOut)) - { - // CF set on error (extensions not supported) - LastSupported = FALSE; - return FALSE; - } - - if (RegsOut.w.bx != 0xAA55) - { - // BX = AA55h if installed - LastSupported = FALSE; - return FALSE; - } - - if (!(RegsOut.w.cx & 0x0001)) - { - // CX = API subset support bitmap - // Bit 0, extended disk access functions (AH=42h-44h,47h,48h) supported - printf("Suspicious API subset support bitmap 0x%x on device 0x%lx\n", RegsOut.w.cx, DriveNumber); - LastSupported = FALSE; - return FALSE; - } - - LastSupported = TRUE; - return TRUE; -} - -BOOLEAN PcDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer) -{ - - DbgPrint((DPRINT_DISK, "PcDiskReadLogicalSectors() DriveNumber: 0x%x SectorNumber: %I64d SectorCount: %d Buffer: 0x%x\n", DriveNumber, SectorNumber, SectorCount, Buffer)); - - // - // Check to see if it is a fixed disk drive - // If so then check to see if Int13 extensions work - // If they do then use them, otherwise default back to BIOS calls - // - if ((DriveNumber >= 0x80) && PcDiskInt13ExtensionsSupported(DriveNumber)) - { - DbgPrint((DPRINT_DISK, "Using Int 13 Extensions for read. PcDiskInt13ExtensionsSupported(%d) = %s\n", DriveNumber, PcDiskInt13ExtensionsSupported(DriveNumber) ? "TRUE" : "FALSE")); - - // - // LBA is easy, nothing to calculate - // Just do the read - // - return PcDiskReadLogicalSectorsLBA(DriveNumber, SectorNumber, SectorCount, Buffer); - } - else - { - // LBA is not supported default to the CHS calls - return PcDiskReadLogicalSectorsCHS(DriveNumber, SectorNumber, SectorCount, Buffer); - } - - return TRUE; -} - -BOOLEAN -PcDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY Geometry) -{ - REGS RegsIn; - REGS RegsOut; - ULONG Cylinders; - - DbgPrint((DPRINT_DISK, "DiskGetDriveGeometry()\n")); - - /* BIOS Int 13h, function 08h - Get drive parameters - * AH = 08h - * DL = drive (bit 7 set for hard disk) - * ES:DI = 0000h:0000h to guard against BIOS bugs - * Return: - * CF set on error - * AH = status (07h) - * CF clear if successful - * AH = 00h - * AL = 00h on at least some BIOSes - * BL = drive type (AT/PS2 floppies only) - * CH = low eight bits of maximum cylinder number - * CL = maximum sector number (bits 5-0) - * high two bits of maximum cylinder number (bits 7-6) - * DH = maximum head number - * DL = number of drives - * ES:DI -> drive parameter table (floppies only) - */ - RegsIn.b.ah = 0x08; - RegsIn.b.dl = DriveNumber; - RegsIn.w.es = 0x0000; - RegsIn.w.di = 0x0000; - - /* Get drive parameters */ - Int386(0x13, &RegsIn, &RegsOut); - - if (! INT386_SUCCESS(RegsOut)) - { - return FALSE; - } - - Cylinders = (RegsOut.b.cl & 0xC0) << 2; - Cylinders += RegsOut.b.ch; - Cylinders++; - Geometry->Cylinders = Cylinders; - Geometry->Heads = RegsOut.b.dh + 1; - Geometry->Sectors = RegsOut.b.cl & 0x3F; - Geometry->BytesPerSector = 512; /* Just assume 512 bytes per sector */ - - return TRUE; -} - -ULONG -PcDiskGetCacheableBlockCount(ULONG DriveNumber) -{ - GEOMETRY Geometry; - - /* If LBA is supported then the block size will be 64 sectors (32k) - * If not then the block size is the size of one track */ - if (DiskInt13ExtensionsSupported(DriveNumber)) - { - return 64; - } - /* Get the disk geometry - * If this fails then we will just return 1 sector to be safe */ - else if (! PcDiskGetDriveGeometry(DriveNumber, &Geometry)) - { - return 1; - } - else - { - return Geometry.Sectors; - } -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/pcmem.c b/reactos/boot/freeldr/freeldr/arch/amd64/pcmem.c deleted file mode 100644 index 914a363cc9a..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/pcmem.c +++ /dev/null @@ -1,249 +0,0 @@ -/* $Id: pcmem.c 24238 2006-09-23 16:50:39Z fireball $ - * - * FreeLoader - * - * 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. - * - * Note: Most of this code comes from the old file "i386mem.c", which - * was Copyright (C) 1998-2003 Brian Palmer - */ - -#include - -#define NDEBUG -#include - -static ULONG -PcMemGetExtendedMemorySize(VOID) -{ - REGS RegsIn; - REGS RegsOut; - ULONG MemorySize; - - DbgPrint((DPRINT_MEMORY, "GetExtendedMemorySize()\n")); - - /* Int 15h AX=E801h - * Phoenix BIOS v4.0 - GET MEMORY SIZE FOR >64M CONFIGURATIONS - * - * AX = E801h - * Return: - * CF clear if successful - * AX = extended memory between 1M and 16M, in K (max 3C00h = 15MB) - * BX = extended memory above 16M, in 64K blocks - * CX = configured memory 1M to 16M, in K - * DX = configured memory above 16M, in 64K blocks - * CF set on error - */ - RegsIn.w.ax = 0xE801; - Int386(0x15, &RegsIn, &RegsOut); - - DbgPrint((DPRINT_MEMORY, "Int15h AX=E801h\n")); - DbgPrint((DPRINT_MEMORY, "AX = 0x%x\n", RegsOut.w.ax)); - DbgPrint((DPRINT_MEMORY, "BX = 0x%x\n", RegsOut.w.bx)); - DbgPrint((DPRINT_MEMORY, "CX = 0x%x\n", RegsOut.w.cx)); - DbgPrint((DPRINT_MEMORY, "DX = 0x%x\n", RegsOut.w.dx)); - DbgPrint((DPRINT_MEMORY, "CF set = %s\n\n", (RegsOut.x.eflags & I386FLAG_CF) ? "TRUE" : "FALSE")); - - if (INT386_SUCCESS(RegsOut)) - { - /* If AX=BX=0000h the use CX and DX */ - if (RegsOut.w.ax == 0) - { - /* Return extended memory size in K */ - MemorySize = RegsOut.w.dx * 64; - MemorySize += RegsOut.w.cx; - return MemorySize; - } - else - { - /* Return extended memory size in K */ - MemorySize = RegsOut.w.bx * 64; - MemorySize += RegsOut.w.ax; - return MemorySize; - } - } - - /* If we get here then Int15 Func E801h didn't work */ - /* So try Int15 Func 88h */ - - /* Int 15h AH=88h - * SYSTEM - GET EXTENDED MEMORY SIZE (286+) - * - * AH = 88h - * Return: - * CF clear if successful - * AX = number of contiguous KB starting at absolute address 100000h - * CF set on error - * AH = status - * 80h invalid command (PC,PCjr) - * 86h unsupported function (XT,PS30) - */ - RegsIn.b.ah = 0x88; - Int386(0x15, &RegsIn, &RegsOut); - - DbgPrint((DPRINT_MEMORY, "Int15h AH=88h\n")); - DbgPrint((DPRINT_MEMORY, "AX = 0x%x\n", RegsOut.w.ax)); - DbgPrint((DPRINT_MEMORY, "CF set = %s\n\n", (RegsOut.x.eflags & I386FLAG_CF) ? "TRUE" : "FALSE")); - - if (INT386_SUCCESS(RegsOut) && RegsOut.w.ax != 0) - { - MemorySize = RegsOut.w.ax; - return MemorySize; - } - - /* If we get here then Int15 Func 88h didn't work */ - /* So try reading the CMOS */ - WRITE_PORT_UCHAR((PUCHAR)0x70, 0x31); - MemorySize = READ_PORT_UCHAR((PUCHAR)0x71); - MemorySize = (MemorySize & 0xFFFF); - MemorySize = (MemorySize << 8); - - DbgPrint((DPRINT_MEMORY, "Int15h Failed\n")); - DbgPrint((DPRINT_MEMORY, "CMOS reports: 0x%x\n", MemorySize)); - - return MemorySize; -} - -static ULONG -PcMemGetConventionalMemorySize(VOID) -{ - REGS Regs; - - DbgPrint((DPRINT_MEMORY, "GetConventionalMemorySize()\n")); - - /* Int 12h - * BIOS - GET MEMORY SIZE - * - * Return: - * AX = kilobytes of contiguous memory starting at absolute address 00000h - * - * This call returns the contents of the word at 0040h:0013h; - * in PC and XT, this value is set from the switches on the motherboard - */ - Regs.w.ax = 0; - Int386(0x12, &Regs, &Regs); - - DbgPrint((DPRINT_MEMORY, "Int12h\n")); - DbgPrint((DPRINT_MEMORY, "AX = 0x%x\n\n", Regs.w.ax)); - - return (ULONG)Regs.w.ax; -} - -static ULONG -PcMemGetBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize) -{ - REGS Regs; - ULONG MapCount; - - DbgPrint((DPRINT_MEMORY, "GetBiosMemoryMap()\n")); - - /* Int 15h AX=E820h - * Newer BIOSes - GET SYSTEM MEMORY MAP - * - * AX = E820h - * EAX = 0000E820h - * EDX = 534D4150h ('SMAP') - * EBX = continuation value or 00000000h to start at beginning of map - * ECX = size of buffer for result, in bytes (should be >= 20 bytes) - * ES:DI -> buffer for result - * Return: - * CF clear if successful - * EAX = 534D4150h ('SMAP') - * ES:DI buffer filled - * EBX = next offset from which to copy or 00000000h if all done - * ECX = actual length returned in bytes - * CF set on error - * AH = error code (86h) - */ - Regs.x.eax = 0x0000E820; - Regs.x.edx = 0x534D4150; /* ('SMAP') */ - Regs.x.ebx = 0x00000000; - Regs.x.ecx = sizeof(BIOS_MEMORY_MAP); - Regs.w.es = BIOSCALLBUFSEGMENT; - Regs.w.di = BIOSCALLBUFOFFSET; - for (MapCount = 0; MapCount < MaxMemoryMapSize; MapCount++) - { - Int386(0x15, &Regs, &Regs); - - DbgPrint((DPRINT_MEMORY, "Memory Map Entry %d\n", MapCount)); - DbgPrint((DPRINT_MEMORY, "Int15h AX=E820h\n")); - DbgPrint((DPRINT_MEMORY, "EAX = 0x%x\n", Regs.x.eax)); - DbgPrint((DPRINT_MEMORY, "EBX = 0x%x\n", Regs.x.ebx)); - DbgPrint((DPRINT_MEMORY, "ECX = 0x%x\n", Regs.x.ecx)); - DbgPrint((DPRINT_MEMORY, "CF set = %s\n", (Regs.x.eflags & I386FLAG_CF) ? "TRUE" : "FALSE")); - - /* If the BIOS didn't return 'SMAP' in EAX then - * it doesn't support this call */ - if (Regs.x.eax != 0x534D4150) - { - break; - } - - /* Copy data to caller's buffer */ - RtlCopyMemory(&BiosMemoryMap[MapCount], (PVOID)BIOSCALLBUFFER, Regs.x.ecx); - - DbgPrint((DPRINT_MEMORY, "BaseAddress: 0x%p\n", (PVOID)BiosMemoryMap[MapCount].BaseAddress)); - DbgPrint((DPRINT_MEMORY, "Length: 0x%p\n", (PVOID)BiosMemoryMap[MapCount].Length)); - DbgPrint((DPRINT_MEMORY, "Type: 0x%x\n", BiosMemoryMap[MapCount].Type)); - DbgPrint((DPRINT_MEMORY, "Reserved: 0x%x\n", BiosMemoryMap[MapCount].Reserved)); - DbgPrint((DPRINT_MEMORY, "\n")); - - /* If the continuation value is zero or the - * carry flag is set then this was - * the last entry so we're done */ - if (Regs.x.ebx == 0x00000000 || !INT386_SUCCESS(Regs)) - { - MapCount++; - DbgPrint((DPRINT_MEMORY, "End Of System Memory Map!\n\n")); - break; - } - - /* Setup the registers for the next call */ - Regs.x.eax = 0x0000E820; - Regs.x.edx = 0x534D4150; /* ('SMAP') */ - /* Regs.x.ebx = 0x00000001; Continuation value already set by the BIOS */ - Regs.x.ecx = sizeof(BIOS_MEMORY_MAP); - Regs.w.es = BIOSCALLBUFSEGMENT; - Regs.w.di = BIOSCALLBUFOFFSET; - } - - return MapCount; -} - -ULONG -PcMemGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize) -{ - ULONG EntryCount; - - EntryCount = PcMemGetBiosMemoryMap(BiosMemoryMap, MaxMemoryMapSize); - - /* If the BIOS didn't provide a memory map, synthesize one */ - if (0 == EntryCount && 2 <= MaxMemoryMapSize) - { - /* Conventional memory */ - BiosMemoryMap[0].BaseAddress = 0; - BiosMemoryMap[0].Length = PcMemGetConventionalMemorySize() * 1024; - BiosMemoryMap[0].Type = BiosMemoryUsable; - /* Extended memory */ - BiosMemoryMap[1].BaseAddress = 1024 * 1024; - BiosMemoryMap[1].Length = PcMemGetExtendedMemorySize() * 1024; - BiosMemoryMap[1].Type = BiosMemoryUsable; - EntryCount = 2; - } - - return EntryCount; -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/pcrtc.c b/reactos/boot/freeldr/freeldr/arch/amd64/pcrtc.c deleted file mode 100644 index cbd3803f95a..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/pcrtc.c +++ /dev/null @@ -1,104 +0,0 @@ -/* $Id: pcrtc.c 21339 2006-03-18 22:09:16Z peterw $ - * - * FreeLoader - * - * 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 - -#define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f)) - -VOID -PcRTCGetCurrentDateTime(PULONG Year, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second) -{ - REGS Regs; - - if (NULL != Year || NULL != Month || NULL != Day) - { - /* Some BIOSes, such es the 1998/07/25 system ROM - * in the Compaq Deskpro EP/SB, leave CF unchanged - * if successful, so CF should be cleared before - * calling this function. */ - __asm__ ("clc"); - - /* Int 1Ah AH=04h - * TIME - GET REAL-TIME CLOCK DATE (AT,XT286,PS) - * - * AH = 04h - * CF clear to avoid bug - * Return: - * CF clear if successful - * CH = century (BCD) - * CL = year (BCD) - * DH = month (BCD) - * DL = day (BCD) - * CF set on error - */ - Regs.b.ah = 0x04; - Int386(0x1A, &Regs, &Regs); - - if (NULL != Year) - { - *Year = 100 * BCD_INT(Regs.b.ch) + BCD_INT(Regs.b.cl); - } - if (NULL != Month) - { - *Month = BCD_INT(Regs.b.dh); - } - if (NULL != Day) - { - *Day = BCD_INT(Regs.b.dl); - } - } - - if (NULL != Hour || NULL != Minute || NULL != Second) - { - /* Some BIOSes leave CF unchanged if successful, - * so CF should be cleared before calling this function. */ - __asm__ ("clc"); - - /* Int 1Ah AH=02h - * TIME - GET REAL-TIME CLOCK TIME (AT,XT286,PS) - * - * AH = 02h - * CF clear to avoid bug - * Return: - * CF clear if successful - * CH = hour (BCD) - * CL = minutes (BCD) - * DH = seconds (BCD) - * DL = daylight savings flag (00h standard time, 01h daylight time) - * CF set on error (i.e. clock not running or in middle of update) - */ - Regs.b.ah = 0x02; - Int386(0x1A, &Regs, &Regs); - - if (NULL != Hour) - { - *Hour = BCD_INT(Regs.b.ch); - } - if (NULL != Minute) - { - *Minute = BCD_INT(Regs.b.cl); - } - if (NULL != Second) - { - *Second = BCD_INT(Regs.b.dh); - } - } -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/pcvideo.c b/reactos/boot/freeldr/freeldr/arch/amd64/pcvideo.c deleted file mode 100644 index fd3668c38b4..00000000000 --- a/reactos/boot/freeldr/freeldr/arch/amd64/pcvideo.c +++ /dev/null @@ -1,1122 +0,0 @@ -/* $Id: pcvideo.c 31712 2008-01-11 11:35:09Z hpoussin $ - * - * FreeLoader - * - * 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 - -#define NDEBUG -#include - -#define VIDEOPORT_PALETTE_READ 0x03C7 -#define VIDEOPORT_PALETTE_WRITE 0x03C8 -#define VIDEOPORT_PALETTE_DATA 0x03C9 -#define VIDEOPORT_VERTICAL_RETRACE 0x03DA - -#define VIDEOVGA_MEM_ADDRESS 0xA0000 -#define VIDEOTEXT_MEM_ADDRESS 0xB8000 -#define VIDEOTEXT_MEM_SIZE 0x8000 - -#define VIDEOCARD_CGA_OR_OTHER 0 -#define VIDEOCARD_EGA 1 -#define VIDEOCARD_VGA 2 - -#define VIDEOMODE_NORMAL_TEXT 0 -#define VIDEOMODE_EXTENDED_TEXT 1 -#define VIDEOMODE_80X28 0x501C -#define VIDEOMODE_80X30 0x501E -#define VIDEOMODE_80X34 0x5022 -#define VIDEOMODE_80X43 0x502B -#define VIDEOMODE_80X60 0x503C -#define VIDEOMODE_132X25 0x8419 -#define VIDEOMODE_132X43 0x842B -#define VIDEOMODE_132X50 0x8432 -#define VIDEOMODE_132X60 0x843C - -#define VERTRES_200_SCANLINES 0x00 -#define VERTRES_350_SCANLINES 0x01 -#define VERTRES_400_SCANLINES 0x02 - -typedef struct -{ - USHORT ModeAttributes; /* mode attributes (see #00080) */ - UCHAR WindowAttributesA; /* window attributes, window A (see #00081) */ - UCHAR WindowsAttributesB; /* window attributes, window B (see #00081) */ - USHORT WindowGranularity; /* window granularity in KB */ - USHORT WindowSize; /* window size in KB */ - USHORT WindowAStartSegment; /* start segment of window A (0000h if not supported) */ - USHORT WindowBStartSegment; /* start segment of window B (0000h if not supported) */ - ULONG WindowPositioningFunction; /* -> FAR window positioning function (equivalent to AX=4F05h) */ - USHORT BytesPerScanLine; /* bytes per scan line */ - /* ---remainder is optional for VESA modes in v1.0/1.1, needed for OEM modes--- */ - USHORT WidthInPixels; /* width in pixels (graphics) or characters (text) */ - USHORT HeightInPixels; /* height in pixels (graphics) or characters (text) */ - UCHAR CharacterWidthInPixels; /* width of character cell in pixels */ - UCHAR CharacterHeightInPixels; /* height of character cell in pixels */ - UCHAR NumberOfMemoryPlanes; /* number of memory planes */ - UCHAR BitsPerPixel; /* number of bits per pixel */ - UCHAR NumberOfBanks; /* number of banks */ - UCHAR MemoryModel; /* memory model type (see #00082) */ - UCHAR BankSize; /* size of bank in KB */ - UCHAR NumberOfImagePanes; /* number of image pages (less one) that will fit in video RAM */ - UCHAR Reserved1; /* reserved (00h for VBE 1.0-2.0, 01h for VBE 3.0) */ - /* ---VBE v1.2+ --- */ - UCHAR RedMaskSize; /* red mask size */ - UCHAR RedMaskPosition; /* red field position */ - UCHAR GreenMaskSize; /* green mask size */ - UCHAR GreenMaskPosition; /* green field size */ - UCHAR BlueMaskSize; /* blue mask size */ - UCHAR BlueMaskPosition; /* blue field size */ - UCHAR ReservedMaskSize; /* reserved mask size */ - UCHAR ReservedMaskPosition; /* reserved mask position */ - UCHAR DirectColorModeInfo; /* direct color mode info */ - /* bit 0:Color ramp is programmable */ - /* bit 1:Bytes in reserved field may be used by application */ - /* ---VBE v2.0+ --- */ - ULONG LinearVideoBufferAddress; /* physical address of linear video buffer */ - ULONG OffscreenMemoryPointer; /* pointer to start of offscreen memory */ - USHORT OffscreenMemorySize; /* KB of offscreen memory */ - /* ---VBE v3.0 --- */ - USHORT LinearBytesPerScanLine; /* bytes per scan line in linear modes */ - UCHAR BankedNumberOfImages; /* number of images (less one) for banked video modes */ - UCHAR LinearNumberOfImages; /* number of images (less one) for linear video modes */ - UCHAR LinearRedMaskSize; /* linear modes:Size of direct color red mask (in bits) */ - UCHAR LinearRedMaskPosition; /* linear modes:Bit position of red mask LSB (e.g. shift count) */ - UCHAR LinearGreenMaskSize; /* linear modes:Size of direct color green mask (in bits) */ - UCHAR LinearGreenMaskPosition; /* linear modes:Bit position of green mask LSB (e.g. shift count) */ - UCHAR LinearBlueMaskSize; /* linear modes:Size of direct color blue mask (in bits) */ - UCHAR LinearBlueMaskPosition; /* linear modes:Bit position of blue mask LSB (e.g. shift count) */ - UCHAR LinearReservedMaskSize; /* linear modes:Size of direct color reserved mask (in bits) */ - UCHAR LinearReservedMaskPosition; /* linear modes:Bit position of reserved mask LSB */ - ULONG MaximumPixelClock; /* maximum pixel clock for graphics video mode, in Hz */ - UCHAR Reserved2[190]; /* 190 BYTEs reserved (0) */ -} PACKED SVGA_MODE_INFORMATION, *PSVGA_MODE_INFORMATION; - -static ULONG BiosVideoMode; /* Current video mode as known by BIOS */ -static ULONG ScreenWidth = 80; /* Screen Width in characters */ -static ULONG ScreenHeight = 25; /* Screen Height in characters */ -static ULONG BytesPerScanLine = 160; /* Number of bytes per scanline (delta) */ -static VIDEODISPLAYMODE DisplayMode = VideoTextMode; /* Current display mode */ -static BOOLEAN VesaVideoMode = FALSE; /* Are we using a VESA mode? */ -static SVGA_MODE_INFORMATION VesaVideoModeInformation; /* Only valid when in VESA mode */ -static ULONG CurrentMemoryBank = 0; /* Currently selected VESA bank */ - -static ULONG -PcVideoDetectVideoCard(VOID) -{ - REGS Regs; - - /* Int 10h AH=12h BL=10h - * VIDEO - ALTERNATE FUNCTION SELECT (PS,EGA,VGA,MCGA) - GET EGA INFO - * - * AH = 12h - * BL = 10h - * Return: - * BH = video state - * 00h color mode in effect (I/O port 3Dxh) - * 01h mono mode in effect (I/O port 3Bxh) - * BL = installed memory (00h = 64K, 01h = 128K, 02h = 192K, 03h = 256K) - * CH = feature connector bits - * CL = switch settings - * AH destroyed (at least by Tseng ET4000 BIOS v8.00n) - * - * Installation check;EGA - */ - Regs.b.ah = 0x12; - Regs.b.bl = 0x10; - Int386(0x10, &Regs, &Regs); - - /* If BL is still equal to 0x10 then there is no EGA/VGA present */ - if (0x10 == Regs.b.bl) - { - return VIDEOCARD_CGA_OR_OTHER; - } - - /* Int 10h AX=1A00h - * VIDEO - GET DISPLAY COMBINATION CODE (PS,VGA/MCGA) - * - * AX = 1A00h - * Return: - * AL = 1Ah if function was supported - * BL = active display code - * BH = alternate display code - * - * This function is commonly used to check for the presence of a VGA. - * - * Installation check;VGA - * - * Values for display combination code: - * 00h no display - * 01h monochrome adapter w/ monochrome display - * 02h CGA w/ color display - * 03h reserved - * 04h EGA w/ color display - * 05h EGA w/ monochrome display - * 06h PGA w/ color display - * 07h VGA w/ monochrome analog display - * 08h VGA w/ color analog display - * 09h reserved - * 0Ah MCGA w/ digital color display - * 0Bh MCGA w/ monochrome analog display - * 0Ch MCGA w/ color analog display - * FFh unknown display type - */ - Regs.b.ah = 0x12; - Regs.b.bl = 0x10; - Int386(0x10, &Regs, &Regs); - - if (0x1a == Regs.b.al) - { - return VIDEOCARD_VGA; - } - else - { - return VIDEOCARD_EGA; - } -} - -static VOID PcVideoSetBiosMode(ULONG VideoMode) -{ - REGS Regs; - - /* Int 10h AH=00h - * VIDEO - SET VIDEO MODE - * - * AH = 00h - * AL = desired video mode - * Return: - * AL = video mode flag (Phoenix, AMI BIOS) - * 20h mode > 7 - * 30h modes 0-5 and 7 - * 3Fh mode 6 - * AL = CRT controller mode byte (Phoenix 386 BIOS v1.10) - */ - Regs.b.ah = 0x00; - Regs.b.al = VideoMode; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoSetFont8x8(VOID) -{ - REGS Regs; - - /* Int 10h AX=1112h - * VIDEO - TEXT-MODE CHARGEN - LOAD ROM 8x8 DBL-DOT PATTERNS (PS,EGA,VGA) - * - * AX = 1112h - * BL = block to load - * Return: - * Nothing - */ - Regs.w.ax = 0x1112; - Regs.b.bl = 0x00; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoSetFont8x14(VOID) -{ - REGS Regs; - - /* Int 10h AX=1111h - * VIDEO - TEXT-MODE CHARGEN - LOAD ROM MONOCHROME PATTERNS (PS,EGA,VGA) - * - * AX = 1111h - * BL = block to load - * Return: - * Nothing - */ - Regs.w.ax = 0x1111; - Regs.b.bl = 0; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoSelectAlternatePrintScreen(VOID) -{ - REGS Regs; - - /* Int 10h AH=12h BL=20h - * VIDEO - ALTERNATE FUNCTION SELECT (PS,EGA,VGA,MCGA) - ALTERNATE PRTSC - * - * AH = 12h - * BL = 20h select alternate print screen routine - * Return: - * Nothing - * - * Installs a PrtSc routine from the video card's BIOS to replace the - * default PrtSc handler from the ROM BIOS, which usually does not - * understand screen heights other than 25 lines. - * - * Some adapters disable print-screen instead of enhancing it. - */ - Regs.b.ah = 0x12; - Regs.b.bl = 0x20; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoDisableCursorEmulation(VOID) -{ - REGS Regs; - - /* Int 10h AH=12h BL=34h - * VIDEO - ALTERNATE FUNCTION SELECT (VGA) - CURSOR EMULATION - * - * AH = 12h - * BL = 34h - * AL = new state - * 00h enable alphanumeric cursor emulation - * 01h disable alphanumeric cursor emulation - * Return: - * AL = 12h if function supported - * - * Specify whether the BIOS should automatically remap cursor start/end - * according to the current character height in text modes. - */ - Regs.b.ah = 0x12; - Regs.b.bl = 0x34; - Regs.b.al = 0x01; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoDefineCursor(ULONG StartScanLine, ULONG EndScanLine) -{ - REGS Regs; - - /* Int 10h AH=01h - * VIDEO - SET TEXT-MODE CURSOR SHAPE - * - * AH = 01h - * CH = cursor start and options - * CL = bottom scan line containing cursor (bits 0-4) - * Return: - * Nothing - * - * Specify the starting and ending scan lines to be occupied - * by the hardware cursor in text modes. - * - * AMI 386 BIOS and AST Premier 386 BIOS will lock up the - * system if AL is not equal to the current video mode. - * - * Bitfields for cursor start and options: - * - * Bit(s) Description - * 7 should be zero - * 6,5 cursor blink - * (00=normal, 01=invisible, 10=erratic, 11=slow). - * (00=normal, other=invisible on EGA/VGA) - * 4-0 topmost scan line containing cursor - */ - Regs.b.ah = 0x01; - Regs.b.al = 0x03; - Regs.b.ch = StartScanLine; - Regs.b.cl = EndScanLine; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoSetVerticalResolution(ULONG ScanLines) -{ - REGS Regs; - - /* Int 10h AH=12h BL=30h - * VIDEO - ALTERNATE FUNCTION SELECT (VGA) - SELECT VERTICAL RESOLUTION - * - * AH = 12h - * BL = 30h - * AL = vertical resolution - * 00h 200 scan lines - * 01h 350 scan lines - * 02h 400 scan lines - * Return: - * AL = 12h if function supported - * - * Specifiy the number of scan lines used to display text modes. - * - * The specified resolution will take effect on the next mode set. - */ - Regs.b.ah = 0x12; - Regs.b.bl = 0x30; - Regs.b.al = ScanLines; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoSet480ScanLines(VOID) -{ - INT_PTR CRTC; - - /* Read CRTC port */ - CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC); - - if (CRTC & 1) - { - CRTC = 0x3D4; - } - else - { - CRTC = 0x3B4; - } - - /* Vertical sync end (also unlocks CR0-7) */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x11); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x0C); - - /* Vertical total */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x06); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x0B); - - /* (vertical) overflow */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x07); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x3E); - - /* Vertical sync start */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x10); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xEA); - - /* Vertical display end */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x12); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xDF); - - /* Vertical blank start */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x15); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xE7); - - /* Vertical blank end */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x16); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x04); - - /* Misc output register (read) */ - CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC); - - /* Preserve clock select bits and color bit */ - CRTC = (CRTC & 0x0D); - /* Set correct sync polarity */ - CRTC = (CRTC | 0xE2); - - /* (write) */ - WRITE_PORT_UCHAR((PUCHAR)0x03C2, CRTC); -} - -static VOID -PcVideoSetDisplayEnd(VOID) -{ - INT_PTR CRTC; - - /* Read CRTC port */ - CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC); - - if (CRTC & 1) - { - CRTC = 0x3D4; - } - else - { - CRTC = 0x3B4; - } - - /* Vertical display end */ - WRITE_PORT_UCHAR((PUCHAR)CRTC, 0x12); - WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xDF); -} - -static BOOLEAN -PcVideoVesaGetSVGAModeInformation(USHORT Mode, PSVGA_MODE_INFORMATION ModeInformation) -{ - REGS Regs; - - RtlZeroMemory((PVOID)BIOSCALLBUFFER, 256); - - /* VESA SuperVGA BIOS - GET SuperVGA MODE INFORMATION - * AX = 4F01h - * CX = SuperVGA video mode (see #04082 for bitfields) - * ES:DI -> 256-byte buffer for mode information (see #00079) - * Return: - * AL = 4Fh if function supported - * AH = status - * 00h successful - * ES:DI buffer filled - * 01h failed - * - * Desc: Determine the attributes of the specified video mode - * - * Note: While VBE 1.1 and higher will zero out all unused bytes - * of the buffer, v1.0 did not, so applications that want to be - * backward compatible should clear the buffer before calling - */ - Regs.w.ax = 0x4F01; - Regs.w.cx = Mode; - Regs.w.es = BIOSCALLBUFSEGMENT; - Regs.w.di = BIOSCALLBUFOFFSET; - Int386(0x10, &Regs, &Regs); - - if (Regs.w.ax != 0x004F) - { - return FALSE; - } - - RtlCopyMemory(ModeInformation, (PVOID)BIOSCALLBUFFER, sizeof(SVGA_MODE_INFORMATION)); - - DbgPrint((DPRINT_UI, "\n")); - DbgPrint((DPRINT_UI, "BiosVesaGetSVGAModeInformation() mode 0x%x\n", Mode)); - DbgPrint((DPRINT_UI, "ModeAttributes = 0x%x\n", ModeInformation->ModeAttributes)); - DbgPrint((DPRINT_UI, "WindowAttributesA = 0x%x\n", ModeInformation->WindowAttributesA)); - DbgPrint((DPRINT_UI, "WindowAttributesB = 0x%x\n", ModeInformation->WindowsAttributesB)); - DbgPrint((DPRINT_UI, "WindowGranularity = %dKB\n", ModeInformation->WindowGranularity)); - DbgPrint((DPRINT_UI, "WindowSize = %dKB\n", ModeInformation->WindowSize)); - DbgPrint((DPRINT_UI, "WindowAStartSegment = 0x%x\n", ModeInformation->WindowAStartSegment)); - DbgPrint((DPRINT_UI, "WindowBStartSegment = 0x%x\n", ModeInformation->WindowBStartSegment)); - DbgPrint((DPRINT_UI, "WindowPositioningFunction = 0x%x\n", ModeInformation->WindowPositioningFunction)); - DbgPrint((DPRINT_UI, "BytesPerScanLine = %d\n", ModeInformation->BytesPerScanLine)); - DbgPrint((DPRINT_UI, "WidthInPixels = %d\n", ModeInformation->WidthInPixels)); - DbgPrint((DPRINT_UI, "HeightInPixels = %d\n", ModeInformation->HeightInPixels)); - DbgPrint((DPRINT_UI, "CharacterWidthInPixels = %d\n", ModeInformation->CharacterWidthInPixels)); - DbgPrint((DPRINT_UI, "CharacterHeightInPixels = %d\n", ModeInformation->CharacterHeightInPixels)); - DbgPrint((DPRINT_UI, "NumberOfMemoryPlanes = %d\n", ModeInformation->NumberOfMemoryPlanes)); - DbgPrint((DPRINT_UI, "BitsPerPixel = %d\n", ModeInformation->BitsPerPixel)); - DbgPrint((DPRINT_UI, "NumberOfBanks = %d\n", ModeInformation->NumberOfBanks)); - DbgPrint((DPRINT_UI, "MemoryModel = %d\n", ModeInformation->MemoryModel)); - DbgPrint((DPRINT_UI, "BankSize = %d\n", ModeInformation->BankSize)); - DbgPrint((DPRINT_UI, "NumberOfImagePlanes = %d\n", ModeInformation->NumberOfImagePanes)); - DbgPrint((DPRINT_UI, "---VBE v1.2+ ---\n")); - DbgPrint((DPRINT_UI, "RedMaskSize = %d\n", ModeInformation->RedMaskSize)); - DbgPrint((DPRINT_UI, "RedMaskPosition = %d\n", ModeInformation->RedMaskPosition)); - DbgPrint((DPRINT_UI, "GreenMaskSize = %d\n", ModeInformation->GreenMaskSize)); - DbgPrint((DPRINT_UI, "GreenMaskPosition = %d\n", ModeInformation->GreenMaskPosition)); - DbgPrint((DPRINT_UI, "BlueMaskSize = %d\n", ModeInformation->BlueMaskSize)); - DbgPrint((DPRINT_UI, "BlueMaskPosition = %d\n", ModeInformation->BlueMaskPosition)); - DbgPrint((DPRINT_UI, "ReservedMaskSize = %d\n", ModeInformation->ReservedMaskSize)); - DbgPrint((DPRINT_UI, "ReservedMaskPosition = %d\n", ModeInformation->ReservedMaskPosition)); - DbgPrint((DPRINT_UI, "\n")); - - return TRUE; -} - -static BOOLEAN -PcVideoSetBiosVesaMode(USHORT Mode) -{ - REGS Regs; - - /* Int 10h AX=4F02h - * VESA SuperVGA BIOS - SET SuperVGA VIDEO MODE - * - * AX = 4F02h - * BX = new video mode - * ES:DI -> (VBE 3.0+) CRTC information block, bit mode bit 11 set - * Return: - * AL = 4Fh if function supported - * AH = status - * 00h successful - * 01h failed - * - * Values for VESA video mode: - * 00h-FFh OEM video modes (see #00010 at AH=00h) - * 100h 640x400x256 - * 101h 640x480x256 - * 102h 800x600x16 - * 103h 800x600x256 - * 104h 1024x768x16 - * 105h 1024x768x256 - * 106h 1280x1024x16 - * 107h 1280x1024x256 - * 108h 80x60 text - * 109h 132x25 text - * 10Ah 132x43 text - * 10Bh 132x50 text - * 10Ch 132x60 text - * ---VBE v1.2+ --- - * 10Dh 320x200x32K - * 10Eh 320x200x64K - * 10Fh 320x200x16M - * 110h 640x480x32K - * 111h 640x480x64K - * 112h 640x480x16M - * 113h 800x600x32K - * 114h 800x600x64K - * 115h 800x600x16M - * 116h 1024x768x32K - * 117h 1024x768x64K - * 118h 1024x768x16M - * 119h 1280x1024x32K (1:5:5:5) - * 11Ah 1280x1024x64K (5:6:5) - * 11Bh 1280x1024x16M - * ---VBE 2.0+ --- - * 120h 1600x1200x256 - * 121h 1600x1200x32K - * 122h 1600x1200x64K - * 81FFh special full-memory access mode - * - * Notes: The special mode 81FFh preserves the contents of the video memory and gives - * access to all of the memory; VESA recommends that the special mode be a packed-pixel - * mode. For VBE 2.0+, it is required that the VBE implement the mode, but not place it - * in the list of available modes (mode information for this mode can be queried - * directly, however).. As of VBE 2.0, VESA will no longer define video mode numbers - */ - Regs.w.ax = 0x4F02; - Regs.w.bx = Mode; - Int386(0x10, &Regs, &Regs); - - if (0x004F != Regs.w.ax) - { - return FALSE; - } - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode80x25(VOID) -{ - PcVideoSetBiosMode(0x03); - ScreenWidth = 80; - ScreenHeight = 25; - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode80x50_80x43(VOID) -{ - if (VIDEOCARD_VGA == PcVideoDetectVideoCard()) - { - PcVideoSetBiosMode(0x12); - PcVideoSetFont8x8(); - PcVideoSelectAlternatePrintScreen(); - PcVideoDisableCursorEmulation(); - PcVideoDefineCursor(6, 7); - ScreenWidth = 80; - ScreenHeight = 50; - } - else if (VIDEOCARD_EGA == PcVideoDetectVideoCard()) - { - PcVideoSetBiosMode(0x03); - PcVideoSetFont8x8(); - PcVideoSelectAlternatePrintScreen(); - PcVideoDisableCursorEmulation(); - PcVideoDefineCursor(6, 7); - ScreenWidth = 80; - ScreenHeight = 43; - } - else /* VIDEOCARD_CGA_OR_OTHER */ - { - return FALSE; - } - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode80x28(VOID) -{ - /* FIXME: Is this VGA-only? */ - PcVideoSetMode80x25(); - PcVideoSetFont8x14(); - PcVideoDefineCursor(11, 12); - ScreenWidth = 80; - ScreenHeight = 28; - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode80x30(VOID) -{ - /* FIXME: Is this VGA-only? */ - PcVideoSetMode80x25(); - PcVideoSet480ScanLines(); - ScreenWidth = 80; - ScreenHeight = 30; - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode80x34(VOID) -{ - /* FIXME: Is this VGA-only? */ - PcVideoSetMode80x25(); - PcVideoSet480ScanLines(); - PcVideoSetFont8x14(); - PcVideoDefineCursor(11, 12); - PcVideoSetDisplayEnd(); - ScreenWidth = 80; - ScreenHeight = 34; - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode80x43(VOID) -{ - /* FIXME: Is this VGA-only? */ - PcVideoSetVerticalResolution(VERTRES_350_SCANLINES); - PcVideoSetMode80x25(); - PcVideoSetFont8x8(); - PcVideoSelectAlternatePrintScreen(); - PcVideoDisableCursorEmulation(); - PcVideoDefineCursor(6, 7); - ScreenWidth = 80; - ScreenHeight = 43; - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode80x60(VOID) -{ - /* FIXME: Is this VGA-only? */ - PcVideoSetMode80x25(); - PcVideoSet480ScanLines(); - PcVideoSetFont8x8(); - PcVideoSelectAlternatePrintScreen(); - PcVideoDisableCursorEmulation(); - PcVideoDefineCursor(6, 7); - PcVideoSetDisplayEnd(); - ScreenWidth = 80; - ScreenHeight = 60; - - return TRUE; -} - -static BOOLEAN -PcVideoSetMode(ULONG NewMode) -{ - CurrentMemoryBank = 0; - - /* Set the values for the default text modes - * If they are setting a graphics mode then - * these values will be changed. - */ - BiosVideoMode = NewMode; - ScreenWidth = 80; - ScreenHeight = 25; - BytesPerScanLine = 160; - DisplayMode = VideoTextMode; - VesaVideoMode = FALSE; - - switch (NewMode) - { - case VIDEOMODE_NORMAL_TEXT: - case 0x03: /* BIOS 80x25 text mode number */ - return PcVideoSetMode80x25(); - case VIDEOMODE_EXTENDED_TEXT: - return PcVideoSetMode80x50_80x43(); - case VIDEOMODE_80X28: - return PcVideoSetMode80x28(); - case VIDEOMODE_80X30: - return PcVideoSetMode80x30(); - case VIDEOMODE_80X34: - return PcVideoSetMode80x34(); - case VIDEOMODE_80X43: - return PcVideoSetMode80x43(); - case VIDEOMODE_80X60: - return PcVideoSetMode80x60(); - } - - if (0x12 == NewMode) - { - /* 640x480x16 */ - PcVideoSetBiosMode(NewMode); - WRITE_PORT_USHORT((USHORT*)0x03CE, 0x0F01); /* For some reason this is necessary? */ - ScreenWidth = 640; - ScreenHeight = 480; - BytesPerScanLine = 80; - BiosVideoMode = NewMode; - DisplayMode = VideoGraphicsMode; - - return TRUE; - } - else if (0x13 == NewMode) - { - /* 320x200x256 */ - PcVideoSetBiosMode(NewMode); - ScreenWidth = 320; - ScreenHeight = 200; - BytesPerScanLine = 320; - BiosVideoMode = NewMode; - DisplayMode = VideoGraphicsMode; - - return TRUE; - } - else if (0x0108 <= NewMode && NewMode <= 0x010C) - { - /* VESA Text Mode */ - if (! PcVideoVesaGetSVGAModeInformation(NewMode, &VesaVideoModeInformation)) - { - return FALSE; - } - - if (! PcVideoSetBiosVesaMode(NewMode)) - { - return FALSE; - } - - ScreenWidth = VesaVideoModeInformation.WidthInPixels; - ScreenHeight = VesaVideoModeInformation.HeightInPixels; - BytesPerScanLine = VesaVideoModeInformation.BytesPerScanLine; - BiosVideoMode = NewMode; - DisplayMode = VideoTextMode; - VesaVideoMode = TRUE; - - return TRUE; - } - else - { - /* VESA Graphics Mode */ - if (! PcVideoVesaGetSVGAModeInformation(NewMode, &VesaVideoModeInformation)) - { - return FALSE; - } - - if (! PcVideoSetBiosVesaMode(NewMode)) - { - return FALSE; - } - - ScreenWidth = VesaVideoModeInformation.WidthInPixels; - ScreenHeight = VesaVideoModeInformation.HeightInPixels; - BytesPerScanLine = VesaVideoModeInformation.BytesPerScanLine; - BiosVideoMode = NewMode; - DisplayMode = VideoTextMode; - VesaVideoMode = TRUE; - - return TRUE; - } - - return FALSE; -} - -static VOID -PcVideoSetBlinkBit(BOOLEAN Enable) -{ - REGS Regs; - - /* Int 10h AX=1003h - * VIDEO - TOGGLE INTENSITY/BLINKING BIT (Jr, PS, TANDY 1000, EGA, VGA) - * - * AX = 1003h - * BL = new state - * 00h background intensity enabled - * 01h blink enabled - * BH = 00h to avoid problems on some adapters - * Return: - * Nothing - * - * Note: although there is no function to get - * the current status, bit 5 of 0040h:0065h - * indicates the state. - */ - Regs.w.ax = 0x1003; - Regs.w.bx = Enable ? 0x0001 : 0x0000; - Int386(0x10, &Regs, &Regs); -} - -static VOID -PcVideoSetMemoryBank(USHORT BankNumber) -{ - REGS Regs; - - if (CurrentMemoryBank != BankNumber) - { - /* Int 10h AX=4F05h - * VESA SuperVGA BIOS - CPU VIDEO MEMORY CONTROL - * - * AX = 4F05h - * BH = subfunction - * 00h select video memory window - * 01h get video memory window - * DX = window address in video memory (in granularity units) - * Return: - * DX = window address in video memory (in gran. units) - * BL = window number - * 00h window A - * 01h window B. - * Return: - * AL = 4Fh if function supported - * AH = status - * 00h successful - * 01h failed - */ - Regs.w.ax = 0x4F05; - Regs.w.bx = 0x0000; - Regs.w.dx = BankNumber; - Int386(0x10, &Regs, &Regs); - - if (0x004F == Regs.w.ax) - { - CurrentMemoryBank = BankNumber; - } - } -} - -VIDEODISPLAYMODE -PcVideoSetDisplayMode(char *DisplayModeName, BOOLEAN Init) -{ - ULONG VideoMode = VIDEOMODE_NORMAL_TEXT; - - if (NULL == DisplayModeName || '\0' == *DisplayModeName) - { - PcVideoSetBlinkBit(! Init); - return DisplayMode; - } - - if (VIDEOCARD_CGA_OR_OTHER == PcVideoDetectVideoCard()) - { - DbgPrint((DPRINT_UI, "CGA or other display adapter detected.\n")); - printf("CGA or other display adapter detected.\n"); - printf("Using 80x25 text mode.\n"); - VideoMode = VIDEOMODE_NORMAL_TEXT; - } - else if (VIDEOCARD_EGA == PcVideoDetectVideoCard()) - { - DbgPrint((DPRINT_UI, "EGA display adapter detected.\n")); - printf("EGA display adapter detected.\n"); - printf("Using 80x25 text mode.\n"); - VideoMode = VIDEOMODE_NORMAL_TEXT; - } - else /* if (VIDEOCARD_VGA == PcVideoDetectVideoCard()) */ - { - DbgPrint((DPRINT_UI, "VGA display adapter detected.\n")); - - if (0 == _stricmp(DisplayModeName, "NORMAL_VGA")) - { - VideoMode = VIDEOMODE_NORMAL_TEXT; - } - else if (0 == _stricmp(DisplayModeName, "EXTENDED_VGA")) - { - VideoMode = VIDEOMODE_EXTENDED_TEXT; - } - else - { - VideoMode = atoi(DisplayModeName); - } - } - - if (! PcVideoSetMode(VideoMode)) - { - printf("Error: unable to set video display mode 0x%x\n", (int) VideoMode); - printf("Defaulting to 80x25 text mode.\n"); - printf("Press any key to continue.\n"); - PcConsGetCh(); - - PcVideoSetMode(VIDEOMODE_NORMAL_TEXT); - } - - PcVideoSetBlinkBit(! Init); - - - return DisplayMode; -} - -VOID -PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth) -{ - *Width = ScreenWidth; - *Height = ScreenHeight; - if (VideoGraphicsMode == DisplayMode && VesaVideoMode) - { - if (16 == VesaVideoModeInformation.BitsPerPixel) - { - /* 16-bit color modes give green an extra bit (5:6:5) - * 15-bit color modes have just 5:5:5 for R:G:B */ - *Depth = (6 == VesaVideoModeInformation.GreenMaskSize ? 16 : 15); - } - else - { - *Depth = VesaVideoModeInformation.BitsPerPixel; - } - } - else - { - *Depth = 0; - } -} - -ULONG -PcVideoGetBufferSize(VOID) -{ - return ScreenHeight * BytesPerScanLine; -} - -VOID -PcVideoSetTextCursorPosition(ULONG X, ULONG Y) -{ - REGS Regs; - - /* Int 10h AH=02h - * VIDEO - SET CURSOR POSITION - * - * AH = 02h - * BH = page number - * 0-3 in modes 2&3 - * 0-7 in modes 0&1 - * 0 in graphics modes - * DH = row (00h is top) - * DL = column (00h is left) - * Return: - * Nothing - */ - Regs.b.ah = 0x02; - Regs.b.bh = 0x00; - Regs.b.dh = Y; - Regs.b.dl = X; - Int386(0x10, &Regs, &Regs); -} - -VOID -PcVideoHideShowTextCursor(BOOLEAN Show) -{ - if (Show) - { - PcVideoDefineCursor(0x0D, 0x0E); - } - else - { - PcVideoDefineCursor(0x20, 0x00); - } -} - -VOID -PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer) -{ - ULONG BanksToCopy; - ULONG BytesInLastBank; - ULONG CurrentBank; - ULONG BankSize; - - /* PcVideoWaitForVerticalRetrace(); */ - - /* Text mode (BIOS or VESA) */ - if (VideoTextMode == DisplayMode) - { - RtlCopyMemory((PVOID) VIDEOTEXT_MEM_ADDRESS, Buffer, PcVideoGetBufferSize()); - } - /* VESA graphics mode */ - else if (VideoGraphicsMode == DisplayMode && VesaVideoMode) - { - BankSize = VesaVideoModeInformation.WindowGranularity << 10; - BanksToCopy = (VesaVideoModeInformation.HeightInPixels * VesaVideoModeInformation.BytesPerScanLine) / BankSize; - BytesInLastBank = (VesaVideoModeInformation.HeightInPixels * VesaVideoModeInformation.BytesPerScanLine) % BankSize; - - /* Copy all the banks but the last one because - * it is probably a partial bank */ - for (CurrentBank = 0; CurrentBank < BanksToCopy; CurrentBank++) - { - PcVideoSetMemoryBank(CurrentBank); - RtlCopyMemory((PVOID) VIDEOVGA_MEM_ADDRESS, (char *) Buffer + CurrentBank * BankSize, BankSize); - } - - /* Copy the remaining bytes into the last bank */ - PcVideoSetMemoryBank(CurrentBank); - RtlCopyMemory((PVOID)VIDEOVGA_MEM_ADDRESS, (char *) Buffer + CurrentBank * BankSize, BytesInLastBank); - } - /* BIOS graphics mode */ - else - { - UNIMPLEMENTED; - } -} - -VOID -PcVideoClearScreen(UCHAR Attr) -{ - USHORT AttrChar; - USHORT *BufPtr; - - AttrChar = ((USHORT) Attr << 8) | ' '; - for (BufPtr = (USHORT *) VIDEOTEXT_MEM_ADDRESS; - BufPtr < (USHORT *) (VIDEOTEXT_MEM_ADDRESS + VIDEOTEXT_MEM_SIZE); - BufPtr++) - { - *BufPtr = AttrChar; - } -} - -VOID -PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y) -{ - USHORT *BufPtr; - - BufPtr = (USHORT *) (ULONG_PTR)(VIDEOTEXT_MEM_ADDRESS + Y * BytesPerScanLine + X * 2); - *BufPtr = ((USHORT) Attr << 8) | (Ch & 0xff); -} - -BOOLEAN -PcVideoIsPaletteFixed(VOID) -{ - return FALSE; -} - -VOID -PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue) -{ - WRITE_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_WRITE, Color); - WRITE_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_DATA, Red); - WRITE_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_DATA, Green); - WRITE_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_DATA, Blue); -} - -VOID -PcVideoGetPaletteColor(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue) -{ - WRITE_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_READ, Color); - *Red = READ_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_DATA); - *Green = READ_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_DATA); - *Blue = READ_PORT_UCHAR((UCHAR*) VIDEOPORT_PALETTE_DATA); -} - -VOID -PcVideoSync(VOID) -{ - while (1 == (READ_PORT_UCHAR((UCHAR*)VIDEOPORT_VERTICAL_RETRACE) & 0x08)) - { - /* - * Keep reading the port until bit 3 is clear - * This waits for the current retrace to end and - * we can catch the next one so we know we are - * getting a full retrace. - */ - } - - while (0 == (READ_PORT_UCHAR((UCHAR*)VIDEOPORT_VERTICAL_RETRACE) & 0x08)) - { - /* - * Keep reading the port until bit 3 is set - * Now that we know we aren't doing a vertical - * retrace we need to wait for the next one. - */ - } -} - -VOID -PcVideoPrepareForReactOS(IN BOOLEAN Setup) -{ - if (Setup) - { - PcVideoSetMode80x50_80x43(); - } - else - { - PcVideoSetBiosMode(0x12); - } - PcVideoHideShowTextCursor(FALSE); -} - -/* EOF */ diff --git a/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild b/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild index 11f75db4d42..b5510b7fb08 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild +++ b/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild @@ -75,16 +75,17 @@ - _alloca.S - mach.c + loader.c + + hardware.c hwacpi.c hwapm.c hwpci.c - i386disk.c i386rtl.c + i386disk.c i386vid.c - loader.c + machpc.c pccons.c pcdisk.c pcmem.c diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h index a2d49236666..aa98eb09ff0 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h @@ -26,6 +26,7 @@ #include "mm.h" #endif +#define MachInit PcMachInit VOID PcMachInit(const char *CmdLine); VOID PcConsPutChar(int Ch); From cd09661d87ccaa669eb05811bb9b21901d4bb3bf Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 19:54:57 +0000 Subject: [PATCH 187/388] define _SSIZE_T_DEFINED when defining ssize_t svn path=/branches/ros-amd64-bringup/; revision=35710 --- reactos/include/crt/sys/types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/include/crt/sys/types.h b/reactos/include/crt/sys/types.h index 026471fe1a3..cdd1d6e4d61 100644 --- a/reactos/include/crt/sys/types.h +++ b/reactos/include/crt/sys/types.h @@ -101,7 +101,10 @@ typedef _sigset_t sigset_t; typedef long _ssize_t; #ifndef _NO_OLDNAMES +# ifndef _SSIZE_T_DEFINED +# define _SSIZE_T_DEFINED typedef _ssize_t ssize_t; +# endif #endif #endif /* Not _SSIZE_T_ */ From 01a504435449db392fc9cb1f7e02549dcc94678a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 00:17:53 +0000 Subject: [PATCH 188/388] Implement KegetCurrentThread inline function svn path=/branches/ros-amd64-bringup/; revision=35736 --- reactos/ntoskrnl/include/internal/ke_x.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/ntoskrnl/include/internal/ke_x.h b/reactos/ntoskrnl/include/internal/ke_x.h index 8d584f4c7f5..8182046a90a 100644 --- a/reactos/ntoskrnl/include/internal/ke_x.h +++ b/reactos/ntoskrnl/include/internal/ke_x.h @@ -1534,6 +1534,8 @@ KeGetCurrentThread(VOID) #ifdef _M_IX86 /* Return the current thread */ return ((PKIPCR)KeGetPcr())->PrcbData.CurrentThread; +#elif defined (_M_AMD64) + return (PRKTHREAD)__readgsqword(FIELD_OFFSET(KIPCR, Prcb.CurrentThread)); #else PKPRCB Prcb = KeGetCurrentPrcb(); return Prcb->CurrentThread; From ae1e57e747da8b8c45989e913ffd377ad5be37dd Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 00:24:55 +0000 Subject: [PATCH 189/388] Implement MmUpdatePageDir svn path=/branches/ros-amd64-bringup/; revision=35737 --- reactos/ntoskrnl/include/internal/amd64/mm.h | 22 ++++++++----- reactos/ntoskrnl/mm/amd64/page.c | 33 +++++++++++++++++++- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h index c106a2f45c1..fa8da9a6434 100644 --- a/reactos/ntoskrnl/include/internal/amd64/mm.h +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -2,8 +2,8 @@ * Lowlevel memory managment definitions */ -#ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H -#define __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H +#ifndef __NTOSKRNL_INCLUDE_INTERNAL_AMD64_MM_H +#define __NTOSKRNL_INCLUDE_INTERNAL_AMD64_MM_H struct _EPROCESS; PULONG_PTR MmGetPageDirectory(VOID); @@ -17,15 +17,21 @@ PULONG_PTR MmGetPageDirectory(VOID); /* Converting address to a corresponding PDE or PTE entry */ #define MiAddressToPde(x) \ - ((PMMPTE)(((((ULONG)(x)) >> 22) << 2) + PAGEDIRECTORY_MAP)) + ((PMMPTE)(((((ULONG64)(x)) >> 22) << 2) + PAGEDIRECTORY_MAP)) #define MiAddressToPte(x) \ - ((PMMPTE)(((((ULONG)(x)) >> 12) << 2) + PAGETABLE_MAP)) + ((PMMPTE)(((((ULONG64)(x)) >> 12) << 2) + PAGETABLE_MAP)) + +//#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE)) +//#define ADDR_TO_PDE_OFFSET(v) ((((ULONG)(v)) / (1024 * PAGE_SIZE))) +//#define ADDR_TO_PTE_OFFSET(v) ((((ULONG)(v)) % (1024 * PAGE_SIZE)) / PAGE_SIZE) + +#define VAtoPXI(va) ((((ULONG64)va) >> PXI_SHIFT) & 0x1FF) +#define VAtoPPI(va) ((((ULONG64)va) >> PPI_SHIFT) & 0x1FF) +#define VAtoPDI(va) ((((ULONG64)va) >> PDI_SHIFT) & 0x1FF) +#define VAtoPTI(va) ((((ULONG64)va) >> PTI_SHIFT) & 0x1FF) -#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE)) -#define ADDR_TO_PDE_OFFSET(v) ((((ULONG)(v)) / (1024 * PAGE_SIZE))) -#define ADDR_TO_PTE_OFFSET(v) ((((ULONG)(v)) % (1024 * PAGE_SIZE)) / PAGE_SIZE) /* Easy accessing PFN in PTE */ #define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber) -#endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_MM_H */ +#endif /* __NTOSKRNL_INCLUDE_INTERNAL_AMD64_MM_H */ diff --git a/reactos/ntoskrnl/mm/amd64/page.c b/reactos/ntoskrnl/mm/amd64/page.c index ba46336fe08..97848d66d6e 100644 --- a/reactos/ntoskrnl/mm/amd64/page.c +++ b/reactos/ntoskrnl/mm/amd64/page.c @@ -21,6 +21,7 @@ /* GLOBALS *****************************************************************/ +ULONG64 MmGlobalKernelPageDirectory[512]; /* FUNCTIONS ***************************************************************/ @@ -301,7 +302,37 @@ VOID NTAPI MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) { - UNIMPLEMENTED; + ULONG StartIndex, EndIndex, Index; + PULONG64 Pde; + + /* Sanity check */ + if (Address < MmSystemRangeStart) + { + KEBUGCHECK(0); + } + + /* Get pointer to the page directory to update */ + if (Process != NULL && Process != PsGetCurrentProcess()) + { +// Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); + } + else + { + Pde = (PULONG64)PXE_BASE; + } + + /* Update PML4 entries */ + StartIndex = VAtoPXI(Address); + EndIndex = VAtoPXI((ULONG64)Address + Size); + for (Index = StartIndex; Index <= EndIndex; Index++) + { + if (Index != VAtoPXI(PXE_BASE)) + { + (void)InterlockedCompareExchangePointer((PVOID*)&Pde[Index], + MmGlobalKernelPageDirectory[Index], + 0); + } + } } VOID From 5d495da9f4c9279727ff6da0824bc85081dd0880 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 00:35:02 +0000 Subject: [PATCH 190/388] Fix DebugService svn path=/branches/ros-amd64-bringup/; revision=35738 --- reactos/lib/rtl/amd64/debug_asm.S | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/reactos/lib/rtl/amd64/debug_asm.S b/reactos/lib/rtl/amd64/debug_asm.S index af2248f7026..493d74fd9c4 100644 --- a/reactos/lib/rtl/amd64/debug_asm.S +++ b/reactos/lib/rtl/amd64/debug_asm.S @@ -51,27 +51,38 @@ _DebugService2: .endfunc +/****************************************************************************** + * NTSTATUS NTAPI DebugService( + * IN ULONG Service, // = [rsp + 8] + * IN PVOID Buffer, // = [rsp + 16] + * IN ULONG Length, // = [rsp + 24] + * IN PVOID Argument1, // = [rsp + 32] + * IN PVOID Argument2); // [rsp + 40] + */ .func DebugService _DebugService: /* Save the registers */ + push rbx push rcx - push rbx + push rdx + push rsi push rdi - push rdi - push rbx + + /* Load Argument 2 in rax */ + mov rax, [rsp + 48 + 40] /* Call the Interrupt */ - // FIXME: setup registers int 0x2D int 3 /* Restore registers */ - pop rbx - pop rdi pop rdi + pop rsi + pop rdx + pop rcx pop rbx /* Return */ - ret 20 + ret .endfunc From 5d8afe00fcdd6577f160e2b7cb400f43e65b35ac Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 00:35:46 +0000 Subject: [PATCH 191/388] KGDT_TSS is 0x40 (vista 64bit). svn path=/branches/ros-amd64-bringup/; revision=35739 --- reactos/include/ndk/amd64/ketypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 82f7940a385..7f20a779336 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -62,9 +62,9 @@ Author: #define KGDT_64_R0_SS 0x0018 #define KGDT_64_DATA 0x0028 // 2b #define KGDT_64_R3_CODE 0x0030 // 33 +#define KGDT_TSS 0x0040 #define KGDT_32_R3_TEB 0x0050 // 53 -#define KGDT_TSS 0x0038 // ?? // // CR4 From df5f36896fca8e2de4a0644f613255d0def57d51 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 00:38:15 +0000 Subject: [PATCH 192/388] Fix Ki386InitializeTss. Load idt in KeInitExceptions. Implement KiDebugServiceTrap. Add #ifed out threadini.c. Update Stubs. Now DbgPrints are working. svn path=/branches/ros-amd64-bringup/; revision=35740 --- reactos/ntoskrnl/amd64stubs.c | 1 - reactos/ntoskrnl/kd/amd64/kd.c | 30 +++ reactos/ntoskrnl/kdbg/amd64/kdb.c | 47 +++++ reactos/ntoskrnl/ke/amd64/cpu.c | 39 ++-- reactos/ntoskrnl/ke/amd64/except.c | 1 + reactos/ntoskrnl/ke/amd64/thrdini.c | 231 +++++++++++++++++++++ reactos/ntoskrnl/ke/amd64/trap.S | 104 +++++++++- reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 6 + 8 files changed, 440 insertions(+), 19 deletions(-) create mode 100644 reactos/ntoskrnl/kd/amd64/kd.c create mode 100644 reactos/ntoskrnl/kdbg/amd64/kdb.c create mode 100644 reactos/ntoskrnl/ke/amd64/thrdini.c diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index 6da6ea2ca71..fccd94cca8d 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -69,7 +69,6 @@ STUB(_ExSemaphoreObjectType) STUB(KeFeatureBits) STUB(KiSystemService) STUB(KdpGdbStubInit) -STUB(KdbpGetCommandLineSettings) STUB(KdbpSafeReadMemory) STUB(RtlFillMemoryUlong) STUB(RtlCaptureContext) diff --git a/reactos/ntoskrnl/kd/amd64/kd.c b/reactos/ntoskrnl/kd/amd64/kd.c new file mode 100644 index 00000000000..ae6a1b4bd3e --- /dev/null +++ b/reactos/ntoskrnl/kd/amd64/kd.c @@ -0,0 +1,30 @@ + +#include +#define NDEBUG +#include + +VOID +STDCALL +KdbpGetCommandLineSettings(PCHAR p1) +{ + PCHAR p2; + + while (p1 && (p2 = strchr(p1, ' '))) + { + p2++; + + if (!_strnicmp(p2, "KDSERIAL", 8)) + { + p2 += 8; + KdbDebugState |= KD_DEBUG_KDSERIAL; + KdpDebugMode.Serial = TRUE; + } + else if (!_strnicmp(p2, "KDNOECHO", 8)) + { + p2 += 8; + KdbDebugState |= KD_DEBUG_KDNOECHO; + } + + p1 = p2; + } +} diff --git a/reactos/ntoskrnl/kdbg/amd64/kdb.c b/reactos/ntoskrnl/kdbg/amd64/kdb.c new file mode 100644 index 00000000000..0fa9f7d0597 --- /dev/null +++ b/reactos/ntoskrnl/kdbg/amd64/kdb.c @@ -0,0 +1,47 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/kdbg/kdb.c + * PURPOSE: Kernel Debugger + * + * PROGRAMMERS: Gregor Anich + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +ULONG KdbDebugState = 0; /* KDBG Settings (NOECHO, KDSERIAL) */ + +/* FUNCTIONS *****************************************************************/ + +VOID +STDCALL +KdbpGetCommandLineSettings(PCHAR p1) +{ + PCHAR p2; + + while (p1 && (p2 = strchr(p1, ' '))) + { + p2++; + + if (!_strnicmp(p2, "KDSERIAL", 8)) + { + p2 += 8; + KdbDebugState |= KD_DEBUG_KDSERIAL; + KdpDebugMode.Serial = TRUE; + } + else if (!_strnicmp(p2, "KDNOECHO", 8)) + { + p2 += 8; + KdbDebugState |= KD_DEBUG_KDNOECHO; + } + + p1 = p2; + } +} + diff --git a/reactos/ntoskrnl/ke/amd64/cpu.c b/reactos/ntoskrnl/ke/amd64/cpu.c index 0b0efcbac1b..083e4968d3c 100644 --- a/reactos/ntoskrnl/ke/amd64/cpu.c +++ b/reactos/ntoskrnl/ke/amd64/cpu.c @@ -456,30 +456,45 @@ Ki386InitializeTss(IN PKTSS64 Tss, IN PKGDTENTRY Gdt, IN UINT64 Stack) { - PKGDTENTRY TssEntry; + PKGDTENTRY64 TssEntry; - /* Initialize the boot TSS entry */ - TssEntry = &Gdt[KGDT_TSS / sizeof(KGDTENTRY)]; - TssEntry->Bits.Type = I386_TSS; - TssEntry->Bits.Present = 1; + /* Initialize the TSS descriptor entry */ + TssEntry = (PVOID)((ULONG64)Gdt + KGDT_TSS); + TssEntry->Bits.Type = 9;//AMD64_TSS; TssEntry->Bits.Dpl = 0; + TssEntry->Bits.Present = 1; + TssEntry->Bits.System = 0; + TssEntry->Bits.LongMode = 0; + TssEntry->Bits.DefaultBig = 0; + TssEntry->Bits.Granularity = 0; - /* FIXME: I/O Map */ + /* Descriptor base is the TSS address */ + TssEntry->BaseLow = (ULONG64)Tss & 0xffff; + TssEntry->Bits.BaseMiddle = ((ULONG64)Tss >> 16) & 0xff; + TssEntry->Bits.BaseHigh = ((ULONG64)Tss >> 24) & 0xff; + TssEntry->BaseUpper = (ULONG64)Tss >> 32; - /* Load the task register */ - Ke386SetTr(KGDT_TSS); + /* Set the limit */ + TssEntry->LimitLow = sizeof(KTSS64) -1; + TssEntry->Bits.LimitHigh = 0; - /* Setup stack pointer */ + /* FIXME: I/O Map? */ + Tss->IoMapBase = 0; + + /* Setup ring 0 stack pointer */ Tss->Rsp0 = Stack; /* Setup a stack for Double Fault Traps */ - Tss->Ist[1] = PtrToUlong(KiDoubleFaultStack); + Tss->Ist[1] = (ULONG64)KiDoubleFaultStack; /* Setup a stack for CheckAbort Traps */ - Tss->Ist[2] = PtrToUlong(KiDoubleFaultStack); + Tss->Ist[2] = (ULONG64)KiDoubleFaultStack; /* Setup a stack for NMI Traps */ - Tss->Ist[3] = PtrToUlong(KiDoubleFaultStack); + Tss->Ist[3] = (ULONG64)KiDoubleFaultStack; + + /* Load the task register */ + Ke386SetTr(KGDT_TSS); } diff --git a/reactos/ntoskrnl/ke/amd64/except.c b/reactos/ntoskrnl/ke/amd64/except.c index c21905471be..1eaae2903f1 100644 --- a/reactos/ntoskrnl/ke/amd64/except.c +++ b/reactos/ntoskrnl/ke/amd64/except.c @@ -87,5 +87,6 @@ KeInitExceptions(VOID) KiIdt[i].Reserved1 = 0; } + __lidt(&KiIdtDescriptor.Limit); } diff --git a/reactos/ntoskrnl/ke/amd64/thrdini.c b/reactos/ntoskrnl/ke/amd64/thrdini.c new file mode 100644 index 00000000000..199dc769fc0 --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/thrdini.c @@ -0,0 +1,231 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/ke/i386/thread.c + * PURPOSE: i386 Thread Context Creation + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include +#if 0 +typedef struct _KSWITCHFRAME +{ + PVOID ExceptionList; + BOOLEAN ApcBypassDisable; + PVOID RetAddr; +} KSWITCHFRAME, *PKSWITCHFRAME; + +typedef struct _KSTART_FRAME +{ + PKSYSTEM_ROUTINE SystemRoutine; + PKSTART_ROUTINE StartRoutine; + PVOID StartContext; + BOOLEAN UserThread; +} KSTART_FRAME, *PKSTART_FRAME; + +typedef struct _KUINIT_FRAME +{ + KSWITCHFRAME CtxSwitchFrame; + KSTART_FRAME StartFrame; + KTRAP_FRAME TrapFrame; + FX_SAVE_AREA FxSaveArea; +} KUINIT_FRAME, *PKUINIT_FRAME; + +typedef struct _KKINIT_FRAME +{ + KSWITCHFRAME CtxSwitchFrame; + KSTART_FRAME StartFrame; + FX_SAVE_AREA FxSaveArea; +} KKINIT_FRAME, *PKKINIT_FRAME; +#endif +/* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +Ke386InitThreadWithContext(IN PKTHREAD Thread, + IN PKSYSTEM_ROUTINE SystemRoutine, + IN PKSTART_ROUTINE StartRoutine, + IN PVOID StartContext, + IN PCONTEXT ContextPointer) +{ + FrLdrDbgPrint("Ke386InitThreadWithContext stub\n"); +#if 0 + PFX_SAVE_AREA FxSaveArea; + PFXSAVE_FORMAT FxSaveFormat; + PKSTART_FRAME StartFrame; + PKSWITCHFRAME CtxSwitchFrame; + PKTRAP_FRAME TrapFrame; + CONTEXT LocalContext; + PCONTEXT Context = NULL; + ULONG ContextFlags; + + /* Check if this is a With-Context Thread */ + if (ContextPointer) + { + /* Set up the Initial Frame */ + PKUINIT_FRAME InitFrame; + InitFrame = (PKUINIT_FRAME)((ULONG_PTR)Thread->InitialStack - + sizeof(KUINIT_FRAME)); + + /* Copy over the context we got */ + RtlCopyMemory(&LocalContext, ContextPointer, sizeof(CONTEXT)); + Context = &LocalContext; + ContextFlags = CONTEXT_CONTROL; + + /* Zero out the trap frame and save area */ + RtlZeroMemory(&InitFrame->TrapFrame, + KTRAP_FRAME_LENGTH + sizeof(FX_SAVE_AREA)); + + /* Setup the Fx Area */ + FxSaveArea = &InitFrame->FxSaveArea; + + /* Check if we support FXsr */ + if (KeI386FxsrPresent) + { + /* Get the FX Save Format Area */ + FxSaveFormat = (PFXSAVE_FORMAT)Context->ExtendedRegisters; + + /* Set an initial state */ + FxSaveFormat->ControlWord = 0x27F; + FxSaveFormat->StatusWord = 0; + FxSaveFormat->TagWord = 0; + FxSaveFormat->ErrorOffset = 0; + FxSaveFormat->ErrorSelector = 0; + FxSaveFormat->DataOffset = 0; + FxSaveFormat->DataSelector = 0; + FxSaveFormat->MXCsr = 0x1F80; + } + else + { + /* Setup the regular save area */ + Context->FloatSave.ControlWord = 0x27F; + Context->FloatSave.StatusWord = 0; + Context->FloatSave.TagWord = -1; + Context->FloatSave.ErrorOffset = 0; + Context->FloatSave.ErrorSelector = 0; + Context->FloatSave.DataOffset =0; + Context->FloatSave.DataSelector = 0; + } + + /* Check if the CPU has NPX */ + if (KeI386NpxPresent) + { + /* Set an intial NPX State */ + Context->FloatSave.Cr0NpxState = 0; + FxSaveArea->Cr0NpxState = 0; + FxSaveArea->NpxSavedCpu = 0; + + /* Now set the context flags depending on XMM support */ + ContextFlags |= (KeI386FxsrPresent) ? CONTEXT_EXTENDED_REGISTERS : + CONTEXT_FLOATING_POINT; + + /* Set the Thread's NPX State */ + Thread->NpxState = NPX_STATE_NOT_LOADED; + Thread->DispatcherHeader.NpxIrql = PASSIVE_LEVEL; + } + else + { + /* We'll use emulation */ + FxSaveArea->Cr0NpxState = CR0_EM; + Thread->NpxState = NPX_STATE_NOT_LOADED &~ CR0_MP; + } + + /* Disable any debug regiseters */ + Context->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS; + + /* Setup the Trap Frame */ + TrapFrame = &InitFrame->TrapFrame; + + /* Set up a trap frame from the context. */ + KeContextToTrapFrame(Context, + NULL, + TrapFrame, + Context->ContextFlags | ContextFlags, + UserMode); + + /* Set SS, DS, ES's RPL Mask properly */ + TrapFrame->HardwareSegSs |= RPL_MASK; + TrapFrame->SegDs |= RPL_MASK; + TrapFrame->SegEs |= RPL_MASK; + TrapFrame->Dr7 = 0; + + /* Set the debug mark */ + TrapFrame->DbgArgMark = 0xBADB0D00; + + /* Set the previous mode as user */ + TrapFrame->PreviousPreviousMode = UserMode; + + /* Terminate the Exception Handler List */ + TrapFrame->ExceptionList = EXCEPTION_CHAIN_END; + + /* Setup the Stack for KiThreadStartup and Context Switching */ + StartFrame = &InitFrame->StartFrame; + CtxSwitchFrame = &InitFrame->CtxSwitchFrame; + + /* Tell the thread it will run in User Mode */ + Thread->PreviousMode = UserMode; + + /* Tell KiThreadStartup of that too */ + StartFrame->UserThread = TRUE; + } + else + { + /* Set up the Initial Frame for the system thread */ + PKKINIT_FRAME InitFrame; + InitFrame = (PKKINIT_FRAME)((ULONG_PTR)Thread->InitialStack - + sizeof(KKINIT_FRAME)); + + /* Setup the Fx Area */ + FxSaveArea = &InitFrame->FxSaveArea; + RtlZeroMemory(FxSaveArea, sizeof(FX_SAVE_AREA)); + + /* Check if we have Fxsr support */ + if (KeI386FxsrPresent) + { + /* Set the stub FX area */ + FxSaveArea->U.FxArea.ControlWord = 0x27F; + FxSaveArea->U.FxArea.MXCsr = 0x1F80; + } + else + { + /* Set the stub FN area */ + FxSaveArea->U.FnArea.ControlWord = 0x27F; + FxSaveArea->U.FnArea.TagWord = -1; + } + + /* No NPX State */ + Thread->NpxState = NPX_STATE_NOT_LOADED; + + /* Setup the Stack for KiThreadStartup and Context Switching */ + StartFrame = &InitFrame->StartFrame; + CtxSwitchFrame = &InitFrame->CtxSwitchFrame; + + /* Tell the thread it will run in Kernel Mode */ + Thread->PreviousMode = KernelMode; + + /* Tell KiThreadStartup of that too */ + StartFrame->UserThread = FALSE; + } + + /* Now setup the remaining data for KiThreadStartup */ + StartFrame->StartContext = StartContext; + StartFrame->StartRoutine = StartRoutine; + StartFrame->SystemRoutine = SystemRoutine; + + /* And set up the Context Switch Frame */ + CtxSwitchFrame->RetAddr = KiThreadStartup; + CtxSwitchFrame->ApcBypassDisable = TRUE; + CtxSwitchFrame->ExceptionList = EXCEPTION_CHAIN_END;; + + /* Save back the new value of the kernel stack. */ + Thread->KernelStack = (PVOID)CtxSwitchFrame; +#endif +} + +/* EOF */ + + diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S index 5c43aae70ca..a79ea919213 100644 --- a/reactos/ntoskrnl/ke/amd64/trap.S +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -17,6 +17,9 @@ .data +_MsgPageFault: +.ascii "Page fault 0x%x at %p!\n\0" + _MsgGeneralProtFault: .ascii "General protection fault at %p!\n\0" @@ -33,55 +36,95 @@ _MsgUnexpectedInterrupt: .global _KiDivideErrorFault _KiDivideErrorFault: + /* Push pseudo error code */ + push 0 + .global _KiDebugTrapOrFault _KiDebugTrapOrFault: + /* Push pseudo error code */ + push 0 .global _KiNmiInterrupt _KiNmiInterrupt: + /* Push pseudo error code */ + push 0 + +jmp $ .global _KiBreakpointTrap _KiBreakpointTrap: -// mov rdx, [rsp] + /* Push pseudo error code */ + push 0 + + push rax + push rcx + push rdx + sub rsp, 0x10 -// movabs rcx, offset _MsgBreakpointTrap -// movabs rax, offset _FrLdrDbgPrint -// call [rax] + movabs rcx, offset _MsgBreakpointTrap + mov rdx, [rsp + 0x10 + 24 + 8] + movabs rax, offset _FrLdrDbgPrint + call [rax] add rsp, 0x10 - iret + + pop rdx + pop rcx + pop rax + add rsp, 8 + iretq .global _KiOverflowTrap _KiOverflowTrap: + /* Push pseudo error code */ + push 0 .global _KiBoundFault _KiBoundFault: + /* Push pseudo error code */ + push 0 .global _KiInvalidOpcodeFault _KiInvalidOpcodeFault: + /* Push pseudo error code */ + push 0 .global _KiNpxNotAvailableFault _KiNpxNotAvailableFault: + /* Push pseudo error code */ + push 0 .global _KiDoubleFaultAbort _KiDoubleFaultAbort: + /* Push pseudo error code */ + push 0 .global _KiNpxSegmentOverrunAbort _KiNpxSegmentOverrunAbort: + /* Push pseudo error code */ + push 0 .global _KiInvalidTssFault _KiInvalidTssFault: + /* We have an error code */ + .global _KiSegmentNotPresentFault _KiSegmentNotPresentFault: + /* We have an error code */ + .global _KiStackFault _KiStackFault: + /* We have an error code */ jmp $ .global _KiGeneralProtectionFault _KiGeneralProtectionFault: + /* We have an error code */ + mov rdx, 0 mov dx, ss movabs rcx, offset _MsgGeneralProtFault @@ -92,18 +135,34 @@ _KiGeneralProtectionFault: .global _KiPageFault _KiPageFault: + /* We have an error code */ + movabs rcx, offset _MsgPageFault + mov rdx, [rsp] + mov r8, [rsp+8] + mov r9, rsp + movabs rax, offset _FrLdrDbgPrint + call [rax] + jmp $ + .global _KiFloatingErrorFault _KiFloatingErrorFault: + /* Push pseudo error code */ + push 0 .global _KiAlignmentFault _KiAlignmentFault: + /* We have an error code */ .global _KiMcheckAbort _KiMcheckAbort: + /* Push pseudo error code */ + push 0 .global _KiXmmException _KiXmmException: + /* Push pseudo error code */ + push 0 .global _KiApcInterrupt _KiApcInterrupt: @@ -111,9 +170,40 @@ _KiApcInterrupt: .global _KiRaiseAssertion _KiRaiseAssertion: +jmp $ .global _KiDebugServiceTrap _KiDebugServiceTrap: + /* Push pseudo error code */ + push 0 + + push rax + push rcx + push rdx + push r8 + push r9 + + /* Create stack space for parameters */ + sub rsp, 0x18 + + /* just forward first 3 parameters */ + call _KdpServiceDispatcher + + /* Skip the int 3, increment return rip */ + inc qword ptr [rsp + 0x18 + 48] + + /* Cleanup */ + add rsp, 0x18 + + pop r9 + pop r8 + pop rdx + pop rcx + pop rax + + add rsp, 8 + iretq + .global _KiDpcInterrupt _KiDpcInterrupt: @@ -121,10 +211,12 @@ _KiDpcInterrupt: .global _KiIpiInterrupt _KiIpiInterrupt: - iret +jmp $ + .global _KiUnexpectedInterrupt _KiUnexpectedInterrupt: +jmp $ movabs rcx, offset _MsgUnexpectedInterrupt movabs rax, offset _FrLdrDbgPrint call [rax] diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index 3c010044f10..e450f445c04 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -95,6 +95,7 @@ except.c irql.c kiinit.c + thrdini.c trap.S @@ -303,6 +304,11 @@ kdb_keyboard.c kdb_serial.c + + + kdb.c + + kdb_symbols.c From bb1ab6e781c2dedddb9beb077dec962044d2874b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 01:45:40 +0000 Subject: [PATCH 193/388] KeAcquire/ReleaseQueuedSpinlock belong to ntoskrnl on amd64 svn path=/branches/ros-amd64-bringup/; revision=35742 --- reactos/include/ddk/ntifs.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index 5fa32bbb1b0..54358cccab7 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -3631,14 +3631,22 @@ IoVerifyVolume ( IN BOOLEAN AllowRawMount ); +#ifdef _M_AMD64 +NTKERNELAPI +#else NTHALAPI +#endif KIRQL FASTCALL KeAcquireQueuedSpinLock ( IN KSPIN_LOCK_QUEUE_NUMBER Number ); +#ifdef _M_AMD64 +NTKERNELAPI +#else NTHALAPI +#endif VOID FASTCALL KeReleaseQueuedSpinLock ( From f0c91ae971ca9affd819aa10cf65ad925217932b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 29 Aug 2008 07:49:31 +0000 Subject: [PATCH 194/388] Convert crtdll to WINE's spec file. Forwards most exports to msvcrt and reduces crtdll.dll from 328Kb to 188Kb svn path=/branches/ros-amd64-bringup/; revision=35746 --- reactos/dll/win32/crtdll/crtdll.def | 571 ------------------------- reactos/dll/win32/crtdll/crtdll.rbuild | 5 +- reactos/dll/win32/crtdll/crtdll.spec | 527 +++++++++++++++++++++++ 3 files changed, 530 insertions(+), 573 deletions(-) delete mode 100644 reactos/dll/win32/crtdll/crtdll.def create mode 100644 reactos/dll/win32/crtdll/crtdll.spec diff --git a/reactos/dll/win32/crtdll/crtdll.def b/reactos/dll/win32/crtdll/crtdll.def deleted file mode 100644 index 7c0199eb0dd..00000000000 --- a/reactos/dll/win32/crtdll/crtdll.def +++ /dev/null @@ -1,571 +0,0 @@ -; -; crtdll.def -; -; Exports from crtdll.dll from Windows 95 SYSTEM directory. Hopefully this -; should also work with the crtdll provided with Windows NT. -; Exports from crtdll.dll from Windows NT Server 4.0. -; -; Contributors: -; Created by Colin Peters -; Modified by Adhi P. Yoedo -; -; THIS SOFTWARE IS NOT COPYRIGHTED -; -; This source code is offered for use in the public domain. You may -; use, modify or distribute it freely. -; -; This code is distributed in the hope that it will be useful but -; WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY -; DISCLAMED. This includes but is not limited to warrenties of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -; -; $Revision: 1.19 $ -; $Author$ -; $Date$ -; -; These three functions appear to be name mangled in some way, so GCC is -; probably not going to be able to use them in any case. -; -; ??2@YAPAXI@Z -; ??3@YAXPAX@Z -; ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -; -; Added functional equivalent placeholders: -; -; __builtin_new -; __builtin_delete -; _set_new_handler__FPFUi_i -; I commented out these, cause i dont get why they were added. -Gunnar -; -LIBRARY CRTDLL.DLL -EXPORTS -;__builtin_new -;__builtin_delete -??2@YAPAXI@Z=MSVCRT_operator_new -??3@YAXPAX@Z=MSVCRT_operator_delete -?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z=MSVCRT__set_new_handler -;_set_new_handler__FPFUi_i -_CIacos -_CIasin -_CIatan -_CIatan2 -_CIcos -_CIcosh -_CIexp -_CIfmod -_CIlog -_CIlog10 -_CIpow -_CIsin -_CIsinh -_CIsqrt -_CItan -_CItanh -_HUGE_dll=_HUGE DATA -_XcptFilter -__GetMainArgs -__argc_dll=__argc DATA -__argv_dll=__argv DATA -__dllonexit -__doserrno -__fpecode -__isascii=NTDLL.__isascii -__iscsym=NTDLL.__iscsym -__iscsymf=NTDLL.__iscsymf -__mb_cur_max_dll=__mb_cur_max DATA -__pxcptinfoptrs -__threadhandle -__threadid -__toascii=NTDLL.__toascii -_abnormal_termination -_access -_acmdln_dll=_acmdln DATA -_aexit_rtn_dll=_aexit_rtn DATA -_amsg_exit -_assert -_basemajor_dll=CRTDLL__basemajor_dll DATA -_baseminor_dll=CRTDLL__baseminor_dll DATA -_baseversion_dll=CRTDLL__baseversion_dll DATA -_beep -_beginthread -_c_exit -_cabs -_cexit -_cgets -_chdir -_chdrive -_chgsign -_chmod -_chsize -_clearfp -_close -_commit -_commode_dll=_commode DATA -_control87 -_controlfp -_copysign -_cprintf -_cpumode_dll=_cpumode DATA ;fixme: wine has CRTDLL__cpumode_dll -_cputs -_creat -_cscanf -_ctype DATA -_cwait -_daylight_dll=_daylight DATA -_dup -_dup2 -_ecvt -_endthread -_environ_dll=_environ DATA -_eof -_errno -_except_handler2 -_execl -_execle -_execlp -_execlpe -_execv -_execve -_execvp -_execvpe -_exit -_expand -_fcloseall -_fcvt -_fdopen -_fgetchar -_fgetwchar -_filbuf -;_fileinfo_dll=_fileinfo DATA -_filelength -_fileno DATA -_findclose -_findfirst -_findnext -_finite -_flsbuf -_flushall -_fmode_dll=_fmode DATA -_fpclass -_fpieee_flt -_fpreset -_fputchar -_fputwchar -_fsopen -_fstat=CRTDLL__fstat -_ftime -_ftol=NTDLL._ftol -_fullpath -_futime -_gcvt -_get_osfhandle -_getch -_getche -_getcwd -_getdcwd -_getdiskfree -_getdllprocaddr -_getdrive -_getdrives -_getpid -_getsystime -_getw -_global_unwind2 -_heapchk -_heapmin -_heapset -_heapwalk -_hypot -_initterm -_iob DATA -_isatty -_isctype -_ismbbalnum -_ismbbalpha -_ismbbgraph -_ismbbkalnum -_ismbbkana -_ismbbkpunct -_ismbblead -_ismbbprint -_ismbbpunct -_ismbbtrail -_ismbcalpha -_ismbcdigit -_ismbchira -_ismbckata -_ismbcl0 -_ismbcl1 -_ismbcl2 -_ismbclegal -_ismbclower -_ismbcprint -_ismbcspace -_ismbcsymbol -_ismbcupper -_ismbslead -_ismbstrail -_isnan -_itoa=NTDLL._itoa -_itow=NTDLL._itow -_j0 -_j1 -_jn -_kbhit -_lfind -_loaddll -_local_unwind2 -_locking -_logb -_lrotl -_lrotr -_lsearch -_lseek -_ltoa=NTDLL._ltoa -_ltow=NTDLL._ltow -_makepath -_matherr -_mbbtombc -_mbbtype -_mbccpy -_mbcjistojms -_mbcjmstojis -_mbclen -_mbctohira -_mbctokata -_mbctolower -_mbctombb -_mbctoupper -_mbctype DATA -_mbsbtype -_mbscat -_mbschr -_mbscmp -_mbscpy -_mbscspn -_mbsdec -_mbsdup -_mbsicmp -_mbsinc -_mbslen -_mbslwr -_mbsnbcat -_mbsnbcmp -_mbsnbcnt -_mbsnbcpy -_mbsnbicmp -_mbsnbset -_mbsncat -_mbsnccnt -_mbsncmp -_mbsncpy -_mbsnextc -_mbsnicmp -_mbsninc -_mbsnset -_mbspbrk -_mbsrchr -_mbsrev -_mbsset -_mbsspn -_mbsspnp -_mbsstr -_mbstok -_mbstrlen -_mbsupr -_memccpy -_memicmp=NTDLL._memicmp -_mkdir -_mktemp -_msize -_nextafter -_onexit -_open -_open_osfhandle -_osmajor_dll=CRTDLL__osmajor_dll DATA -_osminor_dll=CRTDLL__osminor_dll DATA -_osmode_dll=CRTDLL__osmode_dll DATA -_osver_dll=_osver DATA -_osversion_dll=CRTDLL__osversion_dll DATA -_pclose -_pctype_dll=_pctype DATA -_pgmptr_dll=_pgmptr DATA -_pipe -_popen -_purecall -_putch -_putenv -_putw -_pwctype_dll=_pwctype DATA -_read -_rmdir -_rmtmp -_rotl -_rotr -_scalb -_searchenv -_seterrormode -_setjmp -_setmode -_setsystime -_sleep -_snprintf -_snwprintf -_sopen -_spawnl -_spawnle -_spawnlp -_spawnlpe -_spawnv -_spawnve -_spawnvp -_spawnvpe -_splitpath=NTDLL._splitpath -_stat=CRTDLL__stat -_statusfp -_strcmpi=NTDLL._strcmpi -_strdate -_strdec -_strdup -_strerror -_stricmp=NTDLL._stricmp -_stricoll -_strinc -_strlwr=NTDLL._strlwr -_strncnt -_strnextc -_strnicmp=NTDLL._strnicmp -_strninc -_strnset -_strrev -_strset -_strspnp -_strtime -_strupr=NTDLL._strupr -_swab -_sys_errlist DATA -_sys_nerr_dll=_sys_nerr DATA -_tell -_tempnam -_timezone_dll=_timezone -_tolower=NTDLL._tolower -_toupper=NTDLL._toupper -_tzname DATA -_tzset -_ultoa=NTDLL._ultoa -_ultow=NTDLL._ultow -_umask -_ungetch -_unlink -_unloaddll -_utime -_vsnprintf -_vsnwprintf -_wcsdup -_wcsicmp -_wcsicoll -_wcslwr -_wcsnicmp=NTDLL._wcsnicmp -_wcsnset -_wcsrev -_wcsset -_wcsupr -_winmajor_dll=_winmajor DATA -_winminor_dll=_winminor DATA -_winver_dll=_winver DATA -_write -_wtoi=NTDLL._wtoi -_wtol=NTDLL._wtol -_y0 -_y1 -_yn -abort -abs=NTDLL.abs -acos -asctime -asin -atan=NTDLL.atan -atan2 -atexit -atof -atoi=NTDLL.atoi -atol=NTDLL.atol -bsearch=NTDLL.bsearch -calloc -ceil=NTDLL.ceil -clearerr -clock -cos=NTDLL.cos -cosh -ctime -difftime -div -exit -exp -fabs=NTDLL.fabs -fclose -feof -ferror -fflush -fgetc -fgetpos -fgets -fgetwc -floor=NTDLL.floor -fmod -fopen -fprintf -fputc -fputs -fputwc -fread -free -freopen -frexp -fscanf -fseek -fsetpos -ftell -fwprintf -fwrite -fwscanf -getc -getchar -getenv -gets -gmtime -is_wctype -isalnum=NTDLL.isalnum -isalpha=NTDLL.isalpha -iscntrl=NTDLL.iscntrl -isdigit=NTDLL.isdigit -isgraph=NTDLL.isgraph -isleadbyte -islower=NTDLL.islower -isprint=NTDLL.isprint -ispunct=NTDLL.ispunct -isspace=NTDLL.isspace -isupper=NTDLL.isupper -iswalnum -iswalpha=NTDLL.iswalpha -iswascii -iswcntrl -iswctype=NTDLL.iswctype -iswdigit=NTDLL.iswdigit -iswgraph -iswlower=NTDLL.iswlower -iswprint -iswpunct -iswspace=NTDLL.iswspace -iswupper -iswxdigit=NTDLL.iswxdigit -isxdigit=NTDLL.isxdigit -labs=NTDLL.labs -ldexp -ldiv -localeconv -localtime -log=NTDLL.log -log10 -longjmp -malloc -mblen -mbstowcs=NTDLL.mbstowcs -mbtowc -memchr=NTDLL.memchr -memcmp=NTDLL.memcmp -memcpy=NTDLL.memcpy -memmove=NTDLL.memmove -memset -mktime -modf -perror -pow -printf -putc -putchar -puts -qsort=NTDLL.qsort -raise -rand -realloc -remove -rename -rewind -scanf -setbuf -setlocale -setvbuf -signal -sin=NTDLL.sin -sinh -sprintf -sqrt=NTDLL.sqrt -srand -sscanf -strcat -strchr -strcmp=NTDLL.strcmp -strcoll -strcpy -strcspn -strerror -strftime -strlen -strncat -strncmp -strncpy -strpbrk=NTDLL.strpbrk -strrchr -strspn -strstr=NTDLL.strstr -strtod -strtok -strtol=NTDLL.strtol -strtoul -strtoull -strxfrm -swprintf -swscanf -system -tan=NTDLL.tan -tanh -time -tmpfile -tmpnam -tolower=NTDLL.tolower -toupper=NTDLL.toupper -towlower=NTDLL.towlower -towupper=NTDLL.towupper -ungetc -ungetwc -vfprintf -vfwprintf -vprintf -vsprintf -vswprintf -vwprintf -wcscat -wcschr -wcscmp -wcscoll -wcscpy -wcscspn -wcsftime -wcslen -wcsncat -wcsncmp -wcsncpy -wcspbrk -wcsrchr -wcsspn -wcsstr -wcstod -wcstok -wcstol=NTDLL.wcstol -wcstombs -wcstoul=NTDLL.wcstoul -wcsxfrm -wctomb -wprintf -wscanf diff --git a/reactos/dll/win32/crtdll/crtdll.rbuild b/reactos/dll/win32/crtdll/crtdll.rbuild index d69b3c04a94..eec388fba04 100644 --- a/reactos/dll/win32/crtdll/crtdll.rbuild +++ b/reactos/dll/win32/crtdll/crtdll.rbuild @@ -1,11 +1,11 @@ - + . include 0x600 0x501 - + @@ -22,4 +22,5 @@ precomp.h dllmain.c crtdll.rc + crtdll.spec diff --git a/reactos/dll/win32/crtdll/crtdll.spec b/reactos/dll/win32/crtdll/crtdll.spec new file mode 100644 index 00000000000..8dd6d32c928 --- /dev/null +++ b/reactos/dll/win32/crtdll/crtdll.spec @@ -0,0 +1,527 @@ +# Old C runtime library. All functions provided by msvcrt + + @ cdecl ??2@YAPAXI@Z(long) msvcrt.??2@YAPAXI@Z + @ cdecl ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z + @ cdecl ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z + @ cdecl _CIacos() msvcrt._CIacos + @ cdecl _CIasin() msvcrt._CIasin + @ cdecl _CIatan() msvcrt._CIatan + @ cdecl _CIatan2() msvcrt._CIatan2 + @ cdecl _CIcos() msvcrt._CIcos + @ cdecl _CIcosh() msvcrt._CIcosh + @ cdecl _CIexp() msvcrt._CIexp + @ cdecl _CIfmod() msvcrt._CIfmod + @ cdecl _CIlog() msvcrt._CIlog + @ cdecl _CIlog10() msvcrt._CIlog10 + @ cdecl _CIpow() msvcrt._CIpow + @ cdecl _CIsin() msvcrt._CIsin + @ cdecl _CIsinh() msvcrt._CIsinh + @ cdecl _CIsqrt() msvcrt._CIsqrt + @ cdecl _CItan() msvcrt._CItan + @ cdecl _CItanh() msvcrt._CItanh + @ extern _HUGE_dll msvcrt._HUGE + @ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter + @ cdecl __GetMainArgs(ptr ptr ptr long) + @ extern __argc_dll msvcrt.__argc + @ extern __argv_dll msvcrt.__argv + @ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit + @ cdecl __doserrno() msvcrt.__doserrno + @ cdecl __fpecode() msvcrt.__fpecode + @ cdecl __isascii(long) msvcrt.__isascii + @ cdecl __iscsym(long) msvcrt.__iscsym + @ cdecl __iscsymf(long) msvcrt.__iscsymf + @ extern __mb_cur_max_dll msvcrt.__mb_cur_max + @ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs + @ cdecl __threadhandle() msvcrt.__threadhandle + @ cdecl __threadid() msvcrt.__threadid + @ cdecl __toascii(long) msvcrt.__toascii + @ cdecl _abnormal_termination() msvcrt._abnormal_termination + @ cdecl _access(str long) msvcrt._access + @ extern _acmdln_dll msvcrt._acmdln + @ extern _aexit_rtn_dll msvcrt._aexit_rtn + @ cdecl _amsg_exit(long) msvcrt._amsg_exit + @ cdecl _assert(str str long) msvcrt._assert + @ extern _basemajor_dll CRTDLL__basemajor_dll + @ extern _baseminor_dll CRTDLL__baseminor_dll + @ extern _baseversion_dll CRTDLL__baseversion_dll + @ cdecl _beep(long long) msvcrt._beep + @ cdecl _beginthread(ptr long ptr) msvcrt._beginthread + @ cdecl _c_exit() msvcrt._c_exit + @ cdecl _cabs(long) msvcrt._cabs + @ cdecl _cexit() msvcrt._cexit + @ cdecl _cgets(str) msvcrt._cgets + @ cdecl _chdir(str) msvcrt._chdir + @ cdecl _chdrive(long) msvcrt._chdrive + @ cdecl _chgsign( double ) msvcrt._chgsign + @ cdecl _chmod(str long) msvcrt._chmod + @ cdecl _chsize(long long) msvcrt._chsize + @ cdecl _clearfp() msvcrt._clearfp + @ cdecl _close(long) msvcrt._close + @ cdecl _commit(long) msvcrt._commit + @ extern _commode_dll msvcrt._commode + @ cdecl _control87(long long) msvcrt._control87 + @ cdecl _controlfp(long long) msvcrt._controlfp + @ cdecl _copysign( double double ) msvcrt._copysign + @ varargs _cprintf(str) msvcrt._cprintf + @ extern _cpumode_dll CRTDLL__cpumode_dll + @ cdecl _cputs(str) msvcrt._cputs + @ cdecl _creat(str long) msvcrt._creat + @ varargs _cscanf(str) msvcrt._cscanf + @ extern _ctype msvcrt._ctype + @ cdecl _cwait(ptr long long) msvcrt._cwait + @ extern _daylight_dll msvcrt._daylight + @ cdecl _dup(long) msvcrt._dup + @ cdecl _dup2(long long) msvcrt._dup2 + @ cdecl _ecvt( double long ptr ptr) msvcrt._ecvt + @ cdecl _endthread() msvcrt._endthread + @ extern _environ_dll msvcrt._environ + @ cdecl _eof(long) msvcrt._eof + @ cdecl _errno() msvcrt._errno + @ cdecl _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 + @ varargs _execl(str str) msvcrt._execl + @ varargs _execle(str str) msvcrt._execle + @ varargs _execlp(str str) msvcrt._execlp + @ varargs _execlpe(str str) msvcrt._execlpe + @ cdecl _execv(str str) msvcrt._execv + @ cdecl _execve(str str str) msvcrt._execve + @ cdecl _execvp(str str) msvcrt._execvp + @ cdecl _execvpe(str str str) msvcrt._execvpe + @ cdecl _exit(long) msvcrt._exit + @ cdecl _expand(ptr long) msvcrt._expand + @ cdecl _fcloseall() msvcrt._fcloseall + @ cdecl _fcvt( double long ptr ptr) msvcrt._fcvt + @ cdecl _fdopen(long str) msvcrt._fdopen + @ cdecl _fgetchar() msvcrt._fgetchar + @ cdecl _fgetwchar() msvcrt._fgetwchar + @ cdecl _filbuf(ptr) msvcrt._filbuf + @ extern _fileinfo_dll msvcrt._fileinfo + @ cdecl _filelength(long) msvcrt._filelength + @ cdecl _fileno(ptr) msvcrt._fileno + @ cdecl _findclose(long) msvcrt._findclose + @ cdecl _findfirst(str ptr) msvcrt._findfirst + @ cdecl _findnext(long ptr) msvcrt._findnext + @ cdecl _finite( double ) msvcrt._finite + @ cdecl _flsbuf(long ptr) msvcrt._flsbuf + @ cdecl _flushall() msvcrt._flushall + @ extern _fmode_dll msvcrt._fmode + @ cdecl _fpclass(double) msvcrt._fpclass + @ cdecl _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt + @ cdecl _fpreset() msvcrt._fpreset + @ cdecl _fputchar(long) msvcrt._fputchar + @ cdecl _fputwchar(long) msvcrt._fputwchar + @ cdecl _fsopen(str str long) msvcrt._fsopen + @ cdecl _fstat(long ptr) CRTDLL__fstat + @ cdecl _ftime(ptr) msvcrt._ftime + @ cdecl -ret64 _ftol() msvcrt._ftol + @ cdecl _fullpath(ptr str long) msvcrt._fullpath + @ cdecl _futime(long ptr) msvcrt._futime + @ cdecl _gcvt( double long str) msvcrt._gcvt + @ cdecl _get_osfhandle(long) msvcrt._get_osfhandle + @ cdecl _getch() msvcrt._getch + @ cdecl _getche() msvcrt._getche + @ cdecl _getcwd(str long) msvcrt._getcwd + @ cdecl _getdcwd(long str long) msvcrt._getdcwd + @ cdecl _getdiskfree(long ptr) msvcrt._getdiskfree + @ cdecl _getdllprocaddr(long str long) msvcrt._getdllprocaddr + @ cdecl _getdrive() msvcrt._getdrive + @ cdecl _getdrives() msvcrt._getdrives + @ cdecl _getpid() msvcrt._getpid + @ cdecl _getsystime(ptr) msvcrt._getsystime + @ cdecl _getw(ptr) msvcrt._getw + @ cdecl _global_unwind2(ptr) msvcrt._global_unwind2 + @ cdecl _heapchk() msvcrt._heapchk + @ cdecl _heapmin() msvcrt._heapmin + @ cdecl _heapset(long) msvcrt._heapset + @ cdecl _heapwalk(ptr) msvcrt._heapwalk + @ cdecl _hypot(double double) msvcrt._hypot + @ cdecl _initterm(ptr ptr) msvcrt._initterm + @ extern _iob msvcrt._iob + @ cdecl _isatty(long) msvcrt._isatty + @ cdecl _isctype(long long) msvcrt._isctype + @ cdecl _ismbbalnum(long) msvcrt._ismbbalnum + @ cdecl _ismbbalpha(long) msvcrt._ismbbalpha + @ cdecl _ismbbgraph(long) msvcrt._ismbbgraph + @ cdecl _ismbbkalnum(long) msvcrt._ismbbkalnum + @ cdecl _ismbbkana(long) msvcrt._ismbbkana + @ cdecl _ismbbkpunct(long) msvcrt._ismbbkpunct + @ cdecl _ismbblead(long) msvcrt._ismbblead + @ cdecl _ismbbprint(long) msvcrt._ismbbprint + @ cdecl _ismbbpunct(long) msvcrt._ismbbpunct + @ cdecl _ismbbtrail(long) msvcrt._ismbbtrail + @ cdecl _ismbcalpha(long) msvcrt._ismbcalpha + @ cdecl _ismbcdigit(long) msvcrt._ismbcdigit + @ cdecl _ismbchira(long) msvcrt._ismbchira + @ cdecl _ismbckata(long) msvcrt._ismbckata + @ cdecl _ismbcl0(long) msvcrt._ismbcl0 + @ cdecl _ismbcl1(long) msvcrt._ismbcl1 + @ cdecl _ismbcl2(long) msvcrt._ismbcl2 + @ cdecl _ismbclegal(long) msvcrt._ismbclegal + @ cdecl _ismbclower(long) msvcrt._ismbclower + @ cdecl _ismbcprint(long) msvcrt._ismbcprint + @ cdecl _ismbcspace(long) msvcrt._ismbcspace + @ cdecl _ismbcsymbol(long) msvcrt._ismbcsymbol + @ cdecl _ismbcupper(long) msvcrt._ismbcupper + @ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead + @ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail + @ cdecl _isnan( double ) msvcrt._isnan + @ cdecl _itoa(long ptr long) msvcrt._itoa + @ cdecl _itow(long ptr long) msvcrt._itow + @ cdecl _j0(double) msvcrt._j0 + @ cdecl _j1(double) msvcrt._j1 + @ cdecl _jn(long double) msvcrt._jn + @ cdecl _kbhit() msvcrt._kbhit + @ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind + @ cdecl _loaddll(str) msvcrt._loaddll + @ cdecl _local_unwind2(ptr long) msvcrt._local_unwind2 + @ cdecl _locking(long long long) msvcrt._locking + @ cdecl _logb( double ) msvcrt._logb + @ cdecl _lrotl(long long) msvcrt._lrotl + @ cdecl _lrotr(long long) msvcrt._lrotr + @ cdecl _lsearch(ptr ptr long long ptr) msvcrt._lsearch + @ cdecl _lseek(long long long) msvcrt._lseek + @ cdecl _ltoa(long ptr long) msvcrt._ltoa + @ cdecl _ltow(long ptr long) msvcrt._ltow + @ cdecl _makepath(str str str str str) msvcrt._makepath + @ cdecl _matherr(ptr) msvcrt._matherr + @ cdecl _mbbtombc(long) msvcrt._mbbtombc + @ cdecl _mbbtype(long long) msvcrt._mbbtype + @ cdecl _mbccpy(str str) msvcrt._mbccpy + @ cdecl _mbcjistojms(long) msvcrt._mbcjistojms + @ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis + @ cdecl _mbclen(ptr) msvcrt._mbclen + @ cdecl _mbctohira(long) msvcrt._mbctohira + @ cdecl _mbctokata(long) msvcrt._mbctokata + @ cdecl _mbctolower(long) msvcrt._mbctolower + @ cdecl _mbctombb(long) msvcrt._mbctombb + @ cdecl _mbctoupper(long) msvcrt._mbctoupper + @ extern _mbctype msvcrt._mbctype + @ cdecl _mbsbtype(str long) msvcrt._mbsbtype + @ cdecl _mbscat(str str) msvcrt._mbscat + @ cdecl _mbschr(str long) msvcrt._mbschr + @ cdecl _mbscmp(str str) msvcrt._mbscmp + @ cdecl _mbscpy(ptr str) msvcrt._mbscpy + @ cdecl _mbscspn(str str) msvcrt._mbscspn + @ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec + @ cdecl _mbsdup(str) msvcrt._mbsdup + @ cdecl _mbsicmp(str str) msvcrt._mbsicmp + @ cdecl _mbsinc(str) msvcrt._mbsinc + @ cdecl _mbslen(str) msvcrt._mbslen + @ cdecl _mbslwr(str) msvcrt._mbslwr + @ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat + @ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp + @ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt + @ cdecl _mbsnbcpy(ptr str long) msvcrt._mbsnbcpy + @ cdecl _mbsnbicmp(str str long) msvcrt._mbsnbicmp + @ cdecl _mbsnbset(str long long) msvcrt._mbsnbset + @ cdecl _mbsncat(str str long) msvcrt._mbsncat + @ cdecl _mbsnccnt(str long) msvcrt._mbsnccnt + @ cdecl _mbsncmp(str str long) msvcrt._mbsncmp + @ cdecl _mbsncpy(str str long) msvcrt._mbsncpy + @ cdecl _mbsnextc(str) msvcrt._mbsnextc + @ cdecl _mbsnicmp(str str long) msvcrt._mbsnicmp + @ cdecl _mbsninc(str long) msvcrt._mbsninc + @ cdecl _mbsnset(str long long) msvcrt._mbsnset + @ cdecl _mbspbrk(str str) msvcrt._mbspbrk + @ cdecl _mbsrchr(str long) msvcrt._mbsrchr + @ cdecl _mbsrev(str) msvcrt._mbsrev + @ cdecl _mbsset(str long) msvcrt._mbsset + @ cdecl _mbsspn(str str) msvcrt._mbsspn + @ cdecl _mbsspnp(str str) msvcrt._mbsspnp + @ cdecl _mbsstr(str str) msvcrt._mbsstr + @ cdecl _mbstok(str str) msvcrt._mbstok + @ cdecl _mbstrlen(str) msvcrt._mbstrlen + @ cdecl _mbsupr(str) msvcrt._mbsupr + @ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy + @ cdecl _memicmp(str str long) msvcrt._memicmp + @ cdecl _mkdir(str) msvcrt._mkdir + @ cdecl _mktemp(str) msvcrt._mktemp + @ cdecl _msize(ptr) msvcrt._msize + @ cdecl _nextafter(double double) msvcrt._nextafter + @ cdecl _onexit(ptr) msvcrt._onexit + @ varargs _open(str long) msvcrt._open + @ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle + @ extern _osmajor_dll CRTDLL__osmajor_dll + @ extern _osminor_dll CRTDLL__osminor_dll + @ extern _osmode_dll CRTDLL__osmode_dll + @ extern _osver_dll msvcrt._osver + @ extern _osversion_dll CRTDLL__osversion_dll + @ cdecl _pclose(ptr) msvcrt._pclose + @ extern _pctype_dll msvcrt._pctype + @ extern _pgmptr_dll msvcrt._pgmptr + @ cdecl _pipe(ptr long long) msvcrt._pipe + @ cdecl _popen(str str) msvcrt._popen + @ cdecl _purecall() msvcrt._purecall + @ cdecl _putch(long) msvcrt._putch + @ cdecl _putenv(str) msvcrt._putenv + @ cdecl _putw(long ptr) msvcrt._putw + @ extern _pwctype_dll msvcrt._pwctype + @ cdecl _read(long ptr long) msvcrt._read + @ cdecl _rmdir(str) msvcrt._rmdir + @ cdecl _rmtmp() msvcrt._rmtmp + @ cdecl _rotl(long long) msvcrt._rotl + @ cdecl _rotr(long long) msvcrt._rotr + @ cdecl _scalb( double long) msvcrt._scalb + @ cdecl _searchenv(str str ptr) msvcrt._searchenv + @ cdecl _seterrormode(long) msvcrt._seterrormode + @ cdecl -i386 _setjmp(ptr) msvcrt._setjmp + @ cdecl _setmode(long long) msvcrt._setmode + @ cdecl _setsystime(ptr long) msvcrt._setsystime + @ cdecl _sleep(long) msvcrt._sleep + @ varargs _snprintf(str long str) msvcrt._snprintf + @ varargs _snwprintf(wstr long wstr) msvcrt._snwprintf + @ varargs _sopen(str long long) msvcrt._sopen + @ varargs _spawnl(long str str) msvcrt._spawnl + @ varargs _spawnle(long str str) msvcrt._spawnle + @ varargs _spawnlp(long str str) msvcrt._spawnlp + @ varargs _spawnlpe(long str str) msvcrt._spawnlpe + @ cdecl _spawnv(long str ptr) msvcrt._spawnv + @ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve + @ cdecl _spawnvp(long str ptr) msvcrt._spawnvp + @ cdecl _spawnvpe(long str ptr ptr) msvcrt._spawnvpe + @ cdecl _splitpath(str ptr ptr ptr ptr) msvcrt._splitpath + @ cdecl _stat(str ptr) CRTDLL__stat + @ cdecl _statusfp() msvcrt._statusfp + @ cdecl _strcmpi(str str) msvcrt._strcmpi + @ cdecl _strdate(ptr) msvcrt._strdate + @ cdecl _strdec(str str) + @ cdecl _strdup(str) msvcrt._strdup + @ cdecl _strerror(long) msvcrt._strerror + @ cdecl _stricmp(str str) msvcrt._stricmp + @ cdecl _stricoll(str str) msvcrt._stricoll + @ cdecl _strinc(str) + @ cdecl _strlwr(str) msvcrt._strlwr + @ cdecl _strncnt(str long) + @ cdecl _strnextc(str) + @ cdecl _strnicmp(str str long) msvcrt._strnicmp + @ cdecl _strninc(str long) + @ cdecl _strnset(str long long) msvcrt._strnset + @ cdecl _strrev(str) msvcrt._strrev + @ cdecl _strset(str long) msvcrt._strset + @ cdecl _strspnp(str str) + @ cdecl _strtime(ptr) msvcrt._strtime + @ cdecl _strupr(str) msvcrt._strupr + @ cdecl _swab(str str long) msvcrt._swab + @ extern _sys_errlist msvcrt._sys_errlist + @ extern _sys_nerr_dll msvcrt._sys_nerr + @ cdecl _tell(long) msvcrt._tell + @ cdecl _tempnam(str str) msvcrt._tempnam + @ extern _timezone_dll msvcrt._timezone + @ cdecl _tolower(long) msvcrt._tolower + @ cdecl _toupper(long) msvcrt._toupper + @ extern _tzname msvcrt._tzname + @ cdecl _tzset() msvcrt._tzset + @ cdecl _ultoa(long ptr long) msvcrt._ultoa + @ cdecl _umask(long) msvcrt._umask + @ cdecl _ungetch(long) msvcrt._ungetch + @ cdecl _unlink(str) msvcrt._unlink + @ cdecl _unloaddll(long) msvcrt._unloaddll + @ cdecl _utime(str ptr) msvcrt._utime + @ cdecl _vsnprintf(ptr long ptr ptr) msvcrt._vsnprintf + @ cdecl _vsnwprintf(ptr long wstr long) msvcrt._vsnwprintf + @ cdecl _wcsdup(wstr) msvcrt._wcsdup + @ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp + @ cdecl _wcsicoll(wstr wstr) msvcrt._wcsicoll + @ cdecl _wcslwr(wstr) msvcrt._wcslwr + @ cdecl _wcsnicmp(wstr wstr long) msvcrt._wcsnicmp + @ cdecl _wcsnset(wstr long long) msvcrt._wcsnset + @ cdecl _wcsrev(wstr) msvcrt._wcsrev + @ cdecl _wcsset(wstr long) msvcrt._wcsset + @ cdecl _wcsupr(wstr) msvcrt._wcsupr + @ extern _winmajor_dll msvcrt._winmajor + @ extern _winminor_dll msvcrt._winminor + @ extern _winver_dll msvcrt._winver + @ cdecl _write(long ptr long) msvcrt._write + @ cdecl _wtoi(wstr) msvcrt._wtoi + @ cdecl _wtol(wstr) msvcrt._wtol + @ cdecl _y0(double) msvcrt._y0 + @ cdecl _y1(double) msvcrt._y1 + @ cdecl _yn(long double ) msvcrt._yn + @ cdecl abort() msvcrt.abort + @ cdecl abs(long) msvcrt.abs + @ cdecl acos(double) msvcrt.acos + @ cdecl asctime(ptr) msvcrt.asctime + @ cdecl asin(double) msvcrt.asin + @ cdecl atan(double) msvcrt.atan + @ cdecl atan2(double double) msvcrt.atan2 + @ cdecl atexit(ptr) msvcrt.atexit + @ cdecl atof(str) msvcrt.atof + @ cdecl atoi(str) msvcrt.atoi + @ cdecl atol(str) msvcrt.atol + @ cdecl bsearch(ptr ptr long long ptr) msvcrt.bsearch + @ cdecl calloc(long long) msvcrt.calloc + @ cdecl ceil(double) msvcrt.ceil + @ cdecl clearerr(ptr) msvcrt.clearerr + @ cdecl clock() msvcrt.clock + @ cdecl cos(double) msvcrt.cos + @ cdecl cosh(double) msvcrt.cosh + @ cdecl ctime(ptr) msvcrt.ctime + @ cdecl difftime(long long) msvcrt.difftime + @ cdecl div(long long) msvcrt.div + @ cdecl exit(long) msvcrt.exit + @ cdecl exp(double) msvcrt.exp + @ cdecl fabs(double) msvcrt.fabs + @ cdecl fclose(ptr) msvcrt.fclose + @ cdecl feof(ptr) msvcrt.feof + @ cdecl ferror(ptr) msvcrt.ferror + @ cdecl fflush(ptr) msvcrt.fflush + @ cdecl fgetc(ptr) msvcrt.fgetc + @ cdecl fgetpos(ptr ptr) msvcrt.fgetpos + @ cdecl fgets(ptr long ptr) msvcrt.fgets + @ cdecl fgetwc(ptr) msvcrt.fgetwc + @ cdecl floor(double) msvcrt.floor + @ cdecl fmod(double double) msvcrt.fmod + @ cdecl fopen(str str) msvcrt.fopen + @ varargs fprintf(ptr str) msvcrt.fprintf + @ cdecl fputc(long ptr) msvcrt.fputc + @ cdecl fputs(str ptr) msvcrt.fputs + @ cdecl fputwc(long ptr) msvcrt.fputwc + @ cdecl fread(ptr long long ptr) msvcrt.fread + @ cdecl free(ptr) msvcrt.free + @ cdecl freopen(str str ptr) msvcrt.freopen + @ cdecl frexp(double ptr) msvcrt.frexp + @ varargs fscanf(ptr str) msvcrt.fscanf + @ cdecl fseek(ptr long long) msvcrt.fseek + @ cdecl fsetpos(ptr ptr) msvcrt.fsetpos + @ cdecl ftell(ptr) msvcrt.ftell + @ varargs fwprintf(ptr wstr) msvcrt.fwprintf + @ cdecl fwrite(ptr long long ptr) msvcrt.fwrite + @ varargs fwscanf(ptr wstr) msvcrt.fwscanf + @ cdecl getc(ptr) msvcrt.getc + @ cdecl getchar() msvcrt.getchar + @ cdecl getenv(str) msvcrt.getenv + @ cdecl gets(str) msvcrt.gets + @ cdecl gmtime(ptr) msvcrt.gmtime + @ cdecl is_wctype(long long) msvcrt.is_wctype + @ cdecl isalnum(long) msvcrt.isalnum + @ cdecl isalpha(long) msvcrt.isalpha + @ cdecl iscntrl(long) msvcrt.iscntrl + @ cdecl isdigit(long) msvcrt.isdigit + @ cdecl isgraph(long) msvcrt.isgraph + @ cdecl isleadbyte(long) msvcrt.isleadbyte + @ cdecl islower(long) msvcrt.islower + @ cdecl isprint(long) msvcrt.isprint + @ cdecl ispunct(long) msvcrt.ispunct + @ cdecl isspace(long) msvcrt.isspace + @ cdecl isupper(long) msvcrt.isupper + @ cdecl iswalnum(long) msvcrt.iswalnum + @ cdecl iswalpha(long) msvcrt.iswalpha + @ cdecl iswascii(long) msvcrt.iswascii + @ cdecl iswcntrl(long) msvcrt.iswcntrl + @ cdecl iswctype(long long) msvcrt.iswctype + @ cdecl iswdigit(long) msvcrt.iswdigit + @ cdecl iswgraph(long) msvcrt.iswgraph + @ cdecl iswlower(long) msvcrt.iswlower + @ cdecl iswprint(long) msvcrt.iswprint + @ cdecl iswpunct(long) msvcrt.iswpunct + @ cdecl iswspace(long) msvcrt.iswspace + @ cdecl iswupper(long) msvcrt.iswupper + @ cdecl iswxdigit(long) msvcrt.iswxdigit + @ cdecl isxdigit(long) msvcrt.isxdigit + @ cdecl labs(long) msvcrt.labs + @ cdecl ldexp( double long) msvcrt.ldexp + @ cdecl ldiv(long long) msvcrt.ldiv + @ cdecl localeconv() msvcrt.localeconv + @ cdecl localtime(ptr) msvcrt.localtime + @ cdecl log(double) msvcrt.log + @ cdecl log10(double) msvcrt.log10 + @ cdecl -i386 longjmp(ptr long) msvcrt.longjmp + @ cdecl malloc(long) msvcrt.malloc + @ cdecl mblen(ptr long) msvcrt.mblen + @ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs + @ cdecl mbtowc(wstr str long) msvcrt.mbtowc + @ cdecl memchr(ptr long long) msvcrt.memchr + @ cdecl memcmp(ptr ptr long) msvcrt.memcmp + @ cdecl memcpy(ptr ptr long) msvcrt.memcpy + @ cdecl memmove(ptr ptr long) msvcrt.memmove + @ cdecl memset(ptr long long) msvcrt.memset + @ cdecl mktime(ptr) msvcrt.mktime + @ cdecl modf(double ptr) msvcrt.modf + @ cdecl perror(str) msvcrt.perror + @ cdecl pow(double double) msvcrt.pow + @ varargs printf(str) msvcrt.printf + @ cdecl putc(long ptr) msvcrt.putc + @ cdecl putchar(long) msvcrt.putchar + @ cdecl puts(str) msvcrt.puts + @ cdecl qsort(ptr long long ptr) msvcrt.qsort + @ cdecl raise(long) msvcrt.raise + @ cdecl rand() msvcrt.rand + @ cdecl realloc(ptr long) msvcrt.realloc + @ cdecl remove(str) msvcrt.remove + @ cdecl rename(str str) msvcrt.rename + @ cdecl rewind(ptr) msvcrt.rewind + @ varargs scanf(str) msvcrt.scanf + @ cdecl setbuf(ptr ptr) msvcrt.setbuf + @ cdecl setlocale(long str) msvcrt.setlocale + @ cdecl setvbuf(ptr str long long) msvcrt.setvbuf + @ cdecl signal(long long) msvcrt.signal + @ cdecl sin(double) msvcrt.sin + @ cdecl sinh(double) msvcrt.sinh + @ varargs sprintf(ptr str) msvcrt.sprintf + @ cdecl sqrt(double) msvcrt.sqrt + @ cdecl srand(long) msvcrt.srand + @ varargs sscanf(str str) msvcrt.sscanf + @ cdecl strcat(str str) msvcrt.strcat + @ cdecl strchr(str long) msvcrt.strchr + @ cdecl strcmp(str str) msvcrt.strcmp + @ cdecl strcoll(str str) msvcrt.strcoll + @ cdecl strcpy(ptr str) msvcrt.strcpy + @ cdecl strcspn(str str) msvcrt.strcspn + @ cdecl strerror(long) msvcrt.strerror + @ cdecl strftime(str long str ptr) msvcrt.strftime + @ cdecl strlen(str) msvcrt.strlen + @ cdecl strncat(str str long) msvcrt.strncat + @ cdecl strncmp(str str long) msvcrt.strncmp + @ cdecl strncpy(ptr str long) msvcrt.strncpy + @ cdecl strpbrk(str str) msvcrt.strpbrk + @ cdecl strrchr(str long) msvcrt.strrchr + @ cdecl strspn(str str) msvcrt.strspn + @ cdecl strstr(str str) msvcrt.strstr + @ cdecl strtod(str ptr) msvcrt.strtod + @ cdecl strtok(str str) msvcrt.strtok + @ cdecl strtol(str ptr long) msvcrt.strtol + @ cdecl strtoul(str ptr long) msvcrt.strtoul + @ cdecl strxfrm(ptr str long) msvcrt.strxfrm + @ varargs swprintf(wstr wstr) msvcrt.swprintf + @ varargs swscanf(wstr wstr) msvcrt.swscanf + @ cdecl system(str) msvcrt.system + @ cdecl tan(double) msvcrt.tan + @ cdecl tanh(double) msvcrt.tanh + @ cdecl time(ptr) msvcrt.time + @ cdecl tmpfile() msvcrt.tmpfile + @ cdecl tmpnam(str) msvcrt.tmpnam + @ cdecl tolower(long) msvcrt.tolower + @ cdecl toupper(long) msvcrt.toupper + @ cdecl towlower(long) msvcrt.towlower + @ cdecl towupper(long) msvcrt.towupper + @ cdecl ungetc(long ptr) msvcrt.ungetc + @ cdecl ungetwc(long ptr) msvcrt.ungetwc + @ cdecl vfprintf(ptr str long) msvcrt.vfprintf + @ cdecl vfwprintf(ptr wstr long) msvcrt.vfwprintf + @ cdecl vprintf(str long) msvcrt.vprintf + @ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf + @ cdecl vswprintf(ptr wstr long) msvcrt.vswprintf + @ cdecl vwprintf(wstr long) msvcrt.vwprintf + @ cdecl wcscat(wstr wstr) msvcrt.wcscat + @ cdecl wcschr(wstr long) msvcrt.wcschr + @ cdecl wcscmp(wstr wstr) msvcrt.wcscmp + @ cdecl wcscoll(wstr wstr) msvcrt.wcscoll + @ cdecl wcscpy(ptr wstr) msvcrt.wcscpy + @ cdecl wcscspn(wstr wstr) msvcrt.wcscspn + @ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime + @ cdecl wcslen(wstr) msvcrt.wcslen + @ cdecl wcsncat(wstr wstr long) msvcrt.wcsncat + @ cdecl wcsncmp(wstr wstr long) msvcrt.wcsncmp + @ cdecl wcsncpy(ptr wstr long) msvcrt.wcsncpy + @ cdecl wcspbrk(wstr wstr) msvcrt.wcspbrk + @ cdecl wcsrchr(wstr long) msvcrt.wcsrchr + @ cdecl wcsspn(wstr wstr) msvcrt.wcsspn + @ cdecl wcsstr(wstr wstr) msvcrt.wcsstr + @ cdecl wcstod(wstr ptr) msvcrt.wcstod + @ cdecl wcstok(wstr wstr) msvcrt.wcstok + @ cdecl wcstol(wstr ptr long) msvcrt.wcstol + @ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs + @ cdecl wcstoul(wstr ptr long) msvcrt.wcstoul + @ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm + @ cdecl wctomb(ptr long) msvcrt.wctomb + @ varargs wprintf(wstr) msvcrt.wprintf + @ varargs wscanf(wstr) msvcrt.wscanf From adfa1e69ba73f8e1f87e64df3ac6aee07e1e0851 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 29 Aug 2008 08:09:44 +0000 Subject: [PATCH 195/388] commit missing file svn path=/branches/ros-amd64-bringup/; revision=35747 From 593088a73e5441b4f614a538c9abdb1b772434d1 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 29 Aug 2008 16:39:06 +0000 Subject: [PATCH 196/388] Convert fmifs and lsasrv to spec files. svn path=/branches/ros-amd64-bringup/; revision=35762 --- reactos/dll/win32/fmifs/fmifs.def | 31 ------------ reactos/dll/win32/fmifs/fmifs.rbuild | 3 +- reactos/dll/win32/fmifs/fmifs.spec | 18 +++++++ reactos/dll/win32/lsasrv/lsasrv.def | 68 -------------------------- reactos/dll/win32/lsasrv/lsasrv.rbuild | 5 +- reactos/dll/win32/lsasrv/lsasrv.spec | 65 ++++++++++++++++++++++++ 6 files changed, 88 insertions(+), 102 deletions(-) delete mode 100644 reactos/dll/win32/fmifs/fmifs.def create mode 100644 reactos/dll/win32/fmifs/fmifs.spec delete mode 100644 reactos/dll/win32/lsasrv/lsasrv.def create mode 100644 reactos/dll/win32/lsasrv/lsasrv.spec diff --git a/reactos/dll/win32/fmifs/fmifs.def b/reactos/dll/win32/fmifs/fmifs.def deleted file mode 100644 index e11b477941c..00000000000 --- a/reactos/dll/win32/fmifs/fmifs.def +++ /dev/null @@ -1,31 +0,0 @@ -; $Id$ -; -; fmifs.def -; -; Project : ReactOS -; Description : fmifs.dll exported symbols -; Contributors: -; Created by Emanuele Aliberti -; -; -; NOTE: Functions with trailing @0 are unknown. -; -LIBRARY fmifs.dll -EXPORTS -Chkdsk@36 -;ChkdskEx -;ComputeFmMediaType -DiskCopy@0 -EnableVolumeCompression@8 -Extend@0 -Format@0 -FormatEx@28 -;FormatEx2 -InitializeFmIfs@12 -QueryAvailableFileSystemFormat@20 -;QueryDeviceInformation -;QueryDeviceInformationByHandle -;QueryFileSystemName -;QueryLatestFileSystemVersion -QuerySupportedMedia@16 -SetLabel@8=KERNEL32.SetVolumeLabelW diff --git a/reactos/dll/win32/fmifs/fmifs.rbuild b/reactos/dll/win32/fmifs/fmifs.rbuild index f18924e0158..b3d73948ea6 100644 --- a/reactos/dll/win32/fmifs/fmifs.rbuild +++ b/reactos/dll/win32/fmifs/fmifs.rbuild @@ -1,5 +1,5 @@ - + . 0x0600 @@ -14,5 +14,6 @@ media.c query.c fmifs.rc + fmifs.spec precomp.h diff --git a/reactos/dll/win32/fmifs/fmifs.spec b/reactos/dll/win32/fmifs/fmifs.spec new file mode 100644 index 00000000000..e4e81b7c814 --- /dev/null +++ b/reactos/dll/win32/fmifs/fmifs.spec @@ -0,0 +1,18 @@ + + @ stdcall Chkdsk(wstr wstr long long long long ptr ptr ptr) + @ stub ChkdskEx + @ stub ComputeFmMediaType + @ stdcall DiskCopy() + @ stdcall EnableVolumeCompression(wstr long) + @ stdcall Extend() + @ stdcall Format() + @ stdcall FormatEx(wstr long wstr wstr long long ptr) + @ stub FormatEx2 + @ stdcall InitializeFmIfs(ptr long ptr) + @ stdcall QueryAvailableFileSystemFormat(long ptr str str long) + @ stub QueryDeviceInformation + @ stub QueryDeviceInformationByHandle + @ stub QueryFileSystemName + @ stub QueryLatestFileSystemVersion + @ stdcall QuerySupportedMedia(str ptr long ptr) + @ stdcall SetLabel(wstr wstr) kernel32.SetVolumeLabelW diff --git a/reactos/dll/win32/lsasrv/lsasrv.def b/reactos/dll/win32/lsasrv/lsasrv.def deleted file mode 100644 index fc6f4a39a60..00000000000 --- a/reactos/dll/win32/lsasrv/lsasrv.def +++ /dev/null @@ -1,68 +0,0 @@ -; $Id: lsasrv.def 12852 2005-01-06 13:58:04Z mf $ -LIBRARY lsasrv -EXPORTS -;LsaIAuditNotifyPackageLoad -;LsaIAuditSamEvent -;LsaIEnumerateSecrets -;LsaIFree_LSAI_PRIVATE_DATA -;LsaIFree_LSAI_SECRET_ENUM_BUFFER -;LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER -;LsaIFree_LSAPR_CR_CIPHER_VALUE -;LsaIFree_LSAPR_POLICY_INFORMATION -;LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER -;LsaIFree_LSAPR_PRIVILEGE_SET -;LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST -;LsaIFree_LSAPR_SR_SECURITY_DESCRIPTOR -;LsaIFree_LSAPR_TRANSLATED_NAMES -;LsaIFree_LSAPR_TRANSLATED_SIDS -;LsaIFree_LSAPR_TRUSTED_DOMAIN_INFO -;LsaIFree_LSAPR_TRUSTED_ENUM_BUFFER -;LsaIFree_LSAPR_TRUST_INFORMATION -;LsaIFree_LSAPR_UNICODE_STRING -;LsaIGetPrivateData -;LsaIGetSerialNumberPolicy -;LsaIGetSerialNumberPolicy2 -;LsaIHealthCheck -;LsaIInitializeWellKnownSids -;LsaIOpenPolicyTrusted -;LsaIQueryInformationPolicyTrusted -;LsaISetPrivateData -;LsaISetSerialNumberPolicy -;LsaISetTimesSecret -;LsaISetupWasRun -;LsapAuOpenSam -LsapInitLsa@0 -;LsarAddPrivilegesToAccount -;LsarClose -;LsarCreateAccount -;LsarCreateSecret -;LsarCreateTrustedDomain -;LsarDelete -;LsarEnumerateAccounts -;LsarEnumeratePrivileges -;LsarEnumeratePrivilegesAccount -;LsarEnumerateTrustedDomains -;LsarGetQuotasForAccount -;LsarGetSystemAccessAccount -;LsarLookupNames -;LsarLookupPrivilegeDisplayName -;LsarLookupPrivilegeName -;LsarLookupPrivilegeValue -;LsarLookupSids -;LsarOpenAccount -;LsarOpenPolicy -;LsarOpenSecret -;LsarOpenTrustedDomain -;LsarQueryInfoTrustedDomain -;LsarQueryInformationPolicy -;LsarQuerySecret -;LsarQuerySecurityObject -;LsarRemovePrivilegesFromAccount -;LsarSetInformationPolicy -;LsarSetInformationTrustedDomain -;LsarSetQuotasForAccount -;LsarSetSecret -;LsarSetSecurityObject -;LsarSetSystemAccessAccount -;ServiceInit -; EOF \ No newline at end of file diff --git a/reactos/dll/win32/lsasrv/lsasrv.rbuild b/reactos/dll/win32/lsasrv/lsasrv.rbuild index 8f1757c9e76..5614f96ed79 100644 --- a/reactos/dll/win32/lsasrv/lsasrv.rbuild +++ b/reactos/dll/win32/lsasrv/lsasrv.rbuild @@ -1,5 +1,5 @@ - + . . 0x600 @@ -13,4 +13,5 @@ lsarpc.c lsasrv.c lsasrv.rc - + lsasrv.spec + \ No newline at end of file diff --git a/reactos/dll/win32/lsasrv/lsasrv.spec b/reactos/dll/win32/lsasrv/lsasrv.spec new file mode 100644 index 00000000000..17f5d363039 --- /dev/null +++ b/reactos/dll/win32/lsasrv/lsasrv.spec @@ -0,0 +1,65 @@ + + @ stub LsaIAuditNotifyPackageLoad + @ stub LsaIAuditSamEvent + @ stub LsaIEnumerateSecrets + @ stub LsaIFree_LSAI_PRIVATE_DATA #DATA + @ stub LsaIFree_LSAI_SECRET_ENUM_BUFFER + @ stub LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER + @ stub LsaIFree_LSAPR_CR_CIPHER_VALUE + @ stub LsaIFree_LSAPR_POLICY_INFORMATION + @ stub LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER + @ stub LsaIFree_LSAPR_PRIVILEGE_SET + @ stub LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST + @ stub LsaIFree_LSAPR_SR_SECURITY_DESCRIPTOR + @ stub LsaIFree_LSAPR_TRANSLATED_NAMES + @ stub LsaIFree_LSAPR_TRANSLATED_SIDS + @ stub LsaIFree_LSAPR_TRUSTED_DOMAIN_INFO + @ stub LsaIFree_LSAPR_TRUSTED_ENUM_BUFFER + @ stub LsaIFree_LSAPR_TRUST_INFORMATION + @ stub LsaIFree_LSAPR_UNICODE_STRING + @ stub LsaIGetPrivateData + @ stub LsaIGetSerialNumberPolicy + @ stub LsaIGetSerialNumberPolicy2 + @ stub LsaIHealthCheck + @ stub LsaIInitializeWellKnownSids + @ stub LsaIOpenPolicyTrusted + @ stub LsaIQueryInformationPolicyTrusted + @ stub LsaISetPrivateData + @ stub LsaISetSerialNumberPolicy + @ stub LsaISetTimesSecret + @ stub LsaISetupWasRun + @ stub LsapAuOpenSam + @ stdcall LsapInitLsa() + @ stub LsarAddPrivilegesToAccount + @ stub LsarClose + @ stub LsarCreateAccount + @ stub LsarCreateSecret + @ stub LsarCreateTrustedDomain + @ stub LsarDelete + @ stub LsarEnumerateAccounts + @ stub LsarEnumeratePrivileges + @ stub LsarEnumeratePrivilegesAccount + @ stub LsarEnumerateTrustedDomains + @ stub LsarGetQuotasForAccount + @ stub LsarGetSystemAccessAccount + @ stub LsarLookupNames + @ stub LsarLookupPrivilegeDisplayName + @ stub LsarLookupPrivilegeName + @ stub LsarLookupPrivilegeValue + @ stub LsarLookupSids + @ stub LsarOpenAccount + @ stub LsarOpenPolicy + @ stub LsarOpenSecret + @ stub LsarOpenTrustedDomain + @ stub LsarQueryInfoTrustedDomain + @ stub LsarQueryInformationPolicy + @ stub LsarQuerySecret + @ stub LsarQuerySecurityObject + @ stub LsarRemovePrivilegesFromAccount + @ stub LsarSetInformationPolicy + @ stub LsarSetInformationTrustedDomain + @ stub LsarSetQuotasForAccount + @ stub LsarSetSecret + @ stub LsarSetSecurityObject + @ stub LsarSetSystemAccessAccount + @ stub ServiceInit From a7144a6e9b496b2a6a14db7d032e751e6c6d4ac8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 22:47:11 +0000 Subject: [PATCH 197/388] remove stuff from amd64 hal that doesn't belong there svn path=/branches/ros-amd64-bringup/; revision=35771 --- reactos/hal/halamd64/generic/hal.c | 177 ----------------------------- 1 file changed, 177 deletions(-) diff --git a/reactos/hal/halamd64/generic/hal.c b/reactos/hal/halamd64/generic/hal.c index c951feebfdc..c16b82b7cca 100644 --- a/reactos/hal/halamd64/generic/hal.c +++ b/reactos/hal/halamd64/generic/hal.c @@ -13,14 +13,6 @@ #include #include -#undef ExAcquireFastMutex -#undef ExReleaseFastMutex -#undef ExTryToAcquireFastMutex -#undef KeAcquireSpinLock -#undef KeLowerIrql -#undef KeRaiseIrql -#undef KeReleaseSpinLock - #define READ_REGISTER_ULONG(r) (*(volatile ULONG * const)(r)) #define WRITE_REGISTER_ULONG(r, v) (*(volatile ULONG *)(r) = (v)) @@ -786,173 +778,4 @@ HalSweepIcache(VOID) return; } -/* - * @implemented - */ -VOID -NTAPI -KeRaiseIrql(KIRQL NewIrql, - PKIRQL OldIrql) -{ - /* Call the fastcall function */ - *OldIrql = KfRaiseIrql(NewIrql); -} - -/* - * @implemented - */ -VOID -NTAPI -KeAcquireSpinLock(PKSPIN_LOCK SpinLock, - PKIRQL OldIrql) -{ - /* Call the fastcall function */ - *OldIrql = KfAcquireSpinLock(SpinLock); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock) -{ - /* Simply raise to dispatch */ - return KfRaiseIrql(DISPATCH_LEVEL); -} - -/* - * @implemented - */ -VOID -NTAPI -KeReleaseSpinLock(PKSPIN_LOCK SpinLock, - KIRQL NewIrql) -{ - /* Call the fastcall function */ - KfReleaseSpinLock(SpinLock, NewIrql); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KfAcquireSpinLock(PKSPIN_LOCK SpinLock) -{ - /* Simply raise to dispatch */ - return KfRaiseIrql(DISPATCH_LEVEL); -} - -/* - * @implemented - */ -VOID -FASTCALL -KfReleaseSpinLock(PKSPIN_LOCK SpinLock, - KIRQL OldIrql) -{ - /* Simply lower IRQL back */ - KeLowerIrql(OldIrql); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) -{ - /* Simply raise to dispatch */ - return KfRaiseIrql(DISPATCH_LEVEL); -} - -/* - * @implemented - */ -KIRQL -FASTCALL -KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) -{ - /* Simply raise to dispatch */ - return KfRaiseIrql(DISPATCH_LEVEL); -} - -/* - * @implemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Simply raise to dispatch */ - LockHandle->OldIrql = KfRaiseIrql(DISPATCH_LEVEL); -} - -/* - * @implemented - */ -VOID -FASTCALL -KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock, - IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Simply raise to synch */ - LockHandle->OldIrql = KfRaiseIrql(DISPATCH_LEVEL); -} - -/* - * @implemented - */ -VOID -FASTCALL -KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - IN KIRQL OldIrql) -{ - /* Simply lower IRQL back */ - KeLowerIrql(OldIrql); -} - -/* - * @implemented - */ -VOID -FASTCALL -KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - /* Simply lower IRQL back */ - KeLowerIrql(LockHandle->OldIrql); -} - -/* - * @implemented - */ -BOOLEAN -FASTCALL -KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - IN PKIRQL OldIrql) -{ - /* Simply raise to dispatch */ - *OldIrql = KfRaiseIrql(DISPATCH_LEVEL); - - /* Always return true on UP Machines */ - return TRUE; -} - -/* - * @implemented - */ -LOGICAL -FASTCALL -KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, - OUT PKIRQL OldIrql) -{ - /* Simply raise to dispatch */ - *OldIrql = KfRaiseIrql(DISPATCH_LEVEL); - - /* Always return true on UP Machines */ - return TRUE; -} - /* EOF */ From 5faeebf8e08c7929cf2fb166108b5324437db0a8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 23:22:20 +0000 Subject: [PATCH 198/388] fix for x86 build svn path=/branches/ros-amd64-bringup/; revision=35772 --- reactos/boot/freeldr/freeldr/arch/i386/pcmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c b/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c index df4eb565666..a6833cde086 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c @@ -194,8 +194,8 @@ PcMemGetBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize) /* Copy data to caller's buffer */ RtlCopyMemory(&BiosMemoryMap[MapCount], (PVOID)BIOSCALLBUFFER, Regs.x.ecx); - DbgPrint((DPRINT_MEMORY, "BaseAddress: 0x%p\n", (PVOID)BiosMemoryMap[MapCount].BaseAddress)); - DbgPrint((DPRINT_MEMORY, "Length: 0x%p\n", (PVOID)BiosMemoryMap[MapCount].Length)); + DbgPrint((DPRINT_MEMORY, "BaseAddress: 0x%p\n", (PVOID)(ULONG_PTR)BiosMemoryMap[MapCount].BaseAddress)); + DbgPrint((DPRINT_MEMORY, "Length: 0x%p\n", (PVOID)(ULONG_PTR)BiosMemoryMap[MapCount].Length)); DbgPrint((DPRINT_MEMORY, "Type: 0x%x\n", BiosMemoryMap[MapCount].Type)); DbgPrint((DPRINT_MEMORY, "Reserved: 0x%x\n", BiosMemoryMap[MapCount].Reserved)); DbgPrint((DPRINT_MEMORY, "\n")); From acedcef326806b657591ce09f0982c0a98fc5eed Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 23:29:19 +0000 Subject: [PATCH 199/388] #if out RtlExtendedIntegerMultiply and RtlExtendedLargeIntegerDivide for amd64 in winnt4.h svn path=/branches/ros-amd64-bringup/; revision=35773 --- reactos/include/ddk/winnt4.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/include/ddk/winnt4.h b/reactos/include/ddk/winnt4.h index eb0d5e48916..642a06ef5d9 100644 --- a/reactos/include/ddk/winnt4.h +++ b/reactos/include/ddk/winnt4.h @@ -411,6 +411,7 @@ RtlEnlargedUnsignedMultiply( IN ULONG Multiplicand, IN ULONG Multiplier); +#ifndef _M_AMD64 NTSYSAPI LARGE_INTEGER NTAPI @@ -425,6 +426,7 @@ RtlExtendedLargeIntegerDivide( IN LARGE_INTEGER Dividend, IN ULONG Divisor, IN OUT PULONG Remainder); +#endif NTSYSAPI LARGE_INTEGER From e28ba744b1903ba065a8678b178396a148def286 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 29 Aug 2008 23:43:06 +0000 Subject: [PATCH 200/388] fix crtdll build svn path=/branches/ros-amd64-bringup/; revision=35774 --- reactos/dll/win32/crtdll/crtdll.rbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/crtdll/crtdll.rbuild b/reactos/dll/win32/crtdll/crtdll.rbuild index eec388fba04..864951faef0 100644 --- a/reactos/dll/win32/crtdll/crtdll.rbuild +++ b/reactos/dll/win32/crtdll/crtdll.rbuild @@ -5,7 +5,7 @@ 0x600 0x501 - + From b3b3755f3bd389c480ef134386464fca36d5fb7d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Aug 2008 00:00:44 +0000 Subject: [PATCH 201/388] revert changes to def file from 35655, they break x86 build svn path=/branches/ros-amd64-bringup/; revision=35775 --- reactos/dll/win32/msvcrt/msvcrt.def | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/msvcrt/msvcrt.def b/reactos/dll/win32/msvcrt/msvcrt.def index 9d75329c60a..977477266da 100644 --- a/reactos/dll/win32/msvcrt/msvcrt.def +++ b/reactos/dll/win32/msvcrt/msvcrt.def @@ -120,7 +120,7 @@ EXPORTS __fpecode @115 __getmainargs @116 __initenv @117 - __iob_func @118 +; __iob_func @118 __isascii @119 __iscsym @120 __iscsymf @121 @@ -271,10 +271,10 @@ EXPORTS _fileno @265 _findclose @266 _findfirst @267 - _findfirst64 @268 +; _findfirst64 @268 _findfirsti64 @269 _findnext @270 - _findnext64 @271 +; _findnext64 @271 _findnexti64 @272 _finite @273 _flsbuf @274 @@ -316,7 +316,7 @@ EXPORTS ; _getwche @310 _getws @311 _global_unwind2 @312 - _gmtime64 @313 +; _gmtime64 @313 _heapadd @314 _heapchk @315 _heapmin @316 @@ -372,7 +372,7 @@ EXPORTS _lfind @366 _loaddll @367 _local_unwind2 @368 - _localtime64 @369 +; _localtime64 @369 _lock @370 _locking @371 _logb @372 @@ -538,7 +538,7 @@ EXPORTS _tell @532 _telli64 @533 _tempnam @534 - _time64 @535 +; _time64 @535 _timezone @536 DATA _tolower @537 _toupper @538 From 4bf5c9ad76d92f551c7e359ab6fb0b1f66e362fd Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Aug 2008 00:14:36 +0000 Subject: [PATCH 202/388] Fix user32 spec file svn path=/branches/ros-amd64-bringup/; revision=35776 --- reactos/dll/win32/user32/user32.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/dll/win32/user32/user32.spec b/reactos/dll/win32/user32/user32.spec index e4c633eb052..4e5ddc5c2ae 100644 --- a/reactos/dll/win32/user32/user32.spec +++ b/reactos/dll/win32/user32/user32.spec @@ -614,7 +614,7 @@ @ stub SetCursorContents @ stdcall SetCursorPos(long long) @ stdcall SetDebugErrorLevel(long) -@ stdcall SetDeskWallPaper(ptr) +@ stdcall SetDeskWallpaper(ptr) # @ stub SetDesktopBitmap @ stdcall SetDlgItemInt(long long long long) @ stdcall SetDlgItemTextA(long long str) @@ -680,7 +680,7 @@ @ stdcall SetWindowsHookExA(long long long long) @ stdcall SetWindowsHookExW(long long long long) @ stdcall SetWindowsHookW(long ptr) -@ stdcall ShowCaret(long) +@ stdcall ShowCaret(long) NtUserShowCaret @ stdcall ShowCursor(long) @ stdcall ShowOwnedPopups(long long) @ stdcall ShowScrollBar(long long long) @@ -712,17 +712,17 @@ @ stdcall TranslateMDISysAccel(long ptr) @ stdcall TranslateMessage(ptr) # @ stub TranslateMessageEx -@ stdcall UnhookWinEvent(long) +@ stdcall UnhookWinEvent(long) NtUserUnhookWinEvent @ stdcall UnhookWindowsHook(long ptr) -@ stdcall UnhookWindowsHookEx(long) +@ stdcall UnhookWindowsHookEx(long) NtUserUnhookWindowsHookEx @ stdcall UnionRect(ptr ptr ptr) -@ stdcall UnloadKeyboardLayout(long) +@ stdcall UnloadKeyboardLayout(long) NtUserUnloadKeyboardLayout @ stub UnlockWindowStation @ stdcall UnpackDDElParam(long long ptr ptr) @ stdcall UnregisterClassA(str long) @ stdcall UnregisterClassW(wstr long) @ stdcall UnregisterDeviceNotification(long) -@ stdcall UnregisterHotKey(long long) +@ stdcall UnregisterHotKey(long long) NtUserUnregisterHotKey # @ stub UnregisterMessagePumpHook # @ stub UnregisterUserApiHook @ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) @@ -737,7 +737,7 @@ @ stdcall UserRealizePalette(long) @ stub UserRegisterWowHandlers # @ stub UserSetDeviceHoldState -@ stdcall UserSignalProc(long long long long) +# @ stdcall UserSignalProc(long long long long) # @ stub VRipOutput # @ stub VTagOutput @ stdcall ValidateRect(long ptr) From 28c2567a329807442c3b34980aa5c454b12caba8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Aug 2008 00:25:58 +0000 Subject: [PATCH 203/388] fix ws2_32 spec file svn path=/branches/ros-amd64-bringup/; revision=35777 --- reactos/dll/win32/ws2_32/ws2_32.spec | 68 ++++++++++++++-------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/reactos/dll/win32/ws2_32/ws2_32.spec b/reactos/dll/win32/ws2_32/ws2_32.spec index bbcafc0659b..afd1065719c 100644 --- a/reactos/dll/win32/ws2_32/ws2_32.spec +++ b/reactos/dll/win32/ws2_32/ws2_32.spec @@ -1,33 +1,33 @@ -1 stdcall accept(long ptr ptr) WS_accept -2 stdcall bind(long ptr long) WS_bind -3 stdcall closesocket(long) WS_closesocket -4 stdcall connect(long ptr long) WS_connect -5 stdcall getpeername(long ptr ptr) WS_getpeername -6 stdcall getsockname(long ptr ptr) WS_getsockname -7 stdcall getsockopt(long long long ptr ptr) WS_getsockopt -8 stdcall htonl(long) WS_htonl -9 stdcall htons(long) WS_htons -10 stdcall ioctlsocket(long long ptr) WS_ioctlsocket -11 stdcall inet_addr(str) WS_inet_addr -12 stdcall inet_ntoa(ptr) WS_inet_ntoa -13 stdcall listen(long long) WS_listen -14 stdcall ntohl(long) WS_ntohl -15 stdcall ntohs(long) WS_ntohs -16 stdcall recv(long ptr long long) WS_recv -17 stdcall recvfrom(long ptr long long ptr ptr) WS_recvfrom -18 stdcall select(long ptr ptr ptr ptr) WS_select -19 stdcall send(long ptr long long) WS_send -20 stdcall sendto(long ptr long long ptr long) WS_sendto -21 stdcall setsockopt(long long long ptr long) WS_setsockopt -22 stdcall shutdown(long long) WS_shutdown -23 stdcall socket(long long long) WS_socket -51 stdcall gethostbyaddr(ptr long long) WS_gethostbyaddr -52 stdcall gethostbyname(str) WS_gethostbyname -53 stdcall getprotobyname(str) WS_getprotobyname -54 stdcall getprotobynumber(long) WS_getprotobynumber -55 stdcall getservbyname(str str) WS_getservbyname -56 stdcall getservbyport(long str) WS_getservbyport -57 stdcall gethostname(ptr long) WS_gethostname +1 stdcall accept(long ptr ptr) +2 stdcall bind(long ptr long) +3 stdcall closesocket(long) +4 stdcall connect(long ptr long) +5 stdcall getpeername(long ptr ptr) +6 stdcall getsockname(long ptr ptr) +7 stdcall getsockopt(long long long ptr ptr) +8 stdcall htonl(long) +9 stdcall htons(long) +10 stdcall ioctlsocket(long long ptr) +11 stdcall inet_addr(str) +12 stdcall inet_ntoa(ptr) +13 stdcall listen(long long) +14 stdcall ntohl(long) +15 stdcall ntohs(long) +16 stdcall recv(long ptr long long) +17 stdcall recvfrom(long ptr long long ptr ptr) +18 stdcall select(long ptr ptr ptr ptr) +19 stdcall send(long ptr long long) +20 stdcall sendto(long ptr long long ptr long) +21 stdcall setsockopt(long long long ptr long) +22 stdcall shutdown(long long) +23 stdcall socket(long long long) +51 stdcall gethostbyaddr(ptr long long) +52 stdcall gethostbyname(str) +53 stdcall getprotobyname(str) +54 stdcall getprotobynumber(long) +55 stdcall getservbyname(str str) +56 stdcall getservbyport(long str) +57 stdcall gethostname(ptr long) 101 stdcall WSAAsyncSelect(long long long long) 102 stdcall WSAAsyncGetHostByAddr(long long ptr long long ptr long) @@ -50,7 +50,7 @@ 500 stub WEP -@ stdcall GetAddrInfoW(wstr wstr ptr ptr) +# @ stdcall GetAddrInfoW(wstr wstr ptr ptr) @ stdcall WSApSetPostRoutine(ptr) @ stdcall WPUCompleteOverlappedRequest(long ptr long long ptr) @ stdcall WSAAccept(long ptr ptr ptr long) @@ -114,6 +114,6 @@ @ stub WSCUpdateProvider @ stub WSCWriteNameSpaceOrder @ stdcall WSCWriteProviderOrder(ptr long) -@ stdcall freeaddrinfo(ptr) WS_freeaddrinfo -@ stdcall getaddrinfo(str str ptr ptr) WS_getaddrinfo -@ stdcall getnameinfo(ptr long ptr long ptr long long) WS_getnameinfo +@ stdcall freeaddrinfo(ptr) +@ stdcall getaddrinfo(str str ptr ptr) +@ stdcall getnameinfo(ptr long ptr long ptr long long) From 679cd0bc092e85305f8e221572c9e18d84d34e15 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Aug 2008 00:41:21 +0000 Subject: [PATCH 204/388] add needed ros specific exports back to user32.spec svn path=/branches/ros-amd64-bringup/; revision=35778 --- reactos/dll/win32/user32/user32.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/dll/win32/user32/user32.spec b/reactos/dll/win32/user32/user32.spec index 4e5ddc5c2ae..ccca3b171f4 100644 --- a/reactos/dll/win32/user32/user32.spec +++ b/reactos/dll/win32/user32/user32.spec @@ -767,3 +767,7 @@ @ varargs wsprintfW(wstr wstr) @ stdcall wvsprintfA(ptr str ptr) @ stdcall wvsprintfW(ptr wstr ptr) + +# ROS specific exports +@ stdcall PrivateCsrssManualGuiCheck(long) +@ stdcall PrivateCsrssInitialized() From d1a1a9ec83af98806edc2c9f1f1ee8d5a65d1fe3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Aug 2008 01:01:53 +0000 Subject: [PATCH 205/388] - Move KeAcquireSpinlockRaiseToSynch from ndk to ntifs.h - Add KeTryToAcquireQueuedSpinLock to ntifs.h - Fix Spinlock function prototypes in winddk.h svn path=/branches/ros-amd64-bringup/; revision=35780 --- reactos/include/ddk/ntifs.h | 55 ++++++++++-- reactos/include/ddk/winddk.h | 159 ++++++++++++++++++++++++---------- reactos/include/ndk/kefuncs.h | 5 -- 3 files changed, 159 insertions(+), 60 deletions(-) diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index 54358cccab7..56f61f552bb 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -3631,22 +3631,16 @@ IoVerifyVolume ( IN BOOLEAN AllowRawMount ); -#ifdef _M_AMD64 -NTKERNELAPI -#else +#if !defined (_M_AMD64) + NTHALAPI -#endif KIRQL FASTCALL KeAcquireQueuedSpinLock ( IN KSPIN_LOCK_QUEUE_NUMBER Number ); -#ifdef _M_AMD64 -NTKERNELAPI -#else NTHALAPI -#endif VOID FASTCALL KeReleaseQueuedSpinLock ( @@ -3654,6 +3648,51 @@ KeReleaseQueuedSpinLock ( IN KIRQL OldIrql ); +NTHALAPI +KIRQL +FASTCALL +KeAcquireSpinLockRaiseToSynch( + IN OUT PKSPIN_LOCK SpinLock +); + +NTHALAPI +LOGICAL +FASTCALL +KeTryToAcquireQueuedSpinLock( + KSPIN_LOCK_QUEUE_NUMBER Number, + PKIRQL OldIrql); + +#else + +NTKERNELAPI +KIRQL +FASTCALL +KeAcquireQueuedSpinLock ( + IN KSPIN_LOCK_QUEUE_NUMBER Number +); + +NTKERNELAPI +VOID +FASTCALL +KeReleaseQueuedSpinLock ( + IN KSPIN_LOCK_QUEUE_NUMBER Number, + IN KIRQL OldIrql +); + +NTKERNELAPI +KIRQL +KeAcquireSpinLockRaiseToSynch( + IN OUT PKSPIN_LOCK SpinLock +); + +NTKERNELAPI +LOGICAL +KeTryToAcquireQueuedSpinLock( + KSPIN_LOCK_QUEUE_NUMBER Number, + PKIRQL OldIrql); + +#endif + NTKERNELAPI VOID NTAPI diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 8de50fb808f..1f0c01fdb23 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5786,6 +5786,7 @@ typedef struct _PCIBUSDATA } PCIBUSDATA, *PPCIBUSDATA; +/** INTERLOCKED FUNCTIONS *****************************************************/ #if !defined(__INTERLOCKED_DECLARED) #define __INTERLOCKED_DECLARED @@ -5902,12 +5903,43 @@ InterlockedExchangeAdd( #define InterlockedPushEntrySList(Head, Entry) ExpInterlockedPushEntrySList(Head, Entry) #define InterlockedFlushSList(Head) ExpInterlockedFlushSList(Head) #define QueryDepthSList(Head) ExQueryDepthSList(Head) -#endif // !defined(_WINBASE_ +#endif // !defined(_WINBASE_) #endif // _M_AMD64 #endif /* !__INTERLOCKED_DECLARED */ + +/** SPINLOCK FUNCTIONS ********************************************************/ + +NTKERNELAPI +BOOLEAN +FASTCALL +KeTryToAcquireSpinLockAtDpcLevel( + IN OUT PKSPIN_LOCK SpinLock +); + +#if defined (_X86_) + +NTKERNELAPI +VOID +NTAPI +KeInitializeSpinLock( + IN PKSPIN_LOCK SpinLock); + +NTHALAPI +KIRQL +FASTCALL +KfAcquireSpinLock( + IN PKSPIN_LOCK SpinLock); + +NTHALAPI +VOID +FASTCALL +KfReleaseSpinLock( + IN PKSPIN_LOCK SpinLock, + IN KIRQL NewIrql); + NTKERNELAPI VOID FASTCALL @@ -5920,46 +5952,48 @@ FASTCALL KefReleaseSpinLockFromDpcLevel( IN PKSPIN_LOCK SpinLock); -#if defined(_M_AMD64) -NTKERNELAPI -KIRQL -FASTCALL -KfAcquireSpinLock( - IN PKSPIN_LOCK SpinLock); - -NTKERNELAPI -VOID -FASTCALL -KfReleaseSpinLock( - IN PKSPIN_LOCK SpinLock, - IN KIRQL NewIrql); -#else -NTHALAPI -KIRQL -FASTCALL -KfAcquireSpinLock( - IN PKSPIN_LOCK SpinLock); - -NTHALAPI -VOID -FASTCALL -KfReleaseSpinLock( - IN PKSPIN_LOCK SpinLock, - IN KIRQL NewIrql); -#endif - -NTKERNELAPI -BOOLEAN -FASTCALL -KeTryToAcquireSpinLockAtDpcLevel( - IN OUT PKSPIN_LOCK SpinLock -); - #define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock) #define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock) #define KeAcquireSpinLock(a,b) *(b) = KfAcquireSpinLock(a) #define KeReleaseSpinLock(a,b) KfReleaseSpinLock(a,b) +#else // !defined (_X86_) + +FORCEINLINE +VOID +NTAPI +KeInitializeSpinLock( + PKSPIN_LOCK SpinLock) +{ + *SpinLock = 0; +} + +NTKERNELAPI +VOID +KeReleaseSpinLock( + IN PKSPIN_LOCK SpinLock, + IN KIRQL NewIrql); + +NTKERNELAPI +VOID +KeAcquireSpinLockAtDpcLevel( + IN PKSPIN_LOCK SpinLock); + +NTKERNELAPI +VOID +KeReleaseSpinLockFromDpcLevel( + IN PKSPIN_LOCK SpinLock); + +NTKERNELAPI +KIRQL +KeAcquireSpinLockRaiseToDpc( + IN PKSPIN_LOCK SpinLock); + +#define KeAcquireSpinLock(SpinLock, OldIrql) \ + *(OldIrql) = KeAcquireSpinLockRaiseToDpc(SpinLock) + +#endif // !defined (_X86_) + #define RtlCopyMemoryNonTemporal RtlCopyMemory #define KeGetDcacheFillSize() 1L @@ -6358,17 +6392,23 @@ RtlConvertLongToLargeInteger(LONG SignedInteger) return Result; } +static __inline +LARGE_INTEGER +NTAPI_INLINE +RtlConvertUlongToLargeInteger( + ULONG UnsignedInteger) +{ + LARGE_INTEGER ret; + ret.QuadPart = UnsignedInteger; + return ret; +} + NTSYSAPI LUID NTAPI RtlConvertLongToLuid( IN LONG Long); -NTSYSAPI -LARGE_INTEGER -NTAPI -RtlConvertUlongToLargeInteger( - IN ULONG UnsignedInteger); NTSYSAPI LUID @@ -6376,6 +6416,37 @@ NTAPI RtlConvertUlongToLuid( ULONG Ulong); +#ifdef _M_AMD64 + +static __inline +LARGE_INTEGER +NTAPI_INLINE +RtlExtendedIntegerMultiply( + LARGE_INTEGER Multiplicand, + LONG Multiplier) +{ + LARGE_INTEGER ret; + ret.QuadPart = Multiplicand.QuadPart * Multiplier; + return ret; +} + +static __inline +LARGE_INTEGER +NTAPI_INLINE +RtlExtendedLargeIntegerDivide( + LARGE_INTEGER Dividend, + ULONG Divisor, + PULONG Remainder) +{ + LARGE_INTEGER ret; + ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor; + if (Remainder) + *Remainder = (ULONG)(Dividend.QuadPart % Divisor); + return ret; +} + +#endif + /* * VOID * RtlCopyMemory( @@ -9581,12 +9652,6 @@ KeInitializeSemaphore( IN LONG Count, IN LONG Limit); -NTKERNELAPI -VOID -NTAPI -KeInitializeSpinLock( - IN PKSPIN_LOCK SpinLock); - NTKERNELAPI VOID NTAPI diff --git a/reactos/include/ndk/kefuncs.h b/reactos/include/ndk/kefuncs.h index 06a16c5b88e..3b0fe4e139d 100644 --- a/reactos/include/ndk/kefuncs.h +++ b/reactos/include/ndk/kefuncs.h @@ -133,11 +133,6 @@ KeAcquireInStackQueuedSpinLockRaiseToSynch( IN PKLOCK_QUEUE_HANDLE LockHandle ); -KIRQL -FASTCALL -KeAcquireSpinLockRaiseToSynch( - IN OUT PKSPIN_LOCK SpinLock -); // // Interrupt Functions From 85e83d65739d418ba0912414402d963c786c3fee Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Aug 2008 01:42:03 +0000 Subject: [PATCH 206/388] define some fastcall functions to the normal functions on amd64 svn path=/branches/ros-amd64-bringup/; revision=35781 --- reactos/drivers/network/ndis/include/ndissys.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reactos/drivers/network/ndis/include/ndissys.h b/reactos/drivers/network/ndis/include/ndissys.h index 8388a683b7c..6d412e42f11 100644 --- a/reactos/drivers/network/ndis/include/ndissys.h +++ b/reactos/drivers/network/ndis/include/ndissys.h @@ -515,6 +515,13 @@ ExGetCurrentProcessorCounts( PULONG TotalCpuTime, PULONG ProcessorNumber); +/* portability fixes */ +#ifdef _M_AMD64 +#define KfReleaseSpinLock KeReleaseSpinLock +#define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel +#define KefReleaseSpinLockFromDpcLevel KeReleaseSpinLockFromDpcLevel +#endif + #endif /* __NDISSYS_H */ /* EOF */ From efdc0f457130635228ab5fad01facd56509b9cd6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Aug 2008 01:44:37 +0000 Subject: [PATCH 207/388] - implement spinlocks, based on x86 up hal code - comment out KeInitializeSpinLock on amd64 builds (it's inlined there) - define some fastcall functions to normal on amd64 - Update amd64 stubs - remove wrong exports from ntokrnl svn path=/branches/ros-amd64-bringup/; revision=35782 --- reactos/ntoskrnl/amd64stubs.c | 15 -- reactos/ntoskrnl/include/internal/amd64/ke.h | 3 + reactos/ntoskrnl/ke/amd64/spinlock.c | 188 +++++++++++++++++++ reactos/ntoskrnl/ke/spinlock.c | 2 + reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 1 + reactos/ntoskrnl/ntoskrnl_amd64.def | 10 - 6 files changed, 194 insertions(+), 25 deletions(-) create mode 100644 reactos/ntoskrnl/ke/amd64/spinlock.c diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index fccd94cca8d..b384d2e564c 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -7,7 +7,6 @@ unsigned long (*FrLdrDbgPrint)(const char *Format, ...); STUB(KdpEnableSafeMem) STUB(KiIdleLoop) -STUB(KeAcquireInStackQueuedSpinLockRaiseToSynch) STUB(KeBugcheckCallbackListHead) STUB(ExpInterlockedPushEntrySList) STUB(NtContinue) @@ -131,12 +130,6 @@ STUB(IoTranslateBusAddress) STUB(IoWMIDeviceObjectToProviderId) STUB(KdDebuggerEnabled) STUB(KdDebuggerNotPresent) -STUB(KeAcquireQueuedSpinLock) -STUB(_imp__KeAcquireQueuedSpinLock) -STUB(_imp__KeReleaseQueuedSpinLock) -STUB(KeAcquireQueuedSpinLockRaiseToSynch) -STUB(KeAcquireSpinLockRaiseToDpc) -STUB(KeAcquireSpinLockRaiseToSynch) STUB(KeEnterCriticalRegion) STUB(KeEnterGuardedRegion) STUB(KeExpandKernelStackAndCallout) @@ -152,8 +145,6 @@ STUB(KeQueryActiveProcessors) STUB(KeQueryMultiThreadProcessorSet) STUB(KeQueryPrcbAddress) STUB(KeReadStateMutex) -STUB(KeReleaseQueuedSpinLock) -STUB(KeReleaseSpinLock) STUB(KeRestoreFloatingPointState) STUB(KeSaveFloatingPointState) STUB(KeSaveStateForHibernate) @@ -161,8 +152,6 @@ STUB(KeSetDmaIoCoherency) STUB(KeSignalCallDpcDone) STUB(KeSignalCallDpcSynchronize) STUB(KeSynchronizeExecution) -STUB(KeTryToAcquireQueuedSpinLock) -STUB(KeTryToAcquireQueuedSpinLockRaiseToSynch) STUB(KeUpdateRunTime) STUB(KeUpdateSystemTime) STUB(KeUserModeCallback) @@ -245,10 +234,6 @@ STUB(_local_unwind) STUB(_setjmp) STUB(_setjmpex) STUB(longjmp) -STUB(KfReleaseSpinLock) -STUB(KeAcquireInStackQueuedSpinLock) -STUB(KeReleaseInStackQueuedSpinLock) -STUB(KfAcquireSpinLock) STUB(KeProcessorArchitecture) STUB(KeProcessorLevel) STUB(KeProcessorRevision) diff --git a/reactos/ntoskrnl/include/internal/amd64/ke.h b/reactos/ntoskrnl/include/internal/amd64/ke.h index 8ee91fb03d9..6fa646a0865 100644 --- a/reactos/ntoskrnl/include/internal/amd64/ke.h +++ b/reactos/ntoskrnl/include/internal/amd64/ke.h @@ -65,6 +65,9 @@ typedef struct _KIDT_INIT //#define KeArchFnInit() Ke386FnInit() #define KeArchFnInit() DbgPrint("KeArchFnInit is unimplemented!\n"); #define KeArchHaltProcessor() Ke386HaltProcessor() +#define KfLowerIrql KeLowerIrql +#define KfAcquireSpinLock KeAcquireSpinLock +#define KfReleaseSpinLock KeReleaseSpinLock extern ULONG Ke386CacheAlignment; diff --git a/reactos/ntoskrnl/ke/amd64/spinlock.c b/reactos/ntoskrnl/ke/amd64/spinlock.c new file mode 100644 index 00000000000..c3ac026d878 --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/spinlock.c @@ -0,0 +1,188 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: GPL - See COPYING in the top level directory + * FILE: hal/halx86/up/spinlock.c + * PURPOSE: Spinlock and Queued Spinlock Support + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +#undef KeAcquireSpinLock +#undef KeReleaseSpinLock + +/* FUNCTIONS *****************************************************************/ + +/* + * @implemented + */ +KIRQL +KeAcquireSpinLockRaiseToSynch(PKSPIN_LOCK SpinLock) +{ +#ifndef CONFIG_SMP + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +KIRQL +NTAPI +KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock) +{ +#ifndef CONFIG_SMP + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +VOID +NTAPI +KeReleaseSpinLock(PKSPIN_LOCK SpinLock, + KIRQL OldIrql) +{ +#ifndef CONFIG_SMP + /* Simply lower IRQL back */ + KfLowerIrql(OldIrql); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +KIRQL +KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) +{ +#ifndef CONFIG_SMP + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +KIRQL +KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber) +{ +#ifndef CONFIG_SMP + /* Simply raise to dispatch */ + return KfRaiseIrql(DISPATCH_LEVEL); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +VOID +KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ +#ifndef CONFIG_SMP + /* Simply raise to dispatch */ + LockHandle->OldIrql = KfRaiseIrql(DISPATCH_LEVEL); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +VOID +KeAcquireInStackQueuedSpinLockRaiseToSynch(IN PKSPIN_LOCK SpinLock, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ +#ifndef CONFIG_SMP + /* Simply raise to synch */ + LockHandle->OldIrql = KfRaiseIrql(SYNCH_LEVEL); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +VOID +KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, + IN KIRQL OldIrql) +{ +#ifndef CONFIG_SMP + /* Simply lower IRQL back */ + KfLowerIrql(OldIrql); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +VOID +KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) +{ +#ifndef CONFIG_SMP + /* Simply lower IRQL back */ + KfLowerIrql(LockHandle->OldIrql); +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +BOOLEAN +KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, + IN PKIRQL OldIrql) +{ +#ifndef CONFIG_SMP + /* Simply raise to dispatch */ + *OldIrql = KfRaiseIrql(DISPATCH_LEVEL); + + /* Always return true on UP Machines */ + return TRUE; +#else + UNIMPLEMENTED; +#endif +} + +/* + * @implemented + */ +LOGICAL +KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, + OUT PKIRQL OldIrql) +{ +#ifndef CONFIG_SMP + /* Simply raise to dispatch */ + *OldIrql = KfRaiseIrql(DISPATCH_LEVEL); + + /* Always return true on UP Machines */ + return TRUE; +#else + UNIMPLEMENTED; +#endif +} + +/* EOF */ diff --git a/reactos/ntoskrnl/ke/spinlock.c b/reactos/ntoskrnl/ke/spinlock.c index d4be3b5fac3..ab2cb37e601 100644 --- a/reactos/ntoskrnl/ke/spinlock.c +++ b/reactos/ntoskrnl/ke/spinlock.c @@ -86,6 +86,7 @@ KeReleaseQueuedSpinLockFromDpcLevel(IN PKSPIN_LOCK_QUEUE LockHandle) /* PUBLIC FUNCTIONS **********************************************************/ +#ifdef _X86_ /* * @implemented */ @@ -96,6 +97,7 @@ KeInitializeSpinLock(IN PKSPIN_LOCK SpinLock) /* Clear it */ *SpinLock = 0; } +#endif /* * @implemented diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index e450f445c04..c8908fa403b 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -95,6 +95,7 @@ except.c irql.c kiinit.c + spinlock.c thrdini.c trap.S diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def index 4bd04a00ff9..e69168fa2cd 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ b/reactos/ntoskrnl/ntoskrnl_amd64.def @@ -4,16 +4,6 @@ ; EXPORTS ; -KfAcquireSpinLock -KfReleaseSpinLock -KefAcquireSpinLockAtDpcLevel -KefReleaseSpinLockFromDpcLevel -KeInitializeSpinLock -KeGetCurrentProcessorNumber -RtlConvertUlongToLargeInteger -RtlExtendedIntegerMultiply -; -; original: CcCanIWrite CcCopyRead CcCopyWrite From 843608caa214f76be05393f6a4c0b505e6517e4a Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 30 Aug 2008 06:49:03 +0000 Subject: [PATCH 208/388] re-add missing api, remove unneded file svn path=/branches/ros-amd64-bringup/; revision=35789 --- reactos/dll/win32/crtdll/crtdll.spec | 1 + reactos/dll/win32/ws2_32/ws2_32.def | 121 --------------------------- 2 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 reactos/dll/win32/ws2_32/ws2_32.def diff --git a/reactos/dll/win32/crtdll/crtdll.spec b/reactos/dll/win32/crtdll/crtdll.spec index 8dd6d32c928..091a2c42562 100644 --- a/reactos/dll/win32/crtdll/crtdll.spec +++ b/reactos/dll/win32/crtdll/crtdll.spec @@ -311,6 +311,7 @@ @ extern _tzname msvcrt._tzname @ cdecl _tzset() msvcrt._tzset @ cdecl _ultoa(long ptr long) msvcrt._ultoa + @ cdecl _ultow(long ptr long) msvcrt._ultow @ cdecl _umask(long) msvcrt._umask @ cdecl _ungetch(long) msvcrt._ungetch @ cdecl _unlink(str) msvcrt._unlink diff --git a/reactos/dll/win32/ws2_32/ws2_32.def b/reactos/dll/win32/ws2_32/ws2_32.def deleted file mode 100644 index 379a39bbd88..00000000000 --- a/reactos/dll/win32/ws2_32/ws2_32.def +++ /dev/null @@ -1,121 +0,0 @@ -; WS2_32.DLL - Windows Sockets 2 DLL - -LIBRARY ws2_32.dll - -EXPORTS -WEP@0 @500 -WPUCompleteOverlappedRequest@20 @25 -WSAAccept@20 @26 -WSAAddressToStringA@20 @27 -WSAAddressToStringW@20 @28 -WSAAsyncGetHostByAddr@28 @102 -WSAAsyncGetHostByName@20 @103 -WSAAsyncGetProtoByName@20 @105 -WSAAsyncGetProtoByNumber@20 @104 -WSAAsyncGetServByName@24 @107 -WSAAsyncGetServByPort@24 @106 -WSAAsyncSelect@16 @101 -WSACancelAsyncRequest@4 @108 -WSACancelBlockingCall@0 @113 -WSACleanup@0 @116 -WSACloseEvent@4 @29 -WSAConnect@28 @30 -WSACreateEvent@0 @31 -WSADuplicateSocketA@12 @32 -WSADuplicateSocketW@12 @33 -WSAEnumNameSpaceProvidersA@8 @34 -WSAEnumNameSpaceProvidersW@8 @35 -WSAEnumNetworkEvents@12 @36 -WSAEnumProtocolsA@12 @37 -WSAEnumProtocolsW@12 @38 -WSAEventSelect@12 @39 -WSAGetLastError@0 @111 -WSAGetOverlappedResult@20 @40 -WSAGetQOSByName@12 @41 -WSAGetServiceClassInfoA@16 @42 -WSAGetServiceClassInfoW@16 @43 -WSAGetServiceClassNameByClassIdA@12 @44 -WSAGetServiceClassNameByClassIdW@12 @45 -WSAHtonl@12 @46 -WSAHtons@12 @47 -WSAInstallServiceClassA@4 @48 -WSAInstallServiceClassW@4 @49 -WSAIoctl@36 @50 -WSAIsBlocking@0 @114 -WSAJoinLeaf@32 @58 -WSALookupServiceBeginA@12 @59 -WSALookupServiceBeginW@12 @60 -WSALookupServiceEnd@4 @61 -WSALookupServiceNextA@16 @62 -WSALookupServiceNextW@16 @63 -WSANSPIoctl@32 @64 -WSANtohl@12 @65 -WSANtohs@12 @66 -WSAProviderConfigChange@12 @67 -WSARecv@28 @68 -WSARecvDisconnect@8 @69 -WSARecvFrom@36 @70 -WSARemoveServiceClass@4 @71 -WSAResetEvent@4 @72 -WSASend@28 @73 -WSASendDisconnect@8 @74 -WSASendTo@36 @75 -WSASetBlockingHook@4 @109 -WSASetEvent@4 @76 -WSASetLastError@4 @112 -WSASetServiceA@12 @77 -WSASetServiceW@12 @78 -WSASocketA@24 @79 -WSASocketW@24 @80 -WSAStartup@8 @115 -WSAStringToAddressA@20 @81 -WSAStringToAddressW@20 @82 -WSAUnhookBlockingHook@0 @110 -WSAWaitForMultipleEvents@20 @83 -WSApSetPostRoutine@4 @24 -WSCDeinstallProvider@8 @84 -WSCEnableNSProvider@8 @85 -WSCEnumProtocols@16 @86 -WSCGetProviderPath@16 @87 -WSCInstallNameSpace@20 @88 -WSCInstallProvider@20 @89 -WSCUnInstallNameSpace@4 @90 -WSCUpdateProvider@20 @91 -WSCWriteNameSpaceOrder@8 @92 -WSCWriteProviderOrder@8 @93 -__WSAFDIsSet@8 @151 -accept@12 @1 -bind@12 @2 -closesocket@4 @3 -connect@12 @4 -freeaddrinfo@4 @94 -getaddrinfo@16 @95 -gethostbyaddr@12 @51 -gethostbyname@4 @52 -gethostname@8 @57 -getnameinfo@28 @96 -getpeername@12 @5 -getprotobyname@4 @53 -getprotobynumber@4 @54 -getservbyname@8 @55 -getservbyport@8 @56 -getsockname@12 @6 -getsockopt@20 @7 -htonl@4 @8 -htons@4 @9 -inet_addr@4 @11 -inet_ntoa@4 @12 -ioctlsocket@12 @10 -listen@8 @13 -ntohl@4 @14 -ntohs@4 @15 -recv@16 @16 -recvfrom@24 @17 -select@20 @18 -send@16 @19 -sendto@24 @20 -setsockopt@20 @21 -shutdown@8 @22 -socket@12 @23 - -; EOF From a689a4ea26fe874931131ab5dbe7e886621d07cf Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 30 Aug 2008 16:01:15 +0000 Subject: [PATCH 209/388] re-add missing api (fixes user32 winetest build) svn path=/branches/ros-amd64-bringup/; revision=35804 --- reactos/dll/win32/user32/user32.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/user32/user32.spec b/reactos/dll/win32/user32/user32.spec index ccca3b171f4..672efb1fb42 100644 --- a/reactos/dll/win32/user32/user32.spec +++ b/reactos/dll/win32/user32/user32.spec @@ -408,7 +408,7 @@ @ stdcall InflateRect(ptr long long) # @ stub InitSharedTable # @ stub InitTask -# @ stub InitializeLpkHooks +@ stdcall InitializeLpkHooks(ptr) # @ stub InitializeWin32EntryTable @ stdcall InsertMenuA(long long long long ptr) @ stdcall InsertMenuItemA(long long long ptr) From b6ad488a42c44927f9485dc5564081feb149385d Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 30 Aug 2008 16:09:34 +0000 Subject: [PATCH 210/388] remove unneeded msvcrt dependency (all win32 projects already depend on it) svn path=/branches/ros-amd64-bringup/; revision=35805 --- reactos/subsystems/win32/csrss/csrss.rbuild | 1 - reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild | 1 - 2 files changed, 2 deletions(-) diff --git a/reactos/subsystems/win32/csrss/csrss.rbuild b/reactos/subsystems/win32/csrss/csrss.rbuild index 09eff8ba0bb..dd09e4d5d9b 100644 --- a/reactos/subsystems/win32/csrss/csrss.rbuild +++ b/reactos/subsystems/win32/csrss/csrss.rbuild @@ -11,7 +11,6 @@ nt ntdll smdll - msvcrt handle.c process.c diff --git a/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild b/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild index 53bad5de37c..2ea3962678a 100644 --- a/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild +++ b/reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild @@ -15,7 +15,6 @@ gdi32 advapi32 psapi - msvcrt psapi shell32 w32csr.h From 5a8939d7765edb8a4bc5fb612db4f27db2d84954 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 30 Aug 2008 16:47:26 +0000 Subject: [PATCH 211/388] Commit WIP. Part 1 of ?? Update mingw32 headers to mingw-w64 trunk -Too many changes to list -Important concepts: -- _INTEGRAL_MAX_BITS -- _USE_32BIT_TIME_T -- _USE_64BIT_TIME_T - adds crt secure API - Fixes so many types its not even funny. svn path=/branches/ros-amd64-bringup/; revision=35807 --- reactos/include/crt/_mingw.h | 460 +++++-- reactos/include/crt/assert.h | 79 +- reactos/include/crt/complex.h | 65 +- reactos/include/crt/conio.h | 116 +- reactos/include/crt/ctype.h | 506 +++---- reactos/include/crt/direct.h | 93 +- reactos/include/crt/dirent.h | 178 +-- reactos/include/crt/dos.h | 100 +- reactos/include/crt/errno.h | 152 +-- reactos/include/crt/excpt.h | 2 - reactos/include/crt/fcntl.h | 103 +- reactos/include/crt/fenv.h | 39 +- reactos/include/crt/float.h | 10 +- reactos/include/crt/inttypes.h | 61 +- reactos/include/crt/io.h | 652 +++++---- reactos/include/crt/libgen.h | 31 - reactos/include/crt/limits.h | 193 +-- reactos/include/crt/locale.h | 152 +-- reactos/include/crt/malloc.h | 213 ++- reactos/include/crt/math.h | 1474 ++++++++++----------- reactos/include/crt/mbctype.h | 176 +-- reactos/include/crt/mbstring.h | 303 +++-- reactos/include/crt/mem.h | 7 + reactos/include/crt/memory.h | 43 +- reactos/include/crt/mingw32/crtdbg.h | 212 +++ reactos/include/crt/mingw32/stdarg.h | 22 +- reactos/include/crt/mingw32/stddef.h | 97 +- reactos/include/crt/mingw32/vadefs.h | 85 ++ reactos/include/crt/process.h | 274 ++-- reactos/include/crt/search.h | 107 +- reactos/include/crt/sec_api/conio_s.h | 42 + reactos/include/crt/sec_api/crtdbg_s.h | 19 + reactos/include/crt/sec_api/io_s.h | 33 + reactos/include/crt/sec_api/mbstring_s.h | 52 + reactos/include/crt/sec_api/search_s.h | 25 + reactos/include/crt/sec_api/stdio_s.h | 145 ++ reactos/include/crt/sec_api/stdlib_s.h | 67 + reactos/include/crt/sec_api/stralign_s.h | 30 + reactos/include/crt/sec_api/string_s.h | 41 + reactos/include/crt/sec_api/sys/timeb_s.h | 34 + reactos/include/crt/sec_api/tchar_s.h | 266 ++++ reactos/include/crt/sec_api/time_s.h | 61 + reactos/include/crt/sec_api/wchar_s.h | 128 ++ reactos/include/crt/setjmp.h | 198 ++- reactos/include/crt/share.h | 38 +- reactos/include/crt/signal.h | 134 +- reactos/include/crt/stdint.h | 89 +- reactos/include/crt/stdio.h | 857 ++++++------ reactos/include/crt/stdlib.h | 990 +++++++------- reactos/include/crt/string.h | 324 +++-- reactos/include/crt/strings.h | 13 +- reactos/include/crt/sys/cdefs.h | 17 + reactos/include/crt/sys/fcntl.h | 8 +- reactos/include/crt/sys/file.h | 7 + reactos/include/crt/sys/ioctl.h | 21 + reactos/include/crt/sys/locking.h | 41 +- reactos/include/crt/sys/param.h | 30 +- reactos/include/crt/sys/stat.h | 389 +++--- reactos/include/crt/sys/time.h | 36 +- reactos/include/crt/sys/timeb.h | 168 ++- reactos/include/crt/sys/types.h | 153 +-- reactos/include/crt/sys/unistd.h | 8 + reactos/include/crt/sys/utime.h | 186 ++- reactos/include/crt/time.h | 426 +++--- reactos/include/crt/unistd.h | 27 +- reactos/include/crt/utime.h | 5 + reactos/include/crt/wchar.h | 1222 +++++++++++------ reactos/include/crt/wctype.h | 280 ++-- 68 files changed, 7546 insertions(+), 5069 deletions(-) delete mode 100644 reactos/include/crt/libgen.h create mode 100644 reactos/include/crt/mingw32/crtdbg.h create mode 100644 reactos/include/crt/mingw32/vadefs.h create mode 100644 reactos/include/crt/sec_api/conio_s.h create mode 100644 reactos/include/crt/sec_api/crtdbg_s.h create mode 100644 reactos/include/crt/sec_api/io_s.h create mode 100644 reactos/include/crt/sec_api/mbstring_s.h create mode 100644 reactos/include/crt/sec_api/search_s.h create mode 100644 reactos/include/crt/sec_api/stdio_s.h create mode 100644 reactos/include/crt/sec_api/stdlib_s.h create mode 100644 reactos/include/crt/sec_api/stralign_s.h create mode 100644 reactos/include/crt/sec_api/string_s.h create mode 100644 reactos/include/crt/sec_api/sys/timeb_s.h create mode 100644 reactos/include/crt/sec_api/tchar_s.h create mode 100644 reactos/include/crt/sec_api/time_s.h create mode 100644 reactos/include/crt/sec_api/wchar_s.h create mode 100644 reactos/include/crt/sys/cdefs.h create mode 100644 reactos/include/crt/sys/ioctl.h diff --git a/reactos/include/crt/_mingw.h b/reactos/include/crt/_mingw.h index dd0e13d5c46..8ea779a7495 100644 --- a/reactos/include/crt/_mingw.h +++ b/reactos/include/crt/_mingw.h @@ -1,56 +1,20 @@ -/* - * _mingw.h - * - * Mingw specific macros included by ALL include files. - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Mumit Khan - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ -#ifndef __MINGW_H -#define __MINGW_H +#ifndef _INC_CRTDEFS +#define _INC_CRTDEFS -#if __GNUC__ >= 3 -#pragma GCC system_header +#ifndef MINGW64 +#define MINGW64 +#define MINGW64_VERSION 1.0 +#define MINGW64_VERSION_MAJOR 1 +#define MINGW64_VERSION_MINOR 0 +#define MINGW64_VERSION_STATE "alpha" #endif -/* These are defined by the user (or the compiler) - to specify how identifiers are imported from a DLL. - - __DECLSPEC_SUPPORTED Defined if dllimport attribute is supported. - __MINGW_IMPORT The attribute definition to specify imported - variables/functions. - _CRTIMP As above. For MS compatibility. - __MINGW32_VERSION Runtime version. - __MINGW32_MAJOR_VERSION Runtime major version. - __MINGW32_MINOR_VERSION Runtime minor version. - __MINGW32_BUILD_DATE Runtime build date. - - Other macros: - - __int64 define to be long long. Using a typedef doesn't - work for "unsigned __int64" - - All headers should include this first, and then use __DECLSPEC_SUPPORTED - to choose between the old ``__imp__name'' style or __MINGW_IMPORT - style declarations. */ - -/* Try to avoid problems with outdated checks for GCC __attribute__ support. */ -#undef __attribute__ - #ifndef __GNUC__ # ifndef __MINGW_IMPORT # define __MINGW_IMPORT __declspec(dllimport) @@ -63,8 +27,8 @@ #else /* __GNUC__ */ # ifdef __declspec # ifndef __MINGW_IMPORT - /* Note the extern. This is needed to work around GCC's - limitations in handling dllimport attribute. */ +/* Note the extern. This is needed to work around GCC's +limitations in handling dllimport attribute. */ # define __MINGW_IMPORT extern __attribute__ ((__dllimport__)) # endif # ifndef _CRTIMP @@ -88,25 +52,6 @@ # ifndef __stdcall # define __stdcall __attribute__ ((__stdcall__)) # endif -# ifndef __int64 -# define __int64 long long -# endif -# ifndef __int32 -# define __int32 long -# endif -# ifndef __int16 -# define __int16 short -# endif -# ifndef __int8 -# define __int8 char -# endif -# ifndef __small -# define __small char -# endif -# ifndef __hyper -# define __hyper long long -# endif -#endif /* __GNUC__ */ #if defined (__GNUC__) && defined (__GNUC_MINOR__) #define __MINGW_GNUC_PREREQ(major, minor) \ @@ -116,10 +61,12 @@ #define __MINGW_GNUC_PREREQ(major, minor) 0 #endif +#define USE___UUIDOF 0 + #ifdef __cplusplus # define __CRT_INLINE inline #else -# if __GNUC_STDC_INLINE__ +# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) # define __CRT_INLINE extern inline __attribute__((__gnu_inline__)) # else # define __CRT_INLINE extern __inline__ @@ -175,25 +122,388 @@ #ifndef __MSVCRT_VERSION__ /* High byte is the major version, low byte is the minor. */ -# define __MSVCRT_VERSION__ 0x0600 +# define __MSVCRT_VERSION__ 0x0700 +#endif + + +//#ifndef WINVER +//#define WINVER 0x0502 +//#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x502 +#endif + +#ifndef _INT128_DEFINED +#define _INT128_DEFINED +#ifdef __GNUC__ +#define __int8 char +#define __int16 short +#define __int32 int +#define __int64 long long +#ifdef _WIN64 + +typedef int __int128 __attribute__ ((mode (TI))); + +#endif + +#define __ptr32 +#define __ptr64 +#define __unaligned __attribute ((packed)) +#define __forceinline extern __inline +#endif +#endif + +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif + +#if defined (__i386__) +#define _ATTRIBUTES +#else +#define _ATTRIBUTES shared +#endif + +#ifdef __cplusplus +#ifndef __nothrow +#define __nothrow __declspec(nothrow) +#endif +#else +#ifndef __nothrow +#define __nothrow +#endif +#endif + +#undef _CRT_PACKING +#define _CRT_PACKING 8 + +#ifdef _WIN64 +#undef USE_MINGW_SETJMP_TWO_ARGS +#define USE_MINGW_SETJMP_TWO_ARGS +#endif + +#pragma pack(push,_CRT_PACKING) + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _CRT_STRINGIZE +#define __CRT_STRINGIZE(_Value) #_Value +#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value) +#endif + +#ifndef _CRT_WIDE +#define __CRT_WIDE(_String) L ## _String +#define _CRT_WIDE(_String) __CRT_WIDE(_String) +#endif + +#ifndef _W64 +#define _W64 +#endif + +#ifndef _CRTIMP_NOIA64 +#ifdef __ia64__ +#define _CRTIMP_NOIA64 +#else +#define _CRTIMP_NOIA64 _CRTIMP +#endif +#endif + +#ifndef _CRTIMP2 +#define _CRTIMP2 _CRTIMP +#endif + +#ifndef _CRTIMP_ALTERNATIVE +#define _CRTIMP_ALTERNATIVE _CRTIMP +#define _CRT_ALTERNATIVE_IMPORTED +#endif + +#ifndef _MRTIMP2 +#define _MRTIMP2 _CRTIMP +#endif + +#ifndef _DLL +#define _DLL +#endif + +#ifndef _MT +#define _MT +#endif + +#ifndef _MCRTIMP +#define _MCRTIMP _CRTIMP +#endif + +#ifndef _CRTIMP_PURE +#define _CRTIMP_PURE _CRTIMP +#endif + +#ifndef _PGLOBAL +#define _PGLOBAL +#endif + +#ifndef _AGLOBAL +#define _AGLOBAL +#endif + +#define __STDC_SECURE_LIB__ 200411L +#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__ +#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD +#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated) + +#ifndef _CRT_INSECURE_DEPRECATE_MEMORY +#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement) +#endif +#ifndef _CRT_INSECURE_DEPRECATE_GLOBALS +#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement) +#endif +#ifndef _CRT_MANAGED_HEAP_DEPRECATE +#define _CRT_MANAGED_HEAP_DEPRECATE +#endif + +#ifndef _CRT_OBSOLETE +#define _CRT_OBSOLETE(_NewItem) #endif #ifndef _SIZE_T_DEFINED #define _SIZE_T_DEFINED #undef size_t #ifdef _WIN64 +#define _INTEGRAL_MAX_BITS 64 #if defined(__GNUC__) && defined(__STRICT_ANSI__) typedef unsigned int size_t __attribute__ ((mode (DI))); #else typedef unsigned __int64 size_t; #endif #else + #define _INTEGRAL_MAX_BITS 32 typedef unsigned int size_t; #endif #endif -#define __MINGW32_VERSION 3.13 -#define __MINGW32_MAJOR_VERSION 3 -#define __MINGW32_MINOR_VERSION 13 +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#undef ssize_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int ssize_t __attribute__ ((mode (DI))); +#else + typedef __int64 ssize_t; +#endif +#else + typedef int ssize_t; +#endif +#endif -#endif /* __MINGW_H */ +#ifndef _INTPTR_T_DEFINED +#define _INTPTR_T_DEFINED +#ifndef __intptr_t_defined +#define __intptr_t_defined +#undef intptr_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int intptr_t __attribute__ ((mode (DI))); +#else + typedef __int64 intptr_t; +#endif +#else + typedef int intptr_t; +#endif +#endif +#endif + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifndef __uintptr_t_defined +#define __uintptr_t_defined +#undef uintptr_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef unsigned int uintptr_t __attribute__ ((mode (DI))); +#else + typedef unsigned __int64 uintptr_t; +#endif +#else + typedef unsigned int uintptr_t; +#endif +#endif +#endif + +#ifndef _PTRDIFF_T_DEFINED +#define _PTRDIFF_T_DEFINED +#ifndef _PTRDIFF_T_ +#undef ptrdiff_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int ptrdiff_t __attribute__ ((mode (DI))); +#else + typedef __int64 ptrdiff_t; +#endif +#else + typedef int ptrdiff_t; +#endif +#endif +#endif + +#ifndef _WCHAR_T_DEFINED +#define _WCHAR_T_DEFINED +#ifndef __cplusplus + typedef unsigned short wchar_t; +#endif +#endif + +#ifndef _WCTYPE_T_DEFINED +#define _WCTYPE_T_DEFINED + typedef unsigned short wint_t; + typedef unsigned short wctype_t; +#endif + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + typedef __builtin_va_list __gnuc_va_list; +#endif + +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED + typedef __gnuc_va_list va_list; +#endif + +#ifdef _USE_32BIT_TIME_T +#ifdef _WIN64 +#error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64 +#undef _USE_32BIT_TIME_T +#endif +#else +#if _INTEGRAL_MAX_BITS < 64 +#define _USE_32BIT_TIME_T +#endif +#endif + +#ifndef _ERRCODE_DEFINED +#define _ERRCODE_DEFINED + typedef int errcode; + typedef int errno_t; +#endif + +#ifndef _TIME32_T_DEFINED +#define _TIME32_T_DEFINED + typedef long __time32_t; +#endif + +#ifndef _TIME64_T_DEFINED +#define _TIME64_T_DEFINED + typedef __int64 __time64_t; +#endif + +#ifndef _TIME_T_DEFINED +#define _TIME_T_DEFINED +#ifdef _USE_32BIT_TIME_T + typedef __time32_t time_t; +#else + typedef __time64_t time_t; +#endif +#endif + +#ifndef _CONST_RETURN +#define _CONST_RETURN +#endif + +#ifndef __CRT_UNALIGNED +#define __CRT_UNALIGNED +#endif + +#ifndef UNALIGNED +#if defined(__ia64__) || defined(__x86_64) +#define UNALIGNED __CRT_UNALIGNED +#else +#define UNALIGNED +#endif +#endif + +#ifndef _CRT_ALIGN +#define _CRT_ALIGN(x) __attribute__ ((aligned(x))) +#endif + +#ifndef _CRTNOALIAS +#define _CRTNOALIAS +#endif + +#ifndef _CRTRESTRICT +#define _CRTRESTRICT +#endif + +#ifndef __CRTDECL +#define __CRTDECL __cdecl +#endif + +#define _ARGMAX 100 + +#ifndef _TRUNCATE +#define _TRUNCATE ((size_t)-1) +#endif + struct threadlocaleinfostruct; + struct threadmbcinfostruct; + typedef struct threadlocaleinfostruct *pthreadlocinfo; + typedef struct threadmbcinfostruct *pthreadmbcinfo; + struct __lc_time_data; + + typedef struct localeinfo_struct { + pthreadlocinfo locinfo; + pthreadmbcinfo mbcinfo; + } _locale_tstruct,*_locale_t; + +#ifndef _TAGLC_ID_DEFINED +#define _TAGLC_ID_DEFINED + typedef struct tagLC_ID { + unsigned short wLanguage; + unsigned short wCountry; + unsigned short wCodePage; + } LC_ID,*LPLC_ID; +#endif + +#ifndef _THREADLOCALEINFO +#define _THREADLOCALEINFO + typedef struct threadlocaleinfostruct { + int refcount; + unsigned int lc_codepage; + unsigned int lc_collate_cp; + unsigned long lc_handle[6]; + LC_ID lc_id[6]; + struct { + char *locale; + wchar_t *wlocale; + int *refcount; + int *wrefcount; + } lc_category[6]; + int lc_clike; + int mb_cur_max; + int *lconv_intl_refcount; + int *lconv_num_refcount; + int *lconv_mon_refcount; + struct lconv *lconv; + int *ctype1_refcount; + unsigned short *ctype1; + const unsigned short *pctype; + const unsigned char *pclmap; + const unsigned char *pcumap; + struct __lc_time_data *lc_time_curr; + } threadlocinfo; +#endif + +#ifdef __cplusplus +} +#endif + +#define __crt_typefix(ctype) + +#ifndef _CRT_UNUSED +#define _CRT_UNUSED(x) (void)x +#endif + +#pragma pack(pop) +#endif + +#endif diff --git a/reactos/include/crt/assert.h b/reactos/include/crt/assert.h index 1ff6690af2d..a486eb16aeb 100644 --- a/reactos/include/crt/assert.h +++ b/reactos/include/crt/assert.h @@ -1,51 +1,58 @@ -/* - * assert.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Define the assert macro for debug output. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef __ASSERT_H_ +#define __ASSERT_H_ -/* We should be able to include this file multiple times to allow the assert - macro to be enabled/disabled for different parts of code. So don't add a - header guard. */ - -#ifndef RC_INVOKED - -/* All the headers include this file. */ #include <_mingw.h> - -#undef assert - -#ifdef __cplusplus -extern "C" { +#ifdef __cplusplus +#include #endif #ifdef NDEBUG -/* - * If not debugging, assert does nothing. - */ -#define assert(x) ((void)0) +#ifndef assert +#define assert(_Expression) ((void)0) +#endif +#else -#else /* debugging enabled */ +#ifndef _CRT_TERMINATE_DEFINED +#define _CRT_TERMINATE_DEFINED +__declspec(noreturn) void __cdecl exit(int _Code); +_CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code); +#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ +/* C99 function name */ +void __cdecl __declspec(noreturn) _Exit(int); /* Declare to get noreturn attribute. */ +__CRT_INLINE void __cdecl _Exit(int status) +{ _exit(status); } +#endif -/* - * CRTDLL nicely supplies a function which does the actual output and - * call to abort. - */ -_CRTIMP void __cdecl __MINGW_NOTHROW _assert (const char*, const char*, int) __MINGW_ATTRIB_NORETURN; +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma push_macro("abort") +#undef abort +#endif + void __cdecl __declspec(noreturn) abort(void); +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma pop_macro("abort") +#endif -/* - * Definition of the assert macro. - */ -#define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) +#endif -#endif /* NDEBUG */ +#ifdef __cplusplus +extern "C" { +#endif -#ifdef __cplusplus +//extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line); + +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ +#ifndef assert +#define assert(_Expression) (void)((!!(_Expression)))// || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0)) +#endif + +#endif + +#endif diff --git a/reactos/include/crt/complex.h b/reactos/include/crt/complex.h index 2fd73a12e2c..f659dd93d1e 100644 --- a/reactos/include/crt/complex.h +++ b/reactos/include/crt/complex.h @@ -1,3 +1,8 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* * complex.h * @@ -46,11 +51,11 @@ extern "C" { #ifndef RC_INVOKED -double __MINGW_ATTRIB_CONST creal (double _Complex); -double __MINGW_ATTRIB_CONST cimag (double _Complex); -double __MINGW_ATTRIB_CONST carg (double _Complex); -double __MINGW_ATTRIB_CONST cabs (double _Complex); -double _Complex __MINGW_ATTRIB_CONST conj (double _Complex); +double creal (double _Complex); +double cimag (double _Complex); +double carg (double _Complex); +double cabs (double _Complex); +double _Complex conj (double _Complex); double _Complex cacos (double _Complex); double _Complex casin (double _Complex); double _Complex catan (double _Complex); @@ -67,13 +72,13 @@ double _Complex cexp (double _Complex); double _Complex clog (double _Complex); double _Complex cpow (double _Complex, double _Complex); double _Complex csqrt (double _Complex); -double _Complex __MINGW_ATTRIB_CONST cproj (double _Complex); +double _Complex cproj (double _Complex); -float __MINGW_ATTRIB_CONST crealf (float _Complex); -float __MINGW_ATTRIB_CONST cimagf (float _Complex); -float __MINGW_ATTRIB_CONST cargf (float _Complex); -float __MINGW_ATTRIB_CONST cabsf (float _Complex); -float _Complex __MINGW_ATTRIB_CONST conjf (float _Complex); +float crealf (float _Complex); +float cimagf (float _Complex); +float cargf (float _Complex); +float cabsf (float _Complex); +float _Complex conjf (float _Complex); float _Complex cacosf (float _Complex); float _Complex casinf (float _Complex); float _Complex catanf (float _Complex); @@ -90,13 +95,13 @@ float _Complex cexpf (float _Complex); float _Complex clogf (float _Complex); float _Complex cpowf (float _Complex, float _Complex); float _Complex csqrtf (float _Complex); -float _Complex __MINGW_ATTRIB_CONST cprojf (float _Complex); +float _Complex cprojf (float _Complex); -long double __MINGW_ATTRIB_CONST creall (long double _Complex); -long double __MINGW_ATTRIB_CONST cimagl (long double _Complex); -long double __MINGW_ATTRIB_CONST cargl (long double _Complex); -long double __MINGW_ATTRIB_CONST cabsl (long double _Complex); -long double _Complex __MINGW_ATTRIB_CONST conjl (long double _Complex); +long double creall (long double _Complex); +long double cimagl (long double _Complex); +long double cargl (long double _Complex); +long double cabsl (long double _Complex); +long double _Complex conjl (long double _Complex); long double _Complex cacosl (long double _Complex); long double _Complex casinl (long double _Complex); long double _Complex catanl (long double _Complex); @@ -113,27 +118,27 @@ long double _Complex cexpl (long double _Complex); long double _Complex clogl (long double _Complex); long double _Complex cpowl (long double _Complex, long double _Complex); long double _Complex csqrtl (long double _Complex); -long double _Complex __MINGW_ATTRIB_CONST cprojl (long double _Complex); +long double _Complex cprojl (long double _Complex); #ifdef __GNUC__ /* double */ -__CRT_INLINE double __MINGW_ATTRIB_CONST creal (double _Complex _Z) +__CRT_INLINE double creal (double _Complex _Z) { return __real__ _Z; } -__CRT_INLINE double __MINGW_ATTRIB_CONST cimag (double _Complex _Z) +__CRT_INLINE double cimag (double _Complex _Z) { return __imag__ _Z; } -__CRT_INLINE double _Complex __MINGW_ATTRIB_CONST conj (double _Complex _Z) +__CRT_INLINE double _Complex conj (double _Complex _Z) { return __extension__ ~_Z; } -__CRT_INLINE double __MINGW_ATTRIB_CONST carg (double _Complex _Z) +__CRT_INLINE double carg (double _Complex _Z) { double res; __asm__ ("fpatan;" @@ -143,22 +148,22 @@ __CRT_INLINE double __MINGW_ATTRIB_CONST carg (double _Complex _Z) /* float */ -__CRT_INLINE float __MINGW_ATTRIB_CONST crealf (float _Complex _Z) +__CRT_INLINE float crealf (float _Complex _Z) { return __real__ _Z; } -__CRT_INLINE float __MINGW_ATTRIB_CONST cimagf (float _Complex _Z) +__CRT_INLINE float cimagf (float _Complex _Z) { return __imag__ _Z; } -__CRT_INLINE float _Complex __MINGW_ATTRIB_CONST conjf (float _Complex _Z) +__CRT_INLINE float _Complex conjf (float _Complex _Z) { return __extension__ ~_Z; } -__CRT_INLINE float __MINGW_ATTRIB_CONST cargf (float _Complex _Z) +__CRT_INLINE float cargf (float _Complex _Z) { float res; __asm__ ("fpatan;" @@ -167,22 +172,22 @@ __CRT_INLINE float __MINGW_ATTRIB_CONST cargf (float _Complex _Z) } /* long double */ -__CRT_INLINE long double __MINGW_ATTRIB_CONST creall (long double _Complex _Z) +__CRT_INLINE long double creall (long double _Complex _Z) { return __real__ _Z; } -__CRT_INLINE long double __MINGW_ATTRIB_CONST cimagl (long double _Complex _Z) +__CRT_INLINE long double cimagl (long double _Complex _Z) { return __imag__ _Z; } -__CRT_INLINE long double _Complex __MINGW_ATTRIB_CONST conjl (long double _Complex _Z) +__CRT_INLINE long double _Complex conjl (long double _Complex _Z) { return __extension__ ~_Z; } -__CRT_INLINE long double __MINGW_ATTRIB_CONST cargl (long double _Complex _Z) +__CRT_INLINE long double cargl (long double _Complex _Z) { long double res; __asm__ ("fpatan;" diff --git a/reactos/include/crt/conio.h b/reactos/include/crt/conio.h index 8a821cbdba8..2b71ce6ddb4 100644 --- a/reactos/include/crt/conio.h +++ b/reactos/include/crt/conio.h @@ -1,53 +1,101 @@ -/* - * conio.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Low level console I/O functions. Pretty please try to use the ANSI - * standard ones if you are writing new code. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_CONIO +#define _INC_CONIO -#ifndef _CONIO_H_ -#define _CONIO_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#ifndef RC_INVOKED - -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -_CRTIMP char* __cdecl __MINGW_NOTHROW _cgets (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _cprintf (const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _cputs (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _cscanf (char*, ...); + _CRTIMP char *_cgets(char *_Buffer); + _CRTIMP int __cdecl _cprintf(const char *_Format,...); + _CRTIMP int __cdecl _cputs(const char *_Str); + _CRTIMP int __cdecl _cscanf(const char *_Format,...); + _CRTIMP int __cdecl _cscanf_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _getch(void); + _CRTIMP int __cdecl _getche(void); + _CRTIMP int __cdecl _vcprintf(const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cprintf_p(const char *_Format,...); + _CRTIMP int __cdecl _vcprintf_p(const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cprintf_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _cprintf_p_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _kbhit(void); -_CRTIMP int __cdecl __MINGW_NOTHROW _getch (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _getche (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _kbhit (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _putch (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ungetch (int); +#if defined(_X86_) && !defined(__x86_64) + int __cdecl _inp(unsigned short); + unsigned short __cdecl _inpw(unsigned short); + unsigned long __cdecl _inpd(unsigned short); + int __cdecl _outp(unsigned short,int); + unsigned short __cdecl _outpw(unsigned short,unsigned short); + unsigned long __cdecl _outpd(unsigned short,unsigned long); +#endif + _CRTIMP int __cdecl _putch(int _Ch); + _CRTIMP int __cdecl _ungetch(int _Ch); + _CRTIMP int __cdecl _getch_nolock(void); + _CRTIMP int __cdecl _getche_nolock(void); + _CRTIMP int __cdecl _putch_nolock(int _Ch); + _CRTIMP int __cdecl _ungetch_nolock(int _Ch); -#ifndef _NO_OLDNAMES +#ifndef _WCONIO_DEFINED +#define _WCONIO_DEFINED -_CRTIMP int __cdecl __MINGW_NOTHROW getch (void); -_CRTIMP int __cdecl __MINGW_NOTHROW getche (void); -_CRTIMP int __cdecl __MINGW_NOTHROW kbhit (void); -_CRTIMP int __cdecl __MINGW_NOTHROW putch (int); -_CRTIMP int __cdecl __MINGW_NOTHROW ungetch (int); +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) +#endif -#endif /* Not _NO_OLDNAMES */ + _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer); + _CRTIMP wint_t __cdecl _getwch(void); + _CRTIMP wint_t __cdecl _getwche(void); + _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh); + _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh); + _CRTIMP int __cdecl _cputws(const wchar_t *_String); + _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...); + _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cwprintf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP wint_t __cdecl _putwch_nolock(wchar_t _WCh); + _CRTIMP wint_t __cdecl _getwch_nolock(void); + _CRTIMP wint_t __cdecl _getwche_nolock(void); + _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh); +#endif +#ifndef NO_OLDNAMES + char *__cdecl cgets(char *_Buffer); + int __cdecl cprintf(const char *_Format,...); + int __cdecl cputs(const char *_Str); + int __cdecl cscanf(const char *_Format,...); + int __cdecl getch(void); + int __cdecl getche(void); + int __cdecl kbhit(void); + int __cdecl putch(int _Ch); + int __cdecl ungetch(int _Ch); -#ifdef __cplusplus +#if (defined(_X86_) && !defined(__x86_64)) + int __cdecl inp(unsigned short); + unsigned short __cdecl inpw(unsigned short); + int __cdecl outp(unsigned short,int); + unsigned short __cdecl outpw(unsigned short,unsigned short); +#endif + +#endif +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ +#include -#endif /* Not _CONIO_H_ */ +#endif diff --git a/reactos/include/crt/ctype.h b/reactos/include/crt/ctype.h index 44a932bcb3f..45b64091d60 100644 --- a/reactos/include/crt/ctype.h +++ b/reactos/include/crt/ctype.h @@ -1,277 +1,281 @@ -/* - * ctype.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for testing character types and converting characters. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_CTYPE +#define _INC_CTYPE -#ifndef _CTYPE_H_ -#define _CTYPE_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#define __need_wchar_t -#define __need_wint_t -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ - - -/* - * The following flags are used to tell iswctype and _isctype what character - * types you are looking for. - */ -#define _UPPER 0x0001 -#define _LOWER 0x0002 -#define _DIGIT 0x0004 -#define _SPACE 0x0008 /* HT LF VT FF CR SP */ -#define _PUNCT 0x0010 -#define _CONTROL 0x0020 -/* _BLANK is set for SP and non-ASCII horizontal space chars (eg, - "no-break space", 0xA0, in CP1250) but not for HT. */ -#define _BLANK 0x0040 -#define _HEX 0x0080 -#define _LEADBYTE 0x8000 - -#define _ALPHA 0x0103 - -#ifndef RC_INVOKED - #ifdef __cplusplus extern "C" { #endif -_CRTIMP int __cdecl __MINGW_NOTHROW isalnum(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isalpha(int); -_CRTIMP int __cdecl __MINGW_NOTHROW iscntrl(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isdigit(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isgraph(int); -_CRTIMP int __cdecl __MINGW_NOTHROW islower(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isprint(int); -_CRTIMP int __cdecl __MINGW_NOTHROW ispunct(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isspace(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isupper(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isxdigit(int); - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ -int __cdecl __MINGW_NOTHROW isblank (int); -#endif - -#ifndef __STRICT_ANSI__ -_CRTIMP int __cdecl __MINGW_NOTHROW _isctype (int, int); -#endif - -/* These are the ANSI versions, with correct checking of argument */ -_CRTIMP int __cdecl __MINGW_NOTHROW tolower(int); -_CRTIMP int __cdecl __MINGW_NOTHROW toupper(int); - -/* - * NOTE: The above are not old name type wrappers, but functions exported - * explicitly by MSVCRT/CRTDLL. However, underscored versions are also - * exported. - */ -#ifndef __STRICT_ANSI__ -/* - * These are the cheap non-std versions: The return values are undefined - * if the argument is not ASCII char or is not of appropriate case - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _tolower(int); -_CRTIMP int __cdecl __MINGW_NOTHROW _toupper(int); -#endif - -/* Also defined in stdlib.h */ -#ifndef MB_CUR_MAX -#ifdef __DECLSPEC_SUPPORTED -# ifdef __MSVCRT__ -# define MB_CUR_MAX __mb_cur_max - __MINGW_IMPORT int __mb_cur_max; -# else /* not __MSVCRT */ -# define MB_CUR_MAX __mb_cur_max_dll - __MINGW_IMPORT int __mb_cur_max_dll; -# endif /* not __MSVCRT */ - -#else /* ! __DECLSPEC_SUPPORTED */ -# ifdef __MSVCRT__ - extern int* _imp____mbcur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# else /* not __MSVCRT */ - extern int* _imp____mbcur_max_dll; -# define MB_CUR_MAX (*_imp____mb_cur_max_dll) -# endif /* not __MSVCRT */ -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* MB_CUR_MAX */ - -#ifndef _WCTYPE_H_ -#ifdef __DECLSPEC_SUPPORTED -# if __MSVCRT_VERSION__ <= 0x0700 - __MINGW_IMPORT unsigned short _ctype[]; -# endif -# ifdef __MSVCRT__ - __MINGW_IMPORT const unsigned short* _pctype; -# else /* CRTDLL */ - __MINGW_IMPORT const unsigned short* _pctype_dll; -# define _pctype _pctype_dll -# endif - -#else /* __DECLSPEC_SUPPORTED */ -# if __MSVCRT_VERSION__ <= 0x0700 - extern unsigned short** _imp___ctype; -# define _ctype (*_imp___ctype) -# endif -# ifdef __MSVCRT__ - extern unsigned short** _imp___pctype; -# define _pctype (*_imp___pctype) -# else /* CRTDLL */ - extern unsigned short** _imp___pctype_dll; -# define _pctype (*_imp___pctype_dll) -# endif /* CRTDLL */ -#endif /* __DECLSPEC_SUPPORTED */ -#endif - -/* - * Use inlines here rather than macros, because macros will upset - * C++ usage (eg, ::isalnum), and so usually get undefined - * - * According to standard for SB chars, these function are defined only - * for input values representable by unsigned char or EOF. - * Thus, there is no range test. - * This reproduces behaviour of MSVCRT.dll lib implemention for SB chars. - * - * If no MB char support is needed, these can be simplified even - * more by command line define -DMB_CUR_MAX=1. The compiler will then - * optimise away the constant condition. - */ - -#if !(defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES) \ - || defined (__STRICT_ANSI__)) - -/* use simple lookup if SB locale, else _isctype() */ -#define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask)) -__CRT_INLINE int __cdecl __MINGW_NOTHROW isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isalpha(int c) {return __ISCTYPE(c, _ALPHA);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iscntrl(int c) {return __ISCTYPE(c, _CONTROL);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isdigit(int c) {return __ISCTYPE(c, _DIGIT);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW islower(int c) {return __ISCTYPE(c, _LOWER);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW ispunct(int c) {return __ISCTYPE(c, _PUNCT);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isspace(int c) {return __ISCTYPE(c, _SPACE);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isupper(int c) {return __ISCTYPE(c, _UPPER);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isxdigit(int c) {return __ISCTYPE(c, _HEX);} - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ -__CRT_INLINE int __cdecl __MINGW_NOTHROW isblank (int c) - {return (__ISCTYPE(c, _BLANK) || c == '\t');} -#endif - -/* these reproduce behaviour of lib underscored versions */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW _tolower(int c) {return ( c -'A'+'a');} -__CRT_INLINE int __cdecl __MINGW_NOTHROW _toupper(int c) {return ( c -'a'+'A');} - -/* TODO? Is it worth inlining ANSI tolower, toupper? Probably only - if we only want C-locale. */ - -#endif /* _NO_CTYPE_INLINES */ - -/* Wide character equivalents */ - #ifndef WEOF -#define WEOF (wchar_t)(0xFFFF) +#define WEOF (wint_t)(0xFFFF) #endif -#ifndef _WCTYPE_T_DEFINED -typedef wchar_t wctype_t; -#define _WCTYPE_T_DEFINED +#ifndef _CRT_CTYPEDATA_DEFINED +#define _CRT_CTYPEDATA_DEFINED +#ifndef _CTYPE_DISABLE_MACROS + +#ifndef __PCTYPE_FUNC +#define __PCTYPE_FUNC __pctype_func() +#ifdef _MSVCRT_ +#define __pctype_func() (_pctype) +#else +#define __pctype_func() (*_imp___pctype) +#endif #endif -_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t); -_CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */ -_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t); - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -int __cdecl __MINGW_NOTHROW iswblank (wint_t); +#ifndef _pctype +#ifdef _MSVCRT_ + extern const unsigned short *_pctype; +#else + extern const unsigned short **_imp___pctype; +#define _pctype (*_imp___pctype) +#endif #endif -/* Older MS docs uses wchar_t for arg and return type, while newer - online MS docs say arg is wint_t and return is int. - ISO C uses wint_t for both. */ -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towlower (wint_t); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towupper (wint_t); - -_CRTIMP int __cdecl __MINGW_NOTHROW isleadbyte (int); - -/* Also in wctype.h */ -#if ! (defined (__NO_INLINE__) || defined(__NO_CTYPE_INLINES) \ - || defined(__WCTYPE_INLINES_DEFINED)) -#define __WCTYPE_INLINES_DEFINED -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswascii(wint_t wc) {return ((wc & ~0x7F) ==0);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswlower(wint_t wc) {return (iswctype(wc,_LOWER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswspace(wint_t wc) {return (iswctype(wc,_SPACE));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswupper(wint_t wc) {return (iswctype(wc,_UPPER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswblank (wint_t wc) - {return (iswctype(wc,_BLANK) || wc == L'\t');} +#endif #endif -#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ +#ifndef _CRT_WCTYPEDATA_DEFINED +#define _CRT_WCTYPEDATA_DEFINED +#ifndef _CTYPE_DISABLE_MACROS +#ifndef _wctype +#ifdef _MSVCRT_ + extern unsigned short *_wctype; +#else + extern unsigned short **_imp___wctype; +#define _wctype (*_imp___wctype) +#endif +#endif +#ifdef _MSVCRT_ +#define __pwctype_func() (_pwctype) +#ifndef _pwctype + extern const unsigned short *_pwctype; +#endif +#else +#define __pwctype_func() (*_imp___pwctype) +#ifndef _pwctype + extern const unsigned short **_imp___pwctype; +#define _pwctype (*_imp___pwctype) +#endif +#endif +#endif +#endif -#ifndef __STRICT_ANSI__ -int __cdecl __MINGW_NOTHROW __isascii (int); -int __cdecl __MINGW_NOTHROW __toascii (int); -int __cdecl __MINGW_NOTHROW __iscsymf (int); /* Valid first character in C symbol */ -int __cdecl __MINGW_NOTHROW __iscsym (int); /* Valid character in C symbol (after first) */ + /* CRT stuff */ +#if 1 + extern const unsigned char __newclmap[]; + extern const unsigned char __newcumap[]; + extern pthreadlocinfo __ptlocinfo; + extern pthreadmbcinfo __ptmbcinfo; + extern int __globallocalestatus; + extern int __locale_changed; + extern struct threadlocaleinfostruct __initiallocinfo; + extern _locale_tstruct __initiallocalestructinfo; + pthreadlocinfo __cdecl __updatetlocinfo(void); + pthreadmbcinfo __cdecl __updatetmbcinfo(void); +#endif -#if !(defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES)) -__CRT_INLINE int __cdecl __MINGW_NOTHROW __isascii(int c) {return ((c & ~0x7F) == 0);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW __toascii(int c) {return (c & 0x7F);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW __iscsymf(int c) {return (isalpha(c) || (c == '_'));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW __iscsym(int c) {return (isalnum(c) || (c == '_'));} -#endif /* __NO_CTYPE_INLINES */ +#define _UPPER 0x1 +#define _LOWER 0x2 +#define _DIGIT 0x4 +#define _SPACE 0x8 -#ifndef _NO_OLDNAMES -/* Not _CRTIMP */ -int __cdecl __MINGW_NOTHROW isascii (int); -int __cdecl __MINGW_NOTHROW toascii (int); -int __cdecl __MINGW_NOTHROW iscsymf (int); -int __cdecl __MINGW_NOTHROW iscsym (int); -#endif /* Not _NO_OLDNAMES */ +#define _PUNCT 0x10 +#define _CONTROL 0x20 +#define _BLANK 0x40 +#define _HEX 0x80 -#endif /* Not __STRICT_ANSI__ */ +#define _LEADBYTE 0x8000 +#define _ALPHA (0x0100|_UPPER|_LOWER) + +#ifndef _CTYPE_DEFINED +#define _CTYPE_DEFINED + + _CRTIMP int __cdecl _isctype(int _C,int _Type); + _CRTIMP int __cdecl _isctype_l(int _C,int _Type,_locale_t _Locale); + _CRTIMP int __cdecl isalpha(int _C); + _CRTIMP int __cdecl _isalpha_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl isupper(int _C); + _CRTIMP int __cdecl _isupper_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl islower(int _C); + _CRTIMP int __cdecl _islower_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl isdigit(int _C); + _CRTIMP int __cdecl _isdigit_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl isxdigit(int _C); + _CRTIMP int __cdecl _isxdigit_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl isspace(int _C); + _CRTIMP int __cdecl _isspace_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl ispunct(int _C); + _CRTIMP int __cdecl _ispunct_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl isalnum(int _C); + _CRTIMP int __cdecl _isalnum_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl isprint(int _C); + _CRTIMP int __cdecl _isprint_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl isgraph(int _C); + _CRTIMP int __cdecl _isgraph_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl iscntrl(int _C); + _CRTIMP int __cdecl _iscntrl_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl toupper(int _C); + _CRTIMP int __cdecl tolower(int _C); + _CRTIMP int __cdecl _tolower(int _C); + _CRTIMP int __cdecl _tolower_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl _toupper(int _C); + _CRTIMP int __cdecl _toupper_l(int _C,_locale_t _Locale); + _CRTIMP int __cdecl __isascii(int _C); + _CRTIMP int __cdecl __toascii(int _C); + _CRTIMP int __cdecl __iscsymf(int _C); + _CRTIMP int __cdecl __iscsym(int _C); + +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) +int __cdecl isblank(int _C); +#endif +#endif + +#ifndef _WCTYPE_DEFINED +#define _WCTYPE_DEFINED + + int __cdecl iswalpha(wint_t _C); + _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale); + int __cdecl iswupper(wint_t _C); + _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale); + int __cdecl iswlower(wint_t _C); + _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale); + int __cdecl iswdigit(wint_t _C); + _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale); + int __cdecl iswxdigit(wint_t _C); + _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale); + int __cdecl iswspace(wint_t _C); + _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale); + int __cdecl iswpunct(wint_t _C); + _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale); + int __cdecl iswalnum(wint_t _C); + _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale); + int __cdecl iswprint(wint_t _C); + _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale); + int __cdecl iswgraph(wint_t _C); + _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale); + int __cdecl iswcntrl(wint_t _C); + _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale); + int __cdecl iswascii(wint_t _C); + int __cdecl isleadbyte(int _C); + _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale); + wint_t __cdecl towupper(wint_t _C); + _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale); + wint_t __cdecl towlower(wint_t _C); + _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale); + int __cdecl iswctype(wint_t _C,wctype_t _Type); + _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale); + _CRTIMP int __cdecl __iswcsymf(wint_t _C); + _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale); + _CRTIMP int __cdecl __iswcsym(wint_t _C); + _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale); + int __cdecl is_wctype(wint_t _C,wctype_t _Type); + +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) +int __cdecl iswblank(wint_t _C); +#endif +#endif + +#ifndef _CTYPE_DISABLE_MACROS + +#ifndef MB_CUR_MAX +#define MB_CUR_MAX ___mb_cur_max_func() +#ifndef __mb_cur_max +#ifdef _MSVCRT_ + extern int __mb_cur_max; +#else +#define __mb_cur_max (*_imp____mb_cur_max) + extern int *_imp____mb_cur_max; +#endif +#endif +#ifdef _MSVCRT_ +#define ___mb_cur_max_func() (__mb_cur_max) +#else +#define ___mb_cur_max_func() (*_imp____mb_cur_max) +#endif +#endif + +#define __chvalidchk(a,b) (__PCTYPE_FUNC[(a)] & (b)) +#define _chvalidchk_l(_Char,_Flag,_Locale) (!_Locale ? __chvalidchk(_Char,_Flag) : ((_locale_t)_Locale)->locinfo->pctype[_Char] & (_Flag)) +#define _ischartype_l(_Char,_Flag,_Locale) (((_Locale)!=NULL && (((_locale_t)(_Locale))->locinfo->mb_cur_max) > 1) ? _isctype_l(_Char,(_Flag),_Locale) : _chvalidchk_l(_Char,_Flag,_Locale)) +#define _isalpha_l(_Char,_Locale) _ischartype_l(_Char,_ALPHA,_Locale) +#define _isupper_l(_Char,_Locale) _ischartype_l(_Char,_UPPER,_Locale) +#define _islower_l(_Char,_Locale) _ischartype_l(_Char,_LOWER,_Locale) +#define _isdigit_l(_Char,_Locale) _ischartype_l(_Char,_DIGIT,_Locale) +#define _isxdigit_l(_Char,_Locale) _ischartype_l(_Char,_HEX,_Locale) +#define _isspace_l(_Char,_Locale) _ischartype_l(_Char,_SPACE,_Locale) +#define _ispunct_l(_Char,_Locale) _ischartype_l(_Char,_PUNCT,_Locale) +#define _isalnum_l(_Char,_Locale) _ischartype_l(_Char,_ALPHA|_DIGIT,_Locale) +#define _isprint_l(_Char,_Locale) _ischartype_l(_Char,_BLANK|_PUNCT|_ALPHA|_DIGIT,_Locale) +#define _isgraph_l(_Char,_Locale) _ischartype_l(_Char,_PUNCT|_ALPHA|_DIGIT,_Locale) +#define _iscntrl_l(_Char,_Locale) _ischartype_l(_Char,_CONTROL,_Locale) +#define _tolower(_Char) ((_Char)-'A'+'a') +#define _toupper(_Char) ((_Char)-'a'+'A') +#define __isascii(_Char) ((unsigned)(_Char) < 0x80) +#define __toascii(_Char) ((_Char) & 0x7f) + +#ifndef _WCTYPE_INLINE_DEFINED +#define _WCTYPE_INLINE_DEFINED + +#undef _CRT_WCTYPE_NOINLINE +#ifndef __cplusplus +#define iswalpha(_c) (iswctype(_c,_ALPHA)) +#define iswupper(_c) (iswctype(_c,_UPPER)) +#define iswlower(_c) (iswctype(_c,_LOWER)) +#define iswdigit(_c) (iswctype(_c,_DIGIT)) +#define iswxdigit(_c) (iswctype(_c,_HEX)) +#define iswspace(_c) (iswctype(_c,_SPACE)) +#define iswpunct(_c) (iswctype(_c,_PUNCT)) +#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) +#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) +#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) +#define iswcntrl(_c) (iswctype(_c,_CONTROL)) +#define iswascii(_c) ((unsigned)(_c) < 0x80) +#define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p)) +#define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p)) +#define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p)) +#define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p)) +#define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p)) +#define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p)) +#define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p)) +#define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p)) +#define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p)) +#define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p)) +#define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p)) +#endif +#endif + +#define __iscsymf(_c) (isalpha(_c) || ((_c)=='_')) +#define __iscsym(_c) (isalnum(_c) || ((_c)=='_')) +#define __iswcsymf(_c) (iswalpha(_c) || ((_c)=='_')) +#define __iswcsym(_c) (iswalnum(_c) || ((_c)=='_')) +#define _iscsymf_l(_c,_p) (_isalpha_l(_c,_p) || ((_c)=='_')) +#define _iscsym_l(_c,_p) (_isalnum_l(_c,_p) || ((_c)=='_')) +#define _iswcsymf_l(_c,_p) (_iswalpha_l(_c,_p) || ((_c)=='_')) +#define _iswcsym_l(_c,_p) (_iswalnum_l(_c,_p) || ((_c)=='_')) +#endif + +#ifndef NO_OLDNAMES +#ifndef _CTYPE_DEFINED + int __cdecl isascii(int _C); + int __cdecl toascii(int _C); + int __cdecl iscsymf(int _C); + int __cdecl iscsym(int _C); +#else +#define isascii __isascii +#define toascii __toascii +#define iscsymf __iscsymf +#define iscsym __iscsym +#endif +#endif #ifdef __cplusplus } #endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _CTYPE_H_ */ - - +#endif diff --git a/reactos/include/crt/direct.h b/reactos/include/crt/direct.h index 86cd042bab3..99ce69db700 100644 --- a/reactos/include/crt/direct.h +++ b/reactos/include/crt/direct.h @@ -1,73 +1,68 @@ -/* - * direct.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for manipulating paths and directories (included from io.h) - * plus functions for setting the current drive. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ -#ifndef _DIRECT_H_ -#define _DIRECT_H_ +#ifndef _INC_DIRECT +#define _INC_DIRECT -/* All the headers include this file. */ #include <_mingw.h> - -#define __need_wchar_t -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ - #include -#ifndef RC_INVOKED +#pragma pack(push,_CRT_PACKING) -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif #ifndef _DISKFREE_T_DEFINED -/* needed by _getdiskfree (also in dos.h) */ -struct _diskfree_t { - unsigned total_clusters; - unsigned avail_clusters; - unsigned sectors_per_cluster; - unsigned bytes_per_sector; -}; #define _DISKFREE_T_DEFINED + struct _diskfree_t { + unsigned total_clusters; + unsigned avail_clusters; + unsigned sectors_per_cluster; + unsigned bytes_per_sector; + }; #endif -/* - * You really shouldn't be using these. Use the Win32 API functions instead. - * However, it does make it easier to port older code. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _getdrive (void); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW _getdrives(void); -_CRTIMP int __cdecl __MINGW_NOTHROW _chdrive (int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _getdcwd (int, char*, int); -_CRTIMP unsigned __cdecl __MINGW_NOTHROW _getdiskfree (unsigned, struct _diskfree_t *); + _CRTIMP char *__cdecl _getcwd(char *_DstBuf,int _SizeInBytes); + _CRTIMP char *__cdecl _getdcwd(int _Drive,char *_DstBuf,int _SizeInBytes); + char *__cdecl _getdcwd_nolock(int _Drive,char *_DstBuf,int _SizeInBytes); + _CRTIMP int __cdecl _chdir(const char *_Path); + _CRTIMP int __cdecl _mkdir(const char *_Path); + _CRTIMP int __cdecl _rmdir(const char *_Path); + _CRTIMP int __cdecl _chdrive(int _Drive); + _CRTIMP int __cdecl _getdrive(void); + _CRTIMP unsigned long __cdecl _getdrives(void); -#ifndef _NO_OLDNAMES -# define diskfree_t _diskfree_t +#ifndef _GETDISKFREE_DEFINED +#define _GETDISKFREE_DEFINED + _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); #endif #ifndef _WDIRECT_DEFINED -/* wide character versions. Also in wchar.h */ -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wchdir(const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetcwd(wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetdcwd(int, wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wmkdir(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrmdir(const wchar_t*); -#endif /* __MSVCRT__ */ #define _WDIRECT_DEFINED + _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords); + _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords); + wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords); + _CRTIMP int __cdecl _wchdir(const wchar_t *_Path); + _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path); + _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path); #endif -#ifdef __cplusplus +#ifndef NO_OLDNAMES + +#define diskfree_t _diskfree_t + + char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes); + int __cdecl chdir(const char *_Path); + int __cdecl mkdir(const char *_Path); + int __cdecl rmdir(const char *_Path); +#endif + +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _DIRECT_H_ */ +#pragma pack(pop) +#endif diff --git a/reactos/include/crt/dirent.h b/reactos/include/crt/dirent.h index e2a6689241d..cd31f59e0cf 100644 --- a/reactos/include/crt/dirent.h +++ b/reactos/include/crt/dirent.h @@ -1,15 +1,18 @@ -/* - * DIRENT.H (formerly DIRLIB.H) +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +/* All the headers include this file. */ +#include <_mingw.h> + +#ifndef __STRICT_ANSI__ + #ifndef _DIRENT_H_ #define _DIRENT_H_ -/* All the headers include this file. */ -#include <_mingw.h> + +#pragma pack(push,_CRT_PACKING) #include @@ -19,99 +22,102 @@ extern "C" { #endif -struct dirent -{ - long d_ino; /* Always zero. */ - unsigned short d_reclen; /* Always zero. */ - unsigned short d_namlen; /* Length of name in d_name. */ - char d_name[FILENAME_MAX]; /* File name. */ -}; + struct dirent + { + long d_ino; /* Always zero. */ + unsigned short d_reclen; /* Always zero. */ + unsigned short d_namlen; /* Length of name in d_name. */ + char* d_name; /* File name. */ + /* NOTE: The name in the dirent structure points to the name in the + * finddata_t structure in the DIR. */ + }; -/* - * This is an internal data structure. Good programmers will not use it - * except as an argument to one of the functions below. - * dd_stat field is now int (was short in older versions). - */ -typedef struct -{ - /* disk transfer area for this dir */ - struct _finddata_t dd_dta; + /* + * This is an internal data structure. Good programmers will not use it + * except as an argument to one of the functions below. + * dd_stat field is now int (was short in older versions). + */ + typedef struct + { + /* disk transfer area for this dir */ + struct _finddata_t dd_dta; - /* dirent struct to return from dir (NOTE: this makes this thread - * safe as long as only one thread uses a particular DIR struct at - * a time) */ - struct dirent dd_dir; + /* dirent struct to return from dir (NOTE: this makes this thread + * safe as long as only one thread uses a particular DIR struct at + * a time) */ + struct dirent dd_dir; - /* _findnext handle */ - long dd_handle; + /* _findnext handle */ + long dd_handle; - /* - * Status of search: - * 0 = not started yet (next entry to read is first entry) - * -1 = off the end - * positive = 0 based index of next entry - */ - int dd_stat; + /* + * Status of search: + * 0 = not started yet (next entry to read is first entry) + * -1 = off the end + * positive = 0 based index of next entry + */ + int dd_stat; - /* given path for dir with search pattern (struct is extended) */ - char dd_name[1]; -} DIR; + /* given path for dir with search pattern (struct is extended) */ + char dd_name[1]; + } DIR; -DIR* __cdecl __MINGW_NOTHROW opendir (const char*); -struct dirent* __cdecl __MINGW_NOTHROW readdir (DIR*); -int __cdecl __MINGW_NOTHROW closedir (DIR*); -void __cdecl __MINGW_NOTHROW rewinddir (DIR*); -long __cdecl __MINGW_NOTHROW telldir (DIR*); -void __cdecl __MINGW_NOTHROW seekdir (DIR*, long); + DIR* __cdecl opendir (const char*); + struct dirent* __cdecl readdir (DIR*); + int __cdecl closedir (DIR*); + void __cdecl rewinddir (DIR*); + long __cdecl telldir (DIR*); + void __cdecl seekdir (DIR*, long); -/* wide char versions */ + /* wide char versions */ -struct _wdirent -{ - long d_ino; /* Always zero. */ - unsigned short d_reclen; /* Always zero. */ - unsigned short d_namlen; /* Length of name in d_name. */ - wchar_t d_name[FILENAME_MAX]; /* File name. */ -}; + struct _wdirent + { + long d_ino; /* Always zero. */ + unsigned short d_reclen; /* Always zero. */ + unsigned short d_namlen; /* Length of name in d_name. */ + wchar_t* d_name; /* File name. */ + /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */ + }; -/* - * This is an internal data structure. Good programmers will not use it - * except as an argument to one of the functions below. - */ -typedef struct -{ - /* disk transfer area for this dir */ - struct _wfinddata_t dd_dta; + /* + * This is an internal data structure. Good programmers will not use it + * except as an argument to one of the functions below. + */ + typedef struct + { + /* disk transfer area for this dir */ + struct _wfinddata_t dd_dta; - /* dirent struct to return from dir (NOTE: this makes this thread - * safe as long as only one thread uses a particular DIR struct at - * a time) */ - struct _wdirent dd_dir; + /* dirent struct to return from dir (NOTE: this makes this thread + * safe as long as only one thread uses a particular DIR struct at + * a time) */ + struct _wdirent dd_dir; - /* _findnext handle */ - long dd_handle; + /* _findnext handle */ + long dd_handle; - /* - * Status of search: - * 0 = not started yet (next entry to read is first entry) - * -1 = off the end - * positive = 0 based index of next entry - */ - int dd_stat; + /* + * Status of search: + * 0 = not started yet (next entry to read is first entry) + * -1 = off the end + * positive = 0 based index of next entry + */ + int dd_stat; - /* given path for dir with search pattern (struct is extended) */ - wchar_t dd_name[1]; -} _WDIR; + /* given path for dir with search pattern (struct is extended) */ + wchar_t dd_name[1]; + } _WDIR; -_WDIR* __cdecl __MINGW_NOTHROW _wopendir (const wchar_t*); -struct _wdirent* __cdecl __MINGW_NOTHROW _wreaddir (_WDIR*); -int __cdecl __MINGW_NOTHROW _wclosedir (_WDIR*); -void __cdecl __MINGW_NOTHROW _wrewinddir (_WDIR*); -long __cdecl __MINGW_NOTHROW _wtelldir (_WDIR*); -void __cdecl __MINGW_NOTHROW _wseekdir (_WDIR*, long); + _WDIR* __cdecl _wopendir (const wchar_t*); + struct _wdirent* __cdecl _wreaddir (_WDIR*); + int __cdecl _wclosedir (_WDIR*); + void __cdecl _wrewinddir (_WDIR*); + long __cdecl _wtelldir (_WDIR*); + void __cdecl _wseekdir (_WDIR*, long); #ifdef __cplusplus @@ -120,4 +126,10 @@ void __cdecl __MINGW_NOTHROW _wseekdir (_WDIR*, long); #endif /* Not RC_INVOKED */ +#pragma pack(pop) + #endif /* Not _DIRENT_H_ */ + + +#endif /* Not __STRICT_ANSI__ */ + diff --git a/reactos/include/crt/dos.h b/reactos/include/crt/dos.h index e6bf561ac5b..8530582c6ac 100644 --- a/reactos/include/crt/dos.h +++ b/reactos/include/crt/dos.h @@ -1,89 +1,55 @@ -/* - * dos.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * DOS-specific functions and structures. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_DOS +#define _INC_DOS -#ifndef _DOS_H_ -#define _DOS_H_ - -/* All the headers include this file. */ #include <_mingw.h> - -#define __need_wchar_t -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ - -/* For DOS file attributes */ #include -#ifndef RC_INVOKED +#pragma pack(push,_CRT_PACKING) #ifdef __cplusplus extern "C" { #endif -#ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */ -#ifndef __DECLSPEC_SUPPORTED -extern unsigned int *_imp___basemajor_dll; -extern unsigned int *_imp___baseminor_dll; -extern unsigned int *_imp___baseversion_dll; -extern unsigned int *_imp___osmajor_dll; -extern unsigned int *_imp___osminor_dll; -extern unsigned int *_imp___osmode_dll; - -#define _basemajor (*_imp___basemajor_dll) -#define _baseminor (*_imp___baseminor_dll) -#define _baseversion (*_imp___baseversion_dll) -#define _osmajor (*_imp___osmajor_dll) -#define _osminor (*_imp___osminor_dll) -#define _osmode (*_imp___osmode_dll) - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT unsigned int _basemajor_dll; -__MINGW_IMPORT unsigned int _baseminor_dll; -__MINGW_IMPORT unsigned int _baseversion_dll; -__MINGW_IMPORT unsigned int _osmajor_dll; -__MINGW_IMPORT unsigned int _osminor_dll; -__MINGW_IMPORT unsigned int _osmode_dll; - -#define _basemajor _basemajor_dll -#define _baseminor _baseminor_dll -#define _baseversion _baseversion_dll -#define _osmajor _osmajor_dll -#define _osminor _osminor_dll -#define _osmode _osmode_dll - -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* ! __MSVCRT__ */ - #ifndef _DISKFREE_T_DEFINED -/* needed by _getdiskfree (also in direct.h) */ -struct _diskfree_t { - unsigned total_clusters; - unsigned avail_clusters; - unsigned sectors_per_cluster; - unsigned bytes_per_sector; -}; #define _DISKFREE_T_DEFINED + + struct _diskfree_t { + unsigned total_clusters; + unsigned avail_clusters; + unsigned sectors_per_cluster; + unsigned bytes_per_sector; + }; #endif -_CRTIMP unsigned __cdecl __MINGW_NOTHROW _getdiskfree (unsigned, struct _diskfree_t *); +#define _A_NORMAL 0x00 +#define _A_RDONLY 0x01 +#define _A_HIDDEN 0x02 +#define _A_SYSTEM 0x04 +#define _A_SUBDIR 0x10 +#define _A_ARCH 0x20 -#ifndef _NO_OLDNAMES -# define diskfree_t _diskfree_t +#ifndef _GETDISKFREE_DEFINED +#define _GETDISKFREE_DEFINED + _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); +#endif + +//#if (defined(_X86_) && !defined(__x86_64)) +// void __cdecl _disable(void); +// void __cdecl _enable(void); +//#endif + +#ifndef NO_OLDNAMES +#define diskfree_t _diskfree_t #endif #ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _DOS_H_ */ +#pragma pack(pop) +#endif diff --git a/reactos/include/crt/errno.h b/reactos/include/crt/errno.h index e3690a709a8..c2df01581c3 100644 --- a/reactos/include/crt/errno.h +++ b/reactos/include/crt/errno.h @@ -1,101 +1,75 @@ -/* - * errno.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Error numbers and access to error reporting. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_ERRNO +#define _INC_ERRNO -#ifndef _ERRNO_H_ -#define _ERRNO_H_ - -/* All the headers include this file. */ #include <_mingw.h> -/* - * Error numbers. - * TODO: Can't be sure of some of these assignments, I guessed from the - * names given by strerror and the defines in the Cygnus errno.h. A lot - * of the names from the Cygnus errno.h are not represented, and a few - * of the descriptions returned by strerror do not obviously match - * their error naming. - */ -#define EPERM 1 /* Operation not permitted */ -#define ENOFILE 2 /* No such file or directory */ -#define ENOENT 2 -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted function call */ -#define EIO 5 /* Input/output error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file descriptor */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Resource temporarily unavailable */ -#define ENOMEM 12 /* Not enough space */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -/* 15 - Unknown Error */ -#define EBUSY 16 /* strerror reports "Resource device" */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Improper link (cross-device link?) */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Inappropriate I/O control operation */ -/* 26 - Unknown Error */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Domain error (math functions) */ -#define ERANGE 34 /* Result too large (possibly too small) */ -/* 35 - Unknown Error */ -#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */ -#define EDEADLK 36 -/* 37 - Unknown Error */ -#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */ -#define ENOLCK 39 /* No locks available (46 in Cyg?) */ -#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */ -#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */ -#define EILSEQ 42 /* Illegal byte sequence */ - -/* - * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the - * sockets.h header provided with windows32api-0.1.2. - * You should go and put an #if 0 ... #endif around the whole block - * of errors (look at the comment above them). - */ - -#ifndef RC_INVOKED - -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -/* - * Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see - * stdlib.h. - */ -#ifdef _UWIN -#undef errno -extern int errno; -#else -_CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void); -#define errno (*_errno()) +#ifndef _CRT_ERRNO_DEFINED +#define _CRT_ERRNO_DEFINED + _CRTIMP extern int *__cdecl _errno(void); +#define errno (*_errno()) + + errno_t __cdecl _set_errno(int _Value); + errno_t __cdecl _get_errno(int *_Value); #endif -#ifdef __cplusplus +#define EPERM 1 +#define ENOENT 2 +#define ESRCH 3 +#define EINTR 4 +#define EIO 5 +#define ENXIO 6 +#define E2BIG 7 +#define ENOEXEC 8 +#define EBADF 9 +#define ECHILD 10 +#define EAGAIN 11 +#define ENOMEM 12 +#define EACCES 13 +#define EFAULT 14 +#define EBUSY 16 +#define EEXIST 17 +#define EXDEV 18 +#define ENODEV 19 +#define ENOTDIR 20 +#define EISDIR 21 +#define ENFILE 23 +#define EMFILE 24 +#define ENOTTY 25 +#define EFBIG 27 +#define ENOSPC 28 +#define ESPIPE 29 +#define EROFS 30 +#define EMLINK 31 +#define EPIPE 32 +#define EDOM 33 +#define EDEADLK 36 +#define ENAMETOOLONG 38 +#define ENOLCK 39 +#define ENOSYS 40 +#define ENOTEMPTY 41 + +#ifndef RC_INVOKED +#if !defined(_SECURECRT_ERRCODE_VALUES_DEFINED) +#define _SECURECRT_ERRCODE_VALUES_DEFINED +#define EINVAL 22 +#define ERANGE 34 +#define EILSEQ 42 +#define STRUNCATE 80 +#endif +#endif + +#define EDEADLOCK EDEADLK + +#ifdef __cplusplus } #endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _ERRNO_H_ */ +#endif diff --git a/reactos/include/crt/excpt.h b/reactos/include/crt/excpt.h index 6be9b852edc..64893e3ade6 100644 --- a/reactos/include/crt/excpt.h +++ b/reactos/include/crt/excpt.h @@ -15,9 +15,7 @@ #define _EXCPT_H_ /* All the headers include this file. */ -#if defined(__MINGW32__) #include <_mingw.h> -#endif /* * NOTE: The constants structs and typedefs below should be defined in the diff --git a/reactos/include/crt/fcntl.h b/reactos/include/crt/fcntl.h index 9bff9352a0d..607a1cb445c 100644 --- a/reactos/include/crt/fcntl.h +++ b/reactos/include/crt/fcntl.h @@ -1,75 +1,52 @@ -/* - * fcntl.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Access constants for _open. Note that the permissions constants are - * in sys/stat.h (ick). - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ -#ifndef _FCNTL_H_ -#define _FCNTL_H_ - -/* All the headers include this file. */ #include <_mingw.h> -/* - * It appears that fcntl.h should include io.h for compatibility... - */ #include -/* Specifiy one of these flags to define the access mode. */ -#define _O_RDONLY 0 -#define _O_WRONLY 1 -#define _O_RDWR 2 +#ifndef _INC_FCNTL +#define _INC_FCNTL + +#define _O_RDONLY 0x0000 +#define _O_WRONLY 0x0001 +#define _O_RDWR 0x0002 -/* Mask for access mode bits in the _open flags. */ #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) +#define _O_APPEND 0x0008 +#define _O_CREAT 0x0100 +#define _O_TRUNC 0x0200 +#define _O_EXCL 0x0400 +#define _O_TEXT 0x4000 +#define _O_BINARY 0x8000 +#define _O_WTEXT 0x10000 +#define _O_U16TEXT 0x20000 +#define _O_U8TEXT 0x40000 -#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */ +#define _O_RAW _O_BINARY +#define _O_NOINHERIT 0x0080 +#define _O_TEMPORARY 0x0040 +#define _O_SHORT_LIVED 0x1000 -#define _O_RANDOM 0x0010 -#define _O_SEQUENTIAL 0x0020 -#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing. - * WARNING: Even if not created by _open! */ -#define _O_NOINHERIT 0x0080 +#define _O_SEQUENTIAL 0x0020 +#define _O_RANDOM 0x0010 -#define _O_CREAT 0x0100 /* Create the file if it does not exist. */ -#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */ -#define _O_EXCL 0x0400 /* Open only if the file does not exist. */ - -#define _O_SHORT_LIVED 0x1000 - -/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */ -#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */ -#define _O_BINARY 0x8000 /* Input and output is not translated. */ -#define _O_RAW _O_BINARY - -#if (__MSVCRT_VERSION__ >= 0x0800) -#define _O_WTEXT 0x10000 -#define _O_U16TEXT 0x20000 -#define _O_U8TEXT 0x40000 +#if !defined(NO_OLDNAMES) || defined(_POSIX) +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_RDWR _O_RDWR +#define O_APPEND _O_APPEND +#define O_CREAT _O_CREAT +#define O_TRUNC _O_TRUNC +#define O_EXCL _O_EXCL +#define O_TEXT _O_TEXT +#define O_BINARY _O_BINARY +#define O_RAW _O_BINARY +#define O_TEMPORARY _O_TEMPORARY +#define O_NOINHERIT _O_NOINHERIT +#define O_SEQUENTIAL _O_SEQUENTIAL +#define O_RANDOM _O_RANDOM +#endif #endif - -#ifndef _NO_OLDNAMES - -/* POSIX/Non-ANSI names for increased portability */ -#define O_RDONLY _O_RDONLY -#define O_WRONLY _O_WRONLY -#define O_RDWR _O_RDWR -#define O_ACCMODE _O_ACCMODE -#define O_APPEND _O_APPEND -#define O_CREAT _O_CREAT -#define O_TRUNC _O_TRUNC -#define O_EXCL _O_EXCL -#define O_TEXT _O_TEXT -#define O_BINARY _O_BINARY -#define O_TEMPORARY _O_TEMPORARY -#define O_NOINHERIT _O_NOINHERIT -#define O_SEQUENTIAL _O_SEQUENTIAL -#define O_RANDOM _O_RANDOM - -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not _FCNTL_H_ */ diff --git a/reactos/include/crt/fenv.h b/reactos/include/crt/fenv.h index ddae8921e51..6a7d123615d 100644 --- a/reactos/include/crt/fenv.h +++ b/reactos/include/crt/fenv.h @@ -1,8 +1,11 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ #ifndef _FENV_H_ #define _FENV_H_ -#include <_mingw.h> - /* FPU status word exception flags */ #define FE_INVALID 0x01 #define FE_DENORMAL 0x02 @@ -24,10 +27,6 @@ #define __MXCSR_EXCEPT_FLAG_SHIFT 0 /* How much to shift FE status word exception flags - to get the MXCSR exeptions masks, */ -#define __MXCSR_EXCEPT_MASK_SHIFT 7 - -/* How much to shift FE control word rounding flags to get MXCSR rounding flags, */ #define __MXCSR_ROUND_FLAG_SHIFT 3 @@ -55,9 +54,9 @@ typedef struct unsigned short __ip_selector; unsigned short __opcode; unsigned int __data_offset; - unsigned short __data_selector; - unsigned short __unused3; - unsigned int __mxcsr; /* contents of the MXCSR register */ + unsigned short __data_selector; + unsigned short __unused3; + unsigned int __mxcsr; /* contents of the MXCSR register */ } fenv_t; @@ -81,23 +80,23 @@ extern "C" { /*TODO: Some of these could be inlined */ /* 7.6.2 Exception */ -extern int __cdecl __MINGW_NOTHROW feclearexcept (int); -extern int __cdecl __MINGW_NOTHROW fegetexceptflag (fexcept_t * flagp, int excepts); -extern int __cdecl __MINGW_NOTHROW feraiseexcept (int excepts ); -extern int __cdecl __MINGW_NOTHROW fesetexceptflag (const fexcept_t *, int); -extern int __cdecl __MINGW_NOTHROW fetestexcept (int excepts); +extern int __cdecl feclearexcept (int); +extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts); +extern int __cdecl feraiseexcept (int excepts ); +extern int __cdecl fesetexceptflag (const fexcept_t *, int); +extern int __cdecl fetestexcept (int excepts); /* 7.6.3 Rounding */ -extern int __cdecl __MINGW_NOTHROW fegetround (void); -extern int __cdecl __MINGW_NOTHROW fesetround (int mode); +extern int __cdecl fegetround (void); +extern int __cdecl fesetround (int mode); /* 7.6.4 Environment */ -extern int __cdecl __MINGW_NOTHROW fegetenv (fenv_t * envp); -extern int __cdecl __MINGW_NOTHROW fesetenv (const fenv_t * ); -extern int __cdecl __MINGW_NOTHROW feupdateenv (const fenv_t *); -extern int __cdecl __MINGW_NOTHROW feholdexcept (fenv_t *); +extern int __cdecl fegetenv(fenv_t * envp); +extern int __cdecl fesetenv(const fenv_t * ); +extern int __cdecl feupdateenv(const fenv_t *); +extern int __cdecl feholdexcept(fenv_t *); #ifdef __cplusplus } diff --git a/reactos/include/crt/float.h b/reactos/include/crt/float.h index 3b1ca89f078..e8bf302cc6a 100644 --- a/reactos/include/crt/float.h +++ b/reactos/include/crt/float.h @@ -1,4 +1,4 @@ -/* +/* * float.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -12,7 +12,7 @@ * NOTE: GCC provides float.h, but it doesn't include the non-standard * stuff for accessing the fp controller. We include_next the * GCC-supplied header and just define the MS-specific extensions - * here. + * here. * */ @@ -116,7 +116,7 @@ _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _statusfp (void); /* Report the FPU word to 0x37f (64 bit mantissa precison rather than 53 bit). By default, the mingw version of _fpreset sets fp control as per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when - building your application. + building your application. */ void __cdecl __MINGW_NOTHROW _fpreset (void); void __cdecl __MINGW_NOTHROW fpreset (void); @@ -148,6 +148,4 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _isnan (double); #endif /* Not __STRICT_ANSI__ */ -#endif /* _FLOAT_H_ */ - - +#endif /* _MINGW_FLOAT_H_ */ diff --git a/reactos/include/crt/inttypes.h b/reactos/include/crt/inttypes.h index 0d42a079d24..1a5b555a82a 100644 --- a/reactos/include/crt/inttypes.h +++ b/reactos/include/crt/inttypes.h @@ -1,3 +1,8 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* 7.8 Format conversion of integer types */ #ifndef _INTTYPES_H_ @@ -20,7 +25,7 @@ typedef struct { #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) /* 7.8.1 Macros for format specifiers - * + * * MS runtime does not yet understand C9x standard "ll" * length specifier. It appears to treat "ll" as "l". * The non-standard I64 length specifier causes warning in GCC, @@ -44,7 +49,6 @@ typedef struct { #define PRIdFAST64 "I64d" #define PRIdMAX "I64d" -#define PRIdPTR "d" #define PRIi8 "i" #define PRIi16 "i" @@ -62,7 +66,6 @@ typedef struct { #define PRIiFAST64 "I64i" #define PRIiMAX "I64i" -#define PRIiPTR "i" #define PRIo8 "o" #define PRIo16 "o" @@ -81,8 +84,6 @@ typedef struct { #define PRIoMAX "I64o" -#define PRIoPTR "o" - /* fprintf macros for unsigned types */ #define PRIu8 "u" #define PRIu16 "u" @@ -101,7 +102,6 @@ typedef struct { #define PRIuFAST64 "I64u" #define PRIuMAX "I64u" -#define PRIuPTR "u" #define PRIx8 "x" #define PRIx16 "x" @@ -119,7 +119,6 @@ typedef struct { #define PRIxFAST64 "I64x" #define PRIxMAX "I64x" -#define PRIxPTR "x" #define PRIX8 "X" #define PRIX16 "X" @@ -137,7 +136,6 @@ typedef struct { #define PRIXFAST64 "I64X" #define PRIXMAX "I64X" -#define PRIXPTR "X" /* * fscanf macros for signed int types @@ -159,7 +157,6 @@ typedef struct { #define SCNdFAST64 "I64d" #define SCNdMAX "I64d" -#define SCNdPTR "d" #define SCNi16 "hi" #define SCNi32 "i" @@ -174,7 +171,6 @@ typedef struct { #define SCNiFAST64 "I64i" #define SCNiMAX "I64i" -#define SCNiPTR "i" #define SCNo16 "ho" #define SCNo32 "o" @@ -189,7 +185,6 @@ typedef struct { #define SCNoFAST64 "I64o" #define SCNoMAX "I64o" -#define SCNoPTR "o" #define SCNx16 "hx" #define SCNx32 "x" @@ -204,8 +199,6 @@ typedef struct { #define SCNxFAST64 "I64x" #define SCNxMAX "I64x" -#define SCNxPTR "x" - /* fscanf macros for unsigned int types */ @@ -222,12 +215,37 @@ typedef struct { #define SCNuFAST64 "I64u" #define SCNuMAX "I64u" -#define SCNuPTR "u" + +#ifdef _WIN64 +#define PRIdPTR "I64d" +#define PRIiPTR "I64i" +#define PRIoPTR "I64o" +#define PRIuPTR "I64u" +#define PRIxPTR "I64x" +#define PRIXPTR "I64X" +#define SCNdPTR "I64d" +#define SCNiPTR "I64i" +#define SCNoPTR "I64o" +#define SCNxPTR "I64x" +#define SCNuPTR "I64u" +#else +#define PRIdPTR "d" +#define PRIiPTR "i" +#define PRIoPTR "o" +#define PRIuPTR "u" +#define PRIxPTR "x" +#define PRIXPTR "X" +#define SCNdPTR "d" +#define SCNiPTR "i" +#define SCNoPTR "o" +#define SCNxPTR "x" + #define SCNuPTR "u" +#endif #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* * no length modifier for char types prior to C9x - * MS runtime scanf appears to treat "hh" as "h" + * MS runtime scanf appears to treat "hh" as "h" */ /* signed char */ @@ -255,20 +273,21 @@ typedef struct { #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ -__CRT_INLINE intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j) +intmax_t __cdecl imaxabs (intmax_t j); +__CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j) {return (j >= 0 ? j : -j);} -imaxdiv_t __cdecl __MINGW_NOTHROW imaxdiv (intmax_t numer, intmax_t denom); +imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom); /* 7.8.2 Conversion functions for greatest-width integer types */ -intmax_t __cdecl __MINGW_NOTHROW strtoimax (const char* __restrict__ nptr, +intmax_t __cdecl strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); -uintmax_t __cdecl __MINGW_NOTHROW strtoumax (const char* __restrict__ nptr, +uintmax_t __cdecl strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); -intmax_t __cdecl __MINGW_NOTHROW wcstoimax (const wchar_t* __restrict__ nptr, +intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, int base); -uintmax_t __cdecl __MINGW_NOTHROW wcstoumax (const wchar_t* __restrict__ nptr, +uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, int base); #ifdef __cplusplus diff --git a/reactos/include/crt/io.h b/reactos/include/crt/io.h index 0d4a68844ca..552dc47cf91 100644 --- a/reactos/include/crt/io.h +++ b/reactos/include/crt/io.h @@ -1,337 +1,415 @@ -/* - * io.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * System level I/O functions and types. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ -#ifndef _IO_H_ -#define _IO_H_ +#ifndef _IO_H_ +#define _IO_H_ -/* All the headers include this file. */ #include <_mingw.h> +#include -/* MSVC's io.h contains the stuff from dir.h, so I will too. - * NOTE: This also defines off_t, the file offset type, through - * an inclusion of sys/types.h */ +#pragma pack(push,_CRT_PACKING) -#include /* To get time_t. */ +#ifndef _POSIX_ -/* - * Attributes of files as returned by _findfirst et al. - */ -#define _A_NORMAL 0x00000000 -#define _A_RDONLY 0x00000001 -#define _A_HIDDEN 0x00000002 -#define _A_SYSTEM 0x00000004 -#define _A_VOLID 0x00000008 -#define _A_SUBDIR 0x00000010 -#define _A_ARCH 0x00000020 - - -#ifndef RC_INVOKED - -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 - typedef __int64 intptr_t; -#else - typedef int intptr_t; -#endif +#ifdef __cplusplus +extern "C" { #endif -#ifndef _FSIZE_T_DEFINED -typedef unsigned long _fsize_t; +_CRTIMP char* __cdecl _getcwd (char*, int); +#ifndef _FSIZE_T_DEFINED + typedef unsigned long _fsize_t; #define _FSIZE_T_DEFINED #endif -/* - * The maximum length of a file name. You should use GetVolumeInformation - * instead of this constant. But hey, this works. - * Also defined in stdio.h. - */ -#ifndef FILENAME_MAX -#define FILENAME_MAX (260) +#ifndef _FINDDATA_T_DEFINED + + struct _finddata32_t { + unsigned attrib; + __time32_t time_create; + __time32_t time_access; + __time32_t time_write; + _fsize_t size; + char name[260]; + }; + +/*#if _INTEGRAL_MAX_BITS >= 64*/ + + struct _finddata32i64_t { + unsigned attrib; + __time32_t time_create; + __time32_t time_access; + __time32_t time_write; + __int64 size; + char name[260]; + }; + + struct _finddata64i32_t { + unsigned attrib; + __time64_t time_create; + __time64_t time_access; + __time64_t time_write; + _fsize_t size; + char name[260]; + }; + + struct __finddata64_t { + unsigned attrib; + __time64_t time_create; + __time64_t time_access; + __time64_t time_write; + __int64 size; + char name[260]; + }; +/* #endif */ + +#ifdef _USE_32BIT_TIME_T +#define _finddata_t _finddata32_t +#define _finddatai64_t _finddata32i64_t + +#ifdef _WIN64 +#define _findfirst _findfirst32 +#define _findnext _findnext32 +#else +#define _findfirst32 _findfirst +#define _findnext32 _findnext +#endif +#define _findfirsti64 _findfirst32i64 +#define _findnexti64 _findnext32i64 +#else +#define _finddata_t _finddata64i32_t +#define _finddatai64_t __finddata64_t + +#define _findfirst _findfirst64i32 +#define _findnext _findnext64i32 +#define _findfirsti64 _findfirst64 +#define _findnexti64 _findnext64 #endif -/* - * The following structure is filled in by _findfirst or _findnext when - * they succeed in finding a match. - */ -struct _finddata_t -{ - unsigned attrib; /* Attributes, see constants above. */ - time_t time_create; - time_t time_access; /* always midnight local time */ - time_t time_write; - _fsize_t size; - char name[FILENAME_MAX]; /* may include spaces. */ -}; - -struct _finddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - char name[FILENAME_MAX]; -}; - -struct __finddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; - _fsize_t size; - char name[FILENAME_MAX]; -}; +#define _FINDDATA_T_DEFINED +#endif #ifndef _WFINDDATA_T_DEFINED -struct _wfinddata_t { - unsigned attrib; - time_t time_create; /* -1 for FAT file systems */ - time_t time_access; /* -1 for FAT file systems */ - time_t time_write; - _fsize_t size; - wchar_t name[FILENAME_MAX]; /* may include spaces. */ -}; -struct _wfinddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - wchar_t name[FILENAME_MAX]; -}; + struct _wfinddata32_t { + unsigned attrib; + __time32_t time_create; + __time32_t time_access; + __time32_t time_write; + _fsize_t size; + wchar_t name[260]; + }; -struct __wfinddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; - _fsize_t size; - wchar_t name[FILENAME_MAX]; -}; +/* #if _INTEGRAL_MAX_BITS >= 64 */ + + struct _wfinddata32i64_t { + unsigned attrib; + __time32_t time_create; + __time32_t time_access; + __time32_t time_write; + __int64 size; + wchar_t name[260]; + }; + + struct _wfinddata64i32_t { + unsigned attrib; + __time64_t time_create; + __time64_t time_access; + __time64_t time_write; + _fsize_t size; + wchar_t name[260]; + }; + + struct _wfinddata64_t { + unsigned attrib; + __time64_t time_create; + __time64_t time_access; + __time64_t time_write; + __int64 size; + wchar_t name[260]; + }; +/* #endif */ + +#ifdef _USE_32BIT_TIME_T +#define _wfinddata_t _wfinddata32_t +#define _wfinddatai64_t _wfinddata32i64_t + +#define _wfindfirst _wfindfirst32 +#define _wfindnext _wfindnext32 +#define _wfindfirsti64 _wfindfirst32i64 +#define _wfindnexti64 _wfindnext32i64 +#else +#define _wfinddata_t _wfinddata64i32_t +#define _wfinddatai64_t _wfinddata64_t + +#define _wfindfirst _wfindfirst64i32 +#define _wfindnext _wfindnext64i32 +#define _wfindfirsti64 _wfindfirst64 +#define _wfindnexti64 _wfindnext64 +#endif #define _WFINDDATA_T_DEFINED #endif -#ifdef __cplusplus -extern "C" { +#define _A_NORMAL 0x00 +#define _A_RDONLY 0x01 +#define _A_HIDDEN 0x02 +#define _A_SYSTEM 0x04 +#define _A_SUBDIR 0x10 +#define _A_ARCH 0x20 + +#ifndef _SIZE_T_DEFINED +#define _SIZE_T_DEFINED +#undef size_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef unsigned int size_t __attribute__ ((mode (DI))); +#else + typedef unsigned __int64 size_t; +#endif +#else + typedef unsigned int size_t; +#endif #endif -/* - * Functions for searching for files. _findfirst returns -1 if no match - * is found. Otherwise it returns a handle to be used in _findnext and - * _findclose calls. _findnext also returns -1 if no match could be found, - * and 0 if a match was found. Call _findclose when you are finished. - */ - -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst (const char*, struct _finddata_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findnext (intptr_t, struct _finddata_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findclose (intptr_t); - -_CRTIMP int __cdecl __MINGW_NOTHROW _chdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _getcwd (char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _mkdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _mktemp (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _rmdir (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _chmod (const char*, int); - -#ifdef __MSVCRT__ -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _filelengthi64(int); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirsti64(const char*, struct _finddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnexti64(intptr_t, struct _finddatai64_t*); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _lseeki64(int, __int64, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _telli64(int); -/* These require newer versions of msvcrt.dll (6.1 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst64(const char*, struct __finddata64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findnext64(intptr_t, struct __finddata64_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ - -#ifndef __NO_MINGW_LFS -__CRT_INLINE off64_t lseek64 (int, off64_t, int); -__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) -{ - return _lseeki64(fd, (__int64) offset, whence); -} +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#undef ssize_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int ssize_t __attribute__ ((mode (DI))); +#else + typedef __int64 ssize_t; +#endif +#else + typedef int ssize_t; +#endif #endif -#endif /* __MSVCRT__ */ - -#ifndef _NO_OLDNAMES - -#ifndef _UWIN -_CRTIMP int __cdecl __MINGW_NOTHROW chdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW getcwd (char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW mkdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW mktemp (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rmdir (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int); -#endif /* _UWIN */ - -#endif /* Not _NO_OLDNAMES */ - -#ifdef __cplusplus -} +#ifndef _OFF_T_DEFINED +#define _OFF_T_DEFINED +#ifndef _OFF_T_ +#define _OFF_T_ + typedef long _off_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long off_t; +#endif +#endif #endif -#endif /* Not RC_INVOKED */ +#ifndef _OFF64_T_DEFINED +#define _OFF64_T_DEFINED +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int _off64_t __attribute__ ((mode (DI))); +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef int off64_t __attribute__ ((mode (DI))); +#endif +#else + typedef long long _off64_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long long off64_t; +#endif +#endif +#endif -/* TODO: Maximum number of open handles has not been tested, I just set - * it the same as FOPEN_MAX. */ -#define HANDLE_MAX FOPEN_MAX - -/* Some defines for _access nAccessMode (MS doesn't define them, but - * it doesn't seem to hurt to add them). */ + /* Some defines for _access nAccessMode (MS doesn't define them, but + * it doesn't seem to hurt to add them). */ #define F_OK 0 /* Check for file existence */ -/* Well maybe it does hurt. On newer versions of MSVCRT, an access mode - of 1 causes invalid parameter error. */ -#define X_OK 1 /* MS access() doesn't check for execute permission. */ +#define X_OK 1 /* Check for execute permission. */ #define W_OK 2 /* Check for write permission */ #define R_OK 4 /* Check for read permission */ -#ifndef RC_INVOKED + _CRTIMP int __cdecl _access(const char *_Filename,int _AccessMode); + _CRTIMP int __cdecl _chmod(const char *_Filename,int _Mode); + _CRTIMP int __cdecl _chsize(int _FileHandle,long _Size); + _CRTIMP int __cdecl _close(int _FileHandle); + _CRTIMP int __cdecl _commit(int _FileHandle); + _CRTIMP int __cdecl _creat(const char *_Filename,int _PermissionMode); + _CRTIMP int __cdecl _dup(int _FileHandle); + _CRTIMP int __cdecl _dup2(int _FileHandleSrc,int _FileHandleDst); + _CRTIMP int __cdecl _eof(int _FileHandle); + _CRTIMP long __cdecl _filelength(int _FileHandle); + _CRTIMP intptr_t __cdecl _findfirst32(const char *_Filename,struct _finddata32_t *_FindData); + _CRTIMP int __cdecl _findnext32(intptr_t _FindHandle,struct _finddata32_t *_FindData); + _CRTIMP int __cdecl _findclose(intptr_t _FindHandle); + _CRTIMP int __cdecl _isatty(int _FileHandle); + _CRTIMP int __cdecl _locking(int _FileHandle,int _LockMode,long _NumOfBytes); + _CRTIMP long __cdecl _lseek(int _FileHandle,long _Offset,int _Origin); + _off64_t lseek64(int fd,_off64_t offset, int whence); + _CRTIMP char *__cdecl _mktemp(char *_TemplateName); + _CRTIMP int __cdecl _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode); + _CRTIMP int __cdecl _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount); -#ifdef __cplusplus +#ifndef _CRT_DIRECTORY_DEFINED +#define _CRT_DIRECTORY_DEFINED + int __cdecl remove(const char *_Filename); + int __cdecl rename(const char *_OldFilename,const char *_NewFilename); + _CRTIMP int __cdecl _unlink(const char *_Filename); +#ifndef NO_OLDNAMES + int __cdecl unlink(const char *_Filename); +#endif +#endif + + _CRTIMP int __cdecl _setmode(int _FileHandle,int _Mode); + _CRTIMP long __cdecl _tell(int _FileHandle); + _CRTIMP int __cdecl _umask(int _Mode); + _CRTIMP int __cdecl _write(int _FileHandle,const void *_Buf,unsigned int _MaxCharCount); + +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP __int64 __cdecl _filelengthi64(int _FileHandle); + _CRTIMP intptr_t __cdecl _findfirst32i64(const char *_Filename,struct _finddata32i64_t *_FindData); + _CRTIMP intptr_t __cdecl _findfirst64(const char *_Filename,struct __finddata64_t *_FindData); +#ifdef __cplusplus +#include +#endif + intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData); + __CRT_INLINE intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData) + { + struct __finddata64_t fd; + intptr_t ret = _findfirst64(_Filename,&fd); + _FindData->attrib=fd.attrib; + _FindData->time_create=fd.time_create; + _FindData->time_access=fd.time_access; + _FindData->time_write=fd.time_write; + _FindData->size=(_fsize_t) fd.size; + strncpy(_FindData->name,fd.name,260); + return ret; + } + _CRTIMP int __cdecl _findnext32i64(intptr_t _FindHandle,struct _finddata32i64_t *_FindData); + _CRTIMP int __cdecl _findnext64(intptr_t _FindHandle,struct __finddata64_t *_FindData); + int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData); + __CRT_INLINE int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData) + { + struct __finddata64_t fd; + int ret = _findnext64(_FindHandle,&fd); + _FindData->attrib=fd.attrib; + _FindData->time_create=fd.time_create; + _FindData->time_access=fd.time_access; + _FindData->time_write=fd.time_write; + _FindData->size=(_fsize_t) fd.size; + strncpy(_FindData->name,fd.name,260); + return ret; + } + __int64 __cdecl _lseeki64(int _FileHandle,__int64 _Offset,int _Origin); + __int64 __cdecl _telli64(int _FileHandle); +#endif +#ifndef NO_OLDNAMES + +#ifndef _UWIN + int __cdecl chdir (const char *); + char *__cdecl getcwd (char *, int); + int __cdecl mkdir (const char *); + char *__cdecl mktemp(char *); + int __cdecl rmdir (const char*); + int __cdecl chmod (const char *, int); +#endif /* _UWIN */ + +#endif /* Not NO_OLDNAMES */ + + _CRTIMP errno_t __cdecl _sopen_s(int *_FileHandle,const char *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode); + +#ifndef __cplusplus + _CRTIMP int __cdecl _open(const char *_Filename,int _OpenFlag,...); + _CRTIMP int __cdecl _sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...); +#else + extern "C++" _CRTIMP int __cdecl _open(const char *_Filename,int _Openflag,int _PermissionMode = 0); + extern "C++" _CRTIMP int __cdecl _sopen(const char *_Filename,int _Openflag,int _ShareFlag,int _PermissionMode = 0); +#endif + +#ifndef _WIO_DEFINED +#define _WIO_DEFINED + _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode); + _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode); + _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode); + _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData); + _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData); + _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename); + _CRTIMP int __cdecl _wrename(const wchar_t *_NewFilename,const wchar_t *_OldFilename); + _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName); + +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData); + intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData); + _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData); + _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData); + int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData); + _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData); +#endif + + _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag); + +#if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64)) + _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...); + _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...); +#else + extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0); + extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0); +#endif + +#endif + + int __cdecl __lock_fhandle(int _Filehandle); + void __cdecl _unlock_fhandle(int _Filehandle); + _CRTIMP intptr_t __cdecl _get_osfhandle(int _FileHandle); + _CRTIMP int __cdecl _open_osfhandle(intptr_t _OSFileHandle,int _Flags); + +#ifndef NO_OLDNAMES + int __cdecl access(const char *_Filename,int _AccessMode); + int __cdecl chmod(const char *_Filename,int _AccessMode); + int __cdecl chsize(int _FileHandle,long _Size); + int __cdecl close(int _FileHandle); + int __cdecl creat(const char *_Filename,int _PermissionMode); + int __cdecl dup(int _FileHandle); + int __cdecl dup2(int _FileHandleSrc,int _FileHandleDst); + int __cdecl eof(int _FileHandle); + long __cdecl filelength(int _FileHandle); + int __cdecl isatty(int _FileHandle); + int __cdecl locking(int _FileHandle,int _LockMode,long _NumOfBytes); + long __cdecl lseek(int _FileHandle,long _Offset,int _Origin); + char *__cdecl mktemp(char *_TemplateName); + int __cdecl open(const char *_Filename,int _OpenFlag,...); + int __cdecl read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount); + int __cdecl setmode(int _FileHandle,int _Mode); + int __cdecl sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...); + long __cdecl tell(int _FileHandle); + int __cdecl umask(int _Mode); + int __cdecl write(int _Filehandle,const void *_Buf,unsigned int _MaxCharCount); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#ifdef __cplusplus extern "C" { #endif -_CRTIMP int __cdecl __MINGW_NOTHROW _access (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _chsize (int, long); -_CRTIMP int __cdecl __MINGW_NOTHROW _close (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _commit(int); - -/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), - * the "owner write permission" bit (on FAT). */ -_CRTIMP int __cdecl __MINGW_NOTHROW _creat (const char*, int); - -_CRTIMP int __cdecl __MINGW_NOTHROW _dup (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _dup2 (int, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _filelength (int); -_CRTIMP long __cdecl __MINGW_NOTHROW _get_osfhandle (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _isatty (int); - -/* In a very odd turn of events this function is excluded from those - * files which define _STREAM_COMPAT. This is required in order to - * build GNU libio because of a conflict with _eof in streambuf.h - * line 107. Actually I might just be able to change the name of - * the enum member in streambuf.h... we'll see. TODO */ -#ifndef _STREAM_COMPAT -_CRTIMP int __cdecl __MINGW_NOTHROW _eof (int); -#endif - -/* LK_... locking commands defined in sys/locking.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _locking (int, int, long); - -_CRTIMP long __cdecl __MINGW_NOTHROW _lseek (int, long, int); - -/* Optional third argument is unsigned unPermissions. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _open (const char*, int, ...); - -_CRTIMP int __cdecl __MINGW_NOTHROW _open_osfhandle (long, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _pipe (int *, unsigned int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _read (int, void*, unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _setmode (int, int); -/* MS puts remove & rename (but not wide versions) in io.h as well - as in stdio.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW remove (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rename (const char*, const char*); - -/* SH_... flags for nShFlags defined in share.h - * Optional fourth argument is unsigned unPermissions */ -_CRTIMP int __cdecl __MINGW_NOTHROW _sopen (const char*, int, int, ...); - -_CRTIMP long __cdecl __MINGW_NOTHROW _tell (int); -/* Should umask be in sys/stat.h and/or sys/types.h instead? */ -_CRTIMP int __cdecl __MINGW_NOTHROW _umask (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _unlink (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _write (int, const void*, unsigned int); - -/* Wide character versions. Also declared in wchar.h. */ -/* Not in crtdll.dll */ -#if !defined (_WIO_DEFINED) -#if defined (__MSVCRT__) -_CRTIMP int __cdecl __MINGW_NOTHROW _waccess(const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wchmod(const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcreat(const wchar_t*, int); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst(const wchar_t*, struct _wfinddata_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext(intptr_t, struct _wfinddata_t *); -_CRTIMP int __cdecl __MINGW_NOTHROW _wunlink(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wopen(const wchar_t*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsopen(const wchar_t*, int, int, ...); -_CRTIMP wchar_t * __cdecl __MINGW_NOTHROW _wmktemp(wchar_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnexti64(intptr_t, struct _wfinddatai64_t*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*); -#endif -#endif /* defined (__MSVCRT__) */ -#define _WIO_DEFINED -#endif /* _WIO_DEFINED */ - -#ifndef _NO_OLDNAMES -/* - * Non-underscored versions of non-ANSI functions to improve portability. - * These functions live in libmoldname.a. - */ - -#ifndef _UWIN -_CRTIMP int __cdecl __MINGW_NOTHROW access (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW chsize (int, long ); -_CRTIMP int __cdecl __MINGW_NOTHROW close (int); -_CRTIMP int __cdecl __MINGW_NOTHROW creat (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW dup (int); -_CRTIMP int __cdecl __MINGW_NOTHROW dup2 (int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW eof (int); -_CRTIMP long __cdecl __MINGW_NOTHROW filelength (int); -_CRTIMP int __cdecl __MINGW_NOTHROW isatty (int); -_CRTIMP long __cdecl __MINGW_NOTHROW lseek (int, long, int); -_CRTIMP int __cdecl __MINGW_NOTHROW open (const char*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW read (int, void*, unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW setmode (int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW sopen (const char*, int, int, ...); -_CRTIMP long __cdecl __MINGW_NOTHROW tell (int); -_CRTIMP int __cdecl __MINGW_NOTHROW umask (int); -_CRTIMP int __cdecl __MINGW_NOTHROW unlink (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW write (int, const void*, unsigned int); -#endif /* _UWIN */ +/* Misc stuff */ +char *getlogin(void); +unsigned int alarm(unsigned int seconds); #ifdef __USE_MINGW_ACCESS /* Old versions of MSVCRT access() just ignored X_OK, while the version shipped with Vista, returns an error code. This will restore the old behaviour */ -static inline int __mingw_access (const char* __fname, int __mode) - { return _access (__fname, __mode & ~X_OK); } +static inline int __mingw_access (const char *__fname, int __mode) { + return _access (__fname, __mode & ~X_OK); +} + #define access(__f,__m) __mingw_access (__f, __m) #endif -/* Wide character versions. Also declared in wchar.h. */ -/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */ -#if 0 -int waccess(const wchar_t *, int); -int wchmod(const wchar_t *, int); -int wcreat(const wchar_t *, int); -long wfindfirst(wchar_t *, struct _wfinddata_t *); -int wfindnext(long, struct _wfinddata_t *); -int wunlink(const wchar_t *); -int wrename(const wchar_t *, const wchar_t *); -int wopen(const wchar_t *, int, ...); -int wsopen(const wchar_t *, int, int, ...); -wchar_t * wmktemp(wchar_t *); -#endif -#endif /* Not _NO_OLDNAMES */ - -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ -#endif /* _IO_H_ not defined */ +#pragma pack(pop) + +#include + +#endif /* End _IO_H_ */ + diff --git a/reactos/include/crt/libgen.h b/reactos/include/crt/libgen.h deleted file mode 100644 index db89e1e14ac..00000000000 --- a/reactos/include/crt/libgen.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _LIBGEN_H_ -/* - * libgen.h - * - * $Id: libgen.h,v 1.2 2007/06/23 07:34:15 dannysmith Exp $ - * - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for splitting pathnames into dirname and basename components. - * - */ -#define _LIBGEN_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifdef __cplusplus -extern "C" { -#endif - -extern __cdecl __MINGW_NOTHROW char *basename (char *); -extern __cdecl __MINGW_NOTHROW char *dirname (char *); - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBGEN_H_: end of file */ - diff --git a/reactos/include/crt/limits.h b/reactos/include/crt/limits.h index 06fd723ebf5..fafb04a4696 100644 --- a/reactos/include/crt/limits.h +++ b/reactos/include/crt/limits.h @@ -1,110 +1,111 @@ -/* - * limits.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for manipulating paths and directories (included from io.h) - * plus functions for setting the current drive. - * - * Defines constants for the sizes of integral types. - * - * NOTE: GCC should supply a version of this header and it should be safe to - * use that version instead of this one (maybe safer). - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ - -#ifndef _LIMITS_H_ -#define _LIMITS_H_ - -/* All the headers include this file. */ #include <_mingw.h> -/* - * File system limits - * - * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the - * same as FILENAME_MAX and FOPEN_MAX from stdio.h? - * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is - * required for the NUL. TODO: Test? - */ -#define PATH_MAX 259 +#ifndef _INC_LIMITS +#define _INC_LIMITS /* - * Characteristics of the char data type. - */ -#define CHAR_BIT 8 -#define MB_LEN_MAX 2 +* File system limits +* +* TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the +* same as FILENAME_MAX and FOPEN_MAX from stdio.h? +* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is +* required for the NUL. TODO: Test? +*/ +#define PATH_MAX (259) -#define SCHAR_MIN (-128) -#define SCHAR_MAX 127 +#define CHAR_BIT 8 +#define SCHAR_MIN (-128) +#define SCHAR_MAX 127 +#define UCHAR_MAX 0xff -#define UCHAR_MAX 255 +#define CHAR_MIN SCHAR_MIN +#define CHAR_MAX SCHAR_MAX -/* TODO: Is this safe? I think it might just be testing the preprocessor, - * not the compiler itself... */ -#if ('\x80' < 0) -#define CHAR_MIN SCHAR_MIN -#define CHAR_MAX SCHAR_MAX +#define MB_LEN_MAX 5 +#define SHRT_MIN (-32768) +#define SHRT_MAX 32767 +#define USHRT_MAX 0xffff +#define INT_MIN (-2147483647 - 1) +#define INT_MAX 2147483647 +#define UINT_MAX 0xffffffff +#define LONG_MIN (-2147483647L - 1) +#define LONG_MAX 2147483647L +#define ULONG_MAX 0xffffffffUL +#define LLONG_MAX 9223372036854775807ll +#define LLONG_MIN (-9223372036854775807ll - 1) +#define ULLONG_MAX 0xffffffffffffffffull + +#if _INTEGRAL_MAX_BITS >= 8 +#define _I8_MIN (-127 - 1) +#define _I8_MAX 127i8 +#define _UI8_MAX 0xffu +#endif + +#if _INTEGRAL_MAX_BITS >= 16 +#define _I16_MIN (-32767 - 1) +#define _I16_MAX 32767i16 +#define _UI16_MAX 0xffffu +#endif + +#if _INTEGRAL_MAX_BITS >= 32 +#define _I32_MIN (-2147483647 - 1) +#define _I32_MAX 2147483647 +#define _UI32_MAX 0xffffffffu +#endif + +#if defined(__GNUC__) +#undef LONG_LONG_MAX +#define LONG_LONG_MAX 9223372036854775807ll +#undef LONG_LONG_MIN +#define LONG_LONG_MIN (-LONG_LONG_MAX-1) +#undef ULONG_LONG_MAX +#define ULONG_LONG_MAX (2ull * LONG_LONG_MAX + 1ull) +#endif + +#if _INTEGRAL_MAX_BITS >= 64 +#define _I64_MIN (-9223372036854775807ll - 1) +#define _I64_MAX 9223372036854775807ll +#define _UI64_MAX 0xffffffffffffffffull +#endif + +#ifndef SIZE_MAX +#ifdef _WIN64 +#define SIZE_MAX _UI64_MAX #else -#define CHAR_MIN 0 -#define CHAR_MAX UCHAR_MAX +#define SIZE_MAX UINT_MAX +#endif #endif -/* - * Maximum and minimum values for ints. - */ -#define INT_MAX 2147483647 -#define INT_MIN (-INT_MAX-1) - -#define UINT_MAX 0xffffffff - -/* - * Maximum and minimum values for shorts. - */ -#define SHRT_MAX 32767 -#define SHRT_MIN (-SHRT_MAX-1) - -#define USHRT_MAX 0xffff - -/* - * Maximum and minimum values for longs and unsigned longs. - * - * TODO: This is not correct for Alphas, which have 64 bit longs. - */ -#define LONG_MAX 2147483647L -#define LONG_MIN (-LONG_MAX-1) - -#define ULONG_MAX 0xffffffffUL - -#ifndef __STRICT_ANSI__ -/* POSIX wants this. */ -#define SSIZE_MAX LONG_MAX +#ifdef _POSIX_ +#define _POSIX_ARG_MAX 4096 +#define _POSIX_CHILD_MAX 6 +#define _POSIX_LINK_MAX 8 +#define _POSIX_MAX_CANON 255 +#define _POSIX_MAX_INPUT 255 +#define _POSIX_NAME_MAX 14 +#define _POSIX_NGROUPS_MAX 0 +#define _POSIX_OPEN_MAX 16 +#define _POSIX_PATH_MAX 255 +#define _POSIX_PIPE_BUF 512 +#define _POSIX_SSIZE_MAX 32767 +#define _POSIX_STREAM_MAX 8 +#define _POSIX_TZNAME_MAX 3 +#define ARG_MAX 14500 +#define LINK_MAX 1024 +#define MAX_CANON _POSIX_MAX_CANON +#define MAX_INPUT _POSIX_MAX_INPUT +#define NAME_MAX 255 +#define NGROUPS_MAX 16 +#define OPEN_MAX 32 +#define PATH_MAX 512 +#define PIPE_BUF _POSIX_PIPE_BUF +#define SSIZE_MAX _POSIX_SSIZE_MAX +#define STREAM_MAX 20 +#define TZNAME_MAX 10 #endif - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined(__STRICT_ANSI__) -/* ISO C9x macro names */ -#define LLONG_MAX 9223372036854775807LL -#define LLONG_MIN (-LLONG_MAX - 1) -#define ULLONG_MAX (2ULL * LLONG_MAX + 1) #endif - -/* - * The GNU C compiler also allows 'long long int' - */ -#if !defined(__STRICT_ANSI__) && defined(__GNUC__) - -#define LONG_LONG_MAX 9223372036854775807LL -#define LONG_LONG_MIN (-LONG_LONG_MAX-1) -#define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1) - -/* MSVC compatibility */ -#define _I64_MIN LONG_LONG_MIN -#define _I64_MAX LONG_LONG_MAX -#define _UI64_MAX ULONG_LONG_MAX - -#endif /* Not Strict ANSI and GNU C compiler */ - - -#endif /* not _LIMITS_H_ */ diff --git a/reactos/include/crt/locale.h b/reactos/include/crt/locale.h index f80ccf3069a..686aa9bae35 100644 --- a/reactos/include/crt/locale.h +++ b/reactos/include/crt/locale.h @@ -1,89 +1,91 @@ -/* - * locale.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions and types for localization (ie. changing the appearance of - * output based on the standards of a certain country). - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_LOCALE +#define _INC_LOCALE -#ifndef _LOCALE_H_ -#define _LOCALE_H_ - -/* All the headers include this file. */ #include <_mingw.h> -/* - * NOTE: I have tried to test this, but I am limited by my knowledge of - * locale issues. The structure does not bomb if you look at the - * values, and 'decimal_point' even seems to be correct. But the - * rest of the values are, by default, not particularly useful - * (read meaningless and not related to the international settings - * of the system). - */ +#pragma pack(push,_CRT_PACKING) -#define LC_ALL 0 -#define LC_COLLATE 1 -#define LC_CTYPE 2 -#define LC_MONETARY 3 -#define LC_NUMERIC 4 -#define LC_TIME 5 -#define LC_MIN LC_ALL -#define LC_MAX LC_TIME - -#ifndef RC_INVOKED - -/* According to C89 std, NULL is defined in locale.h too. */ -#define __need_NULL -#include - -/* - * The structure returned by 'localeconv'. - */ -struct lconv -{ - char* decimal_point; - char* thousands_sep; - char* grouping; - char* int_curr_symbol; - char* currency_symbol; - char* mon_decimal_point; - char* mon_thousands_sep; - char* mon_grouping; - char* positive_sign; - char* negative_sign; - char int_frac_digits; - char frac_digits; - char p_cs_precedes; - char p_sep_by_space; - char n_cs_precedes; - char n_sep_by_space; - char p_sign_posn; - char n_sign_posn; -}; - -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -_CRTIMP char* __cdecl __MINGW_NOTHROW setlocale (int, const char*); -_CRTIMP struct lconv* __cdecl __MINGW_NOTHROW localeconv (void); +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif -#ifndef _WLOCALE_DEFINED /* also declared in wchar.h */ -# define __need_wchar_t -# include - _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wsetlocale(int, const wchar_t*); -# define _WLOCALE_DEFINED -#endif /* ndef _WLOCALE_DEFINED */ +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 -#ifdef __cplusplus +#define LC_MIN LC_ALL +#define LC_MAX LC_TIME + +#ifndef _LCONV_DEFINED +#define _LCONV_DEFINED + struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + }; +#endif + +#ifndef _CONFIG_LOCALE_SWT +#define _CONFIG_LOCALE_SWT + +#define _ENABLE_PER_THREAD_LOCALE 0x1 +#define _DISABLE_PER_THREAD_LOCALE 0x2 +#define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10 +#define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20 +#define _ENABLE_PER_THREAD_LOCALE_NEW 0x100 +#define _DISABLE_PER_THREAD_LOCALE_NEW 0x200 + +#endif + + int __cdecl _configthreadlocale(int _Flag); + char *__cdecl setlocale(int _Category,const char *_Locale); + _CRTIMP struct lconv *__cdecl localeconv(void); + _locale_t __cdecl _get_current_locale(void); + _locale_t __cdecl _create_locale(int _Category,const char *_Locale); + void __cdecl _free_locale(_locale_t _Locale); + _locale_t __cdecl __get_current_locale(void); + _locale_t __cdecl __create_locale(int _Category,const char *_Locale); + void __cdecl __free_locale(_locale_t _Locale); + +#ifndef _WLOCALE_DEFINED +#define _WLOCALE_DEFINED + _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale); +#endif + +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _LOCALE_H_ */ - - +#pragma pack(pop) +#endif diff --git a/reactos/include/crt/malloc.h b/reactos/include/crt/malloc.h index 9d2c33f0772..9c4bf2f7cdb 100644 --- a/reactos/include/crt/malloc.h +++ b/reactos/include/crt/malloc.h @@ -1,98 +1,177 @@ -/* - * malloc.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Support for programs which want to use malloc.h to get memory management - * functions. Unless you absolutely need some of these functions and they are - * not in the ANSI headers you should use the ANSI standard header files - * instead. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ - #ifndef _MALLOC_H_ #define _MALLOC_H_ -/* All the headers include this file. */ #include <_mingw.h> -#include +#pragma pack(push,_CRT_PACKING) -#ifndef RC_INVOKED +#ifndef _MM_MALLOC_H_INCLUDED +#define _MM_MALLOC_H_INCLUDED +#endif -/* - * The structure used to walk through the heap with _heapwalk. - */ -typedef struct _heapinfo -{ - int* _pentry; - size_t _size; - int _useflag; -} _HEAPINFO; +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _WIN64 +#define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0 +#else +#define _HEAP_MAXREQ 0xFFFFFFE0 +#endif + +#ifndef _STATIC_ASSERT +#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)] +#endif + +/* Return codes for _heapwalk() */ +#define _HEAPEMPTY (-1) +#define _HEAPOK (-2) +#define _HEAPBADBEGIN (-3) +#define _HEAPBADNODE (-4) +#define _HEAPEND (-5) +#define _HEAPBADPTR (-6) /* Values for _heapinfo.useflag */ #define _FREEENTRY 0 #define _USEDENTRY 1 -/* Return codes for _heapwalk() */ -#define _HEAPEMPTY (-1) -#define _HEAPOK (-2) -#define _HEAPBADBEGIN (-3) -#define _HEAPBADNODE (-4) -#define _HEAPEND (-5) -#define _HEAPBADPTR (-6) - -#ifdef __cplusplus -extern "C" { +#ifndef _HEAPINFO_DEFINED +#define _HEAPINFO_DEFINED + /* The structure used to walk through the heap with _heapwalk. */ + typedef struct _heapinfo { + int *_pentry; + size_t _size; + int _useflag; + } _HEAPINFO; #endif -/* - The _heap* memory allocation functions are supported on NT - but not W9x. On latter, they always set errno to ENOSYS. -*/ -_CRTIMP int __cdecl __MINGW_NOTHROW _heapwalk (_HEAPINFO*); + + extern unsigned int _amblksiz; + +#define _mm_free(a) _aligned_free(a) +#define _mm_malloc(a,b) _aligned_malloc(a,b) + +#ifndef _CRT_ALLOCATION_DEFINED +#define _CRT_ALLOCATION_DEFINED + void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements); + void __cdecl free(void *_Memory); + void *__cdecl malloc(size_t _Size); + void *__cdecl realloc(void *_Memory,size_t _NewSize); + _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size); + /* _CRTIMP void __cdecl _aligned_free(void *_Memory); + _CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment); */ + _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset); + _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment); + _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment); + _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset); + _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset); +#endif + +#define _MAX_WAIT_MALLOC_CRT 60000 + + _CRTIMP int __cdecl _resetstkoflw (void); + _CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait(unsigned long _NewValue); + + _CRTIMP void *__cdecl _expand(void *_Memory,size_t _NewSize); + _CRTIMP size_t __cdecl _msize(void *_Memory); #ifdef __GNUC__ +#undef _alloca #define _alloca(x) __builtin_alloca((x)) +#else + void *__cdecl _alloca(size_t _Size); +#endif + _CRTIMP size_t __cdecl _get_sbh_threshold(void); + _CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue); + _CRTIMP errno_t __cdecl _set_amblksiz(size_t _Value); + _CRTIMP errno_t __cdecl _get_amblksiz(size_t *_Value); + _CRTIMP int __cdecl _heapadd(void *_Memory,size_t _Size); + _CRTIMP int __cdecl _heapchk(void); + _CRTIMP int __cdecl _heapmin(void); + _CRTIMP int __cdecl _heapset(unsigned int _Fill); + _CRTIMP int __cdecl _heapwalk(_HEAPINFO *_EntryInfo); + _CRTIMP size_t __cdecl _heapused(size_t *_Used,size_t *_Commit); + _CRTIMP intptr_t __cdecl _get_heap_handle(void); + +#define _ALLOCA_S_THRESHOLD 1024 +#define _ALLOCA_S_STACK_MARKER 0xCCCC +#define _ALLOCA_S_HEAP_MARKER 0xDDDD + +#if(defined(_X86_) && !defined(__x86_64)) +#define _ALLOCA_S_MARKER_SIZE 8 +#elif defined(__ia64__) || defined(__x86_64) +#define _ALLOCA_S_MARKER_SIZE 16 #endif -#ifndef _NO_OLDNAMES -_CRTIMP int __cdecl __MINGW_NOTHROW heapwalk (_HEAPINFO*); +#if !defined(RC_INVOKED) + static __inline void *_MarkAllocaS(void *_Ptr,unsigned int _Marker) { + if(_Ptr) { + *((unsigned int*)_Ptr) = _Marker; + _Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE; + } + return _Ptr; + } +#endif + +#undef _malloca +#define _malloca(size) \ + ((((size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) ? \ + _MarkAllocaS(_alloca((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_STACK_MARKER) : \ + _MarkAllocaS(malloc((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_HEAP_MARKER)) +#undef _FREEA_INLINE +#define _FREEA_INLINE + +#ifndef RC_INVOKED +#undef _freea + static __inline void __cdecl _freea(void *_Memory) { + unsigned int _Marker; + if(_Memory) { + _Memory = (char*)_Memory - _ALLOCA_S_MARKER_SIZE; + _Marker = *(unsigned int *)_Memory; + if(_Marker==_ALLOCA_S_HEAP_MARKER) { + free(_Memory); + } +#ifdef _ASSERTE + else if(_Marker!=_ALLOCA_S_STACK_MARKER) { + _ASSERTE(("Corrupted pointer passed to _freea",0)); + } +#endif + } + } +#endif /* RC_INVOKED */ + +#ifndef NO_OLDNAMES +#undef alloca #ifdef __GNUC__ #define alloca(x) __builtin_alloca((x)) +#else +#define alloca _alloca +#endif #endif -#endif /* Not _NO_OLDNAMES */ -_CRTIMP int __cdecl __MINGW_NOTHROW _heapchk (void); /* Verify heap integrety. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _heapmin (void); /* Return unused heap to the OS. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _heapset (unsigned int); +#ifdef HEAPHOOK +#ifndef _HEAPHOOK_DEFINED +#define _HEAPHOOK_DEFINED + typedef int (__cdecl *_HEAPHOOK)(int,size_t,void *,void **); +#endif -_CRTIMP size_t __cdecl __MINGW_NOTHROW _msize (void*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _get_sbh_threshold (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _set_sbh_threshold (size_t); -_CRTIMP void* __cdecl __MINGW_NOTHROW _expand (void*, size_t); + _CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK _NewHook); -/* These require msvcr70.dll or higher. */ -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_offset_malloc(size_t, size_t, size_t); -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_offset_realloc(void*, size_t, size_t, size_t); - -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_malloc (size_t, size_t); -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_realloc (void*, size_t, size_t); -_CRTIMP void __cdecl __MINGW_NOTHROW _aligned_free (void*); -#endif /* __MSVCRT_VERSION__ >= 0x0700 */ - -/* These require libmingwex.a. */ -void * __cdecl __MINGW_NOTHROW __mingw_aligned_offset_malloc (size_t, size_t, size_t); -void * __cdecl __MINGW_NOTHROW __mingw_aligned_offset_realloc (void*, size_t, size_t, size_t); - -void * __cdecl __MINGW_NOTHROW __mingw_aligned_malloc (size_t, size_t); -void * __cdecl __MINGW_NOTHROW __mingw_aligned_realloc (void*, size_t, size_t); -void __cdecl __MINGW_NOTHROW __mingw_aligned_free (void*); +#define _HEAP_MALLOC 1 +#define _HEAP_CALLOC 2 +#define _HEAP_FREE 3 +#define _HEAP_REALLOC 4 +#define _HEAP_MSIZE 5 +#define _HEAP_EXPAND 6 +#endif #ifdef __cplusplus } #endif -#endif /* RC_INVOKED */ +#pragma pack(pop) -#endif /* Not _MALLOC_H_ */ +#endif /* _MALLOC_H_ */ diff --git a/reactos/include/crt/math.h b/reactos/include/crt/math.h index 0d60c6f19d9..fd8a3b317d7 100644 --- a/reactos/include/crt/math.h +++ b/reactos/include/crt/math.h @@ -1,14 +1,8 @@ -/* - * math.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Mathematical functions. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ - - #ifndef _MATH_H_ #define _MATH_H_ @@ -16,61 +10,705 @@ #pragma GCC system_header #endif -/* All the headers include this file. */ #include <_mingw.h> -/* - * Types for the _exception structure. - */ +struct exception; -#define _DOMAIN 1 /* domain error in argument */ -#define _SING 2 /* singularity */ -#define _OVERFLOW 3 /* range overflow */ -#define _UNDERFLOW 4 /* range underflow */ -#define _TLOSS 5 /* total loss of precision */ -#define _PLOSS 6 /* partial loss of precision */ +#pragma pack(push,_CRT_PACKING) -/* - * Exception types with non-ANSI names for compatibility. - */ - -#ifndef __STRICT_ANSI__ -#ifndef _NO_OLDNAMES - -#define DOMAIN _DOMAIN -#define SING _SING -#define OVERFLOW _OVERFLOW -#define UNDERFLOW _UNDERFLOW -#define TLOSS _TLOSS -#define PLOSS _PLOSS - -#endif /* Not _NO_OLDNAMES */ -#endif /* Not __STRICT_ANSI__ */ - - -/* Traditional/XOPEN math constants (double precison) */ -#ifndef __STRICT_ANSI__ -#define M_E 2.7182818284590452354 -#define M_LOG2E 1.4426950408889634074 -#define M_LOG10E 0.43429448190325182765 -#define M_LN2 0.69314718055994530942 -#define M_LN10 2.30258509299404568402 -#define M_PI 3.14159265358979323846 -#define M_PI_2 1.57079632679489661923 -#define M_PI_4 0.78539816339744830962 -#define M_1_PI 0.31830988618379067154 -#define M_2_PI 0.63661977236758134308 -#define M_2_SQRTPI 1.12837916709551257390 -#define M_SQRT2 1.41421356237309504880 -#define M_SQRT1_2 0.70710678118654752440 +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _EXCEPTION_DEFINED +#define _EXCEPTION_DEFINED + struct _exception { + int type; + char *name; + double arg1; + double arg2; + double retval; + }; +#endif + +#ifndef _COMPLEX_DEFINED +#define _COMPLEX_DEFINED + struct _complex { + double x,y; + }; +#endif + +#define _DOMAIN 1 +#define _SING 2 +#define _OVERFLOW 3 +#define _UNDERFLOW 4 +#define _TLOSS 5 +#define _PLOSS 6 + +#define EDOM 33 +#define ERANGE 34 + +#ifndef _HUGE +#ifdef _MSVCRT_ + extern double *_HUGE; +#else + extern double *_imp___HUGE; +#define _HUGE (*_imp___HUGE) +#endif +#endif + +#define HUGE_VAL _HUGE + +#ifndef _CRT_ABS_DEFINED +#define _CRT_ABS_DEFINED + int __cdecl abs(int _X); + long __cdecl labs(long _X); +#endif + double __cdecl acos(double _X); + double __cdecl asin(double _X); + double __cdecl atan(double _X); + double __cdecl atan2(double _Y,double _X); +#ifndef _SIGN_DEFINED +#define _SIGN_DEFINED + _CRTIMP double __cdecl _copysign (double _Number,double _Sign); + _CRTIMP double __cdecl _chgsign (double _X); +#endif + double __cdecl cos(double _X); + double __cdecl cosh(double _X); + double __cdecl exp(double _X); + double __cdecl fabs(double _X); + double __cdecl fmod(double _X,double _Y); + double __cdecl log(double _X); + double __cdecl log10(double _X); + double __cdecl pow(double _X,double _Y); + double __cdecl sin(double _X); + double __cdecl sinh(double _X); + double __cdecl tan(double _X); + double __cdecl tanh(double _X); + double __cdecl sqrt(double _X); +#ifndef _CRT_ATOF_DEFINED +#define _CRT_ATOF_DEFINED + double __cdecl atof(const char *_String); + double __cdecl _atof_l(const char *_String,_locale_t _Locale); +#endif + + _CRTIMP double __cdecl _cabs(struct _complex _ComplexA); + double __cdecl ceil(double _X); + double __cdecl floor(double _X); + double __cdecl frexp(double _X,int *_Y); + double __cdecl _hypot(double _X,double _Y); + _CRTIMP double __cdecl _j0(double _X); + _CRTIMP double __cdecl _j1(double _X); + _CRTIMP double __cdecl _jn(int _X,double _Y); + double __cdecl ldexp(double _X,int _Y); +#ifndef _CRT_MATHERR_DEFINED +#define _CRT_MATHERR_DEFINED + int __cdecl _matherr(struct _exception *_Except); +#endif + double __cdecl modf(double _X,double *_Y); + _CRTIMP double __cdecl _y0(double _X); + _CRTIMP double __cdecl _y1(double _X); + _CRTIMP double __cdecl _yn(int _X,double _Y); + +#if(defined(_X86_) && !defined(__x86_64)) + _CRTIMP int __cdecl _set_SSE2_enable(int _Flag); + /* from libmingwex */ + float __cdecl _hypotf(float _X,float _Y); +#endif + + float frexpf(float _X,int *_Y); + float __cdecl ldexpf(float _X,int _Y); + long double __cdecl ldexpl(long double _X,int _Y); + float __cdecl acosf(float _X); + float __cdecl asinf(float _X); + float __cdecl atanf(float _X); + float __cdecl atan2f(float _X,float _Y); + float __cdecl cosf(float _X); + float __cdecl sinf(float _X); + float __cdecl tanf(float _X); + float __cdecl coshf(float _X); + float __cdecl sinhf(float _X); + float __cdecl tanhf(float _X); + float __cdecl expf(float _X); + float __cdecl logf(float _X); + float __cdecl log10f(float _X); + float __cdecl modff(float _X,float *_Y); + float __cdecl powf(float _X,float _Y); + float __cdecl sqrtf(float _X); + float __cdecl ceilf(float _X); + float __cdecl floorf(float _X); + float __cdecl fmodf(float _X,float _Y); + float __cdecl _hypotf(float _X,float _Y); + float __cdecl fabsf(float _X); +#if !defined(__ia64__) + /* from libmingwex */ + float __cdecl _copysignf (float _Number,float _Sign); + float __cdecl _chgsignf (float _X); + float __cdecl _logbf(float _X); + float __cdecl _nextafterf(float _X,float _Y); + int __cdecl _finitef(float _X); + int __cdecl _isnanf(float _X); + int __cdecl _fpclassf(float _X); +#endif + +#ifndef __cplusplus + __CRT_INLINE long double __cdecl fabsl (long double x) + { + long double res; + __asm__ ("fabs;" : "=t" (res) : "0" (x)); + return res; + } +#define _hypotl(x,y) ((long double)_hypot((double)(x),(double)(y))) +#define _matherrl _matherr + __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign((double)(_Number)); } + __CRT_INLINE long double _copysignl(long double _Number,long double _Sign) { return _copysign((double)(_Number),(double)(_Sign)); } + __CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); } + +#if !defined (__ia64__) + __CRT_INLINE float __cdecl fabsf (float x) + { + float res; + __asm__ ("fabs;" : "=t" (res) : "0" (x)); + return res; + } + + __CRT_INLINE float __cdecl ldexpf (float x, int expn) { return (float) ldexp (x, expn); } +#endif +#else + // cplusplus + __CRT_INLINE long double __cdecl fabsl (long double x) + { + long double res; + __asm__ ("fabs;" : "=t" (res) : "0" (x)); + return res; + } + __CRT_INLINE long double modfl(long double _X,long double *_Y) { + double _Di,_Df = modf((double)_X,&_Di); + *_Y = (long double)_Di; + return (_Df); + } + __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign(static_cast(_Number)); } + __CRT_INLINE long double _copysignl(long double _Number,long double _Sign) { return _copysign(static_cast(_Number),static_cast(_Sign)); } + __CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); } +#ifndef __ia64__ + __CRT_INLINE float __cdecl fabsf (float x) + { + float res; + __asm__ ("fabs;" : "=t" (res) : "0" (x)); + return res; + } + __CRT_INLINE float __cdecl ldexpf (float x, int expn) { return (float) ldexp (x, expn); } +#ifndef __x86_64 + __CRT_INLINE float acosf(float _X) { return ((float)acos((double)_X)); } + __CRT_INLINE float asinf(float _X) { return ((float)asin((double)_X)); } + __CRT_INLINE float atanf(float _X) { return ((float)atan((double)_X)); } + __CRT_INLINE float atan2f(float _X,float _Y) { return ((float)atan2((double)_X,(double)_Y)); } + __CRT_INLINE float ceilf(float _X) { return ((float)ceil((double)_X)); } + __CRT_INLINE float cosf(float _X) { return ((float)cos((double)_X)); } + __CRT_INLINE float coshf(float _X) { return ((float)cosh((double)_X)); } + __CRT_INLINE float expf(float _X) { return ((float)exp((double)_X)); } + __CRT_INLINE float floorf(float _X) { return ((float)floor((double)_X)); } + __CRT_INLINE float fmodf(float _X,float _Y) { return ((float)fmod((double)_X,(double)_Y)); } + __CRT_INLINE float logf(float _X) { return ((float)log((double)_X)); } + __CRT_INLINE float log10f(float _X) { return ((float)log10((double)_X)); } + __CRT_INLINE float modff(float _X,float *_Y) { + double _Di,_Df = modf((double)_X,&_Di); + *_Y = (float)_Di; + return ((float)_Df); + } + __CRT_INLINE float powf(float _X,float _Y) { return ((float)pow((double)_X,(double)_Y)); } + __CRT_INLINE float sinf(float _X) { return ((float)sin((double)_X)); } + __CRT_INLINE float sinhf(float _X) { return ((float)sinh((double)_X)); } + __CRT_INLINE float sqrtf(float _X) { return ((float)sqrt((double)_X)); } + __CRT_INLINE float tanf(float _X) { return ((float)tan((double)_X)); } + __CRT_INLINE float tanhf(float _X) { return ((float)tanh((double)_X)); } +#endif +#endif +#endif + +#ifndef NO_OLDNAMES +#define DOMAIN _DOMAIN +#define SING _SING +#define OVERFLOW _OVERFLOW +#define UNDERFLOW _UNDERFLOW +#define TLOSS _TLOSS +#define PLOSS _PLOSS +#define matherr _matherr + +#define HUGE _HUGE + /* double __cdecl cabs(struct _complex _X); */ + double __cdecl hypot(double _X,double _Y); + _CRTIMP double __cdecl j0(double _X); + _CRTIMP double __cdecl j1(double _X); + _CRTIMP double __cdecl jn(int _X,double _Y); + _CRTIMP double __cdecl y0(double _X); + _CRTIMP double __cdecl y1(double _X); + _CRTIMP double __cdecl yn(int _X,double _Y); +#endif + +#ifndef __NO_ISOCEXT +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ + || !defined __STRICT_ANSI__ || defined __GLIBCPP__ + +#define NAN (0.0F/0.0F) +#define HUGE_VALF (1.0F/0.0F) +#define HUGE_VALL (1.0L/0.0L) +#define INFINITY (1.0F/0.0F) + + +#define FP_NAN 0x0100 +#define FP_NORMAL 0x0400 +#define FP_INFINITE (FP_NAN | FP_NORMAL) +#define FP_ZERO 0x4000 +#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO) + /* 0x0200 is signbit mask */ + + + /* + We can't __CRT_INLINE float or double, because we want to ensure truncation + to semantic type before classification. + (A normal long double value might become subnormal when + converted to double, and zero when converted to float.) + */ + + extern int __cdecl __fpclassifyf (float); + extern int __cdecl __fpclassify (double); + + __CRT_INLINE int __cdecl __fpclassifyl (long double x){ + unsigned short sw; + __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); + return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); + } + +#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \ + : sizeof (x) == sizeof (double) ? __fpclassify (x) \ + : __fpclassifyl (x)) + + /* 7.12.3.2 */ +#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0) + + /* 7.12.3.3 */ +#define isinf(x) (fpclassify(x) == FP_INFINITE) + + /* 7.12.3.4 */ + /* We don't need to worry about trucation here: + A NaN stays a NaN. */ + + __CRT_INLINE int __cdecl __isnan (double _x) + { + unsigned short sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; + } + + __CRT_INLINE int __cdecl __isnanf (float _x) + { + unsigned short sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; + } + + __CRT_INLINE int __cdecl __isnanl (long double _x) + { + unsigned short sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; + } + + +#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \ + : sizeof (x) == sizeof (double) ? __isnan (x) \ + : __isnanl (x)) + + /* 7.12.3.5 */ +#define isnormal(x) (fpclassify(x) == FP_NORMAL) + + /* 7.12.3.6 The signbit macro */ + __CRT_INLINE int __cdecl __signbit (double x) { + unsigned short stw; + __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + return stw & 0x0200; + } + + __CRT_INLINE int __cdecl __signbitf (float x) { + unsigned short stw; + __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + return stw & 0x0200; + } + + __CRT_INLINE int __cdecl __signbitl (long double x) { + unsigned short stw; + __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + return stw & 0x0200; + } + +#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \ + : sizeof (x) == sizeof (double) ? __signbit (x) \ + : __signbitl (x)) + + extern double __cdecl exp2(double); + extern float __cdecl exp2f(float); + extern long double __cdecl exp2l(long double); + +#define FP_ILOGB0 ((int)0x80000000) +#define FP_ILOGBNAN ((int)0x80000000) + extern int __cdecl ilogb (double); + extern int __cdecl ilogbf (float); + extern int __cdecl ilogbl (long double); + + extern double __cdecl log1p(double); + extern float __cdecl log1pf(float); + extern long double __cdecl log1pl(long double); + + extern double __cdecl log2 (double); + extern float __cdecl log2f (float); + extern long double __cdecl log2l (long double); + + extern double __cdecl logb (double); + extern float __cdecl logbf (float); + extern long double __cdecl logbl (long double); + + __CRT_INLINE double __cdecl logb (double x) + { + double res; + __asm__ ("fxtract\n\t" + "fstp %%st" : "=t" (res) : "0" (x)); + return res; + } + + __CRT_INLINE float __cdecl logbf (float x) + { + float res; + __asm__ ("fxtract\n\t" + "fstp %%st" : "=t" (res) : "0" (x)); + return res; + } + + __CRT_INLINE long double __cdecl logbl (long double x) + { + long double res; + __asm__ ("fxtract\n\t" + "fstp %%st" : "=t" (res) : "0" (x)); + return res; + } + + extern long double __cdecl modfl (long double, long double*); + + /* 7.12.6.13 */ + extern double __cdecl scalbn (double, int); + extern float __cdecl scalbnf (float, int); + extern long double __cdecl scalbnl (long double, int); + + extern double __cdecl scalbln (double, long); + extern float __cdecl scalblnf (float, long); + extern long double __cdecl scalblnl (long double, long); + + /* 7.12.7.1 */ + /* Implementations adapted from Cephes versions */ + extern double __cdecl cbrt (double); + extern float __cdecl cbrtf (float); + extern long double __cdecl cbrtl (long double); + + __CRT_INLINE float __cdecl hypotf (float x, float y) + { return (float) hypot (x, y);} + extern long double __cdecl hypotl (long double, long double); + + extern long double __cdecl powl (long double, long double); + extern long double __cdecl expl(long double); + extern long double __cdecl coshl(long double); + extern long double __cdecl fabsl (long double); + extern long double __cdecl acosl(long double); + extern long double __cdecl asinl(long double); + extern long double __cdecl atanl(long double); + extern long double __cdecl atan2l(long double,long double); + extern long double __cdecl sinhl(long double); + extern long double __cdecl tanhl(long double); + + /* 7.12.8.1 The erf functions */ + extern double __cdecl erf (double); + extern float __cdecl erff (float); + /* TODO + extern long double __cdecl erfl (long double); + */ + + /* 7.12.8.2 The erfc functions */ + extern double __cdecl erfc (double); + extern float __cdecl erfcf (float); + /* TODO + extern long double __cdecl erfcl (long double); + */ + + /* 7.12.8.3 The lgamma functions */ + extern double __cdecl lgamma (double); + extern float __cdecl lgammaf (float); + extern long double __cdecl lgammal (long double); + + /* 7.12.8.4 The tgamma functions */ + extern double __cdecl tgamma (double); + extern float __cdecl tgammaf (float); + extern long double __cdecl tgammal (long double); + + extern long double __cdecl ceill (long double); + extern long double __cdecl floorl (long double); + extern long double __cdecl frexpl(long double,int *); + extern long double __cdecl log10l(long double); + extern long double __cdecl logl(long double); + extern long double __cdecl cosl(long double); + extern long double __cdecl sinl(long double); + extern long double __cdecl tanl(long double); + extern long double sqrtl(long double); + + /* 7.12.9.3 */ + extern double __cdecl nearbyint ( double); + extern float __cdecl nearbyintf (float); + extern long double __cdecl nearbyintl (long double); + + /* 7.12.9.4 */ + /* round, using fpu control word settings */ + __CRT_INLINE double __cdecl rint (double x) + { + double retval; + __asm__ ("frndint;": "=t" (retval) : "0" (x)); + return retval; + } + + __CRT_INLINE float __cdecl rintf (float x) + { + float retval; + __asm__ ("frndint;" : "=t" (retval) : "0" (x) ); + return retval; + } + + __CRT_INLINE long double __cdecl rintl (long double x) + { + long double retval; + __asm__ ("frndint;" : "=t" (retval) : "0" (x) ); + return retval; + } + + /* 7.12.9.5 */ + __CRT_INLINE long __cdecl lrint (double x) + { + long retval; + __asm__ __volatile__ \ + ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ + return retval; + } + + __CRT_INLINE long __cdecl lrintf (float x) + { + long retval; + __asm__ __volatile__ \ + ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ + return retval; + } + + __CRT_INLINE long __cdecl lrintl (long double x) + { + long retval; + __asm__ __volatile__ \ + ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ + return retval; + } + + __CRT_INLINE long long __cdecl llrint (double x) + { + long long retval; + __asm__ __volatile__ \ + ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ + return retval; + } + + __CRT_INLINE long long __cdecl llrintf (float x) + { + long long retval; + __asm__ __volatile__ \ + ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ + return retval; + } + + __CRT_INLINE long long __cdecl llrintl (long double x) + { + long long retval; + __asm__ __volatile__ \ + ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ + return retval; + } + + /* 7.12.9.6 */ + /* round away from zero, regardless of fpu control word settings */ + extern double __cdecl round (double); + extern float __cdecl roundf (float); + extern long double __cdecl roundl (long double); + + /* 7.12.9.7 */ + extern long __cdecl lround (double); + extern long __cdecl lroundf (float); + extern long __cdecl lroundl (long double); + + extern long long __cdecl llround (double); + extern long long __cdecl llroundf (float); + extern long long __cdecl llroundl (long double); + + /* 7.12.9.8 */ + /* round towards zero, regardless of fpu control word settings */ + extern double __cdecl trunc (double); + extern float __cdecl truncf (float); + extern long double __cdecl truncl (long double); + + extern long double __cdecl fmodl (long double, long double); + + /* 7.12.10.2 */ + extern double __cdecl remainder (double, double); + extern float __cdecl remainderf (float, float); + extern long double __cdecl remainderl (long double, long double); + + /* 7.12.10.3 */ + extern double __cdecl remquo(double, double, int *); + extern float __cdecl remquof(float, float, int *); + extern long double __cdecl remquol(long double, long double, int *); + + /* 7.12.11.1 */ + extern double __cdecl copysign (double, double); /* in libmoldname.a */ + extern float __cdecl copysignf (float, float); + extern long double __cdecl copysignl (long double, long double); + + /* 7.12.11.2 Return a NaN */ + extern double __cdecl nan(const char *tagp); + extern float __cdecl nanf(const char *tagp); + extern long double __cdecl nanl(const char *tagp); + +#ifndef __STRICT_ANSI__ +#define _nan() nan("") +#define _nanf() nanf("") +#define _nanl() nanl("") +#endif + + /* 7.12.11.3 */ + extern double __cdecl nextafter (double, double); /* in libmoldname.a */ + extern float __cdecl nextafterf (float, float); + extern long double __cdecl nextafterl (long double, long double); + + /* 7.12.11.4 The nexttoward functions: TODO */ + + /* 7.12.12.1 */ + /* x > y ? (x - y) : 0.0 */ + extern double __cdecl fdim (double x, double y); + extern float __cdecl fdimf (float x, float y); + extern long double __cdecl fdiml (long double x, long double y); + + /* fmax and fmin. + NaN arguments are treated as missing data: if one argument is a NaN + and the other numeric, then these functions choose the numeric + value. */ + + /* 7.12.12.2 */ + extern double __cdecl fmax (double, double); + extern float __cdecl fmaxf (float, float); + extern long double __cdecl fmaxl (long double, long double); + + /* 7.12.12.3 */ + extern double __cdecl fmin (double, double); + extern float __cdecl fminf (float, float); + extern long double __cdecl fminl (long double, long double); + + /* 7.12.13.1 */ + /* return x * y + z as a ternary op */ + extern double __cdecl fma (double, double, double); + extern float __cdecl fmaf (float, float, float); + extern long double __cdecl fmal (long double, long double, long double); + + + /* 7.12.14 */ + /* + * With these functions, comparisons involving quiet NaNs set the FP + * condition code to "unordered". The IEEE floating-point spec + * dictates that the result of floating-point comparisons should be + * false whenever a NaN is involved, with the exception of the != op, + * which always returns true: yes, (NaN != NaN) is true). + */ + +#if __GNUC__ >= 3 + +#define isgreater(x, y) __builtin_isgreater(x, y) +#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) +#define isless(x, y) __builtin_isless(x, y) +#define islessequal(x, y) __builtin_islessequal(x, y) +#define islessgreater(x, y) __builtin_islessgreater(x, y) +#define isunordered(x, y) __builtin_isunordered(x, y) + +#else + /* helper */ + __CRT_INLINE int __cdecl + __fp_unordered_compare (long double x, long double y){ + unsigned short retval; + __asm__ ("fucom %%st(1);" + "fnstsw;": "=a" (retval) : "t" (x), "u" (y)); + return retval; + } + +#define isgreater(x, y) ((__fp_unordered_compare(x, y) \ + & 0x4500) == 0) +#define isless(x, y) ((__fp_unordered_compare (y, x) \ + & 0x4500) == 0) +#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \ + & FP_INFINITE) == 0) +#define islessequal(x, y) ((__fp_unordered_compare(y, x) \ + & FP_INFINITE) == 0) +#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \ + & FP_SUBNORMAL) == 0) +#define isunordered(x, y) ((__fp_unordered_compare(x, y) \ + & 0x4500) == 0x4500) + +#endif + + +#endif /* __STDC_VERSION__ >= 199901L */ +#endif /* __NO_ISOCEXT */ + +#ifdef __cplusplus +} +extern "C++" { + template inline _Ty _Pow_int(_Ty _X,int _Y) { + unsigned int _N; + if(_Y >= 0) _N = (unsigned int)_Y; + else _N = (unsigned int)(-_Y); + for(_Ty _Z = _Ty(1);;_X *= _X) { + if((_N & 1)!=0) _Z *= _X; + if((_N >>= 1)==0) return (_Y < 0 ? _Ty(1) / _Z : _Z); + } + } +} +#endif + +#pragma pack(pop) + +#if !defined(__STRICT_ANSI__) && !defined(_MATH_DEFINES_DEFINED) +#define _MATH_DEFINES_DEFINED + +#define M_E 2.71828182845904523536 +#define M_LOG2E 1.44269504088896340736 +#define M_LOG10E 0.434294481903251827651 +#define M_LN2 0.693147180559945309417 +#define M_LN10 2.30258509299404568402 +#define M_PI 3.14159265358979323846 +#define M_PI_2 1.57079632679489661923 +#define M_PI_4 0.785398163397448309616 +#define M_1_PI 0.318309886183790671538 +#define M_2_PI 0.636619772367581343076 +#define M_2_SQRTPI 1.12837916709551257390 +#define M_SQRT2 1.41421356237309504880 +#define M_SQRT1_2 0.707106781186547524401 #endif -/* These are also defined in Mingw float.h; needed here as well to work - around GCC build issues. */ -#ifndef __STRICT_ANSI__ #ifndef __MINGW_FPCLASS_DEFINED #define __MINGW_FPCLASS_DEFINED 1 -/* IEEE 754 classication */ #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ #define _FPCLASS_NINF 0x0004 /* Negative Infinity */ @@ -82,721 +720,13 @@ #define _FPCLASS_PN 0x0100 /* Positive Normal */ #define _FPCLASS_PINF 0x0200 /* Positive Infinity */ #endif /* __MINGW_FPCLASS_DEFINED */ -#endif /* Not __STRICT_ANSI__ */ - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * HUGE_VAL is returned by strtod when the value would overflow the - * representation of 'double'. There are other uses as well. - * - * __imp__HUGE is a pointer to the actual variable _HUGE in - * MSVCRT.DLL. If we used _HUGE directly we would get a pointer - * to a thunk function. - * - * NOTE: The CRTDLL version uses _HUGE_dll instead. - */ - -#if __MINGW_GNUC_PREREQ(3, 3) -#define HUGE_VAL __builtin_huge_val() -#else - -#ifndef __DECLSPEC_SUPPORTED - -#ifdef __MSVCRT__ -extern double* _imp___HUGE; -#define HUGE_VAL (*_imp___HUGE) -#else -/* CRTDLL */ -extern double* _imp___HUGE_dll; -#define HUGE_VAL (*_imp___HUGE_dll) -#endif - -#else /* __DECLSPEC_SUPPORTED */ - -#ifdef __MSVCRT__ -__MINGW_IMPORT double _HUGE; -#define HUGE_VAL _HUGE -#else -/* CRTDLL */ -__MINGW_IMPORT double _HUGE_dll; -#define HUGE_VAL _HUGE_dll -#endif - -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* __MINGW_GNUC_PREREQ(3, 3) */ - - -struct _exception -{ - int type; - char *name; - double arg1; - double arg2; - double retval; -}; - -_CRTIMP double __cdecl sin (double); -_CRTIMP double __cdecl cos (double); -_CRTIMP double __cdecl tan (double); -_CRTIMP double __cdecl sinh (double); -_CRTIMP double __cdecl cosh (double); -_CRTIMP double __cdecl tanh (double); -_CRTIMP double __cdecl asin (double); -_CRTIMP double __cdecl acos (double); -_CRTIMP double __cdecl atan (double); -_CRTIMP double __cdecl atan2 (double, double); -_CRTIMP double __cdecl exp (double); -_CRTIMP double __cdecl log (double); -_CRTIMP double __cdecl log10 (double); -_CRTIMP double __cdecl pow (double, double); -_CRTIMP double __cdecl sqrt (double); -_CRTIMP double __cdecl ceil (double); -_CRTIMP double __cdecl floor (double); -_CRTIMP double __cdecl fabs (double); -_CRTIMP double __cdecl ldexp (double, int); -_CRTIMP double __cdecl frexp (double, int*); -_CRTIMP double __cdecl modf (double, double*); -_CRTIMP double __cdecl fmod (double, double); - -/* Excess precision when using a 64-bit mantissa for FPU math ops can - cause unexpected results with some of the MSVCRT math functions. For - example, unless the function return value is stored (truncating to - 53-bit mantissa), calls to pow with both x and y as integral values - sometimes produce a non-integral result. - One workaround is to reset the FPU env to 53-bit mantissa - by a call to fesetenv (FE_PC53_ENV). Amother is to force storage - of the return value of individual math functions using wrappers. - NB, using these wrappers will disable builtin math functions and - hence disable the folding of function results at compile time when - arguments are constant. */ - -#if 0 -#define __DEFINE_FLOAT_STORE_MATHFN_D1(fn1) \ -static __inline__ double \ -__float_store_ ## fn1 (double x) \ -{ \ - __volatile__ double res = (fn1) (x); \ - return res; \ -} - -#define __DEFINE_FLOAT_STORE_MATHFN_D2(fn2) \ -static __inline__ double \ -__float_store_ ## fn2 (double x, double y) \ -{ \ - __volatile__ double res = (fn2) (x, y); \ - return res; \ -} -#endif - -/* For example, here is how to force the result of the pow function - to be stored: */ -#if 0 -#undef pow -/* Define the ___float_store_pow function and use it instead of pow(). */ -__DEFINE_FLOAT_STORE_MATHFN_D2 (pow) -#define pow __float_store_pow -#endif - -#ifndef __STRICT_ANSI__ - -/* Complex number (for _cabs). This is the MS version. The ISO - C99 counterpart _Complex is an intrinsic type in GCC and - 'complex' is defined as a macro. See complex.h */ -struct _complex -{ - double x; /* Real part */ - double y; /* Imaginary part */ -}; - -_CRTIMP double __cdecl _cabs (struct _complex); - -_CRTIMP double __cdecl _hypot (double, double); -_CRTIMP double __cdecl _j0 (double); -_CRTIMP double __cdecl _j1 (double); -_CRTIMP double __cdecl _jn (int, double); -_CRTIMP double __cdecl _y0 (double); -_CRTIMP double __cdecl _y1 (double); -_CRTIMP double __cdecl _yn (int, double); -_CRTIMP int __cdecl _matherr (struct _exception *); - -/* These are also declared in Mingw float.h; needed here as well to work - around GCC build issues. */ -/* BEGIN FLOAT.H COPY */ -/* - * IEEE recommended functions - */ - -_CRTIMP double __cdecl _chgsign (double); -_CRTIMP double __cdecl _copysign (double, double); -_CRTIMP double __cdecl _logb (double); -_CRTIMP double __cdecl _nextafter (double, double); -_CRTIMP double __cdecl _scalb (double, long); - -_CRTIMP int __cdecl _finite (double); -_CRTIMP int __cdecl _fpclass (double); -_CRTIMP int __cdecl _isnan (double); - -/* END FLOAT.H COPY */ - - -/* - * Non-underscored versions of non-ANSI functions. - * These reside in liboldnames.a. - */ - -#if !defined (_NO_OLDNAMES) - -_CRTIMP double __cdecl j0 (double); -_CRTIMP double __cdecl j1 (double); -_CRTIMP double __cdecl jn (int, double); -_CRTIMP double __cdecl y0 (double); -_CRTIMP double __cdecl y1 (double); -_CRTIMP double __cdecl yn (int, double); - -_CRTIMP double __cdecl chgsign (double); -_CRTIMP double __cdecl scalb (double, long); -_CRTIMP int __cdecl finite (double); -_CRTIMP int __cdecl fpclass (double); - -#define FP_SNAN _FPCLASS_SNAN -#define FP_QNAN _FPCLASS_QNAN -#define FP_NINF _FPCLASS_NINF -#define FP_PINF _FPCLASS_PINF -#define FP_NDENORM _FPCLASS_ND -#define FP_PDENORM _FPCLASS_PD -#define FP_NZERO _FPCLASS_NZ -#define FP_PZERO _FPCLASS_PZ -#define FP_NNORM _FPCLASS_NN -#define FP_PNORM _FPCLASS_PN - -#endif /* Not _NO_OLDNAMES */ - -/* This require msvcr70.dll or higher. */ -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP int __cdecl _set_SSE2_enable (int); -#endif /* __MSVCRT_VERSION__ >= 0x0700 */ - - -#endif /* __STRICT_ANSI__ */ - - -#ifndef __NO_ISOCEXT -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus - -#if __MINGW_GNUC_PREREQ(3, 3) -#define HUGE_VALF __builtin_huge_valf() -#define HUGE_VALL __builtin_huge_vall() -#define INFINITY __builtin_inf() -#define NAN __builtin_nan("") -#else -extern const float __INFF; -#define HUGE_VALF __INFF -extern const long double __INFL; -#define HUGE_VALL __INFL -#define INFINITY HUGE_VALF -extern const double __QNAN; -#define NAN __QNAN -#endif /* __MINGW_GNUC_PREREQ(3, 3) */ - -/* 7.12.3.1 */ -/* - Return values for fpclassify. - These are based on Intel x87 fpu condition codes - in the high byte of status word and differ from - the return values for MS IEEE 754 extension _fpclass() -*/ -#define FP_NAN 0x0100 -#define FP_NORMAL 0x0400 -#define FP_INFINITE (FP_NAN | FP_NORMAL) -#define FP_ZERO 0x4000 -#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO) -/* 0x0200 is signbit mask */ - - -/* - We can't inline float or double, because we want to ensure truncation - to semantic type before classification. - (A normal long double value might become subnormal when - converted to double, and zero when converted to float.) -*/ - -extern int __cdecl __fpclassifyf (float); -extern int __cdecl __fpclassify (double); - -__CRT_INLINE int __cdecl __fpclassifyl (long double x){ - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} - -#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \ - : sizeof (x) == sizeof (double) ? __fpclassify (x) \ - : __fpclassifyl (x)) - -/* 7.12.3.2 */ -#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0) - -/* 7.12.3.3 */ -#define isinf(x) (fpclassify(x) == FP_INFINITE) - -/* 7.12.3.4 */ -/* We don't need to worry about trucation here: - A NaN stays a NaN. */ - -__CRT_INLINE int __cdecl __isnan (double _x) -{ - unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); - return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -__CRT_INLINE int __cdecl __isnanf (float _x) -{ - unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); - return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -__CRT_INLINE int __cdecl __isnanl (long double _x) -{ - unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); - return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - - -#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \ - : sizeof (x) == sizeof (double) ? __isnan (x) \ - : __isnanl (x)) - -/* 7.12.3.5 */ -#define isnormal(x) (fpclassify(x) == FP_NORMAL) - -/* 7.12.3.6 The signbit macro */ -__CRT_INLINE int __cdecl __signbit (double x) { - unsigned short stw; - __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); - return (stw & 0x0200) != 0; -} - -__CRT_INLINE int __cdecl __signbitf (float x) { - unsigned short stw; - __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); - return (stw & 0x0200) != 0; -} - -__CRT_INLINE int __cdecl __signbitl (long double x) { - unsigned short stw; - __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); - return (stw & 0x0200) != 0; -} - -#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \ - : sizeof (x) == sizeof (double) ? __signbit (x) \ - : __signbitl (x)) - -/* 7.12.4 Trigonometric functions: Double in C89 */ -extern float __cdecl sinf (float); -extern long double __cdecl sinl (long double); - -extern float __cdecl cosf (float); -extern long double __cdecl cosl (long double); - -extern float __cdecl tanf (float); -extern long double __cdecl tanl (long double); - -extern float __cdecl asinf (float); -extern long double __cdecl asinl (long double); - -extern float __cdecl acosf (float); -extern long double __cdecl acosl (long double); - -extern float __cdecl atanf (float); -extern long double __cdecl atanl (long double); - -extern float __cdecl atan2f (float, float); -extern long double __cdecl atan2l (long double, long double); - -/* 7.12.5 Hyperbolic functions: Double in C89 */ -__CRT_INLINE float __cdecl sinhf (float x) - {return (float) sinh (x);} -extern long double __cdecl sinhl (long double); - -__CRT_INLINE float __cdecl coshf (float x) - {return (float) cosh (x);} -extern long double __cdecl coshl (long double); - -__CRT_INLINE float __cdecl tanhf (float x) - {return (float) tanh (x);} -extern long double __cdecl tanhl (long double); - -/* Inverse hyperbolic trig functions */ -/* 7.12.5.1 */ -extern double __cdecl acosh (double); -extern float __cdecl acoshf (float); -extern long double __cdecl acoshl (long double); - -/* 7.12.5.2 */ -extern double __cdecl asinh (double); -extern float __cdecl asinhf (float); -extern long double __cdecl asinhl (long double); - -/* 7.12.5.3 */ -extern double __cdecl atanh (double); -extern float __cdecl atanf (float); -extern long double __cdecl atanhl (long double); - -/* Exponentials and logarithms */ -/* 7.12.6.1 Double in C89 */ -__CRT_INLINE float __cdecl expf (float x) - {return (float) exp (x);} -extern long double __cdecl expl (long double); - -/* 7.12.6.2 */ -extern double __cdecl exp2(double); -extern float __cdecl exp2f(float); -extern long double __cdecl exp2l(long double); - -/* 7.12.6.3 The expm1 functions */ -/* TODO: These could be inlined */ -extern double __cdecl expm1(double); -extern float __cdecl expm1f(float); -extern long double __cdecl expm1l(long double); - -/* 7.12.6.4 Double in C89 */ -__CRT_INLINE float __cdecl frexpf (float x, int* expn) - {return (float) frexp (x, expn);} -extern long double __cdecl frexpl (long double, int*); - -/* 7.12.6.5 */ -#define FP_ILOGB0 ((int)0x80000000) -#define FP_ILOGBNAN ((int)0x80000000) -extern int __cdecl ilogb (double); -extern int __cdecl ilogbf (float); -extern int __cdecl ilogbl (long double); - -/* 7.12.6.6 Double in C89 */ -__CRT_INLINE float __cdecl ldexpf (float x, int expn) - {return (float) ldexp (x, expn);} -extern long double __cdecl ldexpl (long double, int); - -/* 7.12.6.7 Double in C89 */ -extern float __cdecl logf (float); -extern long double __cdecl logl (long double); - -/* 7.12.6.8 Double in C89 */ -extern float __cdecl log10f (float); -extern long double __cdecl log10l (long double); - -/* 7.12.6.9 */ -extern double __cdecl log1p(double); -extern float __cdecl log1pf(float); -extern long double __cdecl log1pl(long double); - -/* 7.12.6.10 */ -extern double __cdecl log2 (double); -extern float __cdecl log2f (float); -extern long double __cdecl log2l (long double); - -/* 7.12.6.11 */ -extern double __cdecl logb (double); -extern float __cdecl logbf (float); -extern long double __cdecl logbl (long double); - -/* Inline versions. GCC-4.0+ can do a better fast-math optimization - with __builtins. */ -#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) -__CRT_INLINE double __cdecl logb (double x) -{ - double res; - __asm__ ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} - -__CRT_INLINE float __cdecl logbf (float x) -{ - float res; - __asm__ ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} - -__CRT_INLINE long double __cdecl logbl (long double x) -{ - long double res; - __asm__ ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} -#endif /* !defined __FAST_MATH__ || !__MINGW_GNUC_PREREQ (4, 0) */ - -/* 7.12.6.12 Double in C89 */ -extern float __cdecl modff (float, float*); -extern long double __cdecl modfl (long double, long double*); - -/* 7.12.6.13 */ -extern double __cdecl scalbn (double, int); -extern float __cdecl scalbnf (float, int); -extern long double __cdecl scalbnl (long double, int); - -extern double __cdecl scalbln (double, long); -extern float __cdecl scalblnf (float, long); -extern long double __cdecl scalblnl (long double, long); - -/* 7.12.7.1 */ -/* Implementations adapted from Cephes versions */ -extern double __cdecl cbrt (double); -extern float __cdecl cbrtf (float); -extern long double __cdecl cbrtl (long double); - -/* 7.12.7.2 The fabs functions: Double in C89 */ -extern float __cdecl fabsf (float x); -extern long double __cdecl fabsl (long double x); - -/* 7.12.7.3 */ -extern double __cdecl hypot (double, double); /* in libmoldname.a */ -__CRT_INLINE float __cdecl hypotf (float x, float y) - { return (float) hypot (x, y);} -extern long double __cdecl hypotl (long double, long double); - -/* 7.12.7.4 The pow functions. Double in C89 */ -__CRT_INLINE float __cdecl powf (float x, float y) - {return (float) pow (x, y);} -extern long double __cdecl powl (long double, long double); - -/* 7.12.7.5 The sqrt functions. Double in C89. */ -extern float __cdecl sqrtf (float); -extern long double __cdecl sqrtl (long double); - -/* 7.12.8.1 The erf functions */ -extern double __cdecl erf (double); -extern float __cdecl erff (float); -extern long double __cdecl erfl (long double); - -/* 7.12.8.2 The erfc functions */ -extern double __cdecl erfc (double); -extern float __cdecl erfcf (float); -extern long double __cdecl erfcl (long double); - -/* 7.12.8.3 The lgamma functions */ -extern double __cdecl lgamma (double); -extern float __cdecl lgammaf (float); -extern long double __cdecl lgammal (long double); - -/* 7.12.8.4 The tgamma functions */ -extern double __cdecl tgamma (double); -extern float __cdecl tgammaf (float); -extern long double __cdecl tgammal (long double); - -/* 7.12.9.1 Double in C89 */ -extern float __cdecl ceilf (float); -extern long double __cdecl ceill (long double); - -/* 7.12.9.2 Double in C89 */ -extern float __cdecl floorf (float); -extern long double __cdecl floorl (long double); - -/* 7.12.9.3 */ -extern double __cdecl nearbyint ( double); -extern float __cdecl nearbyintf (float); -extern long double __cdecl nearbyintl (long double); - -/* 7.12.9.4 */ -/* round, using fpu control word settings */ -extern double __cdecl rint (double); -extern float __cdecl rintf (float); -extern long double __cdecl rintl (long double); - -/* 7.12.9.5 */ -extern long __cdecl lrint (double); -extern long __cdecl lrintf (float); -extern long __cdecl lrintl (long double); - -extern long long __cdecl llrint (double); -extern long long __cdecl llrintf (float); -extern long long __cdecl llrintl (long double); - -/* Inline versions of above. - GCC 4.0+ can do a better fast-math job with __builtins. */ -#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) -__CRT_INLINE double __cdecl rint (double x) -{ - double retval; - __asm__ ("frndint;": "=t" (retval) : "0" (x)); - return retval; -} - -__CRT_INLINE float __cdecl rintf (float x) -{ - float retval; - __asm__ ("frndint;" : "=t" (retval) : "0" (x) ); - return retval; -} - -__CRT_INLINE long double __cdecl rintl (long double x) -{ - long double retval; - __asm__ ("frndint;" : "=t" (retval) : "0" (x) ); - return retval; -} - -__CRT_INLINE long __cdecl lrint (double x) -{ - long retval; - __asm__ __volatile__ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long __cdecl lrintf (float x) -{ - long retval; - __asm__ __volatile__ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long __cdecl lrintl (long double x) -{ - long retval; - __asm__ __volatile__ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long long __cdecl llrint (double x) -{ - long long retval; - __asm__ __volatile__ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long long __cdecl llrintf (float x) -{ - long long retval; - __asm__ __volatile__ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long long __cdecl llrintl (long double x) -{ - long long retval; - __asm__ __volatile__ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} -#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4,0) */ - -/* 7.12.9.6 */ -/* round away from zero, regardless of fpu control word settings */ -extern double __cdecl round (double); -extern float __cdecl roundf (float); -extern long double __cdecl roundl (long double); - -/* 7.12.9.7 */ -extern long __cdecl lround (double); -extern long __cdecl lroundf (float); -extern long __cdecl lroundl (long double); - -extern long long __cdecl llround (double); -extern long long __cdecl llroundf (float); -extern long long __cdecl llroundl (long double); - -/* 7.12.9.8 */ -/* round towards zero, regardless of fpu control word settings */ -extern double __cdecl trunc (double); -extern float __cdecl truncf (float); -extern long double __cdecl truncl (long double); - -/* 7.12.10.1 Double in C89 */ -extern float __cdecl fmodf (float, float); -extern long double __cdecl fmodl (long double, long double); - -/* 7.12.10.2 */ -extern double __cdecl remainder (double, double); -extern float __cdecl remainderf (float, float); -extern long double __cdecl remainderl (long double, long double); - -/* 7.12.10.3 */ -extern double __cdecl remquo(double, double, int *); -extern float __cdecl remquof(float, float, int *); -extern long double __cdecl remquol(long double, long double, int *); - -/* 7.12.11.1 */ -extern double __cdecl copysign (double, double); /* in libmoldname.a */ -extern float __cdecl copysignf (float, float); -extern long double __cdecl copysignl (long double, long double); - -/* 7.12.11.2 Return a NaN */ -extern double __cdecl nan(const char *tagp); -extern float __cdecl nanf(const char *tagp); -extern long double __cdecl nanl(const char *tagp); - -#ifndef __STRICT_ANSI__ -#define _nan() nan("") -#define _nanf() nanf("") -#define _nanl() nanl("") -#endif - -/* 7.12.11.3 */ -extern double __cdecl nextafter (double, double); /* in libmoldname.a */ -extern float __cdecl nextafterf (float, float); -extern long double __cdecl nextafterl (long double, long double); - -/* 7.12.11.4 The nexttoward functions */ -extern double __cdecl nexttoward (double, long double); -extern float __cdecl nexttowardf (float, long double); -extern long double __cdecl nexttowardl (long double, long double); - -/* 7.12.12.1 */ -/* x > y ? (x - y) : 0.0 */ -extern double __cdecl fdim (double x, double y); -extern float __cdecl fdimf (float x, float y); -extern long double __cdecl fdiml (long double x, long double y); - -/* fmax and fmin. - NaN arguments are treated as missing data: if one argument is a NaN - and the other numeric, then these functions choose the numeric - value. */ - -/* 7.12.12.2 */ -extern double __cdecl fmax (double, double); -extern float __cdecl fmaxf (float, float); -extern long double __cdecl fmaxl (long double, long double); - -/* 7.12.12.3 */ -extern double __cdecl fmin (double, double); -extern float __cdecl fminf (float, float); -extern long double __cdecl fminl (long double, long double); - -/* 7.12.13.1 */ -/* return x * y + z as a ternary op */ -extern double __cdecl fma (double, double, double); -extern float __cdecl fmaf (float, float, float); -extern long double __cdecl fmal (long double, long double, long double); - /* 7.12.14 */ -/* +/* * With these functions, comparisons involving quiet NaNs set the FP * condition code to "unordered". The IEEE floating-point spec * dictates that the result of floating-point comparisons should be - * false whenever a NaN is involved, with the exception of the != op, + * false whenever a NaN is involved, with the exception of the != op, * which always returns true: yes, (NaN != NaN) is true). */ @@ -834,15 +764,5 @@ __fp_unordered_compare (long double x, long double y){ #endif +#endif /* End _MATH_H_ */ -#endif /* __STDC_VERSION__ >= 199901L */ -#endif /* __NO_ISOCEXT */ - - -#ifdef __cplusplus -} -#endif -#endif /* Not RC_INVOKED */ - - -#endif /* Not _MATH_H_ */ diff --git a/reactos/include/crt/mbctype.h b/reactos/include/crt/mbctype.h index ffc9a3771f9..a30de52174d 100644 --- a/reactos/include/crt/mbctype.h +++ b/reactos/include/crt/mbctype.h @@ -1,97 +1,109 @@ -/* - * mbctype.h - * - * Functions for testing multibyte character types and converting characters. - * - * This file is part of the Mingw32 package. - * - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_MBCTYPE +#define _INC_MBCTYPE -#ifndef _MBCTYPE_H_ -#define _MBCTYPE_H_ - -/* All the headers include this file. */ #include <_mingw.h> - -/* return values for _mbsbtype and _mbbtype in mbstring.h */ -#define _MBC_SINGLE 0 -#define _MBC_LEAD 1 -#define _MBC_TRAIL 2 -#define _MBC_ILLEGAL (-1) - -/* args for setmbcp (in lieu of actual codepage) */ -#define _MB_CP_SBCS 0 -#define _MB_CP_OEM (-2) -#define _MB_CP_ANSI (-3) -#define _MB_CP_LOCALE (-4) - -#define _MS 0x01 -#define _MP 0x02 -#define _M1 0x04 -#define _M2 0x08 - -#define _SBUP 0x10 -#define _SBLOW 0x20 - - -#ifndef RC_INVOKED +#include #ifdef __cplusplus extern "C" { #endif -#ifndef __STRICT_ANSI__ - -_CRTIMP int __cdecl __MINGW_NOTHROW _setmbcp (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _getmbcp (void); - -/* byte classification */ -/* NB: Corresponding _ismbc* functions are in mbstring.h */ - -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbalpha (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbalnum (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbgraph (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbprint (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbpunct (unsigned int); - -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkana (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkalnum (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkprint (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkpunct (unsigned int); - - -/* these are also in mbstring.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbblead (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbtrail (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbslead (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbstrail (const unsigned char*, const unsigned char*); - -#ifdef __DECLSPEC_SUPPORTED -__MINGW_IMPORT unsigned char _mbctype[]; -__MINGW_IMPORT unsigned char _mbcasemap[]; + /* CRT stuff */ +#if 1 +#if defined (_DLL) && defined (_M_IX86) + /* Retained for compatibility with VC++ 5.0 and earlier versions */ + _CRTIMP unsigned char * __cdecl __p__mbctype(void); + _CRTIMP unsigned char * __cdecl __p__mbcasemap(void); +#endif /* defined (_DLL) && defined (_M_IX86) */ +#endif +#ifndef _mbctype +#ifdef _MSVCRT_ + extern unsigned char _mbctype[257]; +#else +#define _mbctype (*_imp___mbctype) + extern unsigned char **_imp___mbctype; +#endif +#endif +#ifndef _mbcasemap +#ifdef _MSVCRT_ + extern unsigned char *_mbcasemap; +#else +#define _mbcasemap (*_imp___mbcasemap) + extern unsigned char **_imp___mbcasemap; +#endif #endif -/* TODO : _MBCS_ mappings go in tchar.h */ + /* CRT stuff */ +#if 1 + extern pthreadmbcinfo __ptmbcinfo; + extern int __globallocalestatus; + extern int __locale_changed; + extern struct threadmbcinfostruct __initialmbcinfo; + pthreadmbcinfo __cdecl __updatetmbcinfo(void); +#endif -#endif /* Not strict ANSI */ +#define _MS 0x01 +#define _MP 0x02 +#define _M1 0x04 +#define _M2 0x08 + +#define _SBUP 0x10 +#define _SBLOW 0x20 + +#define _MBC_SINGLE 0 +#define _MBC_LEAD 1 +#define _MBC_TRAIL 2 +#define _MBC_ILLEGAL (-1) + +#define _KANJI_CP 932 + +#define _MB_CP_SBCS 0 +#define _MB_CP_OEM -2 +#define _MB_CP_ANSI -3 +#define _MB_CP_LOCALE -4 + +#ifndef _MBCTYPE_DEFINED +#define _MBCTYPE_DEFINED + + _CRTIMP int __cdecl _setmbcp(int _CodePage); + _CRTIMP int __cdecl _getmbcp(void); + _CRTIMP int __cdecl _ismbbkalnum(unsigned int _C); + _CRTIMP int __cdecl _ismbbkalnum_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbkana(unsigned int _C); + _CRTIMP int __cdecl _ismbbkana_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbkpunct(unsigned int _C); + _CRTIMP int __cdecl _ismbbkpunct_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbkprint(unsigned int _C); + _CRTIMP int __cdecl _ismbbkprint_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbalpha(unsigned int _C); + _CRTIMP int __cdecl _ismbbalpha_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbpunct(unsigned int _C); + _CRTIMP int __cdecl _ismbbpunct_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbalnum(unsigned int _C); + _CRTIMP int __cdecl _ismbbalnum_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbprint(unsigned int _C); + _CRTIMP int __cdecl _ismbbprint_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbgraph(unsigned int _C); + _CRTIMP int __cdecl _ismbbgraph_l(unsigned int _C,_locale_t _Locale); +#ifndef _MBLEADTRAIL_DEFINED +#define _MBLEADTRAIL_DEFINED + _CRTIMP int __cdecl _ismbblead(unsigned int _C); + _CRTIMP int __cdecl _ismbblead_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbtrail(unsigned int _C); + _CRTIMP int __cdecl _ismbbtrail_l(unsigned int _C,_locale_t _Locale); + _CRTIMP int __cdecl _ismbslead(const unsigned char *_Str,const unsigned char *_Pos); + _CRTIMP int __cdecl _ismbslead_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale); + _CRTIMP int __cdecl _ismbstrail(const unsigned char *_Str,const unsigned char *_Pos); + _CRTIMP int __cdecl _ismbstrail_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale); +#endif +#endif #ifdef __cplusplus } #endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _MCTYPE_H_ */ - - +#endif diff --git a/reactos/include/crt/mbstring.h b/reactos/include/crt/mbstring.h index 4428b60a651..d5363b1317c 100644 --- a/reactos/include/crt/mbstring.h +++ b/reactos/include/crt/mbstring.h @@ -1,133 +1,212 @@ -/* - * mbstring.h - * - * Protototypes for string functions supporting multibyte characters. - * - * This file is part of the Mingw32 package. - * - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_MBSTRING +#define _INC_MBSTRING -#ifndef _MBSTRING_H_ -#define _MBSTRING_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#ifndef RC_INVOKED - -#define __need_size_t -#include +#pragma pack(push,_CRT_PACKING) #ifdef __cplusplus extern "C" { #endif -#ifndef __STRICT_ANSI__ +#ifndef _FILE_DEFINED + struct _iobuf { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _charbuf; + int _bufsiz; + char *_tmpfname; + }; + typedef struct _iobuf FILE; +#define _FILE_DEFINED +#endif -/* character classification */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcalnum (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcalpha (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcdigit (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcgraph (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcprint (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcpunct (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcspace (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbclower (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcupper (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbclegal (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcsymbol (unsigned int); +#ifndef _MBSTRING_DEFINED +#define _MBSTRING_DEFINED + _CRTIMP unsigned char *__cdecl _mbsdup(const unsigned char *_Str); + _CRTIMP unsigned int __cdecl _mbbtombc(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbbtombc_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _mbbtype(unsigned char _Ch,int _CType); + _CRTIMP int __cdecl _mbbtype_l(unsigned char _Ch,int _CType,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbctombb(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbctombb_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _mbsbtype(const unsigned char *_Str,size_t _Pos); + _CRTIMP int __cdecl _mbsbtype_l(const unsigned char *_Str,size_t _Pos,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbscat(unsigned char *_Dest,const unsigned char *_Source); + _CRTIMP unsigned char *_mbscat_l(unsigned char *_Dest,const unsigned char *_Source,_locale_t _Locale); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbschr(const unsigned char *_Str,unsigned int _Ch); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbschr_l(const unsigned char *_Str,unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _mbscmp(const unsigned char *_Str1,const unsigned char *_Str2); + _CRTIMP int __cdecl _mbscmp_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _mbscoll(const unsigned char *_Str1,const unsigned char *_Str2); + _CRTIMP int __cdecl _mbscoll_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbscpy(unsigned char *_Dest,const unsigned char *_Source); + _CRTIMP unsigned char *_mbscpy_l(unsigned char *_Dest,const unsigned char *_Source,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbscspn(const unsigned char *_Str,const unsigned char *_Control); + _CRTIMP size_t __cdecl _mbscspn_l(const unsigned char *_Str,const unsigned char *_Control,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsdec(const unsigned char *_Start,const unsigned char *_Pos); + _CRTIMP unsigned char *__cdecl _mbsdec_l(const unsigned char *_Start,const unsigned char *_Pos,_locale_t _Locale); + _CRTIMP int __cdecl _mbsicmp(const unsigned char *_Str1,const unsigned char *_Str2); + _CRTIMP int __cdecl _mbsicmp_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _mbsicoll(const unsigned char *_Str1,const unsigned char *_Str2); + _CRTIMP int __cdecl _mbsicoll_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsinc(const unsigned char *_Ptr); + _CRTIMP unsigned char *__cdecl _mbsinc_l(const unsigned char *_Ptr,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbslen(const unsigned char *_Str); + _CRTIMP size_t __cdecl _mbslen_l(const unsigned char *_Str,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbsnlen(const unsigned char *_Str,size_t _MaxCount); + _CRTIMP size_t __cdecl _mbsnlen_l(const unsigned char *_Str,size_t _MaxCount,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbslwr(unsigned char *_String); + _CRTIMP unsigned char *_mbslwr_l(unsigned char *_String,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsnbcat(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); + _CRTIMP unsigned char *__cdecl _mbsnbcat_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); + _CRTIMP int __cdecl _mbsnbcmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsnbcmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _mbsnbcoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsnbcoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbsnbcnt(const unsigned char *_Str,size_t _MaxCount); + _CRTIMP size_t __cdecl _mbsnbcnt_l(const unsigned char *_Str,size_t _MaxCount,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsnbcpy(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); + _CRTIMP unsigned char *__cdecl _mbsnbcpy_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); + _CRTIMP int __cdecl _mbsnbicmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsnbicmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _mbsnbicoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsnbicoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsnbset(unsigned char *_Str,unsigned int _Ch,size_t _MaxCount); + _CRTIMP unsigned char *__cdecl _mbsnbset_l(unsigned char *_Str,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsncat(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); + _CRTIMP unsigned char *__cdecl _mbsncat_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbsnccnt(const unsigned char *_Str,size_t _MaxCount); + _CRTIMP size_t __cdecl _mbsnccnt_l(const unsigned char *_Str,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _mbsncmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsncmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _mbsncoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsncoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsncpy(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); + _CRTIMP unsigned char *__cdecl _mbsncpy_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbsnextc (const unsigned char *_Str); + _CRTIMP unsigned int __cdecl _mbsnextc_l(const unsigned char *_Str,_locale_t _Locale); + _CRTIMP int __cdecl _mbsnicmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsnicmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _mbsnicoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _mbsnicoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsninc(const unsigned char *_Str,size_t _Count); + _CRTIMP unsigned char *__cdecl _mbsninc_l(const unsigned char *_Str,size_t _Count,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsnset(unsigned char *_Dst,unsigned int _Val,size_t _MaxCount); + _CRTIMP unsigned char *__cdecl _mbsnset_l(unsigned char *_Dst,unsigned int _Val,size_t _MaxCount,_locale_t _Locale); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbspbrk(const unsigned char *_Str,const unsigned char *_Control); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbspbrk_l(const unsigned char *_Str,const unsigned char *_Control,_locale_t _Locale); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsrchr(const unsigned char *_Str,unsigned int _Ch); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsrchr_l(const unsigned char *_Str,unsigned int _Ch,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsrev(unsigned char *_Str); + _CRTIMP unsigned char *__cdecl _mbsrev_l(unsigned char *_Str,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsset(unsigned char *_Str,unsigned int _Val); + _CRTIMP unsigned char *__cdecl _mbsset_l(unsigned char *_Str,unsigned int _Val,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbsspn(const unsigned char *_Str,const unsigned char *_Control); + _CRTIMP size_t __cdecl _mbsspn_l(const unsigned char *_Str,const unsigned char *_Control,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsspnp(const unsigned char *_Str1,const unsigned char *_Str2); + _CRTIMP unsigned char *__cdecl _mbsspnp_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsstr(const unsigned char *_Str,const unsigned char *_Substr); + _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsstr_l(const unsigned char *_Str,const unsigned char *_Substr,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbstok(unsigned char *_Str,const unsigned char *_Delim); + _CRTIMP unsigned char *__cdecl _mbstok_l(unsigned char *_Str,const unsigned char *_Delim,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbsupr(unsigned char *_String); + _CRTIMP unsigned char *_mbsupr_l(unsigned char *_String,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbclen(const unsigned char *_Str); + _CRTIMP size_t __cdecl _mbclen_l(const unsigned char *_Str,_locale_t _Locale); + _CRTIMP void __cdecl _mbccpy(unsigned char *_Dst,const unsigned char *_Src); + _CRTIMP void __cdecl _mbccpy_l(unsigned char *_Dst,const unsigned char *_Src,_locale_t _Locale); +#define _mbccmp(_cpc1,_cpc2) _mbsncmp((_cpc1),(_cpc2),1) +#ifdef __cplusplus +#ifndef _CPP_MBCS_INLINES_DEFINED +#define _CPP_MBCS_INLINES_DEFINED + extern "C++" { + static inline unsigned char *__cdecl _mbschr(unsigned char *_String,unsigned int _Char) { return ((unsigned char *)_mbschr((const unsigned char *)_String,_Char)); } + static inline unsigned char *__cdecl _mbschr_l(unsigned char *_String,unsigned int _Char,_locale_t _Locale) { return ((unsigned char *)_mbschr_l((const unsigned char *)_String,_Char,_Locale)); } + static inline unsigned char *__cdecl _mbspbrk(unsigned char *_String,const unsigned char *_CharSet) { return ((unsigned char *)_mbspbrk((const unsigned char *)_String,_CharSet)); } + static inline unsigned char *__cdecl _mbspbrk_l(unsigned char *_String,const unsigned char *_CharSet,_locale_t _Locale) { return ((unsigned char *)_mbspbrk_l((const unsigned char *)_String,_CharSet,_Locale)); } + static inline unsigned char *__cdecl _mbsrchr(unsigned char *_String,unsigned int _Char) { return ((unsigned char *)_mbsrchr((const unsigned char *)_String,_Char)); } + static inline unsigned char *__cdecl _mbsrchr_l(unsigned char *_String,unsigned int _Char,_locale_t _Locale) { return ((unsigned char *)_mbsrchr_l((const unsigned char *)_String,_Char,_Locale)); } + static inline unsigned char *__cdecl _mbsstr(unsigned char *_String,const unsigned char *_Match) { return ((unsigned char *)_mbsstr((const unsigned char *)_String,_Match)); } + static inline unsigned char *__cdecl _mbsstr_l(unsigned char *_String,const unsigned char *_Match,_locale_t _Locale) { return ((unsigned char *)_mbsstr_l((const unsigned char *)_String,_Match,_Locale)); } + } +#endif +#endif -/* also in mbctype.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbblead (unsigned int ); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbtrail (unsigned int ); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbslead ( const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbstrail ( const unsigned char*, const unsigned char*); + _CRTIMP int __cdecl _ismbcalnum(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcalnum_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcalpha(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcalpha_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcdigit(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcdigit_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcgraph(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcgraph_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbclegal(unsigned int _Ch); + _CRTIMP int __cdecl _ismbclegal_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbclower(unsigned int _Ch); + _CRTIMP int __cdecl _ismbclower_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcprint(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcprint_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcpunct(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcpunct_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcspace(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcspace_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcupper(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcupper_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbctolower(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbctolower_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbctoupper(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbctoupper_l(unsigned int _Ch,_locale_t _Locale); +#endif -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctolower (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctoupper (unsigned int); +#ifndef _MBLEADTRAIL_DEFINED +#define _MBLEADTRAIL_DEFINED + _CRTIMP int __cdecl _ismbblead(unsigned int _Ch); + _CRTIMP int __cdecl _ismbblead_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbbtrail(unsigned int _Ch); + _CRTIMP int __cdecl _ismbbtrail_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbslead(const unsigned char *_Str,const unsigned char *_Pos); + _CRTIMP int __cdecl _ismbslead_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale); + _CRTIMP int __cdecl _ismbstrail(const unsigned char *_Str,const unsigned char *_Pos); + _CRTIMP int __cdecl _ismbstrail_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale); +#endif -_CRTIMP void __cdecl __MINGW_NOTHROW _mbccpy (unsigned char*, const unsigned char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbclen (const unsigned char*); - -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbbtombc (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctombb (unsigned int); - -/* Return value constants for these are defined in mbctype.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _mbbtype (unsigned char, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsbtype (const unsigned char*, size_t); - -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbscpy (unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsncpy (unsigned char*, const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnbcpy (unsigned char*, const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsset (unsigned char*, unsigned int); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnset (unsigned char*, unsigned int, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnbset (unsigned char*, unsigned int, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsdup (const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsrev (unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbscat (unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsncat (unsigned char*, const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnbcat (unsigned char*, const unsigned char*, size_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbslen (const unsigned char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbsnbcnt (const unsigned char*, size_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbsnccnt (const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbschr (const unsigned char*, unsigned int); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsrchr (const unsigned char*, unsigned int); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbsspn (const unsigned char*, const unsigned char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbscspn (const unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsspnp (const unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbspbrk (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbscmp (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsicmp (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsncmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnicmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbcmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbicmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbscoll (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsicoll (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsncoll (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnicoll (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbcoll (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbicoll (const unsigned char*, const unsigned char*, size_t); - -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsinc (const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsninc (const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsdec (const unsigned char*, const unsigned char*); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbsnextc (const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbslwr (unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsupr (unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbstok (unsigned char*, const unsigned char*); - -/* Kanji */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbchira (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbckata (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcl0 (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcl1 (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcl2 (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbcjistojms (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbcjmstojis (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctohira (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctokata (unsigned int); - -#endif /* Not strict ANSI */ + _CRTIMP int __cdecl _ismbchira(unsigned int _Ch); + _CRTIMP int __cdecl _ismbchira_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbckata(unsigned int _Ch); + _CRTIMP int __cdecl _ismbckata_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcsymbol(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcsymbol_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcl0(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcl0_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcl1(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcl1_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP int __cdecl _ismbcl2(unsigned int _Ch); + _CRTIMP int __cdecl _ismbcl2_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbcjistojms(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbcjistojms_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbcjmstojis(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbcjmstojis_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbctohira(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbctohira_l(unsigned int _Ch,_locale_t _Locale); + _CRTIMP unsigned int __cdecl _mbctokata(unsigned int _Ch); + _CRTIMP unsigned int __cdecl _mbctokata_l(unsigned int _Ch,_locale_t _Locale); #ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ -#endif /* Not _MBSTRING_H_ */ - +#pragma pack(pop) +#include +#endif diff --git a/reactos/include/crt/mem.h b/reactos/include/crt/mem.h index 451de0cd47e..255202359a9 100644 --- a/reactos/include/crt/mem.h +++ b/reactos/include/crt/mem.h @@ -1,6 +1,13 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* * This file is part of the Mingw32 package. * * mem.h maps to string.h */ +#ifndef __STRICT_ANSI__ #include +#endif diff --git a/reactos/include/crt/memory.h b/reactos/include/crt/memory.h index 9ba65cf690e..90d88aeddf9 100644 --- a/reactos/include/crt/memory.h +++ b/reactos/include/crt/memory.h @@ -1,7 +1,40 @@ -/* - * This file is part of the Mingw32 package. - * - * memory.h maps to the standard string.h header. +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_MEMORY +#define _INC_MEMORY -#include +#include <_mingw.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _CONST_RETURN +#define _CONST_RETURN +#endif + +#define _WConst_return _CONST_RETURN + +#ifndef _CRT_MEMORY_DEFINED +#define _CRT_MEMORY_DEFINED + _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount); + _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount); + _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); + _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale); + int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size); + void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size); + void *__cdecl memset(void *_Dst,int _Val,size_t _Size); + +#ifndef NO_OLDNAMES + void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size); + int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); +#endif +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/reactos/include/crt/mingw32/crtdbg.h b/reactos/include/crt/mingw32/crtdbg.h new file mode 100644 index 00000000000..797998a0cf0 --- /dev/null +++ b/reactos/include/crt/mingw32/crtdbg.h @@ -0,0 +1,212 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#include <_mingw.h> + +#ifndef _INC_CRTDBG +#define _INC_CRTDBG + +#pragma pack(push,_CRT_PACKING) + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + typedef void *_HFILE; + +#define _CRT_WARN 0 +#define _CRT_ERROR 1 +#define _CRT_ASSERT 2 +#define _CRT_ERRCNT 3 + +#define _CRTDBG_MODE_FILE 0x1 +#define _CRTDBG_MODE_DEBUG 0x2 +#define _CRTDBG_MODE_WNDW 0x4 +#define _CRTDBG_REPORT_MODE -1 + +#define _CRTDBG_INVALID_HFILE ((_HFILE)-1) +#define _CRTDBG_HFILE_ERROR ((_HFILE)-2) +#define _CRTDBG_FILE_STDOUT ((_HFILE)-4) +#define _CRTDBG_FILE_STDERR ((_HFILE)-5) +#define _CRTDBG_REPORT_FILE ((_HFILE)-6) + + typedef int (__cdecl *_CRT_REPORT_HOOK)(int,char *,int *); + typedef int (__cdecl *_CRT_REPORT_HOOKW)(int,wchar_t *,int *); + +#define _CRT_RPTHOOK_INSTALL 0 +#define _CRT_RPTHOOK_REMOVE 1 + +#define _HOOK_ALLOC 1 +#define _HOOK_REALLOC 2 +#define _HOOK_FREE 3 + + typedef int (__cdecl *_CRT_ALLOC_HOOK)(int,void *,size_t,int,long,const unsigned char *,int); + +#define _CRTDBG_ALLOC_MEM_DF 0x01 +#define _CRTDBG_DELAY_FREE_MEM_DF 0x02 +#define _CRTDBG_CHECK_ALWAYS_DF 0x04 +#define _CRTDBG_RESERVED_DF 0x08 +#define _CRTDBG_CHECK_CRT_DF 0x10 +#define _CRTDBG_LEAK_CHECK_DF 0x20 + +#define _CRTDBG_CHECK_EVERY_16_DF 0x00100000 +#define _CRTDBG_CHECK_EVERY_128_DF 0x00800000 +#define _CRTDBG_CHECK_EVERY_1024_DF 0x04000000 + +#define _CRTDBG_CHECK_DEFAULT_DF 0 + +#define _CRTDBG_REPORT_FLAG -1 + +#define _BLOCK_TYPE(block) (block & 0xFFFF) +#define _BLOCK_SUBTYPE(block) (block >> 16 & 0xFFFF) + +#define _FREE_BLOCK 0 +#define _NORMAL_BLOCK 1 +#define _CRT_BLOCK 2 +#define _IGNORE_BLOCK 3 +#define _CLIENT_BLOCK 4 +#define _MAX_BLOCKS 5 + + typedef void (__cdecl *_CRT_DUMP_CLIENT)(void *,size_t); + + struct _CrtMemBlockHeader; + + typedef struct _CrtMemState { + struct _CrtMemBlockHeader *pBlockHeader; + size_t lCounts[_MAX_BLOCKS]; + size_t lSizes[_MAX_BLOCKS]; + size_t lHighWaterCount; + size_t lTotalCount; + } _CrtMemState; + +#ifndef _STATIC_ASSERT +#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)] +#endif + +#ifndef _ASSERT +#define _ASSERT(expr) ((void)0) +#endif + +#ifndef _ASSERTE +#define _ASSERTE(expr) ((void)0) +#endif + +#ifndef _ASSERT_EXPR +#define _ASSERT_EXPR(expr,expr_str) ((void)0) +#endif + +#ifndef _ASSERT_BASE +#define _ASSERT_BASE _ASSERT_EXPR +#endif + +#define _RPT0(rptno,msg) +#define _RPTW0(rptno,msg) + +#define _RPT1(rptno,msg,arg1) +#define _RPTW1(rptno,msg,arg1) +#define _RPT2(rptno,msg,arg1,arg2) +#define _RPTW2(rptno,msg,arg1,arg2) +#define _RPT3(rptno,msg,arg1,arg2,arg3) +#define _RPTW3(rptno,msg,arg1,arg2,arg3) +#define _RPT4(rptno,msg,arg1,arg2,arg3,arg4) +#define _RPTW4(rptno,msg,arg1,arg2,arg3,arg4) +#define _RPTF0(rptno,msg) +#define _RPTFW0(rptno,msg) +#define _RPTF1(rptno,msg,arg1) +#define _RPTFW1(rptno,msg,arg1) +#define _RPTF2(rptno,msg,arg1,arg2) +#define _RPTFW2(rptno,msg,arg1,arg2) +#define _RPTF3(rptno,msg,arg1,arg2,arg3) +#define _RPTFW3(rptno,msg,arg1,arg2,arg3) +#define _RPTF4(rptno,msg,arg1,arg2,arg3,arg4) +#define _RPTFW4(rptno,msg,arg1,arg2,arg3,arg4) + +#define _malloc_dbg(s,t,f,l) malloc(s) +#define _calloc_dbg(c,s,t,f,l) calloc(c,s) +#define _realloc_dbg(p,s,t,f,l) realloc(p,s) +#define _recalloc_dbg(p,c,s,t,f,l) _recalloc(p,c,s) +#define _expand_dbg(p,s,t,f,l) _expand(p,s) +#define _free_dbg(p,t) free(p) +#define _msize_dbg(p,t) _msize(p) + +#define _aligned_malloc_dbg(s,a,f,l) _aligned_malloc(s,a) +#define _aligned_realloc_dbg(p,s,a,f,l) _aligned_realloc(p,s,a) +#define _aligned_recalloc_dbg(p,c,s,a,f,l) _aligned_realloc(p,c,s,a) +#define _aligned_free_dbg(p) _aligned_free(p) +#define _aligned_offset_malloc_dbg(s,a,o,f,l) _aligned_offset_malloc(s,a,o) +#define _aligned_offset_realloc_dbg(p,s,a,o,f,l) _aligned_offset_realloc(p,s,a,o) +#define _aligned_offset_recalloc_dbg(p,c,s,a,o,f,l) _aligned_offset_recalloc(p,c,s,a,o) + +#define _malloca_dbg(s,t,f,l) _malloca(s) +#define _freea_dbg(p,t) _freea(p) + +#define _strdup_dbg(s,t,f,l) _strdup(s) +#define _wcsdup_dbg(s,t,f,l) _wcsdup(s) +#define _mbsdup_dbg(s,t,f,l) _mbsdup(s) +#define _tempnam_dbg(s1,s2,t,f,l) _tempnam(s1,s2) +#define _wtempnam_dbg(s1,s2,t,f,l) _wtempnam(s1,s2) +#define _fullpath_dbg(s1,s2,le,t,f,l) _fullpath(s1,s2,le) +#define _wfullpath_dbg(s1,s2,le,t,f,l) _wfullpath(s1,s2,le) +#define _getcwd_dbg(s,le,t,f,l) _getcwd(s,le) +#define _wgetcwd_dbg(s,le,t,f,l) _wgetcwd(s,le) +#define _getdcwd_dbg(d,s,le,t,f,l) _getdcwd(d,s,le) +#define _wgetdcwd_dbg(d,s,le,t,f,l) _wgetdcwd(d,s,le) +#define _getdcwd_lk_dbg(d,s,le,t,f,l) _getdcwd_nolock(d,s,le) +#define _wgetdcwd_lk_dbg(d,s,le,t,f,l) _wgetdcwd_nolock(d,s,le) + +#define _CrtSetReportHook(f) ((_CRT_REPORT_HOOK)0) +#define _CrtGetReportHook() ((_CRT_REPORT_HOOK)0) +#define _CrtSetReportHook2(t,f) ((int)0) +#define _CrtSetReportHookW2(t,f) ((int)0) +#define _CrtSetReportMode(t,f) ((int)0) +#define _CrtSetReportFile(t,f) ((_HFILE)0) + +#define _CrtDbgBreak() ((void)0) + +#define _CrtSetBreakAlloc(a) ((long)0) +#define _CrtSetAllocHook(f) ((_CRT_ALLOC_HOOK)0) +#define _CrtGetAllocHook() ((_CRT_ALLOC_HOOK)0) +#define _CrtCheckMemory() ((int)1) +#define _CrtSetDbgFlag(f) ((int)0) +#define _CrtDoForAllClientObjects(f,c) ((void)0) +#define _CrtIsValidPointer(p,n,r) ((int)1) +#define _CrtIsValidHeapPointer(p) ((int)1) +#define _CrtIsMemoryBlock(p,t,r,f,l) ((int)1) +#define _CrtReportBlockType(p) ((int)-1) +#define _CrtSetDumpClient(f) ((_CRT_DUMP_CLIENT)0) +#define _CrtGetDumpClient() ((_CRT_DUMP_CLIENT)0) +#define _CrtMemCheckpoint(s) ((void)0) +#define _CrtMemDifference(s1,s2,s3) ((int)0) +#define _CrtMemDumpAllObjectsSince(s) ((void)0) +#define _CrtMemDumpStatistics(s) ((void)0) +#define _CrtDumpMemoryLeaks() ((int)0) +#define _CrtSetDebugFillThreshold(t) ((size_t)0) +#define _CrtSetCheckCount(f) ((int)0) +#define _CrtGetCheckCount() ((int)0) + +#ifdef __cplusplus +} + + void *__cdecl operator new[](size_t _Size); + inline void *__cdecl operator new(size_t _Size,int,const char *,int) { return ::operator new(_Size); } + inline void *__cdecl operator new[](size_t _Size,int,const char *,int) { return ::operator new[](_Size); } + void __cdecl operator delete[](void *); + inline void __cdecl operator delete(void *_P,int,const char *,int) { ::operator delete(_P); } + inline void __cdecl operator delete[](void *_P,int,const char *,int) { ::operator delete[](_P); } +#endif + +#pragma pack(pop) + +#include + +#endif diff --git a/reactos/include/crt/mingw32/stdarg.h b/reactos/include/crt/mingw32/stdarg.h index 55450553821..4e6490b3551 100644 --- a/reactos/include/crt/mingw32/stdarg.h +++ b/reactos/include/crt/mingw32/stdarg.h @@ -28,6 +28,12 @@ Boston, MA 02110-1301, USA. */ * ISO C Standard: 7.15 Variable arguments */ +#ifndef _INC_STDARG +#define _INC_STDARG +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif + #ifndef _STDARG_H #ifndef _ANSI_STDARG_H_ #ifndef __need___va_list @@ -58,7 +64,7 @@ typedef __builtin_va_list __gnuc_va_list; /* Define va_list, if desired, from __gnuc_va_list. */ /* We deliberately do not define va_list when called from stdio.h, because ANSI C says that stdio.h is not supposed to define - va_list. stdio.h needs to have access to that data type, + va_list. stdio.h needs to have access to that data type, but must not use that name. It should use the name __gnuc_va_list, which is safe because it is reserved for the implementation. */ @@ -131,3 +137,17 @@ typedef __gnuc_va_list va_list; #endif /* not _ANSI_STDARG_H_ */ #endif /* not _STDARG_H */ + +#include + +#ifndef va_start +#define va_start _crt_va_start +#endif +#ifndef va_arg +#define va_arg _crt_va_arg +#endif +#ifndef va_end +#define va_end _crt_va_end +#endif + +#endif diff --git a/reactos/include/crt/mingw32/stddef.h b/reactos/include/crt/mingw32/stddef.h index 8102a5fc386..60b6a28bb0c 100644 --- a/reactos/include/crt/mingw32/stddef.h +++ b/reactos/include/crt/mingw32/stddef.h @@ -1,29 +1,35 @@ -/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002, 2004 - Free Software Foundation, Inc. +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ -This file is part of GCC. +#include <_mingw.h> -GCC 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, or (at your option) -any later version. +#ifndef _INC_STDDEF +#define _INC_STDDEF -GCC 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. +#ifdef __cplusplus +extern "C" { +#endif -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +#ifndef _CRT_ERRNO_DEFINED +#define _CRT_ERRNO_DEFINED + _CRTIMP extern int *__cdecl _errno(void); +#define errno (*_errno()) + errno_t __cdecl _set_errno(int _Value); + errno_t __cdecl _get_errno(int *_Value); +#endif -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ + _CRTIMP extern unsigned long __cdecl __threadid(void); +#define _threadid (__threadid()) + _CRTIMP extern uintptr_t __cdecl __threadhandle(void); + +#ifdef __cplusplus +} +#endif + +#endif /* * ISO C Standard: 7.17 Common definitions @@ -49,19 +55,6 @@ Boston, MA 02110-1301, USA. */ #endif #ifndef __sys_stdtypes_h -/* This avoids lossage on SunOS but only if stdtypes.h comes first. - There's no way to win with the other order! Sun lossage. */ - -/* On 4.3bsd-net2, make sure ansi.h is included, so we have - one less case to deal with in the following. */ -#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) -#include -#endif -/* On FreeBSD 5, machine/ansi.h does not exist anymore... */ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -#include -#endif - /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are defined if the corresponding type is *not* defined. FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */ @@ -147,9 +140,12 @@ _TYPE_wchar_t; #define ___int_ptrdiff_t_h #define _GCC_PTRDIFF_T #ifndef __PTRDIFF_TYPE__ -#define __PTRDIFF_TYPE__ long int +#define __PTRDIFF_TYPE__ long long int #endif +#ifndef _PTRDIFF_T_DEFINED +#define _PTRDIFF_T_DEFINED typedef __PTRDIFF_TYPE__ ptrdiff_t; +#endif #endif /* _GCC_PTRDIFF_T */ #endif /* ___int_ptrdiff_t_h */ #endif /* _BSD_PTRDIFF_T_ */ @@ -208,7 +204,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; #define __size_t #endif #ifndef __SIZE_TYPE__ -#define __SIZE_TYPE__ long unsigned int +#define __SIZE_TYPE__ long long unsigned int #endif #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; @@ -283,7 +279,7 @@ typedef long ssize_t; symbols in the _FOO_T_ family, stays defined even after its corresponding type is defined). If we define wchar_t, then we must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if - we undef _WCHAR_T_, then we must also define rune_t, since + we undef _WCHAR_T_, then we must also define rune_t, since headers like runetype.h assume that if machine/ansi.h is included, and _BSD_WCHAR_T_ is not defined, then rune_t is available. machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of @@ -305,22 +301,9 @@ typedef _BSD_RUNE_T_ rune_t; #endif #endif #endif -/* FreeBSD 5 can't be handled well using "traditional" logic above - since it no longer defines _BSD_RUNE_T_ yet still desires to export - rune_t in some cases... */ -#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) -#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) -#if __BSD_VISIBLE -#ifndef _RUNE_T_DECLARED -typedef __rune_t rune_t; -#define _RUNE_T_DECLARED -#endif -#endif -#endif -#endif #ifndef __WCHAR_TYPE__ -#define __WCHAR_TYPE__ int +#define __WCHAR_TYPE__ unsigned short #endif #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; @@ -345,18 +328,6 @@ typedef __WCHAR_TYPE__ wchar_t; #undef __need_wchar_t #endif /* _STDDEF_H or __need_wchar_t. */ -#if defined (__need_wint_t) -#ifndef _WINT_T -#define _WINT_T - -#ifndef __WINT_TYPE__ -#define __WINT_TYPE__ unsigned int -#endif -typedef __WINT_TYPE__ wint_t; -#endif -#undef __need_wint_t -#endif - /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. are already defined. */ /* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ diff --git a/reactos/include/crt/mingw32/vadefs.h b/reactos/include/crt/mingw32/vadefs.h new file mode 100644 index 00000000000..eae1a2e5764 --- /dev/null +++ b/reactos/include/crt/mingw32/vadefs.h @@ -0,0 +1,85 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_VADEFS +#define _INC_VADEFS + +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif + +#include <_mingw.h> + +#undef _CRT_PACKING +#define _CRT_PACKING 8 +#pragma pack(push,_CRT_PACKING) + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifndef __uintptr_t_defined +#define __uintptr_t_defined +#undef uintptr_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef unsigned int uintptr_t __attribute__ ((mode (DI))); +#else + typedef unsigned __int64 uintptr_t; +#endif +#else + typedef unsigned long uintptr_t; +#endif +#endif +#endif + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + typedef __builtin_va_list __gnuc_va_list; +#endif + +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED + typedef __gnuc_va_list va_list; +#endif + +#ifdef __cplusplus +#define _ADDRESSOF(v) (&reinterpret_cast(v)) +#else +#define _ADDRESSOF(v) (&(v)) +#endif + +#if defined(__ia64__) +#define _VA_ALIGN 8 +#define _SLOTSIZEOF(t) ((sizeof(t) + _VA_ALIGN - 1) & ~(_VA_ALIGN - 1)) + +#define _VA_STRUCT_ALIGN 16 + +#define _ALIGNOF(ap) ((((ap)+_VA_STRUCT_ALIGN - 1) & ~(_VA_STRUCT_ALIGN -1)) - (ap)) +#define _APALIGN(t,ap) (__alignof(t) > 8 ? _ALIGNOF((uintptr_t) ap) : 0) +#else +#define _SLOTSIZEOF(t) (sizeof(t)) +#define _APALIGN(t,ap) (__alignof(t)) +#endif + +#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L +#define va_copy(d,s) __builtin_va_copy(d,s) +#endif +#define __va_copy(d,s) __builtin_va_copy(d,s) + +#define _INTSIZEOF(n) ((sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1)) + +#define _crt_va_start(v,l) __builtin_va_start(v,l) +#define _crt_va_arg(v,l) __builtin_va_arg(v,l) +#define _crt_va_end(v) __builtin_va_end(v) + +#ifdef __cplusplus +} +#endif + +#pragma pack(pop) +#endif diff --git a/reactos/include/crt/process.h b/reactos/include/crt/process.h index c57014baafe..f5ceabd0029 100644 --- a/reactos/include/crt/process.h +++ b/reactos/include/crt/process.h @@ -1,140 +1,176 @@ -/* - * process.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Function calls for spawning child processes. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_PROCESS +#define _INC_PROCESS -#ifndef _PROCESS_H_ -#define _PROCESS_H_ - -/* All the headers include this file. */ #include <_mingw.h> /* Includes a definition of _pid_t and pid_t */ #include -#include - -/* - * Constants for cwait actions. - * Obsolete for Win32. - */ -#define _WAIT_CHILD 0 -#define _WAIT_GRANDCHILD 1 - -#ifndef _NO_OLDNAMES -#define WAIT_CHILD _WAIT_CHILD -#define WAIT_GRANDCHILD _WAIT_GRANDCHILD -#endif /* Not _NO_OLDNAMES */ - -/* - * Mode constants for spawn functions. - */ -#define _P_WAIT 0 -#define _P_NOWAIT 1 -#define _P_OVERLAY 2 -#define _OLD_P_OVERLAY _P_OVERLAY -#define _P_NOWAITO 3 -#define _P_DETACH 4 - -#ifndef _NO_OLDNAMES -#define P_WAIT _P_WAIT -#define P_NOWAIT _P_NOWAIT -#define P_OVERLAY _P_OVERLAY -#define OLD_P_OVERLAY _OLD_P_OVERLAY -#define P_NOWAITO _P_NOWAITO -#define P_DETACH _P_DETACH -#endif /* Not _NO_OLDNAMES */ - - -#ifndef RC_INVOKED - -#ifdef __cplusplus +#ifndef _POSIX_ +#ifdef __cplusplus extern "C" { #endif -_CRTIMP void __cdecl __MINGW_NOTHROW _cexit(void); -_CRTIMP void __cdecl __MINGW_NOTHROW _c_exit(void); +#define _P_WAIT 0 +#define _P_NOWAIT 1 +#define _OLD_P_OVERLAY 2 +#define _P_NOWAITO 3 +#define _P_DETACH 4 +#define _P_OVERLAY 2 -_CRTIMP int __cdecl __MINGW_NOTHROW _cwait (int*, _pid_t, int); +#define _WAIT_CHILD 0 +#define _WAIT_GRANDCHILD 1 -_CRTIMP _pid_t __cdecl __MINGW_NOTHROW _getpid(void); + _CRTIMP uintptr_t __cdecl _beginthread(void (__cdecl *_StartAddress) (void *),unsigned _StackSize,void *_ArgList); + _CRTIMP void __cdecl _endthread(void); + _CRTIMP uintptr_t __cdecl _beginthreadex(void *_Security,unsigned _StackSize,unsigned (__stdcall *_StartAddress) (void *),void *_ArgList,unsigned _InitFlag,unsigned *_ThrdAddr); + _CRTIMP void __cdecl _endthreadex(unsigned _Retval); -_CRTIMP int __cdecl __MINGW_NOTHROW _execl (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _execle (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _execlp (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _execlpe (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _execv (const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW _execve (const char*, const char* const*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW _execvp (const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW _execvpe (const char*, const char* const*, const char* const*); +#ifndef _CRT_TERMINATE_DEFINED +#define _CRT_TERMINATE_DEFINED + __declspec(noreturn) void __cdecl exit(int _Code); + _CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnl (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnle (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnlp (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnlpe (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnv (int, const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnve (int, const char*, const char* const*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnvp (int, const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW _spawnvpe (int, const char*, const char* const*, const char* const*); - - -/* - * The functions _beginthreadex and _endthreadex are not provided by CRTDLL. - * They are provided by MSVCRT. - * - * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread, - * making for race conditions if you are not careful. Basically you have to - * make sure that no-one is going to do *anything* with the thread handle - * after the thread calls _endthread or returns from the thread function. - * - * NOTE: No old names for these functions. Use the underscore. - */ -_CRTIMP uintptr_t __cdecl __MINGW_NOTHROW - _beginthread (void (*)(void *), unsigned, void*); -_CRTIMP void __cdecl __MINGW_NOTHROW _endthread (void); - -#ifdef __MSVCRT__ -_CRTIMP uintptr_t __cdecl __MINGW_NOTHROW - _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *), - void*, unsigned, unsigned*); -_CRTIMP void __cdecl __MINGW_NOTHROW _endthreadex (unsigned); +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma push_macro("abort") +#undef abort +#endif + void __cdecl __declspec(noreturn) abort(void); +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma pop_macro("abort") +#undef abort +#endif #endif + _CRTIMP void __cdecl _cexit(void); + _CRTIMP void __cdecl _c_exit(void); + _CRTIMP int __cdecl _getpid(void); + _CRTIMP intptr_t __cdecl _cwait(int *_TermStat,intptr_t _ProcHandle,int _Action); + _CRTIMP intptr_t __cdecl _execl(const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _execle(const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _execlp(const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _execlpe(const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _execv(const char *_Filename,const char *const *_ArgList); + _CRTIMP intptr_t __cdecl _execve(const char *_Filename,const char *const *_ArgList,const char *const *_Env); + _CRTIMP intptr_t __cdecl _execvp(const char *_Filename,const char *const *_ArgList); + _CRTIMP intptr_t __cdecl _execvpe(const char *_Filename,const char *const *_ArgList,const char *const *_Env); + _CRTIMP intptr_t __cdecl _spawnl(int _Mode,const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _spawnle(int _Mode,const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _spawnlp(int _Mode,const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _spawnlpe(int _Mode,const char *_Filename,const char *_ArgList,...); + _CRTIMP intptr_t __cdecl _spawnv(int _Mode,const char *_Filename,const char *const *_ArgList); + _CRTIMP intptr_t __cdecl _spawnve(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env); + _CRTIMP intptr_t __cdecl _spawnvp(int _Mode,const char *_Filename,const char *const *_ArgList); + _CRTIMP intptr_t __cdecl _spawnvpe(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env); -#ifndef _NO_OLDNAMES -/* - * Functions without the leading underscore, for portability. These functions - * live in liboldnames.a. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW cwait (int*, pid_t, int); -_CRTIMP pid_t __cdecl __MINGW_NOTHROW getpid (void); -_CRTIMP int __cdecl __MINGW_NOTHROW execl (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW execle (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW execlp (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW execlpe (const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW execv (const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW execve (const char*, const char* const*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW execvp (const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW execvpe (const char*, const char* const*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnl (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnle (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnlp (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnlpe (int, const char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnv (int, const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnve (int, const char*, const char* const*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnvp (int, const char*, const char* const*); -_CRTIMP int __cdecl __MINGW_NOTHROW spawnvpe (int, const char*, const char* const*, const char* const*); -#endif /* Not _NO_OLDNAMES */ +#ifndef _CRT_SYSTEM_DEFINED +#define _CRT_SYSTEM_DEFINED + int __cdecl system(const char *_Command); +#endif -#ifdef __cplusplus +#ifndef _WPROCESS_DEFINED +#define _WPROCESS_DEFINED + _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); + _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); + _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); + _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); +#ifndef _CRT_WSYSTEM_DEFINED +#define _CRT_WSYSTEM_DEFINED + _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); +#endif +#endif + + void __cdecl __security_init_cookie(void); +#if (defined(_X86_) && !defined(__x86_64)) + void __fastcall __security_check_cookie(uintptr_t _StackCookie); + __declspec(noreturn) void __cdecl __report_gsfailure(void); +#else + void __cdecl __security_check_cookie(uintptr_t _StackCookie); + __declspec(noreturn) void __cdecl __report_gsfailure(uintptr_t _StackCookie); +#endif + extern uintptr_t __security_cookie; + + intptr_t __cdecl _loaddll(char *_Filename); + int __cdecl _unloaddll(intptr_t _Handle); + int (__cdecl *__cdecl _getdllprocaddr(intptr_t _Handle,char *_ProcedureName,intptr_t _Ordinal))(void); + +#ifdef _DECL_DLLMAIN +#ifdef _WINDOWS_ + WINBOOL WINAPI DllMain(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved); + WINBOOL WINAPI _CRT_INIT(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved); + WINBOOL WINAPI _wCRT_INIT(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved); + extern WINBOOL (WINAPI *const _pRawDllMain)(HANDLE,DWORD,LPVOID); +#else + int __stdcall DllMain(void *_HDllHandle,unsigned _Reason,void *_Reserved); + int __stdcall _CRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved); + int __stdcall _wCRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved); + extern int (__stdcall *const _pRawDllMain)(void *,unsigned,void *); +#endif +#endif + +#ifndef NO_OLDNAMES +#define P_WAIT _P_WAIT +#define P_NOWAIT _P_NOWAIT +#define P_OVERLAY _P_OVERLAY +#define OLD_P_OVERLAY _OLD_P_OVERLAY +#define P_NOWAITO _P_NOWAITO +#define P_DETACH _P_DETACH +#define WAIT_CHILD _WAIT_CHILD +#define WAIT_GRANDCHILD _WAIT_GRANDCHILD + + intptr_t __cdecl cwait(int *_TermStat,intptr_t _ProcHandle,int _Action); + intptr_t __cdecl execlpe(const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl spawnl(int,const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl spawnle(int,const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl spawnlp(int,const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl spawnlpe(int,const char *_Filename,const char *_ArgList,...); + int __cdecl getpid(void); +#ifdef __GNUC__ + /* Those methods are predefined by gcc builtins to return int. So to prevent + stupid warnings, define them in POSIX way. This is save, because those + methods do not return in success case, so that the return value is not + really dependent to its scalar width. */ + int __cdecl execl(const char *_Filename,const char *_ArgList,...); + int __cdecl execle(const char *_Filename,const char *_ArgList,...); + int __cdecl execlp(const char *_Filename,const char *_ArgList,...); + int __cdecl execv(const char *_Filename,char *const _ArgList[]); + int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]); + int __cdecl execvp(const char *_Filename,char *const _ArgList[]); + int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]); +#else + intptr_t __cdecl execlp(const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl execl(const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl execle(const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl execv(const char *_Filename,char *const _ArgList[]); + intptr_t __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]); + intptr_t __cdecl execvp(const char *_Filename,char *const _ArgList[]); + intptr_t __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]); +#endif + intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]); + intptr_t __cdecl spawnve(int,const char *_Filename,char *const _ArgList[],char *const _Env[]); + intptr_t __cdecl spawnvp(int,const char *_Filename,char *const _ArgList[]); + intptr_t __cdecl spawnvpe(int,const char *_Filename,char *const _ArgList[],char *const _Env[]); +#endif + +#ifdef __cplusplus } #endif - -#endif /* Not RC_INVOKED */ - -#endif /* _PROCESS_H_ not defined */ +#endif +#endif diff --git a/reactos/include/crt/search.h b/reactos/include/crt/search.h index fc6ffc387da..c3be3cf7e68 100644 --- a/reactos/include/crt/search.h +++ b/reactos/include/crt/search.h @@ -1,106 +1,35 @@ -/* - * search.h - * - * Functions for searching and sorting. - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Danny Smith - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_SEARCH +#define _INC_SEARCH -#ifndef _SEARCH_H_ -#define _SEARCH_H_ - -/* All the headers include this file. */ #include <_mingw.h> - -#ifndef RC_INVOKED +#include #ifdef __cplusplus extern "C" { #endif -#ifndef _SIZE_T_DEFINED -typedef unsigned int size_t; -#define _SIZE_T_DEFINED +#ifndef _CRT_ALGO_DEFINED +#define _CRT_ALGO_DEFINED + void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); + void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); #endif + _CRTIMP void *__cdecl _lfind(const void *_Key,const void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); + _CRTIMP void *__cdecl _lsearch(const void *_Key,void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); -/* bsearch and qsort are also declared in stdlib.h */ -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, - int (*)(const void*, const void*)); -_CRTIMP void __cdecl qsort (void*, size_t, size_t, - int (*)(const void*, const void*)); - -_CRTIMP void* __cdecl _lfind (const void*, const void*, unsigned int*, - unsigned int, int (*)(const void*, const void*)); -_CRTIMP void* __cdecl _lsearch (const void*, void*, unsigned int*, unsigned int, - int (*)(const void*, const void*)); -/* -Documentation for these POSIX definitions and prototypes can be found in -The Open Group Base Specifications Issue 6 -IEEE Std 1003.1, 2004 Edition. -eg: http://www.opengroup.org/onlinepubs/009695399/functions/twalk.html -*/ - - -typedef struct entry { - char *key; - void *data; -} ENTRY; - -typedef enum { - FIND, - ENTER -} ACTION; - -typedef enum { - preorder, - postorder, - endorder, - leaf -} VISIT; - -#ifdef _SEARCH_PRIVATE -typedef struct node { - char *key; - struct node *llink, *rlink; -} node_t; -#endif - -void * __cdecl tdelete (const void * __restrict__, void ** __restrict__, - int (*)(const void *, const void *)) - __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3); -void * __cdecl tfind (const void *, void * const *, - int (*)(const void *, const void *)) - __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3); -void * __cdecl tsearch (const void *, void **, - int (*)(const void *, const void *)) - __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3); -void __cdecl twalk (const void *, void (*)(const void *, VISIT, int)); - -#ifndef _NO_OLDNAMES -_CRTIMP void* __cdecl lfind (const void*, const void*, unsigned int*, - unsigned int, int (*)(const void*, const void*)); -_CRTIMP void* __cdecl lsearch (const void*, void*, unsigned int*, unsigned int, - int (*)(const void*, const void*)); +#ifndef NO_OLDNAMES + void *__cdecl lfind(const void *_Key,const void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); + void *__cdecl lsearch(const void *_Key,void *_Base,unsigned int *_NumOfElements,unsigned int _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); #endif #ifdef __cplusplus } #endif -#endif /* RC_INVOKED */ +#include -#endif /* _SEARCH_H_ */ +#endif diff --git a/reactos/include/crt/sec_api/conio_s.h b/reactos/include/crt/sec_api/conio_s.h new file mode 100644 index 00000000000..98d97ba2e0e --- /dev/null +++ b/reactos/include/crt/sec_api/conio_s.h @@ -0,0 +1,42 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ + +#ifndef _INC_CONIO_S +#define _INC_CONIO_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + + _CRTIMP errno_t __cdecl _cgets_s(char *_Buffer,size_t _Size,size_t *_SizeRead); + _CRTIMP int __cdecl _cprintf_s(const char *_Format,...); + _CRTIMP int __cdecl _cscanf_s(const char *_Format,...); + _CRTIMP int __cdecl _cscanf_s_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcprintf_s(const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cprintf_s_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + +#ifndef _WCONIO_DEFINED_S +#define _WCONIO_DEFINED_S + _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead); + _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); +#endif + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/reactos/include/crt/sec_api/crtdbg_s.h b/reactos/include/crt/sec_api/crtdbg_s.h new file mode 100644 index 00000000000..4598b4f7c1c --- /dev/null +++ b/reactos/include/crt/sec_api/crtdbg_s.h @@ -0,0 +1,19 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ + +#ifndef _INC_CRTDBG_S +#define _INC_CRTDBG_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#define _dupenv_s_dbg(ps1,size,s2,t,f,l) _dupenv_s(ps1,size,s2) +#define _wdupenv_s_dbg(ps1,size,s2,t,f,l) _wdupenv_s(ps1,size,s2) + +#endif + +#endif diff --git a/reactos/include/crt/sec_api/io_s.h b/reactos/include/crt/sec_api/io_s.h new file mode 100644 index 00000000000..ec565a61714 --- /dev/null +++ b/reactos/include/crt/sec_api/io_s.h @@ -0,0 +1,33 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_IO_S +#define _INC_IO_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + + _CRTIMP errno_t __cdecl _access_s(const char *_Filename,int _AccessMode); + _CRTIMP errno_t __cdecl _chsize_s(int _FileHandle,__int64 _Size); + _CRTIMP errno_t __cdecl _mktemp_s(char *_TemplateName,size_t _Size); + _CRTIMP errno_t __cdecl _umask_s(int _NewMode,int *_OldMode); + +#ifndef _WIO_S_DEFINED +#define _WIO_S_DEFINED + _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode); + _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords); +#endif + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/reactos/include/crt/sec_api/mbstring_s.h b/reactos/include/crt/sec_api/mbstring_s.h new file mode 100644 index 00000000000..6b2b188f8b7 --- /dev/null +++ b/reactos/include/crt/sec_api/mbstring_s.h @@ -0,0 +1,52 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_MBSTRING_S +#define _INC_MBSTRING_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _MBSTRING_S_DEFINED +#define _MBSTRING_S_DEFINED + _CRTIMP errno_t __cdecl _mbscat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); + _CRTIMP errno_t __cdecl _mbscat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbscpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); + _CRTIMP errno_t __cdecl _mbscpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbslwr_s(unsigned char *_Str,size_t _SizeInBytes); + _CRTIMP errno_t __cdecl _mbslwr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); + _CRTIMP errno_t __cdecl _mbsnbcat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); + _CRTIMP errno_t __cdecl _mbsnbcpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsnbset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount); + _CRTIMP errno_t __cdecl _mbsnbset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsncat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); + _CRTIMP errno_t __cdecl _mbsncat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); + _CRTIMP errno_t __cdecl _mbsncpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsnset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount); + _CRTIMP errno_t __cdecl _mbsnset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val); + _CRTIMP errno_t __cdecl _mbsset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,_locale_t _Locale); + _CRTIMP unsigned char *__cdecl _mbstok_s(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context); + _CRTIMP unsigned char *__cdecl _mbstok_s_l(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbsupr_s(unsigned char *_Str,size_t _SizeInBytes); + _CRTIMP errno_t __cdecl _mbsupr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); + _CRTIMP errno_t __cdecl _mbccpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src); + _CRTIMP errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src,_locale_t _Locale); +#endif + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/reactos/include/crt/sec_api/search_s.h b/reactos/include/crt/sec_api/search_s.h new file mode 100644 index 00000000000..cae89989829 --- /dev/null +++ b/reactos/include/crt/sec_api/search_s.h @@ -0,0 +1,25 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_SEARCH_S +#define _INC_SEARCH_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + + _CRTIMP void *__cdecl _lfind_s(const void *_Key,const void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); + _CRTIMP void *__cdecl _lsearch_s(const void *_Key,void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/reactos/include/crt/sec_api/stdio_s.h b/reactos/include/crt/sec_api/stdio_s.h new file mode 100644 index 00000000000..c9b803b1263 --- /dev/null +++ b/reactos/include/crt/sec_api/stdio_s.h @@ -0,0 +1,145 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_STDIO_S +#define _INC_STDIO_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _STDIO_S_DEFINED +#define _STDIO_S_DEFINED + _CRTIMP errno_t __cdecl clearerr_s(FILE *_File); + int __cdecl fprintf_s(FILE *_File,const char *_Format,...); + size_t __cdecl fread_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File); + _CRTIMP int __cdecl _fscanf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,...); + int __cdecl printf_s(const char *_Format,...); + _CRTIMP int __cdecl _scanf_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _scanf_s_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,...); + _CRTIMP int __cdecl _snprintf_c(char *_DstBuf,size_t _MaxCount,const char *_Format,...); + _CRTIMP int __cdecl _vsnprintf_c(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList); + int __cdecl sprintf_s(char *_DstBuf,size_t _DstSize,const char *_Format,...); + _CRTIMP int __cdecl _fscanf_l(FILE *_File,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _sscanf_l(const char *_Src,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _sscanf_s_l(const char *_Src,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snscanf_s(const char *_Src,size_t _MaxCount,const char *_Format,...); + _CRTIMP int __cdecl _snscanf_l(const char *_Src,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snscanf_s_l(const char *_Src,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); + int __cdecl vfprintf_s(FILE *_File,const char *_Format,va_list _ArgList); + int __cdecl vprintf_s(const char *_Format,va_list _ArgList); + int __cdecl vsnprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _vsnprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,va_list _ArgList); + int __cdecl vsprintf_s(char *_DstBuf,size_t _Size,const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _fprintf_p(FILE *_File,const char *_Format,...); + _CRTIMP int __cdecl _printf_p(const char *_Format,...); + _CRTIMP int __cdecl _sprintf_p(char *_Dst,size_t _MaxCount,const char *_Format,...); + _CRTIMP int __cdecl _vfprintf_p(FILE *_File,const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _vprintf_p(const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _vsprintf_p(char *_Dst,size_t _MaxCount,const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _scprintf_p(const char *_Format,...); + _CRTIMP int __cdecl _vscprintf_p(const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _printf_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _printf_p_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fprintf_l(FILE *_File,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _fprintf_p_l(FILE *_File,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vfprintf_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vfprintf_p_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _sprintf_l(char *_DstBuf,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _sprintf_p_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsprintf_l(char *_DstBuf,const char *_Format,_locale_t,va_list _ArgList); + _CRTIMP int __cdecl _vsprintf_p_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _scprintf_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _scprintf_p_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vscprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vscprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _printf_s_l(const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fprintf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vfprintf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _sprintf_s_l(char *_DstBuf,size_t _DstSize,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsprintf_s_l(char *_DstBuf,size_t _DstSize,const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _snprintf_s_l(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsnprintf_s_l(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _snprintf_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snprintf_c_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsnprintf_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vsnprintf_c_l(char *_DstBuf,size_t _MaxCount,const char *,_locale_t _Locale,va_list _ArgList); + +#ifndef _WSTDIO_S_DEFINED +#define _WSTDIO_S_DEFINED + _CRTIMP wchar_t *__cdecl _getws_s(wchar_t *_Str,size_t _SizeInWords); + int __cdecl fwprintf_s(FILE *_File,const wchar_t *_Format,...); + int __cdecl wprintf_s(const wchar_t *_Format,...); + int __cdecl vwprintf_s(const wchar_t *_Format,va_list _ArgList); + int __cdecl swprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,...); + int __cdecl vswprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vsnwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _wprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vfwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _swprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vswprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsnwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fwscanf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _swscanf_s_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snwscanf_s(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...); + _CRTIMP int __cdecl _snwscanf_s_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _wscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP errno_t __cdecl _wfopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode); + _CRTIMP errno_t __cdecl _wfreopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile); + _CRTIMP errno_t __cdecl _wtmpnam_s(wchar_t *_DstBuf,size_t _SizeInWords); + _CRTIMP int __cdecl _fwprintf_p(FILE *_File,const wchar_t *_Format,...); + _CRTIMP int __cdecl _wprintf_p(const wchar_t *_Format,...); + _CRTIMP int __cdecl _vfwprintf_p(FILE *_File,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _vwprintf_p(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _swprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vswprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _scwprintf_p(const wchar_t *_Format,...); + _CRTIMP int __cdecl _vscwprintf_p(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _wprintf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _wprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _fwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vfwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vfwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _swprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _swprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vswprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vswprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _scwprintf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsnwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...); + _CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args); + _CRTIMP int __cdecl _vscwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fwscanf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _swscanf_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snwscanf_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _wscanf_l(const wchar_t *_Format,_locale_t _Locale,...); +#endif +#endif + + _CRTIMP size_t __cdecl _fread_nolock_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File); + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/reactos/include/crt/sec_api/stdlib_s.h b/reactos/include/crt/sec_api/stdlib_s.h new file mode 100644 index 00000000000..f98262ccc43 --- /dev/null +++ b/reactos/include/crt/sec_api/stdlib_s.h @@ -0,0 +1,67 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_STDLIB_S +#define _INC_STDLIB_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + + _CRTIMP errno_t __cdecl _dupenv_s(char **_PBuffer,size_t *_PBufferSizeInBytes,const char *_VarName); + _CRTIMP errno_t __cdecl _itoa_s(int _Value,char *_DstBuf,size_t _Size,int _Radix); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP errno_t __cdecl _i64toa_s(__int64 _Val,char *_DstBuf,size_t _Size,int _Radix); + _CRTIMP errno_t __cdecl _ui64toa_s(unsigned __int64 _Val,char *_DstBuf,size_t _Size,int _Radix); +#endif + _CRTIMP errno_t __cdecl _ltoa_s(long _Val,char *_DstBuf,size_t _Size,int _Radix); + _CRTIMP errno_t __cdecl mbstowcs_s(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount); + _CRTIMP errno_t __cdecl _mbstowcs_s_l(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount,_locale_t _Locale); + _CRTIMP errno_t __cdecl _ultoa_s(unsigned long _Val,char *_DstBuf,size_t _Size,int _Radix); + _CRTIMP errno_t __cdecl _wctomb_s_l(int *_SizeConverted,char *_MbCh,size_t _SizeInBytes,wchar_t _WCh,_locale_t _Locale); + _CRTIMP errno_t __cdecl wcstombs_s(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes); + _CRTIMP errno_t __cdecl _wcstombs_s_l(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes,_locale_t _Locale); + +#ifndef _WSTDLIB_S_DEFINED +#define _WSTDLIB_S_DEFINED + _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); + _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); +#endif +#endif + +#ifndef _POSIX_ + _CRTIMP errno_t __cdecl _ecvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDights,int *_PtDec,int *_PtSign); + _CRTIMP errno_t __cdecl _fcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDec,int *_PtDec,int *_PtSign); + _CRTIMP errno_t __cdecl _gcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDigits); + _CRTIMP errno_t __cdecl _makepath_s(char *_PathResult,size_t _Size,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext); + _CRTIMP errno_t __cdecl _putenv_s(const char *_Name,const char *_Value); + _CRTIMP errno_t __cdecl _searchenv_s(const char *_Filename,const char *_EnvVar,char *_ResultPath,size_t _SizeInBytes); + _CRTIMP errno_t __cdecl _splitpath_s(const char *_FullPath,char *_Drive,size_t _DriveSize,char *_Dir,size_t _DirSize,char *_Filename,size_t _FilenameSize,char *_Ext,size_t _ExtSize); + +#ifndef _WSTDLIBP_S_DEFINED +#define _WSTDLIBP_S_DEFINED + _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); + _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); + _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); + _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/reactos/include/crt/sec_api/stralign_s.h b/reactos/include/crt/sec_api/stralign_s.h new file mode 100644 index 00000000000..5b78f586011 --- /dev/null +++ b/reactos/include/crt/sec_api/stralign_s.h @@ -0,0 +1,30 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef __STRALIGN_H_S_ +#define __STRALIGN_H_S_ + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(I_X86_) && defined(_WSTRING_S_DEFINED) +#if defined(__cplusplus) && defined(_WConst_Return) + static __inline PUWSTR ua_wcscpy_s(PUWSTR Destination,size_t DestinationSize,PCUWSTR Source) { + if(WSTR_ALIGNED(Source) && WSTR_ALIGNED(Destination)) return (wcscpy_s((PWSTR)Destination,DestinationSize,(PCWSTR)Source)==0 ? Destination : NULL); + return uaw_wcscpy((PCUWSTR)String,Character); + } +#endif +#endif + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/reactos/include/crt/sec_api/string_s.h b/reactos/include/crt/sec_api/string_s.h new file mode 100644 index 00000000000..9db70e77d50 --- /dev/null +++ b/reactos/include/crt/sec_api/string_s.h @@ -0,0 +1,41 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_STRING_S +#define _INC_STRING_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + + _CRTIMP errno_t __cdecl _strset_s(char *_Dst,size_t _DstSize,int _Value); + _CRTIMP errno_t __cdecl _strerror_s(char *_Buf,size_t _SizeInBytes,const char *_ErrMsg); + _CRTIMP errno_t __cdecl _strlwr_s(char *_Str,size_t _Size); + _CRTIMP errno_t __cdecl _strlwr_s_l(char *_Str,size_t _Size,_locale_t _Locale); + _CRTIMP errno_t __cdecl _strnset_s(char *_Str,size_t _Size,int _Val,size_t _MaxCount); + _CRTIMP errno_t __cdecl _strupr_s(char *_Str,size_t _Size); + _CRTIMP errno_t __cdecl _strupr_s_l(char *_Str,size_t _Size,_locale_t _Locale); +#ifndef _WSTRING_S_DEFINED +#define _WSTRING_S_DEFINED + _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context); + _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum); + _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg); + _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount); + _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val); + _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords); + _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale); + _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size); + _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale); +#endif + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/reactos/include/crt/sec_api/sys/timeb_s.h b/reactos/include/crt/sec_api/sys/timeb_s.h new file mode 100644 index 00000000000..af5ef098fe8 --- /dev/null +++ b/reactos/include/crt/sec_api/sys/timeb_s.h @@ -0,0 +1,34 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ + +#ifndef _TIMEB_H_S +#define _TIMEB_H_S + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef _USE_32BIT_TIME_T +#define _ftime_s _ftime32_s +#else +#define _ftime_s _ftime64_s +#endif + + _CRTIMP errno_t __cdecl _ftime32_s(struct __timeb32 *_Time); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP errno_t __cdecl _ftime64_s(struct __timeb64 *_Time); +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/crt/sec_api/tchar_s.h b/reactos/include/crt/sec_api/tchar_s.h new file mode 100644 index 00000000000..343d348eb94 --- /dev/null +++ b/reactos/include/crt/sec_api/tchar_s.h @@ -0,0 +1,266 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_TCHAR_S +#define _INC_TCHAR_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _UNICODE + +#define _tprintf_s wprintf_s +#define _tprintf_s_l _wprintf_s_l +#define _tcprintf_s _cwprintf_s +#define _tcprintf_s_l _cwprintf_s_l +#define _vtcprintf_s _vcwprintf_s +#define _vtcprintf_s_l _vcwprintf_s_l +#define _ftprintf_s fwprintf_s +#define _ftprintf_s_l _fwprintf_s_l +#define _stprintf_s swprintf_s +#define _stprintf_s_l _swprintf_s_l +#define _sntprintf_s _snwprintf_s +#define _sntprintf_s_l _snwprintf_s_l +#define _vtprintf_s vwprintf_s +#define _vtprintf_s_l _vwprintf_s_l +#define _vftprintf_s vfwprintf_s +#define _vftprintf_s_l _vfwprintf_s_l +#define _vstprintf_s vswprintf_s +#define _vstprintf_s_l _vswprintf_s_l +#define _vsntprintf_s _vsnwprintf_s +#define _vsntprintf_s_l _vsnwprintf_s_l + +#define _tscanf_s wscanf_s +#define _tscanf_s_l _wscanf_s_l +#define _tcscanf_s _cwscanf_s +#define _tcscanf_s_l _cwscanf_s_l +#define _ftscanf_s fwscanf_s +#define _ftscanf_s_l _fwscanf_s_l +#define _stscanf_s swscanf_s +#define _stscanf_s_l _swscanf_s_l +#define _sntscanf_s _snwscanf_s +#define _sntscanf_s_l _snwscanf_s_l + +#define _cgetts_s _cgetws_s +#define _getts_s _getws_s + +#define _itot_s _itow_s +#define _ltot_s _ltow_s +#define _ultot_s _ultow_s +#define _i64tot_s _i64tow_s +#define _ui64tot_s _ui64tow_s + +#define _tcscat_s wcscat_s +#define _tcscpy_s wcscpy_s +#define _tcsncat_s wcsncat_s +#define _tcsncat_s_l _wcsncat_s_l +#define _tcsncpy_s wcsncpy_s +#define _tcsncpy_s_l _wcsncpy_s_l +#define _tcstok_s wcstok_s +#define _tcstok_s_l _wcstok_s_l +#define _tcserror_s _wcserror_s +#define __tcserror_s __wcserror_s + +#define _tcsnset_s _wcsnset_s +#define _tcsnset_s_l _wcsnset_s_l +#define _tcsset_s _wcsset_s +#define _tcsset_s_l _wcsset_s_l + +#define _tasctime_s _wasctime_s +#define _tctime_s _wctime_s +#define _tctime32_s _wctime32_s +#define _tctime64_s _wctime64_s +#define _tstrdate_s _wstrdate_s +#define _tstrtime_s _wstrtime_s + +#define _tgetenv_s _wgetenv_s +#define _tdupenv_s _wdupenv_s +#define _tmakepath_s _wmakepath_s +#define _tputenv_s _wputenv_s +#define _tsearchenv_s _wsearchenv_s +#define _tsplitpath_s _wsplitpath_s + +#define _tfopen_s _wfopen_s +#define _tfreopen_s _wfreopen_s +#define _ttmpnam_s _wtmpnam_s +#define _taccess_s _waccess_s +#define _tmktemp_s _wmktemp_s + +#define _tcsnccat_s wcsncat_s +#define _tcsnccat_s_l _wcsncat_s_l +#define _tcsnccpy_s wcsncpy_s +#define _tcsnccpy_s_l _wcsncpy_s_l + +#define _tcslwr_s _wcslwr_s +#define _tcslwr_s_l _wcslwr_s_l +#define _tcsupr_s _wcsupr_s +#define _tcsupr_s_l _wcsupr_s_l + +#define _wcstok_s_l(_String,_Delimiters,_Current_position,_Locale) (wcstok_s(_String,_Delimiters,_Current_position)) +#define _wcsnset_s_l(_Destination,_Destination_size_chars,_Value,_Count,_Locale) (_wcsnset_s(_Destination,_Destination_size_chars,_Value,_Count)) +#define _wcsset_s_l(_Destination,_Destination_size_chars,_Value,_Locale) (_wcsset_s(_Destination,_Destination_size_chars,_Value)) + +#else + +#define _tprintf_s printf_s +#define _tprintf_s_l _printf_s_l +#define _tcprintf_s _cprintf_s +#define _tcprintf_s_l _cprintf_s_l +#define _vtcprintf_s _vcprintf_s +#define _vtcprintf_s_l _vcprintf_s_l +#define _ftprintf_s fprintf_s +#define _ftprintf_s_l _fprintf_s_l +#define _stprintf_s sprintf_s +#define _stprintf_s_l _sprintf_s_l +#define _sntprintf_s _snprintf_s +#define _sntprintf_s_l _snprintf_s_l +#define _vtprintf_s vprintf_s +#define _vtprintf_s_l _vprintf_s_l +#define _vftprintf_s vfprintf_s +#define _vftprintf_s_l _vfprintf_s_l +#define _vstprintf_s vsprintf_s +#define _vstprintf_s_l _vsprintf_s_l +#define _vsntprintf_s _vsnprintf_s +#define _vsntprintf_s_l _vsnprintf_s_l +#define _tscanf_s scanf_s +#define _tscanf_s_l _scanf_s_l +#define _tcscanf_s _cscanf_s +#define _tcscanf_s_l _cscanf_s_l +#define _ftscanf_s fscanf_s +#define _ftscanf_s_l _fscanf_s_l +#define _stscanf_s sscanf_s +#define _stscanf_s_l _sscanf_s_l +#define _sntscanf_s _snscanf_s +#define _sntscanf_s_l _snscanf_s_l + +#define _getts_s gets_s +#define _cgetts_s _cgets_s +#define _itot_s _itoa_s +#define _ltot_s _ltoa_s +#define _ultot_s _ultoa_s +#define _i64tot_s _i64toa_s +#define _ui64tot_s _ui64toa_s + +#define _tcscat_s strcat_s +#define _tcscpy_s strcpy_s +#define _tcserror_s strerror_s +#define __tcserror_s _strerror_s + +#define _tasctime_s asctime_s +#define _tctime_s ctime_s +#define _tctime32_s _ctime32_s +#define _tctime64_s _ctime64_s +#define _tstrdate_s _strdate_s +#define _tstrtime_s _strtime_s + +#define _tgetenv_s getenv_s +#define _tdupenv_s _dupenv_s +#define _tmakepath_s _makepath_s +#define _tputenv_s _putenv_s +#define _tsearchenv_s _searchenv_s +#define _tsplitpath_s _splitpath_s + +#define _tfopen_s fopen_s +#define _tfreopen_s freopen_s +#define _ttmpnam_s tmpnam_s +#define _tmktemp_s _mktemp_s + +#ifndef _POSIX_ +#define _taccess_s _access_s +#endif + +#define _tsopen_s _sopen_s + +#ifdef _MBCS + +#ifdef _MB_MAP_DIRECT + +#define _tcsncat_s _mbsnbcat_s +#define _tcsncat_s_l _mbsnbcat_s_l +#define _tcsncpy_s _mbsnbcpy_s +#define _tcsncpy_s_l _mbsnbcpy_s_l +#define _tcstok_s _mbstok_s +#define _tcstok_s_l _mbstok_s_l + +#define _tcsnset_s _mbsnbset_s +#define _tcsnset_s_l _mbsnbset_s_l +#define _tcsset_s _mbsset_s +#define _tcsset_s_l _mbsset_s_l + +#define _tcsnccat_s _mbsncat_s +#define _tcsnccat_s_l _mbsncat_s_l +#define _tcsnccpy_s _mbsncpy_s +#define _tcsnccpy_s_l _mbsncpy_s_l +#define _tcsncset_s _mbsnset_s +#define _tcsncset_s_l _mbsnset_s_l + +#define _tcslwr_s _mbslwr_s +#define _tcslwr_s_l _mbslwr_s_l +#define _tcsupr_s _mbsupr_s +#define _tcsupr_s_l _mbsupr_s_l + +#define _tccpy_s _mbccpy_s +#define _tccpy_s_l _mbccpy_s_l +#else + + _CRTIMP char *__cdecl _tcsncat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsncat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsncpy_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsncpy_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcstok_s(char *_Str,const char *_Delim,char **_Context); + _CRTIMP char *__cdecl _tcstok_s_l(char *_Str,const char *_Delim,char **_Context,_locale_t _Locale); + _CRTIMP errno_t __cdecl _tcsset_s(char *_Str,size_t _SizeInChars,unsigned int _Val); + _CRTIMP errno_t __cdecl _tcsset_s_l(char *_Str,size_t _SizeInChars,unsigned int,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsnccat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsnccat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsnccpy_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsnccpy_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcslwr_s(char *_Str,size_t _SizeInChars); + _CRTIMP char *__cdecl _tcslwr_s_l(char *_Str,size_t _SizeInChars,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsupr_s(char *_Str,size_t _SizeInChars); + _CRTIMP char *__cdecl _tcsupr_s_l(char *_Str,size_t _SizeInChars,_locale_t _Locale); + +#endif + +#else + +#define _tcsncat_s strncat_s +#define _tcsncat_s_l _strncat_s_l +#define _tcsncpy_s strncpy_s +#define _tcsncpy_s_l _strncpy_s_l +#define _tcstok_s strtok_s +#define _tcstok_s_l _strtok_s_l + +#define _tcsnset_s _strnset_s +#define _tcsnset_s_l _strnset_s_l +#define _tcsset_s _strset_s +#define _tcsset_s _strset_s +#define _tcsset_s_l _strset_s_l + +#define _tcsnccat_s strncat_s +#define _tcsnccat_s_l _strncat_s_l +#define _tcsnccpy_s strncpy_s +#define _tcsnccpy_s_l _strncpy_s_l + +#define _tcslwr_s _strlwr_s +#define _tcslwr_s_l _strlwr_s_l +#define _tcsupr_s _strupr_s +#define _tcsupr_s_l _strupr_s_l + +#define _strnset_s_l(_Destination,_Destination_size_chars,_Value,_Count,_Locale) (_strnset_s(_Destination,_Destination_size_chars,_Value,_Count)) +#define _strset_s_l(_Destination,_Destination_size_chars,_Value,_Locale) (_strset_s(_Destination,_Destination_size_chars,_Value)) +#endif +#endif + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/reactos/include/crt/sec_api/time_s.h b/reactos/include/crt/sec_api/time_s.h new file mode 100644 index 00000000000..9603b94fc20 --- /dev/null +++ b/reactos/include/crt/sec_api/time_s.h @@ -0,0 +1,61 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _TIME_H__S +#define _TIME_H__S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + + _CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time); + _CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time); + _CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time); + _CRTIMP errno_t __cdecl _strdate_s(char *_Buf,size_t _SizeInBytes); + _CRTIMP errno_t __cdecl _strtime_s(char *_Buf ,size_t _SizeInBytes); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP errno_t __cdecl _ctime64_s(char *_Buf,size_t _SizeInBytes,const __time64_t *_Time); + _CRTIMP errno_t __cdecl _gmtime64_s(struct tm *_Tm,const __time64_t *_Time); + _CRTIMP errno_t __cdecl _localtime64_s(struct tm *_Tm,const __time64_t *_Time); +#endif + +#ifndef _WTIME_S_DEFINED +#define _WTIME_S_DEFINED + _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); + _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); + _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords); + _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); +#endif + +#if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) +#define _INC_WTIME_S_INL +#ifdef _USE_32BIT_TIME_T +__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); } +#else +__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); } +#endif +#endif +#endif + +#ifndef RC_INVOKED +#ifdef _USE_32BIT_TIME_T +__CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); } +#else +__CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); } +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/reactos/include/crt/sec_api/wchar_s.h b/reactos/include/crt/sec_api/wchar_s.h new file mode 100644 index 00000000000..94251aa8b64 --- /dev/null +++ b/reactos/include/crt/sec_api/wchar_s.h @@ -0,0 +1,128 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _INC_WCHAR_S +#define _INC_WCHAR_S + +#include + +#if defined(MINGW_HAS_SECURE_API) + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _WIO_S_DEFINED +#define _WIO_S_DEFINED + _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode); + _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords); +#endif + +#ifndef _WCONIO_S_DEFINED +#define _WCONIO_S_DEFINED + _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead); + _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); +#endif + +#ifndef _WSTDIO_S_DEFINED +#define _WSTDIO_S_DEFINED + _CRTIMP wchar_t *__cdecl _getws_s(wchar_t *_Str,size_t _SizeInWords); + int __cdecl fwprintf_s(FILE *_File,const wchar_t *_Format,...); + int __cdecl wprintf_s(const wchar_t *_Format,...); + int __cdecl vfwprintf_s(FILE *_File,const wchar_t *_Format,va_list _ArgList); + int __cdecl vwprintf_s(const wchar_t *_Format,va_list _ArgList); + int __cdecl swprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,...); + int __cdecl vswprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vsnwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _wprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vfwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _swprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vswprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsnwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fwscanf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _swscanf_s_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snwscanf_s(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...); + _CRTIMP int __cdecl _snwscanf_s_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _wscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP errno_t __cdecl _wfopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode); + _CRTIMP errno_t __cdecl _wfreopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile); + _CRTIMP errno_t __cdecl _wtmpnam_s(wchar_t *_DstBuf,size_t _SizeInWords); +#endif + +#ifndef _WSTDLIB_S_DEFINED +#define _WSTDLIB_S_DEFINED + _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); + _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); + _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); +#endif +#endif + +#ifndef _POSIX_ +#ifndef _WSTDLIBP_S_DEFINED +#define _WSTDLIBP_S_DEFINED + _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); + _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); + _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); + _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); +#endif +#endif + +#ifndef _WSTRING_S_DEFINED +#define _WSTRING_S_DEFINED + _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context); + _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum); + _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg); + _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount); + _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val); + _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords); + _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale); + _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size); + _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale); +#endif + +#ifndef _WTIME_S_DEFINED +#define _WTIME_S_DEFINED + _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); + _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); + _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords); + _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); +#endif + +#if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) +#define _INC_WTIME_S_INL +#ifdef _USE_32BIT_TIME_T +__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); } +#else +__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); } +#endif +#endif +#endif + + _CRTIMP errno_t __cdecl mbsrtowcs_s(size_t *_Retval,wchar_t *_Dst,size_t _SizeInWords,const char **_PSrc,size_t _N,mbstate_t *_State); + _CRTIMP errno_t __cdecl wcrtomb_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,wchar_t _Ch,mbstate_t *_State); + _CRTIMP errno_t __cdecl wcsrtombs_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,const wchar_t **_Src,size_t _Size,mbstate_t *_State); + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/reactos/include/crt/setjmp.h b/reactos/include/crt/setjmp.h index f83e1c01220..8caa5771103 100644 --- a/reactos/include/crt/setjmp.h +++ b/reactos/include/crt/setjmp.h @@ -1,57 +1,181 @@ -/* - * setjmp.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Declarations supporting setjmp and longjump, a method for avoiding - * the normal function call return sequence. (Bleah!) - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_SETJMP +#define _INC_SETJMP -#ifndef _SETJMP_H_ -#define _SETJMP_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#ifndef RC_INVOKED +#pragma pack(push,_CRT_PACKING) #ifdef __cplusplus extern "C" { #endif -/* - * The buffer used by setjmp to store the information used by longjmp - * to perform it's evil goto-like work. The size of this buffer was - * determined through experimentation; it's contents are a mystery. - * NOTE: This was determined on an i386 (actually a Pentium). The - * contents could be different on an Alpha or something else. - */ +#if (defined(_X86_) && !defined(__x86_64)) + #define _JBLEN 16 #define _JBTYPE int -typedef _JBTYPE jmp_buf[_JBLEN]; -/* - * The function provided by CRTDLL which appears to do the actual work - * of setjmp. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf); + typedef struct __JUMP_BUFFER { + unsigned long Ebp; + unsigned long Ebx; + unsigned long Edi; + unsigned long Esi; + unsigned long Esp; + unsigned long Eip; + unsigned long Registration; + unsigned long TryLevel; + unsigned long Cookie; + unsigned long UnwindFunc; + unsigned long UnwindData[6]; + } _JUMP_BUFFER; +#elif defined(__ia64__) + typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { + __int64 LowPart; + __int64 HighPart; + } SETJMP_FLOAT128; -#define setjmp(x) _setjmp(x) +#define _JBLEN 33 + typedef SETJMP_FLOAT128 _JBTYPE; -/* - * Return to the last setjmp call and act as if setjmp had returned - * nVal (which had better be non-zero!). - */ -_CRTIMP void __cdecl __MINGW_NOTHROW longjmp (jmp_buf, int) __MINGW_ATTRIB_NORETURN; + typedef struct __JUMP_BUFFER { + + unsigned long iAReserved[6]; + + unsigned long Registration; + unsigned long TryLevel; + unsigned long Cookie; + unsigned long UnwindFunc; + + unsigned long UnwindData[6]; + + SETJMP_FLOAT128 FltS0; + SETJMP_FLOAT128 FltS1; + SETJMP_FLOAT128 FltS2; + SETJMP_FLOAT128 FltS3; + SETJMP_FLOAT128 FltS4; + SETJMP_FLOAT128 FltS5; + SETJMP_FLOAT128 FltS6; + SETJMP_FLOAT128 FltS7; + SETJMP_FLOAT128 FltS8; + SETJMP_FLOAT128 FltS9; + SETJMP_FLOAT128 FltS10; + SETJMP_FLOAT128 FltS11; + SETJMP_FLOAT128 FltS12; + SETJMP_FLOAT128 FltS13; + SETJMP_FLOAT128 FltS14; + SETJMP_FLOAT128 FltS15; + SETJMP_FLOAT128 FltS16; + SETJMP_FLOAT128 FltS17; + SETJMP_FLOAT128 FltS18; + SETJMP_FLOAT128 FltS19; + __int64 FPSR; + __int64 StIIP; + __int64 BrS0; + __int64 BrS1; + __int64 BrS2; + __int64 BrS3; + __int64 BrS4; + __int64 IntS0; + __int64 IntS1; + __int64 IntS2; + __int64 IntS3; + __int64 RsBSP; + __int64 RsPFS; + __int64 ApUNAT; + __int64 ApLC; + __int64 IntSp; + __int64 IntNats; + __int64 Preds; + + } _JUMP_BUFFER; +#elif defined(__x86_64) + typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { + unsigned __int64 Part[2]; + } SETJMP_FLOAT128; + +#define _JBLEN 16 + typedef SETJMP_FLOAT128 _JBTYPE; + + typedef struct _JUMP_BUFFER { + unsigned __int64 Frame; + unsigned __int64 Rbx; + unsigned __int64 Rsp; + unsigned __int64 Rbp; + unsigned __int64 Rsi; + unsigned __int64 Rdi; + unsigned __int64 R12; + unsigned __int64 R13; + unsigned __int64 R14; + unsigned __int64 R15; + unsigned __int64 Rip; + unsigned __int64 Spare; + SETJMP_FLOAT128 Xmm6; + SETJMP_FLOAT128 Xmm7; + SETJMP_FLOAT128 Xmm8; + SETJMP_FLOAT128 Xmm9; + SETJMP_FLOAT128 Xmm10; + SETJMP_FLOAT128 Xmm11; + SETJMP_FLOAT128 Xmm12; + SETJMP_FLOAT128 Xmm13; + SETJMP_FLOAT128 Xmm14; + SETJMP_FLOAT128 Xmm15; + } _JUMP_BUFFER; +#endif +#ifndef _JMP_BUF_DEFINED + typedef _JBTYPE jmp_buf[_JBLEN]; +#define _JMP_BUF_DEFINED +#endif + +__CRT_INLINE void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void) +{ +#ifdef __GNUC__ +#ifdef __x86_64 + __int64 *ret; + __asm__ __volatile__("leaq 16(%%rsp),%0\n" + :"=r"(ret) + : + ); + return ret; +#elif __i386__ + __int32 *ret; + __asm__ __volatile__("lea 8(%esp),%0\n" + :"=r"(ret) + : + ); + return ret; +#endif +#else +#error Unsupported Compiler +#endif +} + +#ifdef USE_MINGW_SETJMP_TWO_ARGS +#ifndef _INC_SETJMPEX +#define setjmp(BUF) _setjmp((BUF),mingw_getsp()) + int __cdecl __attribute__ ((__nothrow__)) _setjmp(jmp_buf _Buf,void *_Ctx); +#else +#undef setjmp +#define setjmp(BUF) _setjmpex((BUF),mingw_getsp()) +#define setjmpex(BUF) _setjmpex((BUF),mingw_getsp()) + int __cdecl __attribute__ ((__nothrow__)) _setjmpex(jmp_buf _Buf,void *_Ctx); +#endif +#else +#ifndef _INC_SETJMPEX +#define setjmp _setjmp +#endif + int __cdecl __attribute__ ((__nothrow__)) setjmp(jmp_buf _Buf); +#endif + + __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/; + __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value); #ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _SETJMP_H_ */ - - +#pragma pack(pop) +#endif diff --git a/reactos/include/crt/share.h b/reactos/include/crt/share.h index 09a54ad284f..14b2772c40e 100644 --- a/reactos/include/crt/share.h +++ b/reactos/include/crt/share.h @@ -1,33 +1,27 @@ -/* - * share.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Constants for file sharing functions. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_SHARE +#define _INC_SHARE -#ifndef _SHARE_H_ -#define _SHARE_H_ - -/* All the headers include this file. */ -#include <_mingw.h> +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif #define _SH_COMPAT 0x00 /* Compatibility */ -#define _SH_DENYRW 0x10 /* Deny read/write */ -#define _SH_DENYWR 0x20 /* Deny write */ -#define _SH_DENYRD 0x30 /* Deny read */ -#define _SH_DENYNO 0x40 /* Deny nothing */ +#define _SH_DENYRW 0x10 +#define _SH_DENYWR 0x20 +#define _SH_DENYRD 0x30 +#define _SH_DENYNO 0x40 +#define _SH_SECURE 0x80 -#ifndef _NO_OLDNAMES - -/* Non ANSI names */ +#ifndef NO_OLDNAMES #define SH_DENYRW _SH_DENYRW #define SH_DENYWR _SH_DENYWR #define SH_DENYRD _SH_DENYRD #define SH_DENYNO _SH_DENYNO +#endif -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not _SHARE_H_ */ +#endif diff --git a/reactos/include/crt/signal.h b/reactos/include/crt/signal.h index 18a75e384f2..6e9c79734c6 100644 --- a/reactos/include/crt/signal.h +++ b/reactos/include/crt/signal.h @@ -1,99 +1,61 @@ -/* - * signal.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * A way to set handlers for exceptional conditions (also known as signals). - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_SIGNAL +#define _INC_SIGNAL -#ifndef _SIGNAL_H_ -#define _SIGNAL_H_ - -/* All the headers include this file. */ #include <_mingw.h> -/* - * The actual signal values. Using other values with signal - * produces a SIG_ERR return value. - * - * NOTE: SIGINT is produced when the user presses Ctrl-C. - * SIGILL has not been tested. - * SIGFPE doesn't seem to work? - * SIGSEGV does not catch writing to a NULL pointer (that shuts down - * your app; can you say "segmentation violation core dump"?). - * SIGTERM comes from what kind of termination request exactly? - * SIGBREAK is indeed produced by pressing Ctrl-Break. - * SIGABRT is produced by calling abort. - * TODO: The above results may be related to not installing an appropriate - * structured exception handling frame. Results may be better if I ever - * manage to get the SEH stuff down. - */ -#define SIGINT 2 /* Interactive attention */ -#define SIGILL 4 /* Illegal instruction */ -#define SIGFPE 8 /* Floating point error */ -#define SIGSEGV 11 /* Segmentation violation */ -#define SIGTERM 15 /* Termination request */ -#define SIGBREAK 21 /* Control-break */ -#define SIGABRT 22 /* Abnormal termination (abort) */ - -#define NSIG 23 /* maximum signal number + 1 */ - -#ifndef RC_INVOKED - -#ifndef _SIG_ATOMIC_T_DEFINED -typedef int sig_atomic_t; -#define _SIG_ATOMIC_T_DEFINED -#endif - -/* - * The prototypes (below) are the easy part. The hard part is figuring - * out what signals are available and what numbers they are assigned - * along with appropriate values of SIG_DFL and SIG_IGN. - */ - -/* - * A pointer to a signal handler function. A signal handler takes a - * single int, which is the signal it handles. - */ -typedef void (*__p_sig_fn_t)(int); - -/* - * These are special values of signal handler pointers which are - * used to send a signal to the default handler (SIG_DFL), ignore - * the signal (SIG_IGN), indicate an error return (SIG_ERR), - * get an error (SIG_SGE), or acknowledge (SIG_ACK). - */ -#define SIG_DFL ((__p_sig_fn_t) 0) -#define SIG_IGN ((__p_sig_fn_t) 1) -#define SIG_ERR ((__p_sig_fn_t) -1) -#define SIG_SGE ((__p_sig_fn_t) 3) -#define SIG_ACK ((__p_sig_fn_t) 4) - -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -/* - * Call signal to set the signal handler for signal sig to the - * function pointed to by handler. Returns a pointer to the - * previous handler, or SIG_ERR if an error occurs. Initially - * unhandled signals defined above will return SIG_DFL. - */ -_CRTIMP __p_sig_fn_t __cdecl __MINGW_NOTHROW signal(int, __p_sig_fn_t); - -/* - * Raise the signal indicated by sig. Returns non-zero on success. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW raise (int); - -#ifdef __cplusplus -} +#ifndef _SIG_ATOMIC_T_DEFINED +#define _SIG_ATOMIC_T_DEFINED + typedef int sig_atomic_t; #endif -#endif /* Not RC_INVOKED */ +#define NSIG 23 -#endif /* Not _SIGNAL_H_ */ +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGIOT 6 /* IOT instruction */ +#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 +#define SIGBREAK 21 +#define SIGABRT2 22 +#define SIGABRT_COMPAT 6 + typedef void (*__p_sig_fn_t)(int); + +#define SIG_DFL (__p_sig_fn_t)0 +#define SIG_IGN (__p_sig_fn_t)1 +#define SIG_GET (__p_sig_fn_t)2 +#define SIG_SGE (__p_sig_fn_t)3 +#define SIG_ACK (__p_sig_fn_t)4 +#define SIG_ERR (__p_sig_fn_t)-1 + + extern void **__cdecl __pxcptinfoptrs(void); +#define _pxcptinfoptrs (*__pxcptinfoptrs()) + + __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func); + int __cdecl raise(int _SigNum); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/reactos/include/crt/stdint.h b/reactos/include/crt/stdint.h index 57db989cdae..14a8bfdc926 100644 --- a/reactos/include/crt/stdint.h +++ b/reactos/include/crt/stdint.h @@ -1,3 +1,8 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* ISO C9x 7.18 Integer types * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) * @@ -19,9 +24,12 @@ #ifndef _STDINT_H #define _STDINT_H + +#include <_mingw.h> + #define __need_wint_t #define __need_wchar_t -#include +#include "stddef.h" /* 7.18.1.1 Exact-width integer types */ typedef signed char int8_t; @@ -43,9 +51,9 @@ typedef unsigned uint_least32_t; typedef long long int_least64_t; typedef unsigned long long uint_least64_t; -/* 7.18.1.3 Fastest minimum-width integer types +/* 7.18.1.3 Fastest minimum-width integer types * Not actually guaranteed to be fastest for all purposes - * Here we use the exact-width types for 8 and 16-bit ints. + * Here we use the exact-width types for 8 and 16-bit ints. */ typedef char int_fast8_t; typedef unsigned char uint_fast8_t; @@ -56,35 +64,15 @@ typedef unsigned int uint_fast32_t; typedef long long int_fast64_t; typedef unsigned long long uint_fast64_t; -/* 7.18.1.4 Integer types capable of holding object pointers */ - -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 - typedef __int64 intptr_t; -#else - typedef int intptr_t; -#endif -#endif - -#ifndef _UINTPTR_T_DEFINED -#define _UINTPTR_T_DEFINED -#ifdef _WIN64 - typedef unsigned __int64 uintptr_t; -#else - typedef unsigned int uintptr_t; -#endif -#endif - /* 7.18.1.5 Greatest-width integer types */ typedef long long intmax_t; -typedef unsigned long long uintmax_t; +typedef unsigned long long uintmax_t; /* 7.18.2 Limits of specified-width integer types */ #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) /* 7.18.2.1 Limits of exact-width integer types */ -#define INT8_MIN (-128) +#define INT8_MIN (-128) #define INT16_MIN (-32768) #define INT32_MIN (-2147483647 - 1) #define INT64_MIN (-9223372036854775807LL - 1) @@ -149,24 +137,37 @@ typedef unsigned long long uintmax_t; #define UINTMAX_MAX UINT64_MAX /* 7.18.3 Limits of other integer types */ -#define PTRDIFF_MIN INTPTR_MIN -#define PTRDIFF_MAX INTPTR_MAX +#ifdef _WIN64 +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#endif -#define SIG_ATOMIC_MIN INTPTR_MIN -#define SIG_ATOMIC_MAX INTPTR_MAX +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX -#define SIZE_MAX UINTPTR_MAX +#ifndef SIZE_MAX +#ifdef _WIN64 +#define SIZE_MAX UINT64_MAX +#else +#define SIZE_MAX UINT32_MAX +#endif +#endif -#ifndef WCHAR_MIN /* also in wchar.h */ +#ifndef WCHAR_MIN /* also in wchar.h */ #define WCHAR_MIN 0 -#define WCHAR_MAX 0xffff /* UINT16_MAX */ +#endif +#ifndef WCHAR_MAX +#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */ #endif /* * wint_t is unsigned short for compatibility with MS runtime */ #define WINT_MIN 0 -#define WINT_MAX 0xffff /* UINT16_MAX */ +#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */ #endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ @@ -185,21 +186,25 @@ typedef unsigned long long uintmax_t; an integer constant with width less than that of type int. TC1 changed this to require just an integer constant *expression* with *promoted* type." + + The trick used here is from Clive D W Feather. */ -#define INT8_C(val) ((int8_t) + (val)) -#define UINT8_C(val) ((uint8_t) + (val##U)) -#define INT16_C(val) ((int16_t) + (val)) -#define UINT16_C(val) ((uint16_t) + (val##U)) - -#define INT32_C(val) val##L -#define UINT32_C(val) val##UL +#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) +#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) +#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) +/* The 'trick' doesn't work in C89 for long long because, without + suffix, (val) will be evaluated as int, not intmax_t */ #define INT64_C(val) val##LL + +#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val)) +#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val)) +#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val)) #define UINT64_C(val) val##ULL /* 7.18.4.2 Macros for greatest-width integer constants */ -#define INTMAX_C(val) INT64_C(val) -#define UINTMAX_C(val) UINT64_C(val) +#define INTMAX_C(val) val##LL +#define UINTMAX_C(val) val##ULL #endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ diff --git a/reactos/include/crt/stdio.h b/reactos/include/crt/stdio.h index b32edaf8da3..12cbb6866db 100644 --- a/reactos/include/crt/stdio.h +++ b/reactos/include/crt/stdio.h @@ -1,516 +1,445 @@ -/* - * stdio.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Definitions of types and prototypes of functions for standard input and - * output. - * - * NOTE: The file manipulation functions provided by Microsoft seem to - * work with either slash (/) or backslash (\) as the directory separator. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_STDIO +#define _INC_STDIO -#ifndef _STDIO_H_ -#define _STDIO_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#ifndef RC_INVOKED -#define __need_size_t -#define __need_NULL -#define __need_wchar_t -#define __need_wint_t -#include -#define __need___va_list -#include -#endif /* Not RC_INVOKED */ - - -/* Flags for the iobuf structure */ -#define _IOREAD 0x0001 /* currently reading */ -#define _IOWRT 0x0002 /* currently writing */ -#define _IOMYBUF 0x0008 /* stdio malloc()'d buffer */ -#define _IOEOF 0x0010 /* EOF reached on read */ -#define _IOERR 0x0020 /* I/O error from system */ -#define _IOSTRG 0x0040 /* Strange or no file descriptor */ -#define _IORW 0x0080 /* opened as "r+w" */ -#ifdef _POSIX_SOURCE -# define _IOAPPEND 0x0200 -#endif - - -/* - * The three standard file pointers provided by the run time library. - * NOTE: These will go to the bit-bucket silently in GUI applications! - */ -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -/* Returned by various functions on end of file condition or error. */ -#define EOF (-1) - -/* - * The maximum length of a file name. You should use GetVolumeInformation - * instead of this constant. But hey, this works. - * Also defined in io.h. - */ -#ifndef FILENAME_MAX -#define FILENAME_MAX (260) -#endif - -/* - * The maximum number of files that may be open at once. I have set this to - * a conservative number. The actual value may be higher. - */ -#define FOPEN_MAX (20) - -/* After creating this many names, tmpnam and tmpfile return NULL */ -#define TMP_MAX 32767 -/* - * Tmpnam, tmpfile and, sometimes, _tempnam try to create - * temp files in the root directory of the current drive - * (not in pwd, as suggested by some older MS doc's). - * Redefining these macros does not effect the CRT functions. - */ -#define _P_tmpdir "\\" -#ifndef __STRICT_ANSI__ -#define P_tmpdir _P_tmpdir -#endif -#define _wP_tmpdir L"\\" - -/* - * The maximum size of name (including NUL) that will be put in the user - * supplied buffer caName for tmpnam. - * Inferred from the size of the static buffer returned by tmpnam - * when passed a NULL argument. May actually be smaller. - */ -#define L_tmpnam (16) - -#define _IOFBF 0x0000 /* full buffered */ -#define _IOLBF 0x0040 /* line buffered */ -#define _IONBF 0x0004 /* not buffered */ - -/* - * The buffer size as used by setbuf such that it is equivalent to - * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ). - */ -#define BUFSIZ 512 - -/* Constants for nOrigin indicating the position relative to which fseek - * sets the file position. Defined unconditionally since ISO and POSIX - * say they are defined here. */ -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 - -#ifndef RC_INVOKED - -#ifndef __VALIST -#ifdef __GNUC__ -#define __VALIST __gnuc_va_list -#else -#define __VALIST char* -#endif -#endif /* defined __VALIST */ - -/* - * The structure underlying the FILE type. - * - * Some believe that nobody in their right mind should make use of the - * internals of this structure. Provided by Pedro A. Aranda Gutiirrez - * . - */ -#ifndef _FILE_DEFINED -#define _FILE_DEFINED -typedef struct _iobuf -{ - char* _ptr; - int _cnt; - char* _base; - int _flag; - int _file; - int _charbuf; - int _bufsiz; - char* _tmpfname; -} FILE; -#endif /* Not _FILE_DEFINED */ - - -/* - * The standard file handles - */ -#ifndef __DECLSPEC_SUPPORTED - -extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ - -#define _iob (*_imp___iob) /* An array of FILE */ - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */ - -#endif /* __DECLSPEC_SUPPORTED */ - -#define stdin (&_iob[STDIN_FILENO]) -#define stdout (&_iob[STDOUT_FILENO]) -#define stderr (&_iob[STDERR_FILENO]) +#pragma pack(push,_CRT_PACKING) #ifdef __cplusplus extern "C" { #endif -/* - * File Operations - */ -_CRTIMP FILE* __cdecl __MINGW_NOTHROW fopen (const char*, const char*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW freopen (const char*, const char*, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fflush (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fclose (FILE*); -/* MS puts remove & rename (but not wide versions) in io.h also */ -_CRTIMP int __cdecl __MINGW_NOTHROW remove (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rename (const char*, const char*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW tmpfile (void); -_CRTIMP char* __cdecl __MINGW_NOTHROW tmpnam (char*); +#define BUFSIZ 512 +#define _NFILE _NSTREAM_ +#define _NSTREAM_ 512 +#define _IOB_ENTRIES 20 +#define EOF (-1) -#ifndef __STRICT_ANSI__ -_CRTIMP char* __cdecl __MINGW_NOTHROW _tempnam (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _rmtmp(void); -_CRTIMP int __cdecl __MINGW_NOTHROW _unlink (const char*); - -#ifndef NO_OLDNAMES -_CRTIMP char* __cdecl __MINGW_NOTHROW tempnam (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rmtmp(void); -_CRTIMP int __cdecl __MINGW_NOTHROW unlink (const char*); -#endif -#endif /* __STRICT_ANSI__ */ - -_CRTIMP int __cdecl __MINGW_NOTHROW setvbuf (FILE*, char*, int, size_t); - -_CRTIMP void __cdecl __MINGW_NOTHROW setbuf (FILE*, char*); - -/* - * Formatted Output - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW fprintf (FILE*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW printf (const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW sprintf (char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _snprintf (char*, size_t, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vfprintf (FILE*, const char*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vprintf (const char*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vsprintf (char*, const char*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW _vsnprintf (char*, size_t, const char*, __VALIST); - -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -int __cdecl __MINGW_NOTHROW snprintf(char *, size_t, const char *, ...); -int __cdecl __MINGW_NOTHROW vsnprintf (char *, size_t, const char *, __VALIST); - -int __cdecl __MINGW_NOTHROW vscanf (const char * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vfscanf (FILE * __restrict__, const char * __restrict__, - __VALIST); -int __cdecl __MINGW_NOTHROW vsscanf (const char * __restrict__, - const char * __restrict__, __VALIST); +#ifndef _FILE_DEFINED + struct _iobuf { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _charbuf; + int _bufsiz; + char *_tmpfname; + }; + typedef struct _iobuf FILE; +#define _FILE_DEFINED #endif -/* - * Formatted Input - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW fscanf (FILE*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW scanf (const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW sscanf (const char*, const char*, ...); -/* - * Character Input and Output Functions - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW fgetc (FILE*); -_CRTIMP char* __cdecl __MINGW_NOTHROW fgets (char*, int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputc (int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputs (const char*, FILE*); -_CRTIMP char* __cdecl __MINGW_NOTHROW gets (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW puts (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW ungetc (int, FILE*); - -/* Traditionally, getc and putc are defined as macros. but the - standard doesn't say that they must be macros. - We use inline functions here to allow the fast versions - to be used in C++ with namespace qualification, eg., ::getc. - - _filbuf and _flsbuf are not thread-safe. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _filbuf (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _flsbuf (int, FILE*); - -#if !defined _MT - -__CRT_INLINE int __cdecl __MINGW_NOTHROW getc (FILE* __F) -{ - return (--__F->_cnt >= 0) - ? (int) (unsigned char) *__F->_ptr++ - : _filbuf (__F); -} - -__CRT_INLINE int __cdecl __MINGW_NOTHROW putc (int __c, FILE* __F) -{ - return (--__F->_cnt >= 0) - ? (int) (unsigned char) (*__F->_ptr++ = (char)__c) - : _flsbuf (__c, __F); -} - -__CRT_INLINE int __cdecl __MINGW_NOTHROW getchar (void) -{ - return (--stdin->_cnt >= 0) - ? (int) (unsigned char) *stdin->_ptr++ - : _filbuf (stdin); -} - -__CRT_INLINE int __cdecl __MINGW_NOTHROW putchar(int __c) -{ - return (--stdout->_cnt >= 0) - ? (int) (unsigned char) (*stdout->_ptr++ = (char)__c) - : _flsbuf (__c, stdout);} - -#else /* Use library functions. */ - -_CRTIMP int __cdecl __MINGW_NOTHROW getc (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW putc (int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW getchar (void); -_CRTIMP int __cdecl __MINGW_NOTHROW putchar (int); - -#endif - -/* - * Direct Input and Output Functions - */ - -_CRTIMP size_t __cdecl __MINGW_NOTHROW fread (void*, size_t, size_t, FILE*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW fwrite (const void*, size_t, size_t, FILE*); - -/* - * File Positioning Functions - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW fseek (FILE*, long, int); -_CRTIMP long __cdecl __MINGW_NOTHROW ftell (FILE*); -_CRTIMP void __cdecl __MINGW_NOTHROW rewind (FILE*); - -#if __MSVCRT_VERSION__ >= 0x800 -_CRTIMP int __cdecl __MINGW_NOTHROW _fseek_nolock (FILE*, long, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _ftell_nolock (FILE*); - -_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64 (FILE*, __int64, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64 (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64_nolock (FILE*, __int64, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64_nolock (FILE*); -#endif - -#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */ -/* - * Workaround for limitations on win9x where a file contents are - * not zero'd out if you seek past the end and then write. - */ - -int __cdecl __MINGW_NOTHROW __mingw_fseek (FILE *, long, int); -size_t __cdecl __MINGW_NOTHROW __mingw_fwrite (const void*, size_t, size_t, FILE*); -#define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence) -#define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp) -#endif /* __USE_MINGW_FSEEK */ - -/* - * An opaque data type used for storing file positions... The contents of - * this type are unknown, but we (the compiler) need to know the size - * because the programmer using fgetpos and fsetpos will be setting aside - * storage for fpos_t structres. Actually I tested using a byte array and - * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL). - * Perhaps an unsigned long? TODO? It's definitely a 64-bit number in - * MSVCRT however, and for now `long long' will do. - */ -#ifdef __MSVCRT__ -typedef long long fpos_t; +#ifdef _POSIX_ +#define _P_tmpdir "/" +#define _wP_tmpdir L"/" #else -typedef long fpos_t; +#define _P_tmpdir "\\" +#define _wP_tmpdir L"\\" #endif -_CRTIMP int __cdecl __MINGW_NOTHROW fgetpos (FILE*, fpos_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW fsetpos (FILE*, const fpos_t*); +#define L_tmpnam (sizeof(_P_tmpdir) + 12) -/* - * Error Functions - */ +#ifdef _POSIX_ +#define L_ctermid 9 +#define L_cuserid 32 +#endif -_CRTIMP int __cdecl __MINGW_NOTHROW feof (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW ferror (FILE*); +#define SEEK_CUR 1 +#define SEEK_END 2 +#define SEEK_SET 0 +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +#define FILENAME_MAX 260 +#define FOPEN_MAX 20 +#define _SYS_OPEN 20 +#define TMP_MAX 32767 + +#ifndef NULL #ifdef __cplusplus -inline int __cdecl __MINGW_NOTHROW feof (FILE* __F) - { return __F->_flag & _IOEOF; } -inline int __cdecl __MINGW_NOTHROW ferror (FILE* __F) - { return __F->_flag & _IOERR; } +#define NULL 0 #else -#define feof(__F) ((__F)->_flag & _IOEOF) -#define ferror(__F) ((__F)->_flag & _IOERR) +#define NULL ((void *)0) +#endif #endif -_CRTIMP void __cdecl __MINGW_NOTHROW clearerr (FILE*); -_CRTIMP void __cdecl __MINGW_NOTHROW perror (const char*); - - -#ifndef __STRICT_ANSI__ -/* - * Pipes - */ -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _popen (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _pclose (FILE*); - -#ifndef NO_OLDNAMES -_CRTIMP FILE* __cdecl __MINGW_NOTHROW popen (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW pclose (FILE*); +#ifndef _OFF_T_DEFINED +#define _OFF_T_DEFINED +#ifndef _OFF_T_ +#define _OFF_T_ + typedef long _off_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long off_t; +#endif +#endif #endif -/* - * Other Non ANSI functions - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _flushall (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _fgetchar (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _fputchar (int); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _fdopen (int, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _fileno (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _fcloseall(void); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _fsopen(const char*, const char*, int); -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _getmaxstdio(void); -_CRTIMP int __cdecl __MINGW_NOTHROW _setmaxstdio(int); +#ifndef _OFF64_T_DEFINED +#define _OFF64_T_DEFINED + typedef long long _off64_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long long off64_t; +#endif #endif -#if __MSVCRT_VERSION__ >= 0x800 -_CRTIMP int __cdecl __MINGW_NOTHROW _set_printf_count_output(int); -_CRTIMP int __cdecl __MINGW_NOTHROW _get_printf_count_output(void); +#ifndef _STDIO_DEFINED +#ifdef _WIN64 + _CRTIMP FILE *__cdecl __iob_func(void); +#else +#ifdef _MSVCRT_ +extern FILE _iob[]; /* A pointer to an array of FILE */ +#define __iob_func() (_iob) +#else +extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ +#define __iob_func() (*_imp___iob) +#define _iob __iob_func() +#endif +#endif #endif -#ifndef _NO_OLDNAMES -_CRTIMP int __cdecl __MINGW_NOTHROW fgetchar (void); -_CRTIMP int __cdecl __MINGW_NOTHROW fputchar (int); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW fdopen (int, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW fileno (FILE*); -#endif /* Not _NO_OLDNAMES */ +#ifndef _FPOS_T_DEFINED +#define _FPOS_T_DEFINED +#undef _FPOSOFF -#define _fileno(__F) ((__F)->_file) -#ifndef _NO_OLDNAMES -#define fileno(__F) ((__F)->_file) +#if (!defined(NO_OLDNAMES) || defined(__GNUC__)) && _INTEGRAL_MAX_BITS >= 64 + typedef __int64 fpos_t; +#define _FPOSOFF(fp) ((long)(fp)) +#else + typedef long long fpos_t; +#define _FPOSOFF(fp) ((long)(fp)) #endif -#if defined (__MSVCRT__) && !defined (__NO_MINGW_LFS) -#include -__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char* filename, const char* mode) -{ - return fopen (filename, mode); -} - -int __cdecl __MINGW_NOTHROW fseeko64 (FILE*, off64_t, int); - -#ifdef __USE_MINGW_FSEEK -int __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, off64_t, int); -#define fseeko64(fp, offset, whence) __mingw_fseeko64(fp, offset, whence) #endif -__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream) -{ - fpos_t pos; - if (fgetpos(stream, &pos)) - return -1LL; - else - return ((off64_t) pos); -} -#endif /* __NO_MINGW_LFS */ +#ifndef _STDSTREAM_DEFINED +#define _STDSTREAM_DEFINED -#endif /* Not __STRICT_ANSI__ */ +#define stdin (&__iob_func()[0]) +#define stdout (&__iob_func()[1]) +#define stderr (&__iob_func()[2]) +#endif -/* Wide versions */ +#define _IOREAD 0x0001 +#define _IOWRT 0x0002 + +#define _IOFBF 0x0000 +#define _IOLBF 0x0040 +#define _IONBF 0x0004 + +#define _IOMYBUF 0x0008 +#define _IOEOF 0x0010 +#define _IOERR 0x0020 +#define _IOSTRG 0x0040 +#define _IORW 0x0080 +#ifdef _POSIX_ +#define _IOAPPEND 0x0200 +#endif + +#define _TWO_DIGIT_EXPONENT 0x1 + +#ifndef _STDIO_DEFINED + + _CRTIMP int __cdecl _filbuf(FILE *_File); + _CRTIMP int __cdecl _flsbuf(int _Ch,FILE *_File); +#ifdef _POSIX_ + _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode); +#else + _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode,int _ShFlag); +#endif + void __cdecl clearerr(FILE *_File); + int __cdecl fclose(FILE *_File); + _CRTIMP int __cdecl _fcloseall(void); +#ifdef _POSIX_ + FILE *__cdecl fdopen(int _FileHandle,const char *_Mode); +#else + _CRTIMP FILE *__cdecl _fdopen(int _FileHandle,const char *_Mode); +#endif + int __cdecl feof(FILE *_File); + int __cdecl ferror(FILE *_File); + int __cdecl fflush(FILE *_File); + int __cdecl fgetc(FILE *_File); + _CRTIMP int __cdecl _fgetchar(void); + int __cdecl fgetpos(FILE *_File ,fpos_t *_Pos); + char *__cdecl fgets(char *_Buf,int _MaxCount,FILE *_File); +#ifdef _POSIX_ + int __cdecl fileno(FILE *_File); +#else + _CRTIMP int __cdecl _fileno(FILE *_File); +#endif + _CRTIMP char *__cdecl _tempnam(const char *_DirName,const char *_FilePrefix); + _CRTIMP int __cdecl _flushall(void); + FILE *__cdecl fopen(const char *_Filename,const char *_Mode); + FILE *fopen64(const char *filename,const char *mode); + int __cdecl fprintf(FILE *_File,const char *_Format,...); + int __cdecl fputc(int _Ch,FILE *_File); + _CRTIMP int __cdecl _fputchar(int _Ch); + int __cdecl fputs(const char *_Str,FILE *_File); + size_t __cdecl fread(void *_DstBuf,size_t _ElementSize,size_t _Count,FILE *_File); + FILE *__cdecl freopen(const char *_Filename,const char *_Mode,FILE *_File); + int __cdecl fscanf(FILE *_File,const char *_Format,...); + int __cdecl fsetpos(FILE *_File,const fpos_t *_Pos); + int __cdecl fseek(FILE *_File,long _Offset,int _Origin); + int fseeko64(FILE* stream, _off64_t offset, int whence); + long __cdecl ftell(FILE *_File); + _off64_t ftello64(FILE * stream); + int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin); + __int64 __cdecl _ftelli64(FILE *_File); + size_t __cdecl fwrite(const void *_Str,size_t _Size,size_t _Count,FILE *_File); + int __cdecl getc(FILE *_File); + int __cdecl getchar(void); + _CRTIMP int __cdecl _getmaxstdio(void); + char *__cdecl gets(char *_Buffer); + int __cdecl _getw(FILE *_File); +#ifndef _CRT_PERROR_DEFINED +#define _CRT_PERROR_DEFINED + void __cdecl perror(const char *_ErrMsg); +#endif + _CRTIMP int __cdecl _pclose(FILE *_File); + _CRTIMP FILE *__cdecl _popen(const char *_Command,const char *_Mode); +#if !defined(NO_OLDNAMES) && !defined(popen) +#define popen _popen +#define pclose _pclose +#endif + int __cdecl printf(const char *_Format,...); + int __cdecl putc(int _Ch,FILE *_File); + int __cdecl putchar(int _Ch); + int __cdecl puts(const char *_Str); + _CRTIMP int __cdecl _putw(int _Word,FILE *_File); +#ifndef _CRT_DIRECTORY_DEFINED +#define _CRT_DIRECTORY_DEFINED + int __cdecl remove(const char *_Filename); + int __cdecl rename(const char *_OldFilename,const char *_NewFilename); + _CRTIMP int __cdecl _unlink(const char *_Filename); +#ifndef NO_OLDNAMES + int __cdecl unlink(const char *_Filename); +#endif +#endif + void __cdecl rewind(FILE *_File); + _CRTIMP int __cdecl _rmtmp(void); + int __cdecl scanf(const char *_Format,...); + void __cdecl setbuf(FILE *_File,char *_Buffer); + _CRTIMP int __cdecl _setmaxstdio(int _Max); + _CRTIMP unsigned int __cdecl _set_output_format(unsigned int _Format); + _CRTIMP unsigned int __cdecl _get_output_format(void); + int __cdecl setvbuf(FILE *_File,char *_Buf,int _Mode,size_t _Size); + _CRTIMP int __cdecl _scprintf(const char *_Format,...); + int __cdecl sscanf(const char *_Src,const char *_Format,...); + _CRTIMP int __cdecl _snscanf(const char *_Src,size_t _MaxCount,const char *_Format,...); + FILE *__cdecl tmpfile(void); + char *__cdecl tmpnam(char *_Buffer); + int __cdecl ungetc(int _Ch,FILE *_File); + int __cdecl vfprintf(FILE *_File,const char *_Format,va_list _ArgList); + int __cdecl vprintf(const char *_Format,va_list _ArgList); + /* Make sure macros are not defined. */ +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma push_macro("vsnprintf") +#pragma push_macro("snprintf") + #undef vsnprintf + #undef snprintf +#endif + extern +#ifdef gnu_printf + __attribute__((format(gnu_printf, 3, 0))) __attribute__((nonnull (3))) +#endif + int __mingw_vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList); + extern +#ifdef gnu_printf + __attribute__((format(gnu_printf, 3, 4))) __attribute__((nonnull (3))) +#endif + int __mingw_snprintf(char* s, size_t n, const char* format, ...); + int __cdecl vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _snprintf(char *_Dest,size_t _Count,const char *_Format,...); + _CRTIMP int __cdecl _vsnprintf(char *_Dest,size_t _Count,const char *_Format,va_list _Args); + int __cdecl sprintf(char *_Dest,const char *_Format,...); + int __cdecl vsprintf(char *_Dest,const char *_Format,va_list _Args); +#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ + int __cdecl snprintf(char* s, size_t n, const char* format, ...); + __CRT_INLINE int __cdecl vsnprintf (char* s, size_t n, const char* format,va_list arg) { + return _vsnprintf ( s, n, format, arg); + } + int __cdecl vscanf(const char * Format, va_list argp); + int __cdecl vfscanf (FILE * fp, const char * Format,va_list argp); + int __cdecl vsscanf (const char * _Str,const char * Format,va_list argp); +#endif +/* Restore may prior defined macros snprintf/vsnprintf. */ +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma pop_macro("snprintf") +#pragma pop_macro("vsnprintf") +#endif +/* Check if vsnprintf and snprintf are defaulting to gnu-style. */ +#if defined(USE_MINGW_GNU_SNPRINTF) && USE_MINGW_GNU_SNPRINTF + #ifndef vsnprint + #define vsnprintf __mingw_vsnprintf + #endif + #ifndef snprintf + #define snprintf __mingw_snprintf + #endif +#else + #ifndef vsnprint + #define vsnprintf _vsnprintf + #endif + #ifndef snprintf + #define snprintf _snprintf + #endif +#endif + + _CRTIMP int __cdecl _vscprintf(const char *_Format,va_list _ArgList); + _CRTIMP int __cdecl _set_printf_count_output(int _Value); + _CRTIMP int __cdecl _get_printf_count_output(); #ifndef _WSTDIO_DEFINED -/* also in wchar.h - keep in sync */ -_CRTIMP int __cdecl __MINGW_NOTHROW fwprintf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wprintf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW swprintf (wchar_t*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _snwprintf (wchar_t*, size_t, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vfwprintf (FILE*, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vwprintf (const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW fwscanf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wscanf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW swscanf (const wchar_t*, const wchar_t*, ...); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwc (wchar_t, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW ungetwc (wchar_t, FILE*); -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, const wchar_t *); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfsopen (const wchar_t*, const wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*); -#endif /* __MSVCRT__ */ - -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg) - { return _vsnwprintf ( s, n, format, arg);} -int __cdecl __MINGW_NOTHROW vwscanf (const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vfwscanf (FILE * __restrict__, - const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vswscanf (const wchar_t * __restrict__, - const wchar_t * __restrict__, __VALIST); +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) #endif +#ifdef _POSIX_ + _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode); +#else + _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag); +#endif + wint_t __cdecl fgetwc(FILE *_File); + _CRTIMP wint_t __cdecl _fgetwchar(void); + wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File); + _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch); + wint_t __cdecl getwc(FILE *_File); + wint_t __cdecl getwchar(void); + wint_t __cdecl putwc(wchar_t _Ch,FILE *_File); + wint_t __cdecl putwchar(wchar_t _Ch); + wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File); + wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File); + int __cdecl fputws(const wchar_t *_Str,FILE *_File); + _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String); + _CRTIMP int __cdecl _putws(const wchar_t *_Str); + int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...); + int __cdecl wprintf(const wchar_t *_Format,...); + _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...); + int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList); + int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...); + _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list); + _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vswprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args); +#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ + int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); + __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) { return _vsnwprintf(s,n,format,arg); } + int __cdecl vwscanf (const wchar_t *, va_list); + int __cdecl vfwscanf (FILE *,const wchar_t *,va_list); + int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list); +#endif + _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args); + +#ifndef RC_INVOKED +#include +#endif + +#ifdef _CRT_NON_CONFORMING_SWPRINTFS +#ifndef __cplusplus +#define swprintf _swprintf +#define vswprintf _vswprintf +#define _swprintf_l __swprintf_l +#define _vswprintf_l __vswprintf_l +#endif +#endif + + _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix); + _CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList); + int __cdecl fwscanf(FILE *_File,const wchar_t *_Format,...); + int __cdecl swscanf(const wchar_t *_Src,const wchar_t *_Format,...); + _CRTIMP int __cdecl _snwscanf(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...); + int __cdecl wscanf(const wchar_t *_Format,...); + _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode); + _CRTIMP FILE *__cdecl _wfopen(const wchar_t *_Filename,const wchar_t *_Mode); + _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile); +#ifndef _CRT_WPERROR_DEFINED +#define _CRT_WPERROR_DEFINED + _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); +#endif + _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode); +#if !defined(NO_OLDNAMES) && !defined(wpopen) +#define wpopen _wpopen +#endif + _CRTIMP int __cdecl _wremove(const wchar_t *_Filename); + _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer); + _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File); + _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File); + _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File); + +#undef _CRT_GETPUTWCHAR_NOINLINE + +#if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) +#define getwchar() fgetwc(stdin) +#define putwchar(_c) fputwc((_c),stdout) +#else + __CRT_INLINE wint_t __cdecl getwchar() { return (fgetwc(stdin)); } + __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) { return (fputwc(_C,stdout)); } +#endif + +#define getwc(_stm) fgetwc(_stm) +#define putwc(_c,_stm) fputwc(_c,_stm) +#define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm) +#define _getwc_nolock(_stm) _fgetwc_nolock(_stm) + #define _WSTDIO_DEFINED -#endif /* _WSTDIO_DEFINED */ +#endif -#ifndef __STRICT_ANSI__ -#ifdef __MSVCRT__ -#ifndef NO_OLDNAMES -_CRTIMP FILE* __cdecl __MINGW_NOTHROW wpopen (const wchar_t*, const wchar_t*); -#endif /* not NO_OLDNAMES */ -#endif /* MSVCRT runtime */ +#define _STDIO_DEFINED +#endif -/* - * Other Non ANSI wide functions - */ -_CRTIMP wint_t __cdecl __MINGW_NOTHROW _fgetwchar (void); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW _fputwchar (wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _getw (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _putw (int, FILE*); +#define _fgetc_nolock(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream)) +#define _fputc_nolock(_c,_stream) (--(_stream)->_cnt >= 0 ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream))) +#define _getc_nolock(_stream) _fgetc_nolock(_stream) +#define _putc_nolock(_c,_stream) _fputc_nolock(_c,_stream) +#define _getchar_nolock() _getc_nolock(stdin) +#define _putchar_nolock(_c) _putc_nolock((_c),stdout) +#define _getwchar_nolock() _getwc_nolock(stdin) +#define _putwchar_nolock(_c) _putwc_nolock((_c),stdout) -#ifndef _NO_OLDNAMES -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwchar (void); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwchar (wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW getw (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW putw (int, FILE*); -#endif /* Not _NO_OLDNAMES */ + _CRTIMP void __cdecl _lock_file(FILE *_File); + _CRTIMP void __cdecl _unlock_file(FILE *_File); + _CRTIMP int __cdecl _fclose_nolock(FILE *_File); + _CRTIMP int __cdecl _fflush_nolock(FILE *_File); + _CRTIMP size_t __cdecl _fread_nolock(void *_DstBuf,size_t _ElementSize,size_t _Count,FILE *_File); + _CRTIMP int __cdecl _fseek_nolock(FILE *_File,long _Offset,int _Origin); + _CRTIMP long __cdecl _ftell_nolock(FILE *_File); + _CRTIMP int __cdecl _fseeki64_nolock(FILE *_File,__int64 _Offset,int _Origin); + _CRTIMP __int64 __cdecl _ftelli64_nolock(FILE *_File); + _CRTIMP size_t __cdecl _fwrite_nolock(const void *_DstBuf,size_t _Size,size_t _Count,FILE *_File); + _CRTIMP int __cdecl _ungetc_nolock(int _Ch,FILE *_File); -#endif /* __STRICT_ANSI */ +#if !defined(NO_OLDNAMES) || !defined(_POSIX) +#define P_tmpdir _P_tmpdir +#define SYS_OPEN _SYS_OPEN + + char *__cdecl tempnam(const char *_Directory,const char *_FilePrefix); + int __cdecl fcloseall(void); + FILE *__cdecl fdopen(int _FileHandle,const char *_Format); + int __cdecl fgetchar(void); + int __cdecl fileno(FILE *_File); + int __cdecl flushall(void); + int __cdecl fputchar(int _Ch); + int __cdecl getw(FILE *_File); + int __cdecl putw(int _Ch,FILE *_File); + int __cdecl rmtmp(void); +#endif #ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ +#pragma pack(pop) -#endif /* _STDIO_H_ */ +#include + +#endif diff --git a/reactos/include/crt/stdlib.h b/reactos/include/crt/stdlib.h index 73d141eb586..9b793def43c 100644 --- a/reactos/include/crt/stdlib.h +++ b/reactos/include/crt/stdlib.h @@ -1,544 +1,586 @@ -/* - * stdlib.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Definitions for common types, variables, and functions. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_STDLIB +#define _INC_STDLIB -#ifndef _STDLIB_H_ -#define _STDLIB_H_ - -/* All the headers include this file. */ #include <_mingw.h> +#include -#define __need_size_t -#define __need_wchar_t -#define __need_NULL -#ifndef RC_INVOKED -#include -#endif /* RC_INVOKED */ - -/* - * RAND_MAX is the maximum value that may be returned by rand. - * The minimum is zero. - */ -#define RAND_MAX 0x7FFF - -/* - * These values may be used as exit status codes. - */ -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 - -/* - * Definitions for path name functions. - * NOTE: All of these values have simply been chosen to be conservatively high. - * Remember that with long file names we can no longer depend on - * extensions being short. - */ -#ifndef __STRICT_ANSI__ - -#ifndef MAX_PATH -#define MAX_PATH (260) -#endif - -#define _MAX_PATH MAX_PATH -#define _MAX_DRIVE (3) -#define _MAX_DIR 256 -#define _MAX_FNAME 256 -#define _MAX_EXT 256 - -#endif /* Not __STRICT_ANSI__ */ - - -#ifndef RC_INVOKED +#pragma pack(push,_CRT_PACKING) #ifdef __cplusplus extern "C" { #endif -#if !defined (__STRICT_ANSI__) +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif -/* - * This seems like a convenient place to declare these variables, which - * give programs using WinMain (or main for that matter) access to main-ish - * argc and argv. environ is a pointer to a table of environment variables. - * NOTE: Strings in _argv and environ are ANSI strings. - */ -extern int _argc; -extern char** _argv; +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 -/* imports from runtime dll of the above variables */ -#ifdef __MSVCRT__ +#ifndef _ONEXIT_T_DEFINED +#define _ONEXIT_T_DEFINED -extern int* __cdecl __MINGW_NOTHROW __p___argc(void); -extern char*** __cdecl __MINGW_NOTHROW __p___argv(void); -extern wchar_t*** __cdecl __MINGW_NOTHROW __p___wargv(void); + typedef int (__cdecl *_onexit_t)(void); -#define __argc (*__p___argc()) -#define __argv (*__p___argv()) -#define __wargv (*__p___wargv()) +#ifndef NO_OLDNAMES +#define onexit_t _onexit_t +#endif +#endif -#else /* !MSVCRT */ +#ifndef _DIV_T_DEFINED +#define _DIV_T_DEFINED -#ifndef __DECLSPEC_SUPPORTED + typedef struct _div_t { + int quot; + int rem; + } div_t; -extern int* _imp____argc_dll; -extern char*** _imp____argv_dll; -#define __argc (*_imp____argc_dll) -#define __argv (*_imp____argv_dll) + typedef struct _ldiv_t { + long quot; + long rem; + } ldiv_t; +#endif -#else /* __DECLSPEC_SUPPORTED */ +#ifndef _CRT_DOUBLE_DEC +#define _CRT_DOUBLE_DEC -__MINGW_IMPORT int __argc_dll; -__MINGW_IMPORT char** __argv_dll; -#define __argc __argc_dll -#define __argv __argv_dll +#pragma pack(4) + typedef struct { + unsigned char ld[10]; + } _LDOUBLE; +#pragma pack() -#endif /* __DECLSPEC_SUPPORTED */ +#define _PTR_LD(x) ((unsigned char *)(&(x)->ld)) + + typedef struct { + double x; + } _CRT_DOUBLE; + + typedef struct { + float f; + } _CRT_FLOAT; +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma push_macro("long") +#undef long +#endif + + typedef struct { + long double x; + } _LONGDOUBLE; + +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma pop_macro("long") +#endif + +#pragma pack(4) + typedef struct { + unsigned char ld12[12]; + } _LDBL12; +#pragma pack() +#endif + +#define RAND_MAX 0x7fff -#endif /* __MSVCRT */ -#endif /* __STRICT_ANSI__ */ -/* - * Also defined in ctype.h. - */ #ifndef MB_CUR_MAX -#ifdef __DECLSPEC_SUPPORTED -# ifdef __MSVCRT__ -# define MB_CUR_MAX __mb_cur_max - __MINGW_IMPORT int __mb_cur_max; -# else /* not __MSVCRT */ -# define MB_CUR_MAX __mb_cur_max_dll - __MINGW_IMPORT int __mb_cur_max_dll; -# endif /* not __MSVCRT */ - -#else /* ! __DECLSPEC_SUPPORTED */ -# ifdef __MSVCRT__ - extern int* _imp____mbcur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# else /* not __MSVCRT */ - extern int* _imp____mbcur_max_dll; -# define MB_CUR_MAX (*_imp____mb_cur_max_dll) -# endif /* not __MSVCRT */ -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* MB_CUR_MAX */ - -/* - * MS likes to declare errno in stdlib.h as well. - */ - -#ifdef _UWIN -#undef errno -extern int errno; +#define MB_CUR_MAX ___mb_cur_max_func() +#ifndef __mb_cur_max +#ifdef _MSVCRT_ + extern int __mb_cur_max; #else - _CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void); -#define errno (*_errno()) +#define __mb_cur_max (*_imp____mb_cur_max) + extern int *_imp____mb_cur_max; +#endif +#endif +#ifdef _MSVCRT_ + extern int __mbcur_max; +#define ___mb_cur_max_func() (__mb_cur_max) +#else + extern int* _imp____mbcur_max; +#define ___mb_cur_max_func() (*_imp____mb_cur_max) +#endif #endif - _CRTIMP int* __cdecl __MINGW_NOTHROW __doserrno(void); -#define _doserrno (*__doserrno()) -#if !defined (__STRICT_ANSI__) -/* - * Use environ from the DLL, not as a global. - */ +#define __max(a,b) (((a) > (b)) ? (a) : (b)) +#define __min(a,b) (((a) < (b)) ? (a) : (b)) -#ifdef __MSVCRT__ - extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void); - extern _CRTIMP wchar_t *** __cdecl __MINGW_NOTHROW __p__wenviron(void); -# define _environ (*__p__environ()) -# define _wenviron (*__p__wenviron()) -#else /* ! __MSVCRT__ */ -# ifndef __DECLSPEC_SUPPORTED - extern char *** _imp___environ_dll; -# define _environ (*_imp___environ_dll) -# else /* __DECLSPEC_SUPPORTED */ - __MINGW_IMPORT char ** _environ_dll; -# define _environ _environ_dll -# endif /* __DECLSPEC_SUPPORTED */ -#endif /* ! __MSVCRT__ */ +#define _MAX_PATH 260 +#define _MAX_DRIVE 3 +#define _MAX_DIR 256 +#define _MAX_FNAME 256 +#define _MAX_EXT 256 -#define environ _environ +#define _OUT_TO_DEFAULT 0 +#define _OUT_TO_STDERR 1 +#define _OUT_TO_MSGBOX 2 +#define _REPORT_ERRMODE 3 -#ifdef __MSVCRT__ -/* One of the MSVCRTxx libraries */ +#define _WRITE_ABORT_MSG 0x1 +#define _CALL_REPORTFAULT 0x2 -#ifndef __DECLSPEC_SUPPORTED +#define _MAX_ENV 32767 + + typedef void (__cdecl *_purecall_handler)(void); + + _CRTIMP _purecall_handler __cdecl _set_purecall_handler(_purecall_handler _Handler); + _CRTIMP _purecall_handler __cdecl _get_purecall_handler(); + + typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t); + _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler); + _invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void); + +#ifndef _CRT_ERRNO_DEFINED +#define _CRT_ERRNO_DEFINED + _CRTIMP extern int *__cdecl _errno(void); +#define errno (*_errno()) + errno_t __cdecl _set_errno(int _Value); + errno_t __cdecl _get_errno(int *_Value); +#endif + _CRTIMP unsigned long *__cdecl __doserrno(void); +#define _doserrno (*__doserrno()) + errno_t __cdecl _set_doserrno(unsigned long _Value); + errno_t __cdecl _get_doserrno(unsigned long *_Value); + +#ifdef _MSVCRT_ extern int* _imp___sys_nerr; -# define sys_nerr (*_imp___sys_nerr) -#else /* __DECLSPEC_SUPPORTED */ + extern char*** _imp__sys_errlist; +#else __MINGW_IMPORT int _sys_nerr; -# ifndef _UWIN -# define sys_nerr _sys_nerr -# endif /* _UWIN */ -#endif /* __DECLSPEC_SUPPORTED */ - -#else /* ! __MSVCRT__ */ - -/* CRTDLL run time library */ - -#ifndef __DECLSPEC_SUPPORTED - extern int* _imp___sys_nerr_dll; -# define sys_nerr (*_imp___sys_nerr_dll) -#else /* __DECLSPEC_SUPPORTED */ - __MINGW_IMPORT int _sys_nerr_dll; -# define sys_nerr _sys_nerr_dll -#endif /* __DECLSPEC_SUPPORTED */ - -#endif /* ! __MSVCRT__ */ - -#ifndef __DECLSPEC_SUPPORTED -extern char*** _imp__sys_errlist; -#define sys_errlist (*_imp___sys_errlist) -#else /* __DECLSPEC_SUPPORTED */ -__MINGW_IMPORT char* _sys_errlist[]; -#ifndef _UWIN -#define sys_errlist _sys_errlist -#endif /* _UWIN */ -#endif /* __DECLSPEC_SUPPORTED */ - -/* - * OS version and such constants. - */ - -#ifdef __MSVCRT__ -/* msvcrtxx.dll */ - -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__osver(void); -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winver(void); -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winmajor(void); -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winminor(void); - -#ifndef __DECLSPEC_SUPPORTED -# define _osver (*__p__osver()) -# define _winver (*__p__winver()) -# define _winmajor (*__p__winmajor()) -# define _winminor (*__p__winminor()) -#else -__MINGW_IMPORT unsigned int _osver; -__MINGW_IMPORT unsigned int _winver; -__MINGW_IMPORT unsigned int _winmajor; -__MINGW_IMPORT unsigned int _winminor; -#endif /* __DECLSPEC_SUPPORTED */ - -#else -/* Not msvcrtxx.dll, thus crtdll.dll */ - -#ifndef __DECLSPEC_SUPPORTED - -extern unsigned int* _imp___osver_dll; -extern unsigned int* _imp___winver_dll; -extern unsigned int* _imp___winmajor_dll; -extern unsigned int* _imp___winminor_dll; - -#define _osver (*_imp___osver_dll) -#define _winver (*_imp___winver_dll) -#define _winmajor (*_imp___winmajor_dll) -#define _winminor (*_imp___winminor_dll) - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT unsigned int _osver_dll; -__MINGW_IMPORT unsigned int _winver_dll; -__MINGW_IMPORT unsigned int _winmajor_dll; -__MINGW_IMPORT unsigned int _winminor_dll; - -#define _osver _osver_dll -#define _winver _winver_dll -#define _winmajor _winmajor_dll -#define _winminor _winminor_dll - -#endif /* __DECLSPEC_SUPPORTED */ - + __MINGW_IMPORT char* _sys_errlist[]; #endif -#if defined __MSVCRT__ -/* although the _pgmptr is exported as DATA, - * be safe and use the access function __p__pgmptr() to get it. */ -_CRTIMP char** __cdecl __MINGW_NOTHROW __p__pgmptr(void); -#define _pgmptr (*__p__pgmptr()) -_CRTIMP wchar_t** __cdecl __MINGW_NOTHROW __p__wpgmptr(void); -#define _wpgmptr (*__p__wpgmptr()) -#else /* ! __MSVCRT__ */ -# ifndef __DECLSPEC_SUPPORTED - extern char** __imp__pgmptr_dll; -# define _pgmptr (*_imp___pgmptr_dll) -# else /* __DECLSPEC_SUPPORTED */ - __MINGW_IMPORT char* _pgmptr_dll; -# define _pgmptr _pgmptr_dll -# endif /* __DECLSPEC_SUPPORTED */ -/* no wide version in CRTDLL */ -#endif /* __MSVCRT__ */ - -/* - * This variable determines the default file mode. - * TODO: Which flags work? - */ -#if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME) - -#ifdef __MSVCRT__ -extern int* _imp___fmode; -#define _fmode (*_imp___fmode) +//#if (defined(_X86_) && !defined(__x86_64)) + _CRTIMP int *__cdecl __p___argc(void); + _CRTIMP char ***__cdecl __p___argv(void); + _CRTIMP wchar_t ***__cdecl __p___wargv(void); + _CRTIMP char ***__cdecl __p__environ(void); + _CRTIMP wchar_t ***__cdecl __p__wenviron(void); + _CRTIMP char **__cdecl __p__pgmptr(void); + _CRTIMP wchar_t **__cdecl __p__wpgmptr(void); +//#endif +#ifndef __argc +#ifdef _MSVCRT_ + extern int __argc; #else -/* CRTDLL */ -extern int* _imp___fmode_dll; -#define _fmode (*_imp___fmode_dll) +#define __argc (*_imp____argc) + extern int *_imp____argc; +#endif +#endif +#ifndef __argv +#ifdef _MSVCRT_ + extern char **__argv; +#else +#define __argv (*_imp____argv) + extern char ***_imp____argv; +#endif +#endif +#ifndef __wargv +#ifdef _MSVCRT_ + extern wchar_t **__wargv; +#else +#define __wargv (*_imp____wargv) + extern wchar_t ***_imp____wargv; +#endif #endif -#else /* __DECLSPEC_SUPPORTED */ - -#ifdef __MSVCRT__ -__MINGW_IMPORT int _fmode; -#else /* ! __MSVCRT__ */ -__MINGW_IMPORT int _fmode_dll; -#define _fmode _fmode_dll -#endif /* ! __MSVCRT__ */ - -#endif /* __DECLSPEC_SUPPORTED */ - -#endif /* Not __STRICT_ANSI__ */ - -_CRTIMP double __cdecl __MINGW_NOTHROW atof (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*); -_CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*); -#if !defined (__STRICT_ANSI__) -_CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *); -_CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *); +#ifdef _POSIX_ + extern char **environ; +#else +#ifndef _environ +#ifdef _MSVCRT_ + extern char **_environ; +#else +#define _environ (*_imp___environ) + extern char ***_imp___environ; #endif -_CRTIMP double __cdecl __MINGW_NOTHROW strtod (const char*, char**); -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -float __cdecl __MINGW_NOTHROW strtof (const char * __restrict__, char ** __restrict__); -long double __cdecl __MINGW_NOTHROW strtold (const char * __restrict__, char ** __restrict__); +#endif + +#ifndef _wenviron +#ifdef _MSVCRT_ + extern wchar_t **_wenviron; +#else +#define _wenviron (*_imp___wenviron) + extern wchar_t ***_imp___wenviron; +#endif +#endif +#endif +#ifndef _pgmptr +#ifdef _MSVCRT_ + extern char *_pgmptr; +#else +#define _pgmptr (*_imp___pgmptr) + extern char **_imp___pgmptr; +#endif +#endif + +#ifndef _wpgmptr +#ifdef _MSVCRT_ + extern wchar_t *_wpgmptr; +#else +#define _wpgmptr (*_imp___wpgmptr) + extern wchar_t **_imp___wpgmptr; +#endif +#endif + errno_t __cdecl _get_pgmptr(char **_Value); + errno_t __cdecl _get_wpgmptr(wchar_t **_Value); +#ifndef _fmode +#ifdef _MSVCRT_ + extern int _fmode; +#else +#define _fmode (*_imp___fmode) + extern int *_imp___fmode; +#endif +#endif + _CRTIMP errno_t __cdecl _set_fmode(int _Mode); + _CRTIMP errno_t __cdecl _get_fmode(int *_PMode); + +#ifndef _osplatform +#ifdef _MSVCRT_ + extern unsigned int _osplatform; +#else +#define _osplatform (*_imp___osplatform) + extern unsigned int *_imp___osplatform; +#endif +#endif + +#ifndef _osver +#ifdef _MSVCRT_ + extern unsigned int _osver; +#else +#define _osver (*_imp___osver) + extern unsigned int *_imp___osver; +#endif +#endif + +#ifndef _winver +#ifdef _MSVCRT_ + extern unsigned int _winver; +#else +#define _winver (*_imp___winver) + extern unsigned int *_imp___winver; +#endif +#endif + +#ifndef _winmajor +#ifdef _MSVCRT_ + extern unsigned int _winmajor; +#else +#define _winmajor (*_imp___winmajor) + extern unsigned int *_imp___winmajor; +#endif +#endif + +#ifndef _winminor +#ifdef _MSVCRT_ + extern unsigned int _winminor; +#else +#define _winminor (*_imp___winminor) + extern unsigned int *_imp___winminor; +#endif +#endif + + errno_t __cdecl _get_osplatform(unsigned int *_Value); + errno_t __cdecl _get_osver(unsigned int *_Value); + errno_t __cdecl _get_winver(unsigned int *_Value); + errno_t __cdecl _get_winmajor(unsigned int *_Value); + errno_t __cdecl _get_winminor(unsigned int *_Value); +#ifndef _countof +#ifndef __cplusplus +#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0])) +#else + extern "C++" { + template char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; +#define _countof(_Array) sizeof(*__countof_helper(_Array)) + } +#endif +#endif + +#ifndef _CRT_TERMINATE_DEFINED +#define _CRT_TERMINATE_DEFINED + __declspec(noreturn) void __cdecl exit(int _Code); + _CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code); +#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ + /* C99 function name */ + void __cdecl __declspec(noreturn) _Exit(int); /* Declare to get noreturn attribute. */ + __CRT_INLINE void __cdecl _Exit(int status) + { _exit(status); } +#endif +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma push_macro("abort") +#undef abort +#endif + void __cdecl __declspec(noreturn) abort(void); +#ifdef _WIN64 //hack for old gcc in ROSBE +#pragma pop_macro("abort") +#endif +#endif + + _CRTIMP unsigned int __cdecl _set_abort_behavior(unsigned int _Flags,unsigned int _Mask); + +#ifndef _CRT_ABS_DEFINED +#define _CRT_ABS_DEFINED + int __cdecl abs(int _X); + long __cdecl labs(long _X); +#endif + +#if _INTEGRAL_MAX_BITS >= 64 + __int64 __cdecl _abs64(__int64); +#endif + int __cdecl atexit(void (__cdecl *)(void)); +#ifndef _CRT_ATOF_DEFINED +#define _CRT_ATOF_DEFINED + double __cdecl atof(const char *_String); + double __cdecl _atof_l(const char *_String,_locale_t _Locale); +#endif + int __cdecl atoi(const char *_Str); + _CRTIMP int __cdecl _atoi_l(const char *_Str,_locale_t _Locale); + long __cdecl atol(const char *_Str); + _CRTIMP long __cdecl _atol_l(const char *_Str,_locale_t _Locale); +#ifndef _CRT_ALGO_DEFINED +#define _CRT_ALGO_DEFINED + void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); + void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *)); +#endif + /*unsigned short __cdecl _byteswap_ushort(unsigned short _Short); */ + /*unsigned long __cdecl _byteswap_ulong (unsigned long _Long); */ +#if _INTEGRAL_MAX_BITS >= 64 + /*unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64);*/ +#endif + div_t __cdecl div(int _Numerator,int _Denominator); + char *__cdecl getenv(const char *_VarName); + _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix); + + _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix); + _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix); + _CRTIMP __int64 __cdecl _atoi64(const char *_String); + _CRTIMP __int64 __cdecl _atoi64_l(const char *_String,_locale_t _Locale); + _CRTIMP __int64 __cdecl _strtoi64(const char *_String,char **_EndPtr,int _Radix); + _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale); + _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix); + _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale); + + ldiv_t __cdecl ldiv(long _Numerator,long _Denominator); + _CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix); + int __cdecl mblen(const char *_Ch,size_t _MaxCount); + _CRTIMP int __cdecl _mblen_l(const char *_Ch,size_t _MaxCount,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbstrlen(const char *_Str); + _CRTIMP size_t __cdecl _mbstrlen_l(const char *_Str,_locale_t _Locale); + _CRTIMP size_t __cdecl _mbstrnlen(const char *_Str,size_t _MaxCount); + _CRTIMP size_t __cdecl _mbstrnlen_l(const char *_Str,size_t _MaxCount,_locale_t _Locale); + int __cdecl mbtowc(wchar_t *_DstCh,const char *_SrcCh,size_t _SrcSizeInBytes); + _CRTIMP int __cdecl _mbtowc_l(wchar_t *_DstCh,const char *_SrcCh,size_t _SrcSizeInBytes,_locale_t _Locale); + size_t __cdecl mbstowcs(wchar_t *_Dest,const char *_Source,size_t _MaxCount); + _CRTIMP size_t __cdecl _mbstowcs_l(wchar_t *_Dest,const char *_Source,size_t _MaxCount,_locale_t _Locale); + int __cdecl rand(void); + _CRTIMP int __cdecl _set_error_mode(int _Mode); + void __cdecl srand(unsigned int _Seed); + double __cdecl strtod(const char *_Str,char **_EndPtr); + float __cdecl strtof(const char *nptr, char **endptr); +#if !defined __NO_ISOCEXT /* in libmingwex.a */ + float __cdecl strtof (const char * __restrict__, char ** __restrict__); + long double __cdecl strtold(const char * __restrict__, char ** __restrict__); #endif /* __NO_ISOCEXT */ + _CRTIMP double __cdecl _strtod_l(const char *_Str,char **_EndPtr,_locale_t _Locale); + long __cdecl strtol(const char *_Str,char **_EndPtr,int _Radix); + _CRTIMP long __cdecl _strtol_l(const char *_Str,char **_EndPtr,int _Radix,_locale_t _Locale); + unsigned long __cdecl strtoul(const char *_Str,char **_EndPtr,int _Radix); + _CRTIMP unsigned long __cdecl _strtoul_l(const char *_Str,char **_EndPtr,int _Radix,_locale_t _Locale); +#ifndef _CRT_SYSTEM_DEFINED +#define _CRT_SYSTEM_DEFINED + int __cdecl system(const char *_Command); +#endif + _CRTIMP char *__cdecl _ultoa(unsigned long _Value,char *_Dest,int _Radix); + int __cdecl wctomb(char *_MbCh,wchar_t _WCh); + _CRTIMP int __cdecl _wctomb_l(char *_MbCh,wchar_t _WCh,_locale_t _Locale); + size_t __cdecl wcstombs(char *_Dest,const wchar_t *_Source,size_t _MaxCount); + _CRTIMP size_t __cdecl _wcstombs_l(char *_Dest,const wchar_t *_Source,size_t _MaxCount,_locale_t _Locale); -_CRTIMP long __cdecl __MINGW_NOTHROW strtol (const char*, char**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int); +#ifndef _CRT_ALLOCATION_DEFINED +#define _CRT_ALLOCATION_DEFINED + void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements); + void __cdecl free(void *_Memory); + void *__cdecl malloc(size_t _Size); + void *__cdecl realloc(void *_Memory,size_t _NewSize); + _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size); + //_CRTIMP void __cdecl _aligned_free(void *_Memory); + //_CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment); + _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset); + _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment); + _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment); + _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset); + _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset); +#endif #ifndef _WSTDLIB_DEFINED -/* also declared in wchar.h */ -_CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int); -_CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**); -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -float __cdecl __MINGW_NOTHROW wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__); -long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); -#endif /* __NO_ISOCEXT */ -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t); -#endif #define _WSTDLIB_DEFINED + + _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix); + _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix); + _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix); + double __cdecl wcstod(const wchar_t *_Str,wchar_t **_EndPtr); + float __cdecl wcstof(const wchar_t *nptr, wchar_t **endptr); +#if !defined __NO_ISOCEXT /* in libmingwex.a */ + float __cdecl wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__); + long double __cdecl wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__); +#endif /* __NO_ISOCEXT */ + _CRTIMP double __cdecl _wcstod_l(const wchar_t *_Str,wchar_t **_EndPtr,_locale_t _Locale); + long __cdecl wcstol(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP long __cdecl _wcstol_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); + unsigned long __cdecl wcstoul(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName); +#ifndef _CRT_WSYSTEM_DEFINED +#define _CRT_WSYSTEM_DEFINED + _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); +#endif + _CRTIMP double __cdecl _wtof(const wchar_t *_Str); + _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale); + _CRTIMP int __cdecl _wtoi(const wchar_t *_Str); + _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale); + _CRTIMP long __cdecl _wtol(const wchar_t *_Str); + _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale); + + _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix); + _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix); + _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str); + _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale); + _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); + _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); + #endif -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcstombs (char*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wctomb (char*, wchar_t); +#ifndef _POSIX_ +#define _CVTBUFSIZE (309+40) + _CRTIMP char *__cdecl _fullpath(char *_FullPath,const char *_Path,size_t _SizeInBytes); + _CRTIMP char *__cdecl _ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign); + _CRTIMP char *__cdecl _fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign); + _CRTIMP char *__cdecl _gcvt(double _Val,int _NumOfDigits,char *_DstBuf); + _CRTIMP int __cdecl _atodbl(_CRT_DOUBLE *_Result,char *_Str); + _CRTIMP int __cdecl _atoldbl(_LDOUBLE *_Result,char *_Str); + _CRTIMP int __cdecl _atoflt(_CRT_FLOAT *_Result,char *_Str); + _CRTIMP int __cdecl _atodbl_l(_CRT_DOUBLE *_Result,char *_Str,_locale_t _Locale); + _CRTIMP int __cdecl _atoldbl_l(_LDOUBLE *_Result,char *_Str,_locale_t _Locale); + _CRTIMP int __cdecl _atoflt_l(_CRT_FLOAT *_Result,char *_Str,_locale_t _Locale); + _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST; + _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST; + _CRTIMP void __cdecl _makepath(char *_Path,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext); + _onexit_t __cdecl _onexit(_onexit_t _Func); -_CRTIMP int __cdecl __MINGW_NOTHROW mblen (const char*, size_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW mbstowcs (wchar_t*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW mbtowc (wchar_t*, const char*, size_t); +#ifndef _CRT_PERROR_DEFINED +#define _CRT_PERROR_DEFINED + void __cdecl perror(const char *_ErrMsg); +#endif + _CRTIMP int __cdecl _putenv(const char *_EnvString); + //_CRTIMP unsigned int __cdecl _rotl(unsigned int, int) __MINGW_ATTRIB_CONST; +#if _INTEGRAL_MAX_BITS >= 64 + //_CRTIMP unsigned __int64 __cdecl _rotl64(unsigned __int64, int) __MINGW_ATTRIB_CONST; +#endif + //_CRTIMP unsigned int __cdecl _rotr(unsigned int, int) __MINGW_ATTRIB_CONST; +#if _INTEGRAL_MAX_BITS >= 64 + //_CRTIMP unsigned __int64 __cdecl _rotr64(unsigned __int64, int) __MINGW_ATTRIB_CONST; +#endif + _CRTIMP void __cdecl _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath); + _CRTIMP void __cdecl _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext); + _CRTIMP void __cdecl _swab(char *_Buf1,char *_Buf2,int _SizeInBytes); -_CRTIMP int __cdecl __MINGW_NOTHROW rand (void); -_CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int); +#ifndef _WSTDLIBP_DEFINED +#define _WSTDLIBP_DEFINED + _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords); + _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); +#ifndef _CRT_WPERROR_DEFINED +#define _CRT_WPERROR_DEFINED + _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); +#endif + _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString); + _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath); + _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext); +#endif -_CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC; -_CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC; -_CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t); -_CRTIMP void __cdecl __MINGW_NOTHROW free (void*); -_CRTIMP void __cdecl __MINGW_NOTHROW abort (void) __MINGW_ATTRIB_NORETURN; -_CRTIMP void __cdecl __MINGW_NOTHROW exit (int) __MINGW_ATTRIB_NORETURN; + _CRTIMP void __cdecl _beep(unsigned _Frequency,unsigned _Duration) __MINGW_ATTRIB_DEPRECATED; + /* Not to be confused with _set_error_mode (int). */ + _CRTIMP void __cdecl _seterrormode(int _Mode) __MINGW_ATTRIB_DEPRECATED; + _CRTIMP void __cdecl _sleep(unsigned long _Duration) __MINGW_ATTRIB_DEPRECATED; +#endif -/* Note: This is in startup code, not imported directly from dll */ -int __cdecl __MINGW_NOTHROW atexit (void (*)(void)); - -_CRTIMP int __cdecl __MINGW_NOTHROW system (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*); - -/* bsearch and qsort are also in non-ANSI header search.h */ -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, - int (*)(const void*, const void*)); -_CRTIMP void __cdecl qsort(void*, size_t, size_t, - int (*)(const void*, const void*)); - -_CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST; -_CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST; - -/* - * div_t and ldiv_t are structures used to return the results of div and - * ldiv. - * - * NOTE: div and ldiv appear not to work correctly unless - * -fno-pcc-struct-return is specified. This is included in the - * mingw32 specs file. - */ -typedef struct { int quot, rem; } div_t; -typedef struct { long quot, rem; } ldiv_t; - -_CRTIMP div_t __cdecl __MINGW_NOTHROW div (int, int) __MINGW_ATTRIB_CONST; -_CRTIMP ldiv_t __cdecl __MINGW_NOTHROW ldiv (long, long) __MINGW_ATTRIB_CONST; - -#if !defined (__STRICT_ANSI__) - -/* - * NOTE: Officially the three following functions are obsolete. The Win32 API - * functions SetErrorMode, Beep and Sleep are their replacements. - */ -_CRTIMP void __cdecl __MINGW_NOTHROW _beep (unsigned int, unsigned int) __MINGW_ATTRIB_DEPRECATED; -/* Not to be confused with _set_error_mode (int). */ -_CRTIMP void __cdecl __MINGW_NOTHROW _seterrormode (int) __MINGW_ATTRIB_DEPRECATED; -_CRTIMP void __cdecl __MINGW_NOTHROW _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED; - -_CRTIMP void __cdecl __MINGW_NOTHROW _exit (int) __MINGW_ATTRIB_NORETURN; - -/* _onexit is MS extension. Use atexit for portability. */ -/* Note: This is in startup code, not imported directly from dll */ -typedef int (* _onexit_t)(void); -_onexit_t __cdecl __MINGW_NOTHROW _onexit( _onexit_t ); - -_CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*); - - -_CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*); - -_CRTIMP void __cdecl __MINGW_NOTHROW _makepath (char*, const char*, const char*, const char*, const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _splitpath (const char*, char*, char*, char*, char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t); - -_CRTIMP char* __cdecl __MINGW_NOTHROW _itoa (int, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ltoa (long, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ultoa(unsigned long, char*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _itow (int, wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int); - -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *); - -#ifdef __MSVCRT__ -_CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int); - - -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotl(unsigned int, int) __MINGW_ATTRIB_CONST; -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotr(unsigned int, int) __MINGW_ATTRIB_CONST; -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST; -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST; - -_CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int); -#define _OUT_TO_DEFAULT 0 -#define _OUT_TO_STDERR 1 -#define _OUT_TO_MSGBOX 2 -#define _REPORT_ERRMODE 3 - -#if __MSVCRT_VERSION__ >= 0x800 -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 - typedef __int64 intptr_t; -#else - typedef int intptr_t; +#ifndef NO_OLDNAMES +#ifndef _POSIX_ +#if 0 +#ifndef __cplusplus +#ifndef NOMINMAX +#ifndef max +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif +#endif #endif #endif -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int); -/* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */ -#define _WRITE_ABORT_MSG 1 -#define _CALL_REPORTFAULT 2 -typedef void (* _invalid_parameter_handler) (const wchar_t *, - const wchar_t *, - const wchar_t *, - unsigned int, - uintptr_t); -_invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler); -#endif /* __MSVCRT_VERSION__ >= 0x800 */ -#endif /* __MSVCRT__ */ - -#ifndef _NO_OLDNAMES - -_CRTIMP int __cdecl __MINGW_NOTHROW putenv (const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW searchenv (const char*, const char*, char*); - -_CRTIMP char* __cdecl __MINGW_NOTHROW itoa (int, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW ltoa (long, char*, int); - -#ifndef _UWIN -_CRTIMP char* __cdecl __MINGW_NOTHROW ecvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW fcvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW gcvt (double, int, char*); -#endif /* _UWIN */ -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not __STRICT_ANSI__ */ - -/* C99 names */ +#define sys_errlist (*_imp___sys_errlist) +#define sys_nerr (*_imp___sys_nerr) +#define environ _environ + char *__cdecl ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign); + char *__cdecl fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign); + char *__cdecl gcvt(double _Val,int _NumOfDigits,char *_DstBuf); + char *__cdecl itoa(int _Val,char *_DstBuf,int _Radix); + char *__cdecl ltoa(long _Val,char *_DstBuf,int _Radix); + int __cdecl putenv(const char *_EnvString); + void __cdecl swab(char *_Buf1,char *_Buf2,int _SizeInBytes); + char *__cdecl ultoa(unsigned long _Val,char *_Dstbuf,int _Radix); + onexit_t __cdecl onexit(onexit_t _Func); +#endif +#endif #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ -/* C99 name for _exit */ -void __cdecl __MINGW_NOTHROW _Exit(int) __MINGW_ATTRIB_NORETURN; -#ifndef __STRICT_ANSI__ /* inline using non-ansi functions */ -__CRT_INLINE void __cdecl __MINGW_NOTHROW _Exit(int __status) - { _exit (__status); } -#endif + typedef struct { long long quot, rem; } lldiv_t; -typedef struct { long long quot, rem; } lldiv_t; + lldiv_t __cdecl lldiv(long long, long long); -lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST; + __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); } -long long __cdecl __MINGW_NOTHROW llabs(long long); -__CRT_INLINE long long __cdecl __MINGW_NOTHROW llabs(long long _j) - {return (_j >= 0 ? _j : -_j);} + long long __cdecl strtoll(const char* __restrict__, char** __restrict, int); + unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int); -long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int); -unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int); + /* these are stubs for MS _i64 versions */ + long long __cdecl atoll (const char *); -#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ -long long __cdecl __MINGW_NOTHROW atoll (const char *); +#ifndef __STRICT_ANSI__ + long long __cdecl wtoll (const wchar_t *); + char *__cdecl lltoa (long long, char *, int); + char *__cdecl ulltoa (unsigned long long , char *, int); + wchar_t *__cdecl lltow (long long, wchar_t *, int); + wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int); -#if !defined (__STRICT_ANSI__) -long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t *); -char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int); -char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int); -wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int); -wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int); - - /* inline using non-ansi functions */ -__CRT_INLINE long long __cdecl __MINGW_NOTHROW atoll (const char * _c) - { return _atoi64 (_c); } -__CRT_INLINE char* __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i) - { return _i64toa (_n, _c, _i); } -__CRT_INLINE char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i) - { return _ui64toa (_n, _c, _i); } -__CRT_INLINE long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w) - { return _wtoi64 (_w); } -__CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i) - { return _i64tow (_n, _w, _i); } -__CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i) - { return _ui64tow (_n, _w, _i); } + /* __CRT_INLINE using non-ansi functions */ + __CRT_INLINE long long __cdecl atoll (const char * _c) { return _atoi64 (_c); } + __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); } + __CRT_INLINE char *__cdecl ulltoa (unsigned long long _n, char * _c, int _i) { return _ui64toa (_n, _c, _i); } + __CRT_INLINE long long __cdecl wtoll (const wchar_t * _w) { return _wtoi64 (_w); } + __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); } + __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); } #endif /* (__STRICT_ANSI__) */ -#endif /* __MSVCRT__ */ - #endif /* !__NO_ISOCEXT */ - #ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _STDLIB_H_ */ +#pragma pack(pop) +#include +#include +#endif diff --git a/reactos/include/crt/string.h b/reactos/include/crt/string.h index 62bdb3f10d1..f766137515a 100644 --- a/reactos/include/crt/string.h +++ b/reactos/include/crt/string.h @@ -1,195 +1,169 @@ -/* - * string.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Definitions for memory and string functions. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_STRING +#define _INC_STRING -#ifndef _STRING_H_ -#define _STRING_H_ - -/* All the headers include this file. */ #include <_mingw.h> -/* - * Define size_t, wchar_t and NULL - */ -#define __need_size_t -#define __need_wchar_t -#define __need_NULL -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ - -#ifndef RC_INVOKED - #ifdef __cplusplus extern "C" { #endif -/* - * Prototypes of the ANSI Standard C library string functions. - */ -_CRTIMP void* __cdecl __MINGW_NOTHROW memchr (const void*, int, size_t) __MINGW_ATTRIB_PURE; -_CRTIMP int __cdecl __MINGW_NOTHROW memcmp (const void*, const void*, size_t) __MINGW_ATTRIB_PURE; -_CRTIMP void* __cdecl __MINGW_NOTHROW memcpy (void*, const void*, size_t); -_CRTIMP void* __cdecl __MINGW_NOTHROW memmove (void*, const void*, size_t); -_CRTIMP void* __cdecl __MINGW_NOTHROW memset (void*, int, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strcat (char*, const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW strchr (const char*, int) __MINGW_ATTRIB_PURE; -_CRTIMP int __cdecl __MINGW_NOTHROW strcmp (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP int __cdecl __MINGW_NOTHROW strcoll (const char*, const char*); /* Compare using locale */ -_CRTIMP char* __cdecl __MINGW_NOTHROW strcpy (char*, const char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW strcspn (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strerror (int); /* NOTE: NOT an old name wrapper. */ - -_CRTIMP size_t __cdecl __MINGW_NOTHROW strlen (const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strncat (char*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW strncmp (const char*, const char*, size_t) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strncpy (char*, const char*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strpbrk (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strrchr (const char*, int) __MINGW_ATTRIB_PURE; -_CRTIMP size_t __cdecl __MINGW_NOTHROW strspn (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strstr (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strtok (char*, const char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW strxfrm (char*, const char*, size_t); - -#ifndef __STRICT_ANSI__ -/* - * Extra non-ANSI functions provided by the CRTDLL library - */ -_CRTIMP char* __cdecl __MINGW_NOTHROW _strerror (const char *); -_CRTIMP void* __cdecl __MINGW_NOTHROW _memccpy (void*, const void*, int, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _memicmp (const void*, const void*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strdup (const char*) __MINGW_ATTRIB_MALLOC; -_CRTIMP int __cdecl __MINGW_NOTHROW _strcmpi (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _stricmp (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _stricoll (const char*, const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strlwr (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _strnicmp (const char*, const char*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strnset (char*, int, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strrev (char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strset (char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strupr (char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _swab (const char*, char*, size_t); - -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _strncoll(const char*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _strnicoll(const char*, const char*, size_t); +#ifndef _NLSCMP_DEFINED +#define _NLSCMP_DEFINED +#define _NLSCMPERROR 2147483647 #endif -#ifndef _NO_OLDNAMES -/* - * Non-underscored versions of non-ANSI functions. They live in liboldnames.a - * and provide a little extra portability. Also a few extra UNIX-isms like - * strcasecmp. - */ -_CRTIMP void* __cdecl __MINGW_NOTHROW memccpy (void*, const void*, int, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW memicmp (const void*, const void*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strdup (const char*) __MINGW_ATTRIB_MALLOC; -_CRTIMP int __cdecl __MINGW_NOTHROW strcmpi (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW stricmp (const char*, const char*); -__CRT_INLINE int __cdecl __MINGW_NOTHROW strcasecmp (const char*, const char *); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -strcasecmp (const char * __sz1, const char * __sz2) - {return _stricmp (__sz1, __sz2);} -_CRTIMP int __cdecl __MINGW_NOTHROW stricoll (const char*, const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW strlwr (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW strnicmp (const char*, const char*, size_t); -__CRT_INLINE int __cdecl __MINGW_NOTHROW strncasecmp (const char *, const char *, size_t); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -strncasecmp (const char * __sz1, const char * __sz2, size_t __sizeMaxCompare) - {return _strnicmp (__sz1, __sz2, __sizeMaxCompare);} -_CRTIMP char* __cdecl __MINGW_NOTHROW strnset (char*, int, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strrev (char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW strset (char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW strupr (char*); -#ifndef _UWIN -_CRTIMP void __cdecl __MINGW_NOTHROW swab (const char*, char*, size_t); -#endif /* _UWIN */ -#endif /* _NO_OLDNAMES */ +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif -#endif /* Not __STRICT_ANSI__ */ +#define _WConst_return _CONST_RETURN + +#ifndef _CRT_MEMORY_DEFINED +#define _CRT_MEMORY_DEFINED + _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount); + _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount); + _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); + _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale); + int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size); + void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size); + void *__cdecl memset(void *_Dst,int _Val,size_t _Size); +#ifndef NO_OLDNAMES + void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size); + int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); +#endif +#endif + char *__cdecl _strset(char *_Str,int _Val); + char *__cdecl strcpy(char *_Dest,const char *_Source); + char *__cdecl strcat(char *_Dest,const char *_Source); + int __cdecl strcmp(const char *_Str1,const char *_Str2); + size_t __cdecl strlen(const char *_Str); +#if 0 + size_t __cdecl strnlen(const char *_Str,size_t _MaxCount); +#endif + void *__cdecl memmove(void *_Dst,const void *_Src,size_t _Size); + _CRTIMP char *__cdecl _strdup(const char *_Src); + _CONST_RETURN char *__cdecl strchr(const char *_Str,int _Val); + _CRTIMP int __cdecl _stricmp(const char *_Str1,const char *_Str2); + _CRTIMP int __cdecl _strcmpi(const char *_Str1,const char *_Str2); + _CRTIMP int __cdecl _stricmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale); + int __cdecl strcoll(const char *_Str1,const char *_Str2); + _CRTIMP int __cdecl _strcoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _stricoll(const char *_Str1,const char *_Str2); + _CRTIMP int __cdecl _stricoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _strncoll (const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _strncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _strnicoll (const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _strnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + size_t __cdecl strcspn(const char *_Str,const char *_Control); + _CRTIMP char *__cdecl _strerror(const char *_ErrMsg); + char *__cdecl strerror(int); + _CRTIMP char *__cdecl _strlwr(char *_String); + char *strlwr_l(char *_String,_locale_t _Locale); + char *__cdecl strncat(char *_Dest,const char *_Source,size_t _Count); + int __cdecl strncmp(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _strnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + char *strncpy(char *_Dest,const char *_Source,size_t _Count); + _CRTIMP char *__cdecl _strnset(char *_Str,int _Val,size_t _MaxCount); + _CONST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control); + _CONST_RETURN char *__cdecl strrchr(const char *_Str,int _Ch); + _CRTIMP char *__cdecl _strrev(char *_Str); + size_t __cdecl strspn(const char *_Str,const char *_Control); + _CONST_RETURN char *__cdecl strstr(const char *_Str,const char *_SubStr); + char *__cdecl strtok(char *_Str,const char *_Delim); + _CRTIMP char *__cdecl _strupr(char *_String); + _CRTIMP char *_strupr_l(char *_String,_locale_t _Locale); + size_t __cdecl strxfrm(char *_Dst,const char *_Src,size_t _MaxCount); + _CRTIMP size_t __cdecl _strxfrm_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale); + +#ifndef NO_OLDNAMES + char *__cdecl strdup(const char *_Src); + int __cdecl strcmpi(const char *_Str1,const char *_Str2); + int __cdecl stricmp(const char *_Str1,const char *_Str2); + char *__cdecl strlwr(char *_Str); + int __cdecl strnicmp(const char *_Str1,const char *_Str,size_t _MaxCount); + __CRT_INLINE int __cdecl strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); } + __CRT_INLINE int __cdecl strcasecmp (const char *__sz1, const char *__sz2) { return _stricmp (__sz1, __sz2); } + char *__cdecl strnset(char *_Str,int _Val,size_t _MaxCount); + char *__cdecl strrev(char *_Str); + char *__cdecl strset(char *_Str,int _Val); + char *__cdecl strupr(char *_Str); +#endif #ifndef _WSTRING_DEFINED -/* - * Unicode versions of the standard calls. - * Also in wchar.h, where they belong according to ISO standard. - */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscat (wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcschr (const wchar_t*, wchar_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscpy (wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcscspn (const wchar_t*, const wchar_t*); -/* Note: _wcserror requires __MSVCRT_VERSION__ >= 0x0700. */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcslen (const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncat (wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsncmp(const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncpy(wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcspbrk(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrchr(const wchar_t*, wchar_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsspn(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsstr(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcstok(wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t); - -#ifndef __STRICT_ANSI__ -/* - * Unicode versions of non-ANSI string functions provided by CRTDLL. - */ - -/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ -#define _wcscmpi _wcsicmp - -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*); - -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsncoll(const wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t); -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*); -#endif -#endif - -#ifndef _NO_OLDNAMES -/* NOTE: There is no _wcscmpi, but this is for compatibility. */ -int __cdecl __MINGW_NOTHROW wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) - {return _wcsicmp (__ws1, __ws2);} -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsupr (wchar_t*); -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not strict ANSI */ - #define _WSTRING_DEFINED -#endif /* _WSTRING_DEFINED */ + + _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str); + wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source); + _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch); + int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); + wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source); + size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); + size_t __cdecl wcslen(const wchar_t *_Str); + size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); + wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); + int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); + _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control); + _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch); + size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control); + _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr); + wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim); + _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum); + _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str); + _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); + _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount); + _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str); + _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val); + _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String); + _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String); + _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale); + size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount); + _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale); + int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2); + _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); + _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); + +#ifndef NO_OLDNAMES + /* NOTE: There is no _wcscmpi, but this is for compatibility. */ + int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2); + __CRT_INLINE int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) { return _wcsicmp (__ws1, __ws2); } + #define _wcscmpi _wcsicmp + + wchar_t *__cdecl wcsdup(const wchar_t *_Str); +#define wcswcs wcsstr + int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); + int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount); + wchar_t *__cdecl wcsrev(wchar_t *_Str); + wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val); + wchar_t *__cdecl wcslwr(wchar_t *_Str); + wchar_t *__cdecl wcsupr(wchar_t *_Str); + int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); +#endif +#endif #ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _STRING_H_ */ +#include +#endif diff --git a/reactos/include/crt/strings.h b/reactos/include/crt/strings.h index 5342276e375..1d801e739ab 100644 --- a/reactos/include/crt/strings.h +++ b/reactos/include/crt/strings.h @@ -1,12 +1,17 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* File: strings.h Copyright: Public Domain - This file is provided because non ANSI fuctions are described in string.h + This file is provided because non ANSI fuctions are described in string.h that belong in strings.h. These functions are provided for in the OLDNAME libraries. */ -#if !defined(_STRINGS_H_) -# define _STRINGS_H_ 1 -# include +#ifndef _STRINGS_H_ +#define _STRINGS_H_ 1 +#include #endif diff --git a/reactos/include/crt/sys/cdefs.h b/reactos/include/crt/sys/cdefs.h new file mode 100644 index 00000000000..24e5fd5b444 --- /dev/null +++ b/reactos/include/crt/sys/cdefs.h @@ -0,0 +1,17 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H +#ifdef __cplusplus +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif +#define __P(protos) protos /* full-blown ANSI C */ +#endif + diff --git a/reactos/include/crt/sys/fcntl.h b/reactos/include/crt/sys/fcntl.h index a2090bc82fe..29fd55a1fd7 100644 --- a/reactos/include/crt/sys/fcntl.h +++ b/reactos/include/crt/sys/fcntl.h @@ -1,7 +1,13 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* * This file is part of the Mingw32 package. * * This fcntl.h maps to the root fcntl.h */ - +#ifndef __STRICT_ANSI__ #include +#endif diff --git a/reactos/include/crt/sys/file.h b/reactos/include/crt/sys/file.h index e95654c09a0..370f352d644 100644 --- a/reactos/include/crt/sys/file.h +++ b/reactos/include/crt/sys/file.h @@ -1,7 +1,14 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* * This file is part of the Mingw32 package. * * This file.h maps to the root fcntl.h * TODO? */ +#ifndef __STRICT_ANSI__ #include +#endif diff --git a/reactos/include/crt/sys/ioctl.h b/reactos/include/crt/sys/ioctl.h new file mode 100644 index 00000000000..02b54add624 --- /dev/null +++ b/reactos/include/crt/sys/ioctl.h @@ -0,0 +1,21 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#ifndef _SYS_IOCTL_H +#define _SYS_IOCTL_H + +#include + +#define WINDOWS_POST 0 /* Set write() behavior to PostMessage() */ +#define WINDOWS_SEND 1 /* Set write() behavior to SendMessage() */ +#define WINDOWS_HWND 2 /* Set hWnd for read() calls */ + +__BEGIN_DECLS + +int ioctl (int __fd, int __cmd, ...); + +__END_DECLS + +#endif diff --git a/reactos/include/crt/sys/locking.h b/reactos/include/crt/sys/locking.h index eee5e3c5413..e3fc85b3a7b 100644 --- a/reactos/include/crt/sys/locking.h +++ b/reactos/include/crt/sys/locking.h @@ -1,31 +1,30 @@ -/* - * locking.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Constants for the mode parameter of the locking function. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_LOCKING +#define _INC_LOCKING -#ifndef _LOCKING_H_ -#define _LOCKING_H_ +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif /* All the headers include this file. */ #include <_mingw.h> -#define _LK_UNLCK 0 /* Unlock */ -#define _LK_LOCK 1 /* Lock */ -#define _LK_NBLCK 2 /* Non-blocking lock */ -#define _LK_RLCK 3 /* Lock for read only */ -#define _LK_NBRLCK 4 /* Non-blocking lock for read only */ +#define _LK_UNLCK 0 +#define _LK_LOCK 1 +#define _LK_NBLCK 2 +#define _LK_RLCK 3 +#define _LK_NBRLCK 4 #ifndef NO_OLDNAMES -#define LK_UNLCK _LK_UNLCK -#define LK_LOCK _LK_LOCK -#define LK_NBLCK _LK_NBLCK -#define LK_RLCK _LK_RLCK -#define LK_NBRLCK _LK_NBRLCK -#endif /* Not NO_OLDNAMES */ +#define LK_UNLCK _LK_UNLCK +#define LK_LOCK _LK_LOCK +#define LK_NBLCK _LK_NBLCK +#define LK_RLCK _LK_RLCK +#define LK_NBRLCK _LK_NBRLCK +#endif -#endif /* Not _LOCKING_H_ */ +#endif diff --git a/reactos/include/crt/sys/param.h b/reactos/include/crt/sys/param.h index 74966bd78da..56e1a3222e8 100644 --- a/reactos/include/crt/sys/param.h +++ b/reactos/include/crt/sys/param.h @@ -1,8 +1,29 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* * param.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Earnie Boyd + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision: 1.3 $ + * $Author: earnie $ + * $Date: 2003/05/03 13:48:47 $ * */ @@ -12,6 +33,7 @@ #include #include +#ifndef __STRICT_ANSI__ /* These are useful for cross-compiling */ #define BIG_ENDIAN 4321 #define LITTLE_ENDIAN 1234 @@ -20,3 +42,5 @@ #define MAXPATHLEN PATH_MAX #endif + +#endif diff --git a/reactos/include/crt/sys/stat.h b/reactos/include/crt/sys/stat.h index 34019d0fbb0..bababc7e6d6 100644 --- a/reactos/include/crt/sys/stat.h +++ b/reactos/include/crt/sys/stat.h @@ -1,125 +1,121 @@ -/* - * stat.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Symbolic constants for opening and creating files, also stat, fstat and - * chmod functions. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_STAT +#define _INC_STAT -#ifndef _STAT_H_ -#define _STAT_H_ +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif -/* All the headers include this file. */ #include <_mingw.h> +#include -#define __need_size_t -#define __need_wchar_t -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ +#pragma pack(push,_CRT_PACKING) + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _CRTIMP +#define _CRTIMP __declspec(dllimport) +#endif #include -/* - * Constants for the stat st_mode member. - */ -#define _S_IFIFO 0x1000 /* FIFO */ -#define _S_IFCHR 0x2000 /* Character */ -#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */ -#define _S_IFDIR 0x4000 /* Directory */ -#define _S_IFREG 0x8000 /* Regular */ +#ifdef _USE_32BIT_TIME_T +#ifdef _WIN64 +#undef _USE_32BIT_TIME_T +#endif +#else +#if _INTEGRAL_MAX_BITS < 64 +#define _USE_32BIT_TIME_T +#endif +#endif -#define _S_IFMT 0xF000 /* File type mask */ +#ifndef _TIME32_T_DEFINED + typedef long __time32_t; +#define _TIME32_T_DEFINED +#endif -#define _S_IEXEC 0x0040 -#define _S_IWRITE 0x0080 -#define _S_IREAD 0x0100 +#ifndef _TIME64_T_DEFINED +#if _INTEGRAL_MAX_BITS >= 64 + typedef __int64 __time64_t; +#endif +#define _TIME64_T_DEFINED +#endif -#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC) -#define _S_IXUSR _S_IEXEC -#define _S_IWUSR _S_IWRITE -#define _S_IRUSR _S_IREAD +#ifndef _TIME_T_DEFINED +#ifdef _USE_32BIT_TIME_T + typedef __time32_t time_t; +#else + typedef __time64_t time_t; +#endif +#define _TIME_T_DEFINED +#endif -#define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) -#define _S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) -#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR) -#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK) -#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) - -#ifndef _NO_OLDNAMES - -#define S_IFIFO _S_IFIFO -#define S_IFCHR _S_IFCHR -#define S_IFBLK _S_IFBLK -#define S_IFDIR _S_IFDIR -#define S_IFREG _S_IFREG -#define S_IFMT _S_IFMT -#define S_IEXEC _S_IEXEC -#define S_IWRITE _S_IWRITE -#define S_IREAD _S_IREAD -#define S_IRWXU _S_IRWXU -#define S_IXUSR _S_IXUSR -#define S_IWUSR _S_IWUSR -#define S_IRUSR _S_IRUSR - -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) - -#endif /* Not _NO_OLDNAMES */ - -#ifndef RC_INVOKED +#ifndef _WCHAR_T_DEFINED + typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif #ifndef _STAT_DEFINED -/* - * The structure manipulated and returned by stat and fstat. - * - * NOTE: If called on a directory the values in the time fields are not only - * invalid, they will cause localtime et. al. to return NULL. And calling - * asctime with a NULL pointer causes an Invalid Page Fault. So watch it! - */ -struct _stat -{ - _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - _ino_t st_ino; /* Always zero ? */ - _mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - _dev_t st_rdev; /* Seems useless (not even filled in) */ - _off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; -#ifndef _NO_OLDNAMES -/* NOTE: Must be the same as _stat above. */ -struct stat -{ - _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - _ino_t st_ino; /* Always zero ? */ - _mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - _dev_t st_rdev; /* Seems useless (not even filled in) */ - _off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; -#endif /* _NO_OLDNAMES */ +#ifdef _USE_32BIT_TIME_T +#ifndef _WIN64 +#define _fstat32 _fstat +#define _stat32 _stat +#define _wstat32 _wstat +#else +#define _fstat _fstat32 +#define _stat _stat32 +#define _wstat _wstat32 +#endif +#define _fstati64 _fstat32i64 +#define _stati64 _stat32i64 +#define _wstati64 _wstat32i64 +#else +#define _fstat _fstat64i32 +#define _fstati64 _fstat64 +#define _stat _stat64i32 +#define _stati64 _stat64 +#define _wstat _wstat64i32 +#define _wstati64 _wstat64 +#endif -#if defined (__MSVCRT__) -struct _stati64 { + struct _stat32 { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + __time32_t st_atime; + __time32_t st_mtime; + __time32_t st_ctime; + }; + +#ifndef NO_OLDNAMES + struct stat { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; +#endif + + struct _stat32i64 { _dev_t st_dev; _ino_t st_ino; unsigned short st_mode; @@ -128,16 +124,29 @@ struct _stati64 { short st_gid; _dev_t st_rdev; __int64 st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; + __time32_t st_atime; + __time32_t st_mtime; + __time32_t st_ctime; + }; -struct __stat64 -{ + struct _stat64i32 { _dev_t st_dev; _ino_t st_ino; - _mode_t st_mode; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + __time64_t st_atime; + __time64_t st_mtime; + __time64_t st_ctime; + }; + + struct _stat64 { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; short st_nlink; short st_uid; short st_gid; @@ -146,50 +155,132 @@ struct __stat64 __time64_t st_atime; __time64_t st_mtime; __time64_t st_ctime; -}; -#endif /* __MSVCRT__ */ -#define _STAT_DEFINED -#endif /* _STAT_DEFINED */ + }; -#ifdef __cplusplus -extern "C" { +#define __stat64 _stat64 + +#define _STAT_DEFINED #endif -_CRTIMP int __cdecl __MINGW_NOTHROW _fstat (int, struct _stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW _chmod (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _stat (const char*, struct _stat*); +#define _S_IFMT 0xF000 +#define _S_IFDIR 0x4000 +#define _S_IFCHR 0x2000 +#define _S_IFIFO 0x1000 +#define _S_IFREG 0x8000 +#define _S_IREAD 0x0100 +#define _S_IWRITE 0x0080 +#define _S_IEXEC 0x0040 -#ifndef _NO_OLDNAMES + _CRTIMP int __cdecl _fstat32(int _FileDes,struct _stat32 *_Stat); + _CRTIMP int __cdecl _stat32(const char *_Name,struct _stat32 *_Stat); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP int __cdecl _fstat64(int _FileDes,struct _stat64 *_Stat); + _CRTIMP int __cdecl _fstat32i64(int _FileDes,struct _stat32i64 *_Stat); + int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat); + __CRT_INLINE int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat) + { + struct _stat64 st; + int ret=_fstat64(_FileDes,&st); + _Stat->st_dev=st.st_dev; + _Stat->st_ino=st.st_ino; + _Stat->st_mode=st.st_mode; + _Stat->st_nlink=st.st_nlink; + _Stat->st_uid=st.st_uid; + _Stat->st_gid=st.st_gid; + _Stat->st_rdev=st.st_rdev; + _Stat->st_size=(_off_t) st.st_size; + _Stat->st_atime=st.st_atime; + _Stat->st_mtime=st.st_mtime; + _Stat->st_ctime=st.st_ctime; + return ret; + } + _CRTIMP int __cdecl _stat64(const char *_Name,struct _stat64 *_Stat); + _CRTIMP int __cdecl _stat32i64(const char *_Name,struct _stat32i64 *_Stat); + int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat); + __CRT_INLINE int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat) + { + struct _stat64 st; + int ret=_stat64(_Name,&st); + _Stat->st_dev=st.st_dev; + _Stat->st_ino=st.st_ino; + _Stat->st_mode=st.st_mode; + _Stat->st_nlink=st.st_nlink; + _Stat->st_uid=st.st_uid; + _Stat->st_gid=st.st_gid; + _Stat->st_rdev=st.st_rdev; + _Stat->st_size=(_off_t) st.st_size; + _Stat->st_atime=st.st_atime; + _Stat->st_mtime=st.st_mtime; + _Stat->st_ctime=st.st_ctime; + return ret; + } +#endif -/* These functions live in liboldnames.a. */ -_CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*); - -#endif /* Not _NO_OLDNAMES */ - -#if defined (__MSVCRT__) -_CRTIMP int __cdecl __MINGW_NOTHROW _fstati64(int, struct _stati64 *); -_CRTIMP int __cdecl __MINGW_NOTHROW _stati64(const char *, struct _stati64 *); -/* These require newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP int __cdecl __MINGW_NOTHROW _fstat64 (int, struct __stat64*); -_CRTIMP int __cdecl __MINGW_NOTHROW _stat64 (const char*, struct __stat64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat(const wchar_t*, struct _stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t*, struct _stati64*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct __stat64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ +#ifndef _WSTAT_DEFINED #define _WSTAT_DEFINED -#endif /* _WSTAT_DEFIND */ -#endif /* __MSVCRT__ */ + _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat); + int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat); + _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat); +#endif +#endif -#ifdef __cplusplus +#ifndef NO_OLDNAMES +#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */ + +#define S_IFMT _S_IFMT +#define S_IFDIR _S_IFDIR +#define S_IFCHR _S_IFCHR +#define S_IFREG _S_IFREG +#define S_IREAD _S_IREAD +#define S_IWRITE _S_IWRITE +#define S_IEXEC _S_IEXEC +#define S_IFIFO _S_IFIFO +#define S_IFBLK _S_IFBLK + +#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC) +#define _S_IXUSR _S_IEXEC +#define _S_IWUSR _S_IWRITE + +#define S_IRWXU _S_IRWXU +#define S_IXUSR _S_IXUSR +#define S_IWUSR _S_IWUSR +#define S_IRUSR _S_IRUSR +#define _S_IRUSR _S_IREAD + +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) + +#endif + +#if !defined (RC_INVOKED) && !defined (NO_OLDNAMES) +int __cdecl stat(const char *_Filename,struct stat *_Stat); +int __cdecl fstat(int _Desc,struct stat *_Stat); +int __cdecl wstat(const wchar_t *_Filename,struct stat *_Stat); +#ifdef _USE_32BIT_TIME_T +__CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) { + return _fstat32(_Desc,(struct _stat32 *)_Stat); +} +__CRT_INLINE int __cdecl stat(const char *_Filename,struct stat *_Stat) { + return _stat32(_Filename,(struct _stat32 *)_Stat); +} +#else +__CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) { + return _fstat64i32(_Desc,(struct _stat64i32 *)_Stat); +} +__CRT_INLINE int __cdecl stat(const char *_Filename,struct stat *_Stat) { + return _stat64i32(_Filename,(struct _stat64i32 *)_Stat); +} +#endif +#endif + +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _STAT_H_ */ +#pragma pack(pop) +#endif diff --git a/reactos/include/crt/sys/time.h b/reactos/include/crt/sys/time.h index e11a2baa09c..8ccab8319c2 100644 --- a/reactos/include/crt/sys/time.h +++ b/reactos/include/crt/sys/time.h @@ -1,11 +1,19 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ + #ifndef _SYS_TIME_H_ #define _SYS_TIME_H_ + #include -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif +#ifndef __STRICT_ANSI__ #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */ #define _TIMEVAL_DEFINED struct timeval { @@ -14,12 +22,14 @@ struct timeval { }; #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) #define timercmp(tvp, uvp, cmp) \ - (((tvp)->tv_sec != (uvp)->tv_sec) ? \ - ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ - ((tvp)->tv_usec cmp (uvp)->tv_usec)) + (((tvp)->tv_sec != (uvp)->tv_sec) ? \ + ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ + ((tvp)->tv_usec cmp (uvp)->tv_usec)) #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 #endif /* _TIMEVAL_DEFINED */ +#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */ +#define _TIMEZONE_DEFINED /* Provided for compatibility with code that assumes that the presence of gettimeofday function implies a definition of struct timezone. */ @@ -29,6 +39,10 @@ struct timezone int tz_dsttime; /* type of dst correction to apply */ }; + extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z); + +#endif + /* Implementation as per: The Open Group Base Specifications, Issue 6 @@ -36,12 +50,20 @@ struct timezone The timezone pointer arg is ignored. Errors are ignored. */ -int __cdecl __MINGW_NOTHROW gettimeofday(struct timeval *__restrict__, - void *__restrict__ /* tzp (unused) */); +#ifndef _GETTIMEOFDAY_DEFINED +#define _GETTIMEOFDAY_DEFINED +int __cdecl gettimeofday(struct timeval *__restrict__, + void *__restrict__ /* tzp (unused) */); +#endif -#ifdef __cplusplus +#endif /* __STRICT_ANSI__ */ + +#ifdef __cplusplus } #endif +/* Adding timespec definition. */ +#include + #endif /* _SYS_TIME_H_ */ diff --git a/reactos/include/crt/sys/timeb.h b/reactos/include/crt/sys/timeb.h index 72e2fcf6154..1cf3ce8b3ee 100644 --- a/reactos/include/crt/sys/timeb.h +++ b/reactos/include/crt/sys/timeb.h @@ -1,74 +1,130 @@ -/* - * timeb.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Support for the UNIX System V ftime system call. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _TIMEB_H_ +#define _TIMEB_H_ -#ifndef _TIMEB_H_ -#define _TIMEB_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#include -#ifndef RC_INVOKED - -/* - * TODO: Structure not tested. - */ -struct _timeb -{ - long time; - short millitm; - short timezone; - short dstflag; -}; - -#ifndef _NO_OLDNAMES -/* - * TODO: Structure not tested. - */ -struct timeb -{ - long time; - short millitm; - short timezone; - short dstflag; -}; +#ifndef _WIN32 +#error Only Win32 target is supported! #endif -struct __timeb64 -{ - __time64_t time; - short millitm; - short timezone; - short dstflag; -}; +#pragma pack(push,_CRT_PACKING) -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -/* TODO: Not tested. */ -_CRTIMP void __cdecl __MINGW_NOTHROW _ftime (struct _timeb*); +#ifndef _CRTIMP +#define _CRTIMP __declspec(dllimport) +#endif -#ifndef _NO_OLDNAMES -_CRTIMP void __cdecl __MINGW_NOTHROW ftime (struct timeb*); -#endif /* Not _NO_OLDNAMES */ +#ifdef _USE_32BIT_TIME_T +#ifdef _WIN64 +#undef _USE_32BIT_TIME_T +#endif +#else +#if _INTEGRAL_MAX_BITS < 64 +#define _USE_32BIT_TIME_T +#endif +#endif -/* This requires newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP void __cdecl __MINGW_NOTHROW _ftime64 (struct __timeb64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ +#ifndef _TIME32_T_DEFINED + typedef long __time32_t; +#define _TIME32_T_DEFINED +#endif -#ifdef __cplusplus +#ifndef _TIME64_T_DEFINED +#if _INTEGRAL_MAX_BITS >= 64 + typedef __int64 __time64_t; +#endif +#define _TIME64_T_DEFINED +#endif + +#ifndef _TIME_T_DEFINED +#ifdef _USE_32BIT_TIME_T + typedef __time32_t time_t; +#else + typedef __time64_t time_t; +#endif +#define _TIME_T_DEFINED +#endif + +#ifndef _TIMEB_DEFINED +#define _TIMEB_DEFINED + + struct __timeb32 { + __time32_t time; + unsigned short millitm; + short timezone; + short dstflag; + }; + +#ifndef NO_OLDNAMES + struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; + }; +#endif + +#if _INTEGRAL_MAX_BITS >= 64 + struct __timeb64 { + __time64_t time; + unsigned short millitm; + short timezone; + short dstflag; + }; +#endif + +#ifdef _USE_32BIT_TIME_T +#define _timeb __timeb32 +#define _ftime _ftime32 +#else +#define _timeb __timeb64 +#define _ftime _ftime64 +#endif +#endif + + _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time); +#endif + +#ifndef TIMESPEC_DEFINED +#define TIMESPEC_DEFINED +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds */ +}; + +struct itimerspec { + struct timespec it_interval; /* Timer period */ + struct timespec it_value; /* Timer expiration */ +}; +#endif + +#if !defined (RC_INVOKED) && !defined (NO_OLDNAMES) +#ifdef _USE_32BIT_TIME_T +__CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { + _ftime32((struct __timeb32 *)_Tmb); +} +#else +__CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { + _ftime64((struct __timeb64 *)_Tmb); +} +#endif +#endif + +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ +#pragma pack(pop) -#endif /* Not _TIMEB_H_ */ +#include +#endif diff --git a/reactos/include/crt/sys/types.h b/reactos/include/crt/sys/types.h index cdd1d6e4d61..a09f28ee859 100644 --- a/reactos/include/crt/sys/types.h +++ b/reactos/include/crt/sys/types.h @@ -1,123 +1,116 @@ -/* - * types.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * The definition of constants, data types and global variables. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_TYPES +#define _INC_TYPES -#ifndef _TYPES_H_ -#define _TYPES_H_ +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif -/* All the headers include this file. */ #include <_mingw.h> -#define __need_wchar_t -#define __need_size_t -#define __need_ptrdiff_t -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ +#ifdef _USE_32BIT_TIME_T +#ifdef _WIN64 +#undef _USE_32BIT_TIME_T +#define _USE_64BIT_TIME_T +#endif +#else +#if _INTEGRAL_MAX_BITS < 64 +#undef _USE_64BIT_TIME_T +#define _USE_32BIT_TIME_T +#endif +#endif -#ifndef RC_INVOKED - -#ifndef _TIME_T_DEFINED -typedef long time_t; -#define _TIME_T_DEFINED +#ifndef _TIME32_T_DEFINED +#define _TIME32_T_DEFINED +typedef long __time32_t; #endif #ifndef _TIME64_T_DEFINED -typedef __int64 __time64_t; #define _TIME64_T_DEFINED +typedef __int64 __time64_t; #endif -#ifndef _OFF_T_ -#define _OFF_T_ -typedef long _off_t; - -#ifndef _NO_OLDNAMES -typedef _off_t off_t; -#endif -#endif /* Not _OFF_T_ */ - - -#ifndef _DEV_T_ -#define _DEV_T_ -#ifdef __MSVCRT__ -typedef unsigned int _dev_t; +#ifndef _TIME_T_DEFINED +#define _TIME_T_DEFINED +#ifdef _USE_32BIT_TIME_T +typedef __time32_t time_t; #else -typedef short _dev_t; +typedef __time64_t time_t; +#endif #endif -#ifndef _NO_OLDNAMES -typedef _dev_t dev_t; +#ifndef _INO_T_DEFINED +#define _INO_T_DEFINED +typedef unsigned short _ino_t; +#ifndef NO_OLDNAMES +typedef unsigned short ino_t; #endif -#endif /* Not _DEV_T_ */ - - -#ifndef _INO_T_ -#define _INO_T_ -typedef short _ino_t; - -#ifndef _NO_OLDNAMES -typedef _ino_t ino_t; #endif -#endif /* Not _INO_T_ */ +#ifndef _DEV_T_DEFINED +#define _DEV_T_DEFINED +typedef unsigned int _dev_t; +#ifndef NO_OLDNAMES +typedef unsigned int dev_t; +#endif +#endif #ifndef _PID_T_ #define _PID_T_ +#ifndef _WIN64 typedef int _pid_t; +#else +typedef __int64 _pid_t; +#endif -#ifndef _NO_OLDNAMES +#ifndef NO_OLDNAMES typedef _pid_t pid_t; #endif #endif /* Not _PID_T_ */ - #ifndef _MODE_T_ #define _MODE_T_ typedef unsigned short _mode_t; -#ifndef _NO_OLDNAMES +#ifndef NO_OLDNAMES typedef _mode_t mode_t; #endif #endif /* Not _MODE_T_ */ - -#ifndef _SIGSET_T_ -#define _SIGSET_T_ -typedef int _sigset_t; - -#ifndef _NO_OLDNAMES -typedef _sigset_t sigset_t; +#ifndef _OFF_T_DEFINED +#define _OFF_T_DEFINED +#ifndef _OFF_T_ +#define _OFF_T_ + typedef long _off_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long off_t; #endif -#endif /* Not _SIGSET_T_ */ - -#ifndef _SSIZE_T_ -#define _SSIZE_T_ -typedef long _ssize_t; - -#ifndef _NO_OLDNAMES -# ifndef _SSIZE_T_DEFINED -# define _SSIZE_T_DEFINED -typedef _ssize_t ssize_t; -# endif #endif -#endif /* Not _SSIZE_T_ */ - -#ifndef _FPOS64_T_ -#define _FPOS64_T_ -typedef long long fpos64_t; #endif -#ifndef _OFF64_T_ -#define _OFF64_T_ -typedef long long off64_t; +#ifndef _OFF64_T_DEFINED +#define _OFF64_T_DEFINED + typedef long long _off64_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long long off64_t; +#endif #endif -#endif /* Not RC_INVOKED */ +#ifndef TIMESPEC_DEFINED +#define TIMESPEC_DEFINED +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseconds */ +}; -#endif /* Not _TYPES_H_ */ +struct itimerspec { + struct timespec it_interval; /* Timer period */ + struct timespec it_value; /* Timer expiration */ +}; +#endif + +#endif diff --git a/reactos/include/crt/sys/unistd.h b/reactos/include/crt/sys/unistd.h index 39eac4a9001..31006d3258c 100644 --- a/reactos/include/crt/sys/unistd.h +++ b/reactos/include/crt/sys/unistd.h @@ -1,6 +1,14 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* * This file is part of the Mingw32 package. * * unistd.h maps (roughly) to io.h */ +#ifndef __STRICT_ANSI__ #include +#endif + diff --git a/reactos/include/crt/sys/utime.h b/reactos/include/crt/sys/utime.h index a6b1cd629ec..4722cb9a475 100644 --- a/reactos/include/crt/sys/utime.h +++ b/reactos/include/crt/sys/utime.h @@ -1,82 +1,138 @@ -/* - * utime.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Support for the utime function. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ -#ifndef _UTIME_H_ -#define _UTIME_H_ +#ifndef _INC_UTIME +#define _INC_UTIME + +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif -/* All the headers include this file. */ #include <_mingw.h> -#define __need_wchar_t -#define __need_size_t -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ -#include +#pragma pack(push,_CRT_PACKING) -#ifndef RC_INVOKED - -/* - * Structure used by _utime function. - */ -struct _utimbuf -{ - time_t actime; /* Access time */ - time_t modtime; /* Modification time */ -}; - - -#ifndef _NO_OLDNAMES -/* NOTE: Must be the same as _utimbuf above. */ -struct utimbuf -{ - time_t actime; - time_t modtime; -}; -#endif /* Not _NO_OLDNAMES */ - -struct __utimbuf64 -{ - __time64_t actime; - __time64_t modtime; -}; - - -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -_CRTIMP int __cdecl __MINGW_NOTHROW _utime (const char*, struct _utimbuf*); +#ifndef _CRTIMP +#define _CRTIMP __declspec(dllimport) +#endif -#ifndef _NO_OLDNAMES -_CRTIMP int __cdecl __MINGW_NOTHROW utime (const char*, struct utimbuf*); -#endif /* Not _NO_OLDNAMES */ +#ifndef _WCHAR_T_DEFINED + typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif -_CRTIMP int __cdecl __MINGW_NOTHROW _futime (int, struct _utimbuf*); +#ifdef _USE_32BIT_TIME_T +#ifdef _WIN64 +#undef _USE_32BIT_TIME_T +#endif +#else +#if _INTEGRAL_MAX_BITS < 64 +#define _USE_32BIT_TIME_T +#endif +#endif -/* The wide character version, only available for MSVCRT versions of the - * C runtime library. */ -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wutime (const wchar_t*, struct _utimbuf*); -#endif /* MSVCRT runtime */ +#ifndef _TIME32_T_DEFINED +#define _TIME32_T_DEFINED + typedef long __time32_t; +#endif -/* These require newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP int __cdecl __MINGW_NOTHROW _utime64 (const char*, struct __utimbuf64*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wutime64 (const wchar_t*, struct __utimbuf64*); -_CRTIMP int __cdecl __MINGW_NOTHROW _futime64 (int, struct __utimbuf64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ +#ifndef _TIME64_T_DEFINED +#define _TIME64_T_DEFINED +#if _INTEGRAL_MAX_BITS >= 64 + typedef __int64 __time64_t; +#endif +#endif -#ifdef __cplusplus +#ifndef _TIME_T_DEFINED +#define _TIME_T_DEFINED +#ifdef _USE_32BIT_TIME_T + typedef __time32_t time_t; +#else + typedef __time64_t time_t; +#endif +#endif + +#ifndef _UTIMBUF_DEFINED +#define _UTIMBUF_DEFINED + + struct _utimbuf { + time_t actime; + time_t modtime; + }; + + struct __utimbuf32 { + __time32_t actime; + __time32_t modtime; + }; + + struct __utimbuf64 { + __time64_t actime; + __time64_t modtime; + }; + +#ifndef NO_OLDNAMES + struct utimbuf { + time_t actime; + time_t modtime; + }; + + struct utimbuf32 { + __time32_t actime; + __time32_t modtime; + }; +#endif +#endif + + _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time); + _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time); + _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time); + _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time); + _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time); + _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time); + +#ifndef RC_INVOKED +__CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { + return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); +} +__CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { + return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf); +} +__CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { + return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf); +} +#elif defined(_USE_64BIT_TIME_T) +__CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { + return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); +} +__CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { + return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf); +} +__CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { + return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf); +} + +#ifndef NO_OLDNAMES +#ifndef _WIN64 +__CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { + return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); +} +#else +__CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { + return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); +} +#endif +#endif +#endif + +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _UTIME_H_ */ +#pragma pack(pop) +#endif diff --git a/reactos/include/crt/time.h b/reactos/include/crt/time.h index 9bcf4521745..97875c444c4 100644 --- a/reactos/include/crt/time.h +++ b/reactos/include/crt/time.h @@ -1,219 +1,283 @@ -/* - * time.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Date and time functions and types. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _TIME_H_ +#define _TIME_H_ -#ifndef _TIME_H_ -#define _TIME_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#define __need_wchar_t -#define __need_size_t -#define __need_NULL -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ - -/* - * Number of clock ticks per second. A clock tick is the unit by which - * processor time is measured and is returned by 'clock'. - */ -#define CLOCKS_PER_SEC ((clock_t)1000) -#define CLK_TCK CLOCKS_PER_SEC - - -#ifndef RC_INVOKED - -/* - * A type for storing the current time and date. This is the number of - * seconds since midnight Jan 1, 1970. - * NOTE: This is also defined in non-ISO sys/types.h. - */ -#ifndef _TIME_T_DEFINED -typedef long time_t; -#define _TIME_T_DEFINED +#ifndef _WIN32 +#error Only Win32 target is supported! #endif -#ifndef __STRICT_ANSI__ -/* A 64-bit time_t to get to Y3K */ -#ifndef _TIME64_T_DEFINED -typedef __int64 __time64_t; -#define _TIME64_T_DEFINED -#endif -#endif -/* - * A type for measuring processor time (in clock ticks). - */ -#ifndef _CLOCK_T_DEFINED -typedef long clock_t; -#define _CLOCK_T_DEFINED -#endif +#pragma pack(push,_CRT_PACKING) -#ifndef _TM_DEFINED -/* - * A structure for storing all kinds of useful information about the - * current (or another) time. - */ -struct tm -{ - int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */ - int tm_min; /* Minutes: 0-59 */ - int tm_hour; /* Hours since midnight: 0-23 */ - int tm_mday; /* Day of the month: 1-31 */ - int tm_mon; /* Months *since* january: 0-11 */ - int tm_year; /* Years since 1900 */ - int tm_wday; /* Days since Sunday (0-6) */ - int tm_yday; /* Days since Jan. 1: 0-365 */ - int tm_isdst; /* +1 Daylight Savings Time, 0 No DST, - * -1 don't know */ -}; -#define _TM_DEFINED -#endif - -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -_CRTIMP clock_t __cdecl __MINGW_NOTHROW clock (void); -_CRTIMP time_t __cdecl __MINGW_NOTHROW time (time_t*); -_CRTIMP double __cdecl __MINGW_NOTHROW difftime (time_t, time_t); -_CRTIMP time_t __cdecl __MINGW_NOTHROW mktime (struct tm*); - -/* - * These functions write to and return pointers to static buffers that may - * be overwritten by other function calls. Yikes! - * - * NOTE: localtime, and perhaps the others of the four functions grouped - * below may return NULL if their argument is not 'acceptable'. Also note - * that calling asctime with a NULL pointer will produce an Invalid Page - * Fault and crap out your program. Guess how I know. Hint: stat called on - * a directory gives 'invalid' times in st_atime etc... - */ -_CRTIMP char* __cdecl __MINGW_NOTHROW asctime (const struct tm*); -_CRTIMP char* __cdecl __MINGW_NOTHROW ctime (const time_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t*); - -_CRTIMP size_t __cdecl __MINGW_NOTHROW strftime (char*, size_t, const char*, const struct tm*); - -#ifndef __STRICT_ANSI__ - -extern _CRTIMP void __cdecl __MINGW_NOTHROW _tzset (void); - -#ifndef _NO_OLDNAMES -extern _CRTIMP void __cdecl __MINGW_NOTHROW tzset (void); +#ifndef _CRTIMP +#define _CRTIMP __declspec(dllimport) #endif -_CRTIMP char* __cdecl __MINGW_NOTHROW _strdate(char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strtime(char*); +#ifndef _WCHAR_T_DEFINED +#define _WCHAR_T_DEFINED + typedef unsigned short wchar_t; +#endif -/* These require newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP __time64_t __cdecl __MINGW_NOTHROW _time64( __time64_t*); -_CRTIMP __time64_t __cdecl __MINGW_NOTHROW _mktime64 (struct tm*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ctime64 (const __time64_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _gmtime64 (const __time64_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _localtime64 (const __time64_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ +#ifndef _TIME32_T_DEFINED +#define _TIME32_T_DEFINED + typedef long __time32_t; +#endif -/* - * _daylight: non zero if daylight savings time is used. - * _timezone: difference in seconds between GMT and local time. - * _tzname: standard/daylight savings time zone names (an array with two - * elements). - */ -#ifdef __MSVCRT__ +#ifndef _TIME64_T_DEFINED +#define _TIME64_T_DEFINED +#if _INTEGRAL_MAX_BITS >= 64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int _time64_t __attribute__ ((mode (DI))); +#else + typedef __int64 __time64_t; +#endif +#endif +#endif -/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */ -extern _CRTIMP int* __cdecl __MINGW_NOTHROW __p__daylight (void); -extern _CRTIMP long* __cdecl __MINGW_NOTHROW __p__timezone (void); -extern _CRTIMP char** __cdecl __MINGW_NOTHROW __p__tzname (void); +#ifndef _TIME_T_DEFINED +#define _TIME_T_DEFINED +#ifdef _USE_32BIT_TIME_T + typedef __time32_t time_t; +#else + typedef __time64_t time_t; +#endif +#endif -__MINGW_IMPORT int _daylight; -__MINGW_IMPORT long _timezone; -__MINGW_IMPORT char *_tzname[2]; +#ifndef _CLOCK_T_DEFINED +#define _CLOCK_T_DEFINED + typedef long clock_t; +#endif -#else /* not __MSVCRT (ie. crtdll) */ +#ifndef _SIZE_T_DEFINED +#define _SIZE_T_DEFINED +#undef size_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef unsigned int size_t __attribute__ ((mode (DI))); +#else + typedef unsigned __int64 size_t; +#endif +#else + typedef unsigned int size_t; +#endif +#endif -#ifndef __DECLSPEC_SUPPORTED +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#undef ssize_t +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int ssize_t __attribute__ ((mode (DI))); +#else + typedef __int64 ssize_t; +#endif +#else + typedef int ssize_t; +#endif +#endif -extern int* _imp___daylight_dll; -extern long* _imp___timezone_dll; -extern char** _imp___tzname; +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif -#define _daylight (*_imp___daylight_dll) -#define _timezone (*_imp___timezone_dll) -#define _tzname (*_imp___tzname) +#ifdef _USE_32BIT_TIME_T +#define _localtime32 localtime +#define _difftime32 difftime +#define _ctime32 ctime +#define _gmtime32 gmtime +#define _mktime32 mktime +#define _time32 _time +#endif -#else /* __DECLSPEC_SUPPORTED */ +#ifndef _TM_DEFINED +#define _TM_DEFINED + struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + }; +#endif -__MINGW_IMPORT int _daylight_dll; -__MINGW_IMPORT long _timezone_dll; -__MINGW_IMPORT char* _tzname[2]; +#define CLOCKS_PER_SEC 1000 -#define _daylight _daylight_dll -#define _timezone _timezone_dll + _CRTIMP int _daylight; + _CRTIMP long _dstbias; + _CRTIMP long _timezone; + _CRTIMP char * _tzname[2]; -#endif /* __DECLSPEC_SUPPORTED */ + _CRTIMP errno_t __cdecl _get_daylight(int *_Daylight); + _CRTIMP errno_t __cdecl _get_dstbias(long *_Daylight_savings_bias); + _CRTIMP errno_t __cdecl _get_timezone(long *_Timezone); + _CRTIMP errno_t __cdecl _get_tzname(size_t *_ReturnValue,char *_Buffer,size_t _SizeInBytes,int _Index); + char *__cdecl asctime(const struct tm *_Tm); + _CRTIMP char *__cdecl _ctime32(const __time32_t *_Time); + clock_t __cdecl clock(void); + _CRTIMP double __cdecl _difftime32(__time32_t _Time1,__time32_t _Time2); + _CRTIMP struct tm *__cdecl _gmtime32(const __time32_t *_Time); + _CRTIMP struct tm *__cdecl _localtime32(const __time32_t *_Time); + size_t __cdecl strftime(char *_Buf,size_t _SizeInBytes,const char *_Format,const struct tm *_Tm); + _CRTIMP size_t __cdecl _strftime_l(char *_Buf,size_t _Max_size,const char *_Format,const struct tm *_Tm,_locale_t _Locale); + _CRTIMP char *__cdecl _strdate(char *_Buffer); + _CRTIMP char *__cdecl _strtime(char *_Buffer); + _CRTIMP __time32_t __cdecl _time32(__time32_t *_Time); + _CRTIMP __time32_t __cdecl _mktime32(struct tm *_Tm); + _CRTIMP __time32_t __cdecl _mkgmtime32(struct tm *_Tm); +#if defined (_POSIX_) || defined(__GNUC__) + void __cdecl tzset(void); +#else + _CRTIMP void __cdecl _tzset(void); +#endif -#endif /* not __MSVCRT__ */ + double __cdecl _difftime64(__time64_t _Time1,__time64_t _Time2); + _CRTIMP char *__cdecl _ctime64(const __time64_t *_Time); + _CRTIMP struct tm *__cdecl _gmtime64(const __time64_t *_Time); + _CRTIMP struct tm *__cdecl _localtime64(const __time64_t *_Time); + _CRTIMP __time64_t __cdecl _mktime64(struct tm *_Tm); + _CRTIMP __time64_t __cdecl _mkgmtime64(struct tm *_Tm); + _CRTIMP __time64_t __cdecl _time64(__time64_t *_Time); -#ifndef _NO_OLDNAMES + unsigned __cdecl _getsystime(struct tm *_Tm); + unsigned __cdecl _setsystime(struct tm *_Tm,unsigned _MilliSec); -#ifdef __MSVCRT__ +#ifndef _SIZE_T_DEFINED +#define _SIZE_T_DEFINED +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef unsigned int size_t __attribute__ ((mode (DI))); +#else + typedef unsigned __int64 size_t; +#endif +#else + typedef unsigned long size_t; +#endif +#endif -/* These go in the oldnames import library for MSVCRT. */ -__MINGW_IMPORT int daylight; -__MINGW_IMPORT long timezone; -__MINGW_IMPORT char *tzname[2]; - -#else /* not __MSVCRT__ */ - -/* CRTDLL is royally messed up when it comes to these macros. - TODO: import and alias these via oldnames import library instead - of macros. */ - -#define daylight _daylight -/* NOTE: timezone not defined as macro because it would conflict with - struct timezone in sys/time.h. - Also, tzname used to a be macro, but now it's in moldname. */ -__MINGW_IMPORT char *tzname[2]; - -#endif /* not __MSVCRT__ */ - -#endif /* Not _NO_OLDNAMES */ -#endif /* Not __STRICT_ANSI__ */ +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#ifdef _WIN64 +#if defined(__GNUC__) && defined(__STRICT_ANSI__) + typedef int ssize_t __attribute__ ((mode (DI))); +#else + typedef __int64 ssize_t; +#endif +#else + typedef long ssize_t; +#endif +#endif #ifndef _WTIME_DEFINED -/* wide function prototypes, also declared in wchar.h */ -#ifndef __STRICT_ANSI__ -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime(const struct tm*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime(const time_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrdate(wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrtime(wchar_t*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*); -#endif -#endif /* __MSVCRT__ */ -#endif /* __STRICT_ANSI__ */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); -#define _WTIME_DEFINED -#endif /* _WTIME_DEFINED */ + _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm); + _CRTIMP wchar_t *__cdecl _wctime32(const __time32_t *_Time); + size_t __cdecl wcsftime(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm); + _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer); + _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer); + _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time); -#ifdef __cplusplus +#if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) +#define _INC_WTIME_INL +#ifdef _USE_32BIT_TIME_T +__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); } +#else +__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); } +#endif +#endif + +#define _WTIME_DEFINED +#endif + +#ifndef RC_INVOKED +double __cdecl difftime(time_t _Time1,time_t _Time2); +char *__cdecl ctime(const time_t *_Time); +struct tm *__cdecl gmtime(const time_t *_Time); +struct tm *__cdecl localtime(const time_t *_Time); +struct tm *__cdecl localtime_r(const time_t *_Time,struct tm *); + +time_t __cdecl mktime(struct tm *_Tm); +time_t __cdecl _mkgmtime(struct tm *_Tm); +time_t __cdecl time(time_t *_Time); + +#ifdef _USE_32BIT_TIME_T +#if 0 +__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); } +__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime32(_Time); } +__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime32(_Time); } +__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime32(_Tm); } +__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime32(_Tm); } +__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time32(_Time); } +#endif +#else +__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime64(_Time1,_Time2); } +__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime64(_Time); } +__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime64(_Time); } +__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return _localtime64(_Time); } +__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime64(_Tm); } +__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime64(_Tm); } +__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time64(_Time); } +#endif +#endif + +#if !defined(NO_OLDNAMES) || defined(_POSIX) +#define CLK_TCK CLOCKS_PER_SEC + + _CRTIMP extern int daylight; + _CRTIMP extern long timezone; + _CRTIMP extern char *tzname[2]; + void __cdecl tzset(void); +#endif + +#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */ +#define _TIMEVAL_DEFINED +struct timeval { + long tv_sec; + long tv_usec; +}; +#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#define timercmp(tvp,uvp,cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || (tvp)->tv_sec==(uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) +#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 +#endif /* _TIMEVAL_DEFINED */ + +#ifndef __STRICT_ANSI__ +#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */ +#define _TIMEZONE_DEFINED +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; + + extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z); +#endif +#endif /* __STRICT_ANSI__ */ + +#ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ +#pragma pack(pop) -#endif /* Not _TIME_H_ */ +#include +/* Adding timespec definition. */ +#include + +#endif /* End _TIME_H_ */ diff --git a/reactos/include/crt/unistd.h b/reactos/include/crt/unistd.h index 90934a0ed51..6065a918db5 100644 --- a/reactos/include/crt/unistd.h +++ b/reactos/include/crt/unistd.h @@ -1,11 +1,15 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ /* * This file is part of the Mingw32 package. * * unistd.h maps (roughly) to io.h */ -#ifndef _UNISTD_H -#define _UNISTD_H +#ifndef __STRICT_ANSI__ #include #include @@ -14,24 +18,12 @@ #include #undef __UNISTD_GETOPT__ -/* These are also defined in stdio.h. */ -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - #ifdef __cplusplus extern "C" { #endif - +#ifndef FTRUNCATE_DEFINED +#define FTRUNCATE_DEFINED /* This is defined as a real library function to allow autoconf to verify its existence. */ int ftruncate(int, off_t); @@ -39,9 +31,10 @@ __CRT_INLINE int ftruncate(int __fd, off_t __length) { return _chsize (__fd, __length); } +#endif #ifdef __cplusplus } #endif -#endif /* _UNISTD_H */ +#endif diff --git a/reactos/include/crt/utime.h b/reactos/include/crt/utime.h index 8285f38fdef..bf44bfe876b 100644 --- a/reactos/include/crt/utime.h +++ b/reactos/include/crt/utime.h @@ -1 +1,6 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ #include diff --git a/reactos/include/crt/wchar.h b/reactos/include/crt/wchar.h index 3c3ef35fac0..8a81e9e7003 100644 --- a/reactos/include/crt/wchar.h +++ b/reactos/include/crt/wchar.h @@ -1,427 +1,458 @@ -/* - * wchar.h +/** * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Defines of all functions for supporting wide characters. Actually it - * just includes all those headers, which is not a good thing to do from a - * processing time point of view, but it does mean that everything will be - * in sync. - * + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_WCHAR +#define _INC_WCHAR -#ifndef _WCHAR_H_ -#define _WCHAR_H_ - -/* All the headers include this file. */ #include <_mingw.h> -#ifndef RC_INVOKED +#pragma pack(push,_CRT_PACKING) -#define __need_size_t -#define __need_wint_t -#define __need_wchar_t -#define __need_NULL -#include - -#ifndef __VALIST -#if defined __GNUC__ && __GNUC__ >= 3 -#define __need___va_list -#include -#define __VALIST __builtin_va_list -#else -#define __VALIST char* -#endif -#endif - -#endif /* Not RC_INVOKED */ - -/* - * MSDN says that isw* char classifications are in wchar.h and wctype.h. - * Although the wctype names are ANSI, their exposure in this header is - * not. - */ -#include - -#ifndef __STRICT_ANSI__ -/* This is necessary to support the the non-ANSI wchar declarations - here. */ -#include -#endif /* __STRICT_ANSI__ */ - -#define WCHAR_MIN 0 -#define WCHAR_MAX 0xffff - -#ifndef WEOF -#define WEOF (wchar_t)(0xFFFF) -#endif - -#ifndef RC_INVOKED - -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -#ifndef _FILE_DEFINED /* Also in stdio.h */ -#define _FILE_DEFINED -typedef struct _iobuf -{ - char* _ptr; - int _cnt; - char* _base; - int _flag; - int _file; - int _charbuf; - int _bufsiz; - char* _tmpfname; -} FILE; -#endif /* Not _FILE_DEFINED */ +#define WCHAR_MIN 0 +#define WCHAR_MAX ((wchar_t) -1) /* UINT16_MAX */ -#ifndef _TIME_T_DEFINED /* Also in time.h */ -typedef long time_t; -#define _TIME_T_DEFINED +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + typedef __builtin_va_list __gnuc_va_list; #endif -#ifndef _TM_DEFINED /* Also in time.h */ -struct tm { - int tm_sec; /* seconds after the minute - [0,59] */ - int tm_min; /* minutes after the hour - [0,59] */ - int tm_hour; /* hours since midnight - [0,23] */ - int tm_mday; /* day of the month - [1,31] */ - int tm_mon; /* months since January - [0,11] */ - int tm_year; /* years since 1900 */ - int tm_wday; /* days since Sunday - [0,6] */ - int tm_yday; /* days since January 1 - [0,365] */ - int tm_isdst; /* daylight savings time flag */ - }; -#define _TM_DEFINED +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED + typedef __gnuc_va_list va_list; #endif -#ifndef _WSTDIO_DEFINED -/* Also in stdio.h - keep in sync */ -_CRTIMP int __cdecl __MINGW_NOTHROW fwprintf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wprintf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW swprintf (wchar_t*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _snwprintf (wchar_t*, size_t, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vfwprintf (FILE*, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vwprintf (const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW fwscanf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wscanf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW swscanf (const wchar_t*, const wchar_t*, ...); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwc (wchar_t, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW ungetwc (wchar_t, FILE*); - -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t); -#ifndef __STRICT_ANSI__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, wchar_t *); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfsopen (const wchar_t*, const wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*); -#endif /* __STRICT_ANSI__ */ -#endif /* __MSVCRT__ */ - -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg) - { return _vsnwprintf ( s, n, format, arg);} -int __cdecl __MINGW_NOTHROW vwscanf (const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vfwscanf (FILE * __restrict__, - const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vswscanf (const wchar_t * __restrict__, - const wchar_t * __restrict__, __VALIST); +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) #endif -#define _WSTDIO_DEFINED -#endif /* _WSTDIO_DEFINED */ -#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */ -_CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int); -_CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**); -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -float __cdecl __MINGW_NOTHROW wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__); -long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); -#endif /* __NO_ISOCEXT */ -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t); +#ifndef _FILE_DEFINED + struct _iobuf { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _charbuf; + int _bufsiz; + char *_tmpfname; + }; + typedef struct _iobuf FILE; +#define _FILE_DEFINED #endif -#define _WSTDLIB_DEFINED -#endif /* _WSTDLIB_DEFINED */ -#ifndef _WTIME_DEFINED -#ifndef __STRICT_ANSI__ -#ifdef __MSVCRT__ -/* wide function prototypes, also declared in time.h */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime (const struct tm*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrdate (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrtime (wchar_t*); -#if __MSVCRT_VERSION__ >= 0x601 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*); -#endif -#endif /* __MSVCRT__ */ -#endif /* __STRICT_ANSI__ */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); -#define _WTIME_DEFINED -#endif /* _WTIME_DEFINED */ - - -#ifndef _WSTRING_DEFINED -/* - * Unicode versions of the standard string calls. - * Also in string.h. - */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscat (wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcschr (const wchar_t*, wchar_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscpy (wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcscspn (const wchar_t*, const wchar_t*); -/* Note: _wcserror requires __MSVCRT_VERSION__ >= 0x0700. */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcslen (const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncat (wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsncmp(const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncpy(wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcspbrk(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrchr(const wchar_t*, wchar_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsspn(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsstr(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcstok(wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t); - -#ifndef __STRICT_ANSI__ -/* - * Unicode versions of non-ANSI functions provided by CRTDLL. - */ - -/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ -#define _wcscmpi _wcsicmp - -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*); - -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsncoll(const wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t); -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*); +#ifndef _STDIO_DEFINED +#ifdef _WIN64 + _CRTIMP FILE *__cdecl __iob_func(void); +#else +#ifdef _MSVCRT_ +extern FILE _iob[]; /* A pointer to an array of FILE */ +#define __iob_func() (_iob) +#else +extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ +#define __iob_func() (*_imp___iob) +#define _iob __iob_func() #endif #endif -#ifndef _NO_OLDNAMES -/* NOTE: There is no _wcscmpi, but this is for compatibility. */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW -wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) - {return _wcsicmp (__ws1, __ws2);} -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsupr (wchar_t*); -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not strict ANSI */ - -#define _WSTRING_DEFINED -#endif /* _WSTRING_DEFINED */ - -/* These are resolved by -lmingwex. Alternatively, they can be resolved by - adding -lmsvcp60 to your command line, which will give you the VC++ - versions of these functions. If you want the latter and don't have - msvcp60.dll in your windows system directory, you can easily obtain - it with a search from your favorite search engine. */ -#ifndef __STRICT_ANSI__ -typedef wchar_t _Wint_t; +#define _iob __iob_func() #endif -typedef int mbstate_t; +#ifndef _STDSTREAM_DEFINED +#define stdin (&__iob_func()[0]) +#define stdout (&__iob_func()[1]) +#define stderr (&__iob_func()[2]) +#define _STDSTREAM_DEFINED +#endif -wint_t __cdecl __MINGW_NOTHROW btowc(int); -size_t __cdecl __MINGW_NOTHROW mbrlen(const char * __restrict__, size_t, - mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW mbrtowc(wchar_t * __restrict__, const char * __restrict__, - size_t, mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW mbsrtowcs(wchar_t * __restrict__, const char ** __restrict__, - size_t, mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW wcrtomb(char * __restrict__, wchar_t, - mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW wcsrtombs(char * __restrict__, const wchar_t ** __restrict__, - size_t, mbstate_t * __restrict__); -int __cdecl __MINGW_NOTHROW wctob(wint_t); - -#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW fwide(FILE* __UNUSED_PARAM(stream), - int __UNUSED_PARAM(mode)) - {return -1;} /* limited to byte orientation */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t* __UNUSED_PARAM(ps)) - {return 1;} -wchar_t* __cdecl __MINGW_NOTHROW wmemset(wchar_t *, wchar_t, size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemchr(const wchar_t*, wchar_t, size_t); -int wmemcmp(const wchar_t*, const wchar_t *, size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemcpy(wchar_t* __restrict__, - const wchar_t* __restrict__, - size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemmove(wchar_t* s1, const wchar_t *, size_t); -long long __cdecl __MINGW_NOTHROW wcstoll(const wchar_t * __restrict__, - wchar_t** __restrict__, int); -unsigned long long __cdecl __MINGW_NOTHROW wcstoull(const wchar_t * __restrict__, - wchar_t ** __restrict__, int); -#endif /* __NO_ISOCEXT */ - -#ifndef __STRICT_ANSI__ -/* non-ANSI wide char functions from io.h, direct.h, sys/stat.h and locale.h. */ - -#ifndef _FSIZE_T_DEFINED -typedef unsigned long _fsize_t; +#ifndef _FSIZE_T_DEFINED + typedef unsigned long _fsize_t; #define _FSIZE_T_DEFINED #endif #ifndef _WFINDDATA_T_DEFINED -struct _wfinddata_t { - unsigned attrib; - time_t time_create; /* -1 for FAT file systems */ - time_t time_access; /* -1 for FAT file systems */ - time_t time_write; - _fsize_t size; - wchar_t name[260]; /* may include spaces. */ -}; -struct _wfinddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - wchar_t name[260]; -}; -struct __wfinddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; - _fsize_t size; - wchar_t name[260]; -}; + struct _wfinddata32_t { + unsigned attrib; + __time32_t time_create; + __time32_t time_access; + __time32_t time_write; + _fsize_t size; + wchar_t name[260]; + }; + + struct _wfinddata32i64_t { + unsigned attrib; + __time32_t time_create; + __time32_t time_access; + __time32_t time_write; + __int64 size; + wchar_t name[260]; + }; + + struct _wfinddata64i32_t { + unsigned attrib; + __time64_t time_create; + __time64_t time_access; + __time64_t time_write; + _fsize_t size; + wchar_t name[260]; + }; + + struct _wfinddata64_t { + unsigned attrib; + __time64_t time_create; + __time64_t time_access; + __time64_t time_write; + __int64 size; + wchar_t name[260]; + }; + +#if !defined(_WIN64) //defined(_USE_32BIT_TIME_T) +#define _wfinddata_t _wfinddata32_t +#define _wfinddatai64_t _wfinddata32i64_t + +#define _wfindfirst _wfindfirst32 +#define _wfindnext _wfindnext32 +#define _wfindfirsti64 _wfindfirst32i64 +#define _wfindnexti64 _wfindnext32i64 +#else +#define _wfinddata_t _wfinddata64i32_t +#define _wfinddatai64_t _wfinddata64_t + +#define _wfindfirst _wfindfirst64i32 +#define _wfindnext _wfindnext64i32 +#define _wfindfirsti64 _wfindfirst64 +#define _wfindnexti64 _wfindnext64 +#endif + #define _WFINDDATA_T_DEFINED #endif -/* Wide character versions. Also defined in io.h. */ -/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also - applies to other wide character versions? */ -#if !defined (_WIO_DEFINED) -#if defined (__MSVCRT__) -#include /* For intptr_t. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _waccess (const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wchmod (const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcreat (const wchar_t*, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t*, struct _wfinddata_t *); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext (long, struct _wfinddata_t *); -_CRTIMP int __cdecl __MINGW_NOTHROW _wunlink (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wopen (const wchar_t*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsopen (const wchar_t*, int, int, ...); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wmktemp (wchar_t*); -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnexti64 (long, struct _wfinddatai64_t*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#endif /* defined (__MSVCRT__) */ -#define _WIO_DEFINED -#endif /* _WIO_DEFINED */ +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#ifndef _CONST_RETURN +#define _CONST_RETURN +#endif + +#define _WConst_return _CONST_RETURN + +#ifndef _CRT_CTYPEDATA_DEFINED +#define _CRT_CTYPEDATA_DEFINED +#ifndef _CTYPE_DISABLE_MACROS + +#ifndef __PCTYPE_FUNC +#define __PCTYPE_FUNC __pctype_func() +#ifdef _MSVCRT_ +#define __pctype_func() (_pctype) +#else +#define __pctype_func() (*_imp___pctype) +#endif +#endif + +#ifndef _pctype +#ifdef _MSVCRT_ + extern unsigned short *_pctype; +#else + extern unsigned short **_imp___pctype; +#define _pctype (*_imp___pctype) +#endif +#endif +#endif +#endif + +#ifndef _CRT_WCTYPEDATA_DEFINED +#define _CRT_WCTYPEDATA_DEFINED +#ifndef _CTYPE_DISABLE_MACROS +#ifndef _wctype +#ifdef _MSVCRT_ + extern unsigned short *_wctype; +#else + extern unsigned short **_imp___wctype; +#define _wctype (*_imp___wctype) +#endif +#endif + +#ifdef _MSVCRT_ +#define __pwctype_func() (_pwctype) +#else +#define __pwctype_func() (*_imp___pwctype) +#endif + +#ifndef _pwctype +#ifdef _MSVCRT_ + extern unsigned short *_pwctype; +#else + extern unsigned short **_imp___pwctype; +#define _pwctype (*_imp___pwctype) +#endif +#endif + +#endif +#endif + +#define _UPPER 0x1 +#define _LOWER 0x2 +#define _DIGIT 0x4 +#define _SPACE 0x8 + +#define _PUNCT 0x10 +#define _CONTROL 0x20 +#define _BLANK 0x40 +#define _HEX 0x80 + +#define _LEADBYTE 0x8000 +#define _ALPHA (0x0100|_UPPER|_LOWER) + +#ifndef _WCTYPE_DEFINED +#define _WCTYPE_DEFINED + + int __cdecl iswalpha(wint_t _C); + _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale); + int __cdecl iswupper(wint_t _C); + _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale); + int __cdecl iswlower(wint_t _C); + _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale); + int __cdecl iswdigit(wint_t _C); + _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale); + int __cdecl iswxdigit(wint_t _C); + _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale); + int __cdecl iswspace(wint_t _C); + _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale); + int __cdecl iswpunct(wint_t _C); + _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale); + int __cdecl iswalnum(wint_t _C); + _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale); + int __cdecl iswprint(wint_t _C); + _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale); + int __cdecl iswgraph(wint_t _C); + _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale); + int __cdecl iswcntrl(wint_t _C); + _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale); + int __cdecl iswascii(wint_t _C); + int __cdecl isleadbyte(int _C); + _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale); + wint_t __cdecl towupper(wint_t _C); + _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale); + wint_t __cdecl towlower(wint_t _C); + _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale); + int __cdecl iswctype(wint_t _C,wctype_t _Type); + _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale); + _CRTIMP int __cdecl __iswcsymf(wint_t _C); + _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale); + _CRTIMP int __cdecl __iswcsym(wint_t _C); + _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale); + int __cdecl is_wctype(wint_t _C,wctype_t _Type); +#endif #ifndef _WDIRECT_DEFINED -/* Also in direct.h */ -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wchdir (const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetcwd (wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetdcwd (int, wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wmkdir (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrmdir (const wchar_t*); -#endif /* __MSVCRT__ */ #define _WDIRECT_DEFINED -#endif /* _WDIRECT_DEFINED */ + + _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords); + _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords); + wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords); + _CRTIMP int __cdecl _wchdir(const wchar_t *_Path); + _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path); + _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path); +#endif + +#ifndef _WIO_DEFINED +#define _WIO_DEFINED + + _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode); + _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode); + _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode); + _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData); + _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData); + _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename); + _CRTIMP int __cdecl _wrename(const wchar_t *_NewFilename,const wchar_t *_OldFilename); + _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData); + intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData); + _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData); + _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData); + int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData); + _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData); +#endif + _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag); +#if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64)) + _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...); + _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...); +#else + extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0); + extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0); +#endif +#endif + +#ifndef _WLOCALE_DEFINED +#define _WLOCALE_DEFINED + _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale); +#endif + +#ifndef _WPROCESS_DEFINED +#define _WPROCESS_DEFINED + + _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); + _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); + _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); + _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); + _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); + _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); +#ifndef _CRT_WSYSTEM_DEFINED +#define _CRT_WSYSTEM_DEFINED + _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); +#endif +#endif + +#ifndef _WCTYPE_INLINE_DEFINED +#undef _CRT_WCTYPE_NOINLINE +#if !defined(__cplusplus) || defined(_CRT_WCTYPE_NOINLINE) +#define iswalpha(_c) (iswctype(_c,_ALPHA)) +#define iswupper(_c) (iswctype(_c,_UPPER)) +#define iswlower(_c) (iswctype(_c,_LOWER)) +#define iswdigit(_c) (iswctype(_c,_DIGIT)) +#define iswxdigit(_c) (iswctype(_c,_HEX)) +#define iswspace(_c) (iswctype(_c,_SPACE)) +#define iswpunct(_c) (iswctype(_c,_PUNCT)) +#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) +#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) +#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) +#define iswcntrl(_c) (iswctype(_c,_CONTROL)) +#define iswascii(_c) ((unsigned)(_c) < 0x80) + +#define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p)) +#define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p)) +#define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p)) +#define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p)) +#define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p)) +#define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p)) +#define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p)) +#define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p)) +#define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p)) +#define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p)) +#define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p)) +#ifndef _CTYPE_DISABLE_MACROS +#define isleadbyte(_c) (__PCTYPE_FUNC[(unsigned char)(_c)] & _LEADBYTE) +#endif +#endif +#define _WCTYPE_INLINE_DEFINED +#endif + +#if !defined(_POSIX_) || defined(__GNUC__) +#ifndef _INO_T_DEFINED +#define _INO_T_DEFINED + typedef unsigned short _ino_t; +#ifndef NO_OLDNAMES + typedef unsigned short ino_t; +#endif +#endif + +#ifndef _DEV_T_DEFINED +#define _DEV_T_DEFINED + typedef unsigned int _dev_t; +#ifndef NO_OLDNAMES + typedef unsigned int dev_t; +#endif +#endif + +#ifndef _OFF_T_DEFINED +#define _OFF_T_DEFINED +#ifndef _OFF_T_ +#define _OFF_T_ + typedef long _off_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long off_t; +#endif +#endif +#endif + +#ifndef _OFF64_T_DEFINED +#define _OFF64_T_DEFINED + typedef long long _off64_t; +#if !defined(NO_OLDNAMES) || defined(_POSIX) + typedef long long off64_t; +#endif +#endif #ifndef _STAT_DEFINED -/* - * The structure manipulated and returned by stat and fstat. - * - * NOTE: If called on a directory the values in the time fields are not only - * invalid, they will cause localtime et. al. to return NULL. And calling - * asctime with a NULL pointer causes an Invalid Page Fault. So watch it! - */ -struct _stat -{ - _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - _ino_t st_ino; /* Always zero ? */ - _mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - _dev_t st_rdev; /* Seems useless (not even filled in) */ - _off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; +#define _STAT_DEFINED -#ifndef _NO_OLDNAMES -/* NOTE: Must be the same as _stat above. */ -struct stat -{ - _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - _ino_t st_ino; /* Always zero ? */ - _mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - _dev_t st_rdev; /* Seems useless (not even filled in) */ - _off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; -#endif /* _NO_OLDNAMES */ +#ifdef _USE_32BIT_TIME_T +#ifdef WIN64 +#define _fstat _fstat32 +#define _stat _stat32 +#define _wstat _wstat32 +#else +#define _fstat32 _fstat +#define _stat32 _stat +#define _wstat32 _wstat +#endif +#define _fstati64 _fstat32i64 +#define _stati64 _stat32i64 +#define _wstati64 _wstat32i64 +#else +#define _fstat _fstat64i32 +#define _fstati64 _fstat64 +#define _stat _stat64i32 +#define _stati64 _stat64 +#define _wstat _wstat64i32 +#define _wstati64 _wstat64 +#endif -#if defined (__MSVCRT__) -struct _stati64 { + struct _stat32 { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + __time32_t st_atime; + __time32_t st_mtime; + __time32_t st_ctime; + }; + +#ifndef NO_OLDNAMES + struct stat { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + }; +#endif + +#if _INTEGRAL_MAX_BITS >= 64 + + struct _stat32i64 { _dev_t st_dev; _ino_t st_ino; unsigned short st_mode; @@ -430,16 +461,29 @@ struct _stati64 { short st_gid; _dev_t st_rdev; __int64 st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; - }; + __time32_t st_atime; + __time32_t st_mtime; + __time32_t st_ctime; + }; -struct __stat64 -{ + struct _stat64i32 { _dev_t st_dev; _ino_t st_ino; - _mode_t st_mode; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + _off_t st_size; + __time64_t st_atime; + __time64_t st_mtime; + __time64_t st_ctime; + }; + + struct _stat64 { + _dev_t st_dev; + _ino_t st_ino; + unsigned short st_mode; short st_nlink; short st_uid; short st_gid; @@ -448,36 +492,382 @@ struct __stat64 __time64_t st_atime; __time64_t st_mtime; __time64_t st_ctime; -}; -#endif /* __MSVCRT__ */ -#define _STAT_DEFINED -#endif /* _STAT_DEFINED */ + }; +#endif -#if !defined ( _WSTAT_DEFINED) -/* also declared in sys/stat.h */ -#if defined __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat (const wchar_t*, struct _stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t*, struct _stati64*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct __stat64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#endif /* __MSVCRT__ */ +#define __stat64 _stat64 + +#endif + +#ifndef _WSTAT_DEFINED #define _WSTAT_DEFINED -#endif /* ! _WSTAT_DEFIND */ -#ifndef _WLOCALE_DEFINED /* also declared in locale.h */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wsetlocale (int, const wchar_t*); -#define _WLOCALE_DEFINED + _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat); + int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat); + _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat); +#endif +#endif #endif -#endif /* not __STRICT_ANSI__ */ +#ifndef _WCONIO_DEFINED +#define _WCONIO_DEFINED +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) +#endif + + _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer); + _CRTIMP wint_t __cdecl _getwch(void); + _CRTIMP wint_t __cdecl _getwche(void); + _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh); + _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh); + _CRTIMP int __cdecl _cputws(const wchar_t *_String); + _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...); + _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...); + _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList); + + _CRTIMP int __cdecl _cwprintf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + wint_t __cdecl _putwch_nolock(wchar_t _WCh); + wint_t __cdecl _getwch_nolock(void); + wint_t __cdecl _getwche_nolock(void); + wint_t __cdecl _ungetwch_nolock(wint_t _WCh); +#endif + +#ifndef _WSTDIO_DEFINED +#define _WSTDIO_DEFINED + +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) +#endif + +#ifdef _POSIX_ + _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode); +#else + _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag); +#endif + + wint_t __cdecl fgetwc(FILE *_File); + _CRTIMP wint_t __cdecl _fgetwchar(void); + wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File); + _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch); + wint_t __cdecl getwc(FILE *_File); + wint_t __cdecl getwchar(void); + wint_t __cdecl putwc(wchar_t _Ch,FILE *_File); + wint_t __cdecl putwchar(wchar_t _Ch); + wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File); + wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File); + int __cdecl fputws(const wchar_t *_Str,FILE *_File); + _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String); + _CRTIMP int __cdecl _putws(const wchar_t *_Str); + int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...); + int __cdecl wprintf(const wchar_t *_Format,...); + _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...); + int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList); + int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...); + _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list); + _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vswprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args); +#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ + int __cdecl snwprintf (wchar_t *s, size_t n, const wchar_t * format, ...); + __CRT_INLINE int __cdecl vsnwprintf (wchar_t *s, size_t n, const wchar_t *format, va_list arg) { return _vsnwprintf(s,n,format,arg); } + int __cdecl vwscanf (const wchar_t *, va_list); + int __cdecl vfwscanf (FILE *,const wchar_t *,va_list); + int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list); +#endif + _CRTIMP int __cdecl _fwprintf_p(FILE *_File,const wchar_t *_Format,...); + _CRTIMP int __cdecl _wprintf_p(const wchar_t *_Format,...); + _CRTIMP int __cdecl _vfwprintf_p(FILE *_File,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _vwprintf_p(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _swprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vswprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _scwprintf_p(const wchar_t *_Format,...); + _CRTIMP int __cdecl _vscwprintf_p(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _wprintf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _wprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _fwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _fwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vfwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vfwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _swprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _swprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vswprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _vswprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _scwprintf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _snwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _vsnwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...); + _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args); + _CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...); + _CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args); +#ifndef RC_INVOKED +#include +#endif + +#ifdef _CRT_NON_CONFORMING_SWPRINTFS +#ifndef __cplusplus +#define swprintf _swprintf +#define vswprintf _vswprintf +#define _swprintf_l __swprintf_l +#define _vswprintf_l __vswprintf_l +#endif +#endif + + _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix); + _CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList); + _CRTIMP int __cdecl _vscwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); + int __cdecl fwscanf(FILE *_File,const wchar_t *_Format,...); + _CRTIMP int __cdecl _fwscanf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); + int __cdecl swscanf(const wchar_t *_Src,const wchar_t *_Format,...); + _CRTIMP int __cdecl _swscanf_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP int __cdecl _snwscanf(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...); + _CRTIMP int __cdecl _snwscanf_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); + int __cdecl wscanf(const wchar_t *_Format,...); + _CRTIMP int __cdecl _wscanf_l(const wchar_t *_Format,_locale_t _Locale,...); + _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode); + _CRTIMP FILE *__cdecl _wfopen(const wchar_t *_Filename,const wchar_t *_Mode); + _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile); + +#ifndef _CRT_WPERROR_DEFINED +#define _CRT_WPERROR_DEFINED + _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); +#endif + _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode); +#if !defined(NO_OLDNAMES) && !defined(wpopen) +#define wpopen _wpopen +#endif + _CRTIMP int __cdecl _wremove(const wchar_t *_Filename); + _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer); + _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File); + _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File); + _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File); + +#undef _CRT_GETPUTWCHAR_NOINLINE + +#if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) +#define getwchar() fgetwc(stdin) +#define putwchar(_c) fputwc((_c),stdout) +#else + __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); } + __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); } +#endif + +#define getwc(_stm) fgetwc(_stm) +#define putwc(_c,_stm) fputwc(_c,_stm) +#define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm) +#define _getwc_nolock(_c) _fgetwc_nolock(_c) +#endif + +#ifndef _WSTDLIB_DEFINED +#define _WSTDLIB_DEFINED + + _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix); + _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix); + _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix); + double __cdecl wcstod(const wchar_t *_Str,wchar_t **_EndPtr); + _CRTIMP double __cdecl _wcstod_l(const wchar_t *_Str,wchar_t **_EndPtr,_locale_t _Locale); + float __cdecl wcstof( const wchar_t *nptr, wchar_t **endptr); +#if !defined __NO_ISOCEXT /* in libmingwex.a */ + float __cdecl wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__); + long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); +#endif /* __NO_ISOCEXT */ + long __cdecl wcstol(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP long __cdecl _wcstol_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); + unsigned long __cdecl wcstoul(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName); +#ifndef _CRT_WSYSTEM_DEFINED +#define _CRT_WSYSTEM_DEFINED + _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); +#endif + _CRTIMP double __cdecl _wtof(const wchar_t *_Str); + _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale); + _CRTIMP int __cdecl _wtoi(const wchar_t *_Str); + _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale); + _CRTIMP long __cdecl _wtol(const wchar_t *_Str); + _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale); + +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix); + _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix); + _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str); + _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale); + _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); + _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); + _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); +#endif +#endif + +#ifndef _POSIX_ +#ifndef _WSTDLIBP_DEFINED +#define _WSTDLIBP_DEFINED + _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords); + _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); +#ifndef _CRT_WPERROR_DEFINED +#define _CRT_WPERROR_DEFINED + _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); +#endif + _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString); + _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath); + _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext); +#endif +#endif + +#ifndef _WSTRING_DEFINED +#define _WSTRING_DEFINED + _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str); + wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source); + _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch); + int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); + wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source); + size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); + size_t __cdecl wcslen(const wchar_t *_Str); + size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); + wchar_t *__cdecl wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); + int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + wchar_t *__cdecl wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count); + _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control); + _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch); + size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control); + _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr); + wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim); + _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum); + _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str); + _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); + _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount); + _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str); + _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val); + _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String); + _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String); + _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale); + size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount); + _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale); + int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2); + _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); + _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); + +#ifndef NO_OLDNAMES + /* NOTE: There is no _wcscmpi, but this is for compatibility. */ + int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2); + __CRT_INLINE int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) { return _wcsicmp (__ws1, __ws2); } + #define _wcscmpi _wcsicmp + + wchar_t *__cdecl wcsdup(const wchar_t *_Str); +#define wcswcs wcsstr + int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); + int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); + wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount); + wchar_t *__cdecl wcsrev(wchar_t *_Str); + wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val); + wchar_t *__cdecl wcslwr(wchar_t *_Str); + wchar_t *__cdecl wcsupr(wchar_t *_Str); + int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); +#endif +#endif + +#ifndef _TM_DEFINED +#define _TM_DEFINED + struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + }; +#endif + +#ifndef _WTIME_DEFINED +#define _WTIME_DEFINED + + _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm); + _CRTIMP wchar_t *__cdecl _wctime32(const __time32_t *_Time); + size_t __cdecl wcsftime(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm); + _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale); + _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer); + _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer); +#if _INTEGRAL_MAX_BITS >= 64 + _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time); +#endif + +#if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) +#define _INC_WTIME_INL +#ifdef _USE_32BIT_TIME_T +__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); } +#else +__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); } +#endif +#endif +#endif + + typedef int mbstate_t; + typedef wchar_t _Wint_t; + + wint_t __cdecl btowc(int); + size_t __cdecl mbrlen(const char *_Ch,size_t _SizeInBytes,mbstate_t *_State); + size_t __cdecl mbrtowc(wchar_t *_DstCh,const char *_SrcCh,size_t _SizeInBytes,mbstate_t *_State); + size_t __cdecl mbsrtowcs(wchar_t *_Dest,const char **_PSrc,size_t _Count,mbstate_t *_State); + size_t __cdecl wcrtomb(char *_Dest,wchar_t _Source,mbstate_t *_State); + size_t __cdecl wcsrtombs(char *_Dest,const wchar_t **_PSource,size_t _Count,mbstate_t *_State); + int __cdecl wctob(wint_t _WCh); + +#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ + wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n); + _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n); + int wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n); + wchar_t *__cdecl wmemcpy(wchar_t *s1,const wchar_t *s2,size_t n); + wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n); + long long __cdecl wcstoll(const wchar_t *nptr,wchar_t **endptr, int base); + unsigned long long __cdecl wcstoull(const wchar_t *nptr,wchar_t **endptr, int base); +#endif /* __NO_ISOCEXT */ + + void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount); + void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _MaxCount); + __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); } + __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); } + __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) { for (;0<_N;++_S,--_N) if (*_S==_C) return (_CONST_RETURN wchar_t *)(_S); return (0); } + __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) { for (; 0 < _N; ++_S1,++_S2,--_N) if (*_S1!=*_S2) return (*_S1 < *_S2 ? -1 : +1); return (0); } + __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memcpy(_S1,_S2,_N*sizeof(wchar_t)); } + __CRT_INLINE wchar_t *__cdecl wmemmove(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memmove(_S1,_S2,_N*sizeof(wchar_t)); } + __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) { + wchar_t *_Su = _S; + for (;0<_N;++_Su,--_N) { + *_Su = _C; + } + return (_S); + } #ifdef __cplusplus -} /* end of extern "C" */ +} #endif -#endif /* Not RC_INVOKED */ - -#endif /* not _WCHAR_H_ */ - +#pragma pack(pop) +#include +#endif diff --git a/reactos/include/crt/wctype.h b/reactos/include/crt/wctype.h index 57f61f71d43..a44cb384af2 100644 --- a/reactos/include/crt/wctype.h +++ b/reactos/include/crt/wctype.h @@ -1,170 +1,172 @@ -/* - * wctype.h - * - * Functions for testing wide character types and converting characters. - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Mumit Khan - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. */ +#ifndef _INC_WCTYPE +#define _INC_WCTYPE -#ifndef _WCTYPE_H_ -#define _WCTYPE_H_ +#ifndef _WIN32 +#error Only Win32 target is supported! +#endif -/* All the headers include this file. */ #include <_mingw.h> -#define __need_wchar_t -#define __need_wint_t -#ifndef RC_INVOKED -#include -#endif /* Not RC_INVOKED */ - -/* - * The following flags are used to tell iswctype and _isctype what character - * types you are looking for. - */ -#define _UPPER 0x0001 -#define _LOWER 0x0002 -#define _DIGIT 0x0004 -#define _SPACE 0x0008 -#define _PUNCT 0x0010 -#define _CONTROL 0x0020 -#define _BLANK 0x0040 -#define _HEX 0x0080 -#define _LEADBYTE 0x8000 - -#define _ALPHA 0x0103 - -#ifndef RC_INVOKED +#pragma pack(push,_CRT_PACKING) #ifdef __cplusplus extern "C" { #endif -#ifndef WEOF -#define WEOF (wchar_t)(0xFFFF) +#ifndef _CRTIMP +#define _CRTIMP __declspec(dllimport) +#endif + +#ifndef _WCHAR_T_DEFINED + typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED #endif #ifndef _WCTYPE_T_DEFINED -typedef wchar_t wctype_t; + typedef unsigned short wint_t; + typedef unsigned short wctype_t; #define _WCTYPE_T_DEFINED #endif -/* Wide character equivalents - also in ctype.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t); -_CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */ -_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t); - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -int __cdecl __MINGW_NOTHROW iswblank (wint_t); +#ifndef WEOF +#define WEOF (wint_t)(0xFFFF) #endif -/* Older MS docs uses wchar_t for arg and return type, while newer - online MS docs say arg is wint_t and return is int. - ISO C uses wint_t for both. */ -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towlower (wint_t); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towupper (wint_t); +#ifndef _CRT_CTYPEDATA_DEFINED +#define _CRT_CTYPEDATA_DEFINED +#ifndef _CTYPE_DISABLE_MACROS -_CRTIMP int __cdecl __MINGW_NOTHROW isleadbyte (int); - -/* Also in ctype.h */ - -#ifndef _CTYPE_H_ -#ifdef __DECLSPEC_SUPPORTED -# if __MSVCRT_VERSION__ <= 0x0700 - __MINGW_IMPORT unsigned short _ctype[]; -# endif -# ifdef __MSVCRT__ - __MINGW_IMPORT const unsigned short* _pctype; -# else /* CRTDLL */ - __MINGW_IMPORT const unsigned short* _pctype_dll; -# define _pctype _pctype_dll -# endif - -#else /* ! __DECLSPEC_SUPPORTED */ -# if __MSVCRT_VERSION__ <= 0x0700 - extern unsigned short** _imp___ctype; -# define _ctype (*_imp___ctype) -# endif -# ifdef __MSVCRT__ - extern unsigned short** _imp___pctype; -# define _pctype (*_imp___pctype) -# else /* CRTDLL */ - extern unsigned short** _imp___pctype_dll; -# define _pctype (*_imp___pctype_dll) -# endif /* CRTDLL */ -#endif /* __DECLSPEC_SUPPORTED */ +#ifndef __PCTYPE_FUNC +#define __PCTYPE_FUNC __pctype_func() +#ifdef _MSVCRT_ +#define __pctype_func() (_pctype) +#else +#define __pctype_func() (*_imp___pctype) +#endif #endif -#if !(defined (__NO_INLINE__) || defined(__NO_CTYPE_INLINES) \ - || defined(__WCTYPE_INLINES_DEFINED)) -#define __WCTYPE_INLINES_DEFINED -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswascii(wint_t wc) {return ((wc & ~0x7F) ==0);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswlower(wint_t wc) {return (iswctype(wc,_LOWER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswspace(wint_t wc) {return (iswctype(wc,_SPACE));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswupper(wint_t wc) {return (iswctype(wc,_UPPER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswblank (wint_t wc) - {return (iswctype(wc, _BLANK) || wc == L'\t');} +#ifndef _pctype +#ifdef _MSVCRT_ + extern unsigned short *_pctype; +#else + extern unsigned short **_imp___pctype; +#define _pctype (*_imp___pctype) +#endif #endif -#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ +#endif +#endif -typedef wchar_t wctrans_t; +#ifndef _CRT_WCTYPEDATA_DEFINED +#define _CRT_WCTYPEDATA_DEFINED +#ifndef _CTYPE_DISABLE_MACROS +#ifndef _wctype +#ifdef _MSVCRT_ + extern unsigned short *_wctype; +#else + extern unsigned short **_imp___wctype; +#define _wctype (*_imp___wctype) +#endif +#endif -/* These are resolved by libmingwex.a. Note, that they are also exported - by the MS C++ runtime lib (msvcp60.dll). The msvcp60.dll implementations - of wctrans and towctrans are not C99 compliant in that wctrans("tolower") - returns 0, while std specifies that a non-zero value should be returned - for a valid string descriptor. If you want the MS behaviour (and you have - msvcp60.dll in your path) add -lmsvcp60 to your command line. */ +#ifndef _pwctype +#ifdef _MSVCRT_ + extern unsigned short *_pwctype; +#else + extern unsigned short **_imp___pwctype; +#define _pwctype (*_imp___pwctype) +#define __pwctype_func() (*_imp___pwctype) +#endif +#endif +#endif +#endif -wint_t __cdecl __MINGW_NOTHROW towctrans(wint_t, wctrans_t); -wctrans_t __cdecl __MINGW_NOTHROW wctrans(const char*); -wctype_t __cdecl __MINGW_NOTHROW wctype(const char*); +#define _UPPER 0x1 +#define _LOWER 0x2 +#define _DIGIT 0x4 +#define _SPACE 0x8 + +#define _PUNCT 0x10 +#define _CONTROL 0x20 +#define _BLANK 0x40 +#define _HEX 0x80 + +#define _LEADBYTE 0x8000 +#define _ALPHA (0x0100|_UPPER|_LOWER) + +#ifndef _WCTYPE_DEFINED +#define _WCTYPE_DEFINED + + int __cdecl iswalpha(wint_t); + int __cdecl iswupper(wint_t); + int __cdecl iswlower(wint_t); + int __cdecl iswdigit(wint_t); + int __cdecl iswxdigit(wint_t); + int __cdecl iswspace(wint_t); + int __cdecl iswpunct(wint_t); + int __cdecl iswalnum(wint_t); + int __cdecl iswprint(wint_t); + int __cdecl iswgraph(wint_t); + int __cdecl iswcntrl(wint_t); + int __cdecl iswascii(wint_t); + int __cdecl isleadbyte(int); + wint_t __cdecl towupper(wint_t); + wint_t __cdecl towlower(wint_t); + int __cdecl iswctype(wint_t,wctype_t); + _CRTIMP int __cdecl __iswcsymf(wint_t); + _CRTIMP int __cdecl __iswcsym(wint_t); + int __cdecl is_wctype(wint_t,wctype_t); +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) +int __cdecl isblank(int _C); +#endif +#endif + +#ifndef _WCTYPE_INLINE_DEFINED +#define _WCTYPE_INLINE_DEFINED +#ifndef __cplusplus +#define iswalpha(_c) (iswctype(_c,_ALPHA)) +#define iswupper(_c) (iswctype(_c,_UPPER)) +#define iswlower(_c) (iswctype(_c,_LOWER)) +#define iswdigit(_c) (iswctype(_c,_DIGIT)) +#define iswxdigit(_c) (iswctype(_c,_HEX)) +#define iswspace(_c) (iswctype(_c,_SPACE)) +#define iswpunct(_c) (iswctype(_c,_PUNCT)) +#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) +#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) +#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) +#define iswcntrl(_c) (iswctype(_c,_CONTROL)) +#define iswascii(_c) ((unsigned)(_c) < 0x80) +#define isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE) +#else + __CRT_INLINE int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); } + __CRT_INLINE int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); } + __CRT_INLINE int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); } + __CRT_INLINE int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); } + __CRT_INLINE int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); } + __CRT_INLINE int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); } + __CRT_INLINE int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); } + __CRT_INLINE int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); } + __CRT_INLINE int __cdecl iswprint(wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); } + __CRT_INLINE int __cdecl iswgraph(wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); } + __CRT_INLINE int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); } + __CRT_INLINE int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); } + __CRT_INLINE int __cdecl isleadbyte(int _C) {return (__pctype_func()[(unsigned char)(_C)] & _LEADBYTE); } +#endif +#endif + + typedef wchar_t wctrans_t; + wint_t __cdecl towctrans(wint_t,wctrans_t); + wctrans_t __cdecl wctrans(const char *); + wctype_t __cdecl wctype(const char *); #ifdef __cplusplus } #endif -#endif /* Not RC_INVOKED */ - -#endif /* Not _WCTYPE_H_ */ - - +#pragma pack(pop) +#endif From 9369532afaa2410d030b0163579ae47d89e02300 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 30 Aug 2008 16:50:58 +0000 Subject: [PATCH 212/388] Commit WIP. Part 2 of ?? Update mingw32 runtime to mingw-w64 trunk -Support for msvc 7.0 features -TLS support disabled because ros is not ready svn path=/branches/ros-amd64-bringup/; revision=35809 --- reactos/lib/3rdparty/mingw/CRT_fp10.c | 4 + reactos/lib/3rdparty/mingw/CRTfmode.c | 16 - reactos/lib/3rdparty/mingw/CRTglob.c | 16 - reactos/lib/3rdparty/mingw/CRTinit.c | 24 - reactos/lib/3rdparty/mingw/_newmode.c | 1 + reactos/lib/3rdparty/mingw/_wgetopt.c | 15 - reactos/lib/3rdparty/mingw/argv.c | 19 + reactos/lib/3rdparty/mingw/atonexit.c | 50 ++ reactos/lib/3rdparty/mingw/binmode.c | 7 +- reactos/lib/3rdparty/mingw/charmax.c | 9 + reactos/lib/3rdparty/mingw/cinitexe.c | 7 + reactos/lib/3rdparty/mingw/cpu_features.c | 105 ---- reactos/lib/3rdparty/mingw/cpu_features.h | 25 - reactos/lib/3rdparty/mingw/crt0_c.c | 6 + reactos/lib/3rdparty/mingw/crt0_w.c | 9 + reactos/lib/3rdparty/mingw/crt1.c | 297 ----------- reactos/lib/3rdparty/mingw/crtdll.c | 201 ++++++++ reactos/lib/3rdparty/mingw/crtexe.c | 469 ++++++++++++++++++ reactos/lib/3rdparty/mingw/dllcrt1.c | 185 ------- reactos/lib/3rdparty/mingw/dllentry.c | 8 + reactos/lib/3rdparty/mingw/dllmain.c | 9 + reactos/lib/3rdparty/mingw/gccmain.c | 52 +- reactos/lib/3rdparty/mingw/getopt.c | 137 ----- reactos/lib/3rdparty/mingw/gs_support.c | 129 +++++ reactos/lib/3rdparty/mingw/init.c | 67 --- reactos/lib/3rdparty/mingw/internal.h | 171 +++++++ reactos/lib/3rdparty/mingw/isascii.c | 21 - reactos/lib/3rdparty/mingw/iscsym.c | 20 - reactos/lib/3rdparty/mingw/iscsymf.c | 21 - reactos/lib/3rdparty/mingw/main.c | 79 --- reactos/lib/3rdparty/mingw/merr.c | 12 + reactos/lib/3rdparty/mingw/mingw.rbuild | 49 +- reactos/lib/3rdparty/mingw/mingw_helpers.c | 25 + .../lib/3rdparty/mingw/moldname-msvcrt.def | 10 - reactos/lib/3rdparty/mingw/natstart.c | 7 + reactos/lib/3rdparty/mingw/oscalls.h | 41 ++ reactos/lib/3rdparty/mingw/pesect.c | 66 +++ reactos/lib/3rdparty/mingw/strcasecmp.c | 21 - reactos/lib/3rdparty/mingw/strncasecmp.c | 21 - reactos/lib/3rdparty/mingw/tgetopt.h | 90 ---- reactos/lib/3rdparty/mingw/tlssup.c | 129 +++++ reactos/lib/3rdparty/mingw/toascii.c | 22 - reactos/lib/3rdparty/mingw/wbinmode.c | 5 - reactos/lib/3rdparty/mingw/wcrt1.c | 295 ----------- reactos/lib/3rdparty/mingw/wcscmpi.c | 21 - reactos/lib/3rdparty/mingw/wildcard.c | 1 + reactos/lib/3rdparty/mingw/winit.c | 66 --- reactos/lib/3rdparty/mingw/wmain.c | 86 ---- reactos/lib/3rdparty/mingw/xncommod.c | 1 + reactos/lib/3rdparty/mingw/xthdloc.c | 1 + reactos/lib/3rdparty/mingw/xtxtmode.c | 1 + 51 files changed, 1423 insertions(+), 1726 deletions(-) create mode 100644 reactos/lib/3rdparty/mingw/CRT_fp10.c delete mode 100644 reactos/lib/3rdparty/mingw/CRTfmode.c delete mode 100644 reactos/lib/3rdparty/mingw/CRTglob.c delete mode 100644 reactos/lib/3rdparty/mingw/CRTinit.c create mode 100644 reactos/lib/3rdparty/mingw/_newmode.c delete mode 100644 reactos/lib/3rdparty/mingw/_wgetopt.c create mode 100644 reactos/lib/3rdparty/mingw/argv.c create mode 100644 reactos/lib/3rdparty/mingw/atonexit.c create mode 100644 reactos/lib/3rdparty/mingw/charmax.c create mode 100644 reactos/lib/3rdparty/mingw/cinitexe.c delete mode 100644 reactos/lib/3rdparty/mingw/cpu_features.c delete mode 100644 reactos/lib/3rdparty/mingw/cpu_features.h create mode 100644 reactos/lib/3rdparty/mingw/crt0_c.c create mode 100644 reactos/lib/3rdparty/mingw/crt0_w.c delete mode 100644 reactos/lib/3rdparty/mingw/crt1.c create mode 100644 reactos/lib/3rdparty/mingw/crtdll.c create mode 100644 reactos/lib/3rdparty/mingw/crtexe.c delete mode 100644 reactos/lib/3rdparty/mingw/dllcrt1.c create mode 100644 reactos/lib/3rdparty/mingw/dllentry.c create mode 100644 reactos/lib/3rdparty/mingw/dllmain.c delete mode 100644 reactos/lib/3rdparty/mingw/getopt.c create mode 100644 reactos/lib/3rdparty/mingw/gs_support.c delete mode 100644 reactos/lib/3rdparty/mingw/init.c create mode 100644 reactos/lib/3rdparty/mingw/internal.h delete mode 100644 reactos/lib/3rdparty/mingw/isascii.c delete mode 100644 reactos/lib/3rdparty/mingw/iscsym.c delete mode 100644 reactos/lib/3rdparty/mingw/iscsymf.c delete mode 100644 reactos/lib/3rdparty/mingw/main.c create mode 100644 reactos/lib/3rdparty/mingw/merr.c create mode 100644 reactos/lib/3rdparty/mingw/mingw_helpers.c create mode 100644 reactos/lib/3rdparty/mingw/natstart.c create mode 100644 reactos/lib/3rdparty/mingw/oscalls.h create mode 100644 reactos/lib/3rdparty/mingw/pesect.c delete mode 100644 reactos/lib/3rdparty/mingw/strcasecmp.c delete mode 100644 reactos/lib/3rdparty/mingw/strncasecmp.c delete mode 100644 reactos/lib/3rdparty/mingw/tgetopt.h create mode 100644 reactos/lib/3rdparty/mingw/tlssup.c delete mode 100644 reactos/lib/3rdparty/mingw/toascii.c delete mode 100644 reactos/lib/3rdparty/mingw/wbinmode.c delete mode 100644 reactos/lib/3rdparty/mingw/wcrt1.c delete mode 100644 reactos/lib/3rdparty/mingw/wcscmpi.c create mode 100644 reactos/lib/3rdparty/mingw/wildcard.c delete mode 100644 reactos/lib/3rdparty/mingw/winit.c delete mode 100644 reactos/lib/3rdparty/mingw/wmain.c create mode 100644 reactos/lib/3rdparty/mingw/xncommod.c create mode 100644 reactos/lib/3rdparty/mingw/xthdloc.c create mode 100644 reactos/lib/3rdparty/mingw/xtxtmode.c diff --git a/reactos/lib/3rdparty/mingw/CRT_fp10.c b/reactos/lib/3rdparty/mingw/CRT_fp10.c new file mode 100644 index 00000000000..d12ffa7c8d9 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/CRT_fp10.c @@ -0,0 +1,4 @@ +void _fpreset (void) + { __asm__ ("fninit" ) ;} + +void __attribute__ ((alias ("_fpreset"))) fpreset(void); diff --git a/reactos/lib/3rdparty/mingw/CRTfmode.c b/reactos/lib/3rdparty/mingw/CRTfmode.c deleted file mode 100644 index 31c1f63bf21..00000000000 --- a/reactos/lib/3rdparty/mingw/CRTfmode.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * CRTfmode.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Include this object to set _CRT_fmode to a state that will cause - * _mingw32_init_fmode to leave all file modes in their default state - * (basically text mode). - * - * To use this object include the object file in your link command: - * gcc -o foo.exe foo.o CRTfmode.o - * - */ - -int _CRT_fmode = 0; diff --git a/reactos/lib/3rdparty/mingw/CRTglob.c b/reactos/lib/3rdparty/mingw/CRTglob.c deleted file mode 100644 index a4f5fe051f9..00000000000 --- a/reactos/lib/3rdparty/mingw/CRTglob.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * CRTglob.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Include this object file to set _CRT_glob to a state that will - * turn on command line globbing by default. NOTE: _CRT_glob has a default - * state of on. Specify CRT_noglob.o to turn off globbing by default. - * - * To use this object include the object file in your link command: - * gcc -o foo.exe foo.o CRTglob.o - * - */ - -int _CRT_glob = -1; diff --git a/reactos/lib/3rdparty/mingw/CRTinit.c b/reactos/lib/3rdparty/mingw/CRTinit.c deleted file mode 100644 index d0a472dbb18..00000000000 --- a/reactos/lib/3rdparty/mingw/CRTinit.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * CRTinit.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * A dummy version of _CRT_INIT for MS compatibility. Programs, or more often - * dlls, which use the static version of the MSVC run time are supposed to - * call _CRT_INIT to initialize the run time library in DllMain. This does - * not appear to be necessary when using crtdll or the dll versions of the - * MSVC runtime, so the dummy call simply does nothing. - * - * This object file is included as a standard in the link process as provided - * by the appropriate GCC frontend. - * - * To use this object include the object file in your link command: - * gcc -o foo.exe foo.o CRTinit.o - * - */ - -void -_CRT_INIT () -{ -} diff --git a/reactos/lib/3rdparty/mingw/_newmode.c b/reactos/lib/3rdparty/mingw/_newmode.c new file mode 100644 index 00000000000..fb6962135bc --- /dev/null +++ b/reactos/lib/3rdparty/mingw/_newmode.c @@ -0,0 +1 @@ +int _newmode = 0; diff --git a/reactos/lib/3rdparty/mingw/_wgetopt.c b/reactos/lib/3rdparty/mingw/_wgetopt.c deleted file mode 100644 index 91efed4d702..00000000000 --- a/reactos/lib/3rdparty/mingw/_wgetopt.c +++ /dev/null @@ -1,15 +0,0 @@ -/* $Id$ -*/ -/* - tgetopt -- POSIX-compliant implementation of getopt() with string-type-generic - semantics - - This is public domain software -*/ - -#include - -#define _UNICODE -#include "getopt.c" - -/* EOF */ diff --git a/reactos/lib/3rdparty/mingw/argv.c b/reactos/lib/3rdparty/mingw/argv.c new file mode 100644 index 00000000000..a4a954cbe90 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/argv.c @@ -0,0 +1,19 @@ +#ifdef CRTDLL +#undef CRTDLL +#endif + +#include "internal.h" + +extern int _dowildcard; + +#ifdef WPRFLAG +int __CRTDECL +__wsetargv (void) +#else +int __CRTDECL +__setargv (void) +#endif +{ + _dowildcard = 1; + return 0; +} diff --git a/reactos/lib/3rdparty/mingw/atonexit.c b/reactos/lib/3rdparty/mingw/atonexit.c new file mode 100644 index 00000000000..1affa3b50b8 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/atonexit.c @@ -0,0 +1,50 @@ +#undef CRTDLL +#ifndef _DLL +#define _DLL +#endif + +#include "oscalls.h" +#include "internal.h" +#include +#include +#include + +#define _EXIT_LOCK1 8 + + void __cdecl _lock (int _File); + void __cdecl _unlock (int _File); + +_PVFV *__onexitbegin; +_PVFV *__onexitend; + +extern _CRTIMP _onexit_t __dllonexit (_onexit_t, _PVFV**, _PVFV**); +extern _onexit_t (__cdecl *_imp___onexit) (_onexit_t func); + +/* Choose a different name to prevent name conflicts. The CRT one works fine. */ +_onexit_t __cdecl mingw_onexit(_onexit_t func) +{ + _PVFV *onexitbegin; + _PVFV *onexitend; + _onexit_t retval; + + onexitbegin = (_PVFV *) _decode_pointer (__onexitbegin); + + if (onexitbegin == (_PVFV *) -1) + return (*_imp___onexit) (func); + _lock (_EXIT_LOCK1); + onexitbegin = (_PVFV *) _decode_pointer (__onexitbegin); + onexitend = (_PVFV *) _decode_pointer (__onexitend); + + retval = __dllonexit (func, &onexitbegin, &onexitend); + + __onexitbegin = (_PVFV *) _encode_pointer (onexitbegin); + __onexitend = (_PVFV *) _encode_pointer (onexitend); + _unlock (_EXIT_LOCK1); + return retval; +} + +int __cdecl +atexit (_PVFV func) +{ + return (mingw_onexit((_onexit_t)func) == NULL) ? -1 : 0; +} diff --git a/reactos/lib/3rdparty/mingw/binmode.c b/reactos/lib/3rdparty/mingw/binmode.c index 747bf44551b..b5aec2461b2 100644 --- a/reactos/lib/3rdparty/mingw/binmode.c +++ b/reactos/lib/3rdparty/mingw/binmode.c @@ -1,5 +1,4 @@ +#define SPECIAL_CRTEXE + #include - -/* Set default file mode to binary */ - -int _fmode = _O_BINARY; +#include diff --git a/reactos/lib/3rdparty/mingw/charmax.c b/reactos/lib/3rdparty/mingw/charmax.c new file mode 100644 index 00000000000..c80f8a61141 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/charmax.c @@ -0,0 +1,9 @@ +#include "internal.h" + +int __lconv_init (void); + +int mingw_initcharmax = 0; + +int _charmax = 255; + +_CRTALLOC(".CRT$XIC") _PIFV __mingw_pinit = __lconv_init; diff --git a/reactos/lib/3rdparty/mingw/cinitexe.c b/reactos/lib/3rdparty/mingw/cinitexe.c new file mode 100644 index 00000000000..ac0a6a98b9a --- /dev/null +++ b/reactos/lib/3rdparty/mingw/cinitexe.c @@ -0,0 +1,7 @@ +#include +#include "internal.h" + +_CRTALLOC(".CRT$XIA") _PVFV __xi_a[] = { NULL }; +_CRTALLOC(".CRT$XIZ") _PVFV __xi_z[] = { NULL }; +_CRTALLOC(".CRT$XCA") _PVFV __xc_a[] = { NULL }; +_CRTALLOC(".CRT$XCZ") _PVFV __xc_z[] = { NULL }; diff --git a/reactos/lib/3rdparty/mingw/cpu_features.c b/reactos/lib/3rdparty/mingw/cpu_features.c deleted file mode 100644 index cc901d77f50..00000000000 --- a/reactos/lib/3rdparty/mingw/cpu_features.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include "cpu_features.h" - -/* level 1 edx bits */ -#define EDX_CX8 (1 << 8) /* CMPXCHG8B */ -#define EDX_CMOV (1 << 15) -#define EDX_MMX (1 << 23) -#define EDX_FXSR (1 << 24) /* FXSAVE and FXRSTOR */ -#define EDX_SSE (1 << 25) -#define EDX_SSE2 (1 << 26) - -/* level 1 ecx bits */ -#define ECX_SSE3 (1 << 0) -#define ECX_CX16 (1 << 13) /* CMPXCHG16B */ - -/* extended level 0x80000001 edx bits */ -#define EDX_3DNOW (1 << 31) -#define EDX_3DNOWP (1 << 30) -#define EDX_LM (1 << 29) /*LONG MODE */ - -#define __cpuid(level,a,b,c,d) \ - __asm__ __volatile__ ("cpuid;" \ - : "=a" (a), "=b" (b), "=c" (c), "=d" (d)\ - : "0" (level)) - -/* Combine the different cpuid flags into a single bitmap. */ - -unsigned int __cpu_features = 0; - -void __cpu_features_init (void) -{ -#ifdef __i386__ - unsigned int eax, ebx, ecx, edx; - /* Try to change the value of CPUID bit (bit 21) in EFLAGS. - If the bit can be toggled, CPUID is supported. */ - asm volatile ("pushfl; pushfl; popl %0;" - "movl %0,%1; xorl %2,%0;" - "pushl %0; popfl; pushfl; popl %0; popfl" - : "=&r" (eax), "=&r" (ebx) - : "i" (0x00200000)); - - if (((eax ^ ebx) & 0x00200000) == 0) - return; - - __cpuid (0, eax, ebx, ecx, edx); - if (eax == 0) - return; - - __cpuid (1, eax, ebx, ecx, edx); - - if (edx & EDX_CX8) - __cpu_features |= _CRT_CMPXCHG8B; - if (edx & EDX_CMOV) - __cpu_features |= _CRT_CMOV; - - if (edx & EDX_MMX) - __cpu_features |= _CRT_MMX; - if (edx & EDX_FXSR) - __cpu_features |= _CRT_FXSR; - if (edx & EDX_SSE) - __cpu_features |= _CRT_SSE; - if (edx & EDX_SSE2) - __cpu_features |= _CRT_SSE2; - - - if (ecx & ECX_SSE3) - __cpu_features |= _CRT_SSE3; - if (ecx & ECX_CX16) - __cpu_features |= _CRT_CMPXCHG16B; - - __cpuid (0x80000000, eax, ebx, ecx, edx); - if (eax < 0x80000001) - return; - __cpuid (0x80000001, eax, ebx, ecx, edx); - if (edx & EDX_3DNOW); - __cpu_features |= _CRT_3DNOW; - if (edx & EDX_3DNOWP) - __cpu_features |= _CRT_3DNOWP; -#endif -} - -#ifdef TEST - -#include -#define report(feature) \ - if ((feature) & __cpu_features) printf( #feature " found\n") - -int main() -{ - __cpu_features_init(); - - report(_CRT_CMPXCHG8B); - report(_CRT_CMOV); - report(_CRT_MMX); - report(_CRT_FXSR); - report(_CRT_SSE); - report(_CRT_SSE2); - report(_CRT_SSE3); - report(_CRT_CMPXCHG16B); - report(_CRT_3DNOW); - report(_CRT_3DNOWP); - return 0; -} - -#endif diff --git a/reactos/lib/3rdparty/mingw/cpu_features.h b/reactos/lib/3rdparty/mingw/cpu_features.h deleted file mode 100644 index 64318574776..00000000000 --- a/reactos/lib/3rdparty/mingw/cpu_features.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _CPU_FEATURES_H -#define _CPU_FEATURES_H - -#include - -#define _CRT_CMPXCHG8B 0x0001 -#define _CRT_CMOV 0x0002 -#define _CRT_MMX 0x0004 -#define _CRT_FXSR 0x0008 -#define _CRT_SSE 0x0010 -#define _CRT_SSE2 0x0020 -#define _CRT_SSE3 0x0040 -#define _CRT_CMPXCHG16B 0x0080 -#define _CRT_3DNOW 0x0100 -#define _CRT_3DNOWP 0x0200 - -extern unsigned int __cpu_features; - -/* Currently we use this in fpenv functions */ -#define __HAS_SSE __cpu_features & _CRT_SSE - -void __cpu_features_init (void); - - -#endif diff --git a/reactos/lib/3rdparty/mingw/crt0_c.c b/reactos/lib/3rdparty/mingw/crt0_c.c new file mode 100644 index 00000000000..11bcb68a1af --- /dev/null +++ b/reactos/lib/3rdparty/mingw/crt0_c.c @@ -0,0 +1,6 @@ +#include + +int main (int flags, char **cmdline, char **inst) +{ + return (int) WinMain ((HINSTANCE) inst, NULL, (LPSTR) cmdline,(DWORD) flags); +} diff --git a/reactos/lib/3rdparty/mingw/crt0_w.c b/reactos/lib/3rdparty/mingw/crt0_w.c new file mode 100644 index 00000000000..c0ae9b35d63 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/crt0_w.c @@ -0,0 +1,9 @@ +#include + +int WINAPI wWinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPWSTR lpCmdLine,int nShowCmd); + + +int wmain (int flags, wchar_t **cmdline, wchar_t **inst) +{ + return (int) wWinMain ((HINSTANCE) inst, NULL, (LPWSTR) cmdline,(DWORD) flags); +} diff --git a/reactos/lib/3rdparty/mingw/crt1.c b/reactos/lib/3rdparty/mingw/crt1.c deleted file mode 100644 index e5795642a8a..00000000000 --- a/reactos/lib/3rdparty/mingw/crt1.c +++ /dev/null @@ -1,297 +0,0 @@ -/* - * crt1.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Source code for the startup proceedures used by all programs. This code - * is compiled to make crt1.o, which should be located in the library path. - * - */ - -/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to - avoid problems with older GCC. */ -#define __IN_MINGW_RUNTIME -#include -#include -#include -#include -#include -#define WIN32_LEAN_AND_MEAN -#include -#include - -/* NOTE: The code for initializing the _argv, _argc, and environ variables - * has been moved to a separate .c file which is included in both - * crt1.c and dllcrt1.c. This means changes in the code don't have to - * be manually synchronized, but it does lead to this not-generally- - * a-good-idea use of include. */ -#include "init.c" -#include "cpu_features.h" - -extern void _pei386_runtime_relocator (void); - -extern int main (int, char **, char **); - -/* - * Must have the correct app type for MSVCRT. - */ - -#ifdef __MSVCRT__ -#define __UNKNOWN_APP 0 -#define __CONSOLE_APP 1 -#define __GUI_APP 2 -#ifndef _M_PPC -__MINGW_IMPORT -#endif -void __set_app_type(int); -#endif /* __MSVCRT__ */ - -#ifndef __initenv -extern char ***_imp____initenv; -#define __initenv (*_imp____initenv) -#endif - -/* - * Setup the default file handles to have the _CRT_fmode mode, as well as - * any new files created by the user. - */ -extern int _CRT_fmode; - -static void -_mingw32_init_fmode (void) -{ - /* Don't set the std file mode if the user hasn't set any value for it. */ - if (_CRT_fmode) - { - *_imp___fmode = _CRT_fmode; - - /* - * This overrides the default file mode settings for stdin, - * stdout and stderr. At first I thought you would have to - * test with isatty, but it seems that the DOS console at - * least is smart enough to handle _O_BINARY stdout and - * still display correctly. - */ - if (stdin) - { - _setmode (_fileno (stdin), _CRT_fmode); - } - if (stdout) - { - _setmode (_fileno (stdout), _CRT_fmode); - } - if (stderr) - { - _setmode (_fileno (stderr), _CRT_fmode); - } - } - - /* Now sync the dll _fmode to the one for this .exe. */ -#ifdef __MSVCRT__ - *_imp___fmode = _fmode; -#else - *_imp___fmode_dll = _fmode; -#endif -} - -/* This function will be called when a trap occurs. Thanks to Jacob - Navia for his contribution. */ -static LONG CALLBACK -_gnu_exception_handler (EXCEPTION_POINTERS * exception_data) -{ - void (*old_handler) (int); - LONG action = EXCEPTION_CONTINUE_SEARCH; - int reset_fpu = 0; - - switch (exception_data->ExceptionRecord->ExceptionCode) - { - case EXCEPTION_ACCESS_VIOLATION: - /* test if the user has set SIGSEGV */ - old_handler = signal (SIGSEGV, SIG_DFL); - if (old_handler == SIG_IGN) - { - /* this is undefined if the signal was raised by anything other - than raise (). */ - signal (SIGSEGV, SIG_IGN); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGSEGV); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - case EXCEPTION_ILLEGAL_INSTRUCTION: - case EXCEPTION_PRIV_INSTRUCTION: - /* test if the user has set SIGILL */ - old_handler = signal (SIGILL, SIG_DFL); - if (old_handler == SIG_IGN) - { - /* this is undefined if the signal was raised by anything other - than raise (). */ - signal (SIGILL, SIG_IGN); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGILL); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - case EXCEPTION_FLT_INVALID_OPERATION: - case EXCEPTION_FLT_DIVIDE_BY_ZERO: - case EXCEPTION_FLT_DENORMAL_OPERAND: - case EXCEPTION_FLT_OVERFLOW: - case EXCEPTION_FLT_UNDERFLOW: - case EXCEPTION_FLT_INEXACT_RESULT: - reset_fpu = 1; - /* fall through. */ - - case EXCEPTION_INT_DIVIDE_BY_ZERO: - /* test if the user has set SIGFPE */ - old_handler = signal (SIGFPE, SIG_DFL); - if (old_handler == SIG_IGN) - { - signal (SIGFPE, SIG_IGN); - if (reset_fpu) - _fpreset (); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGFPE); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - default: - break; - } - return action; -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -static void __attribute__((noreturn)) -__mingw_CRTStartup (void) -{ - int nRet; - - /* - * Set up the top-level exception handler so that signal handling - * works as expected. The mapping between ANSI/POSIX signals and - * Win32 SE is not 1-to-1, so caveat emptore. - * - */ - SetUnhandledExceptionFilter (_gnu_exception_handler); - - /* - * Initialize floating point unit. - */ - __cpu_features_init (); /* Do we have SSE, etc.*/ - _fpreset (); /* Supplied by the runtime library. */ - - /* - * Set up __argc, __argv and _environ. - */ - _mingw32_init_mainargs (); - - /* - * Sets the default file mode. - * If _CRT_fmode is set, also set mode for stdin, stdout - * and stderr, as well - * NOTE: DLLs don't do this because that would be rude! - */ - _mingw32_init_fmode (); - - /* Adust references to dllimported data that have non-zero offsets. */ -#if defined(__i386__) - _pei386_runtime_relocator (); -#endif - -#if defined(__i386__) - /* Align the stack to 16 bytes for the sake of SSE ops in main - or in functions inlined into main. */ - asm __volatile__ ("andl $-16, %%esp" : : : "%esp"); -#elif defined(__x86_64__) - /* Align the stack to 16 bytes */ - asm __volatile__ ("andq $-16, %%rsp" : : : "%rsp"); -#elif defined(__mips__) - /* Align the stack to 16 bytes */ - asm __volatile__ ("andi %sp,%sp,-16" : : : "%sp"); -#elif defined(__PowerPC__) - /* Align the stack to 16 bytes */ - asm __volatile__ ("li 0,15\n\tandc 1,1,0" : : : "r1"); -#else -#error Unsupported architecture -#endif - - /* - * Call the main function. If the user does not supply one - * the one in the 'libmingw32.a' library will be linked in, and - * that one calls WinMain. See main.c in the 'lib' dir - * for more details. - */ - nRet = main (_argc, _argv, __initenv); - - /* - * Perform exit processing for the C library. This means - * flushing output and calling 'atexit' registered functions. - */ - _cexit (); - - ExitProcess (nRet); -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -void -mainCRTStartup (void) -{ -#ifdef __MSVCRT__ - __set_app_type (__CONSOLE_APP); -#endif - __mingw_CRTStartup (); -} - -/* - * For now the GUI startup function is the same as the console one. - * This simply gets rid of the annoying warning about not being able - * to find WinMainCRTStartup when linking GUI applications. - */ -void -WinMainCRTStartup (void) -{ -#ifdef __MSVCRT__ - __set_app_type (__GUI_APP); -#endif - __mingw_CRTStartup (); -} - -#if 0 -/* - * We force use of library version of atexit, which is only - * visible in import lib as _imp__atexit - */ -extern int (*_imp__atexit)(void (*)(void)); -int atexit (void (* pfn )(void) ) -{ - return ( (*_imp__atexit)(pfn)); -} - -/* Likewise for non-ANSI _onexit */ -extern _onexit_t (*_imp___onexit)(_onexit_t); -_onexit_t -_onexit (_onexit_t pfn ) -{ - return (*_imp___onexit)(pfn); -} -#endif diff --git a/reactos/lib/3rdparty/mingw/crtdll.c b/reactos/lib/3rdparty/mingw/crtdll.c new file mode 100644 index 00000000000..c5bd1950c2f --- /dev/null +++ b/reactos/lib/3rdparty/mingw/crtdll.c @@ -0,0 +1,201 @@ +#ifdef CRTDLL +#undef CRTDLL +#define _DLL + +#include +#include +#include +#include +#define _DECL_DLLMAIN +#include +#include + +#ifndef _CRTIMP +#ifdef CRTDLL +#define _CRTIMP __declspec(dllexport) +#else +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else +#define _CRTIMP +#endif +#endif +#endif +#include +#include + +extern void __cdecl _initterm(_PVFV *,_PVFV *); +extern void __main (); +extern void _pei386_runtime_relocator (void); +extern _CRTALLOC(".CRT$XIA") _PIFV __xi_a[]; +extern _CRTALLOC(".CRT$XIZ") _PIFV __xi_z[]; +extern _CRTALLOC(".CRT$XCA") _PVFV __xc_a[]; +extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[]; + +extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback; + +static int __proc_attached = 0; + +extern _PVFV *__onexitbegin; +extern _PVFV *__onexitend; + +extern int mingw_app_type; + +extern BOOL WINAPI DllMain (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved); + +extern BOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID); + +static int pre_c_init (void); + +_CRTALLOC(".CRT$XIAA") _PIFV pcinit = pre_c_init; + +static int +pre_c_init (void) +{ + _PVFV *onexitbegin; + + onexitbegin = (_PVFV *) malloc (32 * sizeof (_PVFV)); + __onexitend = __onexitbegin = (_PVFV *) _encode_pointer (onexitbegin); + + if (onexitbegin == NULL) + return 1; + *onexitbegin = (_PVFV) NULL; + return 0; +} + +BOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) +{ + if (dwReason == DLL_PROCESS_DETACH) + { + if (__proc_attached > 0) + __proc_attached--; + else + return FALSE; + } + if (dwReason == DLL_PROCESS_ATTACH) + { + void *lock_free = NULL; + void *fiberid = ((PNT_TIB)NtCurrentTeb ())->StackBase; + int nested = FALSE; + + while ((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock, + fiberid, 0)) != 0) + { + if (lock_free == fiberid) + { + nested = TRUE; + break; + } + Sleep(1000); + } + if (__native_startup_state != __uninitialized) + { + _amsg_exit(31); + } + else + { + __native_startup_state = __initializing; + + _initterm ((_PVFV *) (void *) __xi_a, (_PVFV *) (void *) __xi_z); + _initterm (__xc_a,__xc_z); + __native_startup_state = __initialized; + } + if (! nested) + { + InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0); + } + if (__dyn_tls_init_callback != NULL && + _IsNonwritableInCurrentImage ((PBYTE) &__dyn_tls_init_callback)) + { + __dyn_tls_init_callback (hDllHandle, DLL_THREAD_ATTACH, lpreserved); + } + __proc_attached++; + } + else if (dwReason == DLL_PROCESS_DETACH) + { + void *lock_free = NULL; + while ((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock,(PVOID) 1, 0)) != 0) + { + Sleep(1000); + } + if(__native_startup_state!=__initialized) + { + _amsg_exit (31); + } + else + { + _PVFV * onexitbegin = (_PVFV *) _decode_pointer (__onexitbegin); + if (onexitbegin) + { + _PVFV *onexitend = (_PVFV *) _decode_pointer (__onexitend); + while (--onexitend >= onexitbegin) + if (*onexitend != NULL) + (**onexitend) (); + free (onexitbegin); + __onexitbegin = __onexitend = (_PVFV *) NULL; + } + __native_startup_state = __uninitialized; + InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0); + } + } + return TRUE; +} + +static BOOL __DllMainCRTStartup (HANDLE, DWORD, LPVOID); + +BOOL WINAPI +DllMainCRTStartup(HANDLE hDllHandle,DWORD dwReason,LPVOID lpreserved) +{ + mingw_app_type = 0; + if (dwReason == DLL_PROCESS_ATTACH) + { + __security_init_cookie (); + } + return __DllMainCRTStartup (hDllHandle, dwReason, lpreserved); +} + +__declspec(noinline) BOOL +__DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) +{ + BOOL retcode = TRUE; + + __native_dllmain_reason = dwReason; + if (dwReason == DLL_PROCESS_DETACH && __proc_attached == 0) + { + retcode = FALSE; + goto i__leave; + } + if (dwReason == DLL_PROCESS_ATTACH || dwReason == DLL_THREAD_ATTACH) + { + retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved); + if (retcode) + retcode = _CRT_INIT (hDllHandle, dwReason, lpreserved); + if (! retcode) + goto i__leave; + } + _pei386_runtime_relocator (); + if (retcode && dwReason == DLL_PROCESS_ATTACH) + __main (); + retcode = DllMain(hDllHandle,dwReason,lpreserved); + if ((dwReason == DLL_PROCESS_ATTACH) && ! retcode) + { + DllMain (hDllHandle, DLL_PROCESS_DETACH, lpreserved); + _CRT_INIT (hDllHandle, DLL_PROCESS_DETACH, lpreserved); + DllEntryPoint (hDllHandle, DLL_PROCESS_DETACH, lpreserved); + } + if (dwReason == DLL_PROCESS_DETACH || dwReason == DLL_THREAD_DETACH) + { + if (_CRT_INIT (hDllHandle, dwReason, lpreserved) == FALSE) + { + retcode = FALSE; + } + if (retcode) + { + retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved); + } + } +i__leave: + __native_dllmain_reason = UINT_MAX; + return retcode ; +} +#endif diff --git a/reactos/lib/3rdparty/mingw/crtexe.c b/reactos/lib/3rdparty/mingw/crtexe.c new file mode 100644 index 00000000000..273fea363de --- /dev/null +++ b/reactos/lib/3rdparty/mingw/crtexe.c @@ -0,0 +1,469 @@ +#undef CRTDLL +#define _DLL + +#define SPECIAL_CRTEXE + +#include "oscalls.h" +#include "internal.h" +#include +#include +#include +#include +#include +#include + +#ifndef __winitenv +extern wchar_t ***_imp____winitenv; +#define __winitenv (*_imp____winitenv) +#endif + +#ifndef __initenv +extern char ***_imp____initenv; +#define __initenv (*_imp____initenv) +#endif + +/* Hack, for bug in ld. Will be removed soon. */ +#define __ImageBase _image_base__ +/* This symbol is defined by ld. */ +extern IMAGE_DOS_HEADER __ImageBase; + +extern void _fpreset (void); +#define SPACECHAR _T(' ') +#define DQUOTECHAR _T('\"') + +_CRTIMP void __setusermatherr(int (__cdecl *)(struct _exception *)); + +extern int *_imp___fmode; +extern int *_imp___commode; + +#undef _fmode +extern int _fmode; +extern int *_imp___commode; +#define _commode (*_imp___commode) +extern int _dowildcard; + +extern int __defaultmatherr; +extern _CRTIMP void __cdecl _initterm(_PVFV *, _PVFV *); + +static int __cdecl check_managed_app (void); + +extern _CRTALLOC(".CRT$XIA") _PIFV __xi_a[]; +extern _CRTALLOC(".CRT$XIZ") _PIFV __xi_z[]; +extern _CRTALLOC(".CRT$XCA") _PVFV __xc_a[]; +extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[]; + +extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback; + +extern _PVFV *__onexitbegin; +extern _PVFV *__onexitend; + +extern int mingw_app_type; + +static int argc; +#ifdef WPRFLAG +static wchar_t **argv; +static wchar_t **envp; +#else +static char **argv; +static char **envp; +#endif + +static int argret=0; +static int mainret=0; +static int managedapp=0; +static int has_cctor = 0; +static _startupinfo startinfo; + +extern void _pei386_runtime_relocator (void); +static CALLBACK long _gnu_exception_handler (EXCEPTION_POINTERS * exception_data); +//static LONG __mingw_vex(EXCEPTION_POINTERS * exception_data); +#ifdef WPRFLAG +static void duplicate_ppstrings (int ac, wchar_t ***av); +#else +static void duplicate_ppstrings (int ac, char ***av); +#endif + +static int __cdecl pre_c_init (void); +static void __cdecl pre_cpp_init (void); + +_CRTALLOC(".CRT$XIAA") _PIFV mingw_pcinit = pre_c_init; +_CRTALLOC(".CRT$XCAA") _PVFV mingw_pcppinit = pre_cpp_init; + +static int __cdecl +pre_c_init (void) +{ + managedapp = check_managed_app (); + if (mingw_app_type) + __set_app_type(_GUI_APP); + else + __set_app_type (_CONSOLE_APP); + __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1)); + + *_imp___fmode = _fmode; + *_imp___commode = _commode; + +#ifndef WPRFLAG + _dowildcard = 1; +#endif + + if (! __defaultmatherr) + __setusermatherr (_matherr); + + if (__globallocalestatus == -1) + { + } + return 0; +} + +static void __cdecl +pre_cpp_init (void) +{ + startinfo.newmode = _newmode; +#ifdef WPRFLAG + argret = __wgetmainargs(&argc,&argv,&envp,_dowildcard,&startinfo); +#else + argret = __getmainargs(&argc,&argv,&envp,_dowildcard,&startinfo); +#endif + +} + +static int __mingw_CRTStartup (void); + +#ifdef WPRFLAG +int wWinMainCRTStartup (void) +#else +int WinMainCRTStartup (void) +#endif +{ + mingw_app_type = 1; + __security_init_cookie (); + return __mingw_CRTStartup (); +} + +#ifdef WPRFLAG +int wmainCRTStartup (void) +#else +int mainCRTStartup (void) +#endif +{ + mingw_app_type = 0; + __security_init_cookie (); + return __mingw_CRTStartup (); +} + + +__declspec(noinline) int +__mingw_CRTStartup (void) +{ + _TCHAR *lpszCommandLine = NULL; + STARTUPINFO StartupInfo; + BOOL inDoubleQuote = FALSE; + memset (&StartupInfo, 0, sizeof (STARTUPINFO)); + int nested = FALSE; + + if (mingw_app_type) + GetStartupInfo (&StartupInfo); + { +#if 0 //not ready for this yet + void *lock_free = NULL; + void *fiberid = ((PNT_TIB)NtCurrentTeb())->StackBase; + while((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock, + fiberid, 0)) != 0) + { + if (lock_free == fiberid) + { + nested = TRUE; + break; + } + Sleep(1000); + } +#endif + if (__native_startup_state == __initializing) + { + _amsg_exit (31); + } + else if (__native_startup_state == __uninitialized) + { + __native_startup_state = __initializing; + _initterm ((_PVFV *)(void *)__xi_a, (_PVFV *)(void *) __xi_z); + } + else + has_cctor = 1; + + if (__native_startup_state == __initializing) + { + _initterm (__xc_a, __xc_z); + __native_startup_state = __initialized; + } + _ASSERTE(__native_startup_state == __initialized); + if (! nested) + (VOID)InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0); + + if (__dyn_tls_init_callback != NULL && _IsNonwritableInCurrentImage ((PBYTE) &__dyn_tls_init_callback)) + __dyn_tls_init_callback (NULL, DLL_THREAD_ATTACH, NULL); + + _pei386_runtime_relocator (); + + #if defined(__x86_64__) + __asm__ __volatile__ ( + "xorq %rax,%rax\n\t" + "decq %rax\n\t" + "movq %rax,%gs:0" "\n"); + #elif defined(__i386__) + __asm__ __volatile__ ( + "xorl %eax,%eax\n\t" + "decl %eax\n\t" + "movl %eax,%fs:0" "\n"); + #endif + //AddVectoredExceptionHandler (0, (PVECTORED_EXCEPTION_HANDLER)__mingw_vex); + SetUnhandledExceptionFilter (_gnu_exception_handler); + + if (mingw_app_type) + { +#ifdef WPRFLAG + if (_wcmdln == NULL) + return 255; + lpszCommandLine = (_TCHAR *) _wcmdln; +#else + lpszCommandLine = (char *) _acmdln; +#endif + while (*lpszCommandLine > SPACECHAR || (*lpszCommandLine && inDoubleQuote)) + { + if (*lpszCommandLine == DQUOTECHAR) + inDoubleQuote = TRUE; +#ifdef _MBCS + if (_ismbblead (*lpszCommandLine)) + { + if (lpszCommandLine) + lpszCommandLine++; + } +#endif + ++lpszCommandLine; + } + while (*lpszCommandLine && (*lpszCommandLine <= SPACECHAR)) + lpszCommandLine++; + +#ifdef WPRFLAG + mainret = wmain ( + (int) (StartupInfo.dwFlags & STARTF_USESHOWWINDOW ? StartupInfo.wShowWindow : SW_SHOWDEFAULT), + (wchar_t **) lpszCommandLine, (wchar_t **) (HINSTANCE) &__ImageBase); +#else + mainret = main ( + (int) (StartupInfo.dwFlags & STARTF_USESHOWWINDOW ? StartupInfo.wShowWindow : SW_SHOWDEFAULT), + (char **) lpszCommandLine, (char **) (HINSTANCE) &__ImageBase); +#endif + } + else + { + duplicate_ppstrings (argc, &argv); +#ifdef WPRFLAG + __winitenv = envp; + mainret = wmain (argc, argv, envp); +#else + __initenv = envp; + mainret = main (argc, argv, envp); +#endif + } + if (!managedapp) + exit (mainret); + + if (has_cctor == 0) + _cexit (); + } + return mainret; +} + +extern int mingw_initltsdrot_force; +extern int mingw_initltsdyn_force; +extern int mingw_initltssuo_force; +extern int mingw_initcharmax; + +static int __cdecl +check_managed_app (void) +{ + PIMAGE_DOS_HEADER pDOSHeader; + PIMAGE_NT_HEADERS pPEHeader; + PIMAGE_OPTIONAL_HEADER32 pNTHeader32; + PIMAGE_OPTIONAL_HEADER64 pNTHeader64; + + /* Force to be linked. */ + mingw_initltsdrot_force=1; + mingw_initltsdyn_force=1; + mingw_initltssuo_force=1; + mingw_initcharmax=1; + + pDOSHeader = (PIMAGE_DOS_HEADER) &__ImageBase; + if (pDOSHeader->e_magic != IMAGE_DOS_SIGNATURE) + return 0; + + pPEHeader = (PIMAGE_NT_HEADERS)((char *)pDOSHeader + pDOSHeader->e_lfanew); + if (pPEHeader->Signature != IMAGE_NT_SIGNATURE) + return 0; + + pNTHeader32 = (PIMAGE_OPTIONAL_HEADER32) &pPEHeader->OptionalHeader; + switch (pNTHeader32->Magic) + { + case IMAGE_NT_OPTIONAL_HDR32_MAGIC: + if (pNTHeader32->NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR) + return 0; + return !! pNTHeader32->DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress; + case IMAGE_NT_OPTIONAL_HDR64_MAGIC: + pNTHeader64 = (PIMAGE_OPTIONAL_HEADER64)pNTHeader32; + if (pNTHeader64->NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR) + return 0; + return !! pNTHeader64->DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress; + } + return 0; +} + +int __defaultmatherr; + +static CALLBACK long +_gnu_exception_handler (EXCEPTION_POINTERS * exception_data) +{ + void (*old_handler) (int); + long action = EXCEPTION_CONTINUE_SEARCH; + int reset_fpu = 0; + + switch (exception_data->ExceptionRecord->ExceptionCode) + { + case EXCEPTION_ACCESS_VIOLATION: + /* test if the user has set SIGSEGV */ + old_handler = signal (SIGSEGV, SIG_DFL); + if (old_handler == SIG_IGN) + { + /* this is undefined if the signal was raised by anything other + than raise (). */ + signal (SIGSEGV, SIG_IGN); + action = EXCEPTION_CONTINUE_EXECUTION; + } + else if (old_handler != SIG_DFL) + { + /* This means 'old' is a user defined function. Call it */ + (*old_handler) (SIGSEGV); + action = EXCEPTION_CONTINUE_EXECUTION; + } + break; + + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_PRIV_INSTRUCTION: + /* test if the user has set SIGILL */ + old_handler = signal (SIGILL, SIG_DFL); + if (old_handler == SIG_IGN) + { + /* this is undefined if the signal was raised by anything other + than raise (). */ + signal (SIGILL, SIG_IGN); + action = EXCEPTION_CONTINUE_EXECUTION; + } + else if (old_handler != SIG_DFL) + { + /* This means 'old' is a user defined function. Call it */ + (*old_handler) (SIGILL); + action = EXCEPTION_CONTINUE_EXECUTION; + } + break; + + case EXCEPTION_FLT_INVALID_OPERATION: + case EXCEPTION_FLT_DIVIDE_BY_ZERO: + case EXCEPTION_FLT_DENORMAL_OPERAND: + case EXCEPTION_FLT_OVERFLOW: + case EXCEPTION_FLT_UNDERFLOW: + case EXCEPTION_FLT_INEXACT_RESULT: + reset_fpu = 1; + /* fall through. */ + + case EXCEPTION_INT_DIVIDE_BY_ZERO: + /* test if the user has set SIGFPE */ + old_handler = signal (SIGFPE, SIG_DFL); + if (old_handler == SIG_IGN) + { + signal (SIGFPE, SIG_IGN); + if (reset_fpu) + _fpreset (); + action = EXCEPTION_CONTINUE_EXECUTION; + } + else if (old_handler != SIG_DFL) + { + /* This means 'old' is a user defined function. Call it */ + (*old_handler) (SIGFPE); + action = EXCEPTION_CONTINUE_EXECUTION; + } + break; + + default: + break; + } + return action; +} + +#if 0 +static LONG __mingw_vex(EXCEPTION_POINTERS * exception_data) +{ + /* TODO this is not chainablem, therefore need rewrite. Disabled the ill code. */ + + #ifdef _WIN64 + __asm__ __volatile__ ( + "movq %gs:0,%rax" "\n\t" + "orq %rax,%rax\n\t" + "jz l1\n\t" + "jmp *8(%rax)\n\r" + "l1:\n\t" + "nop\n"); +#else + __asm__ __volatile__ ( + "movl %fs:0,%eax" "\n\t" + "orl %eax,%eax\n\t" + "jz l1\n\t" + "jmp *4(%eax)\n\r" + "l1:\n\t" + "nop\n"); +#endif + return _gnu_exception_handler(exception_data); +} +#endif + +#ifdef WPRFLAG + +static size_t wbytelen(const wchar_t *p) +{ + size_t ret = 1; + while (*p!=0) { + ret++,++p; + } + return ret*2; +} +static void duplicate_ppstrings (int ac, wchar_t ***av) +{ + wchar_t **avl; + int i; + wchar_t **n = (wchar_t **) malloc (sizeof (wchar_t *) * (ac + 1)); + + avl=*av; + for (i=0; i < ac; i++) + { + int l = wbytelen (avl[i]); + n[i] = (wchar_t *) malloc (l); + memcpy (n[i], avl[i], l); + } + n[i] = NULL; + *av = n; +} +#else +static void duplicate_ppstrings (int ac, char ***av) +{ + char **avl; + int i; + char **n = (char **) malloc (sizeof (char *) * (ac + 1)); + + avl=*av; + for (i=0; i < ac; i++) + { + int l = strlen (avl[i]) + 1; + n[i] = (char *) malloc (l); + memcpy (n[i], avl[i], l); + } + n[i] = NULL; + *av = n; +} +#endif diff --git a/reactos/lib/3rdparty/mingw/dllcrt1.c b/reactos/lib/3rdparty/mingw/dllcrt1.c deleted file mode 100644 index cff2c29a5f0..00000000000 --- a/reactos/lib/3rdparty/mingw/dllcrt1.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * dllcrt1.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Initialization code for DLLs. - * - */ -#include -#include -#include -#include -#include -#include - -/* Unlike normal crt1, I don't initialize the FPU, because the process - * should have done that already. I also don't set the file handle modes, - * because that would be rude. */ - -#ifdef __GNUC__ -extern void __main (); -extern void __do_global_dtors (); -#endif - -typedef void (* p_atexit_fn )(void); -static p_atexit_fn* first_atexit; -static p_atexit_fn* next_atexit; - -static void -__dll_exit (void); - -/* This is based on the function in the Wine project's exit.c */ -p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); - - -extern BOOL WINAPI DllMain (HANDLE, DWORD, LPVOID); - -extern void _pei386_runtime_relocator (void); - -BOOL WINAPI -DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - BOOL bRet; - - if (dwReason == DLL_PROCESS_ATTACH) - { - -#ifdef DEBUG - printf ("%s: DLL_PROCESS_ATTACH (%d)\n", __FUNCTION__); -#endif - - /* Initialize private atexit table for this dll. - 32 is min size required by ANSI */ - - first_atexit = (p_atexit_fn*) malloc (32 * sizeof (p_atexit_fn)); - if (first_atexit == NULL ) /* can't allocate memory */ - { - errno=ENOMEM; - return FALSE; - } - *first_atexit = NULL; - next_atexit = first_atexit; - - /* Adust references to dllimported data (from other DLL's) - that have non-zero offsets. */ - _pei386_runtime_relocator (); - -#ifdef __GNUC__ - /* From libgcc.a, __main calls global class constructors, - __do_global_ctors, which registers __do_global_dtors - as the first entry of the private atexit table we - have just initialised */ - __main (); - -#endif - } - - /* - * Call the user-supplied DllMain subroutine. - * This has to come after initialization of atexit table and - * registration of global constructors. - * NOTE: DllMain is optional, so libmingw32.a includes a stub - * which will be used if the user does not supply one. - */ - - bRet = DllMain (hDll, dwReason, lpReserved); - /* Handle case where DllMain returns FALSE on attachment attempt. */ - - if ( (dwReason == DLL_PROCESS_ATTACH) && !bRet) - { -#ifdef DEBUG - printf ("%s: DLL_PROCESS_ATTACH failed, cleaning up\n", __FUNCTION__); -#endif - - __dll_exit (); /* Cleanup now. This will set first_atexit to NULL so we - know we've cleaned up */ - } - - if (dwReason == DLL_PROCESS_DETACH) - { -#ifdef DEBUG - printf ("%s: DLL_PROCESS_DETACH (%d)\n", __FUNCTION__); -#endif - /* If not attached, return FALSE. Cleanup already done above - if failed attachment attempt. */ - if (! first_atexit ) - bRet = FALSE; - else - /* - * We used to call __do_global_dtors () here. This is - * no longer necessary since __do_global_dtors is now - * registered at start (last out) of private atexit table. - */ - __dll_exit (); - } - return bRet; -} - -static -void -__dll_exit(void) -/* Run LIFO terminators registered in private atexit table */ -{ - if ( first_atexit ) - { - p_atexit_fn* __last = next_atexit - 1; - while ( __last >= first_atexit ) - { - if ( *__last != NULL ) - { -#ifdef DEBUG - printf ("%s: Calling exit function 0x%x from 0x%x\n", - __FUNCTION__, (unsigned)(*__last),(unsigned)__last); -#endif - (**__last) (); - } - __last--; - } - free ( first_atexit ) ; - first_atexit = NULL ; - } - /* - Make sure output buffers opened by DllMain or - atexit-registered functions are flushed before detaching, - otherwise we can have problems with redirected output. - */ - fflush (NULL); -} - -/* - * The atexit exported from msvcrt.dll causes problems in DLLs. - * Here, we override the exported version of atexit with one that passes the - * private table initialised in DllMainCRTStartup to __dllonexit. - * That means we have to hide the mscvrt.dll atexit because the - * atexit defined here gets __dllonexit from the same lib. - */ - -#if 0 -int -atexit (p_atexit_fn pfn ) -{ -#ifdef DEBUG - printf ("%s: registering exit function 0x%x at 0x%x\n", - __FUNCTION__, (unsigned)pfn, (unsigned)next_atexit); -#endif - return (__dllonexit (pfn, &first_atexit, &next_atexit) - == NULL ? -1 : 0 ); -} - -/* - * Likewise for non-ANSI function _onexit that may be called by - * code in the dll. - */ - -_onexit_t -_onexit (_onexit_t pfn ) -{ -#ifdef DEBUG - printf ("%s: registering exit function 0x%x at 0x%x\n", - __FUNCTION__, (unsigned)pfn, (unsigned)next_atexit); -#endif - return ((_onexit_t) __dllonexit ((p_atexit_fn)pfn, &first_atexit, &next_atexit)); -} -#endif diff --git a/reactos/lib/3rdparty/mingw/dllentry.c b/reactos/lib/3rdparty/mingw/dllentry.c new file mode 100644 index 00000000000..73f006b9068 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/dllentry.c @@ -0,0 +1,8 @@ +#define _DECL_DLLMAIN +#include +#include + +BOOL WINAPI DllEntryPoint(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) +{ + return TRUE; +} diff --git a/reactos/lib/3rdparty/mingw/dllmain.c b/reactos/lib/3rdparty/mingw/dllmain.c new file mode 100644 index 00000000000..005e24eddb2 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/dllmain.c @@ -0,0 +1,9 @@ +#define _DECL_DLLMAIN +#define _WINDOWS_ +#include +#include + +BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) +{ + return TRUE; +} diff --git a/reactos/lib/3rdparty/mingw/gccmain.c b/reactos/lib/3rdparty/mingw/gccmain.c index 0888741ff09..d46e99de72a 100644 --- a/reactos/lib/3rdparty/mingw/gccmain.c +++ b/reactos/lib/3rdparty/mingw/gccmain.c @@ -1,38 +1,32 @@ -/* - * gccmain.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * A separate version of __main, __do_global_ctors and __do_global_dtors for - * Mingw32 for use with Cygwin32 b19. Hopefully this object file will only - * be linked if the libgcc.a doesn't include __main, __do_global_dtors and - * __do_global_ctors. - * - */ - -/* Needed for the atexit prototype. */ +#include #include -#include +#include typedef void (*func_ptr) (void); extern func_ptr __CTOR_LIST__[]; extern func_ptr __DTOR_LIST__[]; +static HMODULE hMsvcrt = NULL; + +typedef void __cdecl flongjmp(jmp_buf _Buf,int _Value); + +flongjmp *fctMsvcrtLongJmp = NULL; + void __do_global_dtors (void) { static func_ptr *p = __DTOR_LIST__ + 1; - /* - * Call each destructor in the destructor list until a null pointer - * is encountered. - */ while (*p) { (*(p)) (); p++; } + if (hMsvcrt) + { + FreeLibrary (hMsvcrt); + hMsvcrt = NULL; + } } void @@ -41,27 +35,21 @@ __do_global_ctors (void) unsigned long nptrs = (unsigned long) (ptrdiff_t) __CTOR_LIST__[0]; unsigned long i; - /* - * If the first entry in the constructor list is -1 then the list - * is terminated with a null entry. Otherwise the first entry was - * the number of pointers in the list. - */ - if (nptrs == -1) + if (!hMsvcrt) { + hMsvcrt = LoadLibrary ("msvcrt.dll"); + fctMsvcrtLongJmp = (flongjmp *) GetProcAddress( hMsvcrt, "longjmp"); + } + + if (nptrs == (unsigned long) -1) { for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++); } - /* - * Go through the list backwards calling constructors. - */ for (i = nptrs; i >= 1; i--) { __CTOR_LIST__[i] (); } - /* - * Register the destructors for processing on exit. - */ atexit (__do_global_dtors); } @@ -76,5 +64,3 @@ __main (void) __do_global_ctors (); } } - - diff --git a/reactos/lib/3rdparty/mingw/getopt.c b/reactos/lib/3rdparty/mingw/getopt.c deleted file mode 100644 index 3b0bfedfec4..00000000000 --- a/reactos/lib/3rdparty/mingw/getopt.c +++ /dev/null @@ -1,137 +0,0 @@ -/* $Id$ -*/ -/* - tgetopt -- POSIX-compliant implementation of getopt() with string-type-generic - semantics - - This is public domain software -*/ - -#include -#include -#include - -#include "tgetopt.h" - -int _topterr = 1; -int _toptind = 1; -int _toptopt; -_TCHAR * _toptarg; - -int _tgetopt(int argc, _TCHAR * const argv[], const _TCHAR * optstring) -{ - static int s_nArgChar = 0; - _TCHAR * pcOptChar; - - /* we're done */ - if(_toptind >= argc) return -1; - - /* last time we reached the end of argv[_toptind] */ - if(s_nArgChar != 0 && argv[_toptind][s_nArgChar] == 0) - { - /* scan the next argument */ - ++ _toptind; - - /* we're done */ - if(_toptind >= argc) return -1; - - s_nArgChar = 0; - } - - /* first time we scan argv[_toptind] */ - if(s_nArgChar == 0) - { - /* argument is NULL - we're done */ - if(argv[_toptind] == NULL) - return (int)-1; - /* argument is empty - we're done */ - else if(argv[_toptind][0] == 0) - return (int)-1; - /* argument begins with '-' */ - else if(argv[_toptind][0] == _T('-')) - { - /* argument is "--" */ - if(argv[_toptind][1] == _T('-')) - { - /* increment optind */ - ++ _toptind; - s_nArgChar = 0; - - /* we're done */ - return (int)-1; - } - /* argument is "-" */ - else if(argv[_toptind][1] == 0) - { - /* we're done */ - return (int)-1; - } - /* possible option */ - else - ++ s_nArgChar; - } - /* argument doesn't begin with a dash - we're done */ - else - return (int)-1; - } - - /* return the current character */ - _toptopt = argv[_toptind][s_nArgChar]; - - /* advance to the next character */ - ++ s_nArgChar; - - /* unrecognized option */ - if(_toptopt == _T(':') || (pcOptChar = _tcschr(optstring, _toptopt)) == NULL) - { - /* print an error message */ - if(_topterr && optstring[0] != _T(':')) - _ftprintf(stderr, _T("%s: illegal option -- %c\n"), argv[0], _toptopt); - - /* return an error */ - return _T('?'); - } - - /* the option requires an argument */ - if(pcOptChar[1] == _T(':')) - { - /* we are at the end of the argument */ - if(argv[_toptind][s_nArgChar] == 0) - { - /* the argument of the option is the next argument */ - ++ _toptind; - s_nArgChar = 0; - - /* this is the last argument */ - if(_toptind >= argc) - { - /* print an error message */ - if(_topterr && optstring[0] != _T(':')) - { - _ftprintf - ( - stderr, - _T("%s: option requires an argument -- %c\n"), - argv[0], - _toptopt - ); - } - - /* return an error */ - return ((optstring[0] == _T(':')) ? _T(':') : _T('?')); - } - - /* return the argument */ - _toptarg = argv[_toptind]; - ++ _toptind; - } - /* the rest of the argument is the argument of the option */ - else - _toptarg = argv[_toptind] + s_nArgChar; - } - - /* success */ - return _toptopt; -} - -/* EOF */ diff --git a/reactos/lib/3rdparty/mingw/gs_support.c b/reactos/lib/3rdparty/mingw/gs_support.c new file mode 100644 index 00000000000..faa4ae171c6 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/gs_support.c @@ -0,0 +1,129 @@ +#include +#ifdef _WIN64 +#include +#endif + +#ifdef _WIN64 +#define DEFAULT_SECURITY_COOKIE 0x00002B992DDFA232ll +#else +#define DEFAULT_SECURITY_COOKIE 0xBB40E64E +#endif + +/* Externals. */ +#ifdef _WIN64 +PRUNTIME_FUNCTION RtlLookupFunctionEntry (ULONG64, PULONG64, PVOID); +PVOID RtlVirtualUnwind (ULONG HandlerType, ULONG64, ULONG64, PRUNTIME_FUNCTION, + PCONTEXT, PVOID *, PULONG64, PKNONVOLATILE_CONTEXT_POINTERS); +#endif + +typedef LONG NTSTATUS; + +#define STATUS_STACK_BUFFER_OVERRUN ((NTSTATUS)0xC0000409L) + +typedef union +{ + unsigned __int64 ft_scalar; + FILETIME ft_struct; +} FT; + +static EXCEPTION_RECORD GS_ExceptionRecord; +static CONTEXT GS_ContextRecord; + +static const EXCEPTION_POINTERS GS_ExceptionPointers = { + &GS_ExceptionRecord,&GS_ContextRecord +}; + +__declspec(selectany) UINT_PTR __security_cookie = DEFAULT_SECURITY_COOKIE; +__declspec(selectany) UINT_PTR __security_cookie_complement = ~(DEFAULT_SECURITY_COOKIE); + +void __cdecl +__security_init_cookie (void) +{ + UINT_PTR cookie; + FT systime = { 0, }; + LARGE_INTEGER perfctr; + + if (__security_cookie != DEFAULT_SECURITY_COOKIE) + { + __security_cookie_complement = ~__security_cookie; + return; + } + + GetSystemTimeAsFileTime (&systime.ft_struct); +#ifdef _WIN64 + cookie = systime.ft_scalar; +#else + cookie = systime.ft_struct.dwLowDateTime; + cookie ^= systime.ft_struct.dwHighDateTime; +#endif + + cookie ^= GetCurrentProcessId (); + cookie ^= GetCurrentThreadId (); + cookie ^= GetTickCount (); + + QueryPerformanceCounter (&perfctr); +#ifdef _WIN64 + cookie ^= perfctr.QuadPart; +#else + cookie ^= perfctr.LowPart; + cookie ^= perfctr.HighPart; +#endif + +#ifdef _WIN64 + cookie &= 0x0000ffffffffffffll; +#endif + + if (cookie == DEFAULT_SECURITY_COOKIE) + cookie = DEFAULT_SECURITY_COOKIE + 1; + __security_cookie = cookie; + __security_cookie_complement = ~cookie; +} + +__declspec(noreturn) void __cdecl +__report_gsfailure (ULONGLONG StackCookie) +{ + volatile UINT_PTR cookie[2]; +#ifdef _WIN64 + ULONG64 controlPC, imgBase, establisherFrame; + PRUNTIME_FUNCTION fctEntry; + PVOID hndData; +#endif + + +#ifdef _WIN64 + RtlCaptureContext (&GS_ContextRecord); + controlPC = GS_ContextRecord.Rip; + fctEntry = RtlLookupFunctionEntry (controlPC, &imgBase, NULL); + if (fctEntry != NULL) + { + RtlVirtualUnwind (UNW_FLAG_NHANDLER, imgBase, controlPC, fctEntry, + &GS_ContextRecord, &hndData, &establisherFrame, NULL); + } + else +#endif + { +#ifdef _WIN64 + GS_ContextRecord.Rip = (ULONGLONG) __builtin_return_address (0); + GS_ContextRecord.Rsp = (ULONGLONG) __builtin_frame_address (0) + 8; +#else + GS_ContextRecord.Eip = (DWORD) __builtin_return_address (0); + GS_ContextRecord.Esp = (DWORD) __builtin_frame_address (0) + 4; +#endif + } + +#ifdef _WIN64 + GS_ExceptionRecord.ExceptionAddress = (PVOID) GS_ContextRecord.Rip; + GS_ContextRecord.Rcx = StackCookie; +#else + GS_ExceptionRecord.ExceptionAddress = (PVOID) GS_ContextRecord.Eip; + GS_ContextRecord.Ecx = StackCookie; +#endif + GS_ExceptionRecord.ExceptionCode = STATUS_STACK_BUFFER_OVERRUN; + GS_ExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE; + cookie[0] = __security_cookie; + cookie[1] = __security_cookie_complement; + SetUnhandledExceptionFilter (NULL); + UnhandledExceptionFilter ((EXCEPTION_POINTERS *) &GS_ExceptionPointers); + TerminateProcess (GetCurrentProcess (), STATUS_STACK_BUFFER_OVERRUN); + abort(); +} diff --git a/reactos/lib/3rdparty/mingw/init.c b/reactos/lib/3rdparty/mingw/init.c deleted file mode 100644 index b7af07c8b6a..00000000000 --- a/reactos/lib/3rdparty/mingw/init.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * init.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Code to initialize standard file handles and command line arguments. - * This file is #included in both crt1.c and dllcrt1.c. - * - */ - -/* - * Access to a standard 'main'-like argument count and list. Also included - * is a table of environment variables. - */ -int _argc = 0; -char **_argv = 0; - -/* NOTE: Thanks to Pedro A. Aranda Gutiirrez for pointing - * this out to me. GetMainArgs (used below) takes a fourth argument - * which is an int that controls the globbing of the command line. If - * _CRT_glob is non-zero the command line will be globbed (e.g. *.* - * expanded to be all files in the startup directory). In the mingw32 - * library a _CRT_glob variable is defined as being -1, enabling - * this command line globbing by default. To turn it off and do all - * command line processing yourself (and possibly escape bogons in - * MS's globbing code) include a line in one of your source modules - * defining _CRT_glob and setting it to zero, like this: - * int _CRT_glob = 0; - */ -extern int _CRT_glob; - -#ifdef __MSVCRT__ -typedef struct { - int newmode; -} _startupinfo; -extern void __getmainargs (int *, char ***, char ***, int, _startupinfo *); -#else -extern void __GetMainArgs (int *, char ***, char ***, int); -#endif - -/* - * Initialize the _argc, _argv and environ variables. - */ -static void -_mingw32_init_mainargs () -{ - /* The environ variable is provided directly in stdlib.h through - * a dll function call. */ - char **dummy_environ; -#ifdef __MSVCRT__ - _startupinfo start_info; - start_info.newmode = 0; -#endif - - /* - * Microsoft's runtime provides a function for doing just that. - */ -#ifdef __MSVCRT__ - (void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob, - &start_info); -#else - /* CRTDLL version */ - (void) __GetMainArgs (&_argc, &_argv, &dummy_environ, _CRT_glob); -#endif -} - diff --git a/reactos/lib/3rdparty/mingw/internal.h b/reactos/lib/3rdparty/mingw/internal.h new file mode 100644 index 00000000000..91fe16f6ee2 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/internal.h @@ -0,0 +1,171 @@ +#ifndef _INC_INTERNAL +#define _INC_INTERNAL + +#include <_mingw.h> +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#define _CRTALLOC(x) __attribute__ ((section (x) )) + +#pragma pack(push,_CRT_PACKING) + + typedef void (__cdecl *_PVFV)(void); + typedef int (__cdecl *_PIFV)(void); + typedef void (__cdecl *_PVFI)(int); + +#if defined (SPECIAL_CRTEXE) && defined (_DLL) + extern int _commode; +#else + _CRTIMP extern int _commode; +#endif + +#define __IOINFO_TM_ANSI 0 +#define __IOINFO_TM_UTF8 1 +#define __IOINFO_TM_UTF16LE 2 + + typedef struct { + intptr_t osfhnd; + char osfile; + char pipech; + int lockinitflag; + CRITICAL_SECTION lock; + char textmode : 7; + char unicode : 1; + char pipech2[2]; + } ioinfo; + +#define IOINFO_ARRAY_ELTS (1 << 5) + +#define _pioinfo(i) (__pioinfo[(i) >> 5] + ((i) & (IOINFO_ARRAY_ELTS - 1))) +#define _osfile(i) (_pioinfo(i)->osfile) +#define _pipech2(i) (_pioinfo(i)->pipech2) +#define _textmode(i) (_pioinfo(i)->textmode) +#define _tm_unicode(i) (_pioinfo(i)->unicode) +#define _pioinfo_safe(i) ((((i) != -1) && ((i) != -2)) ? _pioinfo(i) : &__badioinfo) +#define _osfhnd_safe(i) (_pioinfo_safe(i)->osfhnd) +#define _osfile_safe(i) (_pioinfo_safe(i)->osfile) +#define _pipech_safe(i) (_pioinfo_safe(i)->pipech) +#define _pipech2_safe(i) (_pioinfo_safe(i)->pipech2) +#define _textmode_safe(i) (_pioinfo_safe(i)->textmode) +#define _tm_unicode_safe(i) (_pioinfo_safe(i)->unicode) + +#ifndef __badioinfo + extern ioinfo ** _imp____badioinfo[]; +#define __badioinfo (*_imp____badioinfo) +#endif + +#ifndef __pioinfo + extern ioinfo ** _imp____pioinfo[]; +#define __pioinfo (*_imp____pioinfo) +#endif + +#define _NO_CONSOLE_FILENO (intptr_t)-2 + +#ifndef _FILE_DEFINED +#define _FILE_DEFINED + struct _iobuf { + char *_ptr; + int _cnt; + char *_base; + int _flag; + int _file; + int _charbuf; + int _bufsiz; + char *_tmpfname; + }; + typedef struct _iobuf FILE; +#endif + +#if !defined (_FILEX_DEFINED) && defined (_WINDOWS_) +#define _FILEX_DEFINED + typedef struct { + FILE f; + CRITICAL_SECTION lock; + } _FILEX; +#endif + + extern int _dowildcard; + extern int _newmode; + +#ifndef __winitenv +extern wchar_t ***_imp____winitenv; +#define __winitenv (*_imp____winitenv) +#endif + +#ifndef __initenv +extern char ***_imp____initenv; +#define __initenv (*_imp____initenv) +#endif + +#ifndef _acmdln +extern char **_imp___acmdln; +#define _acmdln (*_imp___acmdln) +/* _CRTIMP extern char *_acmdln; */ +#endif + +#ifndef _wcmdln +extern char **_imp___wcmdln; +#define _wcmdln (*_imp___wcmdln) +/* __CRTIMP extern wchar_t *_wcmdln; */ +#endif + + _CRTIMP void __cdecl _amsg_exit(int); + + int __CRTDECL _setargv(void); + int __CRTDECL __setargv(void); + int __CRTDECL _wsetargv(void); + int __CRTDECL __wsetargv(void); + + int __CRTDECL main(int _Argc, char **_Argv, char **_Env); + int __CRTDECL wmain(int _Argc, wchar_t **_Argv, wchar_t **_Env); + +#ifndef _STARTUP_INFO_DEFINED +#define _STARTUP_INFO_DEFINED + typedef struct { + int newmode; + } _startupinfo; +#endif + + _CRTIMP int __cdecl __getmainargs(int * _Argc, char *** _Argv, char ***_Env, int _DoWildCard, _startupinfo *_StartInfo); + _CRTIMP int __cdecl __wgetmainargs(int * _Argc, wchar_t ***_Argv, wchar_t ***_Env, int _DoWildCard, _startupinfo *_StartInfo); + +#define _CONSOLE_APP 1 +#define _GUI_APP 2 + + typedef enum __enative_startup_state { + __uninitialized, __initializing, __initialized + } __enative_startup_state; + + extern volatile __enative_startup_state __native_startup_state; + extern volatile void *__native_startup_lock; + + extern volatile unsigned int __native_dllmain_reason; + extern volatile unsigned int __native_vcclrit_reason; + + _CRTIMP void __cdecl __set_app_type (int); + + typedef LONG NTSTATUS; + +#include +#include + + void * __cdecl _encode_pointer(void *); + void * __cdecl _encoded_null(); + void * __cdecl _decode_pointer(void *); + + BOOL __cdecl _ValidateImageBase (PBYTE pImageBase); + PIMAGE_SECTION_HEADER __cdecl _FindPESection (PBYTE pImageBase, DWORD_PTR rva); + BOOL __cdecl _IsNonwritableInCurrentImage (PBYTE pTarget); + +#ifdef __cplusplus +} +#endif + +#pragma pack(pop) +#endif diff --git a/reactos/lib/3rdparty/mingw/isascii.c b/reactos/lib/3rdparty/mingw/isascii.c deleted file mode 100644 index 9d3385c3f01..00000000000 --- a/reactos/lib/3rdparty/mingw/isascii.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * isascii.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include - -int -isascii (int c) -{ - return __isascii(c); -} - diff --git a/reactos/lib/3rdparty/mingw/iscsym.c b/reactos/lib/3rdparty/mingw/iscsym.c deleted file mode 100644 index ea9a571ac18..00000000000 --- a/reactos/lib/3rdparty/mingw/iscsym.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * iscsym.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include - -int -iscsym (int c) -{ - return __iscsym(c); -} diff --git a/reactos/lib/3rdparty/mingw/iscsymf.c b/reactos/lib/3rdparty/mingw/iscsymf.c deleted file mode 100644 index 6afde993e6a..00000000000 --- a/reactos/lib/3rdparty/mingw/iscsymf.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * iscsymf.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include - -int -iscsymf (int c) -{ - return __iscsymf(c); -} - diff --git a/reactos/lib/3rdparty/mingw/main.c b/reactos/lib/3rdparty/mingw/main.c deleted file mode 100644 index f53ef06a606..00000000000 --- a/reactos/lib/3rdparty/mingw/main.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * main.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Extra startup code for applications which do not have a main function - * of their own (but do have a WinMain). Generally these are GUI - * applications, but they don't *have* to be. - * - */ - -#include -#include -#include - -#define ISSPACE(a) (a == ' ' || a == '\t') - -extern int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, - LPSTR szCmdLine, int nShow); - -int -main (int argc, const char *argv[], const char *environ[]) -{ - char *szCmd; - STARTUPINFO startinfo; - int nRet; - - /* Get the command line passed to the process. */ - szCmd = GetCommandLineA (); - GetStartupInfoA (&startinfo); - - /* Strip off the name of the application and any leading - * whitespace. */ - if (szCmd) - { - while (ISSPACE (*szCmd)) - { - szCmd++; - } - - /* On my system I always get the app name enclosed - * in quotes... */ - if (*szCmd == '\"') - { - do - { - szCmd++; - } - while (*szCmd != '\"' && *szCmd != '\0'); - - if (*szCmd == '\"') - { - szCmd++; - } - } - else - { - /* If no quotes then assume first token is program - * name. */ - while (!ISSPACE (*szCmd) && *szCmd != '\0') - { - szCmd++; - } - } - - while (ISSPACE (*szCmd)) - { - szCmd++; - } - } - - nRet = WinMain (GetModuleHandle (NULL), NULL, szCmd, - (startinfo.dwFlags & STARTF_USESHOWWINDOW) ? - startinfo.wShowWindow : SW_SHOWDEFAULT); - - return nRet; -} - diff --git a/reactos/lib/3rdparty/mingw/merr.c b/reactos/lib/3rdparty/mingw/merr.c new file mode 100644 index 00000000000..6e341b67781 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/merr.c @@ -0,0 +1,12 @@ +#include "internal.h" +#include + +int __defaultmatherr = 1; + +int __CRTDECL +_matherr (struct _exception *pexcept) +{ + /* Make compiler happy. */ + pexcept = pexcept; + return 0; +} diff --git a/reactos/lib/3rdparty/mingw/mingw.rbuild b/reactos/lib/3rdparty/mingw/mingw.rbuild index c1dbef73be1..b7ca7386fc7 100644 --- a/reactos/lib/3rdparty/mingw/mingw.rbuild +++ b/reactos/lib/3rdparty/mingw/mingw.rbuild @@ -1,41 +1,42 @@ - + include - cpu_features.c - CRTfmode.c - CRTglob.c - CRTinit.c + CRT_fp10.c + atonexit.c + charmax.c + cinitexe.c gccmain.c - getopt.c - isascii.c - iscsym.c - iscsymf.c - strcasecmp.c - strncasecmp.c - toascii.c - wcscmpi.c - _wgetopt.c - - pseudo-reloc.c - + gs_support.c + merr.c + mingw_helpers.c + natstart.c + _newmode.c + pesect.c + tlssup.c + wildcard.c + xtxtmode.c + xncommod.c + pseudo-reloc.c include - binmode.c - crt1.c - main.c + crt0_c.c + crtexe.c include - wbinmode.c - wcrt1.c - wmain.c + + + crt0_w.c + crtexe.c + include - dllcrt1.c + dllentry.c + dllmain.c diff --git a/reactos/lib/3rdparty/mingw/mingw_helpers.c b/reactos/lib/3rdparty/mingw/mingw_helpers.c new file mode 100644 index 00000000000..cccb9bf0ec0 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/mingw_helpers.c @@ -0,0 +1,25 @@ +#include "oscalls.h" +#include "internal.h" +#include +#include +#include +#include +#include + +const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback; + +void * __cdecl +_decode_pointer (void *codedptr) +{ + return (void *) codedptr; +} + +void * __cdecl +_encode_pointer (void *ptr) +{ + return ptr; +} + +/* 0:console, 1:windows. */ +int mingw_app_type = 0; + diff --git a/reactos/lib/3rdparty/mingw/moldname-msvcrt.def b/reactos/lib/3rdparty/mingw/moldname-msvcrt.def index 81049492177..b6ad6f662aa 100644 --- a/reactos/lib/3rdparty/mingw/moldname-msvcrt.def +++ b/reactos/lib/3rdparty/mingw/moldname-msvcrt.def @@ -1,5 +1,3 @@ - - ; ; moldname-msvcrt.def ; @@ -58,7 +56,6 @@ fileno ; fpreset fputchar fputwchar -fstat ftime gcvt getch @@ -98,7 +95,6 @@ spawnv spawnve spawnvp spawnvpe -stat strcmpi strdup stricmp @@ -151,9 +147,3 @@ cabs hypot logb nextafter - -; Additional definitions for ReactOS: -snwprintf -snprintf -strtoull=_strtoui64 -vsnprintf diff --git a/reactos/lib/3rdparty/mingw/natstart.c b/reactos/lib/3rdparty/mingw/natstart.c new file mode 100644 index 00000000000..733b5dc19ca --- /dev/null +++ b/reactos/lib/3rdparty/mingw/natstart.c @@ -0,0 +1,7 @@ +#include "internal.h" + +_PGLOBAL +volatile unsigned int __native_dllmain_reason = UINT_MAX; +volatile unsigned int __native_vcclrit_reason = UINT_MAX; +volatile __enative_startup_state __native_startup_state; +volatile void *__native_startup_lock; diff --git a/reactos/lib/3rdparty/mingw/oscalls.h b/reactos/lib/3rdparty/mingw/oscalls.h new file mode 100644 index 00000000000..f259ea8b97e --- /dev/null +++ b/reactos/lib/3rdparty/mingw/oscalls.h @@ -0,0 +1,41 @@ +#ifndef _INC_OSCALLS +#define _INC_OSCALLS + +#include <_mingw.h> + +#ifdef NULL +#undef NULL +#endif + +#define NOMINMAX + +#define _WIN32_FUSION 0x0100 +#include + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +typedef struct _FTIME +{ + unsigned short twosecs : 5; + unsigned short minutes : 6; + unsigned short hours : 5; +} FTIME; + +typedef FTIME *PFTIME; + +typedef struct _FDATE +{ + unsigned short day : 5; + unsigned short month : 4; + unsigned short year : 7; +} FDATE; + +typedef FDATE *PFDATE; + +#endif diff --git a/reactos/lib/3rdparty/mingw/pesect.c b/reactos/lib/3rdparty/mingw/pesect.c new file mode 100644 index 00000000000..ad85e72c145 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/pesect.c @@ -0,0 +1,66 @@ +#include + +#if defined (_WIN64) && defined (__ia64__) +#error FIXME: Unsupported __ImageBase implementation. +#else +/* Hack, for bug in ld. Will be removed soon. */ +#define __ImageBase _image_base__ +/* This symbol is defined by the linker. */ +extern IMAGE_DOS_HEADER __ImageBase; +#endif + +BOOL +_ValidateImageBase (PBYTE pImageBase) +{ + PIMAGE_DOS_HEADER pDOSHeader; + PIMAGE_NT_HEADERS pNTHeader; + PIMAGE_OPTIONAL_HEADER pOptHeader; + + pDOSHeader = (PIMAGE_DOS_HEADER) pImageBase; + if (pDOSHeader->e_magic != IMAGE_DOS_SIGNATURE) + return FALSE; + pNTHeader = (PIMAGE_NT_HEADERS) ((PBYTE) pDOSHeader + pDOSHeader->e_lfanew); + if (pNTHeader->Signature != IMAGE_NT_SIGNATURE) + return FALSE; + pOptHeader = (PIMAGE_OPTIONAL_HEADER) &pNTHeader->OptionalHeader; + if (pOptHeader->Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC) + return FALSE; + return TRUE; +} + +PIMAGE_SECTION_HEADER +_FindPESection (PBYTE pImageBase, DWORD_PTR rva) +{ + PIMAGE_NT_HEADERS pNTHeader; + PIMAGE_SECTION_HEADER pSection; + unsigned int iSection; + + pNTHeader = (PIMAGE_NT_HEADERS) (pImageBase + ((PIMAGE_DOS_HEADER) pImageBase)->e_lfanew); + + for (iSection = 0, pSection = IMAGE_FIRST_SECTION (pNTHeader); + iSection < pNTHeader->FileHeader.NumberOfSections; + ++iSection,++pSection) + { + if (rva >= pSection->VirtualAddress + && rva < pSection->VirtualAddress + pSection->Misc.VirtualSize) + return pSection; + } + return NULL; +} + +BOOL +_IsNonwritableInCurrentImage (PBYTE pTarget) +{ + PBYTE pImageBase; + DWORD_PTR rvaTarget; + PIMAGE_SECTION_HEADER pSection; + + pImageBase = (PBYTE) &__ImageBase; + if (! _ValidateImageBase (pImageBase)) + return FALSE; + rvaTarget = pTarget - pImageBase; + pSection = _FindPESection (pImageBase, rvaTarget); + if (pSection == NULL) + return FALSE; + return (pSection->Characteristics & IMAGE_SCN_MEM_WRITE) == 0; +} diff --git a/reactos/lib/3rdparty/mingw/strcasecmp.c b/reactos/lib/3rdparty/mingw/strcasecmp.c deleted file mode 100644 index a238e22f259..00000000000 --- a/reactos/lib/3rdparty/mingw/strcasecmp.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * strcasecmp.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header string.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include - -int -strcasecmp (const char *sz1, const char *sz2) -{ - return _stricmp (sz1, sz2); -} - diff --git a/reactos/lib/3rdparty/mingw/strncasecmp.c b/reactos/lib/3rdparty/mingw/strncasecmp.c deleted file mode 100644 index 7607ea1d001..00000000000 --- a/reactos/lib/3rdparty/mingw/strncasecmp.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * strncasecmp.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header string.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include - -int -strncasecmp (const char *sz1, const char *sz2, size_t sizeMaxCompare) -{ - return _strnicmp (sz1, sz2, sizeMaxCompare); -} - diff --git a/reactos/lib/3rdparty/mingw/tgetopt.h b/reactos/lib/3rdparty/mingw/tgetopt.h deleted file mode 100644 index 01e0b1ee489..00000000000 --- a/reactos/lib/3rdparty/mingw/tgetopt.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#include - -#ifdef _UNICODE -#define _toption _woption -#define _toptarg _woptarg -#define _toptind _woptind -#define _topterr _wopterr -#define _toptopt _woptopt -#define _tgetopt _wgetopt -#define _tgetopt_long _wgetopt_long -#define _tgetopt_long_only _wgetopt_long_only -#define _tgetopt_internal _wgetopt_internal -#else -#define _toption option -#define _toptarg optarg -#define _toptind optind -#define _topterr opterr -#define _toptopt optopt -#define _tgetopt getopt -#define _tgetopt_long getopt_long -#define _tgetopt_long_only getopt_long_only -#define _tgetopt_internal _getopt_internal -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern char *optarg; -extern int optind; -extern int opterr; -extern int optopt; - -extern wchar_t *_woptarg; -extern int _woptind; -extern int _wopterr; -extern int _woptopt; - -struct option -{ - const char *name; - int has_arg; - int *flag; - int val; -}; - -struct _woption -{ - const wchar_t *name; - int has_arg; - int *flag; - int val; -}; - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -extern int getopt (int argc, char *const *argv, const char *shortopts); -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, const struct option *longopts, int *longind); - -extern int _wgetopt (int argc, wchar_t *const *argv, const wchar_t *shortopts); -extern int _wgetopt_long (int argc, wchar_t *const *argv, const wchar_t *shortopts, - const struct _woption *longopts, int *longind); -extern int _wgetopt_long_only (int argc, wchar_t *const *argv, - const wchar_t *shortopts, - const struct _woption *longopts, int *longind); - -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, const struct option *longopts, int *longind, - int long_only); - -extern int _wgetopt_internal (int argc, wchar_t *const *argv, - const wchar_t *shortopts, - const struct _woption *longopts, int *longind, - int long_only); - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ - diff --git a/reactos/lib/3rdparty/mingw/tlssup.c b/reactos/lib/3rdparty/mingw/tlssup.c new file mode 100644 index 00000000000..31d1daa5107 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/tlssup.c @@ -0,0 +1,129 @@ +#ifdef CRTDLL +#undef CRTDLL +#endif + +#include "internal.h" +#include +#include +#include + +#define FUNCS_PER_NODE 30 + +typedef struct TlsDtorNode { + int count; + struct TlsDtorNode *next; + _PVFV funcs[FUNCS_PER_NODE]; +} TlsDtorNode; + +ULONG _tls_index = 0; + +_CRTALLOC(".tls") char _tls_start = 0; +_CRTALLOC(".tls$ZZZ") char _tls_end = 0; + +_CRTALLOC(".CRT$XLA") PIMAGE_TLS_CALLBACK __xl_a = 0; +_CRTALLOC(".CRT$XLZ") PIMAGE_TLS_CALLBACK __xl_z = 0; + +#ifdef _WIN64 +_CRTALLOC(".rdata$T") const IMAGE_TLS_DIRECTORY64 _tls_used = { + (ULONGLONG) &_tls_start, (ULONGLONG) &_tls_end, (ULONGLONG) &_tls_index, + (ULONGLONG) (&__xl_a+1), (ULONG) 0, (ULONG) 0 +}; +#else +_CRTALLOC(".rdata$T") const IMAGE_TLS_DIRECTORY _tls_used = { + (ULONG)(ULONG_PTR) &_tls_start, (ULONG)(ULONG_PTR) &_tls_end, + (ULONG)(ULONG_PTR) &_tls_index, (ULONG)(ULONG_PTR) (&__xl_a+1), + (ULONG) 0, (ULONG) 0 +}; +#endif + +#ifndef __CRT_THREAD +#ifdef HAVE_ATTRIBUTE_THREAD +#define __CRT_THREAD __declspec(thread) +#else +#define __CRT_THREAD +#endif +#endif + +static _CRTALLOC(".CRT$XDA") _PVFV __xd_a = 0; +static _CRTALLOC(".CRT$XDZ") _PVFV __xd_z = 0; +static __CRT_THREAD TlsDtorNode *dtor_list; +static __CRT_THREAD TlsDtorNode dtor_list_head; + +BOOL WINAPI +__dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) +{ + _PVFV *pfunc; + + //DbgPrint("__dyn_tls_init: hDllHandle %p, dwReason %d\n", hDllHandle,dwReason); + if (dwReason != DLL_THREAD_ATTACH) + return TRUE; + + for (pfunc = &__xd_a + 1; pfunc != &__xd_z; ++pfunc) + { + //DbgPrint("pfunc at %p\n",pfunc); + if (*pfunc != NULL) + (*pfunc)(); + } + + return TRUE; +} + +const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback = (const PIMAGE_TLS_CALLBACK) __dyn_tls_init; +_CRTALLOC(".CRT$XLC") PIMAGE_TLS_CALLBACK __xl_c = (PIMAGE_TLS_CALLBACK) __dyn_tls_init; + +int __cdecl +__tlregdtor (_PVFV func) +{ + //DbgPrint("__tlregdtor: func %p\n",func); + + if (dtor_list == NULL) + { + dtor_list = &dtor_list_head; + dtor_list_head.count = 0; + } + else if (dtor_list->count == FUNCS_PER_NODE) + { + TlsDtorNode *pnode = (TlsDtorNode *) malloc (sizeof (TlsDtorNode)); + if (pnode == NULL) + return -1; + pnode->count = 0; + pnode->next = dtor_list; + dtor_list = pnode; + + dtor_list->count = 0; + } + dtor_list->funcs[dtor_list->count++] = func; + return 0; +} + +static BOOL WINAPI +__dyn_tls_dtor (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) +{ + + TlsDtorNode *pnode, *pnext; + int i; + + //DbgPrint("__dyn_tls_dtor: hDllHandle %p, dwReason %d\n"); + if (dwReason != DLL_THREAD_DETACH && dwReason != DLL_PROCESS_DETACH) + return TRUE; + + for (pnode = dtor_list; pnode != NULL; pnode = pnext) + { + for (i = pnode->count - 1; i >= 0; --i) + { + if (pnode->funcs[i] != NULL) + (*pnode->funcs[i])(); + } + pnext = pnode->next; + if (pnext != NULL) + free ((void *) pnode); + } + return TRUE; +} + +_CRTALLOC(".CRT$XLD") PIMAGE_TLS_CALLBACK __xl_d = (PIMAGE_TLS_CALLBACK) __dyn_tls_dtor; + + +int mingw_initltsdrot_force = 0; +int mingw_initltsdyn_force=0; +int mingw_initltssuo_force = 0; diff --git a/reactos/lib/3rdparty/mingw/toascii.c b/reactos/lib/3rdparty/mingw/toascii.c deleted file mode 100644 index be9f2f50bd5..00000000000 --- a/reactos/lib/3rdparty/mingw/toascii.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * toascii.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include - - -int -toascii (int c) -{ - return __toascii(c); -} - diff --git a/reactos/lib/3rdparty/mingw/wbinmode.c b/reactos/lib/3rdparty/mingw/wbinmode.c deleted file mode 100644 index 747bf44551b..00000000000 --- a/reactos/lib/3rdparty/mingw/wbinmode.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -/* Set default file mode to binary */ - -int _fmode = _O_BINARY; diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c deleted file mode 100644 index 4edbbdcfe16..00000000000 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - * crt1.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Source code for the startup proceedures used by all programs. This code - * is compiled to make crt1.o, which should be located in the library path. - * - */ - -/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to - avoid problems with older GCC. */ -#define __IN_MINGW_RUNTIME -#include -#include -#include -#include -#include -#include -#define WIN32_LEAN_AND_MEAN -#include -#include - -/* NOTE: The code for initializing the _argv, _argc, and environ variables - * has been moved to a separate .c file which is included in both - * crt1.c and dllcrt1.c. This means changes in the code don't have to - * be manually synchronized, but it does lead to this not-generally- - * a-good-idea use of include. */ -#include "winit.c" -#include "cpu_features.h" - -extern void _pei386_runtime_relocator (void); - -extern int wmain (int, wchar_t **, wchar_t **); - -/* - * Must have the correct app type for MSVCRT. - */ - -#ifdef __MSVCRT__ -#define __UNKNOWN_APP 0 -#define __CONSOLE_APP 1 -#define __GUI_APP 2 -__MINGW_IMPORT void __set_app_type(int); -#endif /* __MSVCRT__ */ - -#ifndef __winitenv -extern wchar_t ***_imp____winitenv; -#define __winitenv (*_imp____winitenv) -#endif - -/* - * Setup the default file handles to have the _CRT_fmode mode, as well as - * any new files created by the user. - */ -extern int _CRT_fmode; - -static void -_mingw32_init_fmode (void) -{ - /* Don't set the std file mode if the user hasn't set any value for it. */ - if (_CRT_fmode) - { - *_imp___fmode = _CRT_fmode; - - /* - * This overrides the default file mode settings for stdin, - * stdout and stderr. At first I thought you would have to - * test with isatty, but it seems that the DOS console at - * least is smart enough to handle _O_BINARY stdout and - * still display correctly. - */ - if (stdin) - { - _setmode (_fileno (stdin), _CRT_fmode); - } - if (stdout) - { - _setmode (_fileno (stdout), _CRT_fmode); - } - if (stderr) - { - _setmode (_fileno (stderr), _CRT_fmode); - } - } - - /* Now sync the dll _fmode to the one for this .exe. */ -#ifdef __MSVCRT__ - *_imp___fmode = _fmode; -#else - *_imp___fmode_dll = _fmode; -#endif -} - -/* This function will be called when a trap occurs. Thanks to Jacob - Navia for his contribution. */ -static LONG CALLBACK -_gnu_exception_handler (EXCEPTION_POINTERS * exception_data) -{ - void (*old_handler) (int); - LONG action = EXCEPTION_CONTINUE_SEARCH; - int reset_fpu = 0; - - switch (exception_data->ExceptionRecord->ExceptionCode) - { - case EXCEPTION_ACCESS_VIOLATION: - /* test if the user has set SIGSEGV */ - old_handler = signal (SIGSEGV, SIG_DFL); - if (old_handler == SIG_IGN) - { - /* this is undefined if the signal was raised by anything other - than raise (). */ - signal (SIGSEGV, SIG_IGN); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGSEGV); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - case EXCEPTION_ILLEGAL_INSTRUCTION: - case EXCEPTION_PRIV_INSTRUCTION: - /* test if the user has set SIGILL */ - old_handler = signal (SIGILL, SIG_DFL); - if (old_handler == SIG_IGN) - { - /* this is undefined if the signal was raised by anything other - than raise (). */ - signal (SIGILL, SIG_IGN); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGILL); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - case EXCEPTION_FLT_INVALID_OPERATION: - case EXCEPTION_FLT_DIVIDE_BY_ZERO: - case EXCEPTION_FLT_DENORMAL_OPERAND: - case EXCEPTION_FLT_OVERFLOW: - case EXCEPTION_FLT_UNDERFLOW: - case EXCEPTION_FLT_INEXACT_RESULT: - reset_fpu = 1; - /* fall through. */ - - case EXCEPTION_INT_DIVIDE_BY_ZERO: - /* test if the user has set SIGFPE */ - old_handler = signal (SIGFPE, SIG_DFL); - if (old_handler == SIG_IGN) - { - signal (SIGFPE, SIG_IGN); - if (reset_fpu) - _fpreset (); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGFPE); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - default: - break; - } - return action; -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -static void __attribute__((noreturn)) -__mingw_wCRTStartup (void) -{ - int nRet; - - /* - * Set up the top-level exception handler so that signal handling - * works as expected. The mapping between ANSI/POSIX signals and - * Win32 SE is not 1-to-1, so caveat emptore. - * - */ - SetUnhandledExceptionFilter (_gnu_exception_handler); - - /* - * Initialize floating point unit. - */ - __cpu_features_init (); /* Do we have SSE, etc.*/ - _fpreset (); /* Supplied by the runtime library. */ - - /* - * Set up __argc, __argv and _wenviron. - */ - _mingw32_init_wmainargs (); - - /* - * Sets the default file mode. - * If _CRT_fmode is set, also set mode for stdin, stdout - * and stderr, as well - * NOTE: DLLs don't do this because that would be rude! - */ - _mingw32_init_fmode (); - - /* Adust references to dllimported data that have non-zero offsets. */ -#if defined(__i386__) - _pei386_runtime_relocator (); -#endif - -#if defined(__i386__) - /* Align the stack to 16 bytes for the sake of SSE ops in main - or in functions inlined into main. */ - asm __volatile__ ("andl $-16, %%esp" : : : "%esp"); -#elif defined(__x86_64__) - /* Align the stack to 16 bytes */ - asm __volatile__ ("andq $-16, %%rsp" : : : "%rsp"); -#elif defined(__mips__) - /* Align the stack to 16 bytes */ - asm __volatile__ ("andi %sp,%sp,-16" : : : "%sp"); -#elif defined(__PowerPC__) - /* Align the stack to 16 bytes */ - asm __volatile__ ("li 0,15\n\tandc 1,1,0" : : : "r1"); -#else -#error Unsupported architecture -#endif - - /* - * Call the main function. If the user does not supply one - * the one in the 'libmingw32.a' library will be linked in, and - * that one calls WinMain. See main.c in the 'lib' dir - * for more details. - */ - nRet = wmain (_argc, _wargv, __winitenv); - - /* - * Perform exit processing for the C library. This means - * flushing output and calling 'atexit' registered functions. - */ - _cexit (); - - ExitProcess (nRet); -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -void -wmainCRTStartup (void) -{ -#ifdef __MSVCRT__ - __set_app_type (__CONSOLE_APP); -#endif - __mingw_wCRTStartup (); -} - -/* - * For now the GUI startup function is the same as the console one. - * This simply gets rid of the annoying warning about not being able - * to find WinMainCRTStartup when linking GUI applications. - */ -void -wWinMainCRTStartup (void) -{ -#ifdef __MSVCRT__ - __set_app_type (__GUI_APP); -#endif - __mingw_wCRTStartup (); -} - -#if 0 -/* - * We force use of library version of atexit, which is only - * visible in import lib as _imp__atexit - */ -extern int (*_imp__atexit)(void (*)(void)); -int atexit (void (* pfn )(void) ) -{ - return ( (*_imp__atexit)(pfn)); -} - -/* Likewise for non-ANSI _onexit */ -extern _onexit_t (*_imp___onexit)(_onexit_t); -_onexit_t -_onexit (_onexit_t pfn ) -{ - return (*_imp___onexit)(pfn); -} -#endif diff --git a/reactos/lib/3rdparty/mingw/wcscmpi.c b/reactos/lib/3rdparty/mingw/wcscmpi.c deleted file mode 100644 index 497964b3964..00000000000 --- a/reactos/lib/3rdparty/mingw/wcscmpi.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * wcscmpi.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header string.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include - -int -wcscmpi (const wchar_t * ws1, const wchar_t * ws2) -{ - return _wcsicmp (ws1, ws2); -} - diff --git a/reactos/lib/3rdparty/mingw/wildcard.c b/reactos/lib/3rdparty/mingw/wildcard.c new file mode 100644 index 00000000000..b0eca486ac8 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/wildcard.c @@ -0,0 +1 @@ +int _dowildcard = 0; diff --git a/reactos/lib/3rdparty/mingw/winit.c b/reactos/lib/3rdparty/mingw/winit.c deleted file mode 100644 index ebe7ea3d15f..00000000000 --- a/reactos/lib/3rdparty/mingw/winit.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * init.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Code to initialize standard file handles and command line arguments. - * This file is #included in both crt1.c and dllcrt1.c. - * - */ - -/* - * Access to a standard 'main'-like argument count and list. Also included - * is a table of environment variables. - */ -int _argc = 0; -wchar_t **_wargv = 0; - -/* NOTE: Thanks to Pedro A. Aranda Gutiirrez for pointing - * this out to me. GetMainArgs (used below) takes a fourth argument - * which is an int that controls the globbing of the command line. If - * _CRT_glob is non-zero the command line will be globbed (e.g. *.* - * expanded to be all files in the startup directory). In the mingw32 - * library a _CRT_glob variable is defined as being -1, enabling - * this command line globbing by default. To turn it off and do all - * command line processing yourself (and possibly escape bogons in - * MS's globbing code) include a line in one of your source modules - * defining _CRT_glob and setting it to zero, like this: - * int _CRT_glob = 0; - */ -extern int _CRT_glob; - -#ifdef __MSVCRT__ -typedef struct { - int newmode; -} _startupinfo; -extern void __wgetmainargs (int *, wchar_t ***, wchar_t ***, int, _startupinfo *); -#else -#error Cannot build unicode version against crtdll -#endif - -/* - * Initialize the _argc, _argv and environ variables. - */ -static void -_mingw32_init_wmainargs () -{ - /* The environ variable is provided directly in stdlib.h through - * a dll function call. */ - wchar_t **dummy_environ; -#ifdef __MSVCRT__ - _startupinfo start_info; - start_info.newmode = 0; -#endif - - /* - * Microsoft's runtime provides a function for doing just that. - */ -#ifdef __MSVCRT__ - (void) __wgetmainargs (&_argc, &_wargv, &dummy_environ, _CRT_glob, - &start_info); -#else -#error Cannot build unicode version against crtdll -#endif -} - diff --git a/reactos/lib/3rdparty/mingw/wmain.c b/reactos/lib/3rdparty/mingw/wmain.c deleted file mode 100644 index ef363db8e79..00000000000 --- a/reactos/lib/3rdparty/mingw/wmain.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * main.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Extra startup code for applications which do not have a main function - * of their own (but do have a WinMain). Generally these are GUI - * applications, but they don't *have* to be. - * - */ - -#include -#include -#include - -#define ISSPACE(a) (a == ' ' || a == '\t') - -extern void __main(); -extern int PASCAL wWinMain (HINSTANCE hInst, HINSTANCE hPrevInst, - LPWSTR szCmdLine, int nShow); - -int -wmain (int argc, const wchar_t *argv[], const wchar_t *environ[]) -{ - wchar_t *szCmd; - STARTUPINFOW startinfo; - int nRet; - -#ifdef __GNUC__ - /* C++ initialization. (gcc inserts this call automatically for - * a function called "main", but not for "wmain") */ - __main(); -#endif - - /* Get the command line passed to the process. */ - szCmd = GetCommandLineW (); - GetStartupInfoW (&startinfo); - - /* Strip off the name of the application and any leading - * whitespace. */ - if (szCmd) - { - while (ISSPACE (*szCmd)) - { - szCmd++; - } - - /* On my system I always get the app name enclosed - * in quotes... */ - if (*szCmd == '\"') - { - do - { - szCmd++; - } - while (*szCmd != '\"' && *szCmd != '\0'); - - if (*szCmd == '\"') - { - szCmd++; - } - } - else - { - /* If no quotes then assume first token is program - * name. */ - while (!ISSPACE (*szCmd) && *szCmd != '\0') - { - szCmd++; - } - } - - while (ISSPACE (*szCmd)) - { - szCmd++; - } - } - - nRet = wWinMain (GetModuleHandle (NULL), NULL, szCmd, - (startinfo.dwFlags & STARTF_USESHOWWINDOW) ? - startinfo.wShowWindow : SW_SHOWDEFAULT); - - return nRet; -} - diff --git a/reactos/lib/3rdparty/mingw/xncommod.c b/reactos/lib/3rdparty/mingw/xncommod.c new file mode 100644 index 00000000000..0d2a0a45ca9 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/xncommod.c @@ -0,0 +1 @@ +int _commode = 0; diff --git a/reactos/lib/3rdparty/mingw/xthdloc.c b/reactos/lib/3rdparty/mingw/xthdloc.c new file mode 100644 index 00000000000..19f4bb47810 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/xthdloc.c @@ -0,0 +1 @@ +int __globallocalestatus = ~0x1; diff --git a/reactos/lib/3rdparty/mingw/xtxtmode.c b/reactos/lib/3rdparty/mingw/xtxtmode.c new file mode 100644 index 00000000000..3cc2971326b --- /dev/null +++ b/reactos/lib/3rdparty/mingw/xtxtmode.c @@ -0,0 +1 @@ +int _fmode = 0; From d1e98147edb878f7156815febd2b482641ede6eb Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 30 Aug 2008 16:55:35 +0000 Subject: [PATCH 213/388] Commit WIP. Part 3 of ?? - Update crt to conform - add some amd64 stubs svn path=/branches/ros-amd64-bringup/; revision=35810 --- reactos/lib/sdk/crt/crt.rbuild | 27 ++- reactos/lib/sdk/crt/except/amd64/chkstk_asm.s | 22 ++ reactos/lib/sdk/crt/except/amd64/seh.s | 84 +++++++ reactos/lib/sdk/crt/process/process.c | 32 +-- reactos/lib/sdk/crt/stdio/file.c | 213 ++++++++++++++---- reactos/lib/sdk/crt/stdio/find.c | 2 +- reactos/lib/sdk/crt/stdlib/errno.c | 4 +- reactos/lib/sdk/crt/stdlib/getenv.c | 2 +- reactos/lib/sdk/crt/stdlib/rot.c | 1 + reactos/lib/sdk/crt/stdlib/swab.c | 3 +- reactos/lib/sdk/crt/string/atol.c | 4 +- reactos/lib/sdk/crt/string/ctype.c | 7 +- reactos/lib/sdk/crt/string/scanf.c | 4 +- reactos/lib/sdk/crt/time/ctime.c | 4 +- reactos/lib/sdk/crt/time/difftime.c | 4 +- 15 files changed, 338 insertions(+), 75 deletions(-) create mode 100644 reactos/lib/sdk/crt/except/amd64/chkstk_asm.s create mode 100644 reactos/lib/sdk/crt/except/amd64/seh.s diff --git a/reactos/lib/sdk/crt/crt.rbuild b/reactos/lib/sdk/crt/crt.rbuild index bb78b1739bd..5d04ade62c4 100644 --- a/reactos/lib/sdk/crt/crt.rbuild +++ b/reactos/lib/sdk/crt/crt.rbuild @@ -1,6 +1,6 @@ - + . include @@ -56,6 +56,12 @@ chkstk_asm.s + + + seh.s + chkstk_asm.s + + xcptfil.c @@ -75,6 +81,14 @@ statfp.c + + + clearfp.c + cntrlfp.c + logb.c + statfp.c + + locale.c @@ -112,8 +126,15 @@ log10_asm.s - - + + + atan2.c + exp.c + fmod.c + ldexp.c + + + diff --git a/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s new file mode 100644 index 00000000000..be54983f1cb --- /dev/null +++ b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s @@ -0,0 +1,22 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Stack checker + * FILE: lib/ntdll/rtl/i386/chkstk.s + * PROGRAMER: + */ + +.globl _chkstk +.globl _alloca_probe + +/* + _chkstk() is called by all stack allocations of more than 4 KB. It grows the + stack in areas of 4 KB each, trying to access each area. This ensures that the + guard page for the stack is hit, and the stack growing triggered + */ +_chkstk: +_alloca_probe: + /* return */ + ret + +/* EOF */ diff --git a/reactos/lib/sdk/crt/except/amd64/seh.s b/reactos/lib/sdk/crt/except/amd64/seh.s new file mode 100644 index 00000000000..3f814078697 --- /dev/null +++ b/reactos/lib/sdk/crt/except/amd64/seh.s @@ -0,0 +1,84 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS CRT + * FILE: lib/crt/misc/i386/seh.S + * PURPOSE: SEH Support for the CRT + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +.intel_syntax noprefix + +#define DISPOSITION_DISMISS 0 +#define DISPOSITION_CONTINUE_SEARCH 1 +#define DISPOSITION_COLLIDED_UNWIND 3 + +/* GLOBALS *******************************************************************/ + +.globl __global_unwind2 +.globl __local_unwind2 +.globl __abnormal_termination +.globl __except_handler2 +.globl __except_handler3 + +/* FUNCTIONS *****************************************************************/ + +.func unwind_handler +_unwind_handler: + ret +.endfunc + +.func _global_unwind2 +__global_unwind2: + ret +.endfunc + +.func _abnormal_termination +__abnormal_termination: + ret +.endfunc + +.func _local_unwind2 +__local_unwind2: + ret +.endfunc + +.func _except_handler2 +__except_handler2: + ret +.endfunc + +.func _except_handler3 +__except_handler3: + ret +.endfunc + +// +// +// REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME +// +// +.func RtlpGetStackLimits@8 +.globl _RtlpGetStackLimits@8 +_RtlpGetStackLimits@8: + + /* Get the current thread */ + mov eax, [fs:KPCR_CURRENT_THREAD] + + /* Get the stack limits */ + mov ecx, [eax+KTHREAD_STACK_LIMIT] + mov edx, [eax+KTHREAD_INITIAL_STACK] + sub edx, SIZEOF_FX_SAVE_AREA + + /* Return them */ + mov eax, [esp+4] + mov [eax], ecx + + mov eax, [esp+8] + mov [eax], edx + + /* return */ + ret 8 +.endfunc diff --git a/reactos/lib/sdk/crt/process/process.c b/reactos/lib/sdk/crt/process/process.c index 99b3208ea87..1fe8dfbc546 100644 --- a/reactos/lib/sdk/crt/process/process.c +++ b/reactos/lib/sdk/crt/process/process.c @@ -323,7 +323,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env /* * @implemented */ -int _tspawnl(int mode, const _TCHAR *cmdname, const _TCHAR* arg0, ...) +intptr_t _tspawnl(int mode, const _TCHAR *cmdname, const _TCHAR* arg0, ...) { va_list argp; _TCHAR* args; @@ -345,7 +345,7 @@ int _tspawnl(int mode, const _TCHAR *cmdname, const _TCHAR* arg0, ...) /* * @implemented */ -int _tspawnv(int mode, const _TCHAR *cmdname, const _TCHAR* const* argv) +intptr_t _tspawnv(int mode, const _TCHAR *cmdname, const _TCHAR* const* argv) { _TCHAR* args; int ret = -1; @@ -365,7 +365,7 @@ int _tspawnv(int mode, const _TCHAR *cmdname, const _TCHAR* const* argv) /* * @implemented */ -int _tspawnle(int mode, const _TCHAR *cmdname, const _TCHAR* arg0, ... /*, NULL, const char* const* envp*/) +intptr_t _tspawnle(int mode, const _TCHAR *cmdname, const _TCHAR* arg0, ... /*, NULL, const char* const* envp*/) { va_list argp; _TCHAR* args; @@ -400,7 +400,7 @@ int _tspawnle(int mode, const _TCHAR *cmdname, const _TCHAR* arg0, ... /*, NULL, /* * @implemented */ -int _tspawnve(int mode, const _TCHAR *cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) +intptr_t _tspawnve(int mode, const _TCHAR *cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) { _TCHAR *args; _TCHAR *envs; @@ -426,7 +426,7 @@ int _tspawnve(int mode, const _TCHAR *cmdname, const _TCHAR* const* argv, const /* * @implemented */ -int _tspawnvp(int mode, const _TCHAR* cmdname, const _TCHAR* const* argv) +intptr_t _tspawnvp(int mode, const _TCHAR* cmdname, const _TCHAR* const* argv) { _TCHAR pathname[FILENAME_MAX]; @@ -438,7 +438,7 @@ int _tspawnvp(int mode, const _TCHAR* cmdname, const _TCHAR* const* argv) /* * @implemented */ -int _tspawnlp(int mode, const _TCHAR* cmdname, const _TCHAR* arg0, .../*, NULL*/) +intptr_t _tspawnlp(int mode, const _TCHAR* cmdname, const _TCHAR* arg0, .../*, NULL*/) { va_list argp; _TCHAR* args; @@ -461,7 +461,7 @@ int _tspawnlp(int mode, const _TCHAR* cmdname, const _TCHAR* arg0, .../*, NULL*/ /* * @implemented */ -int _tspawnlpe(int mode, const _TCHAR* cmdname, const _TCHAR* arg0, .../*, NULL, const char* const* envp*/) +intptr_t _tspawnlpe(int mode, const _TCHAR* cmdname, const _TCHAR* arg0, .../*, NULL, const char* const* envp*/) { va_list argp; _TCHAR* args; @@ -496,7 +496,7 @@ int _tspawnlpe(int mode, const _TCHAR* cmdname, const _TCHAR* arg0, .../*, NULL, /* * @implemented */ -int _tspawnvpe(int mode, const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) +intptr_t _tspawnvpe(int mode, const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) { _TCHAR pathname[FILENAME_MAX]; @@ -508,7 +508,7 @@ int _tspawnvpe(int mode, const _TCHAR* cmdname, const _TCHAR* const* argv, const /* * @implemented */ -int _texecl(const _TCHAR* cmdname, const _TCHAR* arg0, ...) +intptr_t _texecl(const _TCHAR* cmdname, const _TCHAR* arg0, ...) { _TCHAR* args; va_list argp; @@ -530,7 +530,7 @@ int _texecl(const _TCHAR* cmdname, const _TCHAR* arg0, ...) /* * @implemented */ -int _texecv(const _TCHAR* cmdname, const _TCHAR* const* argv) +intptr_t _texecv(const _TCHAR* cmdname, const _TCHAR* const* argv) { TRACE(MK_STR(_texecv)"('%"sT"')\n", cmdname); return _tspawnv(P_OVERLAY, cmdname, argv); @@ -539,7 +539,7 @@ int _texecv(const _TCHAR* cmdname, const _TCHAR* const* argv) /* * @implemented */ -int _texecle(const _TCHAR* cmdname, const _TCHAR* arg0, ... /*, NULL, char* const* envp */) +intptr_t _texecle(const _TCHAR* cmdname, const _TCHAR* arg0, ... /*, NULL, char* const* envp */) { va_list argp; _TCHAR* args; @@ -573,7 +573,7 @@ int _texecle(const _TCHAR* cmdname, const _TCHAR* arg0, ... /*, NULL, char* cons /* * @implemented */ -int _texecve(const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) +intptr_t _texecve(const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) { TRACE(MK_STR(_texecve)"('%"sT"')\n", cmdname); return _tspawnve(P_OVERLAY, cmdname, argv, envp); @@ -582,7 +582,7 @@ int _texecve(const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* con /* * @implemented */ -int _texeclp(const _TCHAR* cmdname, const _TCHAR* arg0, ...) +intptr_t _texeclp(const _TCHAR* cmdname, const _TCHAR* arg0, ...) { _TCHAR* args; va_list argp; @@ -605,7 +605,7 @@ int _texeclp(const _TCHAR* cmdname, const _TCHAR* arg0, ...) /* * @implemented */ -int _texecvp(const _TCHAR* cmdname, const _TCHAR* const* argv) +intptr_t _texecvp(const _TCHAR* cmdname, const _TCHAR* const* argv) { TRACE(MK_STR(_texecvp)"('%"sT"')\n", cmdname); return _tspawnvp(P_OVERLAY, cmdname, argv); @@ -614,7 +614,7 @@ int _texecvp(const _TCHAR* cmdname, const _TCHAR* const* argv) /* * @implemented */ -int _texeclpe(const _TCHAR* cmdname, const _TCHAR* arg0, ... /*, NULL, char* const* envp */) +intptr_t _texeclpe(const _TCHAR* cmdname, const _TCHAR* arg0, ... /*, NULL, char* const* envp */) { va_list argp; _TCHAR* args; @@ -649,7 +649,7 @@ int _texeclpe(const _TCHAR* cmdname, const _TCHAR* arg0, ... /*, NULL, char* con /* * @implemented */ -int _texecvpe(const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) +intptr_t _texecvpe(const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) { TRACE(MK_STR(_texecvpe)"('%"sT"')\n", cmdname); return _tspawnvpe(P_OVERLAY, cmdname, argv, envp); diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index e0ded79f21e..a092e6246dd 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -132,21 +132,7 @@ static CRITICAL_SECTION FILE_cs; #define LOCK_FILES() do { EnterCriticalSection(&FILE_cs); } while (0) #define UNLOCK_FILES() do { LeaveCriticalSection(&FILE_cs); } while (0) -static void stat64_to_stat(const struct __stat64 *buf64, struct _stat *buf) -{ - buf->st_dev = buf64->st_dev; - buf->st_ino = buf64->st_ino; - buf->st_mode = buf64->st_mode; - buf->st_nlink = buf64->st_nlink; - buf->st_uid = buf64->st_uid; - buf->st_gid = buf64->st_gid; - buf->st_rdev = buf64->st_rdev; - buf->st_size = buf64->st_size; - buf->st_atime = buf64->st_atime; - buf->st_mtime = buf64->st_mtime; - buf->st_ctime = buf64->st_ctime; -} - +#ifndef _WIN64 static void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf) { buf->st_dev = buf64->st_dev; @@ -161,6 +147,7 @@ static void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf buf->st_mtime = buf64->st_mtime; buf->st_ctime = buf64->st_ctime; } +#endif static inline BOOL is_valid_fd(int fd) { @@ -494,7 +481,7 @@ static void int_to_base32(int num, char *str) */ FILE * CDECL __p__iob(void) { - return &_iob[0]; + return _iob; } /********************************************************************* @@ -1165,7 +1152,7 @@ int CDECL _fileno(FILE* file) /********************************************************************* * _fstat64 (MSVCRT.@) */ -int CDECL _fstat64(int fd, struct __stat64* buf) +int CDECL _fstat64(int fd, struct _stat64* buf) { DWORD dw; DWORD type; @@ -1238,14 +1225,60 @@ int CDECL _fstati64(int fd, struct _stati64* buf) /********************************************************************* * _fstat (MSVCRT.@) */ -int CDECL _fstat(int fd, struct _stat* buf) -{ int ret; - struct __stat64 buf64; +int CDECL _fstat(int fd, struct _stat32* buf) +{ + DWORD dw; + DWORD type; + BY_HANDLE_FILE_INFORMATION hfi; + HANDLE hand = fdtoh(fd); - ret = _fstat64(fd, &buf64); - if (!ret) - stat64_to_stat(&buf64, buf); - return ret; + TRACE(":fd (%d) stat (%p)\n",fd,buf); + if (hand == INVALID_HANDLE_VALUE) + return -1; + + if (!buf) + { + WARN(":failed-NULL buf\n"); + __set_errno(ERROR_INVALID_PARAMETER); + return -1; + } + + memset(&hfi, 0, sizeof(hfi)); + memset(buf, 0, sizeof(struct _stat32)); + type = GetFileType(hand); + if (type == FILE_TYPE_PIPE) + { + buf->st_dev = buf->st_rdev = fd; + buf->st_mode = S_IFIFO; + buf->st_nlink = 1; + } + else if (type == FILE_TYPE_CHAR) + { + buf->st_dev = buf->st_rdev = fd; + buf->st_mode = S_IFCHR; + buf->st_nlink = 1; + } + else /* FILE_TYPE_DISK etc. */ + { + if (!GetFileInformationByHandle(hand, &hfi)) + { + WARN(":failed-last error (%d)\n",GetLastError()); + __set_errno(ERROR_INVALID_PARAMETER); + return -1; + } + buf->st_mode = S_IFREG | S_IREAD; + if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + buf->st_mode |= S_IWRITE; + buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_atime = dw; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + buf->st_mtime = buf->st_ctime = dw; + buf->st_nlink = hfi.nNumberOfLinks; + } + TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",hfi.dwFileAttributes, + buf->st_mode); + return 0; } /********************************************************************* @@ -1286,7 +1319,7 @@ int CDECL _futime(int fd, struct _utimbuf *t) /********************************************************************* * _get_osfhandle (MSVCRT.@) */ -long CDECL _get_osfhandle(int fd) +intptr_t CDECL _get_osfhandle(int fd) { HANDLE hand = fdtoh(fd); TRACE(":fd (%d) handle (%p)\n",fd,hand); @@ -1641,7 +1674,7 @@ int CDECL _wcreat(const wchar_t *path, int flags) /********************************************************************* * _open_osfhandle (MSVCRT.@) */ -int CDECL _open_osfhandle(long handle, int oflags) +int CDECL _open_osfhandle(intptr_t handle, int oflags) { int fd; @@ -1879,14 +1912,67 @@ int CDECL _stati64(const char* path, struct _stati64 * buf) /********************************************************************* * _stat (MSVCRT.@) */ -int CDECL _stat(const char* path, struct _stat * buf) -{ int ret; - struct __stat64 buf64; +int CDECL _stat32(const char* path, struct _stat32 * buf) +{ + DWORD dw; + WIN32_FILE_ATTRIBUTE_DATA hfi; + unsigned short mode = ALL_S_IREAD; + int plen; - ret = _stat64( path, &buf64); - if (!ret) - stat64_to_stat(&buf64, buf); - return ret; + TRACE(":file (%s) buf(%p)\n",path,buf); + + if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi)) + { + TRACE("failed (%d)\n",GetLastError()); + __set_errno(ERROR_FILE_NOT_FOUND); + return -1; + } + + memset(buf,0,sizeof(struct _stat32)); + + /* FIXME: rdev isn't drive num, despite what the docs say-what is it? + Bon 011120: This FIXME seems incorrect + Also a letter as first char isn't enough to be classified + as a drive letter + */ + if (isalpha(*path)&& (*(path+1)==':')) + buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */ + else + buf->st_dev = buf->st_rdev = _getdrive() - 1; + + plen = strlen(path); + + /* Dir, or regular file? */ + if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + (path[plen-1] == '\\')) + mode |= (_S_IFDIR | ALL_S_IEXEC); + else + { + mode |= _S_IFREG; + /* executable? */ + if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ + { + unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) | + (tolower(path[plen-3]) << 16); + if (ext == EXE || ext == BAT || ext == CMD || ext == COM) + mode |= ALL_S_IEXEC; + } + } + + if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + mode |= ALL_S_IWRITE; + + buf->st_mode = mode; + buf->st_nlink = 1; + buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_atime = dw; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + buf->st_mtime = buf->st_ctime = dw; + TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, + (long)(buf->st_size >> 16),(long)buf->st_size, + (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); + return 0; } /********************************************************************* @@ -1968,14 +2054,63 @@ int CDECL _wstati64(const wchar_t* path, struct _stati64 * buf) /********************************************************************* * _wstat (MSVCRT.@) */ -int CDECL _wstat(const wchar_t* path, struct _stat * buf) +int CDECL _wstat32(const wchar_t* path, struct _stat32 * buf) { - int ret; - struct __stat64 buf64; + DWORD dw; + WIN32_FILE_ATTRIBUTE_DATA hfi; + unsigned short mode = ALL_S_IREAD; + int plen; - ret = _wstat64( path, &buf64 ); - if (!ret) stat64_to_stat(&buf64, buf); - return ret; + TRACE(":file (%s) buf(%p)\n",debugstr_w(path),buf); + + if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi)) + { + TRACE("failed (%d)\n",GetLastError()); + __set_errno(ERROR_FILE_NOT_FOUND); + return -1; + } + + memset(buf,0,sizeof(struct _stat32)); + + /* FIXME: rdev isn't drive num, despite what the docs says-what is it? */ + if (iswalpha(*path)) + buf->st_dev = buf->st_rdev = toupperW(*path - 'A'); /* drive num */ + else + buf->st_dev = buf->st_rdev = _getdrive() - 1; + + plen = strlenW(path); + + /* Dir, or regular file? */ + if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + (path[plen-1] == '\\')) + mode |= (_S_IFDIR | ALL_S_IEXEC); + else + { + mode |= _S_IFREG; + /* executable? */ + if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ + { + ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) | + ((ULONGLONG)tolowerW(path[plen-3]) << 32); + if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM) + mode |= ALL_S_IEXEC; + } + } + + if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + mode |= ALL_S_IWRITE; + + buf->st_mode = mode; + buf->st_nlink = 1; + buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_atime = dw; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + buf->st_mtime = buf->st_ctime = dw; + TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, + (long)(buf->st_size >> 16),(long)buf->st_size, + (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); + return 0; } /********************************************************************* diff --git a/reactos/lib/sdk/crt/stdio/find.c b/reactos/lib/sdk/crt/stdio/find.c index 590ddc3f3a5..8f602a4de97 100644 --- a/reactos/lib/sdk/crt/stdio/find.c +++ b/reactos/lib/sdk/crt/stdio/find.c @@ -1,6 +1,6 @@ #include #include - +#include /* * @implemented */ diff --git a/reactos/lib/sdk/crt/stdlib/errno.c b/reactos/lib/sdk/crt/stdlib/errno.c index 633267eddd1..3a8d76e1be6 100644 --- a/reactos/lib/sdk/crt/stdlib/errno.c +++ b/reactos/lib/sdk/crt/stdlib/errno.c @@ -13,9 +13,9 @@ /* * @implemented */ -int* __doserrno(void) +unsigned long* __doserrno(void) { - return (int*)(&GetThreadData()->tdoserrno); + return (unsigned long*)(&GetThreadData()->tdoserrno); } /* diff --git a/reactos/lib/sdk/crt/stdlib/getenv.c b/reactos/lib/sdk/crt/stdlib/getenv.c index 0427351a6e7..0f5fb4396cb 100644 --- a/reactos/lib/sdk/crt/stdlib/getenv.c +++ b/reactos/lib/sdk/crt/stdlib/getenv.c @@ -9,7 +9,7 @@ */ #include -#undef environ +//#undef environ /* * @implemented diff --git a/reactos/lib/sdk/crt/stdlib/rot.c b/reactos/lib/sdk/crt/stdlib/rot.c index c1fbc73260c..7502fb74fe2 100644 --- a/reactos/lib/sdk/crt/stdlib/rot.c +++ b/reactos/lib/sdk/crt/stdlib/rot.c @@ -10,6 +10,7 @@ #include +unsigned int _rotr( unsigned int value, int shift ); /* * @implemented */ diff --git a/reactos/lib/sdk/crt/stdlib/swab.c b/reactos/lib/sdk/crt/stdlib/swab.c index f3cfba3fba7..e0e8cb78af8 100644 --- a/reactos/lib/sdk/crt/stdlib/swab.c +++ b/reactos/lib/sdk/crt/stdlib/swab.c @@ -15,8 +15,7 @@ * * copy this swab from wine cvs 2006-05-24 */ -void _swab (const char * src, char * dst, size_t sizeToCopy - ) +void _swab (char * src, char * dst, int sizeToCopy) { if (sizeToCopy > 1) diff --git a/reactos/lib/sdk/crt/string/atol.c b/reactos/lib/sdk/crt/string/atol.c index 9aa3af57d87..459446151c4 100644 --- a/reactos/lib/sdk/crt/string/atol.c +++ b/reactos/lib/sdk/crt/string/atol.c @@ -11,9 +11,9 @@ _ttol(const _TCHAR *str) return (long)_ttoi64(str); } -int _atoldbl(long double *value, const char *str) +int _atoldbl(_LDOUBLE *value, char *str) { /* FIXME needs error checking for huge/small values */ //*value = strtold(str,0); - return 0; + return -1; } diff --git a/reactos/lib/sdk/crt/string/ctype.c b/reactos/lib/sdk/crt/string/ctype.c index 46870724404..2606a39d9f8 100644 --- a/reactos/lib/sdk/crt/string/ctype.c +++ b/reactos/lib/sdk/crt/string/ctype.c @@ -4,6 +4,7 @@ #include #undef _pctype +#undef _pwctype /* MS's CRT header defines all that, and we actually implement that */ #undef iswalnum @@ -22,11 +23,13 @@ #undef iswspace #undef iswxdigit #undef __toascii +#undef _tolower +#undef _toupper #define upalpha ('A' - 'a') -unsigned short _ctype[] = { +const unsigned short _ctype[] = { 0, /* , 0xFFFF */ _CONTROL, /* CTRL+@, 0x00 */ _CONTROL, /* CTRL+A, 0x01 */ @@ -545,7 +548,7 @@ int iswxdigit(wint_t c) */ int __toascii(int c) { - return((unsigned)(c) & 0x7f); + return((unsigned int)(c) & 0x7f); } /* diff --git a/reactos/lib/sdk/crt/string/scanf.c b/reactos/lib/sdk/crt/string/scanf.c index e0ba480eb67..4e6c9bb1558 100644 --- a/reactos/lib/sdk/crt/string/scanf.c +++ b/reactos/lib/sdk/crt/string/scanf.c @@ -24,8 +24,6 @@ */ #include - -#include #include // HACK for LIBCNT @@ -183,7 +181,7 @@ int swscanf(const wchar_t *str, const wchar_t *format, ...) /********************************************************************* * _cscanf (MSVCRT.@) */ -int _cscanf(/*const*/ char *format, ...) +int _cscanf(const char *format, ...) { va_list valist; int res; diff --git a/reactos/lib/sdk/crt/time/ctime.c b/reactos/lib/sdk/crt/time/ctime.c index 822003b9fc4..a3ed572d380 100644 --- a/reactos/lib/sdk/crt/time/ctime.c +++ b/reactos/lib/sdk/crt/time/ctime.c @@ -1450,12 +1450,12 @@ __p__tzname(void) /********************************************************************* * _dstbias (MSVCRT.@) */ -int _dstbias = 0; +long _dstbias = 0; /********************************************************************* * __p_dstbias (MSVCRT.@) */ -int * __p__dstbias(void) +long * __p__dstbias(void) { return &_dstbias; } diff --git a/reactos/lib/sdk/crt/time/difftime.c b/reactos/lib/sdk/crt/time/difftime.c index bd3b2215fa6..07889acd8c6 100644 --- a/reactos/lib/sdk/crt/time/difftime.c +++ b/reactos/lib/sdk/crt/time/difftime.c @@ -5,7 +5,7 @@ * @implemented */ double -difftime(time_t time1, time_t time0) +difftime(time_t time1, time_t time2) { - return time1-time0; + return (double)(time1 - time2); } From 6ba21a4f7532e47525bb394b9be4411e9a8a676b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 30 Aug 2008 17:01:14 +0000 Subject: [PATCH 214/388] Commit WIP. Part 4 of ?? - Create separate def file for amd64 - Update rbuild files, not even these require msvcrt dependency - define _MSVCRT_, necesary to build dll correctly svn path=/branches/ros-amd64-bringup/; revision=35811 --- reactos/dll/win32/crtdll/crtdll.rbuild | 1 + reactos/dll/win32/msvcrt/msvcrt-amd64.def | 848 +++++++++++++++++++++ reactos/dll/win32/msvcrt/msvcrt-i386.def | 848 +++++++++++++++++++++ reactos/dll/win32/msvcrt/msvcrt.rbuild | 3 +- reactos/dll/win32/msvcrt20/msvcrt20.rbuild | 1 - reactos/dll/win32/msvcrt40/msvcrt40.rbuild | 1 - 6 files changed, 1699 insertions(+), 3 deletions(-) create mode 100644 reactos/dll/win32/msvcrt/msvcrt-amd64.def create mode 100644 reactos/dll/win32/msvcrt/msvcrt-i386.def diff --git a/reactos/dll/win32/crtdll/crtdll.rbuild b/reactos/dll/win32/crtdll/crtdll.rbuild index 864951faef0..f7166eb3ea6 100644 --- a/reactos/dll/win32/crtdll/crtdll.rbuild +++ b/reactos/dll/win32/crtdll/crtdll.rbuild @@ -7,6 +7,7 @@ 0x501 + diff --git a/reactos/dll/win32/msvcrt/msvcrt-amd64.def b/reactos/dll/win32/msvcrt/msvcrt-amd64.def new file mode 100644 index 00000000000..9c18fa42585 --- /dev/null +++ b/reactos/dll/win32/msvcrt/msvcrt-amd64.def @@ -0,0 +1,848 @@ +; +; ReactOS MSVCRT Library +; +LIBRARY msvcrt.dll + +EXPORTS + $I10_OUTPUT=MSVCRT_I10_OUTPUT @57 + ??0__non_rtti_object@@QAE@ABV0@@Z=MSVCRT___non_rtti_object_copy_ctor @1 + ??0__non_rtti_object@@QAE@PBD@Z=MSVCRT___non_rtti_object_ctor @2 +; ??0bad_cast@@AAE@PBQBD@Z @3 + ??0bad_cast@@QAE@ABQBD@Z=MSVCRT_bad_cast_ctor @4 + ??0bad_cast@@QAE@ABV0@@Z=MSVCRT_bad_cast_copy_ctor @5 +; ??0bad_cast@@QAE@PBD@Z @6 + ??0bad_typeid@@QAE@ABV0@@Z=MSVCRT_bad_typeid_copy_ctor @7 + ??0bad_typeid@@QAE@PBD@Z=MSVCRT_bad_typeid_ctor @8 + ??0exception@@QAE@ABQBD@Z=MSVCRT_exception_ctor @9 +; ??0exception@@QAE@ABQBDH@Z @10 + ??0exception@@QAE@ABV0@@Z=MSVCRT_exception_copy_ctor @11 + ??0exception@@QAE@XZ=MSVCRT_exception_default_ctor @12 + ??1__non_rtti_object@@UAE@XZ=MSVCRT___non_rtti_object_dtor @13 + ??1bad_cast@@UAE@XZ=MSVCRT_bad_cast_dtor @14 + ??1bad_typeid@@UAE@XZ=MSVCRT_bad_typeid_dtor @15 + ??1exception@@UAE@XZ=MSVCRT_exception_dtor @16 + ??1type_info@@UAE@XZ=MSVCRT_type_info_dtor @17 + ??2@YAPAXI@Z=MSVCRT_operator_new @18 + ??3@YAXPAX@Z=MSVCRT_operator_delete @19 + ??4__non_rtti_object@@QAEAAV0@ABV0@@Z=MSVCRT___non_rtti_object_opequals @20 + ??4bad_cast@@QAEAAV0@ABV0@@Z=MSVCRT_bad_cast_opequals @21 + ??4bad_typeid@@QAEAAV0@ABV0@@Z=MSVCRT_bad_typeid_opequals @22 + ??4exception@@QAEAAV0@ABV0@@Z=MSVCRT_exception_opequals @23 + ??8type_info@@QBEHABV0@@Z=MSVCRT_type_info_opequals_equals @24 + ??9type_info@@QBEHABV0@@Z=MSVCRT_type_info_opnot_equals @25 + ??_7__non_rtti_object@@6B@=MSVCRT___non_rtti_object_vtable@@6B@ @26 DATA + ??_7bad_cast@@6B@=MSVCRT_bad_cast_vtable @27 DATA + ??_7bad_typeid@@6B@=MSVCRT_bad_typeid_vtable @28 DATA + ??_7exception@@6B@=MSVCRT_exception_vtable @29 DATA + ??_E__non_rtti_object@@UAEPAXI@Z=MSVCRT___non_rtti_object_vector_dtor @30 + ??_Ebad_cast@@UAEPAXI@Z=MSVCRT_bad_cast_vector_dtor @31 + ??_Ebad_typeid@@UAEPAXI@Z=MSVCRT_bad_typeid_vector_dtor @32 + ??_Eexception@@UAEPAXI@Z=MSVCRT_exception_vector_dtor @33 +; ??_Fbad_cast@@QAEXXZ @34 +; ??_Fbad_typeid@@QAEXXZ @35 + ??_G__non_rtti_object@@UAEPAXI@Z=MSVCRT___non_rtti_object_scalar_dtor @36 + ??_Gbad_cast@@UAEPAXI@Z=MSVCRT_bad_cast_scalar_dtor @37 + ??_Gbad_typeid@@UAEPAXI@Z=MSVCRT_bad_typeid_scalar_dtor @38 + ??_Gexception@@UAEPAXI@Z=MSVCRT_exception_scalar_dtor @39 + ??_U@YAPAXI@Z=MSVCRT_operator_new @40 + ??_V@YAXPAX@Z=MSVCRT_operator_delete @41 + ?_query_new_handler@@YAP6AHI@ZXZ=MSVCRT__query_new_handler @43 + ?_query_new_mode@@YAHXZ=MSVCRT__query_new_mode @44 + ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z=MSVCRT__set_new_handler @45 + ?_set_new_mode@@YAHH@Z=MSVCRT__set_new_mode @46 + ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z=MSVCRT__set_se_translator @47 + ?before@type_info@@QBEHABV1@@Z=MSVCRT_type_info_before @48 + ?name@type_info@@QBEPBDXZ=MSVCRT_type_info_name @49 + ?raw_name@type_info@@QBEPBDXZ=MSVCRT_type_info_raw_name @50 + ?set_new_handler@@YAP6AXXZP6AXXZ@Z=MSVCRT__set_new_handler @51 + ?set_terminate@@YAP6AXXZP6AXXZ@Z=MSVCRT_set_terminate @52 + ?set_unexpected@@YAP6AXXZP6AXXZ@Z=MSVCRT_set_unexpected @53 + ?terminate@@YAXXZ=MSVCRT_terminate @54 + ?unexpected@@YAXXZ=MSVCRT_unexpected @55 + ?what@exception@@UBEPBDXZ=MSVCRT_what_exception @56 + _CIacos @58 + _CIasin @59 + _CIatan @60 + _CIatan2 @61 + _CIcos @62 + _CIcosh @63 + _CIexp @64 + _CIfmod @65 + _CIlog @66 + _CIlog10 @67 + _CIpow @68 + _CIsin @69 + _CIsinh @70 + _CIsqrt @71 + _CItan @72 + _CItanh @73 + _CxxThrowException @74 + _EH_prolog @75 + _Getdays @76 + _Getmonths @77 + _Gettnames @78 + _HUGE @79 DATA + _Strftime @80 + _XcptFilter @81 + __CppXcptFilter @82 +; __CxxCallUnwindDtor @83 +; __CxxCallUnwindVecDtor @84 + __CxxDetectRethrow @85 +; __CxxExceptionFilter @86 + __CxxFrameHandler @87 +; __CxxFrameHandler2 @88 + __CxxLongjmpUnwind @89 + __CxxQueryExceptionSize @90 +; __CxxRegisterExceptionObject @91 +; __CxxUnregisterExceptionObject @92 +; __DestructExceptionObject @93 + __RTCastToVoid=MSVCRT___RTCastToVoid @94 + __RTDynamicCast=MSVCRT___RTDynamicCast @95 + __RTtypeid=MSVCRT___RTtypeid @96 + __STRINGTOLD @97 +; ___lc_codepage_func @98 +; ___lc_collate_cp_func @99 +; ___lc_handle_func @100 +; ___mb_cur_max_func @101 + ___setlc_active_func @102 + ___unguarded_readlc_active_add_func @103 + __argc @104 DATA + __argv @105 DATA + __badioinfo @106 DATA + __crtCompareStringA=kernel32.CompareStringA @107 + __crtCompareStringW=kernel32.CompareStringW @108 + __crtGetLocaleInfoW=kernel32.GetLocaleInfo @109 + __crtGetStringTypeW=kernel32.GetStringTypeW @110 + __crtLCMapStringA @111 +; __crtLCMapStringW @112 + __dllonexit @113 + __doserrno @114 + __fpecode @115 + __getmainargs @116 + __initenv @117 + __iob_func @118 + __isascii @119 + __iscsym @120 + __iscsymf @121 + __lc_codepage @122 DATA + __lc_collate_cp @123 DATA + __lc_handle @124 DATA + __lconv_init @125 + __mb_cur_max @126 DATA + __p___argc @127 + __p___argv @128 + __p___initenv @129 + __p___mb_cur_max @130 + __p___wargv @131 + __p___winitenv @132 + __p__acmdln @133 + __p__amblksiz @134 + __p__commode @135 + __p__daylight @136 + __p__dstbias @137 + __p__environ @138 +; __p__fileinfo @139 + __p__fmode @140 + __p__iob @141 +; __p__mbcasemap @142 + __p__mbctype @143 + __p__osver @144 + __p__pctype @145 + __p__pgmptr @146 + __p__pwctype @147 + __p__timezone @148 + __p__tzname @149 + __p__wcmdln @150 + __p__wenviron @151 + __p__winmajor @152 + __p__winminor @153 + __p__winver @154 + __p__wpgmptr @155 +; __pctype_func @156 + __pioinfo @157 DATA +; __pwctype_func @158 + __pxcptinfoptrs @159 + __set_app_type @160 + __setlc_active @161 DATA + __setusermatherr @162 + __threadhandle @163 + __threadid @164 + __toascii @165 + __unDName @166 + __unDNameEx @167 +; __uncaught_exception @42 + __unguarded_readlc_active @168 DATA + __wargv @169 DATA +; __wcserror @170 + __wgetmainargs @171 + __winitenv @172 DATA + _abnormal_termination @173 +; _abs64 @174 + _access @175 + _acmdln @176 DATA + _adj_fdiv_m16i @177 + _adj_fdiv_m32 @178 + _adj_fdiv_m32i @179 + _adj_fdiv_m64 @180 + _adj_fdiv_r @181 + _adj_fdivr_m16i @182 + _adj_fdivr_m32 @183 + _adj_fdivr_m32i @184 + _adj_fdivr_m64 @185 + _adj_fpatan @186 + _adj_fprem @187 + _adj_fprem1 @188 + _adj_fptan @189 + _adjust_fdiv @190 DATA + _aexit_rtn @191 + _aligned_free @192 + _aligned_malloc @193 + _aligned_offset_malloc @194 + _aligned_offset_realloc @195 + _aligned_realloc @196 + _amsg_exit @197 + _assert @198 +; _atodbl @199 + _atoi64 @200 + _atoldbl @201 + _beep @202 + _beginthread @203 + _beginthreadex @204 + _c_exit @205 + _cabs @206 + _callnewh @207 + _cexit @208 + _cgets @209 +; _cgetws @210 + _chdir @211 + _chdrive @212 + _chgsign @213 + _chkesp @214 + _chmod @215 + _chsize @216 + _clearfp @217 + _close @218 + _commit @219 + _commode @220 DATA + _control87 @221 + _controlfp @222 + _copysign @223 + _cprintf @224 + _cputs @225 +; _cputws @226 + _creat @227 + _cscanf @228 +; _ctime64 @229 + _ctype @230 DATA + _cwait @231 +; _cwprintf @232 +; _cwscanf @233 + _daylight @234 DATA + _dstbias @235 DATA + _dup @236 + _dup2 @237 + _ecvt @238 + _endthread @239 + _endthreadex @240 + _environ @241 DATA + _eof @242 + _errno @243 + _except_handler2 @244 + _except_handler3 @245 + _execl @246 + _execle @247 + _execlp @248 + _execlpe @249 + _execv @250 + _execve @251 + _execvp @252 + _execvpe @253 + _exit @254 + _expand @255 + _fcloseall @256 + _fcvt @257 + _fdopen @258 + _fgetchar @259 + _fgetwchar @260 + _filbuf @261 +; _fileinfo @262 + _filelength @263 + _filelengthi64 @264 + _fileno @265 + _findclose @266 + _findfirst @267 + _findfirst64 @268 + _findfirsti64 @269 + _findnext @270 + _findnext64 @271 + _findnexti64 @272 + _finite @273 + _flsbuf @274 + _flushall @275 + _fmode @276 DATA + _fpclass @277 + _fpieee_flt @278 + _fpreset @279 + _fputchar @280 + _fputwchar @281 + _fsopen @282 + _fstat @283 + _fstat64 @284 + _fstati64 @285 + _ftime @286 + _ftime64 @287 + _ftol @288 + _fullpath @289 + _futime @290 +; _futime64 @291 + _gcvt @292 +; _get_heap_handle @293 + _get_osfhandle @294 + _get_sbh_threshold @295 + _getch @296 + _getche @297 + _getcwd @298 + _getdcwd @299 + _getdiskfree @300 + _getdllprocaddr @301 + _getdrive @302 + _getdrives=kernel32.GetLogicalDrives @303 + _getmaxstdio @304 + _getmbcp @305 + _getpid=kernel32.GetCurrentProcessId @306 + _getsystime @307 + _getw @308 +; _getwch @309 +; _getwche @310 + _getws @311 + _global_unwind2 @312 + _gmtime64 @313 + _heapadd @314 + _heapchk @315 + _heapmin @316 + _heapset @317 +; _heapused @318 + _heapwalk @319 + _hypot @320 + _i64toa @321 + _i64tow @322 + _initterm @323 +; _inp @324 +; _inpd @325 +; _inpw @326 + _iob @327 DATA + _isatty @328 + _isctype @329 + _ismbbalnum @330 + _ismbbalpha @331 + _ismbbgraph @332 + _ismbbkalnum @333 + _ismbbkana @334 +; _ismbbkprint @335 + _ismbbkpunct @336 + _ismbblead @337 + _ismbbprint @338 + _ismbbpunct @339 + _ismbbtrail @340 + _ismbcalnum @341 + _ismbcalpha @342 + _ismbcdigit @343 + _ismbcgraph @344 + _ismbchira @345 + _ismbckata @346 + _ismbcl0 @347 + _ismbcl1 @348 + _ismbcl2 @349 + _ismbclegal @350 + _ismbclower @351 + _ismbcprint @352 + _ismbcpunct @353 + _ismbcspace @354 + _ismbcsymbol @355 + _ismbcupper @356 + _ismbslead @357 + _ismbstrail @358 + _isnan @359 + _itoa @360 + _itow @361 + _j0 @362 + _j1 @363 + _jn @364 + _kbhit @365 + _lfind @366 + _loaddll @367 + _local_unwind2 @368 + _localtime64 @369 + _lock @370 + _locking @371 + _logb @372 + _longjmpex=longjmp @373 + _lrotl @374 + _lrotr @375 + _lsearch @376 + _lseek @377 + _lseeki64 @378 + _ltoa @379 + _ltow @380 + _makepath @381 + _mbbtombc @382 + _mbbtype @383 +; _mbcasemap @384 + _mbccpy @385 + _mbcjistojms @386 + _mbcjmstojis @387 + _mbclen @388 + _mbctohira @389 + _mbctokata @390 + _mbctolower @391 + _mbctombb @392 + _mbctoupper @393 + _mbctype @394 DATA + _mbsbtype @395 + _mbscat @396 + _mbschr @397 + _mbscmp @398 + _mbscoll @399 + _mbscpy @400 + _mbscspn @401 + _mbsdec @402 + _mbsdup @403 + _mbsicmp @404 + _mbsicoll @405 + _mbsinc @406 + _mbslen @407 + _mbslwr @408 + _mbsnbcat @409 + _mbsnbcmp @410 + _mbsnbcnt @411 + _mbsnbcoll @412 + _mbsnbcpy @413 + _mbsnbicmp @414 + _mbsnbicoll @415 + _mbsnbset @416 + _mbsncat @417 + _mbsnccnt @418 + _mbsncmp @419 + _mbsncoll @420 + _mbsncpy @421 + _mbsnextc @422 + _mbsnicmp @423 + _mbsnicoll @424 + _mbsninc @425 + _mbsnset @426 + _mbspbrk @427 + _mbsrchr @428 + _mbsrev @429 + _mbsset @430 + _mbsspn @431 + _mbsspnp @432 + _mbsstr @433 + _mbstok @434 + _mbstrlen @435 + _mbsupr @436 + _memccpy @437 + _memicmp @438 + _mkdir @439 +; _mkgmtime @440 +; _mkgmtime64 @441 + _mktemp @442 +; _mktime64 @443 + _msize @444 + _nextafter @445 + _onexit @446 + _open @447 + _open_osfhandle @448 +; _osplatform @449 + _osver @450 DATA +; _outp @451 +; _outpd @452 +; _outpw @453 + _pclose @454 + _pctype @455 DATA + _pgmptr @456 DATA + _pipe @457 + _popen @458 + _purecall @459 + _putch @460 + _putenv @461 + _putw @462 +; _putwch @463 + _putws @464 + _pwctype @465 + _read @466 +; _resetstkoflw @467 + _rmdir @468 + _rmtmp @469 + _rotl @470 +; _rotl64 @471 + _rotr @472 +; _rotr64 @473 + _safe_fdiv @474 + _safe_fdivr @475 + _safe_fprem @476 + _safe_fprem1 @477 + _scalb @478 +; _scprintf @479 +; _scwprintf @480 + _searchenv @481 + _seh_longjmp_unwind=_seh_longjmp_unwind@4 @482 +; _set_SSE2_enable @483 + _set_error_mode @484 + _set_sbh_threshold @485 + _seterrormode @486 + _setjmp @487 + _setjmp3 @488 + _setmaxstdio @489 + _setmbcp @490 + _setmode @491 + _setsystime @492 + _sleep @493 + _snprintf @494 +; _snscanf @495 + _snwprintf @496 +; _snwscanf @497 + _sopen @498 + _spawnl @499 + _spawnle @500 + _spawnlp @501 + _spawnlpe @502 + _spawnv @503 + _spawnve @504 + _spawnvp @505 + _spawnvpe @506 + _splitpath @507 + _stat @508 + _stat64 @509 + _stati64 @510 + _statusfp @511 + _strcmpi @512 + _strdate @513 + _strdup @514 + _strerror @515 + _stricmp @516 + _stricoll @517 + _strlwr @518 + _strncoll @519 + _strnicmp @520 + _strnicoll @521 + _strnset @522 + _strrev @523 + _strset @524 + _strtime @525 +; _strtoi64 @526 + _strtoui64=strtoull @527 + _strupr @528 + _swab @529 + _sys_errlist @530 DATA + _sys_nerr @531 DATA + _tell @532 + _telli64 @533 + _tempnam @534 + _time64 @535 + _timezone @536 DATA + _tolower @537 + _toupper @538 + _tzname @539 DATA + _tzset @540 + _ui64toa @541 + _ui64tow @542 + _ultoa @543 + _ultow @544 + _umask @545 + _ungetch @546 +; _ungetwch @547 + _unlink @548 + _unloaddll @549 + _unlock @550 + _utime @551 +; _utime64 @552 +; _vscprintf @553 +; _vscwprintf @554 + _vsnprintf @555 + _vsnwprintf @556 + _waccess @557 + _wasctime @558 + _wchdir @559 + _wchmod @560 + _wcmdln @561 + _wcreat @562 + _wcsdup @563 +; _wcserror @564 + _wcsicmp @565 + _wcsicoll @566 + _wcslwr @567 + _wcsncoll @568 + _wcsnicmp @569 + _wcsnicoll @570 + _wcsnset @571 + _wcsrev @572 + _wcsset @573 +; _wcstoi64 @574 +; _wcstoui64 @575 + _wcsupr @576 + _wctime @577 +; _wctime64 @578 +; _wctype @579 + _wenviron @580 DATA + _wexecl @581 + _wexecle @582 + _wexeclp @583 + _wexeclpe @584 + _wexecv @585 + _wexecve @586 + _wexecvp @587 + _wexecvpe @588 + _wfdopen @589 + _wfindfirst @590 +; _wfindfirst64 @591 + _wfindfirsti64 @592 + _wfindnext @593 +; _wfindnext64 @594 + _wfindnexti64 @595 + _wfopen @596 + _wfreopen @597 + _wfsopen @598 + _wfullpath @599 + _wgetcwd @600 + _wgetdcwd @601 + _wgetenv @602 + _winmajor @603 DATA + _winminor @604 DATA + _winver @605 DATA + _wmakepath @606 + _wmkdir @607 + _wmktemp @608 + _wopen @609 + _wperror @610 + _wpgmptr @611 DATA + _wpopen @612 + _wputenv @613 + _wremove @614 + _wrename @615 + _write @616 + _wrmdir @617 + _wsearchenv @618 + _wsetlocale @619 + _wsopen @620 + _wspawnl @621 + _wspawnle @622 + _wspawnlp @623 + _wspawnlpe @624 + _wspawnv @625 + _wspawnve @626 + _wspawnvp @627 + _wspawnvpe @628 + _wsplitpath @629 + _wstat @630 + _wstat64 @631 + _wstati64 @632 + _wstrdate @633 + _wstrtime @634 + _wsystem @635 + _wtempnam @636 + _wtmpnam @637 +; _wtof @638 + _wtoi @639 + _wtoi64 @640 + _wtol @641 + _wunlink @642 + _wutime @643 +; _wutime64 @644 + _y0 @645 + _y1 @646 + _yn @647 + abort @648 + abs @649 + acos @650 + asctime @651 + asin @652 + atan @653 + atan2 @654 + atexit @655 + atof @656 + atoi @657 + atol @658 + bsearch @659 + calloc @660 + ceil @661 + clearerr @662 + clock @663 + cos @664 + cosh @665 + ctime @666 + difftime @667 + div @668 + exit @669 + exp @670 + fabs @671 + fclose @672 + feof @673 + ferror @674 + fflush @675 + fgetc @676 + fgetpos @677 + fgets @678 + fgetwc @679 + fgetws @680 + floor @681 + fmod @682 + fopen @683 + fprintf @684 + fputc @685 + fputs @686 + fputwc @687 + fputws @688 + fread @689 + free @690 + freopen @691 + frexp @692 + fscanf @693 + fseek @694 + fsetpos @695 + ftell @696 + fwprintf @697 + fwrite @698 + fwscanf @699 + getc @700 + getchar @701 + getenv @702 + gets @703 + getwc @704 + getwchar @705 + gmtime @706 + is_wctype @707 + isalnum @708 + isalpha @709 + iscntrl @710 + isdigit @711 + isgraph @712 + isleadbyte @713 + islower @714 + isprint @715 + ispunct @716 + isspace @717 + isupper @718 + iswalnum @719 + iswalpha @720 + iswascii @721 + iswcntrl @722 + iswctype @723 + iswdigit @724 + iswgraph @725 + iswlower @726 + iswprint @727 + iswpunct @728 + iswspace @729 + iswupper @730 + iswxdigit @731 + isxdigit @732 + labs @733 + ldexp @734 + ldiv @735 + localeconv @736 + localtime @737 + log @738 + log10 @739 + longjmp @740 + malloc @741 + mblen @742 + mbstowcs @743 + mbtowc @744 + memchr @745 + memcmp @746 + memcpy @747 + memmove @748 + memset @749 + mktime @750 + modf @751 + perror @752 + pow @753 + printf @754 + putc @755 + putchar @756 + puts @757 + putwc=fputwc @758 + putwchar=_fputwchar @759 + qsort @760 + raise @761 + rand @762 + realloc @763 + remove @764 + rename @765 + rewind @766 + scanf @767 + setbuf @768 + setlocale @769 + setvbuf @770 + signal @771 + sin @772 + sinh @773 + sprintf @774 + sqrt @775 + srand @776 + sscanf @777 + strcat @778 + strchr @779 + strcmp @780 + strcoll @781 + strcpy @782 + strcspn @783 + strerror @784 + strftime @785 + strlen @786 + strncat @787 + strncmp @788 + strncpy @789 + strpbrk @790 + strrchr @791 + strspn @792 + strstr @793 + strtod @794 + strtok @795 + strtol @796 + strtoul @797 + strxfrm @798 + swprintf @799 + swscanf @800 + system @801 + tan @802 + tanh @803 + time @804 + tmpfile @805 + tmpnam @806 + tolower @807 + toupper @808 + towlower @809 + towupper @810 + ungetc @811 + ungetwc @812 + vfprintf @813 + vfwprintf @814 + vprintf @815 + vsprintf @816 + vswprintf @817 + vwprintf @818 + wcscat @819 + wcschr @820 + wcscmp @821 + wcscoll @822 + wcscpy @823 + wcscspn @824 + wcsftime @825 + wcslen @826 + wcsncat @827 + wcsncmp @828 + wcsncpy @829 + wcspbrk @830 + wcsrchr @831 + wcsspn @832 + wcsstr @833 + wcstod @834 + wcstok @835 + wcstol @836 + wcstombs @837 + wcstoul @838 + wcsxfrm @839 + wctomb @840 + wprintf @841 + wscanf @842 diff --git a/reactos/dll/win32/msvcrt/msvcrt-i386.def b/reactos/dll/win32/msvcrt/msvcrt-i386.def new file mode 100644 index 00000000000..6c45a0fed01 --- /dev/null +++ b/reactos/dll/win32/msvcrt/msvcrt-i386.def @@ -0,0 +1,848 @@ +; +; ReactOS MSVCRT Library +; +LIBRARY msvcrt.dll + +EXPORTS + $I10_OUTPUT=MSVCRT_I10_OUTPUT @57 + ??0__non_rtti_object@@QAE@ABV0@@Z=__thiscall_MSVCRT___non_rtti_object_copy_ctor @1 + ??0__non_rtti_object@@QAE@PBD@Z=__thiscall_MSVCRT___non_rtti_object_ctor @2 +; ??0bad_cast@@AAE@PBQBD@Z @3 + ??0bad_cast@@QAE@ABQBD@Z=__thiscall_MSVCRT_bad_cast_ctor @4 + ??0bad_cast@@QAE@ABV0@@Z=__thiscall_MSVCRT_bad_cast_copy_ctor @5 +; ??0bad_cast@@QAE@PBD@Z @6 + ??0bad_typeid@@QAE@ABV0@@Z=__thiscall_MSVCRT_bad_typeid_copy_ctor @7 + ??0bad_typeid@@QAE@PBD@Z=__thiscall_MSVCRT_bad_typeid_ctor @8 + ??0exception@@QAE@ABQBD@Z=__thiscall_MSVCRT_exception_ctor @9 +; ??0exception@@QAE@ABQBDH@Z @10 + ??0exception@@QAE@ABV0@@Z=__thiscall_MSVCRT_exception_copy_ctor @11 + ??0exception@@QAE@XZ=__thiscall_MSVCRT_exception_default_ctor @12 + ??1__non_rtti_object@@UAE@XZ=__thiscall_MSVCRT___non_rtti_object_dtor @13 + ??1bad_cast@@UAE@XZ=__thiscall_MSVCRT_bad_cast_dtor @14 + ??1bad_typeid@@UAE@XZ=__thiscall_MSVCRT_bad_typeid_dtor @15 + ??1exception@@UAE@XZ=__thiscall_MSVCRT_exception_dtor @16 + ??1type_info@@UAE@XZ=__thiscall_MSVCRT_type_info_dtor @17 + ??2@YAPAXI@Z=MSVCRT_operator_new @18 + ??3@YAXPAX@Z=MSVCRT_operator_delete @19 + ??4__non_rtti_object@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT___non_rtti_object_opequals @20 + ??4bad_cast@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT_bad_cast_opequals @21 + ??4bad_typeid@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT_bad_typeid_opequals @22 + ??4exception@@QAEAAV0@ABV0@@Z=__thiscall_MSVCRT_exception_opequals @23 + ??8type_info@@QBEHABV0@@Z=__thiscall_MSVCRT_type_info_opequals_equals @24 + ??9type_info@@QBEHABV0@@Z=__thiscall_MSVCRT_type_info_opnot_equals @25 + ??_7__non_rtti_object@@6B@=MSVCRT___non_rtti_object_vtable@@6B@ @26 DATA + ??_7bad_cast@@6B@=MSVCRT_bad_cast_vtable @27 DATA + ??_7bad_typeid@@6B@=MSVCRT_bad_typeid_vtable @28 DATA + ??_7exception@@6B@=MSVCRT_exception_vtable @29 DATA + ??_E__non_rtti_object@@UAEPAXI@Z=__thiscall_MSVCRT___non_rtti_object_vector_dtor @30 + ??_Ebad_cast@@UAEPAXI@Z=__thiscall_MSVCRT_bad_cast_vector_dtor @31 + ??_Ebad_typeid@@UAEPAXI@Z=__thiscall_MSVCRT_bad_typeid_vector_dtor @32 + ??_Eexception@@UAEPAXI@Z=__thiscall_MSVCRT_exception_vector_dtor @33 +; ??_Fbad_cast@@QAEXXZ @34 +; ??_Fbad_typeid@@QAEXXZ @35 + ??_G__non_rtti_object@@UAEPAXI@Z=__thiscall_MSVCRT___non_rtti_object_scalar_dtor @36 + ??_Gbad_cast@@UAEPAXI@Z=__thiscall_MSVCRT_bad_cast_scalar_dtor @37 + ??_Gbad_typeid@@UAEPAXI@Z=__thiscall_MSVCRT_bad_typeid_scalar_dtor @38 + ??_Gexception@@UAEPAXI@Z=__thiscall_MSVCRT_exception_scalar_dtor @39 + ??_U@YAPAXI@Z=MSVCRT_operator_new @40 + ??_V@YAXPAX@Z=MSVCRT_operator_delete @41 + ?_query_new_handler@@YAP6AHI@ZXZ=MSVCRT__query_new_handler @43 + ?_query_new_mode@@YAHXZ=MSVCRT__query_new_mode @44 + ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z=MSVCRT__set_new_handler @45 + ?_set_new_mode@@YAHH@Z=MSVCRT__set_new_mode @46 + ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z=MSVCRT__set_se_translator @47 + ?before@type_info@@QBEHABV1@@Z=__thiscall_MSVCRT_type_info_before @48 + ?name@type_info@@QBEPBDXZ=__thiscall_MSVCRT_type_info_name @49 + ?raw_name@type_info@@QBEPBDXZ=__thiscall_MSVCRT_type_info_raw_name @50 + ?set_new_handler@@YAP6AXXZP6AXXZ@Z=MSVCRT__set_new_handler @51 + ?set_terminate@@YAP6AXXZP6AXXZ@Z=MSVCRT_set_terminate @52 + ?set_unexpected@@YAP6AXXZP6AXXZ@Z=MSVCRT_set_unexpected @53 + ?terminate@@YAXXZ=MSVCRT_terminate @54 + ?unexpected@@YAXXZ=MSVCRT_unexpected @55 + ?what@exception@@UBEPBDXZ=__thiscall_MSVCRT_what_exception @56 + _CIacos @58 + _CIasin @59 + _CIatan @60 + _CIatan2 @61 + _CIcos @62 + _CIcosh @63 + _CIexp @64 + _CIfmod @65 + _CIlog @66 + _CIlog10 @67 + _CIpow @68 + _CIsin @69 + _CIsinh @70 + _CIsqrt @71 + _CItan @72 + _CItanh @73 + _CxxThrowException @74 + _EH_prolog @75 + _Getdays @76 + _Getmonths @77 + _Gettnames @78 + _HUGE @79 DATA + _Strftime @80 + _XcptFilter @81 + __CppXcptFilter @82 +; __CxxCallUnwindDtor @83 +; __CxxCallUnwindVecDtor @84 + __CxxDetectRethrow @85 +; __CxxExceptionFilter @86 + __CxxFrameHandler @87 +; __CxxFrameHandler2 @88 + __CxxLongjmpUnwind @89 + __CxxQueryExceptionSize @90 +; __CxxRegisterExceptionObject @91 +; __CxxUnregisterExceptionObject @92 +; __DestructExceptionObject @93 + __RTCastToVoid=MSVCRT___RTCastToVoid @94 + __RTDynamicCast=MSVCRT___RTDynamicCast @95 + __RTtypeid=MSVCRT___RTtypeid @96 + __STRINGTOLD @97 +; ___lc_codepage_func @98 +; ___lc_collate_cp_func @99 +; ___lc_handle_func @100 +; ___mb_cur_max_func @101 + ___setlc_active_func @102 + ___unguarded_readlc_active_add_func @103 + __argc @104 DATA + __argv @105 DATA + __badioinfo @106 DATA + __crtCompareStringA=kernel32.CompareStringA @107 + __crtCompareStringW=kernel32.CompareStringW @108 + __crtGetLocaleInfoW=kernel32.GetLocaleInfo @109 + __crtGetStringTypeW=kernel32.GetStringTypeW @110 + __crtLCMapStringA @111 +; __crtLCMapStringW @112 + __dllonexit @113 + __doserrno @114 + __fpecode @115 + __getmainargs @116 + __initenv @117 +; __iob_func @118 + __isascii @119 + __iscsym @120 + __iscsymf @121 + __lc_codepage @122 DATA + __lc_collate_cp @123 DATA + __lc_handle @124 DATA + __lconv_init @125 + __mb_cur_max @126 DATA + __p___argc @127 + __p___argv @128 + __p___initenv @129 + __p___mb_cur_max @130 + __p___wargv @131 + __p___winitenv @132 + __p__acmdln @133 + __p__amblksiz @134 + __p__commode @135 + __p__daylight @136 + __p__dstbias @137 + __p__environ @138 +; __p__fileinfo @139 + __p__fmode @140 + __p__iob @141 +; __p__mbcasemap @142 + __p__mbctype @143 + __p__osver @144 + __p__pctype @145 + __p__pgmptr @146 + __p__pwctype @147 + __p__timezone @148 + __p__tzname @149 + __p__wcmdln @150 + __p__wenviron @151 + __p__winmajor @152 + __p__winminor @153 + __p__winver @154 + __p__wpgmptr @155 +; __pctype_func @156 + __pioinfo @157 DATA +; __pwctype_func @158 + __pxcptinfoptrs @159 + __set_app_type @160 + __setlc_active @161 DATA + __setusermatherr @162 + __threadhandle @163 + __threadid @164 + __toascii @165 + __unDName @166 + __unDNameEx @167 +; __uncaught_exception @42 + __unguarded_readlc_active @168 DATA + __wargv @169 DATA +; __wcserror @170 + __wgetmainargs @171 + __winitenv @172 DATA + _abnormal_termination @173 +; _abs64 @174 + _access @175 + _acmdln @176 DATA + _adj_fdiv_m16i @177 + _adj_fdiv_m32 @178 + _adj_fdiv_m32i @179 + _adj_fdiv_m64 @180 + _adj_fdiv_r @181 + _adj_fdivr_m16i @182 + _adj_fdivr_m32 @183 + _adj_fdivr_m32i @184 + _adj_fdivr_m64 @185 + _adj_fpatan @186 + _adj_fprem @187 + _adj_fprem1 @188 + _adj_fptan @189 + _adjust_fdiv @190 DATA + _aexit_rtn @191 + _aligned_free @192 + _aligned_malloc @193 + _aligned_offset_malloc @194 + _aligned_offset_realloc @195 + _aligned_realloc @196 + _amsg_exit @197 + _assert @198 +; _atodbl @199 + _atoi64 @200 + _atoldbl @201 + _beep @202 + _beginthread @203 + _beginthreadex @204 + _c_exit @205 + _cabs @206 + _callnewh @207 + _cexit @208 + _cgets @209 +; _cgetws @210 + _chdir @211 + _chdrive @212 + _chgsign @213 + _chkesp @214 + _chmod @215 + _chsize @216 + _clearfp @217 + _close @218 + _commit @219 + _commode @220 DATA + _control87 @221 + _controlfp @222 + _copysign @223 + _cprintf @224 + _cputs @225 +; _cputws @226 + _creat @227 + _cscanf @228 +; _ctime64 @229 + _ctype @230 DATA + _cwait @231 +; _cwprintf @232 +; _cwscanf @233 + _daylight @234 DATA + _dstbias @235 DATA + _dup @236 + _dup2 @237 + _ecvt @238 + _endthread @239 + _endthreadex @240 + _environ @241 DATA + _eof @242 + _errno @243 + _except_handler2 @244 + _except_handler3 @245 + _execl @246 + _execle @247 + _execlp @248 + _execlpe @249 + _execv @250 + _execve @251 + _execvp @252 + _execvpe @253 + _exit @254 + _expand @255 + _fcloseall @256 + _fcvt @257 + _fdopen @258 + _fgetchar @259 + _fgetwchar @260 + _filbuf @261 +; _fileinfo @262 + _filelength @263 + _filelengthi64 @264 + _fileno @265 + _findclose @266 + _findfirst @267 +; _findfirst64 @268 + ;_findfirsti64 @269 + _findnext @270 +; _findnext64 @271 + ;_findnexti64 @272 + _finite @273 + _flsbuf @274 + _flushall @275 + _fmode @276 DATA + _fpclass @277 + _fpieee_flt @278 + _fpreset @279 + _fputchar @280 + _fputwchar @281 + _fsopen @282 + _fstat @283 + _fstat64 @284 + ;_fstati64 @285 + ;_ftime @286 +; _ftime64 @287 + _ftol @288 + _fullpath @289 + _futime @290 +; _futime64 @291 + _gcvt @292 +; _get_heap_handle @293 + _get_osfhandle @294 + _get_sbh_threshold @295 + _getch @296 + _getche @297 + _getcwd @298 + _getdcwd @299 + _getdiskfree @300 + _getdllprocaddr @301 + _getdrive @302 + _getdrives=kernel32.GetLogicalDrives @303 + _getmaxstdio @304 + _getmbcp @305 + _getpid=kernel32.GetCurrentProcessId @306 + _getsystime @307 + _getw @308 +; _getwch @309 +; _getwche @310 + _getws @311 + _global_unwind2 @312 +; _gmtime64 @313 + _heapadd @314 + _heapchk @315 + _heapmin @316 + _heapset @317 +; _heapused @318 + _heapwalk @319 + _hypot @320 + _i64toa @321 + _i64tow @322 + _initterm @323 +; _inp @324 +; _inpd @325 +; _inpw @326 + _iob @327 DATA + _isatty @328 + _isctype @329 + _ismbbalnum @330 + _ismbbalpha @331 + _ismbbgraph @332 + _ismbbkalnum @333 + _ismbbkana @334 +; _ismbbkprint @335 + _ismbbkpunct @336 + _ismbblead @337 + _ismbbprint @338 + _ismbbpunct @339 + _ismbbtrail @340 + _ismbcalnum @341 + _ismbcalpha @342 + _ismbcdigit @343 + _ismbcgraph @344 + _ismbchira @345 + _ismbckata @346 + _ismbcl0 @347 + _ismbcl1 @348 + _ismbcl2 @349 + _ismbclegal @350 + _ismbclower @351 + _ismbcprint @352 + _ismbcpunct @353 + _ismbcspace @354 + _ismbcsymbol @355 + _ismbcupper @356 + _ismbslead @357 + _ismbstrail @358 + _isnan @359 + _itoa @360 + _itow @361 + _j0 @362 + _j1 @363 + _jn @364 + _kbhit @365 + _lfind @366 + _loaddll @367 + _local_unwind2 @368 +; _localtime64 @369 + _lock @370 + _locking @371 + _logb @372 + _longjmpex=longjmp @373 + _lrotl @374 + _lrotr @375 + _lsearch @376 + _lseek @377 + _lseeki64 @378 + _ltoa @379 + _ltow @380 + _makepath @381 + _mbbtombc @382 + _mbbtype @383 +; _mbcasemap @384 + _mbccpy @385 + _mbcjistojms @386 + _mbcjmstojis @387 + _mbclen @388 + _mbctohira @389 + _mbctokata @390 + _mbctolower @391 + _mbctombb @392 + _mbctoupper @393 + _mbctype @394 DATA + _mbsbtype @395 + _mbscat @396 + _mbschr @397 + _mbscmp @398 + _mbscoll @399 + _mbscpy @400 + _mbscspn @401 + _mbsdec @402 + _mbsdup @403 + _mbsicmp @404 + _mbsicoll @405 + _mbsinc @406 + _mbslen @407 + _mbslwr @408 + _mbsnbcat @409 + _mbsnbcmp @410 + _mbsnbcnt @411 + _mbsnbcoll @412 + _mbsnbcpy @413 + _mbsnbicmp @414 + _mbsnbicoll @415 + _mbsnbset @416 + _mbsncat @417 + _mbsnccnt @418 + _mbsncmp @419 + _mbsncoll @420 + _mbsncpy @421 + _mbsnextc @422 + _mbsnicmp @423 + _mbsnicoll @424 + _mbsninc @425 + _mbsnset @426 + _mbspbrk @427 + _mbsrchr @428 + _mbsrev @429 + _mbsset @430 + _mbsspn @431 + _mbsspnp @432 + _mbsstr @433 + _mbstok @434 + _mbstrlen @435 + _mbsupr @436 + _memccpy @437 + _memicmp @438 + _mkdir @439 +; _mkgmtime @440 +; _mkgmtime64 @441 + _mktemp @442 +; _mktime64 @443 + _msize @444 + _nextafter @445 + _onexit @446 + _open @447 + _open_osfhandle @448 +; _osplatform @449 + _osver @450 DATA +; _outp @451 +; _outpd @452 +; _outpw @453 + _pclose @454 + _pctype @455 DATA + _pgmptr @456 DATA + _pipe @457 + _popen @458 + _purecall @459 + _putch @460 + _putenv @461 + _putw @462 +; _putwch @463 + _putws @464 + _pwctype @465 + _read @466 +; _resetstkoflw @467 + _rmdir @468 + _rmtmp @469 + _rotl @470 +; _rotl64 @471 + _rotr @472 +; _rotr64 @473 + _safe_fdiv @474 + _safe_fdivr @475 + _safe_fprem @476 + _safe_fprem1 @477 + _scalb @478 +; _scprintf @479 +; _scwprintf @480 + _searchenv @481 + _seh_longjmp_unwind=_seh_longjmp_unwind@4 @482 +; _set_SSE2_enable @483 + _set_error_mode @484 + _set_sbh_threshold @485 + _seterrormode @486 + _setjmp @487 + _setjmp3 @488 + _setmaxstdio @489 + _setmbcp @490 + _setmode @491 + _setsystime @492 + _sleep @493 + _snprintf @494 +; _snscanf @495 + _snwprintf @496 +; _snwscanf @497 + _sopen @498 + _spawnl @499 + _spawnle @500 + _spawnlp @501 + _spawnlpe @502 + _spawnv @503 + _spawnve @504 + _spawnvp @505 + _spawnvpe @506 + _splitpath @507 + _stat @508 + _stat64 @509 + ;_stati64 @510 + _statusfp @511 + _strcmpi @512 + _strdate @513 + _strdup @514 + _strerror @515 + _stricmp @516 + _stricoll @517 + _strlwr @518 + _strncoll @519 + _strnicmp @520 + _strnicoll @521 + _strnset @522 + _strrev @523 + _strset @524 + _strtime @525 +; _strtoi64 @526 + _strtoui64=strtoull @527 + _strupr @528 + _swab @529 + _sys_errlist @530 DATA + _sys_nerr @531 DATA + _tell @532 + _telli64 @533 + _tempnam @534 +; _time64 @535 + _timezone @536 DATA + _tolower @537 + _toupper @538 + _tzname @539 DATA + _tzset @540 + _ui64toa @541 + _ui64tow @542 + _ultoa @543 + _ultow @544 + _umask @545 + _ungetch @546 +; _ungetwch @547 + _unlink @548 + _unloaddll @549 + _unlock @550 + _utime @551 +; _utime64 @552 +; _vscprintf @553 +; _vscwprintf @554 + _vsnprintf @555 + _vsnwprintf @556 + _waccess @557 + _wasctime @558 + _wchdir @559 + _wchmod @560 + _wcmdln @561 + _wcreat @562 + _wcsdup @563 +; _wcserror @564 + _wcsicmp @565 + _wcsicoll @566 + _wcslwr @567 + _wcsncoll @568 + _wcsnicmp @569 + _wcsnicoll @570 + _wcsnset @571 + _wcsrev @572 + _wcsset @573 +; _wcstoi64 @574 +; _wcstoui64 @575 + _wcsupr @576 + _wctime @577 +; _wctime64 @578 +; _wctype @579 + _wenviron @580 DATA + _wexecl @581 + _wexecle @582 + _wexeclp @583 + _wexeclpe @584 + _wexecv @585 + _wexecve @586 + _wexecvp @587 + _wexecvpe @588 + _wfdopen @589 + ;_wfindfirst @590 +; _wfindfirst64 @591 + ;_wfindfirsti64 @592 + ;_wfindnext @593 +; _wfindnext64 @594 + ;_wfindnexti64 @595 + _wfopen @596 + _wfreopen @597 + _wfsopen @598 + _wfullpath @599 + _wgetcwd @600 + _wgetdcwd @601 + _wgetenv @602 + _winmajor @603 DATA + _winminor @604 DATA + _winver @605 DATA + _wmakepath @606 + _wmkdir @607 + _wmktemp @608 + _wopen @609 + _wperror @610 + _wpgmptr @611 DATA + _wpopen @612 + _wputenv @613 + _wremove @614 + _wrename @615 + _write @616 + _wrmdir @617 + _wsearchenv @618 + _wsetlocale @619 + _wsopen @620 + _wspawnl @621 + _wspawnle @622 + _wspawnlp @623 + _wspawnlpe @624 + _wspawnv @625 + _wspawnve @626 + _wspawnvp @627 + _wspawnvpe @628 + _wsplitpath @629 + _wstat @630 + _wstat64 @631 + ;_wstati64 @632 + _wstrdate @633 + _wstrtime @634 + _wsystem @635 + _wtempnam @636 + _wtmpnam @637 +; _wtof @638 + _wtoi @639 + _wtoi64 @640 + _wtol @641 + _wunlink @642 + _wutime @643 +; _wutime64 @644 + _y0 @645 + _y1 @646 + _yn @647 + abort @648 + abs @649 + acos @650 + asctime @651 + asin @652 + atan @653 + atan2 @654 + atexit @655 + atof @656 + atoi @657 + atol @658 + bsearch @659 + calloc @660 + ceil @661 + clearerr @662 + clock @663 + cos @664 + cosh @665 + ctime @666 + difftime @667 + div @668 + exit @669 + exp @670 + fabs @671 + fclose @672 + feof @673 + ferror @674 + fflush @675 + fgetc @676 + fgetpos @677 + fgets @678 + fgetwc @679 + fgetws @680 + floor @681 + fmod @682 + fopen @683 + fprintf @684 + fputc @685 + fputs @686 + fputwc @687 + fputws @688 + fread @689 + free @690 + freopen @691 + frexp @692 + fscanf @693 + fseek @694 + fsetpos @695 + ftell @696 + fwprintf @697 + fwrite @698 + fwscanf @699 + getc @700 + getchar @701 + getenv @702 + gets @703 + getwc @704 + getwchar @705 + gmtime @706 + is_wctype @707 + isalnum @708 + isalpha @709 + iscntrl @710 + isdigit @711 + isgraph @712 + isleadbyte @713 + islower @714 + isprint @715 + ispunct @716 + isspace @717 + isupper @718 + iswalnum @719 + iswalpha @720 + iswascii @721 + iswcntrl @722 + iswctype @723 + iswdigit @724 + iswgraph @725 + iswlower @726 + iswprint @727 + iswpunct @728 + iswspace @729 + iswupper @730 + iswxdigit @731 + isxdigit @732 + labs @733 + ldexp @734 + ldiv @735 + localeconv @736 + localtime @737 + log @738 + log10 @739 + longjmp @740 + malloc @741 + mblen @742 + mbstowcs @743 + mbtowc @744 + memchr @745 + memcmp @746 + memcpy @747 + memmove @748 + memset @749 + mktime @750 + modf @751 + perror @752 + pow @753 + printf @754 + putc @755 + putchar @756 + puts @757 + putwc=fputwc @758 + putwchar=_fputwchar @759 + qsort @760 + raise @761 + rand @762 + realloc @763 + remove @764 + rename @765 + rewind @766 + scanf @767 + setbuf @768 + setlocale @769 + setvbuf @770 + signal @771 + sin @772 + sinh @773 + sprintf @774 + sqrt @775 + srand @776 + sscanf @777 + strcat @778 + strchr @779 + strcmp @780 + strcoll @781 + strcpy @782 + strcspn @783 + strerror @784 + strftime @785 + strlen @786 + strncat @787 + strncmp @788 + strncpy @789 + strpbrk @790 + strrchr @791 + strspn @792 + strstr @793 + strtod @794 + strtok @795 + strtol @796 + strtoul @797 + strxfrm @798 + swprintf @799 + swscanf @800 + system @801 + tan @802 + tanh @803 + time @804 + tmpfile @805 + tmpnam @806 + tolower @807 + toupper @808 + towlower @809 + towupper @810 + ungetc @811 + ungetwc @812 + vfprintf @813 + vfwprintf @814 + vprintf @815 + vsprintf @816 + vswprintf @817 + vwprintf @818 + wcscat @819 + wcschr @820 + wcscmp @821 + wcscoll @822 + wcscpy @823 + wcscspn @824 + wcsftime @825 + wcslen @826 + wcsncat @827 + wcsncmp @828 + wcsncpy @829 + wcspbrk @830 + wcsrchr @831 + wcsspn @832 + wcsstr @833 + wcstod @834 + wcstok @835 + wcstol @836 + wcstombs @837 + wcstoul @838 + wcsxfrm @839 + wctomb @840 + wprintf @841 + wscanf @842 diff --git a/reactos/dll/win32/msvcrt/msvcrt.rbuild b/reactos/dll/win32/msvcrt/msvcrt.rbuild index cbacf30cd67..af2b78ebc15 100644 --- a/reactos/dll/win32/msvcrt/msvcrt.rbuild +++ b/reactos/dll/win32/msvcrt/msvcrt.rbuild @@ -1,11 +1,12 @@ - + . include 0x600 0x501 + diff --git a/reactos/dll/win32/msvcrt20/msvcrt20.rbuild b/reactos/dll/win32/msvcrt20/msvcrt20.rbuild index dbe765ca396..42a0f5bde48 100644 --- a/reactos/dll/win32/msvcrt20/msvcrt20.rbuild +++ b/reactos/dll/win32/msvcrt20/msvcrt20.rbuild @@ -11,7 +11,6 @@ msvcrt20.c msvcrt20.spec wine - msvcrt kernel32 ntdll diff --git a/reactos/dll/win32/msvcrt40/msvcrt40.rbuild b/reactos/dll/win32/msvcrt40/msvcrt40.rbuild index b02916a86ab..1771c772327 100644 --- a/reactos/dll/win32/msvcrt40/msvcrt40.rbuild +++ b/reactos/dll/win32/msvcrt40/msvcrt40.rbuild @@ -9,7 +9,6 @@ msvcrt40.c msvcrt40.spec wine - msvcrt kernel32 From 75c2238736d1d0cca7da501fa5f974ddce36385f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 31 Aug 2008 00:04:06 +0000 Subject: [PATCH 215/388] fix PCR svn path=/branches/ros-amd64-bringup/; revision=35823 --- reactos/include/ndk/amd64/ketypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 7f20a779336..8099de11c1d 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -30,7 +30,7 @@ Author: // //#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS)) //#define PCR ((volatile KPCR * const)K0IPCR) -#define PCR 0 // HACK +#define PCR ((volatile KPCR * const)__readgsqword(KPCR_SELF)) //#if defined(CONFIG_SMP) || defined(NT_BUILD) //#undef KeGetPcr //#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C)) From 438b349c2921918d28cca1a8ebf0d84950f4326d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 31 Aug 2008 00:07:08 +0000 Subject: [PATCH 216/388] Move KeGetPcr from NDK to winddk.h svn path=/branches/ros-amd64-bringup/; revision=35824 --- reactos/include/ddk/winddk.h | 6 ++++++ reactos/include/ndk/ketypes.h | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 1f0c01fdb23..6359f9bede9 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5438,6 +5438,8 @@ typedef struct _KPCR { ULONG HalReserved[16]; // For use by Hal } KPCR, *PKPCR; /* 54 */ +#define KeGetPcr() PCR + typedef struct _KFLOATING_SAVE { ULONG ControlWord; ULONG StatusWord; @@ -5655,6 +5657,8 @@ typedef struct _KPCR { UCHAR Number; /* 51 */ } KPCR, *PKPCR; /* 54 */ +#define KeGetPcr() PCR + static __inline ULONG DDKAPI @@ -5689,6 +5693,8 @@ typedef struct _KPCR { ULONG IDR; /* 30 */ } KPCR, *PKPCR; +#define KeGetPcr() PCR + typedef struct _KFLOATING_SAVE { } KFLOATING_SAVE, *PKFLOATING_SAVE; diff --git a/reactos/include/ndk/ketypes.h b/reactos/include/ndk/ketypes.h index 3255bccae23..d5393ee6b1d 100644 --- a/reactos/include/ndk/ketypes.h +++ b/reactos/include/ndk/ketypes.h @@ -107,11 +107,6 @@ Author: #define KINTERRUPT_DISPATCH_CODES 106 #endif -// -// Get KPCR -// -#define KeGetPcr() PCR - #ifdef NTOS_MODE_USER // From 811714c03b2ae5b8c2938189fe2d58367ff4ab83 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 31 Aug 2008 02:53:32 +0000 Subject: [PATCH 217/388] -Actually disable TLS. -Fix boot. svn path=/branches/ros-amd64-bringup/; revision=35825 --- reactos/lib/3rdparty/mingw/crtexe.c | 7 ++++--- reactos/lib/3rdparty/mingw/mingw.rbuild | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/lib/3rdparty/mingw/crtexe.c b/reactos/lib/3rdparty/mingw/crtexe.c index 273fea363de..d247c8a07c1 100644 --- a/reactos/lib/3rdparty/mingw/crtexe.c +++ b/reactos/lib/3rdparty/mingw/crtexe.c @@ -287,9 +287,10 @@ check_managed_app (void) PIMAGE_OPTIONAL_HEADER64 pNTHeader64; /* Force to be linked. */ - mingw_initltsdrot_force=1; - mingw_initltsdyn_force=1; - mingw_initltssuo_force=1; + //TLS sections + //mingw_initltsdrot_force=1; + //mingw_initltsdyn_force=1; + //mingw_initltssuo_force=1; mingw_initcharmax=1; pDOSHeader = (PIMAGE_DOS_HEADER) &__ImageBase; diff --git a/reactos/lib/3rdparty/mingw/mingw.rbuild b/reactos/lib/3rdparty/mingw/mingw.rbuild index b7ca7386fc7..3d004dc5e52 100644 --- a/reactos/lib/3rdparty/mingw/mingw.rbuild +++ b/reactos/lib/3rdparty/mingw/mingw.rbuild @@ -15,7 +15,6 @@ natstart.c _newmode.c pesect.c - tlssup.c wildcard.c xtxtmode.c xncommod.c From 2f59177f5f528fd57b38e75eb7df360e871cc42c Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 31 Aug 2008 03:10:30 +0000 Subject: [PATCH 218/388] - minor WIN64 fixes - Remove unneeded dependencies svn path=/branches/ros-amd64-bringup/; revision=35826 --- reactos/base/applications/network/tracert/tracert.c | 8 ++++++++ reactos/base/applications/regedit/regedit.rbuild | 3 +-- reactos/base/applications/taskmgr/taskmgr.rbuild | 3 +-- reactos/base/applications/wordpad/wordpad.rbuild | 1 - reactos/base/setup/usetup/interface/usetup.c | 2 +- reactos/base/setup/usetup/partlist.c | 2 +- reactos/base/setup/vmwinst/vmwinst.c | 2 +- reactos/base/shell/cmd/cmd.c | 4 ++-- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/reactos/base/applications/network/tracert/tracert.c b/reactos/base/applications/network/tracert/tracert.c index f852bfd1fef..0377d80b17d 100644 --- a/reactos/base/applications/network/tracert/tracert.c +++ b/reactos/base/applications/network/tracert/tracert.c @@ -396,7 +396,11 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id, process id %d"), TTLExceedHdr->OrigIcmpHeader.id, GetCurrentProcessId()); return -1; } +#ifndef _WIN64 _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#else + _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#endif return 0; case ECHO_REPLY : @@ -407,7 +411,11 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id %d, process id %d"), IcmpHdr->icmpheader.id, GetCurrentProcessId()); return -1; } +#ifndef _WIN64 _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#else + _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#endif return 1; case DEST_UNREACHABLE : diff --git a/reactos/base/applications/regedit/regedit.rbuild b/reactos/base/applications/regedit/regedit.rbuild index fdd1bd78caa..43dbf2fc8ee 100644 --- a/reactos/base/applications/regedit/regedit.rbuild +++ b/reactos/base/applications/regedit/regedit.rbuild @@ -1,7 +1,7 @@ - + . @@ -12,7 +12,6 @@ user32 gdi32 advapi32 - comdlg32 ole32 shell32 comctl32 diff --git a/reactos/base/applications/taskmgr/taskmgr.rbuild b/reactos/base/applications/taskmgr/taskmgr.rbuild index 4b9022bbaa4..758b27d53ec 100644 --- a/reactos/base/applications/taskmgr/taskmgr.rbuild +++ b/reactos/base/applications/taskmgr/taskmgr.rbuild @@ -1,10 +1,9 @@ - + . 0x0501 0x0501 - msvcrt ntdll kernel32 advapi32 diff --git a/reactos/base/applications/wordpad/wordpad.rbuild b/reactos/base/applications/wordpad/wordpad.rbuild index 586227095c7..a06949b8db8 100644 --- a/reactos/base/applications/wordpad/wordpad.rbuild +++ b/reactos/base/applications/wordpad/wordpad.rbuild @@ -10,7 +10,6 @@ shell32 user32 gdi32 - msvcrt advapi32 kernel32 comctl32 diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index a40728bb76c..26ece1e3823 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -699,7 +699,7 @@ SetupStartPage(PINPUT_RECORD Ir) INFCONTEXT Context; PWCHAR Value; UINT ErrorLine; - SIZE_T ReturnSize; + ULONG ReturnSize; CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index c78597e9cd1..e4807836c19 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -906,7 +906,7 @@ CreatePartitionList (SHORT Left, OBJECT_ATTRIBUTES ObjectAttributes; SYSTEM_DEVICE_INFORMATION Sdi; IO_STATUS_BLOCK Iosb; - SIZE_T ReturnSize; + ULONG ReturnSize; NTSTATUS Status; ULONG DiskNumber; WCHAR Buffer[MAX_PATH]; diff --git a/reactos/base/setup/vmwinst/vmwinst.c b/reactos/base/setup/vmwinst/vmwinst.c index 0269195eeba..db1f63b49f6 100644 --- a/reactos/base/setup/vmwinst/vmwinst.c +++ b/reactos/base/setup/vmwinst/vmwinst.c @@ -503,7 +503,7 @@ done: } cleanup: - hThread = (HANDLE)InterlockedExchange((LONG*)&hInstallationThread, 0); + hThread = (HANDLE)(ULONG_PTR)InterlockedExchange((LONG*)&hInstallationThread, 0); if(hThread != NULL) { CloseHandle(hThread); diff --git a/reactos/base/shell/cmd/cmd.c b/reactos/base/shell/cmd/cmd.c index 84c1e959069..10e5b86e8d0 100644 --- a/reactos/base/shell/cmd/cmd.c +++ b/reactos/base/shell/cmd/cmd.c @@ -307,10 +307,10 @@ static BOOL RunFile(LPTSTR filename) ret = (hShExt)(NULL, _T("open"), filename, NULL, NULL, SW_SHOWNORMAL); - TRACE ("RunFile: ShellExecuteA/W returned %d\n", (DWORD)ret); + TRACE ("RunFile: ShellExecuteA/W returned %d\n", ret); FreeLibrary(hShell32); - return (((DWORD)ret) > 32); + return (PtrToUlong(ret) > 32); } From e4385a44a226378097b9286bc579e4dbaac4a15c Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 31 Aug 2008 03:16:59 +0000 Subject: [PATCH 219/388] minor fix. svn path=/branches/ros-amd64-bringup/; revision=35827 --- reactos/dll/win32/rpcrt4/cproxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/rpcrt4/cproxy.c b/reactos/dll/win32/rpcrt4/cproxy.c index 084285a5458..26e5c416c9c 100644 --- a/reactos/dll/win32/rpcrt4/cproxy.c +++ b/reactos/dll/win32/rpcrt4/cproxy.c @@ -56,7 +56,7 @@ typedef struct { static const IRpcProxyBufferVtbl StdProxy_Vtbl; -#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - FIELD_OFFSET(impl,field)) /* How the Windows stubless proxy thunks work is explained at * http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp, From f6f0710efcb2522800f973683a751d7c8065afec Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 31 Aug 2008 03:18:20 +0000 Subject: [PATCH 220/388] Minor WIN64 fixes. svn path=/branches/ros-amd64-bringup/; revision=35828 --- reactos/drivers/network/afd/afd/listen.c | 2 +- reactos/drivers/network/afd/afd/lock.c | 4 +-- reactos/drivers/network/afd/afd/main.c | 2 +- reactos/drivers/network/dd/pcnet/pcnet.c | 44 ++++++++++++------------ 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/reactos/drivers/network/afd/afd/listen.c b/reactos/drivers/network/afd/afd/listen.c index 63d4b359f30..b26f0936119 100644 --- a/reactos/drivers/network/afd/afd/listen.c +++ b/reactos/drivers/network/afd/afd/listen.c @@ -299,7 +299,7 @@ NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp, RemoveEntryList( PendingConn ); Status = ObReferenceObjectByHandle - ( (HANDLE)AcceptData->ListenHandle, + ( (HANDLE)(ULONG_PTR)AcceptData->ListenHandle, FILE_ALL_ACCESS, NULL, KernelMode, diff --git a/reactos/drivers/network/afd/afd/lock.c b/reactos/drivers/network/afd/afd/lock.c index 43f0633614c..da4a3e196c5 100644 --- a/reactos/drivers/network/afd/afd/lock.c +++ b/reactos/drivers/network/afd/afd/lock.c @@ -140,7 +140,7 @@ PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) { HandleArray[i].Events = HandleArray[i].Events; FileObjects[i].Handle = 0; Status = ObReferenceObjectByHandle - ( (PVOID)HandleArray[i].Handle, + ( (PVOID)(ULONG_PTR)HandleArray[i].Handle, FILE_ALL_ACCESS, NULL, KernelMode, @@ -156,7 +156,7 @@ VOID UnlockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) { for( i = 0; i < HandleCount; i++ ) { if( HandleArray[i].Handle ) - ObDereferenceObject( (PVOID)HandleArray[i].Handle ); + ObDereferenceObject( (PVOID)(ULONG_PTR)HandleArray[i].Handle ); } ExFreePool( HandleArray ); diff --git a/reactos/drivers/network/afd/afd/main.c b/reactos/drivers/network/afd/afd/main.c index a689ce56098..e1f41ae6f0e 100644 --- a/reactos/drivers/network/afd/afd/main.c +++ b/reactos/drivers/network/afd/afd/main.c @@ -30,7 +30,7 @@ void OskitDumpBuffer( PCHAR Data, UINT Len ) { for( i = 0; i < Len; i++ ) { if( i && !(i & 0xf) ) DbgPrint( "\n" ); - if( !(i & 0xf) ) DbgPrint( "%08x: ", (UINT)(Data + i) ); + if( !(i & 0xf) ) DbgPrint( "%08x: ", (UINT_PTR)(Data + i) ); DbgPrint( " %02x", Data[i] & 0xff ); } DbgPrint("\n"); diff --git a/reactos/drivers/network/dd/pcnet/pcnet.c b/reactos/drivers/network/dd/pcnet/pcnet.c index 6fde82e5da6..d0ccb0e9c85 100644 --- a/reactos/drivers/network/dd/pcnet/pcnet.c +++ b/reactos/drivers/network/dd/pcnet/pcnet.c @@ -137,7 +137,7 @@ MiniportHandleInterrupt( RtlZeroMemory(Descriptor, sizeof(RECEIVE_DESCRIPTOR)); Descriptor->RBADR = - (ULONG)(Adapter->ReceiveBufferPtrPhys + Adapter->CurrentReceiveDescriptorIndex * BUFFER_SIZE); + (ULONG_PTR)(Adapter->ReceiveBufferPtrPhys + Adapter->CurrentReceiveDescriptorIndex * BUFFER_SIZE); Descriptor->BCNT = (-BUFFER_SIZE) | 0xf000; Descriptor->FLAGS |= RD_OWN; @@ -323,14 +323,14 @@ MiAllocateSharedMemory( return NDIS_STATUS_RESOURCES; } - if(((ULONG)Adapter->InitializationBlockVirt & 0x00000003) != 0) + if(((ULONG_PTR)Adapter->InitializationBlockVirt & 0x00000003) != 0) { DPRINT("address 0x%x not dword-aligned\n", Adapter->InitializationBlockVirt); BREAKPOINT; return NDIS_STATUS_RESOURCES; } - Adapter->InitializationBlockPhys = (PINITIALIZATION_BLOCK)NdisGetPhysicalAddressLow(PhysicalAddress); + Adapter->InitializationBlockPhys = (PINITIALIZATION_BLOCK)(ptrdiff_t)NdisGetPhysicalAddressLow(PhysicalAddress); /* allocate the transport descriptor ring */ Adapter->TransmitDescriptorRingLength = sizeof(TRANSMIT_DESCRIPTOR) * NUMBER_OF_BUFFERS; @@ -343,14 +343,14 @@ MiAllocateSharedMemory( return NDIS_STATUS_RESOURCES; } - if(((ULONG)Adapter->TransmitDescriptorRingVirt & 0x00000003) != 0) + if(((ULONG_PTR)Adapter->TransmitDescriptorRingVirt & 0x00000003) != 0) { DPRINT("address 0x%x not dword-aligned\n", Adapter->TransmitDescriptorRingVirt); BREAKPOINT; return NDIS_STATUS_RESOURCES; } - Adapter->TransmitDescriptorRingPhys = (PTRANSMIT_DESCRIPTOR)NdisGetPhysicalAddressLow(PhysicalAddress); + Adapter->TransmitDescriptorRingPhys = (PTRANSMIT_DESCRIPTOR)(ptrdiff_t)NdisGetPhysicalAddressLow(PhysicalAddress); RtlZeroMemory(Adapter->TransmitDescriptorRingVirt, sizeof(TRANSMIT_DESCRIPTOR) * NUMBER_OF_BUFFERS); /* allocate the receive descriptor ring */ @@ -364,14 +364,14 @@ MiAllocateSharedMemory( return NDIS_STATUS_RESOURCES; } - if(((ULONG)Adapter->ReceiveDescriptorRingVirt & 0x00000003) != 0) + if(((ULONG_PTR)Adapter->ReceiveDescriptorRingVirt & 0x00000003) != 0) { DPRINT("address 0x%x not dword-aligned\n", Adapter->ReceiveDescriptorRingVirt); BREAKPOINT; return NDIS_STATUS_RESOURCES; } - Adapter->ReceiveDescriptorRingPhys = (PRECEIVE_DESCRIPTOR)NdisGetPhysicalAddressLow(PhysicalAddress); + Adapter->ReceiveDescriptorRingPhys = (PRECEIVE_DESCRIPTOR)(ptrdiff_t)NdisGetPhysicalAddressLow(PhysicalAddress); RtlZeroMemory(Adapter->ReceiveDescriptorRingVirt, sizeof(RECEIVE_DESCRIPTOR) * NUMBER_OF_BUFFERS); /* allocate transmit buffers */ @@ -385,14 +385,14 @@ MiAllocateSharedMemory( return NDIS_STATUS_RESOURCES; } - if(((ULONG)Adapter->TransmitBufferPtrVirt & 0x00000003) != 0) + if(((ULONG_PTR)Adapter->TransmitBufferPtrVirt & 0x00000003) != 0) { DPRINT("address 0x%x not dword-aligned\n", Adapter->TransmitBufferPtrVirt); BREAKPOINT; return NDIS_STATUS_RESOURCES; } - Adapter->TransmitBufferPtrPhys = (PCHAR)NdisGetPhysicalAddressLow(PhysicalAddress); + Adapter->TransmitBufferPtrPhys = (PCHAR)(ULONG_PTR)NdisGetPhysicalAddressLow(PhysicalAddress); RtlZeroMemory(Adapter->TransmitBufferPtrVirt, BUFFER_SIZE * NUMBER_OF_BUFFERS); /* allocate receive buffers */ @@ -406,21 +406,21 @@ MiAllocateSharedMemory( return NDIS_STATUS_RESOURCES; } - if(((ULONG)Adapter->ReceiveBufferPtrVirt & 0x00000003) != 0) + if(((ULONG_PTR)Adapter->ReceiveBufferPtrVirt & 0x00000003) != 0) { DPRINT("address 0x%x not dword-aligned\n", Adapter->ReceiveBufferPtrVirt); BREAKPOINT; return NDIS_STATUS_RESOURCES; } - Adapter->ReceiveBufferPtrPhys = (PCHAR)NdisGetPhysicalAddressLow(PhysicalAddress); + Adapter->ReceiveBufferPtrPhys = (PCHAR)(ULONG_PTR)NdisGetPhysicalAddressLow(PhysicalAddress); RtlZeroMemory(Adapter->ReceiveBufferPtrVirt, BUFFER_SIZE * NUMBER_OF_BUFFERS); /* initialize tx descriptors */ TransmitDescriptor = Adapter->TransmitDescriptorRingVirt; for(i = 0; i < NUMBER_OF_BUFFERS; i++) { - (TransmitDescriptor+i)->TBADR = (ULONG)Adapter->TransmitBufferPtrPhys + i * BUFFER_SIZE; + (TransmitDescriptor+i)->TBADR = (ULONG_PTR)Adapter->TransmitBufferPtrPhys + i * BUFFER_SIZE; (TransmitDescriptor+i)->BCNT = 0xf000 | -BUFFER_SIZE; /* 2's compliment + set top 4 bits */ (TransmitDescriptor+i)->FLAGS = TD1_STP | TD1_ENP; } @@ -431,7 +431,7 @@ MiAllocateSharedMemory( ReceiveDescriptor = Adapter->ReceiveDescriptorRingVirt; for(i = 0; i < NUMBER_OF_BUFFERS; i++) { - (ReceiveDescriptor+i)->RBADR = (ULONG)Adapter->ReceiveBufferPtrPhys + i * BUFFER_SIZE; + (ReceiveDescriptor+i)->RBADR = (ULONG_PTR)Adapter->ReceiveBufferPtrPhys + i * BUFFER_SIZE; (ReceiveDescriptor+i)->BCNT = 0xf000 | -BUFFER_SIZE; /* 2's compliment + set top 4 bits */ (ReceiveDescriptor+i)->FLAGS = RD_OWN; } @@ -467,12 +467,12 @@ MiPrepareInitializationBlock( /* set up receive ring */ DPRINT("Receive ring physical address: 0x%x\n", Adapter->ReceiveDescriptorRingPhys); - Adapter->InitializationBlockVirt->RDRA = (ULONG)Adapter->ReceiveDescriptorRingPhys; + Adapter->InitializationBlockVirt->RDRA = (ULONG_PTR)Adapter->ReceiveDescriptorRingPhys; Adapter->InitializationBlockVirt->RLEN = (LOG_NUMBER_OF_BUFFERS << 4) & 0xf0; /* set up transmit ring */ DPRINT("Transmit ring physical address: 0x%x\n", Adapter->TransmitDescriptorRingPhys); - Adapter->InitializationBlockVirt->TDRA = (ULONG)Adapter->TransmitDescriptorRingPhys; + Adapter->InitializationBlockVirt->TDRA = (ULONG_PTR)Adapter->TransmitDescriptorRingPhys; Adapter->InitializationBlockVirt->TLEN = (LOG_NUMBER_OF_BUFFERS << 4) & 0xf0; } @@ -491,35 +491,35 @@ MiFreeSharedMemory( if(Adapter->InitializationBlockVirt) { - PhysicalAddress.u.LowPart = (ULONG)Adapter->InitializationBlockPhys; + PhysicalAddress.u.LowPart = (ULONG_PTR)Adapter->InitializationBlockPhys; NdisMFreeSharedMemory(Adapter->MiniportAdapterHandle, Adapter->InitializationBlockLength, FALSE, Adapter->InitializationBlockVirt, PhysicalAddress); } if(Adapter->TransmitDescriptorRingVirt) { - PhysicalAddress.u.LowPart = (ULONG)Adapter->TransmitDescriptorRingPhys; + PhysicalAddress.u.LowPart = (ULONG_PTR)Adapter->TransmitDescriptorRingPhys; NdisMFreeSharedMemory(Adapter->MiniportAdapterHandle, Adapter->TransmitDescriptorRingLength, FALSE, Adapter->TransmitDescriptorRingVirt, PhysicalAddress); } if(Adapter->ReceiveDescriptorRingVirt) { - PhysicalAddress.u.LowPart = (ULONG)Adapter->ReceiveDescriptorRingPhys; + PhysicalAddress.u.LowPart = (ULONG_PTR)Adapter->ReceiveDescriptorRingPhys; NdisMFreeSharedMemory(Adapter->MiniportAdapterHandle, Adapter->ReceiveDescriptorRingLength, FALSE, Adapter->ReceiveDescriptorRingVirt, PhysicalAddress); } if(Adapter->TransmitBufferPtrVirt) { - PhysicalAddress.u.LowPart = (ULONG)Adapter->TransmitBufferPtrPhys; + PhysicalAddress.u.LowPart = (ULONG_PTR)Adapter->TransmitBufferPtrPhys; NdisMFreeSharedMemory(Adapter->MiniportAdapterHandle, Adapter->TransmitBufferLength, FALSE, Adapter->TransmitBufferPtrVirt, PhysicalAddress); } if(Adapter->ReceiveBufferPtrVirt) { - PhysicalAddress.u.LowPart = (ULONG)Adapter->ReceiveBufferPtrPhys; + PhysicalAddress.u.LowPart = (ULONG_PTR)Adapter->ReceiveBufferPtrPhys; NdisMFreeSharedMemory(Adapter->MiniportAdapterHandle, Adapter->ReceiveBufferLength, FALSE, Adapter->ReceiveBufferPtrVirt, PhysicalAddress); } @@ -693,9 +693,9 @@ MiInitChip( /* set up csr1 and csr2 with init block */ NdisRawWritePortUshort(Adapter->PortOffset + RAP, CSR1); - NdisRawWritePortUshort(Adapter->PortOffset + RDP, (USHORT)((ULONG)Adapter->InitializationBlockPhys & 0xffff)); + NdisRawWritePortUshort(Adapter->PortOffset + RDP, (USHORT)((ULONG_PTR)Adapter->InitializationBlockPhys & 0xffff)); NdisRawWritePortUshort(Adapter->PortOffset + RAP, CSR2); - NdisRawWritePortUshort(Adapter->PortOffset + RDP, (USHORT)((ULONG)Adapter->InitializationBlockPhys >> 16) & 0xffff); + NdisRawWritePortUshort(Adapter->PortOffset + RDP, (USHORT)((ULONG_PTR)Adapter->InitializationBlockPhys >> 16) & 0xffff); DPRINT("programmed with init block\n"); From d3e4ae4056078dd9b7f96026ebcd80c487ebb123 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 31 Aug 2008 03:22:13 +0000 Subject: [PATCH 221/388] Make crt call win32 time APIs, like WINE svn path=/branches/ros-amd64-bringup/; revision=35829 --- reactos/lib/sdk/crt/time/strdate.c | 18 ++++++------------ reactos/lib/sdk/crt/time/strtime.c | 17 +++++------------ reactos/lib/sdk/crt/time/wstrdate.c | 18 ++++++------------ reactos/lib/sdk/crt/time/wstrtime.c | 17 +++++------------ 4 files changed, 22 insertions(+), 48 deletions(-) diff --git a/reactos/lib/sdk/crt/time/strdate.c b/reactos/lib/sdk/crt/time/strdate.c index fc03ad9ec05..22c188f9ccf 100644 --- a/reactos/lib/sdk/crt/time/strdate.c +++ b/reactos/lib/sdk/crt/time/strdate.c @@ -12,18 +12,12 @@ /* * @implemented */ -char* _strdate(char* datestr) +char* _strdate(char* date) { - time_t t; - struct tm* d; - char* dt = (char*)datestr; + static const char format[] = "MM'/'dd'/'yy"; + + GetDateFormatA(LOCALE_NEUTRAL, 0, NULL, format, date, 9); + + return date; - if (datestr == NULL) { - __set_errno(EINVAL); - return NULL; - } - t = time(NULL); - d = localtime(&t); - sprintf(dt,"%d/%d/%d",d->tm_mday,d->tm_mon+1,d->tm_year); - return dt; } diff --git a/reactos/lib/sdk/crt/time/strtime.c b/reactos/lib/sdk/crt/time/strtime.c index 8d0e87ac839..d6e10687152 100644 --- a/reactos/lib/sdk/crt/time/strtime.c +++ b/reactos/lib/sdk/crt/time/strtime.c @@ -12,18 +12,11 @@ /* * @implemented */ -char* _strtime(char* buf) +char* _strtime(char* time) { - time_t t; - struct tm *d; - char* dt = (char*)buf; + static const char format[] = "HH':'mm':'ss"; - if ( buf == NULL ) { - __set_errno(EINVAL); - return NULL; - } - t = time(NULL); - d = localtime(&t); - sprintf(dt,"%d:%d:%d",d->tm_hour,d->tm_min,d->tm_sec); - return dt; + GetTimeFormatA(LOCALE_NEUTRAL, 0, NULL, format, time, 9); + + return time; } diff --git a/reactos/lib/sdk/crt/time/wstrdate.c b/reactos/lib/sdk/crt/time/wstrdate.c index 559385b7c5b..a19e3b9d5d2 100644 --- a/reactos/lib/sdk/crt/time/wstrdate.c +++ b/reactos/lib/sdk/crt/time/wstrdate.c @@ -12,18 +12,12 @@ /* * @implemented */ -wchar_t* _wstrdate(wchar_t* datestr) +wchar_t* _wstrdate(wchar_t* date) { - time_t t; - struct tm* d; - wchar_t* dt = (wchar_t*)datestr; + static const WCHAR format[] = { 'M','M','\'','/','\'','d','d','\'','/','\'','y','y',0 }; + + GetDateFormatW(LOCALE_NEUTRAL, 0, NULL, format, (LPWSTR)date, 9); + + return date; - if (datestr == NULL) { - __set_errno(EINVAL); - return NULL; - } - t = time(NULL); - d = localtime(&t); - swprintf(dt,L"%d/%d/%d",d->tm_mday,d->tm_mon+1,d->tm_year); - return dt; } diff --git a/reactos/lib/sdk/crt/time/wstrtime.c b/reactos/lib/sdk/crt/time/wstrtime.c index fc78a593242..bc8f5bb3d50 100644 --- a/reactos/lib/sdk/crt/time/wstrtime.c +++ b/reactos/lib/sdk/crt/time/wstrtime.c @@ -12,18 +12,11 @@ /* * @implemented */ -wchar_t* _wstrtime(wchar_t* buf) +wchar_t* _wstrtime(wchar_t* time) { - time_t t; - struct tm* d; - wchar_t* dt = (wchar_t*)buf; + static const WCHAR format[] = { 'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0 }; - if ( buf == NULL ) { - __set_errno(EINVAL); - return NULL; - } - t = time(NULL); - d = localtime(&t); - swprintf(dt,L"%d:%d:%d",d->tm_hour,d->tm_min,d->tm_sec); - return dt; + GetTimeFormatW(LOCALE_NEUTRAL, 0, NULL, format, (LPWSTR)time, 9); + + return time; } From 389c0e65da470ac91068a5a99a608b322ec60605 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 2 Sep 2008 15:03:53 +0000 Subject: [PATCH 222/388] Copied remotely svn path=/branches/ros-amd64-bringup/; revision=35885 --- reactos/include/crt/tchar.h | 410 ++++++++++++++++++++++++++++++++++++ 1 file changed, 410 insertions(+) create mode 100644 reactos/include/crt/tchar.h diff --git a/reactos/include/crt/tchar.h b/reactos/include/crt/tchar.h new file mode 100644 index 00000000000..d0dd45f9ba0 --- /dev/null +++ b/reactos/include/crt/tchar.h @@ -0,0 +1,410 @@ + +#ifndef _TCHAR_H_ +#define _TCHAR_H_ + +#include + +#ifdef _UNICODE + + #define __T(q) L##q + + #ifndef _TCHAR_DEFINED + #ifndef RC_INVOKED + typedef wchar_t TCHAR; + typedef wchar_t _TCHAR; + #endif /* Not RC_INVOKED */ + #define _TCHAR_DEFINED + #endif + + #define _TINT wint_t + #define _TSCHAR wchar_t + #define _TUCHAR wchar_t + #define _TXCHAR wchar_t + #define _TEOF WEOF + #define _tenviron _wenviron + #define _tfinddata_t _wfinddata_t + + /* dirent structures and functions */ + #define _tdirent _wdirent + #define _TDIR _WDIR + #define _topendir _wopendir + #define _tclosedir _wclosedir + #define _treaddir _wreaddir + #define _trewinddir _wrewinddir + #define _ttelldir _wtelldir + #define _tseekdir _wseekdir + + #define _ttoi64 _wtoi64 + #define _i64tot _i64tow + #define _ui64tot _ui64tow + #define _tcsnccoll _wstrncoll + #define _tcsncoll _wstrncoll + #define _tcsncicoll _wstrnicoll + #define _tfindfirsti64 _wfindfirsti64 + #define _tfindnexti64 _wfindnexti64 + #define _tfinddatai64_t _wfinddatai64_t + + #define _tunlink _wunlink + #define _tgetdcwd _wgetdcwd + + #define _fgettc fgetwc + #define _fgettchar _fgetwchar + #define _fgetts fgetws + #define _fputtc fputwc + #define _fputtchar _fputwchar + #define _fputts fputws + #define _ftprintf fwprintf + #define _ftscanf fwscanf + #define _gettc getwc + #define _gettchar getwchar + #define _getts getws + #define _istalnum iswalnum + #define _istalpha iswalpha + #define _istascii iswascii + #define _istcntrl iswcntrl + #define _istdigit iswdigit + #define _istgraph iswgraph + #define _istlead(c) 0 + #define _istleadbyte(c) 0 + #define _istlegal(c) 1 + #define _istlower iswlower + #define _istprint iswprint + #define _istpunct iswpunct + #define _istspace iswspace + #define _istupper iswupper + #define _istxdigit iswxdigit + #define _itot _itow + #define _ltot _ltow + #define _puttc putwc + #define _puttchar putwchar + #define _putts putws + #define _tmain wmain + #define _sntprintf _snwprintf + #define _stprintf swprintf + #define _stscanf swscanf + #define _taccess _waccess + #define _tasctime _wasctime + #define _tccpy(d,s) (*(d)=*(s)) + #define _tchdir _wchdir + #define _tclen(c) 2 + #define _tchmod _wchmod + #define _tcreat _wcreat + #define _tcscat wcscat + #define _tcschr wcschr + #define _tcsclen wcslen + #define _tcscmp wcscmp + #define _tcscoll wcscoll + #define _tcscpy wcscpy + #define _tcscspn wcscspn + #define _tcsdec _wcsdec + #define _tcsdup _wcsdup + #define _tcsftime wcsftime + #define _tcsicmp _wcsicmp + #define _tcsicoll _wcsicoll + #define _tcsinc _wcsinc + #define _tcslen wcslen + #define _tcslwr _wcslwr + #define _tcsnbcnt _wcnscnt + #define _tcsncat wcsncat + #define _tcsnccat wcsncat + #define _tcsncmp wcsncmp + #define _tcsnccmp wcsncmp + #define _tcsnccnt _wcsncnt + #define _tcsnccpy wcsncpy + #define _tcsncicmp _wcsnicmp + #define _tcsncpy wcsncpy + #define _tcsncset _wcsnset + #define _tcsnextc _wcsnextc + #define _tcsnicmp _wcsnicmp + #define _tcsnicoll _wcsnicoll + #define _tcsninc _wcsninc + #define _tcsnccnt _wcsncnt + #define _tcsnset _wcsnset + #define _tcspbrk wcspbrk + #define _tcsspnp _wcsspnp + #define _tcsrchr wcsrchr + #define _tcsrev _wcsrev + #define _tcsset _wcsset + #define _tcsspn wcsspn + #define _tcsstr wcsstr + #define _tcstod wcstod + #define _tcstok wcstok + #define _tcstol wcstol + #define _tcstoul wcstoul + #define _tcsupr _wcsupr + #define _tcsxfrm wcsxfrm + #define _tctime _wctime + #define _texecl _wexecl + #define _texecle _wexecle + #define _texeclp _wexeclp + #define _texeclpe _wexeclpe + #define _texecv _wexecv + #define _texecve _wexecve + #define _texecvp _wexecvp + #define _texecvpe _wexecvpe + #define _tfdopen _wfdopen + #define _tfindfirst _wfindfirst + #define _tfindnext _wfindnext + #define _tfopen _wfopen + #define _tfreopen _wfreopen + #define _tfsopen _wfsopen + #define _tfullpath _wfullpath + #define _tgetcwd _wgetcwd + #define _tgetenv _wgetenv + #define _tmain wmain + #define _tmakepath _wmakepath + #define _tmkdir _wmkdir + #define _tmktemp _wmktemp + #define _tperror _wperror + #define _topen _wopen + #define _totlower towlower + #define _totupper towupper + #define _tpopen _wpopen + #define _tprintf wprintf + #define _tremove _wremove + #define _trename _wrename + #define _trmdir _wrmdir + #define _tsearchenv _wsearchenv + #define _tscanf wscanf + #define _tsetlocale _wsetlocale + #define _tsopen _wsopen + #define _tspawnl _wspawnl + #define _tspawnle _wspawnle + #define _tspawnlp _wspawnlp + #define _tspawnlpe _wspawnlpe + #define _tspawnv _wspawnv + #define _tspawnve _wspawnve + #define _tspawnvp _wspawnvp + #define _tspawnvpe _wspawnvpe + #define _tsplitpath _wsplitpath + #define _tstat _wstat + #define _tstrdate _wstrdate + #define _tstrtime _wstrtime + #define _tsystem _wsystem + #define _ttempnam _wtempnam + #define _ttmpnam _wtmpnam + #define _ttoi _wtoi + #define _ttol _wtol + #define _tutime _wutime + #define _tWinMain wWinMain + #define _ultot _ultow + #define _ungettc ungetwc + #define _vftprintf vfwprintf + #define _vsntprintf _vsnwprintf + #define _vstprintf vswprintf + #define _vtprintf vwprintf + + #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1) + #define _wcsinc(_wcs) ((_wcs)+1) + #define _wcsnextc(_wcs) ((unsigned int) *(_wcs)) + #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc))) + #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs)) + #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL) + +#else + + #define __T(q) q + + #ifndef _TCHAR_DEFINED + #ifndef RC_INVOKED + typedef char TCHAR; + typedef char _TCHAR; + #endif + #define _TCHAR_DEFINED + #endif + + #define _TINT int + #define _TSCHAR signed char + #define _TUCHAR unsigned char + #define _TXCHAR char + #define _TEOF EOF + #define _tenviron _environ + #define _tfinddata_t _finddata_t + + /* dirent structures and functions */ + #define _tdirent dirent + #define _TDIR DIR + #define _topendir opendir + #define _tclosedir closedir + #define _treaddir readdir + #define _trewinddir rewinddir + #define _ttelldir telldir + #define _tseekdir seekdir + + #define _ttoi64 _atoi64 + #define _i64tot _i64toa + #define _ui64tot _ui64toa + #define _tcsnccoll _strncoll + #define _tcsncoll _strncoll + #define _tcsncicoll _strnicoll + #define _tfindfirsti64 _findfirsti64 + #define _tfindnexti64 _findnexti64 + #define _tfinddatai64_t _finddatai64_t + + #define _tunlink _unlink + #define _tgetdcwd _getdcwd + + #define _fgettc fgetc + #define _fgettchar fgetchar + #define _fgetts fgets + #define _fputtc fputc + #define _fputtchar fputchar + #define _fputts fputs + #define _ftprintf fprintf + #define _ftscanf fscanf + #define _gettc getc + #define _gettchar getchar + #define _getts gets + #define _istalnum isalnum + #define _istalpha isalpha + #define _istascii __isascii + #define _istcntrl iscntrl + #define _istdigit isdigit + #define _istgraph isgraph + #define _istlead(c) 0 + #define _istleadbyte(c) 0 + #define _istlegal(c) 1 + #define _istlower islower + #define _istprint isprint + #define _istpunct ispunct + #define _istspace isspace + #define _istupper isupper + #define _istxdigit isxdigit + #define _itot _itoa + #define _ltot _ltoa + #define _puttc putc + #define _puttchar putchar + #define _putts puts + #define _tmain main + #define _sntprintf _snprintf + #define _stprintf sprintf + #define _stscanf sscanf + #define _taccess _access + #define _tasctime asctime + #define _tccpy(d,s) (*(d)=*(s)) + #define _tchdir _chdir + #define _tclen(c) 1 + #define _tchmod _chmod + #define _tcreat _creat + #define _tcscat strcat + #define _tcschr strchr + #define _tcsclen strlen + #define _tcscmp strcmp + #define _tcscoll strcoll + #define _tcscpy strcpy + #define _tcscspn strcspn + #define _tcsdec _strdec + #define _tcsdup _strdup + #define _tcsftime strftime + #define _tcsicmp _stricmp + #define _tcsicoll _stricoll + #define _tcsinc _strinc + #define _tcslen strlen + #define _tcslwr _strlwr + #define _tcsnbcnt _strncnt + #define _tcsncat strncat + #define _tcsnccat strncat + #define _tcsncmp strncmp + #define _tcsnccmp strncmp + #define _tcsnccnt _strncnt + #define _tcsnccpy strncpy + #define _tcsncicmp _strnicmp + #define _tcsncpy strncpy + #define _tcsncset _strnset + #define _tcsnextc _strnextc + #define _tcsnicmp _strnicmp + #define _tcsnicoll _strnicoll + #define _tcsninc _strninc + #define _tcsnccnt _strncnt + #define _tcsnset _strnset + #define _tcspbrk strpbrk + #define _tcsspnp _strspnp + #define _tcsrchr strrchr + #define _tcsrev _strrev + #define _tcsset _strset + #define _tcsspn strspn + #define _tcsstr strstr + #define _tcstod strtod + #define _tcstok strtok + #define _tcstol strtol + #define _tcstoul strtoul + #define _tcsupr _strupr + #define _tcsxfrm strxfrm + #define _tctime ctime + #define _texecl _execl + #define _texecle _execle + #define _texeclp _execlp + #define _texeclpe _execlpe + #define _texecv _execv + #define _texecve _execve + #define _texecvp _execvp + #define _texecvpe _execvpe + #define _tfdopen _fdopen + #define _tfindfirst _findfirst + #define _tfindnext _findnext + #define _tfopen fopen + #define _tfreopen freopen + #define _tfsopen _fsopen + #define _tfullpath _fullpath + #define _tgetcwd _getcwd + #define _tgetenv getenv + #define _tmain main + #define _tmakepath _makepath + #define _tmkdir _mkdir + #define _tmktemp _mktemp + #define _tperror perror + #define _topen _open + #define _totlower tolower + #define _totupper toupper + #define _tpopen _popen + #define _tprintf printf + #define _tremove remove + #define _trename rename + #define _trmdir _rmdir + #define _tsearchenv _searchenv + #define _tscanf scanf + #define _tsetlocale setlocale + #define _tsopen _sopen + #define _tspawnl _spawnl + #define _tspawnle _spawnle + #define _tspawnlp _spawnlp + #define _tspawnlpe _spawnlpe + #define _tspawnv _spawnv + #define _tspawnve _spawnve + #define _tspawnvp _spawnvp + #define _tspawnvpe _spawnvpe + #define _tsplitpath _splitpath + #define _tstat _stat + #define _tstrdate _strdate + #define _tstrtime _strtime + #define _tsystem system + #define _ttempnam _tempnam + #define _ttmpnam tmpnam + #define _ttoi atoi + #define _ttol atol + #define _tutime _utime + #define _tWinMain WinMain + #define _ultot _ultoa + #define _ungettc ungetc + #define _vftprintf vfprintf + #define _vsntprintf _vsnprintf + #define _vstprintf vsprintf + #define _vtprintf vprintf + + #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1) + #define _strinc(_str) ((_str)+1) + #define _strnextc(_str) ((unsigned int) *(_str)) + #define _strninc(_str, _inc) (((_str)+(_inc))) + #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str)) + #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL) + +#endif + + + + +#define _TEXT(x) __T(x) +#define _T(x) __T(x) + +#endif /* _TCHAR_H_ */ + From 99fdc570b821a4f60b6e733c1a3e63ee01e69995 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 2 Sep 2008 15:09:01 +0000 Subject: [PATCH 223/388] Moved tchar.h out of psdk/ Update tchar.h to mingw-w64 version. Protect WCHAR_MAX from redefine warning svn path=/branches/ros-amd64-bringup/; revision=35887 --- reactos/include/crt/tchar.h | 1468 +++++++++++++++++++++++++--------- reactos/include/crt/wchar.h | 6 +- reactos/include/psdk/tchar.h | 410 ---------- 3 files changed, 1085 insertions(+), 799 deletions(-) delete mode 100644 reactos/include/psdk/tchar.h diff --git a/reactos/include/crt/tchar.h b/reactos/include/crt/tchar.h index d0dd45f9ba0..cd44beca154 100644 --- a/reactos/include/crt/tchar.h +++ b/reactos/include/crt/tchar.h @@ -1,410 +1,1102 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ +#include <_mingw.h> -#ifndef _TCHAR_H_ -#define _TCHAR_H_ +#ifndef _INC_TCHAR +#define _INC_TCHAR -#include +#ifdef _STRSAFE_H_INCLUDED_ +#error Need to include strsafe.h after tchar.h +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define _ftcscat _tcscat +#define _ftcschr _tcschr +#define _ftcscpy _tcscpy +#define _ftcscspn _tcscspn +#define _ftcslen _tcslen +#define _ftcsncat _tcsncat +#define _ftcsncpy _tcsncpy +#define _ftcspbrk _tcspbrk +#define _ftcsrchr _tcsrchr +#define _ftcsspn _tcsspn +#define _ftcsstr _tcsstr +#define _ftcstok _tcstok + +#define _ftcsdup _tcsdup +#define _ftcsnset _tcsnset +#define _ftcsrev _tcsrev +#define _ftcsset _tcsset + +#define _ftcscmp _tcscmp +#define _ftcsicmp _tcsicmp +#define _ftcsnccmp _tcsnccmp +#define _ftcsncmp _tcsncmp +#define _ftcsncicmp _tcsncicmp +#define _ftcsnicmp _tcsnicmp + +#define _ftcscoll _tcscoll +#define _ftcsicoll _tcsicoll +#define _ftcsnccoll _tcsnccoll +#define _ftcsncoll _tcsncoll +#define _ftcsncicoll _tcsncicoll +#define _ftcsnicoll _tcsnicoll + +#define _ftcsclen _tcsclen +#define _ftcsnccat _tcsnccat +#define _ftcsnccpy _tcsnccpy +#define _ftcsncset _tcsncset + +#define _ftcsdec _tcsdec +#define _ftcsinc _tcsinc +#define _ftcsnbcnt _tcsnbcnt +#define _ftcsnccnt _tcsnccnt +#define _ftcsnextc _tcsnextc +#define _ftcsninc _tcsninc +#define _ftcsspnp _tcsspnp + +#define _ftcslwr _tcslwr +#define _ftcsupr _tcsupr + +#define _ftclen _tclen +#define _ftccpy _tccpy +#define _ftccmp _tccmp + +#ifndef _CONST_RETURN +#ifdef __cplusplus +#define _CONST_RETURN const +#define _CRT_CONST_CORRECT_OVERLOADS +#else +#define _CONST_RETURN +#endif +#endif + +#define _WConst_return _CONST_RETURN #ifdef _UNICODE - #define __T(q) L##q +#ifdef __cplusplus +} +#endif - #ifndef _TCHAR_DEFINED - #ifndef RC_INVOKED - typedef wchar_t TCHAR; - typedef wchar_t _TCHAR; - #endif /* Not RC_INVOKED */ - #define _TCHAR_DEFINED - #endif +#include - #define _TINT wint_t - #define _TSCHAR wchar_t - #define _TUCHAR wchar_t - #define _TXCHAR wchar_t - #define _TEOF WEOF - #define _tenviron _wenviron - #define _tfinddata_t _wfinddata_t +#ifdef __cplusplus +extern "C" { +#endif - /* dirent structures and functions */ - #define _tdirent _wdirent - #define _TDIR _WDIR - #define _topendir _wopendir - #define _tclosedir _wclosedir - #define _treaddir _wreaddir - #define _trewinddir _wrewinddir - #define _ttelldir _wtelldir - #define _tseekdir _wseekdir +#ifndef _WCTYPE_T_DEFINED +#define _WCTYPE_T_DEFINED + typedef unsigned short wint_t; + typedef unsigned short wctype_t; +#endif - #define _ttoi64 _wtoi64 - #define _i64tot _i64tow - #define _ui64tot _ui64tow - #define _tcsnccoll _wstrncoll - #define _tcsncoll _wstrncoll - #define _tcsncicoll _wstrnicoll - #define _tfindfirsti64 _wfindfirsti64 - #define _tfindnexti64 _wfindnexti64 - #define _tfinddatai64_t _wfinddatai64_t +#ifndef __TCHAR_DEFINED +#define __TCHAR_DEFINED + typedef wchar_t _TCHAR; + typedef wchar_t _TSCHAR; + typedef wchar_t _TUCHAR; + typedef wchar_t _TXCHAR; + typedef wint_t _TINT; +#endif - #define _tunlink _wunlink - #define _tgetdcwd _wgetdcwd +#ifndef _TCHAR_DEFINED +#define _TCHAR_DEFINED +#ifndef NO_OLDNAMES + typedef wchar_t TCHAR; +#endif +#endif - #define _fgettc fgetwc - #define _fgettchar _fgetwchar - #define _fgetts fgetws - #define _fputtc fputwc - #define _fputtchar _fputwchar - #define _fputts fputws - #define _ftprintf fwprintf - #define _ftscanf fwscanf - #define _gettc getwc - #define _gettchar getwchar - #define _getts getws - #define _istalnum iswalnum - #define _istalpha iswalpha - #define _istascii iswascii - #define _istcntrl iswcntrl - #define _istdigit iswdigit - #define _istgraph iswgraph - #define _istlead(c) 0 - #define _istleadbyte(c) 0 - #define _istlegal(c) 1 - #define _istlower iswlower - #define _istprint iswprint - #define _istpunct iswpunct - #define _istspace iswspace - #define _istupper iswupper - #define _istxdigit iswxdigit - #define _itot _itow - #define _ltot _ltow - #define _puttc putwc - #define _puttchar putwchar - #define _putts putws - #define _tmain wmain - #define _sntprintf _snwprintf - #define _stprintf swprintf - #define _stscanf swscanf - #define _taccess _waccess - #define _tasctime _wasctime - #define _tccpy(d,s) (*(d)=*(s)) - #define _tchdir _wchdir - #define _tclen(c) 2 - #define _tchmod _wchmod - #define _tcreat _wcreat - #define _tcscat wcscat - #define _tcschr wcschr - #define _tcsclen wcslen - #define _tcscmp wcscmp - #define _tcscoll wcscoll - #define _tcscpy wcscpy - #define _tcscspn wcscspn - #define _tcsdec _wcsdec - #define _tcsdup _wcsdup - #define _tcsftime wcsftime - #define _tcsicmp _wcsicmp - #define _tcsicoll _wcsicoll - #define _tcsinc _wcsinc - #define _tcslen wcslen - #define _tcslwr _wcslwr - #define _tcsnbcnt _wcnscnt - #define _tcsncat wcsncat - #define _tcsnccat wcsncat - #define _tcsncmp wcsncmp - #define _tcsnccmp wcsncmp - #define _tcsnccnt _wcsncnt - #define _tcsnccpy wcsncpy - #define _tcsncicmp _wcsnicmp - #define _tcsncpy wcsncpy - #define _tcsncset _wcsnset - #define _tcsnextc _wcsnextc - #define _tcsnicmp _wcsnicmp - #define _tcsnicoll _wcsnicoll - #define _tcsninc _wcsninc - #define _tcsnccnt _wcsncnt - #define _tcsnset _wcsnset - #define _tcspbrk wcspbrk - #define _tcsspnp _wcsspnp - #define _tcsrchr wcsrchr - #define _tcsrev _wcsrev - #define _tcsset _wcsset - #define _tcsspn wcsspn - #define _tcsstr wcsstr - #define _tcstod wcstod - #define _tcstok wcstok - #define _tcstol wcstol - #define _tcstoul wcstoul - #define _tcsupr _wcsupr - #define _tcsxfrm wcsxfrm - #define _tctime _wctime - #define _texecl _wexecl - #define _texecle _wexecle - #define _texeclp _wexeclp - #define _texeclpe _wexeclpe - #define _texecv _wexecv - #define _texecve _wexecve - #define _texecvp _wexecvp - #define _texecvpe _wexecvpe - #define _tfdopen _wfdopen - #define _tfindfirst _wfindfirst - #define _tfindnext _wfindnext - #define _tfopen _wfopen - #define _tfreopen _wfreopen - #define _tfsopen _wfsopen - #define _tfullpath _wfullpath - #define _tgetcwd _wgetcwd - #define _tgetenv _wgetenv - #define _tmain wmain - #define _tmakepath _wmakepath - #define _tmkdir _wmkdir - #define _tmktemp _wmktemp - #define _tperror _wperror - #define _topen _wopen - #define _totlower towlower - #define _totupper towupper - #define _tpopen _wpopen - #define _tprintf wprintf - #define _tremove _wremove - #define _trename _wrename - #define _trmdir _wrmdir - #define _tsearchenv _wsearchenv - #define _tscanf wscanf - #define _tsetlocale _wsetlocale - #define _tsopen _wsopen - #define _tspawnl _wspawnl - #define _tspawnle _wspawnle - #define _tspawnlp _wspawnlp - #define _tspawnlpe _wspawnlpe - #define _tspawnv _wspawnv - #define _tspawnve _wspawnve - #define _tspawnvp _wspawnvp - #define _tspawnvpe _wspawnvpe - #define _tsplitpath _wsplitpath - #define _tstat _wstat - #define _tstrdate _wstrdate - #define _tstrtime _wstrtime - #define _tsystem _wsystem - #define _ttempnam _wtempnam - #define _ttmpnam _wtmpnam - #define _ttoi _wtoi - #define _ttol _wtol - #define _tutime _wutime - #define _tWinMain wWinMain - #define _ultot _ultow - #define _ungettc ungetwc - #define _vftprintf vfwprintf - #define _vsntprintf _vsnwprintf - #define _vstprintf vswprintf - #define _vtprintf vwprintf +#define _TEOF WEOF - #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1) - #define _wcsinc(_wcs) ((_wcs)+1) - #define _wcsnextc(_wcs) ((unsigned int) *(_wcs)) - #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc))) - #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs)) - #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL) +#define __T(x) L##x + +#define _tmain wmain +#define _tWinMain wWinMain +#define _tenviron _wenviron +#define __targv __wargv + +#define _tprintf wprintf +#define _tprintf_l _wprintf_l +#define _tprintf_p _wprintf_p +#define _tprintf_p_l _wprintf_p_l +#define _tcprintf _cwprintf +#define _tcprintf_l _cwprintf_l +#define _tcprintf_p _cwprintf_p +#define _tcprintf_p_l _cwprintf_p_l +#define _vtcprintf _vcwprintf +#define _vtcprintf_l _vcwprintf_l +#define _vtcprintf_p _vcwprintf_p +#define _vtcprintf_p_l _vcwprintf_p_l +#define _ftprintf fwprintf +#define _ftprintf_l _fwprintf_l +#define _ftprintf_p _fwprintf_p +#define _ftprintf_p_l _fwprintf_p_l +#define _stprintf swprintf +#define _stprintf_l __swprintf_l +#define _stprintf_p _swprintf_p +#define _stprintf_p_l _swprintf_p_l +#define _sctprintf _scwprintf +#define _sctprintf_l _scwprintf_l +#define _sctprintf_p _scwprintf_p +#define _sctprintf_p_l _scwprintf_p_l +#define _sntprintf _snwprintf +#define _sntprintf_l _snwprintf_l +#define _vtprintf vwprintf +#define _vtprintf_l _vwprintf_l +#define _vtprintf_p _vwprintf_p +#define _vtprintf_p_l _vwprintf_p_l +#define _vftprintf vfwprintf +#define _vftprintf_l _vfwprintf_l +#define _vftprintf_p _vfwprintf_p +#define _vftprintf_p_l _vfwprintf_p_l +#define _vstprintf vswprintf +#define _vstprintf_l _vswprintf_l +#define _vstprintf_p _vswprintf_p +#define _vstprintf_p_l _vswprintf_p_l +#define _vsctprintf _vscwprintf +#define _vsctprintf_l _vscwprintf_l +#define _vsctprintf_p _vscwprintf_p +#define _vsctprintf_p_l _vscwprintf_p_l +#define _vsntprintf _vsnwprintf +#define _vsntprintf_l _vsnwprintf_l + +#define _tscanf wscanf +#define _tscanf_l _wscanf_l +#define _tcscanf _cwscanf +#define _tcscanf_l _cwscanf_l +#define _ftscanf fwscanf +#define _ftscanf_l _fwscanf_l +#define _stscanf swscanf +#define _stscanf_l _swscanf_l +#define _sntscanf _snwscanf +#define _sntscanf_l _snwscanf_l + +#define _fgettc fgetwc +#define _fgettc_nolock _fgetwc_nolock +#define _fgettchar _fgetwchar +#define _fgetts fgetws +#define _fputtc fputwc +#define _fputtc_nolock _fputwc_nolock +#define _fputtchar _fputwchar +#define _fputts fputws +#define _cputts _cputws +#define _cgetts _cgetws +#define _gettc getwc +#define _gettc_nolock _getwc_nolock +#define _gettch _getwch +#define _gettch_nolock _getwch_nolock +#define _gettche _getwche +#define _gettche_nolock _getwche_nolock +#define _gettchar getwchar +#define _gettchar_nolock _getwchar_nolock +#define _getts _getws +#define _puttc putwc +#define _puttc_nolock _putwc_nolock +#define _puttchar putwchar +#define _puttchar_nolock _putwchar_nolock +#define _puttch _putwch +#define _puttch_nolock _putwch_nolock +#define _putts _putws +#define _ungettc ungetwc +#define _ungettc_nolock _ungetwc_nolock +#define _ungettch _ungetwch +#define _ungettch_nolock _ungetwch_nolock + +#define _tcstod wcstod +#define _tcstol wcstol +#define _tcstoul wcstoul +#define _tcstoi64 _wcstoi64 +#define _tcstoui64 _wcstoui64 +#define _tstof _wtof +#define _tstol _wtol +#define _tstoi _wtoi +#define _tstoi64 _wtoi64 +#define _tcstod_l _wcstod_l +#define _tcstol_l _wcstol_l +#define _tcstoul_l _wcstoul_l +#define _tcstoi64_l _wcstoi64_l +#define _tcstoui64_l _wcstoui64_l +#define _tstof_l _wtof_l +#define _tstol_l _wtol_l +#define _tstoi_l _wtoi_l +#define _tstoi64_l _wtoi64_l + +#define _itot _itow +#define _ltot _ltow +#define _ultot _ultow +#define _ttoi _wtoi +#define _ttol _wtol + +#define _ttoi64 _wtoi64 +#define _i64tot _i64tow +#define _ui64tot _ui64tow + +#define _tcscat wcscat +#define _tcschr wcschr +#define _tcscpy wcscpy +#define _tcscspn wcscspn +#define _tcslen wcslen +#define _tcsnlen wcsnlen +#define _tcsncat wcsncat +#define _tcsncat_l _wcsncat_l +#define _tcsncpy wcsncpy +#define _tcsncpy_l _wcsncpy_l +#define _tcspbrk wcspbrk +#define _tcsrchr wcsrchr +#define _tcsspn wcsspn +#define _tcsstr wcsstr +#define _tcstok wcstok +#define _tcstok_l _wcstok_l +#define _tcserror _wcserror +#define __tcserror __wcserror + +#define _tcsdup _wcsdup +#define _tcsnset _wcsnset +#define _tcsnset_l _wcsnset_l +#define _tcsrev _wcsrev +#define _tcsset _wcsset +#define _tcsset_l _wcsset_l + +#define _tcscmp wcscmp +#define _tcsicmp _wcsicmp +#define _tcsicmp_l _wcsicmp_l +#define _tcsnccmp wcsncmp +#define _tcsncmp wcsncmp +#define _tcsncicmp _wcsnicmp +#define _tcsncicmp_l _wcsnicmp_l +#define _tcsnicmp _wcsnicmp +#define _tcsnicmp_l _wcsnicmp_l + +#define _tcscoll wcscoll +#define _tcscoll_l _wcscoll_l +#define _tcsicoll _wcsicoll +#define _tcsicoll_l _wcsicoll_l +#define _tcsnccoll _wcsncoll +#define _tcsnccoll_l _wcsncoll_l +#define _tcsncoll _wcsncoll +#define _tcsncoll_l _wcsncoll_l +#define _tcsncicoll _wcsnicoll +#define _tcsncicoll_l _wcsnicoll_l +#define _tcsnicoll _wcsnicoll +#define _tcsnicoll_l _wcsnicoll_l + +#define _texecl _wexecl +#define _texecle _wexecle +#define _texeclp _wexeclp +#define _texeclpe _wexeclpe +#define _texecv _wexecv +#define _texecve _wexecve +#define _texecvp _wexecvp +#define _texecvpe _wexecvpe + +#define _tspawnl _wspawnl +#define _tspawnle _wspawnle +#define _tspawnlp _wspawnlp +#define _tspawnlpe _wspawnlpe +#define _tspawnv _wspawnv +#define _tspawnve _wspawnve +#define _tspawnvp _wspawnvp +#define _tspawnvp _wspawnvp +#define _tspawnvpe _wspawnvpe + +#define _tsystem _wsystem + +#define _tasctime _wasctime +#define _tctime _wctime +#define _tctime32 _wctime32 +#define _tctime64 _wctime64 +#define _tstrdate _wstrdate +#define _tstrtime _wstrtime +#define _tutime _wutime +#define _tutime32 _wutime32 +#define _tutime64 _wutime64 +#define _tcsftime wcsftime +#define _tcsftime_l _wcsftime_l + +#define _tchdir _wchdir +#define _tgetcwd _wgetcwd +#define _tgetdcwd _wgetdcwd +#define _tgetdcwd_nolock _wgetdcwd_nolock +#define _tmkdir _wmkdir +#define _trmdir _wrmdir + +#define _tfullpath _wfullpath +#define _tgetenv _wgetenv +#define _tmakepath _wmakepath +#define _tpgmptr _wpgmptr +#define _get_tpgmptr _get_wpgmptr +#define _tputenv _wputenv +#define _tsearchenv _wsearchenv +#define _tsplitpath _wsplitpath + +#define _tfdopen _wfdopen +#define _tfsopen _wfsopen +#define _tfopen _wfopen +#define _tfreopen _wfreopen +#define _tperror _wperror +#define _tpopen _wpopen +#define _ttempnam _wtempnam +#define _ttmpnam _wtmpnam + +#define _taccess _waccess +#define _tchmod _wchmod +#define _tcreat _wcreat +#define _tfindfirst _wfindfirst +#define _tfindfirst32 _wfindfirst32 +#define _tfindfirst64 _wfindfirst64 +#define _tfindfirsti64 _wfindfirsti64 +#define _tfindfirst32i64 _wfindfirst32i64 +#define _tfindfirst64i32 _wfindfirst64i32 +#define _tfindnext _wfindnext +#define _tfindnext32 _wfindnext32 +#define _tfindnext64 _wfindnext64 +#define _tfindnexti64 _wfindnexti64 +#define _tfindnext32i64 _wfindnext32i64 +#define _tfindnext64i32 _wfindnext64i32 +#define _tmktemp _wmktemp +#define _topen _wopen +#define _tremove _wremove +#define _trename _wrename +#define _tsopen _wsopen +#define _tunlink _wunlink + +#define _tfinddata_t _wfinddata_t +#define _tfinddata32_t _wfinddata32_t +#define _tfinddata64_t _wfinddata64_t +#define _tfinddatai64_t _wfinddatai64_t +#define _tfinddata32i64_t _wfinddata32i64_t +#define _tfinddata64i32_t _wfinddata64i32_t + +#define _tstat _wstat +#define _tstat32 _wstat32 +#define _tstat32i64 _wstat32i64 +#define _tstat64 _wstat64 +#define _tstat64i32 _wstat64i32 +#define _tstati64 _wstati64 + +#define _tsetlocale _wsetlocale + +#define _tcsclen wcslen +#define _tcscnlen wcsnlen +#define _tcsclen_l(_String,_Locale) wcslen(_String) +#define _tcscnlen_l(_String,_Max_count,_Locale) wcsnlen_l((_String),(_Max_count)) +#define _tcsnccat wcsncat +#define _tcsnccat_l _wcsncat_l +#define _tcsnccpy wcsncpy +#define _tcsnccpy_l _wcsncpy_l +#define _tcsncset _wcsnset + +#define _tcsdec _wcsdec +#define _tcsinc _wcsinc +#define _tcsnbcnt _wcsncnt +#define _tcsnccnt _wcsncnt +#define _tcsnextc _wcsnextc +#define _tcsninc _wcsninc +#define _tcsspnp _wcsspnp + +#define _tcslwr _wcslwr +#define _tcslwr_l _wcslwr_l +#define _tcsupr _wcsupr +#define _tcsupr_l _wcsupr_l +#define _tcsxfrm wcsxfrm +#define _tcsxfrm_l _wcsxfrm_l + +#define _tclen(_pc) (1) +#define _tccpy(_pc1,_cpc2) ((*(_pc1) = *(_cpc2))) +#define _tccmp(_cpc1,_cpc2) ((*(_cpc1))-(*(_cpc2))) + +#define _istalnum iswalnum +#define _istalnum_l _iswalnum_l +#define _istalpha iswalpha +#define _istalpha_l _iswalpha_l +#define _istascii iswascii +#define _istcntrl iswcntrl +#define _istcntrl_l _iswcntrl_l +#define _istdigit iswdigit +#define _istdigit_l _iswdigit_l +#define _istgraph iswgraph +#define _istgraph_l _iswgraph_l +#define _istlower iswlower +#define _istlower_l _iswlower_l +#define _istprint iswprint +#define _istprint_l _iswprint_l +#define _istpunct iswpunct +#define _istpunct_l _iswpunct_l +#define _istspace iswspace +#define _istspace_l _iswspace_l +#define _istupper iswupper +#define _istupper_l _iswupper_l +#define _istxdigit iswxdigit +#define _istxdigit_l _iswxdigit_l + +#define _totupper towupper +#define _totupper_l _towupper_l +#define _totlower towlower +#define _totlower_l _towlower_l + +#define _istlegal(_Char) (1) +#define _istlead(_Char) (0) +#define _istleadbyte(_Char) (0) +#define _istleadbyte_l(_Char,_Locale) (0) + +#define _wcsdec(_cpc1,_cpc2) ((_cpc1)>=(_cpc2) ? NULL : (_cpc2)-1) +#define _wcsinc(_pc) ((_pc)+1) +#define _wcsnextc(_cpc) ((unsigned int) *(_cpc)) +#define _wcsninc(_pc,_sz) (((_pc)+(_sz))) + _CRTIMP size_t __cdecl __wcsncnt(const wchar_t *_Str,size_t _MaxCount); +#define _wcsncnt(_cpc,_sz) (__wcsncnt(_cpc,_sz)) +#define _wcsspnp(_cpc1,_cpc2) (!_cpc1 ? NULL : ((*((_cpc1)+wcsspn(_cpc1,_cpc2))) ? ((_cpc1)+wcsspn(_cpc1,_cpc2)) : NULL)) +#define _wcsncpy_l(_Destination,_Source,_Count,_Locale) (wcsncpy(_Destination,_Source,_Count)) +#define _wcsncat_l(_Destination,_Source,_Count,_Locale) (wcsncat(_Destination,_Source,_Count)) +#define _wcstok_l(_String,_Delimiters,_Locale) (wcstok(_String,_Delimiters)) +#define _wcsnset_l(_Destination,_Value,_Count,_Locale) (_wcsnset(_Destination,_Value,_Count)) +#define _wcsset_l(_Destination,_Value,_Locale) (_wcsset(_Destination,_Value)) + + /* dirent structures and functions */ +#define _tdirent _wdirent +#define _TDIR _WDIR +#define _topendir _wopendir +#define _tclosedir _wclosedir +#define _treaddir _wreaddir +#define _trewinddir _wrewinddir +#define _ttelldir _wtelldir +#define _tseekdir _wseekdir #else - #define __T(q) q - - #ifndef _TCHAR_DEFINED - #ifndef RC_INVOKED - typedef char TCHAR; - typedef char _TCHAR; - #endif - #define _TCHAR_DEFINED - #endif - - #define _TINT int - #define _TSCHAR signed char - #define _TUCHAR unsigned char - #define _TXCHAR char - #define _TEOF EOF - #define _tenviron _environ - #define _tfinddata_t _finddata_t - - /* dirent structures and functions */ - #define _tdirent dirent - #define _TDIR DIR - #define _topendir opendir - #define _tclosedir closedir - #define _treaddir readdir - #define _trewinddir rewinddir - #define _ttelldir telldir - #define _tseekdir seekdir - - #define _ttoi64 _atoi64 - #define _i64tot _i64toa - #define _ui64tot _ui64toa - #define _tcsnccoll _strncoll - #define _tcsncoll _strncoll - #define _tcsncicoll _strnicoll - #define _tfindfirsti64 _findfirsti64 - #define _tfindnexti64 _findnexti64 - #define _tfinddatai64_t _finddatai64_t - - #define _tunlink _unlink - #define _tgetdcwd _getdcwd - - #define _fgettc fgetc - #define _fgettchar fgetchar - #define _fgetts fgets - #define _fputtc fputc - #define _fputtchar fputchar - #define _fputts fputs - #define _ftprintf fprintf - #define _ftscanf fscanf - #define _gettc getc - #define _gettchar getchar - #define _getts gets - #define _istalnum isalnum - #define _istalpha isalpha - #define _istascii __isascii - #define _istcntrl iscntrl - #define _istdigit isdigit - #define _istgraph isgraph - #define _istlead(c) 0 - #define _istleadbyte(c) 0 - #define _istlegal(c) 1 - #define _istlower islower - #define _istprint isprint - #define _istpunct ispunct - #define _istspace isspace - #define _istupper isupper - #define _istxdigit isxdigit - #define _itot _itoa - #define _ltot _ltoa - #define _puttc putc - #define _puttchar putchar - #define _putts puts - #define _tmain main - #define _sntprintf _snprintf - #define _stprintf sprintf - #define _stscanf sscanf - #define _taccess _access - #define _tasctime asctime - #define _tccpy(d,s) (*(d)=*(s)) - #define _tchdir _chdir - #define _tclen(c) 1 - #define _tchmod _chmod - #define _tcreat _creat - #define _tcscat strcat - #define _tcschr strchr - #define _tcsclen strlen - #define _tcscmp strcmp - #define _tcscoll strcoll - #define _tcscpy strcpy - #define _tcscspn strcspn - #define _tcsdec _strdec - #define _tcsdup _strdup - #define _tcsftime strftime - #define _tcsicmp _stricmp - #define _tcsicoll _stricoll - #define _tcsinc _strinc - #define _tcslen strlen - #define _tcslwr _strlwr - #define _tcsnbcnt _strncnt - #define _tcsncat strncat - #define _tcsnccat strncat - #define _tcsncmp strncmp - #define _tcsnccmp strncmp - #define _tcsnccnt _strncnt - #define _tcsnccpy strncpy - #define _tcsncicmp _strnicmp - #define _tcsncpy strncpy - #define _tcsncset _strnset - #define _tcsnextc _strnextc - #define _tcsnicmp _strnicmp - #define _tcsnicoll _strnicoll - #define _tcsninc _strninc - #define _tcsnccnt _strncnt - #define _tcsnset _strnset - #define _tcspbrk strpbrk - #define _tcsspnp _strspnp - #define _tcsrchr strrchr - #define _tcsrev _strrev - #define _tcsset _strset - #define _tcsspn strspn - #define _tcsstr strstr - #define _tcstod strtod - #define _tcstok strtok - #define _tcstol strtol - #define _tcstoul strtoul - #define _tcsupr _strupr - #define _tcsxfrm strxfrm - #define _tctime ctime - #define _texecl _execl - #define _texecle _execle - #define _texeclp _execlp - #define _texeclpe _execlpe - #define _texecv _execv - #define _texecve _execve - #define _texecvp _execvp - #define _texecvpe _execvpe - #define _tfdopen _fdopen - #define _tfindfirst _findfirst - #define _tfindnext _findnext - #define _tfopen fopen - #define _tfreopen freopen - #define _tfsopen _fsopen - #define _tfullpath _fullpath - #define _tgetcwd _getcwd - #define _tgetenv getenv - #define _tmain main - #define _tmakepath _makepath - #define _tmkdir _mkdir - #define _tmktemp _mktemp - #define _tperror perror - #define _topen _open - #define _totlower tolower - #define _totupper toupper - #define _tpopen _popen - #define _tprintf printf - #define _tremove remove - #define _trename rename - #define _trmdir _rmdir - #define _tsearchenv _searchenv - #define _tscanf scanf - #define _tsetlocale setlocale - #define _tsopen _sopen - #define _tspawnl _spawnl - #define _tspawnle _spawnle - #define _tspawnlp _spawnlp - #define _tspawnlpe _spawnlpe - #define _tspawnv _spawnv - #define _tspawnve _spawnve - #define _tspawnvp _spawnvp - #define _tspawnvpe _spawnvpe - #define _tsplitpath _splitpath - #define _tstat _stat - #define _tstrdate _strdate - #define _tstrtime _strtime - #define _tsystem system - #define _ttempnam _tempnam - #define _ttmpnam tmpnam - #define _ttoi atoi - #define _ttol atol - #define _tutime _utime - #define _tWinMain WinMain - #define _ultot _ultoa - #define _ungettc ungetc - #define _vftprintf vfprintf - #define _vsntprintf _vsnprintf - #define _vstprintf vsprintf - #define _vtprintf vprintf - - #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1) - #define _strinc(_str) ((_str)+1) - #define _strnextc(_str) ((unsigned int) *(_str)) - #define _strninc(_str, _inc) (((_str)+(_inc))) - #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str)) - #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL) - +#ifdef __cplusplus +} #endif +#include +#ifdef __cplusplus +extern "C" { +#endif +#define _TEOF EOF -#define _TEXT(x) __T(x) -#define _T(x) __T(x) +#define __T(x) x -#endif /* _TCHAR_H_ */ +#define _tmain main +#define _tWinMain WinMain +#ifdef _POSIX_ +#define _tenviron environ +#else +#define _tenviron _environ +#endif +#define __targv __argv +#define _tprintf printf +#define _tprintf_l _printf_l +#define _tprintf_p _printf_p +#define _tprintf_p_l _printf_p_l +#define _tcprintf _cprintf +#define _tcprintf_l _cprintf_l +#define _tcprintf_p _cprintf_p +#define _tcprintf_p_l _cprintf_p_l +#define _vtcprintf _vcprintf +#define _vtcprintf_l _vcprintf_l +#define _vtcprintf_p _vcprintf_p +#define _vtcprintf_p_l _vcprintf_p_l +#define _ftprintf fprintf +#define _ftprintf_l _fprintf_l +#define _ftprintf_p _fprintf_p +#define _ftprintf_p_l _fprintf_p_l +#define _stprintf sprintf +#define _stprintf_l _sprintf_l +#define _stprintf_p _sprintf_p +#define _stprintf_p_l _sprintf_p_l +#define _sctprintf _scprintf +#define _sctprintf_l _scprintf_l +#define _sctprintf_p _scprintf_p +#define _sctprintf_p_l _scprintf_p_l +#define _sntprintf _snprintf +#define _sntprintf_l _snprintf_l +#define _vtprintf vprintf +#define _vtprintf_l _vprintf_l +#define _vtprintf_p _vprintf_p +#define _vtprintf_p_l _vprintf_p_l +#define _vftprintf vfprintf +#define _vftprintf_l _vfprintf_l +#define _vftprintf_p _vfprintf_p +#define _vftprintf_p_l _vfprintf_p_l +#define _vstprintf vsprintf +#define _vstprintf_l _vsprintf_l +#define _vstprintf_p _vsprintf_p +#define _vstprintf_p_l _vsprintf_p_l +#define _vsctprintf _vscprintf +#define _vsctprintf_l _vscprintf_l +#define _vsctprintf_p _vscprintf_p +#define _vsctprintf_p_l _vscprintf_p_l +#define _vsntprintf _vsnprintf +#define _vsntprintf_l _vsnprintf_l + +#define _tscanf scanf +#define _tscanf_l _scanf_l +#define _tcscanf _cscanf +#define _tcscanf_l _cscanf_l +#define _ftscanf fscanf +#define _ftscanf_l _fscanf_l +#define _stscanf sscanf +#define _stscanf_l _sscanf_l +#define _sntscanf _snscanf +#define _sntscanf_l _snscanf_l + +#define _fgettc fgetc +#define _fgettc_nolock _fgetc_nolock +#define _fgettchar _fgetchar +#define _fgetts fgets +#define _fputtc fputc +#define _fputtc_nolock _fputc_nolock +#define _fputtchar _fputchar +#define _fputts fputs +#define _cputts _cputs +#define _gettc getc +#define _gettc_nolock _getc_nolock +#define _gettch _getch +#define _gettch_nolock _getch_nolock +#define _gettche _getche +#define _gettche_nolock _getche_nolock +#define _gettchar getchar +#define _gettchar_nolock _getchar_nolock +#define _getts gets +#define _cgetts _cgets +#define _puttc putc +#define _puttc_nolock _putc_nolock +#define _puttchar putchar +#define _puttchar_nolock _putchar_nolock +#define _puttch _putch +#define _puttch_nolock _putch_nolock +#define _putts puts +#define _ungettc ungetc +#define _ungettc_nolock _ungetc_nolock +#define _ungettch _ungetch +#define _ungettch_nolock _ungetch_nolock + +#define _tcstod strtod +#define _tcstol strtol +#define _tcstoul strtoul +#define _tstof atof +#define _tstol atol +#define _tstoi atoi +#define _tstoi64 _atoi64 +#define _tcstod_l _strtod_l +#define _tcstol_l _strtol_l +#define _tcstoul_l _strtoul_l +#define _tstof_l _atof_l +#define _tstol_l _atol_l +#define _tstoi_l _atoi_l +#define _tstoi64_l _atoi64_l + +#define _itot _itoa +#define _ltot _ltoa +#define _ultot _ultoa +#define _ttoi atoi +#define _ttol atol + +#define _ttoi64 _atoi64 +#define _tcstoi64 _strtoi64 +#define _tcstoi64_l _strtoi64_l +#define _tcstoui64 _strtoui64 +#define _tcstoui64_l _strtoui64_l +#define _i64tot _i64toa +#define _ui64tot _ui64toa + +#define _tcscat strcat +#define _tcscpy strcpy +#define _tcsdup _strdup +#define _tcslen strlen +#if 0 +#define _tcsnlen strnlen +#endif +#define _tcsxfrm strxfrm +#define _tcsxfrm_l _strxfrm_l +#define _tcserror strerror +#define __tcserror _strerror + +#define _texecl _execl +#define _texecle _execle +#define _texeclp _execlp +#define _texeclpe _execlpe +#define _texecv _execv +#define _texecve _execve +#define _texecvp _execvp +#define _texecvpe _execvpe + +#define _tspawnl _spawnl +#define _tspawnle _spawnle +#define _tspawnlp _spawnlp +#define _tspawnlpe _spawnlpe +#define _tspawnv _spawnv +#define _tspawnve _spawnve +#define _tspawnvp _spawnvp +#define _tspawnvpe _spawnvpe + +#define _tsystem system + +#define _tasctime asctime +#define _tctime ctime +#define _tctime32 _ctime32 +#define _tctime64 _ctime64 +#define _tstrdate _strdate +#define _tstrtime _strtime +#define _tutime _utime +#define _tutime32 _utime32 +#define _tutime64 _utime64 +#define _tcsftime strftime +#define _tcsftime_l _strftime_l + +#define _tchdir _chdir +#define _tgetcwd _getcwd +#define _tgetdcwd _getdcwd +#define _tgetdcwd_nolock _getdcwd_nolock +#define _tmkdir _mkdir +#define _trmdir _rmdir + +#define _tfullpath _fullpath +#define _tgetenv getenv +#define _tmakepath _makepath +#define _tpgmptr _pgmptr +#define _get_tpgmptr _get_pgmptr +#define _tputenv _putenv +#define _tsearchenv _searchenv +#define _tsplitpath _splitpath + +#ifdef _POSIX_ +#define _tfdopen fdopen +#else +#define _tfdopen _fdopen +#endif +#define _tfsopen _fsopen +#define _tfopen fopen +#define _tfreopen freopen +#define _tperror perror +#define _tpopen _popen +#define _ttempnam _tempnam +#define _ttmpnam tmpnam + +#define _tchmod _chmod +#define _tcreat _creat +#define _tfindfirst _findfirst +#define _tfindfirst32 _findfirst32 +#define _tfindfirst64 _findfirst64 +#define _tfindfirsti64 _findfirsti64 +#define _tfindfirst32i64 _findfirst32i64 +#define _tfindfirst64i32 _findfirst64i32 +#define _tfindnext _findnext +#define _tfindnext32 _findnext32 +#define _tfindnext64 _findnext64 +#define _tfindnexti64 _findnexti64 +#define _tfindnext32i64 _findnext32i64 +#define _tfindnext64i32 _findnext64i32 +#define _tmktemp _mktemp + +#ifdef _POSIX_ +#define _topen open +#define _taccess access +#else +#define _topen _open +#define _taccess _access +#endif + +#define _tremove remove +#define _trename rename +#define _tsopen _sopen +#define _tunlink _unlink + +#define _tfinddata_t _finddata_t +#define _tfinddata32_t _finddata32_t +#define _tfinddata64_t __finddata64_t +#define _tfinddatai64_t _finddatai64_t +#define _tfinddata32i64_t _finddata32i64_t +#define _tfinddata64i32_t _finddata64i32_t + +#define _istascii __isascii +#define _istcntrl iscntrl +#define _istcntrl_l _iscntrl_l +#define _istxdigit isxdigit +#define _istxdigit_l _isxdigit_l + +#define _tstat _stat +#define _tstat32 _stat32 +#define _tstat32i64 _stat32i64 +#define _tstat64 _stat64 +#define _tstat64i32 _stat64i32 +#define _tstati64 _stati64 + +#define _tsetlocale setlocale + +#ifdef _MBCS + +#ifdef __cplusplus +} +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __TCHAR_DEFINED + typedef char _TCHAR; + typedef signed char _TSCHAR; + typedef unsigned char _TUCHAR; + typedef unsigned char _TXCHAR; + typedef unsigned int _TINT; +#define __TCHAR_DEFINED +#endif + +#ifndef _TCHAR_DEFINED +#ifndef NO_OLDNAMES + typedef char TCHAR; +#endif +#define _TCHAR_DEFINED +#endif + +#ifdef _MB_MAP_DIRECT + +#define _tcschr _mbschr +#define _tcscspn _mbscspn +#define _tcsncat _mbsnbcat +#define _tcsncat_l _mbsnbcat_l +#define _tcsncpy _mbsnbcpy +#define _tcsncpy_l _mbsnbcpy_l +#define _tcspbrk _mbspbrk +#define _tcsrchr _mbsrchr +#define _tcsspn _mbsspn +#define _tcsstr _mbsstr +#define _tcstok _mbstok +#define _tcstok_l _mbstok_l + +#define _tcsnset _mbsnbset +#define _tcsnset_l _mbsnbset_l +#define _tcsrev _mbsrev +#define _tcsset _mbsset +#define _tcsset_l _mbsset_l + +#define _tcscmp _mbscmp +#define _tcsicmp _mbsicmp +#define _tcsicmp_l _mbsicmp_l +#define _tcsnccmp _mbsncmp +#define _tcsncmp _mbsnbcmp +#define _tcsncicmp _mbsnicmp +#define _tcsncicmp_l _mbsnicmp_l +#define _tcsnicmp _mbsnbicmp +#define _tcsnicmp_l _mbsnbicmp_l + +#define _tcscoll _mbscoll +#define _tcscoll_l _mbscoll_l +#define _tcsicoll _mbsicoll +#define _tcsicoll_l _mbsicoll_l +#define _tcsnccoll _mbsncoll +#define _tcsnccoll_l _mbsncoll_l +#define _tcsncoll _mbsnbcoll +#define _tcsncoll_l _mbsnbcoll_l +#define _tcsncicoll _mbsnicoll +#define _tcsncicoll_l _mbsnicoll_l +#define _tcsnicoll _mbsnbicoll +#define _tcsnicoll_l _mbsnbicoll_l + +#define _tcsclen _mbslen +#define _tcscnlen _mbsnlen +#define _tcsclen_l _mbslen_l +#define _tcscnlen_l _mbsnlen_l +#define _tcsnccat _mbsncat +#define _tcsnccat_l _mbsncat_l +#define _tcsnccpy _mbsncpy +#define _tcsnccpy_l _mbsncpy_l +#define _tcsncset _mbsnset +#define _tcsncset_l _mbsnset_l + +#define _tcsdec _mbsdec +#define _tcsinc _mbsinc +#define _tcsnbcnt _mbsnbcnt +#define _tcsnccnt _mbsnccnt +#define _tcsnextc _mbsnextc +#define _tcsninc _mbsninc +#define _tcsspnp _mbsspnp + +#define _tcslwr _mbslwr +#define _tcslwr_l _mbslwr_l +#define _tcsupr _mbsupr +#define _tcsupr_l _mbsupr_l + +#define _tclen _mbclen +#define _tccpy _mbccpy +#define _tccpy_l _mbccpy_l +#else + + _CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val); + _CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control); + _CRTIMP char *__cdecl _tcsncat(char *_Dst,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsncat_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsncpy(char *_Dst,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsncpy_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP _CONST_RETURN char *__cdecl _tcspbrk(const char *_Str,const char *_Control); + _CRTIMP _CONST_RETURN char *__cdecl _tcsrchr(const char *_Str,unsigned int _Ch); + _CRTIMP size_t __cdecl _tcsspn(const char *_Str,const char *_Control); + _CRTIMP _CONST_RETURN char *__cdecl _tcsstr(const char *_Str,const char *_Substr); + _CRTIMP char *__cdecl _tcstok(char *_Str,const char *_Delim); + _CRTIMP char *__cdecl _tcstok_l(char *_Str,const char *_Delim,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsnset(char *_Str,unsigned int _Val,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsrev(char *_Str); + _CRTIMP char *__cdecl _tcsset(char *_Str,unsigned int _Val); + _CRTIMP char *__cdecl _tcsset_l(char *_Str,unsigned int _Val,_locale_t _Locale); + _CRTIMP int __cdecl _tcscmp(const char *_Str1,const char *_Str); + _CRTIMP int __cdecl _tcsicmp(const char *_Str1,const char *_Str2); + _CRTIMP int __cdecl _tcsicmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _tcsnccmp(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsncmp(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsncicmp(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsncicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _tcsnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _tcscoll(const char *_Str1,const char *_Str2); + _CRTIMP int __cdecl _tcscoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _tcsicoll(const char *_Str1,const char *_Str2); + _CRTIMP int __cdecl _tcsicoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); + _CRTIMP int __cdecl _tcsnccoll(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsnccoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _tcsncoll(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _tcsncicoll(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsncicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP int __cdecl _tcsnicoll(const char *_Str1,const char *_Str2,size_t _MaxCount); + _CRTIMP int __cdecl _tcsnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); + _CRTIMP size_t __cdecl _tcsclen(const char *_Str); + _CRTIMP size_t __cdecl _tcscnlen(const char *_Str,size_t _MaxCount); + _CRTIMP size_t __cdecl _tcsclen_l(const char *_Str,_locale_t _Locale); + _CRTIMP size_t __cdecl _tcscnlen_l(const char *_Str,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsnccat(char *_Dst,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsnccat_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsnccpy(char *_Dst,const char *_Src,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsnccpy_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsncset(char *_Str,unsigned int _Val,size_t _MaxCount); + _CRTIMP char *__cdecl _tcsdec(const char *_Start,const char *_Pos); + _CRTIMP char *__cdecl _tcsinc(const char *_Ptr); + _CRTIMP size_t __cdecl _tcsnbcnt(const char *_Str,size_t _MaxCount); + _CRTIMP size_t __cdecl _tcsnccnt(const char *_Str,size_t _MaxCount); + _CRTIMP unsigned int __cdecl _tcsnextc (const char *_Str); + _CRTIMP char *__cdecl _tcsninc(const char *_Ptr,size_t _Count); + _CRTIMP char *__cdecl _tcsspnp(const char *_Str1,const char *_Str2); + _CRTIMP char *__cdecl _tcslwr(char *_Str); + _CRTIMP char *__cdecl _tcslwr_l(char *_Str,_locale_t _Locale); + _CRTIMP char *__cdecl _tcsupr(char *_Str); + _CRTIMP char *__cdecl _tcsupr_l(char *_Str,_locale_t _Locale); + _CRTIMP size_t __cdecl _tclen(const char *_Str); + _CRTIMP void __cdecl _tccpy(char *_DstCh,const char *_SrcCh); + +#ifdef __cplusplus +#ifndef _CPP_TCHAR_INLINES_DEFINED +#define _CPP_TCHAR_INLINES_DEFINED + extern "C++" { + extern inline char *__cdecl _tcschr(char *_S,unsigned int _C) { return ((char *)_tcschr((const char *)_S,_C)); } + extern inline char *__cdecl _tcspbrk(char *_S,const char *_P) { return ((char *)_tcspbrk((const char *)_S,_P)); } + extern inline char *__cdecl _tcsrchr(char *_S,unsigned int _C) { return ((char *)_tcsrchr((const char *)_S,_C)); } + extern inline char *__cdecl _tcsstr(char *_S,const char *_P) { return ((char *)_tcsstr((const char *)_S,_P)); } + } +#endif +#endif +#endif + +#define _tccmp(_cp1,_cp2) _tcsnccmp(_cp1,_cp2,1) + +#define _istalnum _ismbcalnum +#define _istalnum_l _ismbcalnum_l +#define _istalpha _ismbcalpha +#define _istalpha_l _ismbcalpha_l +#define _istdigit _ismbcdigit +#define _istdigit_l _ismbcdigit_l +#define _istgraph _ismbcgraph +#define _istgraph_l _ismbcgraph_l +#define _istlegal _ismbclegal +#define _istlegal_l _ismbclegal_l +#define _istlower _ismbclower +#define _istlower_l _ismbclower_l +#define _istprint _ismbcprint +#define _istprint_l _ismbcprint_l +#define _istpunct _ismbcpunct +#define _istpunct_l _ismbcpunct_l +#define _istspace _ismbcspace +#define _istspace_l _ismbcspace_l +#define _istupper _ismbcupper +#define _istupper_l _ismbcupper_l + +#define _totupper _mbctoupper +#define _totupper_l _mbctoupper_l +#define _totlower _mbctolower +#define _totlower_l _mbctolower_l + +#define _istlead _ismbblead +#define _istleadbyte isleadbyte +#define _istleadbyte_l _isleadbyte_l +#else + +#ifndef __TCHAR_DEFINED +#define __TCHAR_DEFINED + typedef char _TCHAR; + typedef signed char _TSCHAR; + typedef unsigned char _TUCHAR; + typedef char _TXCHAR; + typedef int _TINT; +#endif + +#ifndef _TCHAR_DEFINED +#define _TCHAR_DEFINED +#ifndef NO_OLDNAMES + typedef char TCHAR; +#endif +#endif + +#define _tcschr strchr +#define _tcscspn strcspn +#define _tcsncat strncat +#define _tcsncat_l _strncat_l +#define _tcsncpy strncpy +#define _tcsncpy_l _strncpy_l +#define _tcspbrk strpbrk +#define _tcsrchr strrchr +#define _tcsspn strspn +#define _tcsstr strstr +#define _tcstok strtok +#define _tcstok_l _strtok_l + +#define _tcsnset _strnset +#define _tcsnset_l _strnset_l +#define _tcsrev _strrev +#define _tcsset _strset + +#define _tcscmp strcmp +#define _tcsicmp _stricmp +#define _tcsicmp_l _stricmp_l +#define _tcsnccmp strncmp +#define _tcsncmp strncmp +#define _tcsncicmp _strnicmp +#define _tcsncicmp_l _strnicmp_l +#define _tcsnicmp _strnicmp +#define _tcsnicmp_l _strnicmp_l + +#define _tcscoll strcoll +#define _tcscoll_l _strcoll_l +#define _tcsicoll _stricoll +#define _tcsicoll_l _stricoll_l +#define _tcsnccoll _strncoll +#define _tcsnccoll_l _strncoll_l +#define _tcsncoll _strncoll +#define _tcsncoll_l _strncoll_l +#define _tcsncicoll _strnicoll +#define _tcsncicoll_l _strnicoll_l +#define _tcsnicoll _strnicoll +#define _tcsnicoll_l _strnicoll_l + +#define _tcsclen strlen +#define _tcscnlen strnlen +#define _tcsclen_l(_String,_Locale) strlen(_String) +#define _tcscnlen_l(_String,_Max_count,_Locale) strnlen_l((_String),(_Max_count)) +#define _tcsnccat strncat +#define _tcsnccat_l _strncat_l +#define _tcsnccpy strncpy +#define _tcsnccpy_l _strncpy_l +#define _tcsncset _strnset + +#define _tcsdec _strdec +#define _tcsinc _strinc +#define _tcsnbcnt _strncnt +#define _tcsnccnt _strncnt +#define _tcsnextc _strnextc +#define _tcsninc _strninc +#define _tcsspnp _strspnp + +#define _tcslwr _strlwr +#define _tcslwr_l _strlwr_l +#define _tcsupr _strupr +#define _tcsupr_l _strupr_l +#define _tcsxfrm strxfrm +#define _tcsxfrm_l _strxfrm_l + +#define _istlead(_Char) (0) +#define _istleadbyte(_Char) (0) +#define _istleadbyte_l(_Char,_Locale) (0) + +#define _tclen(_pc) (1) +#define _tccpy(_pc1,_cpc2) (*(_pc1) = *(_cpc2)) +#define _tccmp(_cpc1,_cpc2) (((unsigned char)*(_cpc1))-((unsigned char)*(_cpc2))) + + /* dirent structures and functions */ +#define _tdirent dirent +#define _TDIR DIR +#define _topendir opendir +#define _tclosedir closedir +#define _treaddir readdir +#define _trewinddir rewinddir +#define _ttelldir telldir +#define _tseekdir seekdir + +#define _istalnum isalnum +#define _istalnum_l _isalnum_l +#define _istalpha isalpha +#define _istalpha_l _isalpha_l +#define _istdigit isdigit +#define _istdigit_l _isdigit_l +#define _istgraph isgraph +#define _istgraph_l _isgraph_l +#define _istlower islower +#define _istlower_l _islower_l +#define _istprint isprint +#define _istprint_l _isprint_l +#define _istpunct ispunct +#define _istpunct_l _ispunct_l +#define _istspace isspace +#define _istspace_l _isspace_l +#define _istupper isupper +#define _istupper_l _isupper_l + +#define _totupper toupper +#define _totupper_l _toupper_l +#define _totlower tolower +#define _totlower_l _tolower_l + +#define _istlegal(_c) (1) + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#define _strdec(_cpc1,_cpc2) ((_cpc1)>=(_cpc2) ? NULL : (_cpc2)-1) +#define _strinc(_pc) ((_pc)+1) +#define _strnextc(_cpc) ((unsigned int) *(const unsigned char *)(_cpc)) +#define _strninc(_pc,_sz) (((_pc)+(_sz))) + _CRTIMP size_t __cdecl __strncnt(const char *_Str,size_t _Cnt); +#define _strncnt(_cpc,_sz) (__strncnt(_cpc,_sz)) +#define _strspnp(_cpc1,_cpc2) (!_cpc1 ? NULL : ((*((_cpc1)+strspn(_cpc1,_cpc2))) ? ((_cpc1)+strspn(_cpc1,_cpc2)) : NULL)) + +#define _strncpy_l(_Destination,_Source,_Count,_Locale) (strncpy(_Destination,_Source,_Count)) +#define _strncat_l(_Destination,_Source,_Count,_Locale) (strncat(_Destination,_Source,_Count)) +#define _strtok_l(_String,_Delimiters,_Locale) (strtok(_String,_Delimiters)) +#define _strnset_l(_Destination,_Value,_Count,_Locale) (_strnset(_Destination,_Value,_Count)) +#define _strset_l(_Destination,_Value,_Locale) (_strset(_Destination,_Value)) +#endif +#endif + +#define _T(x) __T(x) +#define _TEXT(x) __T(x) + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/reactos/include/crt/wchar.h b/reactos/include/crt/wchar.h index 8a81e9e7003..5f85b6e00e1 100644 --- a/reactos/include/crt/wchar.h +++ b/reactos/include/crt/wchar.h @@ -14,8 +14,12 @@ extern "C" { #endif +#ifndef WCHAR_MIN #define WCHAR_MIN 0 -#define WCHAR_MAX ((wchar_t) -1) /* UINT16_MAX */ +#endif +#ifndef WCHAR_MAX +#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */ +#endif #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST diff --git a/reactos/include/psdk/tchar.h b/reactos/include/psdk/tchar.h deleted file mode 100644 index d0dd45f9ba0..00000000000 --- a/reactos/include/psdk/tchar.h +++ /dev/null @@ -1,410 +0,0 @@ - -#ifndef _TCHAR_H_ -#define _TCHAR_H_ - -#include - -#ifdef _UNICODE - - #define __T(q) L##q - - #ifndef _TCHAR_DEFINED - #ifndef RC_INVOKED - typedef wchar_t TCHAR; - typedef wchar_t _TCHAR; - #endif /* Not RC_INVOKED */ - #define _TCHAR_DEFINED - #endif - - #define _TINT wint_t - #define _TSCHAR wchar_t - #define _TUCHAR wchar_t - #define _TXCHAR wchar_t - #define _TEOF WEOF - #define _tenviron _wenviron - #define _tfinddata_t _wfinddata_t - - /* dirent structures and functions */ - #define _tdirent _wdirent - #define _TDIR _WDIR - #define _topendir _wopendir - #define _tclosedir _wclosedir - #define _treaddir _wreaddir - #define _trewinddir _wrewinddir - #define _ttelldir _wtelldir - #define _tseekdir _wseekdir - - #define _ttoi64 _wtoi64 - #define _i64tot _i64tow - #define _ui64tot _ui64tow - #define _tcsnccoll _wstrncoll - #define _tcsncoll _wstrncoll - #define _tcsncicoll _wstrnicoll - #define _tfindfirsti64 _wfindfirsti64 - #define _tfindnexti64 _wfindnexti64 - #define _tfinddatai64_t _wfinddatai64_t - - #define _tunlink _wunlink - #define _tgetdcwd _wgetdcwd - - #define _fgettc fgetwc - #define _fgettchar _fgetwchar - #define _fgetts fgetws - #define _fputtc fputwc - #define _fputtchar _fputwchar - #define _fputts fputws - #define _ftprintf fwprintf - #define _ftscanf fwscanf - #define _gettc getwc - #define _gettchar getwchar - #define _getts getws - #define _istalnum iswalnum - #define _istalpha iswalpha - #define _istascii iswascii - #define _istcntrl iswcntrl - #define _istdigit iswdigit - #define _istgraph iswgraph - #define _istlead(c) 0 - #define _istleadbyte(c) 0 - #define _istlegal(c) 1 - #define _istlower iswlower - #define _istprint iswprint - #define _istpunct iswpunct - #define _istspace iswspace - #define _istupper iswupper - #define _istxdigit iswxdigit - #define _itot _itow - #define _ltot _ltow - #define _puttc putwc - #define _puttchar putwchar - #define _putts putws - #define _tmain wmain - #define _sntprintf _snwprintf - #define _stprintf swprintf - #define _stscanf swscanf - #define _taccess _waccess - #define _tasctime _wasctime - #define _tccpy(d,s) (*(d)=*(s)) - #define _tchdir _wchdir - #define _tclen(c) 2 - #define _tchmod _wchmod - #define _tcreat _wcreat - #define _tcscat wcscat - #define _tcschr wcschr - #define _tcsclen wcslen - #define _tcscmp wcscmp - #define _tcscoll wcscoll - #define _tcscpy wcscpy - #define _tcscspn wcscspn - #define _tcsdec _wcsdec - #define _tcsdup _wcsdup - #define _tcsftime wcsftime - #define _tcsicmp _wcsicmp - #define _tcsicoll _wcsicoll - #define _tcsinc _wcsinc - #define _tcslen wcslen - #define _tcslwr _wcslwr - #define _tcsnbcnt _wcnscnt - #define _tcsncat wcsncat - #define _tcsnccat wcsncat - #define _tcsncmp wcsncmp - #define _tcsnccmp wcsncmp - #define _tcsnccnt _wcsncnt - #define _tcsnccpy wcsncpy - #define _tcsncicmp _wcsnicmp - #define _tcsncpy wcsncpy - #define _tcsncset _wcsnset - #define _tcsnextc _wcsnextc - #define _tcsnicmp _wcsnicmp - #define _tcsnicoll _wcsnicoll - #define _tcsninc _wcsninc - #define _tcsnccnt _wcsncnt - #define _tcsnset _wcsnset - #define _tcspbrk wcspbrk - #define _tcsspnp _wcsspnp - #define _tcsrchr wcsrchr - #define _tcsrev _wcsrev - #define _tcsset _wcsset - #define _tcsspn wcsspn - #define _tcsstr wcsstr - #define _tcstod wcstod - #define _tcstok wcstok - #define _tcstol wcstol - #define _tcstoul wcstoul - #define _tcsupr _wcsupr - #define _tcsxfrm wcsxfrm - #define _tctime _wctime - #define _texecl _wexecl - #define _texecle _wexecle - #define _texeclp _wexeclp - #define _texeclpe _wexeclpe - #define _texecv _wexecv - #define _texecve _wexecve - #define _texecvp _wexecvp - #define _texecvpe _wexecvpe - #define _tfdopen _wfdopen - #define _tfindfirst _wfindfirst - #define _tfindnext _wfindnext - #define _tfopen _wfopen - #define _tfreopen _wfreopen - #define _tfsopen _wfsopen - #define _tfullpath _wfullpath - #define _tgetcwd _wgetcwd - #define _tgetenv _wgetenv - #define _tmain wmain - #define _tmakepath _wmakepath - #define _tmkdir _wmkdir - #define _tmktemp _wmktemp - #define _tperror _wperror - #define _topen _wopen - #define _totlower towlower - #define _totupper towupper - #define _tpopen _wpopen - #define _tprintf wprintf - #define _tremove _wremove - #define _trename _wrename - #define _trmdir _wrmdir - #define _tsearchenv _wsearchenv - #define _tscanf wscanf - #define _tsetlocale _wsetlocale - #define _tsopen _wsopen - #define _tspawnl _wspawnl - #define _tspawnle _wspawnle - #define _tspawnlp _wspawnlp - #define _tspawnlpe _wspawnlpe - #define _tspawnv _wspawnv - #define _tspawnve _wspawnve - #define _tspawnvp _wspawnvp - #define _tspawnvpe _wspawnvpe - #define _tsplitpath _wsplitpath - #define _tstat _wstat - #define _tstrdate _wstrdate - #define _tstrtime _wstrtime - #define _tsystem _wsystem - #define _ttempnam _wtempnam - #define _ttmpnam _wtmpnam - #define _ttoi _wtoi - #define _ttol _wtol - #define _tutime _wutime - #define _tWinMain wWinMain - #define _ultot _ultow - #define _ungettc ungetwc - #define _vftprintf vfwprintf - #define _vsntprintf _vsnwprintf - #define _vstprintf vswprintf - #define _vtprintf vwprintf - - #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1) - #define _wcsinc(_wcs) ((_wcs)+1) - #define _wcsnextc(_wcs) ((unsigned int) *(_wcs)) - #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc))) - #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs)) - #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL) - -#else - - #define __T(q) q - - #ifndef _TCHAR_DEFINED - #ifndef RC_INVOKED - typedef char TCHAR; - typedef char _TCHAR; - #endif - #define _TCHAR_DEFINED - #endif - - #define _TINT int - #define _TSCHAR signed char - #define _TUCHAR unsigned char - #define _TXCHAR char - #define _TEOF EOF - #define _tenviron _environ - #define _tfinddata_t _finddata_t - - /* dirent structures and functions */ - #define _tdirent dirent - #define _TDIR DIR - #define _topendir opendir - #define _tclosedir closedir - #define _treaddir readdir - #define _trewinddir rewinddir - #define _ttelldir telldir - #define _tseekdir seekdir - - #define _ttoi64 _atoi64 - #define _i64tot _i64toa - #define _ui64tot _ui64toa - #define _tcsnccoll _strncoll - #define _tcsncoll _strncoll - #define _tcsncicoll _strnicoll - #define _tfindfirsti64 _findfirsti64 - #define _tfindnexti64 _findnexti64 - #define _tfinddatai64_t _finddatai64_t - - #define _tunlink _unlink - #define _tgetdcwd _getdcwd - - #define _fgettc fgetc - #define _fgettchar fgetchar - #define _fgetts fgets - #define _fputtc fputc - #define _fputtchar fputchar - #define _fputts fputs - #define _ftprintf fprintf - #define _ftscanf fscanf - #define _gettc getc - #define _gettchar getchar - #define _getts gets - #define _istalnum isalnum - #define _istalpha isalpha - #define _istascii __isascii - #define _istcntrl iscntrl - #define _istdigit isdigit - #define _istgraph isgraph - #define _istlead(c) 0 - #define _istleadbyte(c) 0 - #define _istlegal(c) 1 - #define _istlower islower - #define _istprint isprint - #define _istpunct ispunct - #define _istspace isspace - #define _istupper isupper - #define _istxdigit isxdigit - #define _itot _itoa - #define _ltot _ltoa - #define _puttc putc - #define _puttchar putchar - #define _putts puts - #define _tmain main - #define _sntprintf _snprintf - #define _stprintf sprintf - #define _stscanf sscanf - #define _taccess _access - #define _tasctime asctime - #define _tccpy(d,s) (*(d)=*(s)) - #define _tchdir _chdir - #define _tclen(c) 1 - #define _tchmod _chmod - #define _tcreat _creat - #define _tcscat strcat - #define _tcschr strchr - #define _tcsclen strlen - #define _tcscmp strcmp - #define _tcscoll strcoll - #define _tcscpy strcpy - #define _tcscspn strcspn - #define _tcsdec _strdec - #define _tcsdup _strdup - #define _tcsftime strftime - #define _tcsicmp _stricmp - #define _tcsicoll _stricoll - #define _tcsinc _strinc - #define _tcslen strlen - #define _tcslwr _strlwr - #define _tcsnbcnt _strncnt - #define _tcsncat strncat - #define _tcsnccat strncat - #define _tcsncmp strncmp - #define _tcsnccmp strncmp - #define _tcsnccnt _strncnt - #define _tcsnccpy strncpy - #define _tcsncicmp _strnicmp - #define _tcsncpy strncpy - #define _tcsncset _strnset - #define _tcsnextc _strnextc - #define _tcsnicmp _strnicmp - #define _tcsnicoll _strnicoll - #define _tcsninc _strninc - #define _tcsnccnt _strncnt - #define _tcsnset _strnset - #define _tcspbrk strpbrk - #define _tcsspnp _strspnp - #define _tcsrchr strrchr - #define _tcsrev _strrev - #define _tcsset _strset - #define _tcsspn strspn - #define _tcsstr strstr - #define _tcstod strtod - #define _tcstok strtok - #define _tcstol strtol - #define _tcstoul strtoul - #define _tcsupr _strupr - #define _tcsxfrm strxfrm - #define _tctime ctime - #define _texecl _execl - #define _texecle _execle - #define _texeclp _execlp - #define _texeclpe _execlpe - #define _texecv _execv - #define _texecve _execve - #define _texecvp _execvp - #define _texecvpe _execvpe - #define _tfdopen _fdopen - #define _tfindfirst _findfirst - #define _tfindnext _findnext - #define _tfopen fopen - #define _tfreopen freopen - #define _tfsopen _fsopen - #define _tfullpath _fullpath - #define _tgetcwd _getcwd - #define _tgetenv getenv - #define _tmain main - #define _tmakepath _makepath - #define _tmkdir _mkdir - #define _tmktemp _mktemp - #define _tperror perror - #define _topen _open - #define _totlower tolower - #define _totupper toupper - #define _tpopen _popen - #define _tprintf printf - #define _tremove remove - #define _trename rename - #define _trmdir _rmdir - #define _tsearchenv _searchenv - #define _tscanf scanf - #define _tsetlocale setlocale - #define _tsopen _sopen - #define _tspawnl _spawnl - #define _tspawnle _spawnle - #define _tspawnlp _spawnlp - #define _tspawnlpe _spawnlpe - #define _tspawnv _spawnv - #define _tspawnve _spawnve - #define _tspawnvp _spawnvp - #define _tspawnvpe _spawnvpe - #define _tsplitpath _splitpath - #define _tstat _stat - #define _tstrdate _strdate - #define _tstrtime _strtime - #define _tsystem system - #define _ttempnam _tempnam - #define _ttmpnam tmpnam - #define _ttoi atoi - #define _ttol atol - #define _tutime _utime - #define _tWinMain WinMain - #define _ultot _ultoa - #define _ungettc ungetc - #define _vftprintf vfprintf - #define _vsntprintf _vsnprintf - #define _vstprintf vsprintf - #define _vtprintf vprintf - - #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1) - #define _strinc(_str) ((_str)+1) - #define _strnextc(_str) ((unsigned int) *(_str)) - #define _strninc(_str, _inc) (((_str)+(_inc))) - #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str)) - #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL) - -#endif - - - - -#define _TEXT(x) __T(x) -#define _T(x) __T(x) - -#endif /* _TCHAR_H_ */ - From cc2230125f4892fbc771283664f470a3a324a105 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 2 Sep 2008 15:20:23 +0000 Subject: [PATCH 224/388] Fix up winnt.h a bit svn path=/branches/ros-amd64-bringup/; revision=35888 --- reactos/include/psdk/winnt.h | 58 +++++++++++++++++------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 6a96e9f1aaa..e870fbdbbd0 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -140,41 +140,39 @@ typedef WCHAR *PWCHAR,*LPWCH,*PWCH,*NWPSTR,*LPWSTR,*PWSTR; typedef CONST WCHAR *LPCWCH,*PCWCH,*LPCWSTR,*PCWSTR; typedef CHAR *PCHAR,*LPCH,*PCH,*NPSTR,*LPSTR,*PSTR; typedef CONST CHAR *LPCCH,*PCCH,*PCSTR,*LPCSTR; +typedef PWSTR *PZPWSTR; +typedef CONST PWSTR *PCZPWSTR; +typedef WCHAR UNALIGNED *LPUWSTR,*PUWSTR; +typedef PCWSTR *PZPCWSTR; +typedef CONST WCHAR UNALIGNED *LPCUWSTR,*PCUWSTR; +typedef PSTR *PZPSTR; +typedef CONST PSTR *PCZPSTR; +typedef PCSTR *PZPCSTR; + +#ifdef UNICODE #ifndef _TCHAR_DEFINED #define _TCHAR_DEFINED -#ifdef UNICODE -/* - * NOTE: This tests UNICODE, which is different from the _UNICODE define - * used to differentiate standard C runtime calls. - */ -typedef WCHAR TCHAR; -typedef WCHAR _TCHAR; + typedef WCHAR TCHAR,*PTCHAR; + typedef WCHAR TBYTE ,*PTBYTE; +#endif + typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR,LP,PTCHAR; + typedef LPCWSTR PCTSTR,LPCTSTR; + typedef LPUWSTR PUTSTR,LPUTSTR; + typedef LPCUWSTR PCUTSTR,LPCUTSTR; +#define __TEXT(quote) L##quote #else -typedef CHAR TCHAR; -typedef CHAR _TCHAR; +#ifndef _TCHAR_DEFINED +#define _TCHAR_DEFINED + typedef char TCHAR,*PTCHAR; + typedef unsigned char TBYTE ,*PTBYTE; #endif + typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR,PUTSTR,LPUTSTR,PTCHAR; + typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR; +#define __TEXT(quote) quote #endif -typedef TCHAR TBYTE,*PTCH,*PTBYTE; -typedef TCHAR *LPTCH,*PTSTR,*LPTSTR,*LP,*PTCHAR; -typedef const TCHAR *LPCTSTR; -#ifdef UNICODE -/* - * __TEXT is a private macro whose specific use is to force the expansion of a - * macro passed as an argument to the macro TEXT. DO NOT use this - * macro within your programs. It's name and function could change without - * notice. - */ -#define __TEXT(q) L##q -#else -#define __TEXT(q) q -#endif -/* - * UNICODE a constant string when UNICODE is defined, else returns the string - * unmodified. - * The corresponding macros _TEXT() and _T() for mapping _UNICODE strings - * passed to C runtime functions are defined in mingw/tchar.h - */ -#define TEXT(q) __TEXT(q) + +#define TEXT(quote) __TEXT(quote) + typedef SHORT *PSHORT; typedef LONG *PLONG; #ifdef STRICT From 31c9b2552f170c81d08bfe96d46205d3e7027fb8 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 2 Sep 2008 22:35:20 +0000 Subject: [PATCH 225/388] fix amd64 build svn path=/branches/ros-amd64-bringup/; revision=35895 --- reactos/lib/sdk/crt/string/tcsnlen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/lib/sdk/crt/string/tcsnlen.h b/reactos/lib/sdk/crt/string/tcsnlen.h index 341678bd975..17d8476266e 100644 --- a/reactos/lib/sdk/crt/string/tcsnlen.h +++ b/reactos/lib/sdk/crt/string/tcsnlen.h @@ -4,7 +4,7 @@ #include #include -int _tcsnlen(const _TCHAR * str, size_t count) +size_t _tcsnlen(const _TCHAR * str, size_t count) { const _TCHAR * s; From 24326fcfd3161faeed5b647aaf35f9fb7d4067cb Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 3 Sep 2008 00:22:12 +0000 Subject: [PATCH 226/388] implement StringCxxCat functions. Not all flags in StringCxxCatEx are supported yet. svn path=/branches/ros-amd64-bringup/; revision=35900 --- reactos/include/psdk/strsafe.h | 105 +++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 10 deletions(-) diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index 55f30700a35..7a92a312e9e 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -8,12 +8,26 @@ #error Both STRSAFE_NO_CCH_FUNCTIONS and STRSAFE_NO_CB_FUNCTIONS are defined #endif +#ifndef SUCCEEDED +#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0) +#endif #define STRSAFE_MAX_CCH 2147483647 #define STRSAFE_E_INVALID_PARAMETER ((HRESULT)0x80070057L) +#define STRSAFE_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) +#define STRSAFE_E_END_OF_FILE ((HRESULT)0x80070026L) + +#define STRSAFE_FILL_BEHIND_NULL 0x00000200 +#define STRSAFE_IGNORE_NULLS 0x00000200 +#define STRSAFE_FILL_ON_FAILURE 0x00000400 +#define STRSAFE_NULL_ON_FAILURE 0x00000800 +#define STRSAFE_NO_TRUNCATION 0x00001000 + #ifndef S_OK #define S_OK ((HRESULT)0x00000000L) #endif +#define STRSAFE_MIN(a,b) (((a) < (b))?(a):(b)) + #ifndef _HRESULT_DEFINED #define _HRESULT_DEFINED typedef long HRESULT; @@ -75,6 +89,7 @@ typedef unsigned long STRSAFE_DWORD; #define StringCbCatEx StringCbCatExW #define StringCbCatN StringCbCatNW #define StringCbCatNEx StringCbCatNExW +#define StringCbCatWorker StringCxxCatWorkerW #define StringCbCopy StringCbCopyW #define StringCbCopyEx StringCbCopyExW #define StringCbCopyN StringCbCopyNW @@ -90,6 +105,7 @@ typedef unsigned long STRSAFE_DWORD; #define StringCchCatEx StringCchCatExW #define StringCchCatN StringCchCatNW #define StringCchCatNEx StringCchCatNExW +#define StringCchCatWorker StringCchCatWorkerW #define StringCchCopy StringCchCopyW #define StringCchCopyEx StringCchCopyExW #define StringCchCopyN StringCchCopyNW @@ -112,6 +128,7 @@ typedef unsigned long STRSAFE_DWORD; #define StringCbCatEx StringCbCatExA #define StringCbCatN StringCbCatNA #define StringCbCatNEx StringCbCatNExA +#define StringCbCatWorker StringCxxCatWorkerA #define StringCbCopy StringCbCopyA #define StringCbCopyEx StringCbCopyExA #define StringCbCopyN StringCbCopyNA @@ -127,6 +144,7 @@ typedef unsigned long STRSAFE_DWORD; #define StringCchCatEx StringCchCatExA #define StringCchCatN StringCchCatNA #define StringCchCatNEx StringCchCatNExA +#define StringCchCatWorker StringCchCatWorkerA #define StringCchCopy StringCchCopyA #define StringCchCopyEx StringCchCopyExA #define StringCchCopyN StringCchCopyNA @@ -156,6 +174,7 @@ typedef unsigned long STRSAFE_DWORD; #define StringCxxCatEx StringCbCatEx #define StringCxxCatN StringCbCatN #define StringCxxCatNEx StringCbCatNEx +#define StringCxxCatWorker StringCbCatWorker #define StringCxxCopy StringCbCopy #define StringCxxCopyEx StringCbCopyEx #define StringCxxCopyN StringCbCopyN @@ -178,6 +197,7 @@ typedef unsigned long STRSAFE_DWORD; #define StringCxxCatEx StringCchCatEx #define StringCxxCatN StringCchCatN #define StringCxxCatNEx StringCchCatNEx +#define StringCxxCatWorker StringCchCatWorker #define StringCxxCopy StringCchCopy #define StringCxxCopyEx StringCchCopyEx #define StringCxxCopyN StringCchCopyN @@ -218,24 +238,86 @@ STRSAFEAPI StringCxxVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPT /* Create inlined versions */ #define STRSAFEAPI HRESULT static __inline__ +STRSAFEAPI StringCxxCatWorker(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cxMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, int UseN) +{ + HRESULT result; + STRSAFE_LPTSTR psz = pszDest; + size_t cch = STRSAFE_CXXtoCCH(cxDest); + + if (!pszDest || !pszSrc || cch > STRSAFE_MAX_CCH || cch == 0) + { + return STRSAFE_E_INVALID_PARAMETER; + } + + for (--psz; *(++psz) != 0 && --cch > 0;); + if (cch == 0) + { + return STRSAFE_E_INSUFFICIENT_BUFFER; + } + + if (UseN) + { + cch = STRSAFE_MIN(cxDest, STRSAFE_CXXtoCCH(cxMaxAppend)); + } + + for (--pszSrc, --psz; (*(++psz) = *(++pszSrc)) != 0 && --cch > 0;); + if (cch == 0) + { + result = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else + result = S_OK; + + if (ppszDestEnd) + { + *ppszDestEnd = psz; + } + + if (pcbRemaining) + { + *pcbRemaining = STRSAFE_CCHtoCXX(cch); + } + + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + for (--psz, ++cch; --cch; *(++psz) = dwFlags & 0xff); + } + + if (!SUCCEEDED(result)) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + cch = STRSAFE_CXXtoCCH(cxDest); + for (--pszDest, ++cch; --cch; *(++pszDest) = dwFlags & 0xff); + } + + if (dwFlags & STRSAFE_NULL_ON_FAILURE) + { + *pszDest = 0; + } + } + + return result; +} + +STRSAFEAPI StringCxxCatEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) +{ + return StringCxxCatWorker(pszDest, cxDest, pszSrc, 0, ppszDestEnd, pcbRemaining, dwFlags, 0); +} + STRSAFEAPI StringCxxCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc) { - return 0; // FIXME + return StringCxxCatWorker(pszDest, cxDest, pszSrc, 0, NULL, NULL, 0, 0); } -STRSAFEAPI StringCxxCatEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) +STRSAFEAPI StringCxxCatN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend) { - return 0; // FIXME + return StringCxxCatWorker(pszDest, cxDest, pszSrc, cbMaxAppend, NULL, NULL, 0, 1); } -STRSAFEAPI StringCxxCatN(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend) +STRSAFEAPI StringCxxCatNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) { - return 0; // FIXME -} - -STRSAFEAPI StringCxxCatNEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags) -{ - return 0; // FIXME + return StringCxxCatWorker(pszDest, cxDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags, 1); } STRSAFEAPI StringCxxCopy(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPCTSTR pszSrc) @@ -331,6 +413,7 @@ STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTS #undef StringCxxCatEx #undef StringCxxCatN #undef StringCxxCatNEx +#undef StringCxxCatWorker #undef StringCxxCopy #undef StringCxxCopyEx #undef StringCxxCopyN @@ -347,6 +430,7 @@ STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTS #undef StringCbCatEx #undef StringCbCatN #undef StringCbCatNEx +#undef StringCbCatWorker #undef StringCbCopy #undef StringCbCopyEx #undef StringCbCopyN @@ -362,6 +446,7 @@ STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cbDest, STRSAFE_LPTS #undef StringCchCatEx #undef StringCchCatN #undef StringCchCatNEx +#undef StringCchCatWorker #undef StringCchCopy #undef StringCchCopyEx #undef StringCchCopyN From 89f1272447b6e7e4509ce238a705e99b75491dbc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 3 Sep 2008 00:44:50 +0000 Subject: [PATCH 227/388] compatability fixes, so some hal code can be shared svn path=/branches/ros-amd64-bringup/; revision=35902 --- reactos/hal/halx86/generic/timer.c | 4 ++-- reactos/hal/halx86/include/bus.h | 8 ++++---- reactos/hal/halx86/include/hal.h | 4 ++++ reactos/hal/halx86/include/halp.h | 11 +++++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/reactos/hal/halx86/generic/timer.c b/reactos/hal/halx86/generic/timer.c index 0149b8a3394..74f237f984e 100644 --- a/reactos/hal/halx86/generic/timer.c +++ b/reactos/hal/halx86/generic/timer.c @@ -48,7 +48,7 @@ HalpInitializeClock(VOID) PKPRCB Prcb = KeGetCurrentPrcb(); ULONG Increment; USHORT RollOver; - ULONG Flags = 0; + ULONG_PTR Flags = 0; /* Check the CPU Type */ if (Prcb->CpuType <= 4) @@ -92,7 +92,7 @@ NTAPI HalCalibratePerformanceCounter(IN volatile PLONG Count, IN ULONGLONG NewCount) { - ULONG Flags = 0; + ULONG_PTR Flags = 0; /* Disable interrupts */ Ke386SaveFlags(Flags); diff --git a/reactos/hal/halx86/include/bus.h b/reactos/hal/halx86/include/bus.h index 262efeea1b9..9f58d4055e0 100644 --- a/reactos/hal/halx86/include/bus.h +++ b/reactos/hal/halx86/include/bus.h @@ -43,7 +43,7 @@ #define TYPE1_READ(x, y) \ TYPE1_START(x, y) \ *((POINTER_TO_(y))Buffer) = \ - READ_FROM(y)((POINTER_TO_(y))(BusData->Config.Type1.Data + i)); \ + READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i)); \ TYPE1_END(y) // @@ -51,7 +51,7 @@ // #define TYPE1_WRITE(x, y) \ TYPE1_START(x, y) \ - WRITE_TO(y)((POINTER_TO_(y))(BusData->Config.Type1.Data + i), \ + WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i), \ *((POINTER_TO_(y))Buffer)); \ TYPE1_END(y) @@ -69,7 +69,7 @@ #define TYPE2_READ(x, y) \ TYPE2_START(x, y) \ *((POINTER_TO_(y))Buffer) = \ - READ_FROM(y)((POINTER_TO_(y))(ULONG)PciCfg->u.AsUSHORT); \ + READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT); \ TYPE2_END(y) // @@ -77,7 +77,7 @@ // #define TYPE2_WRITE(x, y) \ TYPE2_START(x, y) \ - WRITE_TO(y)((POINTER_TO_(y))(ULONG)PciCfg->u.AsUSHORT, \ + WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT, \ *((POINTER_TO_(y))Buffer)); \ TYPE2_END(y) diff --git a/reactos/hal/halx86/include/hal.h b/reactos/hal/halx86/include/hal.h index caedc2efd78..15a8f3f8508 100644 --- a/reactos/hal/halx86/include/hal.h +++ b/reactos/hal/halx86/include/hal.h @@ -35,7 +35,11 @@ /* Internal kernel headers */ #include "internal/pci.h" +#ifdef _M_AMD64 +#include "internal/amd64/intrin_i.h" +#else #include "internal/i386/intrin_i.h" +#endif /* Internal HAL Headers */ #include "apic.h" diff --git a/reactos/hal/halx86/include/halp.h b/reactos/hal/halx86/include/halp.h index e1b91270914..32d8c6b1f5a 100644 --- a/reactos/hal/halx86/include/halp.h +++ b/reactos/hal/halx86/include/halp.h @@ -154,6 +154,17 @@ HalpTrap06( VOID ); +#ifdef _M_AMD64 +#define KfLowerIrql KeLowerIrql +#ifndef CONFIG_SMP +/* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ +#define KiAcquireSpinLock(SpinLock) +#define KiReleaseSpinLock(SpinLock) +#define KfAcquireSpinLock(SpinLock) KfRaiseIrql(DISPATCH_LEVEL); +#define KfReleaseSpinLock(SpinLock, OldIrql) KeLowerIrql(OldIrql); +#endif // !CONFIG_SMP +#endif // _M_AMD64 + extern PVOID HalpRealModeStart; extern PVOID HalpRealModeEnd; From 230d01477441b085b94d57c825e849dc19dc0099 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 3 Sep 2008 00:49:04 +0000 Subject: [PATCH 228/388] "fix" Ke386SaveFlags and Ke386RestoreFlags svn path=/branches/ros-amd64-bringup/; revision=35903 --- reactos/ntoskrnl/include/internal/amd64/intrin_i.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h index 2af9056f3f1..9eae07d6ea8 100644 --- a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -68,8 +68,8 @@ static __inline__ __attribute__((always_inline)) void __str(unsigned short *Dest : /* no outputs */ \ : "m" (X)); -#define Ke386SaveFlags(x) __asm__ __volatile__("pushfq ; popq %0":"=g" (x): /* no input */) -#define Ke386RestoreFlags(x) __asm__ __volatile__("pushq %0 ; popfq": /* no output */ :"g" (x):"memory") +#define Ke386SaveFlags(x) __asm__ __volatile__("pushfq ; popq %0":"=rm" (x): /* no input */) +#define Ke386RestoreFlags(x) __asm__ __volatile__("pushq %0 ; popfq": /* no output */ :"irm" (x):"memory") #define _Ke386GetSeg(N) ({ \ unsigned int __d; \ From f96e66ec8815c9dde9e3f97ad103829607ef6a6a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 3 Sep 2008 00:52:40 +0000 Subject: [PATCH 229/388] update the hal/hal svn path=/branches/ros-amd64-bringup/; revision=35904 --- reactos/hal/hal/hal.c | 10 +++++++-- reactos/hal/hal/hal.rbuild | 3 +-- reactos/hal/hal/hal_amd64.def | 39 +++++++++++++++++++++++++---------- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index d3c3aa26920..37c772f3958 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -74,7 +74,8 @@ HalSetProfileInterval(IN ULONG_PTR Interval) KEBUGCHECK(0); return Interval; } -#if 0 + +#ifndef _M_AMD64 VOID FASTCALL ExAcquireFastMutex( @@ -784,6 +785,7 @@ KeFlushWriteBuffer(VOID) UNIMPLEMENTED; } +#ifndef _M_AMD64 #undef KeGetCurrentIrql KIRQL NTAPI @@ -802,6 +804,7 @@ KeLowerIrql( { UNIMPLEMENTED; } +#endif LARGE_INTEGER @@ -818,6 +821,7 @@ KeQueryPerformanceCounter( return Value; } +#if 0 #undef KeRaiseIrql VOID NTAPI @@ -847,6 +851,7 @@ KeRaiseIrqlToSynchLevel(VOID) return (KIRQL)0; } +#endif #undef KeReleaseSpinLock VOID @@ -891,7 +896,7 @@ KeTryToAcquireQueuedSpinLockRaiseToSynch( return FALSE; } - +#if !defined(_M_AMD64) KIRQL FASTCALL KfAcquireSpinLock( @@ -931,6 +936,7 @@ KfReleaseSpinLock( { UNIMPLEMENTED; } +#endif #if !defined(_M_AMD64) VOID diff --git a/reactos/hal/hal/hal.rbuild b/reactos/hal/hal/hal.rbuild index df21161f11b..8d7628a69b6 100644 --- a/reactos/hal/hal/hal.rbuild +++ b/reactos/hal/hal/hal.rbuild @@ -36,11 +36,10 @@ include - halamd64_generic ntoskrnl + hal.c hal.rc - hal.spec diff --git a/reactos/hal/hal/hal_amd64.def b/reactos/hal/hal/hal_amd64.def index 9a749c9e7cf..1d8fa785c0e 100644 --- a/reactos/hal/hal/hal_amd64.def +++ b/reactos/hal/hal/hal_amd64.def @@ -10,29 +10,43 @@ HalAllocateAdapterChannel HalAllocateCommonBuffer HalAllocateCrashDumpRegisters HalAssignSlotResources +;HalBugCheckSystem HalCalibratePerformanceCounter -;HalCallBios HalClearSoftwareInterrupt -HalDisableSystemInterrupt +;HalConvertDeviceIdtToIrql +;HalDisableInterrupt HalDisplayString -HalEnableSystemInterrupt +;HalEnableInterrupt +;HalEnumerateEnvironmentVariablesEx +;HalEnumerateProcessors HalFlushCommonBuffer HalFreeCommonBuffer HalGetAdapter HalGetBusData HalGetBusDataByOffset HalGetEnvironmentVariable +;HalGetEnvironmentVariableEx +;HalGetInterruptTargetInformation HalGetInterruptVector +;HalGetMessageRoutingInfo +;HalGetProcessorIdByNtNumber +;HalGetVectorInput ;HalHandleMcheck HalHandleNMI HalInitSystem +;HalInitializeBios +;HalInitializeOnResume HalInitializeProcessor ;HalIsHyperThreadingEnabled HalMakeBeep HalProcessorIdle HalQueryDisplayParameters +;HalQueryEnvironmentVariableInfoEx +;HalQueryMaximumProcessorCount HalQueryRealTimeClock HalReadDmaCounter +;HalRegisterDynamicProcessor +;HalRegisterErrataCallbacks HalReportResourceUsage HalRequestIpi HalRequestSoftwareInterrupt @@ -43,27 +57,30 @@ HalSetBusData HalSetBusDataByOffset HalSetDisplayParameters HalSetEnvironmentVariable +;HalSetEnvironmentVariableEx HalSetProfileInterval HalSetRealTimeClock HalSetTimeIncrement +;HalStartDynamicProcessor HalStartNextProcessor HalStartProfileInterrupt HalStopProfileInterrupt HalSystemVectorDispatchEntry HalTranslateBusAddress -;IoAssignDriveLetters +IoAssignDriveLetters IoFlushAdapterBuffers IoFreeAdapterChannel IoFreeMapRegisters IoMapTransfer -;IoReadPartitionTable -;IoSetPartitionInformation -;IoWritePartitionTable +IoReadPartitionTable +IoSetPartitionInformation +IoWritePartitionTable KdComPortInUse=_KdComPortInUse DATA KeFlushWriteBuffer KeQueryPerformanceCounter KeStallExecutionProcessor -;x86BiosExecuteInterrupt -;x86BiosInitializeBiosEx -;x86BiosTranslateAddress -;DllEntryPoint +;x86BiosAllocateBuffer +;x86BiosCall +;x86BiosFreeBuffer +;x86BiosReadMemory +;x86BiosWriteMemory From 4463d32144495a271e8cab1f7f9434a4606db26b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 3 Sep 2008 01:10:10 +0000 Subject: [PATCH 230/388] implement hal reusing most code from x86 svn path=/branches/ros-amd64-bringup/; revision=35905 --- reactos/hal/hal.rbuild | 4 + reactos/hal/halamd64/generic/generic.rbuild | 21 +- reactos/hal/halamd64/generic/halinit.c | 170 +++++++++++ reactos/hal/halamd64/generic/irq.S | 93 ++++++ reactos/hal/halamd64/generic/misc.c | 105 +++++++ reactos/hal/halamd64/generic/systimer.S | 258 +++++++++++++++++ reactos/hal/halamd64/include/bus.h | 296 ++++++++++++++++++++ reactos/hal/halamd64/include/hal.h | 21 +- reactos/hal/halamd64/include/halp.h | 160 ++++++++++- reactos/hal/halamd64/up/halup.rbuild | 11 +- reactos/hal/halamd64/up/processor.c | 87 ++++++ reactos/hal/halx86/hal_generic_amd64.rbuild | 28 ++ 12 files changed, 1229 insertions(+), 25 deletions(-) create mode 100644 reactos/hal/halamd64/generic/halinit.c create mode 100644 reactos/hal/halamd64/generic/irq.S create mode 100644 reactos/hal/halamd64/generic/misc.c create mode 100644 reactos/hal/halamd64/generic/systimer.S create mode 100644 reactos/hal/halamd64/include/bus.h create mode 100644 reactos/hal/halamd64/up/processor.c create mode 100644 reactos/hal/halx86/hal_generic_amd64.rbuild diff --git a/reactos/hal/hal.rbuild b/reactos/hal/hal.rbuild index 568dcbdf9d4..588040a58a0 100644 --- a/reactos/hal/hal.rbuild +++ b/reactos/hal/hal.rbuild @@ -25,6 +25,10 @@ + + + + diff --git a/reactos/hal/halamd64/generic/generic.rbuild b/reactos/hal/halamd64/generic/generic.rbuild index 4c14a41f768..2b69e20d3b6 100644 --- a/reactos/hal/halamd64/generic/generic.rbuild +++ b/reactos/hal/halamd64/generic/generic.rbuild @@ -1,10 +1,15 @@ - - ../include - include - - - hal.c - ../include/hal.h - + + + ../include + include + + + halinit.c + irq.S + misc.c + systimer.S + ../include/hal.h + + diff --git a/reactos/hal/halamd64/generic/halinit.c b/reactos/hal/halamd64/generic/halinit.c new file mode 100644 index 00000000000..d3d834bf19a --- /dev/null +++ b/reactos/hal/halamd64/generic/halinit.c @@ -0,0 +1,170 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: GPL - See COPYING in the top level directory + * FILE: hal/halx86/generic/halinit.c + * PURPOSE: HAL Entrypoint and Initialization + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +BOOLEAN HalpPciLockSettings; + +/* PRIVATE FUNCTIONS *********************************************************/ + +VOID +NTAPI +HalpGetParameters(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PCHAR CommandLine; + + /* Make sure we have a loader block and command line */ + if ((LoaderBlock) && (LoaderBlock->LoadOptions)) + { + /* Read the command line */ + CommandLine = LoaderBlock->LoadOptions; + + /* Check if PCI is locked */ + if (strstr(CommandLine, "PCILOCK")) HalpPciLockSettings = TRUE; + + /* Check for initial breakpoint */ + if (strstr(CommandLine, "BREAK")) DbgBreakPoint(); + } +} + +/* FUNCTIONS *****************************************************************/ + +NTSTATUS +NTAPI +DriverEntry( + PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) +{ + UNIMPLEMENTED; + + return STATUS_SUCCESS; +} + +/* + * @implemented + */ +BOOLEAN +NTAPI +HalInitSystem(IN ULONG BootPhase, + IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + PKPRCB Prcb = KeGetCurrentPrcb(); + + /* Check the boot phase */ + if (!BootPhase) + { + /* Phase 0... save bus type */ + HalpBusType = LoaderBlock->u.I386.MachineType & 0xFF; + + /* Get command-line parameters */ + HalpGetParameters(LoaderBlock); + + /* Checked HAL requires checked kernel */ +#if DBG + if (!(Prcb->BuildType & PRCB_BUILD_DEBUG)) + { + /* No match, bugcheck */ + KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 1, 0); + } +#else + /* Release build requires release HAL */ + if (Prcb->BuildType & PRCB_BUILD_DEBUG) + { + /* No match, bugcheck */ + KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0); + } +#endif + +#ifdef CONFIG_SMP + /* SMP HAL requires SMP kernel */ + if (Prcb->BuildType & PRCB_BUILD_UNIPROCESSOR) + { + /* No match, bugcheck */ + KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0); + } +#endif + + /* Validate the PRCB */ + if (Prcb->MajorVersion != PRCB_MAJOR_VERSION) + { + /* Validation failed, bugcheck */ + KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0); + } +DPRINT1("HalInitSystem 2\n"); + /* Initialize the PICs */ + HalpInitPICs(); +DPRINT1("HalInitSystem 3\n"); + /* Force initial PIC state */ + KfRaiseIrql(KeGetCurrentIrql()); +DPRINT1("HalInitSystem 4\n"); + /* Initialize the clock */ + HalpInitializeClock(); +DPRINT1("HalInitSystem 5\n"); + /* Setup busy waiting */ + //HalpCalibrateStallExecution(); + + /* Fill out the dispatch tables */ + HalQuerySystemInformation = HaliQuerySystemInformation; + HalSetSystemInformation = HaliSetSystemInformation; + HalInitPnpDriver = NULL; // FIXME: TODO +// HalGetDmaAdapter = HalpGetDmaAdapter; + HalGetInterruptTranslator = NULL; // FIXME: TODO +// HalResetDisplay = HalpBiosDisplayReset; +DPRINT1("HalInitSystem 6\n"); + /* Initialize the hardware lock (CMOS) */ + KeInitializeSpinLock(&HalpSystemHardwareLock); + + /* Do some HAL-specific initialization */ + HalpInitPhase0(LoaderBlock); + } + else if (BootPhase == 1) + { + /* Initialize the default HAL stubs for bus handling functions */ + HalpInitNonBusHandler(); + + /* Enable the clock interrupt */ + PKIDTENTRY64 IdtEntry = &((PKIPCR)KeGetPcr())->IdtBase[0x30]; + IdtEntry->OffsetLow = (((ULONG_PTR)HalpClockInterrupt) & 0xFFFF); + IdtEntry->OffsetMiddle = (((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF); + IdtEntry->OffsetHigh = ((ULONG_PTR)HalpClockInterrupt >> 32); +// HalEnableSystemInterrupt(0x30, CLOCK_LEVEL, Latched); + + /* Initialize DMA. NT does this in Phase 0 */ + HalpInitDma(); + + /* Do some HAL-specific initialization */ + HalpInitPhase1(); + } + + /* All done, return */ + return TRUE; +} + +/* + * @unimplemented + */ +VOID +NTAPI +HalReportResourceUsage(VOID) +{ + /* Initialize PCI bus. */ + HalpInitializePciBus(); + + /* FIXME: This is done in ReactOS MP HAL only*/ + //HaliReconfigurePciInterrupts(); + + /* FIXME: Report HAL Usage to kernel */ +} + +/* EOF */ diff --git a/reactos/hal/halamd64/generic/irq.S b/reactos/hal/halamd64/generic/irq.S new file mode 100644 index 00000000000..dc1f6d44b5b --- /dev/null +++ b/reactos/hal/halamd64/generic/irq.S @@ -0,0 +1,93 @@ +/* + * FILE: hal/halx86/generic/irq.S + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: Software, System and Hardware IRQ Management + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include +.intel_syntax noprefix + +.macro UNIMPLEMENTED func + jmp 2f +1: + .ascii "Sory, asm function " + .ascii func + .ascii " is unimplemented!\n\0" +2: + movabs rcx, offset 1b + call _DbgPrint + ret +.endm + + + +/* GLOBALS *******************************************************************/ + + + +/* FUNCTIONS *****************************************************************/ + +.globl _HalpInitPICs +.func _HalpInitPICs +_HalpInitPICs: +UNIMPLEMENTED "HalpInitPICs" + +.endfunc + +.globl _HalClearSoftwareInterrupt +.func _HalClearSoftwareInterrupt +_HalClearSoftwareInterrupt: + + /* Get IRR mask */ + mov eax, 1 + shl eax, cl + not eax + + /* Set IRR */ +// and gs:[KPCR_IRR], eax + ret +.endfunc + +.globl _HalRequestSoftwareInterrupt +.func _HalRequestSoftwareInterrupt +_HalRequestSoftwareInterrupt: +UNIMPLEMENTED "HalRequestSoftwareInterrupt" +.endfunc + +.globl _HalBeginSystemInterrupt +.func _HalBeginSystemInterrupt +_HalBeginSystemInterrupt: +UNIMPLEMENTED "HalBeginSystemInterrupt" +.endfunc + +.globl _HalpApcInterrupt +.func _HalpApcInterrupt +//TRAP_FIXUPS hapc_a, hapc_t, DoFixupV86, DoFixupAbios +_HalpApcInterrupt: +UNIMPLEMENTED "HalpApcInterrupt" +.endfunc + +.globl _HalpApcInterrupt2ndEntry +.func _HalpApcInterrupt2ndEntry +_HalpApcInterrupt2ndEntry: +UNIMPLEMENTED "HalpApcInterrupt2ndEntry" +.endfunc + +.globl _HalpDispatchInterrupt +.func _HalpDispatchInterrupt +//TRAP_FIXUPS hdpc_a, hdpc_t, DoFixupV86, DoFixupAbios +_HalpDispatchInterrupt: +UNIMPLEMENTED "HalpDispatchInterrupt" +.endfunc + + +.globl _HalpDispatchInterrupt2ndEntry +.func _HalpDispatchInterrupt2ndEntry +_HalpDispatchInterrupt2ndEntry: +UNIMPLEMENTED "HalpDispatchInterrupt2ndEntry" +.endfunc + diff --git a/reactos/hal/halamd64/generic/misc.c b/reactos/hal/halamd64/generic/misc.c new file mode 100644 index 00000000000..7eb1d9170f9 --- /dev/null +++ b/reactos/hal/halamd64/generic/misc.c @@ -0,0 +1,105 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: GPL - See COPYING in the top level directory + * FILE: hal/halx86/generic/misc.c + * PURPOSE: Miscellanous Routines + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + * Eric Kohl (ekohl@abo.rhein-zeitung.de) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +/* PRIVATE FUNCTIONS *********************************************************/ + +VOID +NTAPI +HalpCheckPowerButton(VOID) +{ + /* Nothing to do on non-ACPI */ + return; +} + +PVOID +NTAPI +HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, + IN ULONG NumberPage) +{ + /* Use kernel memory manager I/O map facilities */ + return MmMapIoSpace(PhysicalAddress, + NumberPage << PAGE_SHIFT, + MmNonCached); +} + +VOID +NTAPI +HalpUnmapVirtualAddress(IN PVOID VirtualAddress, + IN ULONG NumberPages) +{ + /* Use kernel memory manager I/O map facilities */ + MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT); +} + +/* FUNCTIONS *****************************************************************/ + +/* + * @implemented + */ +VOID +NTAPI +HalHandleNMI(IN PVOID NmiInfo) +{ + UCHAR ucStatus; + + /* Get the NMI Flag */ + ucStatus = READ_PORT_UCHAR((PUCHAR)0x61); + + /* Display NMI failure string */ + HalDisplayString ("\n*** Hardware Malfunction\n\n"); + HalDisplayString ("Call your hardware vendor for support\n\n"); + + /* Check for parity error */ + if (ucStatus & 0x80) + { + /* Display message */ + HalDisplayString ("NMI: Parity Check / Memory Parity Error\n"); + } + + /* Check for I/O failure */ + if (ucStatus & 0x40) + { + /* Display message */ + HalDisplayString ("NMI: Channel Check / IOCHK\n"); + } + + /* Halt the system */ + HalDisplayString("\n*** The system has halted ***\n"); + //KeEnterKernelDebugger(); +} + +/* + * @implemented + */ +BOOLEAN +FASTCALL +HalSystemVectorDispatchEntry(IN ULONG Vector, + OUT PKINTERRUPT_ROUTINE **FlatDispatch, + OUT PKINTERRUPT_ROUTINE *NoConnection) +{ + /* Not implemented on x86 */ + return FALSE; +} + +/* + * @implemented + */ +VOID +NTAPI +KeFlushWriteBuffer(VOID) +{ + /* Not implemented on x86 */ + return; +} diff --git a/reactos/hal/halamd64/generic/systimer.S b/reactos/hal/halamd64/generic/systimer.S new file mode 100644 index 00000000000..298cea2619f --- /dev/null +++ b/reactos/hal/halamd64/generic/systimer.S @@ -0,0 +1,258 @@ +/* + * FILE: hal/halx86/generic/timer.S + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: System Timer Interrupt and Management + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +#include +#include +.intel_syntax noprefix + +/* GLOBALS *******************************************************************/ + +_HalpLastPerfCounterLow: .long 0 +_HalpLastPerfCounterHigh: .long 0 +_HalpPerfCounterLow: .long 0 +_HalpPerfCounterHigh: .long 0 + +_UnhandledMsg: + .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n" + +/* FUNCTIONS *****************************************************************/ + +.globl _KeStallExecutionProcessor +.func KeStallExecutionProcessor +_KeStallExecutionProcessor: + + /* Get the number of microseconds required */ + jecxz Done + + /* Multiply by the stall factor */ + mov eax, gs:[KPCR_STALL_SCALE_FACTOR] + mul ecx + + /* Align to 16 bytes */ + .align 16 + + /* Jump to subtraction loop */ + jmp SubtractLoop + + /* Align to 16 bytes */ + .align 16 + + /* Subtract one count */ +SubtractLoop: + sub eax, 1 + jnz SubtractLoop + +Done: + /* Return */ + ret 4 +.endfunc + +.global _KeQueryPerformanceCounter +.func KeQueryPerformanceCounter +_KeQueryPerformanceCounter: + + /* Check if we were called too early */ + cmp dword ptr _HalpCurrentRollOver, 0 + je NoCount + + /* Save volatiles */ + push rbx + push rsi + +LoopPreInt: + + /* Disable interrupts */ + pushf + cli + +LoopPostInt: + + /* Get the current value */ + mov ebx, _HalpPerfCounterLow + mov esi, _HalpPerfCounterHigh + + /* Read 8254 timer */ + mov al, 0 + out 0x43, al + jmp $+2 + in al, 0x40 + jmp $+2 + movzx ecx, al + in al, 0x40 + mov ch, al + + /* Enable interrupts and do a short wait */ + popf + nop + jmp $+2 + + /* Disable them again */ + pushf + cli + + /* Get the counter value again */ + mov eax, _HalpPerfCounterLow + mov edx, _HalpPerfCounterHigh + + /* Check if someone updated the counter */ + cmp eax, ebx + jnz LoopPostInt + cmp edx, esi + jnz LoopPostInt + + /* Check if the current 8254 value causes rollover */ + neg ecx + add ecx, _HalpCurrentRollOver + jnb DoRollOver + +SetSum: + + /* Calculate the sum */ + add eax, ecx + adc edx, 0 + + /* Check if we're above or below the last high value */ + cmp edx, _HalpLastPerfCounterHigh + jb short BelowHigh + jnz short BelowLow + + /* Check if we're above or below the last low value */ + cmp eax, _HalpLastPerfCounterLow + jb BelowHigh + +BelowLow: + + /* Update the last value and bring back interrupts */ + mov _HalpLastPerfCounterLow, eax + mov _HalpLastPerfCounterHigh, edx + popf + + /* Check if caller wants frequency */ + cmp dword ptr [esp+12], 0 + jz ReturnNoFreq + + /* Save hard-coded frequency */ + mov ecx, dword ptr [esp+12] + mov dword ptr [ecx], 1193182 + mov dword ptr [ecx+4], 0 + +ReturnNoFreq: + + /* Restore volatiles */ + pop rsi + pop rbx + ret 4 + +NoCount: + + /* Return empty, called too soon */ + mov eax, 0 + mov edx, 0 + ret 4 + +DoRollOver: + + /* We might have an incoming interrupt, save EFLAGS and reset rollover */ + mov esi, [esp] + mov ecx, _HalpCurrentRollOver + popf + + /* Check if interrupts were enabled and try again */ + test esi, EFLAGS_INTERRUPT_MASK + jnz LoopPreInt + + /* They're not, continue where we left */ + pushf + jmp SetSum + +BelowHigh: + + /* Get the last counter values */ + mov ebx, _HalpLastPerfCounterLow + mov esi, _HalpLastPerfCounterHigh + + /* Check if the previous value was 0 and go back if yes */ + mov ecx, ebx + or ecx, esi + jz BelowLow + + /* Make sure that the count is still valid */ + sub ebx, eax + sbb esi, edx + jnz InvalidCount + cmp ebx, _HalpCurrentRollOver + jg InvalidCount + + /* Fixup the count with the last known value */ + sub eax, ebx + sbb edx, esi + + /* We might have an incoming interrupt, save EFLAGS */ + mov ecx, [esp] + popf + + /* Check if interrupts were enabled and try again */ + test ecx, EFLAGS_INTERRUPT_MASK + jnz LoopPreInt + + /* They're not, continue where we left */ + pushf + jmp BelowLow + +InvalidCount: + popf + xor eax, eax + mov _HalpLastPerfCounterLow, eax + mov _HalpLastPerfCounterHigh, eax + jmp LoopPreInt +.endfunc + +.globl _HalpClockInterrupt +.func HalpClockInterrupt +//TRAP_FIXUPS hci_a, hci_t, DoFixupV86, DoFixupAbios +_HalpClockInterrupt: + + /* Enter trap */ +// INT_PROLOG hci_a, hci_t, DoPushFakeErrorCode + + /* Push vector and make stack for IRQL */ + push 0x30 + sub esp, 4 + + /* Begin the interrupt */ + push rsp + push 0x30 + push CLOCK_LEVEL +// call _HalBeginSystemInterrupt + + /* Check if it's spurious */ + or al, al + jz Spurious + + /* Update the performance counter */ + xor ebx, ebx + mov eax, _HalpCurrentRollOver + add _HalpPerfCounterLow, eax + adc _HalpPerfCounterHigh, ebx + + /* Get the time increment and check if someone changed the clock rate */ + mov eax, _HalpCurrentTimeIncrement + cmp _HalpClockSetMSRate, ebx + jz _KeUpdateSystemTime + + /* FIXME: Someone did! */ + int 3 + +Spurious: + + /* Exit the interrupt */ + add esp, 8 +// jmp _Kei386EoiHelper +.endfunc + diff --git a/reactos/hal/halamd64/include/bus.h b/reactos/hal/halamd64/include/bus.h new file mode 100644 index 00000000000..9f58d4055e0 --- /dev/null +++ b/reactos/hal/halamd64/include/bus.h @@ -0,0 +1,296 @@ +#ifndef __INTERNAL_HAL_BUS_H +#define __INTERNAL_HAL_BUS_H + +// +// Helper Macros +// +#define PASTE2(x,y) x ## y +#define POINTER_TO_(x) PASTE2(P,x) +#define READ_FROM(x) PASTE2(READ_PORT_, x) +#define WRITE_TO(x) PASTE2(WRITE_PORT_, x) + +// +// Declares a PCI Register Read/Write Routine +// +#define TYPE_DEFINE(x, y) \ + ULONG \ + NTAPI \ + x( \ + IN PPCIPBUSDATA BusData, \ + IN y PciCfg, \ + IN PUCHAR Buffer, \ + IN ULONG Offset \ + ) +#define TYPE1_DEFINE(x) TYPE_DEFINE(x, PPCI_TYPE1_CFG_BITS); +#define TYPE2_DEFINE(x) TYPE_DEFINE(x, PPCI_TYPE2_ADDRESS_BITS); + +// +// Defines a PCI Register Read/Write Type 1 Routine Prologue and Epilogue +// +#define TYPE1_START(x, y) \ + TYPE_DEFINE(x, PPCI_TYPE1_CFG_BITS) \ +{ \ + ULONG i = Offset % sizeof(ULONG); \ + PciCfg->u.bits.RegisterNumber = Offset / sizeof(ULONG); \ + WRITE_PORT_ULONG(BusData->Config.Type1.Address, PciCfg->u.AsULONG); +#define TYPE1_END(y) \ + return sizeof(y); } +#define TYPE2_END TYPE1_END + +// +// PCI Register Read Type 1 Routine +// +#define TYPE1_READ(x, y) \ + TYPE1_START(x, y) \ + *((POINTER_TO_(y))Buffer) = \ + READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i)); \ + TYPE1_END(y) + +// +// PCI Register Write Type 1 Routine +// +#define TYPE1_WRITE(x, y) \ + TYPE1_START(x, y) \ + WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i), \ + *((POINTER_TO_(y))Buffer)); \ + TYPE1_END(y) + +// +// Defines a PCI Register Read/Write Type 2 Routine Prologue and Epilogue +// +#define TYPE2_START(x, y) \ + TYPE_DEFINE(x, PPCI_TYPE2_ADDRESS_BITS) \ +{ \ + PciCfg->u.bits.RegisterNumber = (USHORT)Offset; + +// +// PCI Register Read Type 2 Routine +// +#define TYPE2_READ(x, y) \ + TYPE2_START(x, y) \ + *((POINTER_TO_(y))Buffer) = \ + READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT); \ + TYPE2_END(y) + +// +// PCI Register Write Type 2 Routine +// +#define TYPE2_WRITE(x, y) \ + TYPE2_START(x, y) \ + WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT, \ + *((POINTER_TO_(y))Buffer)); \ + TYPE2_END(y) + +typedef struct _PCIPBUSDATA +{ + PCIBUSDATA CommonData; + union + { + struct + { + PULONG Address; + ULONG Data; + } Type1; + struct + { + PUCHAR CSE; + PUCHAR Forward; + ULONG Base; + } Type2; + } Config; + ULONG MaxDevice; +} PCIPBUSDATA, *PPCIPBUSDATA; + +typedef ULONG +(NTAPI *FncConfigIO)( + IN PPCIPBUSDATA BusData, + IN PVOID State, + IN PUCHAR Buffer, + IN ULONG Offset +); + +typedef VOID +(NTAPI *FncSync)( + IN PBUS_HANDLER BusHandler, + IN PCI_SLOT_NUMBER Slot, + IN PKIRQL Irql, + IN PVOID State +); + +typedef VOID +(NTAPI *FncReleaseSync)( + IN PBUS_HANDLER BusHandler, + IN KIRQL Irql +); + +typedef struct _PCI_CONFIG_HANDLER +{ + FncSync Synchronize; + FncReleaseSync ReleaseSynchronzation; + FncConfigIO ConfigRead[3]; + FncConfigIO ConfigWrite[3]; +} PCI_CONFIG_HANDLER, *PPCI_CONFIG_HANDLER; + +typedef struct _PCI_REGISTRY_INFO_INTERNAL +{ + UCHAR MajorRevision; + UCHAR MinorRevision; + UCHAR NoBuses; + UCHAR HardwareMechanism; + ULONG ElementCount; + PCI_CARD_DESCRIPTOR CardList[ANYSIZE_ARRAY]; +} PCI_REGISTRY_INFO_INTERNAL, *PPCI_REGISTRY_INFO_INTERNAL; + +/* FUNCTIONS *****************************************************************/ + +VOID +NTAPI +HalpPCISynchronizeType1( + IN PBUS_HANDLER BusHandler, + IN PCI_SLOT_NUMBER Slot, + IN PKIRQL Irql, + IN PPCI_TYPE1_CFG_BITS PciCfg +); + +VOID +NTAPI +HalpPCIReleaseSynchronzationType1( + IN PBUS_HANDLER BusHandler, + IN KIRQL Irql +); + +VOID +NTAPI +HalpPCISynchronizeType2( + IN PBUS_HANDLER BusHandler, + IN PCI_SLOT_NUMBER Slot, + IN PKIRQL Irql, + IN PPCI_TYPE2_ADDRESS_BITS PciCfg +); + +VOID +NTAPI +HalpPCIReleaseSynchronizationType2( + IN PBUS_HANDLER BusHandler, + IN KIRQL Irql +); + +TYPE1_DEFINE(HalpPCIReadUcharType1); +TYPE1_DEFINE(HalpPCIReadUshortType1); +TYPE1_DEFINE(HalpPCIReadUlongType1); +TYPE2_DEFINE(HalpPCIReadUcharType2); +TYPE2_DEFINE(HalpPCIReadUshortType2); +TYPE2_DEFINE(HalpPCIReadUlongType2); +TYPE1_DEFINE(HalpPCIWriteUcharType1); +TYPE1_DEFINE(HalpPCIWriteUshortType1); +TYPE1_DEFINE(HalpPCIWriteUlongType1); +TYPE2_DEFINE(HalpPCIWriteUcharType2); +TYPE2_DEFINE(HalpPCIWriteUshortType2); +TYPE2_DEFINE(HalpPCIWriteUlongType2); + +BOOLEAN +NTAPI +HalpValidPCISlot( + IN PBUS_HANDLER BusHandler, + IN PCI_SLOT_NUMBER Slot +); + +VOID +NTAPI +HalpReadPCIConfig( + IN PBUS_HANDLER BusHandler, + IN PCI_SLOT_NUMBER Slot, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length +); + +VOID +NTAPI +HalpWritePCIConfig( + IN PBUS_HANDLER BusHandler, + IN PCI_SLOT_NUMBER Slot, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length +); + +ULONG +NTAPI +HalpGetSystemInterruptVector( + ULONG BusNumber, + ULONG BusInterruptLevel, + ULONG BusInterruptVector, + PKIRQL Irql, + PKAFFINITY Affinity +); + +ULONG +NTAPI +HalpGetCmosData( + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length +); + +ULONG +NTAPI +HalpSetCmosData( + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length +); + +ULONG +NTAPI +HalpGetPCIData( + IN PBUS_HANDLER BusHandler, + IN PBUS_HANDLER RootBusHandler, + IN PCI_SLOT_NUMBER SlotNumber, + IN PUCHAR Buffer, + IN ULONG Offset, + IN ULONG Length +); + +ULONG +NTAPI +HalpSetPCIData( + IN PBUS_HANDLER BusHandler, + IN PBUS_HANDLER RootBusHandler, + IN PCI_SLOT_NUMBER SlotNumber, + IN PUCHAR Buffer, + IN ULONG Offset, + IN ULONG Length +); + +NTSTATUS +NTAPI +HalpAssignPCISlotResources( + IN PBUS_HANDLER BusHandler, + IN PBUS_HANDLER RootHandler, + IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject OPTIONAL, + IN ULONG Slot, + IN OUT PCM_RESOURCE_LIST *pAllocatedResources +); + +VOID +NTAPI +HalpInitializePciBus( + VOID +); + +extern ULONG HalpBusType; +extern BOOLEAN HalpPCIConfigInitialized; +extern BUS_HANDLER HalpFakePciBusHandler; +extern ULONG HalpMinPciBus, HalpMaxPciBus; + +#endif /* __INTERNAL_HAL_BUS_H */ + +/* EOF */ + + diff --git a/reactos/hal/halamd64/include/hal.h b/reactos/hal/halamd64/include/hal.h index e16859b753f..c793782d06a 100644 --- a/reactos/hal/halamd64/include/hal.h +++ b/reactos/hal/halamd64/include/hal.h @@ -1,9 +1,9 @@ /* - * PROJECT: ReactOS HAL - * LICENSE: BSD - See COPYING.ARM in the top level directory - * FILE: hal/halarm/include/hal.h - * PURPOSE: Hardware Abstraction Layer Header - * PROGRAMMERS: ReactOS Portable Systems Group + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Hardware Abstraction Layer + * FILE: hal/halx86/include/hal.h + * PURPOSE: HAL Header + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) */ /* INCLUDES ******************************************************************/ @@ -28,14 +28,23 @@ #include #include #include -#include #include #include #include #include +/* Internal kernel headers */ +#include "internal/pci.h" +#include "internal/i386/intrin_i.h" + /* Internal HAL Headers */ +//#include "apic.h" +#include "bus.h" +//#include "halirq.h" +//#include "haldma.h" #include "halp.h" +//#include "mps.h" +//#include "ioapic.h" /* Helper Header */ #include diff --git a/reactos/hal/halamd64/include/halp.h b/reactos/hal/halamd64/include/halp.h index 9428bbd370c..e1b91270914 100644 --- a/reactos/hal/halamd64/include/halp.h +++ b/reactos/hal/halamd64/include/halp.h @@ -1,16 +1,162 @@ +/* + * + */ + #ifndef __INTERNAL_HAL_HAL_H #define __INTERNAL_HAL_HAL_H -// -// amd64 Headers -// -#include -#include +#define HAL_APC_REQUEST 0 +#define HAL_DPC_REQUEST 1 +/* CMOS Registers and Ports */ +#define CMOS_CONTROL_PORT (PUCHAR)0x70 +#define CMOS_DATA_PORT (PUCHAR)0x71 +#define RTC_REGISTER_A 0x0A +#define RTC_REGISTER_B 0x0B +#define RTC_REG_A_UIP 0x80 +#define RTC_REGISTER_CENTURY 0x32 + +/* Timer Registers and Ports */ +#define TIMER_CONTROL_PORT 0x43 +#define TIMER_DATA_PORT0 0x40 +#define TIMER_SC0 0 +#define TIMER_BOTH 0x30 +#define TIMER_MD2 0x4 + +/* Conversion functions */ +#define BCD_INT(bcd) \ + (((bcd & 0xF0) >> 4) * 10 + (bcd & 0x0F)) +#define INT_BCD(int) \ + (UCHAR)(((int / 10) << 4) + (int % 10)) + +/* adapter.c */ +PADAPTER_OBJECT STDCALL HalpAllocateAdapterEx(ULONG NumberOfMapRegisters,BOOLEAN IsMaster, BOOLEAN Dma32BitAddresses); + +/* bus.c */ +VOID NTAPI HalpInitNonBusHandler (VOID); + +/* irql.c */ +VOID NTAPI HalpInitPICs(VOID); + +/* udelay.c */ +VOID NTAPI HalpInitializeClock(VOID); + +/* pci.c */ +VOID HalpInitPciBus (VOID); + +/* dma.c */ +VOID HalpInitDma (VOID); + +/* Non-generic initialization */ +VOID HalpInitPhase0 (PLOADER_PARAMETER_BLOCK LoaderBlock); +VOID HalpInitPhase1(VOID); +VOID NTAPI HalpClockInterrupt(VOID); // -// WDK Hack +// KD Support // -#define KdComPortInUse _KdComPortInUse +VOID +NTAPI +HalpCheckPowerButton( + VOID +); + +VOID +NTAPI +HalpRegisterKdSupportFunctions( + VOID +); + +NTSTATUS +NTAPI +HalpSetupPciDeviceForDebugging( + IN PVOID LoaderBlock, + IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice +); + +NTSTATUS +NTAPI +HalpReleasePciDeviceForDebugging( + IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice +); + +// +// Memory routines +// +PVOID +NTAPI +HalpMapPhysicalMemory64( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN ULONG NumberPage +); + +VOID +NTAPI +HalpUnmapVirtualAddress( + IN PVOID VirtualAddress, + IN ULONG NumberPages +); + +/* sysinfo.c */ +NTSTATUS +NTAPI +HaliQuerySystemInformation( + IN HAL_QUERY_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN OUT PVOID Buffer, + OUT PULONG ReturnedLength +); + +NTSTATUS +NTAPI +HaliSetSystemInformation( + IN HAL_SET_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN OUT PVOID Buffer +); + +// +// BIOS Routines +// +BOOLEAN +NTAPI +HalpBiosDisplayReset( + VOID +); + +ULONG +NTAPI +HalpBorrowTss( + VOID +); + +ULONG +NTAPI +HalpReturnTss( + ULONG SavedTss +); + +VOID +NTAPI +HalpBiosCall( + VOID +); + +VOID +NTAPI +HalpTrap0D( + VOID +); + +VOID +NTAPI +HalpTrap06( + VOID +); + +extern PVOID HalpRealModeStart; +extern PVOID HalpRealModeEnd; + +extern KSPIN_LOCK HalpSystemHardwareLock; #endif /* __INTERNAL_HAL_HAL_H */ diff --git a/reactos/hal/halamd64/up/halup.rbuild b/reactos/hal/halamd64/up/halup.rbuild index 8308980b26a..eaa56d7f133 100644 --- a/reactos/hal/halamd64/up/halup.rbuild +++ b/reactos/hal/halamd64/up/halup.rbuild @@ -1,14 +1,17 @@ - - + + - ../include + ../include include - halamd64_generic + hal_generic_amd64 + hal_generic_pc + hal_generic ntoskrnl halinit_up.c halup.rc + processor.c diff --git a/reactos/hal/halamd64/up/processor.c b/reactos/hal/halamd64/up/processor.c new file mode 100644 index 00000000000..669c82b5910 --- /dev/null +++ b/reactos/hal/halamd64/up/processor.c @@ -0,0 +1,87 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: GPL - See COPYING in the top level directory + * FILE: hal/halamd64/up/processor.c + * PURPOSE: HAL Processor Routines + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +LONG HalpActiveProcessors; +KAFFINITY HalpDefaultInterruptAffinity; + +/* FUNCTIONS *****************************************************************/ + +/* + * @implemented + */ +VOID +NTAPI +HalInitializeProcessor(IN ULONG ProcessorNumber, + IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + /* Set default IDR and stall count */ +// KeGetPcr()->IDR = 0xFFFFFFFB; + KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT; + + /* Update the interrupt affinity and processor mask */ + InterlockedBitTestAndSet(&HalpActiveProcessors, ProcessorNumber); + InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity, + ProcessorNumber); + + /* Register routines for KDCOM */ + HalpRegisterKdSupportFunctions(); +} + +/* + * @implemented + */ +BOOLEAN +NTAPI +HalAllProcessorsStarted(VOID) +{ + /* Do nothing */ + return TRUE; +} + +/* + * @implemented + */ +BOOLEAN +NTAPI +HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock, + IN PKPROCESSOR_STATE ProcessorState) +{ + /* Ready to start */ + return FALSE; +} + +/* + * @implemented + */ +VOID +NTAPI +HalProcessorIdle(VOID) +{ + /* Enable interrupts and halt the processor */ + _enable(); + Ke386HaltProcessor(); +} + +/* + * @implemented + */ +VOID +NTAPI +HalRequestIpi(KAFFINITY TargetSet) +{ + /* Not implemented on NT */ + __debugbreak(); +} + +/* EOF */ diff --git a/reactos/hal/halx86/hal_generic_amd64.rbuild b/reactos/hal/halx86/hal_generic_amd64.rbuild new file mode 100644 index 00000000000..c3d5e5b121d --- /dev/null +++ b/reactos/hal/halx86/hal_generic_amd64.rbuild @@ -0,0 +1,28 @@ + + + + + include + include + + + + beep.c + bus.c + cmos.c + dma.c + drive.c + display.c + profil.c + reboot.c + sysinfo.c + timer.c + + + + + + hal.h + + + From d17e988891d256fde59a1435bfd133d0a3f047f4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 3 Sep 2008 01:14:48 +0000 Subject: [PATCH 231/388] fix hal build svn path=/branches/ros-amd64-bringup/; revision=35906 --- reactos/hal/halamd64/up/halup.rbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/hal/halamd64/up/halup.rbuild b/reactos/hal/halamd64/up/halup.rbuild index eaa56d7f133..fdbc06fabd8 100644 --- a/reactos/hal/halamd64/up/halup.rbuild +++ b/reactos/hal/halamd64/up/halup.rbuild @@ -1,7 +1,7 @@ - + ../include include From 2b96a78f9ae5c3720962dd92719fb6fd2d2352b2 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 17:43:00 +0000 Subject: [PATCH 232/388] Make apic.c compile on amd64 build. svn path=/branches/ros-amd64-bringup/; revision=35942 --- reactos/hal/halx86/mp/apic.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/reactos/hal/halx86/mp/apic.c b/reactos/hal/halx86/mp/apic.c index aec51e4fc2a..e38fd740c62 100644 --- a/reactos/hal/halx86/mp/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -228,7 +228,7 @@ __inline ULONG _APICRead(ULONG Offset) { PULONG p; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); return *p; } @@ -238,7 +238,7 @@ __inline VOID APICWrite(ULONG Offset, { PULONG p; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); *p = Value; } @@ -252,7 +252,7 @@ __inline VOID APICWrite(ULONG Offset, lastregw[CPU] = Offset; lastvalw[CPU] = Value; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); *p = Value; } @@ -264,7 +264,7 @@ __inline ULONG APICRead(ULONG Offset) { PULONG p; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); return *p; } #else @@ -276,7 +276,7 @@ __inline ULONG APICRead(ULONG Offset) lastregr[CPU] = Offset; lastvalr[CPU] = 0; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); lastvalr[CPU] = *p; return lastvalr[CPU]; @@ -775,6 +775,9 @@ VOID MpsIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame, PKTRAP_FRAME TrapFrame) { +#ifdef _M_AMD64 + UNIMPLEMENTED; +#else TrapFrame->SegGs = (USHORT)IrqTrapFrame->Gs; TrapFrame->SegFs = (USHORT)IrqTrapFrame->Fs; TrapFrame->SegEs = (USHORT)IrqTrapFrame->Es; @@ -790,6 +793,7 @@ MpsIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame, TrapFrame->Eip = IrqTrapFrame->Eip; TrapFrame->SegCs = IrqTrapFrame->Cs; TrapFrame->EFlags = IrqTrapFrame->Eflags; +#endif } VOID @@ -864,7 +868,7 @@ APICCalibrateTimer(ULONG CPU) APICSetupLVTT(1000000000); - TSCPresent = ((PKIPCR)KeGetPcr())->PrcbData.FeatureBits & KF_RDTSC ? TRUE : FALSE; + TSCPresent = KeGetCurrentPrcb()->FeatureBits & KF_RDTSC ? TRUE : FALSE; /* * The timer chip counts down to zero. Let's wait @@ -893,7 +897,7 @@ APICCalibrateTimer(ULONG CPU) DPRINT("CPU clock speed is %ld.%04ld MHz.\n", CPUMap[CPU].CoreSpeed/1000000, CPUMap[CPU].CoreSpeed%1000000); - ((PKIPCR)KeGetPcr())->PrcbData.MHz = CPUMap[CPU].CoreSpeed/1000000; + KeGetCurrentPrcb()->MHz = CPUMap[CPU].CoreSpeed/1000000; } CPUMap[CPU].BusSpeed = (HZ * (long)(tt1 - tt2) * APIC_DIVISOR); @@ -909,8 +913,11 @@ APICCalibrateTimer(ULONG CPU) } VOID -SetInterruptGate(ULONG index, ULONG address) +SetInterruptGate(ULONG index, ULONG_PTR address) { +#ifdef _M_AMD64 +UNIMPLEMENTED; +#else KIDTENTRY *idt; KIDT_ACCESS Access; @@ -926,6 +933,7 @@ SetInterruptGate(ULONG index, ULONG address) idt->Selector = KGDT_R0_CODE; idt->Access = Access.Value; idt->ExtendedOffset = address >> 16; +#endif } VOID HaliInitBSP(VOID) @@ -946,11 +954,11 @@ VOID HaliInitBSP(VOID) BSPInitialized = TRUE; /* Setup interrupt handlers */ - SetInterruptGate(LOCAL_TIMER_VECTOR, (ULONG)MpsTimerInterrupt); - SetInterruptGate(ERROR_VECTOR, (ULONG)MpsErrorInterrupt); - SetInterruptGate(SPURIOUS_VECTOR, (ULONG)MpsSpuriousInterrupt); + SetInterruptGate(LOCAL_TIMER_VECTOR, (ULONG_PTR)MpsTimerInterrupt); + SetInterruptGate(ERROR_VECTOR, (ULONG_PTR)MpsErrorInterrupt); + SetInterruptGate(SPURIOUS_VECTOR, (ULONG_PTR)MpsSpuriousInterrupt); #ifdef CONFIG_SMP - SetInterruptGate(IPI_VECTOR, (ULONG)MpsIpiInterrupt); + SetInterruptGate(IPI_VECTOR, (ULONG_PTR)MpsIpiInterrupt); #endif DPRINT("APIC is mapped at 0x%X\n", APICBase); From a6a7745b5598904aa6f4d3a8fca6e797bc3be520 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 19:11:19 +0000 Subject: [PATCH 233/388] Don't use hal_generic_pc.rbuild. Remove obsolete hal.c. Add apic.c from x86 to build. Add some stubs. svn path=/branches/ros-amd64-bringup/; revision=35947 --- reactos/hal/hal.rbuild | 1 - reactos/hal/hal/hal_amd64.def | 6 +- reactos/hal/halamd64/generic/generic.rbuild | 1 + reactos/hal/halamd64/generic/hal.c | 781 -------------------- reactos/hal/halamd64/generic/irq.S | 70 +- reactos/hal/halamd64/generic/mps.S | 95 +++ reactos/hal/halamd64/up/halup.rbuild | 1 - reactos/hal/halx86/hal_generic_amd64.rbuild | 3 +- 8 files changed, 135 insertions(+), 823 deletions(-) delete mode 100644 reactos/hal/halamd64/generic/hal.c create mode 100644 reactos/hal/halamd64/generic/mps.S diff --git a/reactos/hal/hal.rbuild b/reactos/hal/hal.rbuild index 588040a58a0..5c3e70b2d93 100644 --- a/reactos/hal/hal.rbuild +++ b/reactos/hal/hal.rbuild @@ -27,7 +27,6 @@ - diff --git a/reactos/hal/hal/hal_amd64.def b/reactos/hal/hal/hal_amd64.def index 1d8fa785c0e..644d6c21288 100644 --- a/reactos/hal/hal/hal_amd64.def +++ b/reactos/hal/hal/hal_amd64.def @@ -14,9 +14,9 @@ HalAssignSlotResources HalCalibratePerformanceCounter HalClearSoftwareInterrupt ;HalConvertDeviceIdtToIrql -;HalDisableInterrupt +HalDisableInterrupt HalDisplayString -;HalEnableInterrupt +HalEnableInterrupt ;HalEnumerateEnvironmentVariablesEx ;HalEnumerateProcessors HalFlushCommonBuffer @@ -52,7 +52,7 @@ HalRequestIpi HalRequestSoftwareInterrupt HalReturnToFirmware ;HalSendNMI -;HalSendSoftwareInterrupt +HalSendSoftwareInterrupt HalSetBusData HalSetBusDataByOffset HalSetDisplayParameters diff --git a/reactos/hal/halamd64/generic/generic.rbuild b/reactos/hal/halamd64/generic/generic.rbuild index 2b69e20d3b6..7c22ec5013e 100644 --- a/reactos/hal/halamd64/generic/generic.rbuild +++ b/reactos/hal/halamd64/generic/generic.rbuild @@ -9,6 +9,7 @@ halinit.c irq.S misc.c + mps.S systimer.S ../include/hal.h diff --git a/reactos/hal/halamd64/generic/hal.c b/reactos/hal/halamd64/generic/hal.c deleted file mode 100644 index c16b82b7cca..00000000000 --- a/reactos/hal/halamd64/generic/hal.c +++ /dev/null @@ -1,781 +0,0 @@ -/* - * PROJECT: ReactOS HAL - * LICENSE: BSD - See COPYING.ARM in the top level directory - * FILE: hal/halarm/generic/hal.c - * PURPOSE: Hardware Abstraction Layer - * PROGRAMMERS: ReactOS Portable Systems Group - */ - -/* INCLUDES *******************************************************************/ - -#include -#define NDEBUG -#include -#include - -#define READ_REGISTER_ULONG(r) (*(volatile ULONG * const)(r)) -#define WRITE_REGISTER_ULONG(r, v) (*(volatile ULONG *)(r) = (v)) - -/* DATA **********************************************************************/ - -ULONG HalpCurrentTimeIncrement, HalpNextTimeIncrement, HalpNextIntervalCount; -ULONG _KdComPortInUse = 0; - -/* FUNCTIONS *****************************************************************/ - -NTSTATUS -NTAPI -DriverEntry( - PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath) -{ - UNIMPLEMENTED; - - return STATUS_SUCCESS; -} - -/* -* @unimplemented -*/ -VOID -NTAPI -HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) -{ - KEBUGCHECK(0); - return; -} - -/* -* @unimplemented -*/ -VOID -NTAPI -HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) -{ - KEBUGCHECK(0); - return; -} - -/* -* @unimplemented -*/ -ULONG_PTR -NTAPI -HalSetProfileInterval(IN ULONG_PTR Interval) -{ - KEBUGCHECK(0); - return Interval; -} - -NTSTATUS -NTAPI -HalAdjustResourceList( - PCM_RESOURCE_LIST Resources) -{ - UNIMPLEMENTED; - - return STATUS_SUCCESS; -} - - -/* - * @implemented - */ -BOOLEAN -NTAPI -HalAllProcessorsStarted(VOID) -{ - /* Do nothing */ - return TRUE; -} - - -NTSTATUS -NTAPI -HalAllocateAdapterChannel( - PADAPTER_OBJECT AdapterObject, - PWAIT_CONTEXT_BLOCK WaitContextBlock, - ULONG NumberOfMapRegisters, - PDRIVER_CONTROL ExecutionRoutine) -{ - UNIMPLEMENTED; - - return STATUS_SUCCESS; -} - - -PVOID -NTAPI -HalAllocateCommonBuffer( - PADAPTER_OBJECT AdapterObject, - ULONG Length, - PPHYSICAL_ADDRESS LogicalAddress, - BOOLEAN CacheEnabled) -{ - UNIMPLEMENTED; - - return NULL; -} - - -PVOID -NTAPI -HalAllocateCrashDumpRegisters( - PADAPTER_OBJECT AdapterObject, - PULONG NumberOfMapRegisters) -{ - UNIMPLEMENTED; - return NULL; -} - - -NTSTATUS -NTAPI -HalAssignSlotResources( - PUNICODE_STRING RegistryPath, - PUNICODE_STRING DriverClassName, - PDRIVER_OBJECT DriverObject, - PDEVICE_OBJECT DeviceObject, - INTERFACE_TYPE BusType, - ULONG BusNumber, - ULONG SlotNumber, - PCM_RESOURCE_LIST *AllocatedResources) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -BOOLEAN -NTAPI -HalBeginSystemInterrupt (KIRQL Irql, - ULONG Vector, - PKIRQL OldIrql) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -VOID -NTAPI -HalCalibratePerformanceCounter( - volatile LONG *Count, - ULONGLONG NewCount) -{ - UNIMPLEMENTED; -} - - -BOOLEAN -NTAPI -HalDisableSystemInterrupt( - ULONG Vector, - KIRQL Irql) -{ - UNIMPLEMENTED; - - return TRUE; -} - -VOID -NTAPI -HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters) -{ - // - // Stub since Windows XP implemented Inbv - // - return; -} - -VOID -NTAPI -HalDisplayString(IN PCH String) -{ - // - // Call the Inbv driver - // - InbvDisplayString(String); -} - -VOID -NTAPI -HalQueryDisplayParameters(OUT PULONG DispSizeX, - OUT PULONG DispSizeY, - OUT PULONG CursorPosX, - OUT PULONG CursorPosY) -{ - // - // Stub since Windows XP implemented Inbv - // - return; -} - -VOID -NTAPI -HalSetDisplayParameters(IN ULONG CursorPosX, - IN ULONG CursorPosY) -{ - // - // Stub since Windows XP implemented Inbv - // - return; -} - -BOOLEAN -NTAPI -HalEnableSystemInterrupt( - ULONG Vector, - KIRQL Irql, - KINTERRUPT_MODE InterruptMode) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -VOID -NTAPI -HalEndSystemInterrupt( - KIRQL Irql, - ULONG Unknown2) -{ - UNIMPLEMENTED; -} - - -BOOLEAN -NTAPI -HalFlushCommonBuffer( - ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3, - ULONG Unknown4, - ULONG Unknown5) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -VOID -NTAPI -HalFreeCommonBuffer( - PADAPTER_OBJECT AdapterObject, - ULONG Length, - PHYSICAL_ADDRESS LogicalAddress, - PVOID VirtualAddress, - BOOLEAN CacheEnabled) -{ - UNIMPLEMENTED; -} - - -PADAPTER_OBJECT -NTAPI -HalGetAdapter( - PDEVICE_DESCRIPTION DeviceDescription, - PULONG NumberOfMapRegisters) -{ - UNIMPLEMENTED; - - return (PADAPTER_OBJECT)NULL; -} - - -ULONG -NTAPI -HalGetBusData( - BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Length) -{ - UNIMPLEMENTED; - - return 0; -} - - -ULONG -NTAPI -HalGetBusDataByOffset( - BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Offset, - ULONG Length) -{ - UNIMPLEMENTED; - - return 0; -} - - -ARC_STATUS -NTAPI -HalGetEnvironmentVariable( - PCH Name, - USHORT ValueLength, - PCH Value) -{ - UNIMPLEMENTED; - - return ENOENT; -} - - -ULONG -NTAPI -HalGetInterruptVector( - INTERFACE_TYPE InterfaceType, - ULONG BusNumber, - ULONG BusInterruptLevel, - ULONG BusInterruptVector, - PKIRQL Irql, - PKAFFINITY Affinity) -{ - UNIMPLEMENTED; - - return 0; -} - - -VOID -NTAPI -HalHandleNMI( - PVOID NmiData) -{ - UNIMPLEMENTED; -} - -VOID -NTAPI -HalpGetParameters(IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - PCHAR CommandLine; - - /* Make sure we have a loader block and command line */ - if ((LoaderBlock) && (LoaderBlock->LoadOptions)) - { - /* Read the command line */ - CommandLine = LoaderBlock->LoadOptions; - - /* Check for initial breakpoint */ - if (strstr(CommandLine, "BREAK")) DbgBreakPoint(); - } -} - -ULONG -HalGetInterruptSource(VOID) -{ - KEBUGCHECK(0); - return 0; -} - -VOID -HalpClockInterrupt(VOID) -{ - KEBUGCHECK(0); - return; -} - -VOID -HalpStallInterrupt(VOID) -{ - KEBUGCHECK(0); - return; -} - -VOID -HalpInitializeInterrupts(VOID) -{ - KEBUGCHECK(0); - return; -} - -/* - * @implemented - */ -BOOLEAN -NTAPI -HalInitSystem(IN ULONG BootPhase, - IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - KEBUGCHECK(0); - return; -} - - -VOID -NTAPI -HalInitializeProcessor(IN ULONG ProcessorNumber, - IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - // - // Nothing to do - // - return; -} - - -BOOLEAN -NTAPI -HalMakeBeep( - ULONG Frequency) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -VOID -NTAPI -HalProcessorIdle(VOID) -{ - UNIMPLEMENTED; -} - - -#define RTC_DATA (PVOID)0xE00E8000 - -BOOLEAN -NTAPI -HalQueryRealTimeClock(IN PTIME_FIELDS Time) -{ - KEBUGCHECK(0); - return TRUE; -} - -ULONG -NTAPI -HalReadDmaCounter( - PADAPTER_OBJECT AdapterObject) -{ - UNIMPLEMENTED; - - return 0; -} - - -VOID -NTAPI -HalReportResourceUsage(VOID) -{ - UNIMPLEMENTED; -} - - -VOID -NTAPI -HalRequestIpi( - KAFFINITY TargetSet) -{ - UNIMPLEMENTED; -} - - -VOID -FASTCALL -HalRequestSoftwareInterrupt(IN KIRQL Request) -{ - KEBUGCHECK(0); - return; -} - -VOID -FASTCALL -HalClearSoftwareInterrupt(IN KIRQL Request) -{ - KEBUGCHECK(0); - return; -} - -VOID -NTAPI -HalReturnToFirmware( - FIRMWARE_REENTRY Action) -{ - UNIMPLEMENTED; -} - - -ULONG -NTAPI -HalSetBusData( - BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Length) -{ - UNIMPLEMENTED; - - return 0; -} - - -ULONG -NTAPI -HalSetBusDataByOffset( - BUS_DATA_TYPE BusDataType, - ULONG BusNumber, - ULONG SlotNumber, - PVOID Buffer, - ULONG Offset, - ULONG Length) -{ - UNIMPLEMENTED; - - return 0; -} - - -ARC_STATUS -NTAPI -HalSetEnvironmentVariable( - PCH Name, - PCH Value) -{ - UNIMPLEMENTED; - - return ESUCCESS; -} - - -BOOLEAN -NTAPI -HalSetRealTimeClock( - PTIME_FIELDS Time) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -ULONG -NTAPI -HalSetTimeIncrement( - ULONG Increment) -{ - UNIMPLEMENTED; - - return Increment; -} - - -BOOLEAN -NTAPI -HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN PKPROCESSOR_STATE ProcessorState) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -ULONG -FASTCALL -HalSystemVectorDispatchEntry( - ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3) -{ - UNIMPLEMENTED; - - return 0; -} - - -BOOLEAN -NTAPI -HalTranslateBusAddress( - INTERFACE_TYPE InterfaceType, - ULONG BusNumber, - PHYSICAL_ADDRESS BusAddress, - PULONG AddressSpace, - PPHYSICAL_ADDRESS TranslatedAddress) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -VOID -NTAPI -HalpAssignDriveLetters(IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, - IN PSTRING NtDeviceName, - OUT PUCHAR NtSystemPath, - OUT PSTRING NtSystemPathString) -{ - /* Call the kernel */ - IoAssignDriveLetters(LoaderBlock, - NtDeviceName, - NtSystemPath, - NtSystemPathString); -} - -NTSTATUS -NTAPI -HalpReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN BOOLEAN ReturnRecognizedPartitions, - IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer) -{ - /* Call the kernel */ - return IoReadPartitionTable(DeviceObject, - SectorSize, - ReturnRecognizedPartitions, - PartitionBuffer); -} - -NTSTATUS -NTAPI -HalpWritePartitionTable(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG SectorsPerTrack, - IN ULONG NumberOfHeads, - IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer) -{ - /* Call the kernel */ - return IoWritePartitionTable(DeviceObject, - SectorSize, - SectorsPerTrack, - NumberOfHeads, - PartitionBuffer); -} - -NTSTATUS -NTAPI -HalpSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG PartitionNumber, - IN ULONG PartitionType) -{ - /* Call the kernel */ - return IoSetPartitionInformation(DeviceObject, - SectorSize, - PartitionNumber, - PartitionType); -} - - -BOOLEAN -NTAPI -IoFlushAdapterBuffers( - PADAPTER_OBJECT AdapterObject, - PMDL Mdl, - PVOID MapRegisterBase, - PVOID CurrentVa, - ULONG Length, - BOOLEAN WriteToDevice) -{ - UNIMPLEMENTED; - - return TRUE; -} - - -VOID -NTAPI -IoFreeAdapterChannel( - PADAPTER_OBJECT AdapterObject) -{ - UNIMPLEMENTED; -} - - -VOID -NTAPI -IoFreeMapRegisters( - PADAPTER_OBJECT AdapterObject, - PVOID MapRegisterBase, - ULONG NumberOfMapRegisters) -{ - UNIMPLEMENTED; -} - - -PHYSICAL_ADDRESS -NTAPI -IoMapTransfer( - PADAPTER_OBJECT AdapterObject, - PMDL Mdl, - PVOID MapRegisterBase, - PVOID CurrentVa, - PULONG Length, - BOOLEAN WriteToDevice) -{ - PHYSICAL_ADDRESS Address; - - UNIMPLEMENTED; - - Address.QuadPart = 0; - - return Address; -} - -VOID -NTAPI -KeFlushWriteBuffer(VOID) -{ - UNIMPLEMENTED; -} - -LARGE_INTEGER -NTAPI -KeQueryPerformanceCounter( - PLARGE_INTEGER PerformanceFreq) -{ - LARGE_INTEGER Value; - - UNIMPLEMENTED; - - Value.QuadPart = 0; - - return Value; -} - -VOID -NTAPI -KeStallExecutionProcessor(IN ULONG Microseconds) -{ - UNIMPLEMENTED; - return; -} - -BOOLEAN HalpProcessorIdentified; -BOOLEAN HalpTestCleanSupported; - -VOID -HalpIdentifyProcessor(VOID) -{ - UNIMPLEMENTED; - return; -} - -VOID -HalSweepDcache(VOID) -{ - UNIMPLEMENTED; - return; -} - -VOID -HalSweepIcache(VOID) -{ - UNIMPLEMENTED; - return; -} - -/* EOF */ diff --git a/reactos/hal/halamd64/generic/irq.S b/reactos/hal/halamd64/generic/irq.S index dc1f6d44b5b..060b5b65940 100644 --- a/reactos/hal/halamd64/generic/irq.S +++ b/reactos/hal/halamd64/generic/irq.S @@ -34,13 +34,44 @@ .globl _HalpInitPICs .func _HalpInitPICs _HalpInitPICs: -UNIMPLEMENTED "HalpInitPICs" - + UNIMPLEMENTED "HalpInitPICs" .endfunc +.global _HalEnableInterrupt +.func _HalEnableInterrupt +_HalEnableInterrupt: + UNIMPLEMENTED "HalEnableInterrupt" +.endfunc + +.global _HalDisableInterrupt +.func _HalDisableInterrupt +_HalDisableInterrupt: + UNIMPLEMENTED "HalDisableInterrupt" +.endfunc + +.global _HalRequestSoftwareInterrupt +.func _HalRequestSoftwareInterrupt +_HalRequestSoftwareInterrupt: + UNIMPLEMENTED "HalRequestSoftwareInterrupt" +.endfunc + +.global _HalSendSoftwareInterrupt +.func _HalSendSoftwareInterrupt +_HalSendSoftwareInterrupt: + UNIMPLEMENTED "HalSendSoftwareInterrupt" +.endfunc + +.global _HalEndSystemInterrupt +.func _HalEndSystemInterrupt +_HalEndSystemInterrupt: + UNIMPLEMENTED "HalEndSystemInterrupt" +.endfunc + + .globl _HalClearSoftwareInterrupt .func _HalClearSoftwareInterrupt _HalClearSoftwareInterrupt: + UNIMPLEMENTED "HalClearSoftwareInterrupt" /* Get IRR mask */ mov eax, 1 @@ -52,42 +83,9 @@ _HalClearSoftwareInterrupt: ret .endfunc -.globl _HalRequestSoftwareInterrupt -.func _HalRequestSoftwareInterrupt -_HalRequestSoftwareInterrupt: -UNIMPLEMENTED "HalRequestSoftwareInterrupt" -.endfunc - .globl _HalBeginSystemInterrupt .func _HalBeginSystemInterrupt _HalBeginSystemInterrupt: -UNIMPLEMENTED "HalBeginSystemInterrupt" -.endfunc - -.globl _HalpApcInterrupt -.func _HalpApcInterrupt -//TRAP_FIXUPS hapc_a, hapc_t, DoFixupV86, DoFixupAbios -_HalpApcInterrupt: -UNIMPLEMENTED "HalpApcInterrupt" -.endfunc - -.globl _HalpApcInterrupt2ndEntry -.func _HalpApcInterrupt2ndEntry -_HalpApcInterrupt2ndEntry: -UNIMPLEMENTED "HalpApcInterrupt2ndEntry" -.endfunc - -.globl _HalpDispatchInterrupt -.func _HalpDispatchInterrupt -//TRAP_FIXUPS hdpc_a, hdpc_t, DoFixupV86, DoFixupAbios -_HalpDispatchInterrupt: -UNIMPLEMENTED "HalpDispatchInterrupt" -.endfunc - - -.globl _HalpDispatchInterrupt2ndEntry -.func _HalpDispatchInterrupt2ndEntry -_HalpDispatchInterrupt2ndEntry: -UNIMPLEMENTED "HalpDispatchInterrupt2ndEntry" + UNIMPLEMENTED "HalBeginSystemInterrupt" .endfunc diff --git a/reactos/hal/halamd64/generic/mps.S b/reactos/hal/halamd64/generic/mps.S new file mode 100644 index 00000000000..219d651498c --- /dev/null +++ b/reactos/hal/halamd64/generic/mps.S @@ -0,0 +1,95 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/hal/amd64/generic/mps.S + * PURPOSE: Intel MultiProcessor specification support + * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net) + */ + +/* INCLUDES ******************************************************************/ + +#include + +/* FUNCTIONS *****************************************************************/ + +#define BEFORE \ + cld; \ + pushq %rax; \ + pushq %rbx; \ + pushq %rcx; \ + pushq %rdx; \ + pushq %rsi; \ + pushq %rdi; \ + pushq %fs; \ + pushq %gs; \ + +#define AFTER \ + popq %gs; \ + popq %fs; \ + popq %rdi; \ + popq %rsi; \ + popq %rdx; \ + popq %rcx; \ + popq %rbx; \ + popq %rax; \ + +#ifdef CONFIG_SMP +.global _MpsIpiInterrupt +_MpsIpiInterrupt: + /* Save registers */ + BEFORE + + /* Call the C handler */ + call _MpsIpiHandler + + /* Return to the caller */ + AFTER + iret +#endif + +.globl _MpsErrorInterrupt +_MpsErrorInterrupt: + /* Save registers */ + BEFORE + + /* Call the C handler */ + call _MpsErrorHandler + + /* Return to the caller */ + AFTER + iret + + +.globl _MpsSpuriousInterrupt +_MpsSpuriousInterrupt: + /* Save registers */ + BEFORE + + /* Call the C handler */ + call _MpsSpuriousHandler + + /* Return to the caller */ + AFTER + iret + +.global _MpsTimerInterrupt +_MpsTimerInterrupt: + /* Save registers */ + BEFORE + + movl $0xef,%ebx + movl $0xceafbeef,%eax + pushq %rax + pushq %rsp + pushq %rbx + call _MpsTimerHandler + popq %rax + popq %rax + popq %rax + + /* Return to the caller */ + AFTER + iret + + +/* EOF */ diff --git a/reactos/hal/halamd64/up/halup.rbuild b/reactos/hal/halamd64/up/halup.rbuild index fdbc06fabd8..08f72745185 100644 --- a/reactos/hal/halamd64/up/halup.rbuild +++ b/reactos/hal/halamd64/up/halup.rbuild @@ -8,7 +8,6 @@ hal_generic_amd64 - hal_generic_pc hal_generic ntoskrnl halinit_up.c diff --git a/reactos/hal/halx86/hal_generic_amd64.rbuild b/reactos/hal/halx86/hal_generic_amd64.rbuild index c3d5e5b121d..c343b64e268 100644 --- a/reactos/hal/halx86/hal_generic_amd64.rbuild +++ b/reactos/hal/halx86/hal_generic_amd64.rbuild @@ -13,13 +13,14 @@ dma.c drive.c display.c + pci.c profil.c reboot.c sysinfo.c timer.c - + apic.c hal.h From 399ee68de4a634c272565ba52a32990488ff4f39 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 19:29:48 +0000 Subject: [PATCH 234/388] fix hal build on x86 svn path=/branches/ros-amd64-bringup/; revision=35948 --- reactos/hal/hal/hal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index 37c772f3958..7f46c2cc6f4 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -38,8 +38,9 @@ DriverEntry( PUNICODE_STRING RegistryPath) { UNIMPLEMENTED; - - return STATUS_SUCCESS; +intptr_t y = __readeflags(); +__writeeflags(34); + return y;//STATUS_SUCCESS; } /* @@ -821,7 +822,7 @@ KeQueryPerformanceCounter( return Value; } -#if 0 +#ifndef _M_AMD64 #undef KeRaiseIrql VOID NTAPI From 16630cb3682794df027e64c298be9450082bfbea Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 19:36:48 +0000 Subject: [PATCH 235/388] Revert the testcode I accidentally committed. svn path=/branches/ros-amd64-bringup/; revision=35949 --- reactos/hal/hal/hal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index 7f46c2cc6f4..a30b42c804c 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -38,9 +38,8 @@ DriverEntry( PUNICODE_STRING RegistryPath) { UNIMPLEMENTED; -intptr_t y = __readeflags(); -__writeeflags(34); - return y;//STATUS_SUCCESS; + + return STATUS_SUCCESS; } /* From 8d9af3292a827f5c2afe28a9b626d8a56c29fcdf Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 19:39:29 +0000 Subject: [PATCH 236/388] implement __readeflags and __writeeflags svn path=/branches/ros-amd64-bringup/; revision=35950 --- reactos/include/psdk/intrin_x86.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index b528735cb75..c8a59794a0a 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -1064,6 +1064,17 @@ static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void return retval; } +static __inline__ __attribute__((always_inline)) void __writeeflags(uintptr_t Value) +{ + __asm__ __volatile__("push %0\n popf" : : "rim"(Value)); +} + +static __inline__ __attribute__((always_inline)) uintptr_t __readeflags(void) +{ + uintptr_t retval; + __asm__ __volatile__("pushf\n pop %0" : "=rm"(retval)); + return retval; +} /*** Interrupts ***/ static __inline__ __attribute__((always_inline)) void __debugbreak(void) From c72a03b1708f0f81cc11555a11be11ce50f083a9 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 20:55:46 +0000 Subject: [PATCH 237/388] Remove hacks from __addgsbyte, __addgsword, __addgsdword. They are correct on ms compiler. (fs ones still broken on x86 compiler that comes with the wdk). Implement __addgsqword. svn path=/branches/ros-amd64-bringup/; revision=35951 --- reactos/include/psdk/intrin_x86.h | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index c8a59794a0a..7b5cbc2f1d3 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -650,29 +650,24 @@ static __inline__ __attribute__((always_inline)) void __incgsdword(const unsigne __asm__ __volatile__("incl %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory"); } -/* NOTE: the bizarre implementation of __addgsxxx mimics the broken Visual C++ behavior */ static __inline__ __attribute__((always_inline)) void __addgsbyte(const unsigned long Offset, const unsigned char Data) { - if(!__builtin_constant_p(Offset)) - __asm__ __volatile__("addb %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); - else - __asm__ __volatile__("addb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); + __asm__ __volatile__("addb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __addgsword(const unsigned long Offset, const unsigned short Data) { - if(!__builtin_constant_p(Offset)) - __asm__ __volatile__("addw %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); - else - __asm__ __volatile__("addw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); + __asm__ __volatile__("addw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } static __inline__ __attribute__((always_inline)) void __addgsdword(const unsigned long Offset, const unsigned int Data) { - if(!__builtin_constant_p(Offset)) - __asm__ __volatile__("addl %k[Offset], %%gs:%a[Offset]" : : [Offset] "r" (Offset) : "memory"); - else - __asm__ __volatile__("addl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); + __asm__ __volatile__("addl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __addgsqword(const unsigned long Offset, const unsigned __int64 Data) +{ + __asm__ __volatile__("addq %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory"); } #else From cb1e57ab684ca548d6491a0d5a58a390ebe20e79 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 21:22:14 +0000 Subject: [PATCH 238/388] fix a typo svn path=/branches/ros-amd64-bringup/; revision=35952 --- reactos/include/ndk/amd64/ketypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 8099de11c1d..5135a318a40 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -788,7 +788,7 @@ typedef struct _KTSS64 typedef struct _KEXCEPTION_FRAME KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; // -// Macro to get current KPRCB +// Inline function to get current KPRCB // FORCEINLINE struct _KPRCB * From 291553900d2acdfc69043e0d2235d5cb85bedb51 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 4 Sep 2008 21:24:44 +0000 Subject: [PATCH 239/388] fix x64 build of hal svn path=/branches/ros-amd64-bringup/; revision=35953 --- reactos/hal/hal/hal_amd64.def | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/hal/hal/hal_amd64.def b/reactos/hal/hal/hal_amd64.def index 644d6c21288..1d8fa785c0e 100644 --- a/reactos/hal/hal/hal_amd64.def +++ b/reactos/hal/hal/hal_amd64.def @@ -14,9 +14,9 @@ HalAssignSlotResources HalCalibratePerformanceCounter HalClearSoftwareInterrupt ;HalConvertDeviceIdtToIrql -HalDisableInterrupt +;HalDisableInterrupt HalDisplayString -HalEnableInterrupt +;HalEnableInterrupt ;HalEnumerateEnvironmentVariablesEx ;HalEnumerateProcessors HalFlushCommonBuffer @@ -52,7 +52,7 @@ HalRequestIpi HalRequestSoftwareInterrupt HalReturnToFirmware ;HalSendNMI -HalSendSoftwareInterrupt +;HalSendSoftwareInterrupt HalSetBusData HalSetBusDataByOffset HalSetDisplayParameters From b01ff9f69492882336a78a74d0a83b56e2c06092 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 5 Sep 2008 22:25:27 +0000 Subject: [PATCH 240/388] use own asm.h on amd64 builds svn path=/branches/ros-amd64-bringup/; revision=35966 --- reactos/include/ndk/amd64/asm.h | 152 ++++++++++++++++++++++++++++++++ reactos/include/ndk/asm.h | 7 +- 2 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 reactos/include/ndk/amd64/asm.h diff --git a/reactos/include/ndk/amd64/asm.h b/reactos/include/ndk/amd64/asm.h new file mode 100644 index 00000000000..ff049f0bb72 --- /dev/null +++ b/reactos/include/ndk/amd64/asm.h @@ -0,0 +1,152 @@ +/*++ NDK Version: 0095 + +Copyright (c) Timo Kreuzer. All rights reserved. + +Header Name: + + amd64/asm.h + +Abstract: + + ASM Offsets for dealing with de-referencing structures in registers. + +Author: + + Timo Kreuzer (timo.kreuzer@reactos.org) 06-Sep-2008 + +--*/ +#ifndef _ASM_AMD64_H +#define _ASM_AMD64_H + + +#define SIZEOF_FX_SAVE_AREA 528 // HACK + +// +// CPU Modes +// +#define KernelMode 0x0 +#define UserMode 0x1 + +// +// CPU Types +// +#define CPU_INTEL 0x1 +#define CPU_AMD 0x2 + +// +// KTSS Offsets +// +#define KTSS64_RSP0 0x04 +#define KTSS64_RSP1 0x0c +#define KTSS64_RSP2 0x14 +#define KTSS64_IST 0x1c +#define KTSS64_IO_MAP_BASE 0x66 + +// +// KTHREAD Offsets +// +#define KTHREAD_DEBUG_ACTIVE 0x03 +#define KTHREAD_INITIAL_STACK 0x28 +#define KTHREAD_STACK_LIMIT 0x30 +#define KTHREAD_WAIT_IRQL 0x156 + + +// +// KPCR Offsets +// +#define KPCR_TSS_BASE 0x08 +#define KPCR_SELF 0x18 +#define KPCR_STALL_SCALE_FACTOR 0x64 + +// +// Trap Frame Offsets +// +#define KTRAP_FRAME_ALIGN 0x10 +#define KTRAP_FRAME_LENGTH 0x190 + +// +// CR0 +// +#define CR0_PE 0x1 +#define CR0_MP 0x2 +#define CR0_EM 0x4 +#define CR0_TS 0x8 +#define CR0_ET 0x10 +#define CR0_NE 0x20 +#define CR0_WP 0x10000 +#define CR0_AM 0x40000 +#define CR0_NW 0x20000000 +#define CR0_CD 0x40000000 +#define CR0_PG 0x80000000 + +// +// Generic Definitions +// +#define PRIMARY_VECTOR_BASE 0x30 +#define MAXIMUM_IDTVECTOR 0xFF + + +/* Following ones are ASM only! ***********************************************/ + +#ifdef __ASM__ + +// +// PCR Access +// +#define PCR gs: + +// +// EFLAGS +// +#define EFLAGS_TF 0x100 +#define EFLAGS_INTERRUPT_MASK 0x200 +#define EFLAGS_NESTED_TASK 0x4000 +#define EFLAGS_V86_MASK 0x20000 +#define EFLAGS_ALIGN_CHECK 0x40000 +#define EFLAGS_VIF 0x80000 +#define EFLAGS_VIP 0x100000 +#define EFLAG_SIGN 0x8000 +#define EFLAG_ZERO 0x4000 +#define EFLAG_SELECT (EFLAG_SIGN + EFLAG_ZERO) +#define EFLAGS_USER_SANITIZE 0x3F4DD7 + + +// +// IRQL Levels +// +#define PASSIVE_LEVEL 0 +#define LOW_LEVEL 0 +#define APC_LEVEL 1 +#define DISPATCH_LEVEL 2 +#define CLOCK_LEVEL 13 +#define IPI_LEVEL 14 +#define POWER_LEVEL 14 +#define PROFILE_LEVEL 15 +#define HIGH_LEVEL 15 + +// +// Quantum Decrements +// +#define CLOCK_QUANTUM_DECREMENT 0x3 + +// +// Machine types +// +#define MACHINE_TYPE_ISA 0x0000 +#define MACHINE_TYPE_EISA 0x0001 +#define MACHINE_TYPE_MCA 0x0002 + +// +// Kernel Feature Bits +// +#define KF_RDTSC 0x00000002 + +// +// Kernel Stack Size +// +#define KERNEL_STACK_SIZE 0x6000 + +#endif // __ASM__ + +#endif // !_ASM_AMD64_H + diff --git a/reactos/include/ndk/asm.h b/reactos/include/ndk/asm.h index 952c545d466..501048be5f1 100644 --- a/reactos/include/ndk/asm.h +++ b/reactos/include/ndk/asm.h @@ -16,7 +16,9 @@ Author: Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004 --*/ - +#ifdef _M_AMD64 +# include "amd64/asm.h" +#else #ifndef _ASM_H #define _ASM_H @@ -191,6 +193,7 @@ Author: #define KPCR_PROCESSOR_NUMBER 0x130 #define KPCR_PRCB_SET_MEMBER 0x134 #define KPCR_PRCB_CPU_TYPE 0x138 +#define KPCR_PRCB_PRCB_LOCK 0xA7C #define KPCR_NPX_THREAD 0x640 #define KPCR_DR6 0x428 #define KPCR_DR7 0x42C @@ -449,6 +452,7 @@ Author: #ifdef __ASM__ #define EFLAGS_TF 0x100 #define EFLAGS_INTERRUPT_MASK 0x200 +#define EFLAGS_IOPL 0x3000 #define EFLAGS_NESTED_TASK 0x4000 #define EFLAGS_V86_MASK 0x20000 #define EFLAGS_ALIGN_CHECK 0x40000 @@ -612,5 +616,6 @@ Author: +#endif From 8eac8b62afa5891d71743ac11a50c4b406d9e2db Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 5 Sep 2008 22:33:50 +0000 Subject: [PATCH 241/388] use KeAcquireSpinLockAtDpcLevel and KeReleaseSpinLockFromDpcLevel instead of KefAcquireSpinLockAtDpcLevel and KefReleaseSpinLockFromDpcLevel svn path=/branches/ros-amd64-bringup/; revision=35967 --- reactos/ntoskrnl/ke/dpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/ke/dpc.c b/reactos/ntoskrnl/ke/dpc.c index ee64bf11d7d..0646ffd4209 100644 --- a/reactos/ntoskrnl/ke/dpc.c +++ b/reactos/ntoskrnl/ke/dpc.c @@ -437,7 +437,7 @@ KiRetireDpcList(IN PKPRCB Prcb) while (DpcData->DpcQueueDepth != 0) { /* Lock the DPC data and get the DPC entry*/ - KefAcquireSpinLockAtDpcLevel(&DpcData->DpcLock); + KeAcquireSpinLockAtDpcLevel(&DpcData->DpcLock); DpcEntry = ListHead->Flink; /* Make sure we have an entry */ @@ -461,7 +461,7 @@ KiRetireDpcList(IN PKPRCB Prcb) Prcb->DebugDpcTime = 0; #endif /* Release the lock */ - KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock); + KeReleaseSpinLockFromDpcLevel(&DpcData->DpcLock); /* Re-enable interrupts */ _enable(); @@ -482,7 +482,7 @@ KiRetireDpcList(IN PKPRCB Prcb) ASSERT(DpcData->DpcQueueDepth == 0); /* Release DPC Lock */ - KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock); + KeReleaseSpinLockFromDpcLevel(&DpcData->DpcLock); } } From cc04d5e1a79172e1620e1cd38cc30bef92174fec Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 5 Sep 2008 23:33:38 +0000 Subject: [PATCH 242/388] use KeAcquireSpinLockAtDpcLevel and KeReleaseSpinLockFromDpcLevel instead of KefAcquireSpinLockAtDpcLevel and KefReleaseSpinLockFromDpcLevel. Fix Size parameter of CmpAllpcate (ULONG->SIZE_T). svn path=/branches/ros-amd64-bringup/; revision=35968 --- reactos/ntoskrnl/config/cmwraprs.c | 2 +- reactos/ntoskrnl/include/internal/cm.h | 2 +- reactos/ntoskrnl/ke/ipi.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/config/cmwraprs.c b/reactos/ntoskrnl/config/cmwraprs.c index 33be0dcec4f..9d8842879f3 100644 --- a/reactos/ntoskrnl/config/cmwraprs.c +++ b/reactos/ntoskrnl/config/cmwraprs.c @@ -51,7 +51,7 @@ CmpCreateEvent(IN EVENT_TYPE EventType, PVOID NTAPI -CmpAllocate(IN ULONG Size, +CmpAllocate(IN SIZE_T Size, IN BOOLEAN Paged, IN ULONG Tag) { diff --git a/reactos/ntoskrnl/include/internal/cm.h b/reactos/ntoskrnl/include/internal/cm.h index a930f05e9cb..8d91fb696d6 100644 --- a/reactos/ntoskrnl/include/internal/cm.h +++ b/reactos/ntoskrnl/include/internal/cm.h @@ -1277,7 +1277,7 @@ CmpCreateEvent( PVOID NTAPI CmpAllocate( - IN ULONG Size, + IN SIZE_T Size, IN BOOLEAN Paged, IN ULONG Tag ); diff --git a/reactos/ntoskrnl/ke/ipi.c b/reactos/ntoskrnl/ke/ipi.c index 979fcdd87b2..92308baeb8a 100644 --- a/reactos/ntoskrnl/ke/ipi.c +++ b/reactos/ntoskrnl/ke/ipi.c @@ -152,7 +152,7 @@ KeIpiGenericCall(IN PKIPI_BROADCAST_WORKER Function, if (OldIrql < DISPATCH_LEVEL) KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); /* Acquire the IPI lock */ - KefAcquireSpinLockAtDpcLevel(&KiIpiLock); + KeAcquireSpinLockAtDpcLevel(&KiIpiLock); /* Raise to IPI level */ KeRaiseIrql(IPI_LEVEL, &OldIrql2); @@ -161,7 +161,7 @@ KeIpiGenericCall(IN PKIPI_BROADCAST_WORKER Function, Status = Function(Argument); /* Release the lock */ - KefReleaseSpinLockFromDpcLevel(&KiIpiLock); + KeReleaseSpinLockFromDpcLevel(&KiIpiLock); /* Lower IRQL back */ KeLowerIrql(OldIrql); From 48f7ad5d4cf4c22bc2b402d723b8e05d3075a5f7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 5 Sep 2008 23:35:40 +0000 Subject: [PATCH 243/388] Fix and update CM_PARTIAL_RESOURCE_DESCRIPTOR svn path=/branches/ros-amd64-bringup/; revision=35969 --- reactos/include/ddk/winddk.h | 33 ++++++++++++++++++++++++++- reactos/include/ndk/cmtypes.h | 42 +++++++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index cb94e6853d3..6163f44de4c 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -1759,8 +1759,25 @@ typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { struct { ULONG Level; ULONG Vector; - ULONG Affinity; + KAFFINITY Affinity; } Interrupt; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + struct { + union { + struct { + USHORT Reserved; + USHORT MessageCount; + ULONG Vector; + KAFFINITY Affinity; + } Raw; + struct { + ULONG Level; + ULONG Vector; + KAFFINITY Affinity; + } Translated; + }; + } MessageInterrupt; +#endif struct { PHYSICAL_ADDRESS Start; ULONG Length; @@ -1783,6 +1800,20 @@ typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { ULONG Reserved1; ULONG Reserved2; } DeviceSpecificData; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + struct { + PHYSICAL_ADDRESS Start; + ULONG Length40; + } Memory40; + struct { + PHYSICAL_ADDRESS Start; + ULONG Length48; + } Memory48; + struct { + PHYSICAL_ADDRESS Start; + ULONG Length64; + } Memory64; +#endif } u; } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; diff --git a/reactos/include/ndk/cmtypes.h b/reactos/include/ndk/cmtypes.h index d5a6ba012ac..c800f1370de 100644 --- a/reactos/include/ndk/cmtypes.h +++ b/reactos/include/ndk/cmtypes.h @@ -433,8 +433,29 @@ typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { ULONG Level; ULONG Vector; - ULONG Affinity; + KAFFINITY Affinity; } Interrupt; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + struct + { + union + { + struct + { + USHORT Reserved; + USHORT MessageCount; + ULONG Vector; + KAFFINITY Affinity; + } Raw; + struct + { + ULONG Level; + ULONG Vector; + KAFFINITY Affinity; + } Translated; + }; + } MessageInterrupt; +#endif struct { PHYSICAL_ADDRESS Start; @@ -448,7 +469,7 @@ typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR } Dma; struct { - ULONG Data[3]; + ULONG Data[3]; } DevicePrivate; struct { @@ -462,6 +483,23 @@ typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR ULONG Reserved1; ULONG Reserved2; } DeviceSpecificData; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + struct + { + PHYSICAL_ADDRESS Start; + ULONG Length40; + } Memory40; + struct + { + PHYSICAL_ADDRESS Start; + ULONG Length48; + } Memory48; + struct + { + PHYSICAL_ADDRESS Start; + ULONG Length64; + } Memory64; +#endif } u; } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; From de62b70a2c91b7d78f59df54353ed35df8130b2c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 5 Sep 2008 23:46:47 +0000 Subject: [PATCH 244/388] fix pointer <-> ULONG cast svn path=/branches/ros-amd64-bringup/; revision=35970 --- reactos/ntoskrnl/config/cmsysini.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index f95e6ed2e81..a89f1ca1679 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -1080,7 +1080,7 @@ CmpLoadHiveThread(IN PVOID StartContext) PAGED_CODE(); /* Get the hive index, make sure it makes sense */ - i = (ULONG)StartContext; + i = PtrToUlong(StartContext); ASSERT(CmpMachineHiveList[i].Name != NULL); /* We were started */ @@ -1275,7 +1275,7 @@ CmpInitializeHiveList(IN USHORT Flag) 0, NULL, CmpLoadHiveThread, - (PVOID)i); + UlongToPtr(i)); if (NT_SUCCESS(Status)) { /* We don't care about the handle -- the thread self-terminates */ From 7e2503da069c42e251210c7cd1aaa41d2d68ce58 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 5 Sep 2008 23:53:36 +0000 Subject: [PATCH 245/388] more pointer <-> ULONG cast fixes svn path=/branches/ros-amd64-bringup/; revision=35971 --- reactos/ntoskrnl/ex/work.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/ex/work.c b/reactos/ntoskrnl/ex/work.c index 7d1e8146663..d7bdae23583 100644 --- a/reactos/ntoskrnl/ex/work.c +++ b/reactos/ntoskrnl/ex/work.c @@ -147,7 +147,7 @@ ProcessLoop: TimeoutPointer); /* Check if we timed out and quit this loop in that case */ - if ((NTSTATUS)QueueEntry == STATUS_TIMEOUT) break; + if ((NTSTATUS)(ULONG_PTR)QueueEntry == STATUS_TIMEOUT) break; /* Increment Processed Work Items */ InterlockedIncrement((PLONG)&WorkQueue->WorkItemsProcessed); @@ -271,7 +271,7 @@ ExpCreateWorkerThread(WORK_QUEUE_TYPE WorkQueueType, NULL, NULL, ExpWorkerThreadEntryPoint, - (PVOID)Context); + UlongToPtr(Context)); /* If the thread is dynamic */ if (Dynamic) From 2cca1c875068dd8f28f77c7ceaf97ca430223d01 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 6 Sep 2008 15:52:53 +0000 Subject: [PATCH 246/388] Merge 35977. Fix 64 bit portability issues. Thanks ekohl! svn path=/branches/ros-amd64-bringup/; revision=35989 --- reactos/base/system/services/rpcserver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index 5e11db39dd8..997ac86e0c3 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -1963,7 +1963,7 @@ done:; if (dwError == ERROR_SUCCESS) { DPRINT("hService %p\n", hServiceHandle); - *lpServiceHandle = (unsigned long)hServiceHandle; /* FIXME: 64 bit portability */ + *lpServiceHandle = (SC_RPC_HANDLE)hServiceHandle; if (lpdwTagId != NULL) *lpdwTagId = lpService->dwTag; @@ -2356,7 +2356,7 @@ DWORD ROpenSCManagerW( return dwError; } - *lpScHandle = (unsigned long)hHandle; /* FIXME: 64 bit portability */ + *lpScHandle = (SC_RPC_HANDLE)hHandle; DPRINT("*hScm = %p\n", *lpScHandle); DPRINT("ROpenSCManagerW() done\n"); @@ -2432,7 +2432,7 @@ DWORD ROpenServiceW( lpService->dwRefCount++; DPRINT1("OpenService - lpService->dwRefCount %u\n",lpService->dwRefCount); - *lpServiceHandle = (unsigned long)hHandle; /* FIXME: 64 bit portability */ + *lpServiceHandle = (SC_RPC_HANDLE)hHandle; DPRINT("*hService = %p\n", *lpServiceHandle); DPRINT("ROpenServiceW() done\n"); From 20f866046866d3413ef8abc569db1c58bc6b116f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 6 Sep 2008 15:53:36 +0000 Subject: [PATCH 247/388] Fix 64 bit portability issues. svn path=/branches/ros-amd64-bringup/; revision=35990 --- reactos/include/reactos/idl/svcctl.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/reactos/idl/svcctl.idl b/reactos/include/reactos/idl/svcctl.idl index 2f737a5a489..8e92a50081b 100644 --- a/reactos/include/reactos/idl/svcctl.idl +++ b/reactos/include/reactos/idl/svcctl.idl @@ -18,11 +18,11 @@ const unsigned short SC_MAX_ARGUMENTS = 1024; typedef unsigned long SECURITY_INFORMATION; typedef [handle] LPSTR SVCCTL_HANDLEA; typedef [handle] LPWSTR SVCCTL_HANDLEW; -typedef [context_handle] unsigned long SC_RPC_HANDLE; +typedef [context_handle] ULONG_PTR SC_RPC_HANDLE; typedef SC_RPC_HANDLE* LPSC_RPC_HANDLE; typedef [context_handle] PVOID SC_RPC_LOCK; typedef SC_RPC_LOCK* LPSC_RPC_LOCK; -typedef [context_handle] unsigned long SC_NOTIFY_RPC_HANDLE; +typedef [context_handle] ULONG_PTR SC_NOTIFY_RPC_HANDLE; typedef SC_NOTIFY_RPC_HANDLE* LPSC_NOTIFY_RPC_HANDLE; typedef [range(0, 1024 * 4)] DWORD BOUNDED_DWORD_4K; typedef BOUNDED_DWORD_4K* LPBOUNDED_DWORD_4K; From 829999d2033e28df62af5ba66f9be36f3a8443ed Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 6 Sep 2008 17:11:46 +0000 Subject: [PATCH 248/388] change stub to stdcall, less likely to fuck up the stack svn path=/branches/ros-amd64-bringup/; revision=35994 --- reactos/tools/winebuild/spec32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/tools/winebuild/spec32.c b/reactos/tools/winebuild/spec32.c index ef4a37d32e8..d4671928da6 100644 --- a/reactos/tools/winebuild/spec32.c +++ b/reactos/tools/winebuild/spec32.c @@ -696,7 +696,7 @@ void BuildPedllFile( DLLSPEC *spec ) output( "#include \n"); output( "#include \n"); - output( "DWORD __wine_spec_unimplemented_stub( const char *module, const char *function )\n"); + output( "DWORD __stdcall __wine_spec_unimplemented_stub( const char *module, const char *function )\n"); output( "{\n"); output( " DPRINT1(\"%%s hit stub for %%s\\n\",module,function);"); output( "\n"); From 3a18219adc201db702a9dfa2e548c37f73a7649a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 6 Sep 2008 23:56:10 +0000 Subject: [PATCH 249/388] Fix a ULONG to pointer cast to make out shiny new RosBE happy. svn path=/branches/ros-amd64-bringup/; revision=36011 --- reactos/drivers/network/ndis/ndis/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/network/ndis/ndis/io.c b/reactos/drivers/network/ndis/ndis/io.c index 43bed6fa3ac..8766e9e4b87 100644 --- a/reactos/drivers/network/ndis/ndis/io.c +++ b/reactos/drivers/network/ndis/ndis/io.c @@ -873,7 +873,7 @@ NdisMRegisterIoPortRange( if(AddressSpace) { ASSERT(TranslatedAddress.u.HighPart == 0); - *PortOffset = (PVOID) TranslatedAddress.u.LowPart; + *PortOffset = (PVOID)(ULONG_PTR)TranslatedAddress.QuadPart; NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x\n", *PortOffset)); return NDIS_STATUS_SUCCESS; } From 6acdf6d0d2aa9e53fb32d3ca1cdf97ac9ecf8b35 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 7 Sep 2008 00:04:29 +0000 Subject: [PATCH 250/388] more ulong <-> pointer fixes svn path=/branches/ros-amd64-bringup/; revision=36012 --- reactos/drivers/storage/scsiport/scsiport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/storage/scsiport/scsiport.c b/reactos/drivers/storage/scsiport/scsiport.c index ca829e96f2f..163acf79e96 100644 --- a/reactos/drivers/storage/scsiport/scsiport.c +++ b/reactos/drivers/storage/scsiport/scsiport.c @@ -462,7 +462,7 @@ ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension, /* i/o space */ if (AddressSpace != 0) - return((PVOID)TranslatedAddress.u.LowPart); + return((PVOID)(ULONG_PTR)TranslatedAddress.QuadPart); MappedAddress = MmMapIoSpace(TranslatedAddress, NumberOfBytes, @@ -1133,8 +1133,8 @@ CreatePortConfig: PortConfig->AccessRanges = (PVOID)(PortConfig+1); /* Align to LONGLONG */ - PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) + 7); - PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) & ~7); + PortConfig->AccessRanges = (PVOID)((ULONG_PTR)(PortConfig->AccessRanges) + 7); + PortConfig->AccessRanges = (PVOID)((ULONG_PTR)(PortConfig->AccessRanges) & ~7); /* Copy the data */ RtlCopyMemory(PortConfig->AccessRanges, From 3fc7faad0d8f0d01094d44cfc225052cee5aa66c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 7 Sep 2008 00:17:05 +0000 Subject: [PATCH 251/388] comment out some functions on AMD64 build that don't belong here. svn path=/branches/ros-amd64-bringup/; revision=36013 --- reactos/hal/hal/hal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index 7cfe343b937..c42cfea8f8b 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -748,7 +748,7 @@ KeAcquireSpinLockRaiseToSynch( return 0; } - +#ifndef _M_AMD64 VOID FASTCALL KeAcquireInStackQueuedSpinLock( @@ -777,6 +777,7 @@ KeReleaseInStackQueuedSpinLock( { UNIMPLEMENTED; } +#endif VOID NTAPI @@ -853,6 +854,7 @@ KeRaiseIrqlToSynchLevel(VOID) } #endif +#ifndef _M_AMD64 #undef KeReleaseSpinLock VOID NTAPI @@ -862,7 +864,7 @@ KeReleaseSpinLock( { UNIMPLEMENTED; } - +#endif VOID NTAPI From 2415d5a23ab08a5783549d30d3874dd771c16027 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 8 Sep 2008 22:54:32 +0000 Subject: [PATCH 252/388] This is the amd64 branch! If arm is broken I don't care, if x86 is broken for some time, it's not that bad. But why the heck do you break amd64 build and then leave it broken? Please fix it ASAP. Yes, encoded, I mean you! - Comment out some files from crt to build bootcd again. svn path=/branches/ros-amd64-bringup/; revision=36069 --- reactos/lib/sdk/crt/crt.rbuild | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/lib/sdk/crt/crt.rbuild b/reactos/lib/sdk/crt/crt.rbuild index 17fa2c60ce7..f19a57e13c4 100644 --- a/reactos/lib/sdk/crt/crt.rbuild +++ b/reactos/lib/sdk/crt/crt.rbuild @@ -259,14 +259,14 @@ access.c - file.c - find.c + + fmode.c lnx_sprintf.c perror.c popen.c waccess.c - wfind.c + wpopen.c From 6732b4914123de79c747d9d4f425fe6395884752 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 9 Sep 2008 22:11:45 +0000 Subject: [PATCH 253/388] Fix some warnings svn path=/branches/ros-amd64-bringup/; revision=36098 --- reactos/ntoskrnl/ke/amd64/cpu.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/cpu.c b/reactos/ntoskrnl/ke/amd64/cpu.c index 083e4968d3c..390b5f8f4c0 100644 --- a/reactos/ntoskrnl/ke/amd64/cpu.c +++ b/reactos/ntoskrnl/ke/amd64/cpu.c @@ -49,7 +49,7 @@ NTAPI KiSetProcessorType(VOID) { ULONG64 EFlags; - int Reg[4]; + INT Reg[4]; ULONG Stepping, Type; /* Start by assuming no CPUID data */ @@ -89,7 +89,7 @@ NTAPI KiGetCpuVendor(VOID) { PKPRCB Prcb = KeGetCurrentPrcb(); - ULONG Vendor[5]; + INT Vendor[5]; ULONG Temp; /* Assume no Vendor ID and fail if no CPUID Support. */ @@ -112,30 +112,30 @@ KiGetCpuVendor(VOID) Prcb->VendorString[sizeof(Prcb->VendorString) - sizeof(CHAR)] = ANSI_NULL; /* Now check the CPU Type */ - if (!strcmp(Prcb->VendorString, CmpIntelID)) + if (!strcmp((PCHAR)Prcb->VendorString, CmpIntelID)) { return CPU_INTEL; } - else if (!strcmp(Prcb->VendorString, CmpAmdID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpAmdID)) { return CPU_AMD; } - else if (!strcmp(Prcb->VendorString, CmpCyrixID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpCyrixID)) { DPRINT1("Cyrix CPUs not fully supported\n"); return 0; } - else if (!strcmp(Prcb->VendorString, CmpTransmetaID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpTransmetaID)) { DPRINT1("Transmeta CPUs not fully supported\n"); return 0; } - else if (!strcmp(Prcb->VendorString, CmpCentaurID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpCentaurID)) { DPRINT1("VIA CPUs not fully supported\n"); return 0; } - else if (!strcmp(Prcb->VendorString, CmpRiseID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpRiseID)) { DPRINT1("Rise CPUs not fully supported\n"); return 0; @@ -152,7 +152,7 @@ KiGetFeatureBits(VOID) PKPRCB Prcb = KeGetCurrentPrcb(); ULONG Vendor; ULONG FeatureBits = KF_WORKING_PTE; - ULONG Reg[4]; + INT Reg[4]; BOOLEAN ExtendedCPUID = TRUE; ULONG CpuFeatures = 0; @@ -230,7 +230,7 @@ KiGetFeatureBits(VOID) { /* Perform the special sequence to get the MicroCode Signature */ __writemsr(0x8B, 0); - __writemsr(Reg, 1); + __cpuid(Reg, 1); Prcb->UpdateSignature.QuadPart = __readmsr(0x8B); } else if (Prcb->CpuType == 5) @@ -329,7 +329,7 @@ KiGetCacheInformation(VOID) { PKIPCR Pcr = (PKIPCR)KeGetPcr(); ULONG Vendor; - ULONG Data[4]; + INT Data[4]; ULONG CacheRequests = 0, i; ULONG CurrentRegister; UCHAR RegisterByte; From 96d080d8b3aed89fb710f9f19fdf2bd26bd08006 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 11 Sep 2008 20:19:23 +0000 Subject: [PATCH 254/388] Stop annoying warning. svn path=/branches/ros-amd64-bringup/; revision=36146 --- reactos/drivers/storage/ide/pciidex/pciidex.rbuild | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild index d37294759fb..0691c33b3cf 100644 --- a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild +++ b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild @@ -3,7 +3,6 @@ ntoskrnl - pciidex.spec fdo.c miniport.c misc.c From 391cff10a7f181e644bb6575f5d5661df7f3514b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 13 Sep 2008 00:52:44 +0000 Subject: [PATCH 255/388] Fix TIMERPROC definition. Fix CreateToolbarEx definition. svn path=/branches/ros-amd64-bringup/; revision=36171 --- reactos/include/psdk/commctrl.h | 2 +- reactos/include/psdk/winuser.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/psdk/commctrl.h b/reactos/include/psdk/commctrl.h index 10426fa791f..5b2a3c69520 100644 --- a/reactos/include/psdk/commctrl.h +++ b/reactos/include/psdk/commctrl.h @@ -1596,7 +1596,7 @@ CreateToolbar(HWND, DWORD, UINT, INT, HINSTANCE, HWND WINAPI CreateToolbarEx(HWND, DWORD, UINT, INT, - HINSTANCE, UINT, LPCTBBUTTON, + HINSTANCE, UINT_PTR, LPCTBBUTTON, INT, INT, INT, INT, INT, UINT); HBITMAP WINAPI diff --git a/reactos/include/psdk/winuser.h b/reactos/include/psdk/winuser.h index d9d9b0b24b6..31d2519702e 100644 --- a/reactos/include/psdk/winuser.h +++ b/reactos/include/psdk/winuser.h @@ -2699,7 +2699,7 @@ extern "C" { #ifndef RC_INVOKED typedef INT_PTR(CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM); -typedef VOID(CALLBACK *TIMERPROC)(HWND,UINT,UINT,DWORD); +typedef VOID(CALLBACK *TIMERPROC)(HWND,UINT,UINT_PTR,DWORD); typedef BOOL(CALLBACK *GRAYSTRINGPROC)(HDC,LPARAM,int); typedef LRESULT(CALLBACK *HOOKPROC)(int,WPARAM,LPARAM); typedef BOOL(CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE); From 7adc5e628f237f3be665bbc56ca6a89e340a70c0 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 13 Sep 2008 00:55:13 +0000 Subject: [PATCH 256/388] Fix CreateToolBarEx. Build as unicode. No need to allow warnings anymore. svn path=/branches/ros-amd64-bringup/; revision=36172 --- reactos/dll/win32/comctl32/comctl32.rbuild | 2 +- reactos/dll/win32/comctl32/commctrl.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/comctl32/comctl32.rbuild b/reactos/dll/win32/comctl32/comctl32.rbuild index 95259d9bb07..9139d732f74 100644 --- a/reactos/dll/win32/comctl32/comctl32.rbuild +++ b/reactos/dll/win32/comctl32/comctl32.rbuild @@ -1,7 +1,7 @@ - + . diff --git a/reactos/dll/win32/comctl32/commctrl.c b/reactos/dll/win32/comctl32/commctrl.c index 4ff20753020..85188ae905a 100644 --- a/reactos/dll/win32/comctl32/commctrl.c +++ b/reactos/dll/win32/comctl32/commctrl.c @@ -707,6 +707,7 @@ CreateUpDownControl (DWORD style, INT x, INT y, INT cx, INT cy, VOID WINAPI InitCommonControls (void) { + return; } @@ -772,7 +773,7 @@ InitCommonControlsEx (const INITCOMMONCONTROLSEX *lpInitCtrls) HWND WINAPI CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps, - HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons, + HINSTANCE hBMInst, UINT_PTR wBMID, LPCTBBUTTON lpButtons, INT iNumButtons, INT dxButton, INT dyButton, INT dxBitmap, INT dyBitmap, UINT uStructSize) { From 2c8d1577ee82ed69ec5a4646ac4fbae0b18430aa Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 13 Sep 2008 01:36:21 +0000 Subject: [PATCH 257/388] Convert winspool to spec svn path=/branches/ros-amd64-bringup/; revision=36173 --- reactos/dll/win32/winspool/winspool.def | 116 ------------- reactos/dll/win32/winspool/winspool.rbuild | 3 +- reactos/dll/win32/winspool/winspool.spec | 181 +++++++++++++++++++++ 3 files changed, 183 insertions(+), 117 deletions(-) delete mode 100644 reactos/dll/win32/winspool/winspool.def create mode 100644 reactos/dll/win32/winspool/winspool.spec diff --git a/reactos/dll/win32/winspool/winspool.def b/reactos/dll/win32/winspool/winspool.def deleted file mode 100644 index ce97f3dc1c6..00000000000 --- a/reactos/dll/win32/winspool/winspool.def +++ /dev/null @@ -1,116 +0,0 @@ -; $Id$ -; -; winspool.drv - Printer spooler - -LIBRARY winspool.drv - -EXPORTS -AbortPrinter@4 -AddFormA@12 -AddFormW@12 -AddJobA@20 -AddJobW@20 -AddMonitorA@12 -AddMonitorW@12 -AddPortA@12 -AddPortW@12 -AddPrinterA@12 -AddPrinterConnectionA@4 -AddPrinterConnectionW@4 -AddPrinterDriverA@12 -AddPrinterDriverW@12 -AddPrinterW@12 -AddPrintProcessorA@16 -AddPrintProcessorW@16 -AddPrintProvidorA@12 -AddPrintProvidorW@12 -AdvancedDocumentPropertiesA@20 -AdvancedDocumentPropertiesW@20 -ClosePrinter@4 -ConfigurePortA@12 -ConfigurePortW@12 -ConnectToPrinterDlg@8 -DeleteFormA@8 -DeleteFormW@8 -DeleteMonitorA@12 -DeleteMonitorW@12 -DeletePortA@12 -DeletePortW@12 -DeletePrinter@4 -DeletePrinterConnectionA@4 -DeletePrinterConnectionW@4 -DeletePrinterDataA@8 -DeletePrinterDataW@8 -DeletePrinterDriverA@12 -DeletePrinterDriverW@12 -DeletePrintProcessorA@12 -DeletePrintProcessorW@12 -DeletePrintProvidorA@12 -DeletePrintProvidorW@12 -DeviceCapabilitiesA@20 -DeviceCapabilitiesW@20 -DllMain@12 -DocumentPropertiesA@24 -DocumentPropertiesW@24 -EndDocPrinter@4 -EndPagePrinter@4 -EnumFormsA@24 -EnumFormsW@24 -EnumJobsA@32 -EnumJobsW@32 -EnumMonitorsA@24 -EnumMonitorsW@24 -EnumPortsA@24 -EnumPortsW@24 -EnumPrinterDataA@36 -EnumPrinterDataW@36 -EnumPrinterDriversA@28 -EnumPrinterDriversW@28 -EnumPrintersA@28 -EnumPrintersW@28 -EnumPrintProcessorDatatypesA@28 -EnumPrintProcessorDatatypesW@28 -EnumPrintProcessorsA@28 -EnumPrintProcessorsW@28 -FindClosePrinterChangeNotification@4 -FindFirstPrinterChangeNotification@16 -FindNextPrinterChangeNotification@16 -FreePrinterNotifyInfo@4 -GetDefaultPrinterA@8 @201 -GetDefaultPrinterW@8 @203 -GetFormA@24 -GetFormW@24 -GetJobA@24 -GetJobW@24 -GetPrinterA@20 -GetPrinterDataA@24 -GetPrinterDataW@24 -GetPrinterDriverA@24 -GetPrinterDriverDirectoryA@24 -GetPrinterDriverDirectoryW@24 -GetPrinterDriverW@24 -GetPrinterW@20 -GetPrintProcessorDirectoryA@24 -GetPrintProcessorDirectoryW@24 -OpenPrinterA@12 -OpenPrinterW@12 -PrinterMessageBoxA@24 -PrinterMessageBoxW@24 -PrinterProperties@8 -ReadPrinter@16 -ResetPrinterA@8 -ResetPrinterW@8 -ScheduleJob@8 -SetFormA@16 -SetFormW@16 -SetJobA@20 -SetJobW@20 -SetPrinterA@16 -SetPrinterDataA@20 -SetPrinterDataW@20 -SetPrinterW@16 -StartDocPrinterA@12 -StartDocPrinterW@12 -StartPagePrinter@4 -WaitForPrinterChange@8 -WritePrinter@16 diff --git a/reactos/dll/win32/winspool/winspool.rbuild b/reactos/dll/win32/winspool/winspool.rbuild index 107f26b134b..c44d0bfad7c 100644 --- a/reactos/dll/win32/winspool/winspool.rbuild +++ b/reactos/dll/win32/winspool/winspool.rbuild @@ -1,5 +1,5 @@ - + . ntdll @@ -7,4 +7,5 @@ info.c stubs.c winspool.rc + winspool.spec diff --git a/reactos/dll/win32/winspool/winspool.spec b/reactos/dll/win32/winspool/winspool.spec new file mode 100644 index 00000000000..b681ded6dc0 --- /dev/null +++ b/reactos/dll/win32/winspool/winspool.spec @@ -0,0 +1,181 @@ + + 100 stub -noname EnumPrinterPropertySheets + 101 stub -noname ClusterSplOpen + 102 stub -noname ClusterSplClose + 103 stub -noname ClusterSplIsAlive + 104 stub PerfClose + 105 stub PerfCollect + 106 stub PerfOpen + 201 stdcall GetDefaultPrinterA(ptr ptr) + 202 stub SetDefaultPrinterA + 203 stdcall GetDefaultPrinterW(ptr ptr) + 204 stub SetDefaultPrinterW + 205 stub -noname SplReadPrinter + 206 stub -noname AddPerMachineConnectionA + 207 stub -noname AddPerMachineConnectionW + 208 stub -noname DeletePerMachineConnectionA + 209 stub -noname DeletePerMachineConnectionW + 210 stub -noname EnumPerMachineConnectionsA + 211 stub -noname EnumPerMachineConnectionsW + 212 stub -noname LoadPrinterDriver + 213 stub -noname RefCntLoadDriver + 214 stub -noname RefCntUnloadDriver + 215 stub -noname ForceUnloadDriver + 216 stub -noname PublishPrinterA + 217 stub -noname PublishPrinterW + 218 stub -noname CallCommonPropertySheetUI + 219 stub -noname PrintUIQueueCreate + 220 stub -noname PrintUIPrinterPropPages + 221 stub -noname PrintUIDocumentDefaults + 222 stub -noname SendRecvBidiData + 223 stub -noname RouterFreeBidiResponseContainer + 224 stub -noname ExternalConnectToLd64In32Server + 226 stub -noname PrintUIWebPnpEntry + 227 stub -noname PrintUIWebPnpPostEntry + 228 stub -noname PrintUICreateInstance + 229 stub -noname PrintUIDocumentPropertiesWrap + 230 stub -noname PrintUIPrinterSetup + 231 stub -noname PrintUIServerPropPages + 232 stub -noname AddDriverCatalog + + @ stub ADVANCEDSETUPDIALOG + @ stdcall AbortPrinter(long) + @ stdcall AddFormA(long long ptr) + @ stdcall AddFormW(long long ptr) + @ stdcall AddJobA(long long ptr long ptr) + @ stdcall AddJobW(long long ptr long ptr) + @ stdcall AddMonitorA(str long ptr) + @ stdcall AddMonitorW(wstr long ptr) + @ stdcall AddPortA(str ptr str) + @ stub AddPortExA + @ stub AddPortExW + @ stdcall AddPortW(wstr long wstr) + @ stdcall AddPrintProcessorA(str str str str) + @ stdcall AddPrintProcessorW(wstr wstr wstr wstr) + @ stdcall AddPrintProvidorA(str long ptr) + @ stdcall AddPrintProvidorW(wstr long ptr) + @ stdcall AddPrinterA(str long ptr) + @ stdcall AddPrinterConnectionA(str) + @ stdcall AddPrinterConnectionW(wstr) + @ stdcall AddPrinterDriverA(str long ptr) + @ stub AddPrinterDriverExA + @ stub AddPrinterDriverExW + @ stdcall AddPrinterDriverW(wstr long ptr) + @ stdcall AddPrinterW(wstr long ptr) + @ stdcall AdvancedDocumentPropertiesA(long long str ptr ptr) + @ stdcall AdvancedDocumentPropertiesW(long long wstr ptr ptr) + @ stub AdvancedSetupDialog + @ stdcall ClosePrinter(long) + @ stdcall ConfigurePortA(str long str) + @ stdcall ConfigurePortW(wstr long wstr) + @ stdcall ConnectToPrinterDlg(long long) + @ stub ConvertAnsiDevModeToUnicodeDevMode + @ stub ConvertUnicodeDevModeToAnsiDevMode + @ stub CreatePrinterIC + @ stub DEVICECAPABILITIES + @ stub DEVICEMODE + @ stdcall DeleteFormA(long str) + @ stdcall DeleteFormW(long wstr) + @ stdcall DeleteMonitorA(str str str) + @ stdcall DeleteMonitorW(wstr wstr wstr) + @ stdcall DeletePortA(str long str) + @ stdcall DeletePortW(wstr long wstr) + @ stdcall DeletePrintProcessorA(str str str) + @ stdcall DeletePrintProcessorW(wstr wstr wstr) + @ stdcall DeletePrintProvidorA(str str str) + @ stdcall DeletePrintProvidorW(wstr wstr wstr) + @ stdcall DeletePrinter(long) + @ stdcall DeletePrinterConnectionA(str) + @ stdcall DeletePrinterConnectionW(wstr) + @ stub DeletePrinterDataExA + @ stub DeletePrinterDataExW + @ stdcall DeletePrinterDriverA(str str str) + @ stub DeletePrinterDriverExA + @ stub DeletePrinterDriverExW + @ stdcall DeletePrinterDriverW(wstr wstr wstr) + @ stub DeletePrinterIC + @ stub DevQueryPrint + @ stdcall DeviceCapabilities(str str long ptr ptr) DeviceCapabilitiesA + @ stdcall DeviceCapabilitiesA(str str long ptr ptr) + @ stdcall DeviceCapabilitiesW(wstr wstr long wstr ptr) + @ stub DeviceMode + @ stub DocumentEvent + @ stdcall DocumentPropertiesA(long long ptr ptr ptr long) + @ stdcall DocumentPropertiesW(long long ptr ptr ptr long) + @ stub EXTDEVICEMODE + @ stdcall EndDocPrinter(long) + @ stdcall EndPagePrinter(long) + @ stdcall EnumFormsA(long long ptr long ptr ptr) + @ stdcall EnumFormsW(long long ptr long ptr ptr) + @ stdcall EnumJobsA(long long long long ptr long ptr ptr) + @ stdcall EnumJobsW(long long long long ptr long ptr ptr) + @ stdcall EnumMonitorsA(str long ptr long long long) + @ stdcall EnumMonitorsW(wstr long ptr long long long) + @ stdcall EnumPortsA(str long ptr ptr ptr ptr) + @ stdcall EnumPortsW(wstr long ptr ptr ptr ptr) + @ stdcall EnumPrintProcessorDatatypesA(str str long ptr long ptr ptr) + @ stdcall EnumPrintProcessorDatatypesW(wstr wstr long ptr long ptr ptr) + @ stdcall EnumPrintProcessorsA(str str long ptr long ptr ptr) + @ stdcall EnumPrintProcessorsW(wstr wstr long ptr long ptr ptr) + @ stdcall EnumPrinterDataA(long long ptr long ptr ptr ptr long ptr) + @ stub EnumPrinterDataExA + @ stub EnumPrinterDataExW + @ stdcall EnumPrinterDataW(long long ptr long ptr ptr ptr long ptr) + @ stdcall EnumPrinterDriversA(str str long ptr long ptr ptr) + @ stdcall EnumPrinterDriversW(wstr wstr long ptr long ptr ptr) + @ stdcall EnumPrintersA(long ptr long ptr long ptr ptr) + @ stdcall EnumPrintersW(long ptr long ptr long ptr ptr) + @ stub ExtDeviceMode + @ stdcall FindClosePrinterChangeNotification(long) + @ stdcall FindFirstPrinterChangeNotification(long long long ptr) + @ stdcall FindNextPrinterChangeNotification(long ptr ptr ptr) + @ stdcall FreePrinterNotifyInfo(ptr) + @ stdcall GetFormA(long str long ptr long ptr) + @ stdcall GetFormW(long wstr long ptr long ptr) + @ stdcall GetJobA(long long long ptr long ptr) + @ stdcall GetJobW(long long long ptr long ptr) + @ stdcall GetPrintProcessorDirectoryA(str str long ptr long ptr) + @ stdcall GetPrintProcessorDirectoryW(wstr wstr long ptr long ptr) + @ stdcall GetPrinterA(long long ptr long ptr) + @ stdcall GetPrinterDataA(long str ptr ptr long ptr) + @ stub GetPrinterDataExA + @ stub GetPrinterDataExW + @ stdcall GetPrinterDataW(long wstr ptr ptr long ptr) + @ stdcall GetPrinterDriverA(long str long ptr long ptr) + @ stdcall GetPrinterDriverDirectoryA(str str long ptr long ptr) + @ stdcall GetPrinterDriverDirectoryW(wstr wstr long ptr long ptr) + @ stdcall GetPrinterDriverW(long str long ptr long ptr) + @ stdcall GetPrinterW(long long ptr long ptr) + @ stdcall OpenPrinterA(str ptr ptr) + @ stdcall OpenPrinterW(wstr ptr ptr) + @ stub PlayGdiScriptOnPrinterIC + @ stub PrinterMessageBoxA + @ stub PrinterMessageBoxW + @ stdcall PrinterProperties(long long) + @ stdcall ReadPrinter(long ptr long ptr) + @ stdcall ResetPrinterA(long ptr) + @ stdcall ResetPrinterW(long ptr) + @ stdcall ScheduleJob(long long) + @ stub SetAllocFailCount + @ stdcall SetFormA(long str long ptr) + @ stdcall SetFormW(long wstr long ptr) + @ stdcall SetJobA(long long long ptr long) + @ stdcall SetJobW(long long long ptr long) + @ stdcall SetPrinterA(long long ptr long) + @ stdcall SetPrinterDataA(long str long ptr long) + @ stub SetPrinterDataExA + @ stub SetPrinterDataExW + @ stdcall SetPrinterDataW(long wstr long ptr long) + @ stdcall SetPrinterW(long long ptr long) + @ stub SpoolerDevQueryPrintW + @ stub SpoolerInit + @ stub SpoolerPrinterEvent + @ stub StartDocDlgA + @ stub StartDocDlgW + @ stub StartDocPrinterA + @ stub StartDocPrinterW + @ stdcall StartPagePrinter(long) + @ stub WaitForPrinterChange + @ stdcall WritePrinter(long ptr long ptr) + @ stub XcvDataW + From 72adb4a0afe65483cb3748de86675748e6cd8408 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 13 Sep 2008 02:00:44 +0000 Subject: [PATCH 258/388] Fix warnings/errors in 64bit build. svn path=/branches/ros-amd64-bringup/; revision=36174 --- reactos/base/applications/taskmgr/perfdata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/base/applications/taskmgr/perfdata.c b/reactos/base/applications/taskmgr/perfdata.c index 3f871e2fa05..5978639371a 100644 --- a/reactos/base/applications/taskmgr/perfdata.c +++ b/reactos/base/applications/taskmgr/perfdata.c @@ -88,7 +88,7 @@ static void SidToUserName(PSID Sid, LPWSTR szBuffer, DWORD BufferSize) void PerfDataRefresh(void) { - SIZE_T ulSize; + ULONG ulSize; NTSTATUS status; LPBYTE pBuffer; ULONG BufferSize; @@ -393,7 +393,7 @@ int PerfGetIndexByProcessId(DWORD dwProcessId) for (Index = 0; Index < ProcessCount; Index++) { - if ((DWORD)pPerfData[Index].ProcessId == dwProcessId) + if (PtrToUlong(pPerfData[Index].ProcessId) == dwProcessId) { FoundIndex = Index; break; @@ -412,7 +412,7 @@ ULONG PerfDataGetProcessId(ULONG Index) EnterCriticalSection(&PerfDataCriticalSection); if (Index < ProcessCount) - ProcessId = (ULONG)pPerfData[Index].ProcessId; + ProcessId = PtrToUlong(pPerfData[Index].ProcessId); else ProcessId = 0; From 20695eeb01878b9e13eddc2b6f53662df671c46f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 13 Sep 2008 07:05:42 +0000 Subject: [PATCH 259/388] Protect other architectures from i386 and amd64 specifics. Disallow warnings in this module(like it was before). svn path=/branches/ros-amd64-bringup/; revision=36175 --- reactos/lib/3rdparty/mingw/crtexe.c | 2 ++ reactos/lib/3rdparty/mingw/mingw.rbuild | 2 +- reactos/lib/3rdparty/mingw/pseudo-reloc.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/lib/3rdparty/mingw/crtexe.c b/reactos/lib/3rdparty/mingw/crtexe.c index d247c8a07c1..6b56ff322b8 100644 --- a/reactos/lib/3rdparty/mingw/crtexe.c +++ b/reactos/lib/3rdparty/mingw/crtexe.c @@ -202,7 +202,9 @@ __mingw_CRTStartup (void) if (__dyn_tls_init_callback != NULL && _IsNonwritableInCurrentImage ((PBYTE) &__dyn_tls_init_callback)) __dyn_tls_init_callback (NULL, DLL_THREAD_ATTACH, NULL); +#if defined(__i386__) || defined(__x86_64__) _pei386_runtime_relocator (); +#endif #if defined(__x86_64__) __asm__ __volatile__ ( diff --git a/reactos/lib/3rdparty/mingw/mingw.rbuild b/reactos/lib/3rdparty/mingw/mingw.rbuild index 3d004dc5e52..c0d8bbfb298 100644 --- a/reactos/lib/3rdparty/mingw/mingw.rbuild +++ b/reactos/lib/3rdparty/mingw/mingw.rbuild @@ -1,7 +1,7 @@ - + include CRT_fp10.c diff --git a/reactos/lib/3rdparty/mingw/pseudo-reloc.c b/reactos/lib/3rdparty/mingw/pseudo-reloc.c index 66425e34ea2..c3e3b6b1c64 100644 --- a/reactos/lib/3rdparty/mingw/pseudo-reloc.c +++ b/reactos/lib/3rdparty/mingw/pseudo-reloc.c @@ -12,6 +12,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +/* Only necesary on x86 and amd64 targets */ +#if defined(__i386__) || defined(__x86_64__) + #include extern char __RUNTIME_PSEUDO_RELOC_LIST__; @@ -44,3 +47,4 @@ _pei386_runtime_relocator () &__RUNTIME_PSEUDO_RELOC_LIST_END__, &_image_base__); } +#endif From 5c266abfd27ceaf1970a058591dc52e1ceaab3ee Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 13 Sep 2008 07:12:22 +0000 Subject: [PATCH 260/388] Move several functions out of file.c, use common code for 64bit, 32bit, unicode and non-unicode versions and provide proper definition. Fixes amd64 build of crt lib. (nothing tested) svn path=/branches/ros-amd64-bringup/; revision=36176 --- reactos/lib/sdk/crt/crt.rbuild | 10 +- reactos/lib/sdk/crt/stdio/file.c | 453 +---------------------------- reactos/lib/sdk/crt/stdio/find.c | 107 +------ reactos/lib/sdk/crt/stdio/find64.c | 119 ++++++++ reactos/lib/sdk/crt/stdio/stat.c | 15 + reactos/lib/sdk/crt/stdio/stat64.c | 365 +++++++++++++++++++++++ reactos/lib/sdk/crt/stdio/wfind.c | 7 +- reactos/lib/sdk/crt/stdio/wstat.c | 7 + 8 files changed, 522 insertions(+), 561 deletions(-) create mode 100644 reactos/lib/sdk/crt/stdio/find64.c create mode 100644 reactos/lib/sdk/crt/stdio/stat.c create mode 100644 reactos/lib/sdk/crt/stdio/stat64.c create mode 100644 reactos/lib/sdk/crt/stdio/wstat.c diff --git a/reactos/lib/sdk/crt/crt.rbuild b/reactos/lib/sdk/crt/crt.rbuild index f19a57e13c4..abea00105ec 100644 --- a/reactos/lib/sdk/crt/crt.rbuild +++ b/reactos/lib/sdk/crt/crt.rbuild @@ -259,15 +259,19 @@ access.c - - + file.c + find.c + find64.c fmode.c lnx_sprintf.c perror.c popen.c + stat.c + stat64.c waccess.c - + wfind.c wpopen.c + wstat.c _exit.c diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index a092e6246dd..2569daf8e03 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -68,11 +68,6 @@ int *__p___mb_cur_max(void); #undef vprintf #undef vwprintf -/* for stat mode, permissions apply to all,owner and group */ -#define ALL_S_IREAD (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6)) -#define ALL_S_IWRITE (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6)) -#define ALL_S_IEXEC (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6)) - /* _access() bit flags FIXME: incomplete */ /* defined in crt/io.h */ @@ -94,7 +89,7 @@ typedef struct { DWORD unkn[7]; /* critical section and init flag */ } ioinfo; -/*static */ioinfo fdesc[MAX_FILES]; +ioinfo fdesc[MAX_FILES]; FILE _iob[3] = { { 0 } }; @@ -110,17 +105,6 @@ static int MSVCRT_umask = 0; /* INTERNAL: Static buffer for temp file name */ static char tmpname[MAX_PATH]; -static const unsigned int EXE = 'e' << 16 | 'x' << 8 | 'e'; -static const unsigned int BAT = 'b' << 16 | 'a' << 8 | 't'; -static const unsigned int CMD = 'c' << 16 | 'm' << 8 | 'd'; -static const unsigned int COM = 'c' << 16 | 'o' << 8 | 'm'; - -#define TOUL(x) (ULONGLONG)(x) -static const ULONGLONG WCEXE = TOUL('e') << 32 | TOUL('x') << 16 | TOUL('e'); -static const ULONGLONG WCBAT = TOUL('b') << 32 | TOUL('a') << 16 | TOUL('t'); -static const ULONGLONG WCCMD = TOUL('c') << 32 | TOUL('m') << 16 | TOUL('d'); -static const ULONGLONG WCCOM = TOUL('c') << 32 | TOUL('o') << 16 | TOUL('m'); - /* This critical section protects the tables fdesc and fstreams, * and their related indexes, fdstart, fdend, * and stream_idx, from race conditions. @@ -132,23 +116,6 @@ static CRITICAL_SECTION FILE_cs; #define LOCK_FILES() do { EnterCriticalSection(&FILE_cs); } while (0) #define UNLOCK_FILES() do { LeaveCriticalSection(&FILE_cs); } while (0) -#ifndef _WIN64 -static void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf) -{ - buf->st_dev = buf64->st_dev; - buf->st_ino = buf64->st_ino; - buf->st_mode = buf64->st_mode; - buf->st_nlink = buf64->st_nlink; - buf->st_uid = buf64->st_uid; - buf->st_gid = buf64->st_gid; - buf->st_rdev = buf64->st_rdev; - buf->st_size = buf64->st_size; - buf->st_atime = buf64->st_atime; - buf->st_mtime = buf64->st_mtime; - buf->st_ctime = buf64->st_ctime; -} -#endif - static inline BOOL is_valid_fd(int fd) { return fd >= 0 && fd < fdend && (fdesc[fd].wxflag & WX_OPEN); @@ -160,7 +127,7 @@ static inline BOOL is_valid_fd(int fd) * it returns a valid handle which is about to be closed, a subsequent call * will fail, most likely in a sane way. */ -static HANDLE fdtoh(int fd) +HANDLE fdtoh(int fd) { if (!is_valid_fd(fd)) { @@ -1149,138 +1116,6 @@ int CDECL _fileno(FILE* file) return file->_file; } -/********************************************************************* - * _fstat64 (MSVCRT.@) - */ -int CDECL _fstat64(int fd, struct _stat64* buf) -{ - DWORD dw; - DWORD type; - BY_HANDLE_FILE_INFORMATION hfi; - HANDLE hand = fdtoh(fd); - - TRACE(":fd (%d) stat (%p)\n",fd,buf); - if (hand == INVALID_HANDLE_VALUE) - return -1; - - if (!buf) - { - WARN(":failed-NULL buf\n"); - __set_errno(ERROR_INVALID_PARAMETER); - return -1; - } - - memset(&hfi, 0, sizeof(hfi)); - memset(buf, 0, sizeof(struct __stat64)); - type = GetFileType(hand); - if (type == FILE_TYPE_PIPE) - { - buf->st_dev = buf->st_rdev = fd; - buf->st_mode = S_IFIFO; - buf->st_nlink = 1; - } - else if (type == FILE_TYPE_CHAR) - { - buf->st_dev = buf->st_rdev = fd; - buf->st_mode = S_IFCHR; - buf->st_nlink = 1; - } - else /* FILE_TYPE_DISK etc. */ - { - if (!GetFileInformationByHandle(hand, &hfi)) - { - WARN(":failed-last error (%d)\n",GetLastError()); - __set_errno(ERROR_INVALID_PARAMETER); - return -1; - } - buf->st_mode = S_IFREG | S_IREAD; - if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - buf->st_mode |= S_IWRITE; - buf->st_size = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); - buf->st_atime = dw; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); - buf->st_mtime = buf->st_ctime = dw; - buf->st_nlink = hfi.nNumberOfLinks; - } - TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",hfi.dwFileAttributes, - buf->st_mode); - return 0; -} - -/********************************************************************* - * _fstati64 (MSVCRT.@) - */ -int CDECL _fstati64(int fd, struct _stati64* buf) -{ - int ret; - struct __stat64 buf64; - - ret = _fstat64(fd, &buf64); - if (!ret) - stat64_to_stati64(&buf64, buf); - return ret; -} - -/********************************************************************* - * _fstat (MSVCRT.@) - */ -int CDECL _fstat(int fd, struct _stat32* buf) -{ - DWORD dw; - DWORD type; - BY_HANDLE_FILE_INFORMATION hfi; - HANDLE hand = fdtoh(fd); - - TRACE(":fd (%d) stat (%p)\n",fd,buf); - if (hand == INVALID_HANDLE_VALUE) - return -1; - - if (!buf) - { - WARN(":failed-NULL buf\n"); - __set_errno(ERROR_INVALID_PARAMETER); - return -1; - } - - memset(&hfi, 0, sizeof(hfi)); - memset(buf, 0, sizeof(struct _stat32)); - type = GetFileType(hand); - if (type == FILE_TYPE_PIPE) - { - buf->st_dev = buf->st_rdev = fd; - buf->st_mode = S_IFIFO; - buf->st_nlink = 1; - } - else if (type == FILE_TYPE_CHAR) - { - buf->st_dev = buf->st_rdev = fd; - buf->st_mode = S_IFCHR; - buf->st_nlink = 1; - } - else /* FILE_TYPE_DISK etc. */ - { - if (!GetFileInformationByHandle(hand, &hfi)) - { - WARN(":failed-last error (%d)\n",GetLastError()); - __set_errno(ERROR_INVALID_PARAMETER); - return -1; - } - buf->st_mode = S_IFREG | S_IREAD; - if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - buf->st_mode |= S_IWRITE; - buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); - buf->st_atime = dw; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); - buf->st_mtime = buf->st_ctime = dw; - buf->st_nlink = hfi.nNumberOfLinks; - } - TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",hfi.dwFileAttributes, - buf->st_mode); - return 0; -} - /********************************************************************* * _futime (MSVCRT.@) */ @@ -1829,290 +1664,6 @@ int CDECL _setmode(int fd,int mode) return ret; } -/********************************************************************* - * _stat64 (MSVCRT.@) - */ -int CDECL _stat64(const char* path, struct __stat64 * buf) -{ - DWORD dw; - WIN32_FILE_ATTRIBUTE_DATA hfi; - unsigned short mode = ALL_S_IREAD; - int plen; - - TRACE(":file (%s) buf(%p)\n",path,buf); - - if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi)) - { - TRACE("failed (%d)\n",GetLastError()); - __set_errno(ERROR_FILE_NOT_FOUND); - return -1; - } - - memset(buf,0,sizeof(struct __stat64)); - - /* FIXME: rdev isn't drive num, despite what the docs say-what is it? - Bon 011120: This FIXME seems incorrect - Also a letter as first char isn't enough to be classified - as a drive letter - */ - if (isalpha(*path)&& (*(path+1)==':')) - buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */ - else - buf->st_dev = buf->st_rdev = _getdrive() - 1; - - plen = strlen(path); - - /* Dir, or regular file? */ - if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || - (path[plen-1] == '\\')) - mode |= (_S_IFDIR | ALL_S_IEXEC); - else - { - mode |= _S_IFREG; - /* executable? */ - if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ - { - unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) | - (tolower(path[plen-3]) << 16); - if (ext == EXE || ext == BAT || ext == CMD || ext == COM) - mode |= ALL_S_IEXEC; - } - } - - if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - mode |= ALL_S_IWRITE; - - buf->st_mode = mode; - buf->st_nlink = 1; - buf->st_size = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); - buf->st_atime = dw; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); - buf->st_mtime = buf->st_ctime = dw; - TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, - (long)(buf->st_size >> 32),(long)buf->st_size, - (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); - return 0; -} - -/********************************************************************* - * _stati64 (MSVCRT.@) - */ -int CDECL _stati64(const char* path, struct _stati64 * buf) -{ - int ret; - struct __stat64 buf64; - - ret = _stat64(path, &buf64); - if (!ret) - stat64_to_stati64(&buf64, buf); - return ret; -} - -/********************************************************************* - * _stat (MSVCRT.@) - */ -int CDECL _stat32(const char* path, struct _stat32 * buf) -{ - DWORD dw; - WIN32_FILE_ATTRIBUTE_DATA hfi; - unsigned short mode = ALL_S_IREAD; - int plen; - - TRACE(":file (%s) buf(%p)\n",path,buf); - - if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi)) - { - TRACE("failed (%d)\n",GetLastError()); - __set_errno(ERROR_FILE_NOT_FOUND); - return -1; - } - - memset(buf,0,sizeof(struct _stat32)); - - /* FIXME: rdev isn't drive num, despite what the docs say-what is it? - Bon 011120: This FIXME seems incorrect - Also a letter as first char isn't enough to be classified - as a drive letter - */ - if (isalpha(*path)&& (*(path+1)==':')) - buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */ - else - buf->st_dev = buf->st_rdev = _getdrive() - 1; - - plen = strlen(path); - - /* Dir, or regular file? */ - if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || - (path[plen-1] == '\\')) - mode |= (_S_IFDIR | ALL_S_IEXEC); - else - { - mode |= _S_IFREG; - /* executable? */ - if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ - { - unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) | - (tolower(path[plen-3]) << 16); - if (ext == EXE || ext == BAT || ext == CMD || ext == COM) - mode |= ALL_S_IEXEC; - } - } - - if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - mode |= ALL_S_IWRITE; - - buf->st_mode = mode; - buf->st_nlink = 1; - buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); - buf->st_atime = dw; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); - buf->st_mtime = buf->st_ctime = dw; - TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, - (long)(buf->st_size >> 16),(long)buf->st_size, - (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); - return 0; -} - -/********************************************************************* - * _wstat64 (MSVCRT.@) - */ -int CDECL _wstat64(const wchar_t* path, struct __stat64 * buf) -{ - DWORD dw; - WIN32_FILE_ATTRIBUTE_DATA hfi; - unsigned short mode = ALL_S_IREAD; - int plen; - - TRACE(":file (%s) buf(%p)\n",debugstr_w(path),buf); - - if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi)) - { - TRACE("failed (%d)\n",GetLastError()); - __set_errno(ERROR_FILE_NOT_FOUND); - return -1; - } - - memset(buf,0,sizeof(struct __stat64)); - - /* FIXME: rdev isn't drive num, despite what the docs says-what is it? */ - if (iswalpha(*path)) - buf->st_dev = buf->st_rdev = toupperW(*path - 'A'); /* drive num */ - else - buf->st_dev = buf->st_rdev = _getdrive() - 1; - - plen = strlenW(path); - - /* Dir, or regular file? */ - if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || - (path[plen-1] == '\\')) - mode |= (_S_IFDIR | ALL_S_IEXEC); - else - { - mode |= _S_IFREG; - /* executable? */ - if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ - { - ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) | - ((ULONGLONG)tolowerW(path[plen-3]) << 32); - if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM) - mode |= ALL_S_IEXEC; - } - } - - if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - mode |= ALL_S_IWRITE; - - buf->st_mode = mode; - buf->st_nlink = 1; - buf->st_size = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); - buf->st_atime = dw; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); - buf->st_mtime = buf->st_ctime = dw; - TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, - (long)(buf->st_size >> 32),(long)buf->st_size, - (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); - return 0; -} - -/********************************************************************* - * _wstati64 (MSVCRT.@) - */ -int CDECL _wstati64(const wchar_t* path, struct _stati64 * buf) -{ - int ret; - struct __stat64 buf64; - - ret = _wstat64(path, &buf64); - if (!ret) - stat64_to_stati64(&buf64, buf); - return ret; -} - -/********************************************************************* - * _wstat (MSVCRT.@) - */ -int CDECL _wstat32(const wchar_t* path, struct _stat32 * buf) -{ - DWORD dw; - WIN32_FILE_ATTRIBUTE_DATA hfi; - unsigned short mode = ALL_S_IREAD; - int plen; - - TRACE(":file (%s) buf(%p)\n",debugstr_w(path),buf); - - if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi)) - { - TRACE("failed (%d)\n",GetLastError()); - __set_errno(ERROR_FILE_NOT_FOUND); - return -1; - } - - memset(buf,0,sizeof(struct _stat32)); - - /* FIXME: rdev isn't drive num, despite what the docs says-what is it? */ - if (iswalpha(*path)) - buf->st_dev = buf->st_rdev = toupperW(*path - 'A'); /* drive num */ - else - buf->st_dev = buf->st_rdev = _getdrive() - 1; - - plen = strlenW(path); - - /* Dir, or regular file? */ - if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || - (path[plen-1] == '\\')) - mode |= (_S_IFDIR | ALL_S_IEXEC); - else - { - mode |= _S_IFREG; - /* executable? */ - if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ - { - ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) | - ((ULONGLONG)tolowerW(path[plen-3]) << 32); - if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM) - mode |= ALL_S_IEXEC; - } - } - - if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - mode |= ALL_S_IWRITE; - - buf->st_mode = mode; - buf->st_nlink = 1; - buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); - buf->st_atime = dw; - RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); - buf->st_mtime = buf->st_ctime = dw; - TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, - (long)(buf->st_size >> 16),(long)buf->st_size, - (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); - return 0; -} - /********************************************************************* * _tell (MSVCRT.@) */ diff --git a/reactos/lib/sdk/crt/stdio/find.c b/reactos/lib/sdk/crt/stdio/find.c index 8f602a4de97..46470f1b7cf 100644 --- a/reactos/lib/sdk/crt/stdio/find.c +++ b/reactos/lib/sdk/crt/stdio/find.c @@ -1,106 +1,5 @@ -#include -#include -#include -/* - * @implemented - */ -intptr_t -_tfindfirst(const _TCHAR* _name, struct _tfinddata_t* result) -{ - WIN32_FIND_DATA FindFileData; - long hFindFile; - - hFindFile = (intptr_t)FindFirstFile(_name, &FindFileData); - if (hFindFile == -1) { - _dosmaperr(GetLastError()); - return -1; - } - - result->attrib = FindFileData.dwFileAttributes; - result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); - result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); - result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); - result->size = FindFileData.nFileSizeLow; - _tcsncpy(result->name,FindFileData.cFileName,MAX_PATH); - - return hFindFile; -} - -/* - * @implemented - */ -intptr_t _tfindnext(intptr_t handle, struct _tfinddata_t* result) -{ - WIN32_FIND_DATA FindFileData; - - if (!FindNextFile((void*)handle, &FindFileData)) { - _dosmaperr(GetLastError()); - return -1; - } - - result->attrib = FindFileData.dwFileAttributes; - result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); - result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); - result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); - result->size = FindFileData.nFileSizeLow; - _tcsncpy(result->name,FindFileData.cFileName, MAX_PATH); - - return 0; -} - - -/* - * @implemented - */ -intptr_t _tfindfirsti64(const _TCHAR *_name, struct _tfinddatai64_t *result) -{ - WIN32_FIND_DATA FindFileData; - long hFindFile; - - hFindFile = (intptr_t)FindFirstFile(_name, &FindFileData); - if (hFindFile == -1) - { - _dosmaperr(GetLastError()); - return -1; - } - - result->attrib = FindFileData.dwFileAttributes; - result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); - result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); - result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); - result->size = - (((__int64)FindFileData.nFileSizeLow)<<32) + FindFileData.nFileSizeLow; - _tcsncpy(result->name,FindFileData.cFileName,MAX_PATH); - - return hFindFile; -} - -/* - * @implemented - */ -int _tfindnexti64(intptr_t handle, struct _tfinddatai64_t *result) -{ - WIN32_FIND_DATA FindFileData; - - if (!FindNextFile((HANDLE)handle, &FindFileData)) { - _dosmaperr(GetLastError()); - return -1; - } - - result->attrib = FindFileData.dwFileAttributes; - result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); - result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); - result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); - result->size = - (((__int64)FindFileData.nFileSizeLow)<<32) + FindFileData.nFileSizeLow; - _tcsncpy(result->name,FindFileData.cFileName,MAX_PATH); - - return 0; -} - - - -#ifndef _UNICODE +#define _USE_FIND64 0 +#include "find64.c" /* * @implemented @@ -114,5 +13,3 @@ int _findclose(intptr_t handle) return 0; } - -#endif diff --git a/reactos/lib/sdk/crt/stdio/find64.c b/reactos/lib/sdk/crt/stdio/find64.c new file mode 100644 index 00000000000..707f4a75423 --- /dev/null +++ b/reactos/lib/sdk/crt/stdio/find64.c @@ -0,0 +1,119 @@ +#include +#include +#include + +#ifndef _USE_FIND64 +#define _USE_FIND64 1 +#endif + +/* + * @implemented + */ +#if _USE_FIND64 +intptr_t _tfindfirst32i64(const _TCHAR* _name, struct _tfinddata32i64_t* result) +#else +intptr_t _tfindfirst32(const _TCHAR* _name, struct _tfinddata32_t* result) +#endif +{ + WIN32_FIND_DATA FindFileData; + HANDLE hFindFile; + + hFindFile = FindFirstFile(_name, &FindFileData); + if (hFindFile == INVALID_HANDLE_VALUE) { + _dosmaperr(GetLastError()); + return -1; + } + + result->attrib = FindFileData.dwFileAttributes; + result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); + result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); + result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); + result->size = FindFileData.nFileSizeLow; + _tcsncpy(result->name,FindFileData.cFileName,MAX_PATH); + + return (intptr_t)hFindFile; +} + +/* + * @implemented + */ +#if _USE_FIND64 +int _tfindnext32i64(intptr_t handle, struct _tfinddata32i64_t* result) +#else +int _tfindnext32(intptr_t handle, struct _tfinddata32_t* result) +#endif +{ + WIN32_FIND_DATA FindFileData; + + if (!FindNextFile((HANDLE)handle, &FindFileData)) { + _dosmaperr(GetLastError()); + return -1; + } + + result->attrib = FindFileData.dwFileAttributes; + result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); + result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); + result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); + result->size = FindFileData.nFileSizeLow; + _tcsncpy(result->name,FindFileData.cFileName, MAX_PATH); + + return 0; +} + + +/* + * @implemented + */ +#if _USE_FIND64 +intptr_t _tfindfirst64(const _TCHAR *_name, struct _tfinddata64_t *result) +#else +intptr_t _tfindfirst64i32(const _TCHAR *_name, struct _tfinddata64i32_t *result) +#endif +{ + WIN32_FIND_DATA FindFileData; + HANDLE hFindFile; + + hFindFile = FindFirstFile(_name, &FindFileData); + if (hFindFile == INVALID_HANDLE_VALUE) { + _dosmaperr(GetLastError()); + return -1; + } + + result->attrib = FindFileData.dwFileAttributes; + result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); + result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); + result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); + result->size = + (((__int64)FindFileData.nFileSizeLow)<<32) + FindFileData.nFileSizeLow; + _tcsncpy(result->name,FindFileData.cFileName,MAX_PATH); + + return (intptr_t)hFindFile; +} + +/* + * @implemented + */ +#if _USE_FIND64 +int _tfindnext64(intptr_t handle, struct _tfinddata64_t *result) +#else +int _tfindnext64i32(intptr_t handle, struct _tfinddata64i32_t *result) +#endif +{ + WIN32_FIND_DATA FindFileData; + + if (!FindNextFile((HANDLE)handle, &FindFileData)) { + _dosmaperr(GetLastError()); + return -1; + } + + result->attrib = FindFileData.dwFileAttributes; + result->time_create = FileTimeToUnixTime(&FindFileData.ftCreationTime,NULL); + result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); + result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); + result->size = + (((__int64)FindFileData.nFileSizeLow)<<32) + FindFileData.nFileSizeLow; + _tcsncpy(result->name,FindFileData.cFileName,MAX_PATH); + + return 0; +} + diff --git a/reactos/lib/sdk/crt/stdio/stat.c b/reactos/lib/sdk/crt/stdio/stat.c new file mode 100644 index 00000000000..07802499ff4 --- /dev/null +++ b/reactos/lib/sdk/crt/stdio/stat.c @@ -0,0 +1,15 @@ +#define _USE_STAT64 0 +#include "stat64.c" + + +//only version needed +//int CDECL _fstati64(int fd, struct _stati64* buf) +//{ +// int ret; +// struct __stat64 buf64; +// +// ret = _fstat64(fd, &buf64); +// if (!ret) +// stat64_to_stati64(&buf64, buf); +// return ret; +//} diff --git a/reactos/lib/sdk/crt/stdio/stat64.c b/reactos/lib/sdk/crt/stdio/stat64.c new file mode 100644 index 00000000000..37d806d1873 --- /dev/null +++ b/reactos/lib/sdk/crt/stdio/stat64.c @@ -0,0 +1,365 @@ +#include +#include "wine/unicode.h" + +#include +#include +#include + +#ifndef _UNICODE +#include +#endif + +#ifndef _USE_STAT64 +#define _USE_STAT64 1 +#endif + +/* for stat mode, permissions apply to all,owner and group */ +#define ALL_S_IREAD (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6)) +#define ALL_S_IWRITE (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6)) +#define ALL_S_IEXEC (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6)) + +#define EXE ('e' << 16 | 'x' << 8 | 'e') +#define BAT ('b' << 16 | 'a' << 8 | 't') +#define CMD ('c' << 16 | 'm' << 8 | 'd') +#define COM ('c' << 16 | 'o' << 8 | 'm') + +#define TOUL(x) (ULONGLONG)(x) +#define WCEXE (TOUL('e') << 32 | TOUL('x') << 16 | TOUL('e')) +#define WCBAT (TOUL('b') << 32 | TOUL('a') << 16 | TOUL('t')) +#define WCCMD (TOUL('c') << 32 | TOUL('m') << 16 | TOUL('d')) +#define WCCOM (TOUL('c') << 32 | TOUL('o') << 16 | TOUL('m')) + +#if _USE_STAT64 +void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf) +{ + buf->st_dev = buf64->st_dev; + buf->st_ino = buf64->st_ino; + buf->st_mode = buf64->st_mode; + buf->st_nlink = buf64->st_nlink; + buf->st_uid = buf64->st_uid; + buf->st_gid = buf64->st_gid; + buf->st_rdev = buf64->st_rdev; + buf->st_size = buf64->st_size; + buf->st_atime = buf64->st_atime; + buf->st_mtime = buf64->st_mtime; + buf->st_ctime = buf64->st_ctime; +} + +//int _tstati64(const TCHAR* path, struct _stati64 * buf) +//{ +// int ret; +// struct __stat64 buf64; +// +// ret = _tstat64(path, &buf64); +// if (!ret) +// stat64_to_stati64(&buf64, buf); +// return ret; +//} + +#endif + +HANDLE fdtoh(int fd); //file.c + +#if _USE_STAT64 +int CDECL _tstat64(const _TCHAR *path, struct _stat64 *buf) +#else +int CDECL _tstat64i32(const _TCHAR *path, struct _stat64i32 *buf) +#endif +{ + DWORD dw; + WIN32_FILE_ATTRIBUTE_DATA hfi; + unsigned short mode = ALL_S_IREAD; + int plen; + + TRACE(":file (%s) buf(%p)\n",path,buf); + + if (!GetFileAttributesEx(path, GetFileExInfoStandard, &hfi)) + { + TRACE("failed (%d)\n",GetLastError()); + __set_errno(ERROR_FILE_NOT_FOUND); + return -1; + } + + memset(buf,0,sizeof(struct __stat64)); + + /* FIXME: rdev isn't drive num, despite what the docs say-what is it? + Bon 011120: This FIXME seems incorrect + Also a letter as first char isn't enough to be classified + as a drive letter + */ +#ifndef _UNICODE + if (isalpha(*path)&& (*(path+1)==':')) + buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */ +#else + if (iswalpha(*path)) + buf->st_dev = buf->st_rdev = toupperW(*path - 'A'); /* drive num */ +#endif + else + buf->st_dev = buf->st_rdev = _getdrive() - 1; + +#ifndef _UNICODE + plen = strlen(path); +#else + plen = strlenW(path); +#endif + + /* Dir, or regular file? */ + if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + (path[plen-1] == '\\')) + mode |= (_S_IFDIR | ALL_S_IEXEC); + else + { + mode |= _S_IFREG; + /* executable? */ + if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ + { +#ifndef _UNICODE + unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) | + (tolower(path[plen-3]) << 16); + if (ext == EXE || ext == BAT || ext == CMD || ext == COM) + mode |= ALL_S_IEXEC; +#else + ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) | + ((ULONGLONG)tolowerW(path[plen-3]) << 32); + if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM) + mode |= ALL_S_IEXEC; +#endif + } + } + + if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + mode |= ALL_S_IWRITE; + + buf->st_mode = mode; + buf->st_nlink = 1; +#if _USE_STAT64 + buf->st_size = buf->st_size = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow; +#else + buf->st_size = hfi.nFileSizeLow; +#endif + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_atime = dw; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + buf->st_mtime = buf->st_ctime = dw; + TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, + (long)(buf->st_size >> 16),(long)buf->st_size, + (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); + return 0; +} + +/********************************************************************* + * _stat (MSVCRT.@) + */ +#if _USE_STAT64 +int CDECL _tstat32i64(const _TCHAR *path,struct _stat32i64 *buf) +#else +int CDECL _tstat32(const _TCHAR *path,struct _stat32 *buf) +#endif +{ + DWORD dw; + WIN32_FILE_ATTRIBUTE_DATA hfi; + unsigned short mode = ALL_S_IREAD; + int plen; + + TRACE(":file (%s) buf(%p)\n",path,buf); + + if (!GetFileAttributesEx(path, GetFileExInfoStandard, &hfi)) + { + TRACE("failed (%d)\n",GetLastError()); + __set_errno(ERROR_FILE_NOT_FOUND); + return -1; + } + + memset(buf,0,sizeof(*buf)); + + /* FIXME: rdev isn't drive num, despite what the docs say-what is it? + Bon 011120: This FIXME seems incorrect + Also a letter as first char isn't enough to be classified + as a drive letter + */ +#ifndef _UNICODE + if (isalpha(*path)&& (*(path+1)==':')) + buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */ +#else + if (iswalpha(*path)) + buf->st_dev = buf->st_rdev = toupperW(*path - 'A'); /* drive num */ +#endif + else + buf->st_dev = buf->st_rdev = _getdrive() - 1; + +#ifndef _UNICODE + plen = strlen(path); +#else + plen = strlenW(path); +#endif + + /* Dir, or regular file? */ + if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + (path[plen-1] == '\\')) + mode |= (_S_IFDIR | ALL_S_IEXEC); + else + { + mode |= _S_IFREG; + /* executable? */ + if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */ + { +#ifndef _UNICODE + unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) | + (tolower(path[plen-3]) << 16); + if (ext == EXE || ext == BAT || ext == CMD || ext == COM) + mode |= ALL_S_IEXEC; +#else + ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) | + ((ULONGLONG)tolowerW(path[plen-3]) << 32); + if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM) + mode |= ALL_S_IEXEC; +#endif + } + } + + if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + mode |= ALL_S_IWRITE; + + buf->st_mode = mode; + buf->st_nlink = 1; +#if _USE_STAT64 + buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; +#else + buf->st_size = hfi.nFileSizeLow; +#endif + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_atime = dw; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + buf->st_mtime = buf->st_ctime = dw; + TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, + (long)(buf->st_size >> 16),(long)buf->st_size, + (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); + return 0; +} + +#ifndef _UNICODE //No wide versions needed + +#if _USE_STAT64 +int CDECL _fstat64(int fd, struct _stat64* buf) +#else +int CDECL _fstat64i32(int fd, struct _stat64i32* buf) +#endif +{ + DWORD dw; + DWORD type; + BY_HANDLE_FILE_INFORMATION hfi; + HANDLE hand = fdtoh(fd); + + TRACE(":fd (%d) stat (%p)\n",fd,buf); + if (hand == INVALID_HANDLE_VALUE) + return -1; + + if (!buf) + { + WARN(":failed-NULL buf\n"); + __set_errno(ERROR_INVALID_PARAMETER); + return -1; + } + + memset(&hfi, 0, sizeof(hfi)); + memset(buf, 0, sizeof(struct __stat64)); + type = GetFileType(hand); + if (type == FILE_TYPE_PIPE) + { + buf->st_dev = buf->st_rdev = fd; + buf->st_mode = S_IFIFO; + buf->st_nlink = 1; + } + else if (type == FILE_TYPE_CHAR) + { + buf->st_dev = buf->st_rdev = fd; + buf->st_mode = S_IFCHR; + buf->st_nlink = 1; + } + else /* FILE_TYPE_DISK etc. */ + { + if (!GetFileInformationByHandle(hand, &hfi)) + { + WARN(":failed-last error (%d)\n",GetLastError()); + __set_errno(ERROR_INVALID_PARAMETER); + return -1; + } + buf->st_mode = S_IFREG | S_IREAD; + if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + buf->st_mode |= S_IWRITE; + buf->st_size = ((__int64)hfi.nFileSizeHigh << 32) + hfi.nFileSizeLow; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_atime = dw; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + buf->st_mtime = buf->st_ctime = dw; + buf->st_nlink = hfi.nNumberOfLinks; + } + TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",hfi.dwFileAttributes, + buf->st_mode); + return 0; +} + +/********************************************************************* + * _fstat (MSVCRT.@) + */ +#if _USE_STAT64 +int CDECL _fstat32(int fd, struct _stat32* buf) +#else +int CDECL _fstat32i64(int fd, struct _stat32i64* buf) +#endif +{ + DWORD dw; + DWORD type; + BY_HANDLE_FILE_INFORMATION hfi; + HANDLE hand = fdtoh(fd); + + TRACE(":fd (%d) stat (%p)\n",fd,buf); + if (hand == INVALID_HANDLE_VALUE) + return -1; + + if (!buf) + { + WARN(":failed-NULL buf\n"); + __set_errno(ERROR_INVALID_PARAMETER); + return -1; + } + + memset(&hfi, 0, sizeof(hfi)); + memset(buf, 0, sizeof(struct _stat32)); + type = GetFileType(hand); + if (type == FILE_TYPE_PIPE) + { + buf->st_dev = buf->st_rdev = fd; + buf->st_mode = S_IFIFO; + buf->st_nlink = 1; + } + else if (type == FILE_TYPE_CHAR) + { + buf->st_dev = buf->st_rdev = fd; + buf->st_mode = S_IFCHR; + buf->st_nlink = 1; + } + else /* FILE_TYPE_DISK etc. */ + { + if (!GetFileInformationByHandle(hand, &hfi)) + { + WARN(":failed-last error (%d)\n",GetLastError()); + __set_errno(ERROR_INVALID_PARAMETER); + return -1; + } + buf->st_mode = S_IFREG | S_IREAD; + if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + buf->st_mode |= S_IWRITE; + buf->st_size = ((__int32)hfi.nFileSizeHigh << 16) + hfi.nFileSizeLow; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastAccessTime, &dw); + buf->st_atime = dw; + RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); + buf->st_mtime = buf->st_ctime = dw; + buf->st_nlink = hfi.nNumberOfLinks; + } + TRACE(":dwFileAttributes = 0x%x, mode set to 0x%x\n",hfi.dwFileAttributes, + buf->st_mode); + return 0; +} + +#endif diff --git a/reactos/lib/sdk/crt/stdio/wfind.c b/reactos/lib/sdk/crt/stdio/wfind.c index 76c568f6c0e..7c40e140bef 100644 --- a/reactos/lib/sdk/crt/stdio/wfind.c +++ b/reactos/lib/sdk/crt/stdio/wfind.c @@ -1,5 +1,8 @@ #define UNICODE #define _UNICODE - -#include "find.c" +#define _USE_FIND64 0 +#include +#include "find64.c" +#undef _USE_FIND64 +#include "find64.c" diff --git a/reactos/lib/sdk/crt/stdio/wstat.c b/reactos/lib/sdk/crt/stdio/wstat.c new file mode 100644 index 00000000000..ca662ef70e3 --- /dev/null +++ b/reactos/lib/sdk/crt/stdio/wstat.c @@ -0,0 +1,7 @@ +#define _UNICODE +#define UNICODE +#define _USE_STAT64 0 +#include +#include "stat64.c" +#undef _USE_STAT64 +#include "stat64.c" From ba472258133129613b40e3870658894b143e940a Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 13 Sep 2008 07:13:27 +0000 Subject: [PATCH 261/388] Remove hacks. Add hacks. Zero sum game? svn path=/branches/ros-amd64-bringup/; revision=36177 --- reactos/include/crt/_mingw.h | 2 -- reactos/include/crt/stdlib.h | 4 ++-- reactos/include/crt/wchar.h | 9 ++++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/reactos/include/crt/_mingw.h b/reactos/include/crt/_mingw.h index 8ea779a7495..7ee087789f4 100644 --- a/reactos/include/crt/_mingw.h +++ b/reactos/include/crt/_mingw.h @@ -272,14 +272,12 @@ extern "C" { #define _SIZE_T_DEFINED #undef size_t #ifdef _WIN64 -#define _INTEGRAL_MAX_BITS 64 #if defined(__GNUC__) && defined(__STRICT_ANSI__) typedef unsigned int size_t __attribute__ ((mode (DI))); #else typedef unsigned __int64 size_t; #endif #else - #define _INTEGRAL_MAX_BITS 32 typedef unsigned int size_t; #endif #endif diff --git a/reactos/include/crt/stdlib.h b/reactos/include/crt/stdlib.h index 9b793def43c..274b8411401 100644 --- a/reactos/include/crt/stdlib.h +++ b/reactos/include/crt/stdlib.h @@ -562,7 +562,7 @@ extern "C" { char *__cdecl ulltoa (unsigned long long , char *, int); wchar_t *__cdecl lltow (long long, wchar_t *, int); wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int); - +#if _INTEGRAL_MAX_BITS >= 64 /* __CRT_INLINE using non-ansi functions */ __CRT_INLINE long long __cdecl atoll (const char * _c) { return _atoi64 (_c); } __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); } @@ -571,7 +571,7 @@ extern "C" { __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); } __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); } #endif /* (__STRICT_ANSI__) */ - +#endif #endif /* !__NO_ISOCEXT */ #ifdef __cplusplus diff --git a/reactos/include/crt/wchar.h b/reactos/include/crt/wchar.h index 5f85b6e00e1..4852494fc38 100644 --- a/reactos/include/crt/wchar.h +++ b/reactos/include/crt/wchar.h @@ -89,6 +89,8 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ wchar_t name[260]; }; +/* #if _INTEGRAL_MAX_BITS >= 64 */ + struct _wfinddata32i64_t { unsigned attrib; __time32_t time_create; @@ -115,8 +117,9 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ __int64 size; wchar_t name[260]; }; +/* #endif */ -#if !defined(_WIN64) //defined(_USE_32BIT_TIME_T) +#ifdef _USE_32BIT_TIME_T #define _wfinddata_t _wfinddata32_t #define _wfinddatai64_t _wfinddata32i64_t @@ -454,7 +457,7 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ }; #endif -#if _INTEGRAL_MAX_BITS >= 64 +/* #if _INTEGRAL_MAX_BITS >= 64 */ struct _stat32i64 { _dev_t st_dev; @@ -497,7 +500,7 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ __time64_t st_mtime; __time64_t st_ctime; }; -#endif +/* #endif */ #define __stat64 _stat64 From 0e905fcd944c3b8a11fac49f9d3110b98702d279 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 14 Sep 2008 06:42:58 +0000 Subject: [PATCH 262/388] Fix command line passing(again), after tchar.h update. svn path=/branches/ros-amd64-bringup/; revision=36221 --- reactos/lib/3rdparty/mingw/mingw.rbuild | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reactos/lib/3rdparty/mingw/mingw.rbuild b/reactos/lib/3rdparty/mingw/mingw.rbuild index c0d8bbfb298..5ff3c242f53 100644 --- a/reactos/lib/3rdparty/mingw/mingw.rbuild +++ b/reactos/lib/3rdparty/mingw/mingw.rbuild @@ -25,10 +25,9 @@ crt0_c.c crtexe.c - + include - crt0_w.c crtexe.c From a4019b877f36143b9c3399847a595574dda17cff Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 14 Sep 2008 08:42:26 +0000 Subject: [PATCH 263/388] Make rsym smart enough to handle 64bit PEs. winebuild: remove unnecessary condition. svn path=/branches/ros-amd64-bringup/; revision=36223 --- reactos/tools/rsym.h | 156 +++++++++++++++++++++++---------- reactos/tools/rsym.mak | 6 +- reactos/tools/winebuild/main.c | 2 +- 3 files changed, 116 insertions(+), 48 deletions(-) diff --git a/reactos/tools/rsym.h b/reactos/tools/rsym.h index ae5dc39df44..83b0e651752 100644 --- a/reactos/tools/rsym.h +++ b/reactos/tools/rsym.h @@ -5,7 +5,6 @@ #define IMAGE_DOS_MAGIC 0x5a4d #define IMAGE_PE_MAGIC 0x00004550 - #define IMAGE_SIZEOF_SHORT_NAME 8 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 @@ -14,6 +13,7 @@ typedef unsigned char BYTE; typedef unsigned char UCHAR; typedef unsigned short WORD; typedef unsigned short USHORT; +typedef unsigned long long ULONGLONG; #if defined(__x86_64__) && defined(unix) typedef signed int LONG; typedef unsigned int ULONG; @@ -33,7 +33,7 @@ typedef unsigned long ULONG_PTR; #endif #endif -#pragma pack(2) +#pragma pack(push,2) typedef struct _IMAGE_DOS_HEADER { WORD e_magic; WORD e_cblp; @@ -55,63 +55,126 @@ typedef struct _IMAGE_DOS_HEADER { WORD e_res2[10]; LONG e_lfanew; } IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; -#pragma pack(4) +#pragma pack(pop) #define IMAGE_FILE_LINE_NUMS_STRIPPED 4 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8 #define IMAGE_FILE_DEBUG_STRIPPED 512 -#pragma pack(4) +#pragma pack(push,4) typedef struct _IMAGE_FILE_HEADER { - WORD Machine; - WORD NumberOfSections; - DWORD TimeDateStamp; - DWORD PointerToSymbolTable; - DWORD NumberOfSymbols; - WORD SizeOfOptionalHeader; - WORD Characteristics; + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; +#pragma pack(pop) typedef struct _IMAGE_DATA_DIRECTORY { DWORD VirtualAddress; DWORD Size; } IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY; -#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 +typedef struct _IMAGE_OPTIONAL_HEADER32 { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + 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_HEADER32,*PIMAGE_OPTIONAL_HEADER32; -typedef struct _IMAGE_OPTIONAL_HEADER { - WORD Magic; - BYTE MajorLinkerVersion; - BYTE MinorLinkerVersion; - DWORD SizeOfCode; - DWORD SizeOfInitializedData; - DWORD SizeOfUninitializedData; - DWORD AddressOfEntryPoint; - DWORD BaseOfCode; - DWORD BaseOfData; - DWORD ImageBase; - DWORD SectionAlignment; - DWORD FileAlignment; - WORD MajorOperatingSystemVersion; - WORD MinorOperatingSystemVersion; - WORD MajorImageVersion; - WORD MinorImageVersion; - WORD MajorSubsystemVersion; - WORD MinorSubsystemVersion; - DWORD Reserved1; - 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; +typedef struct _IMAGE_OPTIONAL_HEADER64 { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + ULONGLONG 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; + ULONGLONG SizeOfStackReserve; + ULONGLONG SizeOfStackCommit; + ULONGLONG SizeOfHeapReserve; + ULONGLONG SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64; + +#pragma pack(push,4) +typedef struct _IMAGE_NT_HEADERS32 { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER32 OptionalHeader; +} IMAGE_NT_HEADERS32,*PIMAGE_NT_HEADERS32; +#pragma pack(pop) + +#pragma pack(push,4) +typedef struct _IMAGE_NT_HEADERS64 { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER64 OptionalHeader; +} IMAGE_NT_HEADERS64,*PIMAGE_NT_HEADERS64; +#pragma pack(pop) + +#ifdef _TARGET_PE64 +#error HERE +typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; +typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER; +typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS; +typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS; +#else +typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER; +typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER; +typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS; +typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS; +#endif + +#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 #define IMAGE_SCN_LNK_REMOVE 0x00000800 @@ -134,11 +197,12 @@ typedef struct _IMAGE_SECTION_HEADER { DWORD Characteristics; } IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER; +#pragma pack(push,4) typedef struct _IMAGE_BASE_RELOCATION { DWORD VirtualAddress; DWORD SizeOfBlock; } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; - +#pragma pack(pop) typedef struct { USHORT f_magic; /* magic number */ diff --git a/reactos/tools/rsym.mak b/reactos/tools/rsym.mak index c87c61cd8a1..527e548f275 100644 --- a/reactos/tools/rsym.mak +++ b/reactos/tools/rsym.mak @@ -16,7 +16,11 @@ RSYM_SOURCES = \ RSYM_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(RSYM_SOURCES:.c=.o)) -RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) +ifeq ($(ARCH),amd64) +RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) -D_TARGET_PE64 +else +RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) +endif RSYM_HOST_LFLAGS = $(TOOLS_LFLAGS) diff --git a/reactos/tools/winebuild/main.c b/reactos/tools/winebuild/main.c index 6614680f5a8..b0a57efaf7e 100644 --- a/reactos/tools/winebuild/main.c +++ b/reactos/tools/winebuild/main.c @@ -48,7 +48,7 @@ int verbose = 0; int save_temps = 0; int link_ext_symbols = 0; -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) enum target_cpu target_cpu = CPU_x86; #elif defined(__x86_64__) enum target_cpu target_cpu = CPU_x86_64; From f58e2f78cea2bda9882e779d81c84840f8b336a9 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 14 Sep 2008 08:45:07 +0000 Subject: [PATCH 264/388] always double check late night commits. svn path=/branches/ros-amd64-bringup/; revision=36224 --- reactos/tools/rsym.h | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/tools/rsym.h b/reactos/tools/rsym.h index 83b0e651752..ccc6934489c 100644 --- a/reactos/tools/rsym.h +++ b/reactos/tools/rsym.h @@ -162,7 +162,6 @@ typedef struct _IMAGE_NT_HEADERS64 { #pragma pack(pop) #ifdef _TARGET_PE64 -#error HERE typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER; typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS; From 28f2a701075bcf3c3cff13bfb748449a00b9fa2f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 15 Sep 2008 16:15:53 +0000 Subject: [PATCH 265/388] Tidy up code a bit svn path=/branches/ros-amd64-bringup/; revision=36260 --- reactos/lib/sdk/crt/stdio/file.c | 15 +++++++++++++++ reactos/lib/sdk/crt/stdio/stat64.c | 18 +++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index 2569daf8e03..210fc4f7072 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -116,6 +116,21 @@ static CRITICAL_SECTION FILE_cs; #define LOCK_FILES() do { EnterCriticalSection(&FILE_cs); } while (0) #define UNLOCK_FILES() do { LeaveCriticalSection(&FILE_cs); } while (0) +void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf) +{ + buf->st_dev = buf64->st_dev; + buf->st_ino = buf64->st_ino; + buf->st_mode = buf64->st_mode; + buf->st_nlink = buf64->st_nlink; + buf->st_uid = buf64->st_uid; + buf->st_gid = buf64->st_gid; + buf->st_rdev = buf64->st_rdev; + buf->st_size = buf64->st_size; + buf->st_atime = buf64->st_atime; + buf->st_mtime = buf64->st_mtime; + buf->st_ctime = buf64->st_ctime; +} + static inline BOOL is_valid_fd(int fd) { return fd >= 0 && fd < fdend && (fdesc[fd].wxflag & WX_OPEN); diff --git a/reactos/lib/sdk/crt/stdio/stat64.c b/reactos/lib/sdk/crt/stdio/stat64.c index 37d806d1873..ef2441e1ca5 100644 --- a/reactos/lib/sdk/crt/stdio/stat64.c +++ b/reactos/lib/sdk/crt/stdio/stat64.c @@ -29,21 +29,10 @@ #define WCCMD (TOUL('c') << 32 | TOUL('m') << 16 | TOUL('d')) #define WCCOM (TOUL('c') << 32 | TOUL('o') << 16 | TOUL('m')) +HANDLE fdtoh(int fd); +void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf); + #if _USE_STAT64 -void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf) -{ - buf->st_dev = buf64->st_dev; - buf->st_ino = buf64->st_ino; - buf->st_mode = buf64->st_mode; - buf->st_nlink = buf64->st_nlink; - buf->st_uid = buf64->st_uid; - buf->st_gid = buf64->st_gid; - buf->st_rdev = buf64->st_rdev; - buf->st_size = buf64->st_size; - buf->st_atime = buf64->st_atime; - buf->st_mtime = buf64->st_mtime; - buf->st_ctime = buf64->st_ctime; -} //int _tstati64(const TCHAR* path, struct _stati64 * buf) //{ @@ -58,7 +47,6 @@ void stat64_to_stati64(const struct __stat64 *buf64, struct _stati64 *buf) #endif -HANDLE fdtoh(int fd); //file.c #if _USE_STAT64 int CDECL _tstat64(const _TCHAR *path, struct _stat64 *buf) From caf9aa6e7f0e9730f713c62b00326d54458cc692 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 15 Sep 2008 16:17:42 +0000 Subject: [PATCH 266/388] Re-add code mistakenly removed in last sync to trunk. Remove explorer from build.(for now) svn path=/branches/ros-amd64-bringup/; revision=36261 --- reactos/base/applications/network/tracert/tracert.c | 8 ++++++++ reactos/base/applications/regedit/regedit.rbuild | 3 +-- reactos/base/shell/shell.rbuild | 3 --- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/reactos/base/applications/network/tracert/tracert.c b/reactos/base/applications/network/tracert/tracert.c index f852bfd1fef..0377d80b17d 100644 --- a/reactos/base/applications/network/tracert/tracert.c +++ b/reactos/base/applications/network/tracert/tracert.c @@ -396,7 +396,11 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id, process id %d"), TTLExceedHdr->OrigIcmpHeader.id, GetCurrentProcessId()); return -1; } +#ifndef _WIN64 _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#else + _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#endif return 0; case ECHO_REPLY : @@ -407,7 +411,11 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id %d, process id %d"), IcmpHdr->icmpheader.id, GetCurrentProcessId()); return -1; } +#ifndef _WIN64 _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#else + _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); +#endif return 1; case DEST_UNREACHABLE : diff --git a/reactos/base/applications/regedit/regedit.rbuild b/reactos/base/applications/regedit/regedit.rbuild index fdd1bd78caa..43dbf2fc8ee 100644 --- a/reactos/base/applications/regedit/regedit.rbuild +++ b/reactos/base/applications/regedit/regedit.rbuild @@ -1,7 +1,7 @@ - + . @@ -12,7 +12,6 @@ user32 gdi32 advapi32 - comdlg32 ole32 shell32 comctl32 diff --git a/reactos/base/shell/shell.rbuild b/reactos/base/shell/shell.rbuild index efdd8f323e7..8b404606eb6 100644 --- a/reactos/base/shell/shell.rbuild +++ b/reactos/base/shell/shell.rbuild @@ -4,9 +4,6 @@ - - - From dbf0f4225c98003d848b89fbff335c145578fa97 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 17 Sep 2008 02:52:33 +0000 Subject: [PATCH 267/388] Fix up win64 warnings about NtQuerySystemInformation. svn path=/branches/ros-amd64-bringup/; revision=36274 --- reactos/base/setup/usetup/cabinet.c | 2 +- reactos/base/setup/usetup/interface/usetup.c | 2 +- reactos/base/setup/usetup/partlist.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/base/setup/usetup/cabinet.c b/reactos/base/setup/usetup/cabinet.c index db6dfa63327..c44521a541a 100644 --- a/reactos/base/setup/usetup/cabinet.c +++ b/reactos/base/setup/usetup/cabinet.c @@ -148,7 +148,7 @@ MSZipCodecUncompress(PVOID OutputBuffer, return CS_BADSTREAM; } - ZStream.next_in = (PUCHAR)((ULONG)InputBuffer + 2); + ZStream.next_in = ((PUCHAR)InputBuffer )+ 2; ZStream.avail_in = *InputLength - 2; ZStream.next_out = (PUCHAR)OutputBuffer; ZStream.avail_out = abs(*OutputLength); diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 2920793bf18..79fff3e524c 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -699,7 +699,7 @@ SetupStartPage(PINPUT_RECORD Ir) INFCONTEXT Context; PWCHAR Value; UINT ErrorLine; - SIZE_T ReturnSize; + ULONG ReturnSize; CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index c78597e9cd1..e4807836c19 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -906,7 +906,7 @@ CreatePartitionList (SHORT Left, OBJECT_ATTRIBUTES ObjectAttributes; SYSTEM_DEVICE_INFORMATION Sdi; IO_STATUS_BLOCK Iosb; - SIZE_T ReturnSize; + ULONG ReturnSize; NTSTATUS Status; ULONG DiskNumber; WCHAR Buffer[MAX_PATH]; From 46fe903e03119f67802b5484ceb57f2f064b5818 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 17 Sep 2008 05:15:51 +0000 Subject: [PATCH 268/388] Use build-in mechanisms(rbuild) to define UNICODE and friends. Fix a small warning about SetWindowText. Use correct definition of WinMain(not a CALLBACK by any means, somehow this caused real WIN64 to think this wasn't a valid application) svn path=/branches/ros-amd64-bringup/; revision=36279 --- reactos/base/applications/wordpad/wordpad.c | 9 ++++++--- reactos/base/applications/wordpad/wordpad.rbuild | 4 +--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/reactos/base/applications/wordpad/wordpad.c b/reactos/base/applications/wordpad/wordpad.c index 0fb22b40847..9bdd33f1438 100644 --- a/reactos/base/applications/wordpad/wordpad.c +++ b/reactos/base/applications/wordpad/wordpad.c @@ -1948,7 +1948,7 @@ static LRESULT OnNotify( HWND hWnd, WPARAM wParam, LPARAM lParam) sprintf( buf,"selection = %d..%d, line count=%ld", pSC->chrg.cpMin, pSC->chrg.cpMax, SendMessage(hwndEditor, EM_GETLINECOUNT, 0, 0)); - SetWindowText(GetDlgItem(hWnd, IDC_STATUSBAR), buf); + SetWindowTextA(GetDlgItem(hWnd, IDC_STATUSBAR), buf); SendMessage(hWnd, WM_USER, 0, 0); return 1; } @@ -2528,8 +2528,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara return 0; } - -int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdParagraph, int nCmdShow) +#if defined(__GNUC__) && !defined(__REACTOS__) +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdParagraph, int nCmdShow) +#else +int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPTSTR szCmdParagraph, int nCmdShow) +#endif { INITCOMMONCONTROLSEX classes = {8, ICC_BAR_CLASSES|ICC_COOL_CLASSES|ICC_USEREX_CLASSES}; HACCEL hAccel; diff --git a/reactos/base/applications/wordpad/wordpad.rbuild b/reactos/base/applications/wordpad/wordpad.rbuild index 586227095c7..0663c07759b 100644 --- a/reactos/base/applications/wordpad/wordpad.rbuild +++ b/reactos/base/applications/wordpad/wordpad.rbuild @@ -1,9 +1,7 @@ - + . - - 0x0600 0x0501 comdlg32 From ff316cad4db78cb054c82033f0d63eac6c4aca33 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 17 Sep 2008 06:37:38 +0000 Subject: [PATCH 269/388] remove unicode="yes" on suggestion from Christoph_vW svn path=/branches/ros-amd64-bringup/; revision=36280 --- reactos/base/applications/wordpad/wordpad.rbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/applications/wordpad/wordpad.rbuild b/reactos/base/applications/wordpad/wordpad.rbuild index 0663c07759b..0097fba956a 100644 --- a/reactos/base/applications/wordpad/wordpad.rbuild +++ b/reactos/base/applications/wordpad/wordpad.rbuild @@ -1,6 +1,6 @@ - + . 0x0600 0x0501 From afd9bec15ba38b3b0aadb01ac0aabb1428b0e1ad Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 19 Sep 2008 22:36:18 +0000 Subject: [PATCH 270/388] fix a warning that we get since the crt header update svn path=/branches/ros-amd64-bringup/; revision=36331 --- reactos/ntoskrnl/kdbg/i386/i386-dis.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/ntoskrnl/kdbg/i386/i386-dis.c b/reactos/ntoskrnl/kdbg/i386/i386-dis.c index fb004f1b1c4..c70a9747594 100644 --- a/reactos/ntoskrnl/kdbg/i386/i386-dis.c +++ b/reactos/ntoskrnl/kdbg/i386/i386-dis.c @@ -38,6 +38,7 @@ typedef signed int bfd_signed_vma; extern int sprintf(char *str, const char *format, ...); #define sprintf_vma(BUF, VMA) sprintf(BUF, "0x%X", VMA) #define _setjmp setjmp +#define _INC_SETJMPEX struct disassemble_info; int From 7f388bab0292159429f0d0b49f97d45320fc32cc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 19 Sep 2008 22:42:40 +0000 Subject: [PATCH 271/388] fix some 64 bit warnings svn path=/branches/ros-amd64-bringup/; revision=36332 --- reactos/ntoskrnl/cc/copy.c | 2 +- reactos/ntoskrnl/ex/harderr.c | 2 +- reactos/ntoskrnl/include/internal/ke.h | 4 ++-- reactos/ntoskrnl/ke/queue.c | 6 +++--- reactos/ntoskrnl/ke/thrdobj.c | 4 +++- reactos/ntoskrnl/ke/thrdschd.c | 2 +- reactos/ntoskrnl/ke/wait.c | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index 37bdd8a1b9b..39dadb578b1 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -612,7 +612,7 @@ CcZeroData (IN PFILE_OBJECT FileObject, { CurrentLength = Length; } - MmInitializeMdl(Mdl, (PVOID)WriteOffset.u.LowPart, CurrentLength); + MmInitializeMdl(Mdl, (PVOID)(ULONG_PTR)WriteOffset.QuadPart, CurrentLength); Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ); for (i = 0; i < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); i++) { diff --git a/reactos/ntoskrnl/ex/harderr.c b/reactos/ntoskrnl/ex/harderr.c index 74a5fdeaffc..0ca2427fe34 100644 --- a/reactos/ntoskrnl/ex/harderr.c +++ b/reactos/ntoskrnl/ex/harderr.c @@ -370,7 +370,7 @@ ExRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG ValidResponseOptions, OUT PULONG Response) { - ULONG Size; + SIZE_T Size; UNICODE_STRING CapturedParams[MAXIMUM_HARDERROR_PARAMETERS]; ULONG i; PULONG_PTR UserData = NULL, ParameterBase; diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index dfe1f0b46d5..0818a8c06d3 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -196,7 +196,7 @@ extern ULONG KiDPCTimeout; /* INTERNAL KERNEL FUNCTIONS ************************************************/ /* Finds a new thread to run */ -NTSTATUS +LONG_PTR FASTCALL KiSwapThread( IN PKTHREAD Thread, @@ -527,7 +527,7 @@ VOID FASTCALL KiUnwaitThread( IN PKTHREAD Thread, - IN NTSTATUS WaitStatus, + IN LONG_PTR WaitStatus, IN KPRIORITY Increment ); diff --git a/reactos/ntoskrnl/ke/queue.c b/reactos/ntoskrnl/ke/queue.c index a548a7df098..917b7ee0d61 100644 --- a/reactos/ntoskrnl/ke/queue.c +++ b/reactos/ntoskrnl/ke/queue.c @@ -57,7 +57,7 @@ KiActivateWaiterQueue(IN PKQUEUE Queue) KWAIT_BLOCK, WaitListEntry); Thread = WaitBlock->Thread; - KiUnwaitThread(Thread, (NTSTATUS)QueueEntry, IO_NO_INCREMENT); + KiUnwaitThread(Thread, (LONG_PTR)QueueEntry, IO_NO_INCREMENT); } } } @@ -102,7 +102,7 @@ KiInsertQueue(IN PKQUEUE Queue, Thread = WaitBlock->Thread; /* Remove the queue from the thread's wait list */ - Thread->WaitStatus = (NTSTATUS)Entry; + Thread->WaitStatus = (LONG_PTR)Entry; if (Thread->WaitListEntry.Flink) RemoveEntryList(&Thread->WaitListEntry); /* Increase the active threads and remove any wait reason */ @@ -239,7 +239,7 @@ KeRemoveQueue(IN PKQUEUE Queue, IN PLARGE_INTEGER Timeout OPTIONAL) { PLIST_ENTRY QueueEntry; - NTSTATUS Status; + LONG_PTR Status; PKTHREAD Thread = KeGetCurrentThread(); PKQUEUE PreviousQueue; PKWAIT_BLOCK WaitBlock = &Thread->WaitBlock[0]; diff --git a/reactos/ntoskrnl/ke/thrdobj.c b/reactos/ntoskrnl/ke/thrdobj.c index e8b6dfaec97..656e75d458c 100644 --- a/reactos/ntoskrnl/ke/thrdobj.c +++ b/reactos/ntoskrnl/ke/thrdobj.c @@ -1353,7 +1353,9 @@ KeTerminateThread(IN KPRIORITY Increment) SavedEntry = Entry; /* Now try to do the exchange */ - Entry = InterlockedCompareExchangePointer(ListHead, ThreadAddr, Entry); + Entry = InterlockedCompareExchangePointer((PVOID*)ListHead, + ThreadAddr, + Entry); /* Break out if the change was succesful */ } while (Entry != SavedEntry); diff --git a/reactos/ntoskrnl/ke/thrdschd.c b/reactos/ntoskrnl/ke/thrdschd.c index ff64d40cf5b..7a658928180 100644 --- a/reactos/ntoskrnl/ke/thrdschd.c +++ b/reactos/ntoskrnl/ke/thrdschd.c @@ -291,7 +291,7 @@ KiSelectNextThread(IN PKPRCB Prcb) return Thread; } -NTSTATUS +LONG_PTR FASTCALL KiSwapThread(IN PKTHREAD CurrentThread, IN PKPRCB Prcb) diff --git a/reactos/ntoskrnl/ke/wait.c b/reactos/ntoskrnl/ke/wait.c index 2ec2cec5159..b1488063b9e 100644 --- a/reactos/ntoskrnl/ke/wait.c +++ b/reactos/ntoskrnl/ke/wait.c @@ -87,7 +87,7 @@ KiUnlinkThread(IN PKTHREAD Thread, VOID FASTCALL KiUnwaitThread(IN PKTHREAD Thread, - IN NTSTATUS WaitStatus, + IN LONG_PTR WaitStatus, IN KPRIORITY Increment) { /* Unlink the thread */ From 96b5b93d6b63a9443f2f6812b6d2d5dbf83a21b5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 20 Sep 2008 09:33:53 +0000 Subject: [PATCH 272/388] Map the APIC page. svn path=/branches/ros-amd64-bringup/; revision=36343 --- reactos/boot/freeldr/freeldr/arch/amd64/loader.c | 11 ++++++----- .../boot/freeldr/freeldr/include/arch/amd64/amd64.h | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 4fce28d60da..41ad96708be 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -193,11 +193,6 @@ FrLdrMapRangeOfPages(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress, ULONG * * Returns: * None. - * - * Remarks: - * We are setting PDEs, but using the equvivalent (for our purpose) PTE structure. - * As such, please note that PageFrameNumber == PageEntryNumber. - * *--*/ VOID FASTCALL @@ -255,6 +250,12 @@ FrLdrSetupPageDirectory(VOID) DbgPrint("Could not map KUSER_SHARED_DATA page.\n", KernelPages); } + /* Map APIC page */ + if (!FrLdrMapSinglePage(APIC_BASE, APIC_PHYS_BASE)) + { + DbgPrint("Could not map APIC page.\n", KernelPages); + } + } VOID diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index 4e4fb7000b4..3917b5064c1 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -41,7 +41,9 @@ #define HYPERSPACE_BASE 0xfffff70000000000ULL #define HAL_BASE 0xffffffff80000000ULL -#define APIC_BASE 0xffffffffff000000ULL // FIXME +#define APIC_BASE 0xfffffffffee00000ULL // FIXME + +#define APIC_PHYS_BASE 0xfee00000 #define NUM_PAGES_KERNEL From a59ab56e6b181d5caeae637fc6b454d8a71291fb Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 20 Sep 2008 15:34:59 +0000 Subject: [PATCH 273/388] - fix a typo - silence debug output svn path=/branches/ros-amd64-bringup/; revision=36355 --- reactos/boot/freeldr/freeldr/arch/amd64/loader.c | 2 +- reactos/boot/freeldr/freeldr/debug.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c index 41ad96708be..81e277a2ab0 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/amd64/loader.c @@ -253,7 +253,7 @@ FrLdrSetupPageDirectory(VOID) /* Map APIC page */ if (!FrLdrMapSinglePage(APIC_BASE, APIC_PHYS_BASE)) { - DbgPrint("Could not map APIC page.\n", KernelPages); + DbgPrint("Could not map APIC page.\n"); } } diff --git a/reactos/boot/freeldr/freeldr/debug.c b/reactos/boot/freeldr/freeldr/debug.c index 3f84b507000..d05dd935bd5 100644 --- a/reactos/boot/freeldr/freeldr/debug.c +++ b/reactos/boot/freeldr/freeldr/debug.c @@ -26,8 +26,8 @@ //#define DEBUG_ALL //#define DEBUG_INIFILE //#define DEBUG_REACTOS -#define DEBUG_CUSTOM -//#define DEBUG_NONE +//#define DEBUG_CUSTOM +#define DEBUG_NONE #if defined (DEBUG_ALL) ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM | From fb201758c1c6a0fc45037b54f4f941addaf8d849 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 00:45:49 +0000 Subject: [PATCH 274/388] use FIELD_OFFSET instead of a constant svn path=/branches/ros-amd64-bringup/; revision=36360 --- reactos/include/ndk/amd64/ketypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 5135a318a40..583669c97a3 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -30,7 +30,7 @@ Author: // //#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS)) //#define PCR ((volatile KPCR * const)K0IPCR) -#define PCR ((volatile KPCR * const)__readgsqword(KPCR_SELF)) +#define PCR ((volatile KPCR * const)__readgsqword(FIELD_OFFSET(KPCR, Self))) //#if defined(CONFIG_SMP) || defined(NT_BUILD) //#undef KeGetPcr //#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C)) From 52babc02da81f3db521318509bf49230993a5b8b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 00:47:15 +0000 Subject: [PATCH 275/388] Make MmGetPageDirectory an inline function svn path=/branches/ros-amd64-bringup/; revision=36361 --- reactos/ntoskrnl/include/internal/amd64/mm.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h index fa8da9a6434..e9a415f99e7 100644 --- a/reactos/ntoskrnl/include/internal/amd64/mm.h +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -6,7 +6,13 @@ #define __NTOSKRNL_INCLUDE_INTERNAL_AMD64_MM_H struct _EPROCESS; -PULONG_PTR MmGetPageDirectory(VOID); + +PULONG64 +FORCEINLINE +MmGetPageDirectory(VOID) +{ + return (PULONG64)__readcr3(); +} #define PAGE_MASK(x) ((x)&(~0xfff)) #define PAE_PAGE_MASK(x) ((x)&(~0xfffLL)) From 416333a9468443c3416b026c3e289104b08ff44f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 14:34:48 +0000 Subject: [PATCH 276/388] preprocess all spec files svn path=/branches/ros-amd64-bringup/; revision=36379 --- .../rbuild/backend/mingw/modulehandler.cpp | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 34b8554a1a5..4d851ef41e0 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -1095,29 +1095,16 @@ Rule wmcRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc", "$(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); -Rule winebuildKMRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" - "\t$(ECHO_WINEBLD)\n" - "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c:\n" - "\t${cp} $(NUL) $@ 1>$(NUL)\n" - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" - "\t$(ECHO_CC)\n" - "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); Rule winebuildRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" "\t$(ECHO_WINEBLD)\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(source)\n" - "$(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c: $(source_path)$(SEP)$(source_name_noext).spec $(WINEBUILD_TARGET)\n" - "\t$(ECHO_WINEBLD)\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c --pedll $(source_path)$(SEP)$(source_name_noext).spec\n" + "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c:\n" + "\t${cp} $(NUL) $@ 1>$(NUL)\n" "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", @@ -1292,8 +1279,6 @@ MingwModuleHandler::GenerateCommands ( { HostDontCare, TypeDontCare, ".asm", &nasmRule }, { HostDontCare, TypeDontCare, ".rc", &windresRule }, { HostDontCare, TypeDontCare, ".mc", &wmcRule }, - { HostFalse, Kernel, ".spec", &winebuildKMRule }, - { HostFalse, KernelModeDLL, ".spec", &winebuildKMRule }, { HostDontCare, TypeDontCare, ".spec", &winebuildRule }, { HostDontCare, RpcServer, ".idl", &widlServerRule }, { HostDontCare, RpcClient, ".idl", &widlClientRule }, From 941fdb3f0bce0765b869ebf83cd73ed102118caf Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 14:40:17 +0000 Subject: [PATCH 277/388] Implement some functions that are forwarded to HAL on x86 build, but not on x64. Modify spec file (use preprocessor macro). Now scsiport can be loaded and freeldr doesn't complain about missing imports. svn path=/branches/ros-amd64-bringup/; revision=36380 --- .../drivers/storage/scsiport/scsiport.rbuild | 3 + .../drivers/storage/scsiport/scsiport.spec | 56 ++-- reactos/drivers/storage/scsiport/stubs.c | 250 ++++++++++++++++++ 3 files changed, 284 insertions(+), 25 deletions(-) create mode 100644 reactos/drivers/storage/scsiport/stubs.c diff --git a/reactos/drivers/storage/scsiport/scsiport.rbuild b/reactos/drivers/storage/scsiport/scsiport.rbuild index 98e4707fe50..76f94a16d65 100644 --- a/reactos/drivers/storage/scsiport/scsiport.rbuild +++ b/reactos/drivers/storage/scsiport/scsiport.rbuild @@ -10,4 +10,7 @@ scsiport.c scsiport.rc scsiport.spec + + stubs.c + diff --git a/reactos/drivers/storage/scsiport/scsiport.spec b/reactos/drivers/storage/scsiport/scsiport.spec index b779b1ee557..7d580bb2a81 100644 --- a/reactos/drivers/storage/scsiport/scsiport.spec +++ b/reactos/drivers/storage/scsiport/scsiport.spec @@ -1,7 +1,13 @@ +#ifdef _M_AMD64 +#define MAYBEFWD(x) +#else +#define MAYBEFWD(x) x +#endif + @ cdecl ScsiDebugPrint() @ stdcall ScsiPortCompleteRequest(ptr long long long long) @ stdcall ScsiPortConvertPhysicalAddressToUlong(long long) -@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) NTOSKRNL.RtlConvertUlongToLargeInteger +@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) MAYBEFWD(NTOSKRNL.RtlConvertUlongToLargeInteger) @ stdcall ScsiPortFlushDma(ptr) @ stdcall ScsiPortFreeDeviceBase(ptr ptr) @ stdcall ScsiPortGetBusData(ptr long long long ptr long) @@ -16,30 +22,30 @@ @ stdcall ScsiPortLogError(ptr ptr long long long long long) @ stdcall ScsiPortMoveMemory(ptr ptr long) @ cdecl ScsiPortNotification() -@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) HAL.READ_PORT_BUFFER_UCHAR -@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT -@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) HAL.READ_PORT_BUFFER_ULONG -@ stdcall ScsiPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR -@ stdcall ScsiPortReadPortUshort(ptr) HAL.READ_PORT_USHORT -@ stdcall ScsiPortReadPortUlong(ptr) HAL.READ_PORT_ULONG -@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_UCHAR -@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT -@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_ULONG -@ stdcall ScsiPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR -@ stdcall ScsiPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT -@ stdcall ScsiPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG +@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_UCHAR) +@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_USHORT) +@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_ULONG) +@ stdcall ScsiPortReadPortUchar(ptr) MAYBEFWD(HAL.READ_PORT_UCHAR) +@ stdcall ScsiPortReadPortUshort(ptr) MAYBEFWD(HAL.READ_PORT_USHORT) +@ stdcall ScsiPortReadPortUlong(ptr) MAYBEFWD(HAL.READ_PORT_ULONG) +@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_UCHAR) +@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_USHORT) +@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_ULONG) +@ stdcall ScsiPortReadRegisterUchar(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_UCHAR) +@ stdcall ScsiPortReadRegisterUshort(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_USHORT) +@ stdcall ScsiPortReadRegisterUlong(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_ULONG) @ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long) @ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor @ stdcall ScsiPortValidateRange(ptr long long long long long long) -@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) HAL.WRITE_PORT_BUFFER_UCHAR -@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) HAL.WRITE_PORT_BUFFER_USHORT -@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) HAL.WRITE_PORT_BUFFER_ULONG -@ stdcall ScsiPortWritePortUchar(ptr long) HAL.WRITE_PORT_UCHAR -@ stdcall ScsiPortWritePortUshort(ptr long) HAL.WRITE_PORT_USHORT -@ stdcall ScsiPortWritePortUlong(ptr long) HAL.WRITE_PORT_ULONG -@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR -@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT -@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG -@ stdcall ScsiPortWriteRegisterUchar(ptr long) NTOSKRNL.WRITE_REGISTER_UCHAR -@ stdcall ScsiPortWriteRegisterUshort(ptr long) NTOSKRNL.WRITE_REGISTER_USHORT -@ stdcall ScsiPortWriteRegisterUlong(ptr long) NTOSKRNL.WRITE_REGISTER_ULONG +@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_UCHAR) +@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_USHORT) +@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_ULONG) +@ stdcall ScsiPortWritePortUchar(ptr long) MAYBEFWD(HAL.WRITE_PORT_UCHAR) +@ stdcall ScsiPortWritePortUshort(ptr long) MAYBEFWD(HAL.WRITE_PORT_USHORT) +@ stdcall ScsiPortWritePortUlong(ptr long) MAYBEFWD(HAL.WRITE_PORT_ULONG) +@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR) +@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT) +@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG) +@ stdcall ScsiPortWriteRegisterUchar(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_UCHAR) +@ stdcall ScsiPortWriteRegisterUshort(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_USHORT) +@ stdcall ScsiPortWriteRegisterUlong(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_ULONG) diff --git a/reactos/drivers/storage/scsiport/stubs.c b/reactos/drivers/storage/scsiport/stubs.c new file mode 100644 index 00000000000..9e286d186f4 --- /dev/null +++ b/reactos/drivers/storage/scsiport/stubs.c @@ -0,0 +1,250 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Storage Stack + * FILE: drivers/storage/scsiport/stubs.c + * PURPOSE: SCSI port driver + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include +#include + +#define NDEBUG +#include + +#ifdef _MSC_VER + #define DDKAPI +#endif + +SCSI_PHYSICAL_ADDRESS +DDKAPI +ScsiPortConvertUlongToPhysicalAddress( + IN ULONG UlongAddress) +{ + return RtlConvertUlongToLargeInteger(UlongAddress); +} + +VOID +DDKAPI +ScsiPortReadPortBufferUchar( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + READ_PORT_BUFFER_UCHAR(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadPortBufferUshort( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + READ_PORT_BUFFER_USHORT(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadPortBufferUlong( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + READ_PORT_BUFFER_ULONG(Port, Buffer, Count); +} + +UCHAR +DDKAPI +ScsiPortReadPortUchar( + IN PUCHAR Port) +{ + return READ_PORT_UCHAR(Port); +} + +USHORT +DDKAPI +ScsiPortReadPortUshort( + IN PUSHORT Port) +{ + return READ_PORT_USHORT(Port); +} + +ULONG +DDKAPI +ScsiPortReadPortUlong( + IN PULONG Port) +{ + return READ_PORT_ULONG(Port); +} + +VOID +DDKAPI +ScsiPortReadRegisterBufferUchar( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + READ_REGISTER_BUFFER_UCHAR(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadRegisterBufferUshort( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + READ_REGISTER_BUFFER_USHORT(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadRegisterBufferUlong( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + READ_REGISTER_BUFFER_ULONG(Register, Buffer, Count); +} + +UCHAR +DDKAPI +ScsiPortReadRegisterUchar( + IN PUCHAR Register) +{ + return READ_REGISTER_UCHAR(Register); +} + +USHORT +DDKAPI +ScsiPortReadRegisterUshort( + IN PUSHORT Register) +{ + return READ_REGISTER_USHORT(Register); +} + +ULONG +DDKAPI +ScsiPortReadRegisterUlong( + IN PULONG Register) +{ + return READ_REGISTER_ULONG(Register); +} + +VOID +DDKAPI +ScsiPortWritePortBufferUchar( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWritePortBufferUshort( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWritePortBufferUlong( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWritePortUchar( + IN PUCHAR Port, + IN UCHAR Value) +{ + WRITE_PORT_UCHAR(Port, Value); +} + +VOID +DDKAPI +ScsiPortWritePortUshort( + IN PUSHORT Port, + IN USHORT Value) +{ + WRITE_PORT_USHORT(Port, Value); +} + +VOID +DDKAPI +ScsiPortWritePortUlong( + IN PULONG Port, + IN ULONG Value) +{ + WRITE_PORT_ULONG(Port, Value); +} + +VOID +DDKAPI +ScsiPortWriteRegisterBufferUchar( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWriteRegisterBufferUshort( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWriteRegisterBufferUlong( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWriteRegisterUchar( + IN PUCHAR Register, + IN ULONG Value) +{ + WRITE_REGISTER_UCHAR(Register, Value); +} + +VOID +DDKAPI +ScsiPortWriteRegisterUshort( + IN PUSHORT Register, + IN USHORT Value) +{ + WRITE_REGISTER_USHORT(Register, Value); +} + +VOID +DDKAPI +ScsiPortWriteRegisterUlong( + IN PULONG Register, + IN ULONG Value) +{ + WRITE_REGISTER_ULONG(Register, Value); +} + From caf56ecbd3f5d5729b6a436aeaad1c87f170c383 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 18:53:48 +0000 Subject: [PATCH 278/388] MS symbols say that the KPRCB member VebdorString is an array of UCHARs, not CHARs. svn path=/branches/ros-amd64-bringup/; revision=36387 --- reactos/include/ndk/i386/ketypes.h | 2 +- reactos/ntoskrnl/config/i386/cmhardwr.c | 2 +- reactos/ntoskrnl/ke/i386/cpu.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/include/ndk/i386/ketypes.h b/reactos/include/ndk/i386/ketypes.h index 6ad6aeba6ff..8738d169a57 100644 --- a/reactos/include/ndk/i386/ketypes.h +++ b/reactos/include/ndk/i386/ketypes.h @@ -595,7 +595,7 @@ typedef struct _KPRCB #else ULONG SpareFields0[1]; #endif - CHAR VendorString[13]; + UCHAR VendorString[13]; UCHAR InitialApicId; UCHAR LogicalProcessorsPerPhysicalProcessor; ULONG MHz; diff --git a/reactos/ntoskrnl/config/i386/cmhardwr.c b/reactos/ntoskrnl/config/i386/cmhardwr.c index a3a04fe7e58..f89cbce224d 100644 --- a/reactos/ntoskrnl/config/i386/cmhardwr.c +++ b/reactos/ntoskrnl/config/i386/cmhardwr.c @@ -483,7 +483,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc if (Prcb->VendorString) { /* Convert it to Unicode */ - RtlInitAnsiString(&TempString, Prcb->VendorString); + RtlInitAnsiString(&TempString, (PCHAR)Prcb->VendorString); RtlAnsiStringToUnicodeString(&Data, &TempString, TRUE); /* Add it to the registry */ diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index 3e5aa136a47..f5d6b0fcc2c 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -206,30 +206,30 @@ KiGetCpuVendor(VOID) Prcb->VendorString[sizeof(Prcb->VendorString) - sizeof(CHAR)] = ANSI_NULL; /* Now check the CPU Type */ - if (!strcmp(Prcb->VendorString, CmpIntelID)) + if (!strcmp((PCHAR)Prcb->VendorString, CmpIntelID)) { return CPU_INTEL; } - else if (!strcmp(Prcb->VendorString, CmpAmdID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpAmdID)) { return CPU_AMD; } - else if (!strcmp(Prcb->VendorString, CmpCyrixID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpCyrixID)) { DPRINT1("Cyrix CPUs not fully supported\n"); return 0; } - else if (!strcmp(Prcb->VendorString, CmpTransmetaID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpTransmetaID)) { DPRINT1("Transmeta CPUs not fully supported\n"); return 0; } - else if (!strcmp(Prcb->VendorString, CmpCentaurID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpCentaurID)) { DPRINT1("VIA CPUs not fully supported\n"); return 0; } - else if (!strcmp(Prcb->VendorString, CmpRiseID)) + else if (!strcmp((PCHAR)Prcb->VendorString, CmpRiseID)) { DPRINT1("Rise CPUs not fully supported\n"); return 0; From d62eba47ce29606dda446ea114d3cfb379f5b6ce Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 19:05:48 +0000 Subject: [PATCH 279/388] implement SetInterruptGate for amd64 and fix APIC_DEFAULT_BASE svn path=/branches/ros-amd64-bringup/; revision=36388 --- reactos/hal/halx86/include/apic.h | 4 ++++ reactos/hal/halx86/mp/apic.c | 20 +++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/reactos/hal/halx86/include/apic.h b/reactos/hal/halx86/include/apic.h index 92497b82251..a05c0d78e90 100644 --- a/reactos/hal/halx86/include/apic.h +++ b/reactos/hal/halx86/include/apic.h @@ -5,7 +5,11 @@ #ifndef __INTERNAL_HAL_APIC_H #define __INTERNAL_HAL_APIC_H +#ifdef _M_AMD64 +#define APIC_DEFAULT_BASE 0xfffffffffee00000ULL; +#else #define APIC_DEFAULT_BASE 0xFEE00000 /* Default Local APIC Base Register Address */ +#endif /* APIC Register Address Map */ #define APIC_ID 0x0020 /* Local APIC ID Register (R/W) */ diff --git a/reactos/hal/halx86/mp/apic.c b/reactos/hal/halx86/mp/apic.c index a4d6e81c601..d07c86410b0 100644 --- a/reactos/hal/halx86/mp/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -916,7 +916,21 @@ VOID SetInterruptGate(ULONG index, ULONG_PTR address) { #ifdef _M_AMD64 -UNIMPLEMENTED; + KIDTENTRY64 *idt; + + idt = &KeGetPcr()->IdtBase[index]; + + idt->OffsetLow = address & 0xffff; + idt->Selector = KGDT_64_R0_CODE; + idt->IstIndex = 0; + idt->Reserved0 = 0; + idt->Type = 0x0e; + idt->Dpl = 0; + idt->Present = 1; + idt->OffsetMiddle = (address >> 16) & 0xffff; + idt->OffsetHigh = address >> 32; + idt->Reserved1 = 0; + idt->Alignment = 0; #else KIDTENTRY *idt; KIDT_ACCESS Access; @@ -960,7 +974,7 @@ VOID HaliInitBSP(VOID) #ifdef CONFIG_SMP SetInterruptGate(IPI_VECTOR, (ULONG_PTR)MpsIpiInterrupt); #endif - DPRINT("APIC is mapped at 0x%X\n", APICBase); + DPRINT1("APIC is mapped at 0x%p\n", (PVOID)APICBase); if (VerifyLocalAPIC()) { @@ -968,7 +982,7 @@ VOID HaliInitBSP(VOID) } else { - DPRINT("No APIC found\n"); + DPRINT1("No APIC found\n"); ASSERT(FALSE); } From 57ab050fcd9fb9ef8427ba4fc32f2028bdb5ee6b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 19:17:53 +0000 Subject: [PATCH 280/388] - fix a typo - add some prototypes svn path=/branches/ros-amd64-bringup/; revision=36389 --- reactos/hal/halamd64/generic/irq.S | 2 +- reactos/hal/halamd64/include/halp.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/reactos/hal/halamd64/generic/irq.S b/reactos/hal/halamd64/generic/irq.S index 060b5b65940..1d5bb59861f 100644 --- a/reactos/hal/halamd64/generic/irq.S +++ b/reactos/hal/halamd64/generic/irq.S @@ -14,7 +14,7 @@ .macro UNIMPLEMENTED func jmp 2f 1: - .ascii "Sory, asm function " + .ascii "Sorry, asm function " .ascii func .ascii " is unimplemented!\n\0" 2: diff --git a/reactos/hal/halamd64/include/halp.h b/reactos/hal/halamd64/include/halp.h index e1b91270914..854043b3e0a 100644 --- a/reactos/hal/halamd64/include/halp.h +++ b/reactos/hal/halamd64/include/halp.h @@ -154,6 +154,15 @@ HalpTrap06( VOID ); +PDMA_ADAPTER STDCALL +HalpGetDmaAdapter( + IN PVOID Context, + IN PDEVICE_DESCRIPTION DeviceDescription, + OUT PULONG NumberOfMapRegisters); + +VOID HaliInitBSP(VOID); +VOID HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack); + extern PVOID HalpRealModeStart; extern PVOID HalpRealModeEnd; From 076b5a9b06bdf60f25955cc697fac548455c0294 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 20:15:15 +0000 Subject: [PATCH 281/388] fix function description comments svn path=/branches/ros-amd64-bringup/; revision=36391 --- reactos/ntoskrnl/ke/i386/ctxswitch.S | 31 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/reactos/ntoskrnl/ke/i386/ctxswitch.S b/reactos/ntoskrnl/ke/i386/ctxswitch.S index 73fe48388ee..c95c34dcdf2 100644 --- a/reactos/ntoskrnl/ke/i386/ctxswitch.S +++ b/reactos/ntoskrnl/ke/i386/ctxswitch.S @@ -320,20 +320,23 @@ BadThread: .endfunc /*++ - * KiSwapContextInternal + * KiSwapContextInternal * + * \brief * The KiSwapContextInternal routine switches context to another thread. * + * BOOLEAN USERCALL KiSwapContextInternal(); + * * Params: * ESI - Pointer to the KTHREAD to which the caller wishes to * switch to. * EDI - Pointer to the KTHREAD to which the caller wishes to * switch from. * - * Returns: - * None. + * \returns + * APC state. * - * Remarks: + * \remarks * Absolutely all registers except ESP can be trampled here for maximum code flexibility. * *--*/ @@ -589,19 +592,25 @@ WrongCpu: #endif .endfunc -/*++ - * KiSwapContext +/** + * KiSwapContext * + * \brief * The KiSwapContext routine switches context to another thread. * - * Params: - * TargetThread - Pointer to the KTHREAD to which the caller wishes to - * switch to. + * BOOLEAN FASTCALL + * KiSwapContext(PKTHREAD CurrentThread, PKTHREAD TargetThread); * - * Returns: + * \param CurrentThread + * Pointer to the KTHREAD of the current thread. + * + * \param TargetThread + * Pointer to the KTHREAD to which the caller wishes to switch to. + * + * \returns * The WaitStatus of the Target Thread. * - * Remarks: + * \remarks * This is a wrapper around KiSwapContextInternal which will save all the * non-volatile registers so that the Internal function can use all of * them. It will also save the old current thread and set the new one. From 274bc288828d4756957e0f5b8c0d959148204340 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 20:56:19 +0000 Subject: [PATCH 282/388] - add ctxswitch.S - compile cmhardwr.c from i386 svn path=/branches/ros-amd64-bringup/; revision=36392 --- reactos/ntoskrnl/amd64stubs.c | 2 - reactos/ntoskrnl/ke/amd64/ctxswitch.S | 216 +++++++++++++++++++++ reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 6 + 3 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 reactos/ntoskrnl/ke/amd64/ctxswitch.S diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index b384d2e564c..86a2d2a5ad3 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -12,7 +12,6 @@ STUB(ExpInterlockedPushEntrySList) STUB(NtContinue) STUB(KeActiveProcessors) STUB(KeDisableInterrupts) -STUB(KiSwapContext) STUB(KeContextToTrapFrame) STUB(KiDispatchException) STUB(MiGetUserPageDirectoryCount) @@ -40,7 +39,6 @@ STUB(ExpFirmwareTableProviderListHead) STUB(ExInterlockedInsertTailList) STUB(ExInterlockedRemoveHeadList) STUB(ExInterlockedAddLargeStatistic) -STUB(CmpInitializeMachineDependentConfiguration) STUB(ExpFirmwareTableResource) STUB(MmNumberOfPhysicalPages) STUB(MmMapLockedPage) diff --git a/reactos/ntoskrnl/ke/amd64/ctxswitch.S b/reactos/ntoskrnl/ke/amd64/ctxswitch.S new file mode 100644 index 00000000000..9a51fee6c5d --- /dev/null +++ b/reactos/ntoskrnl/ke/amd64/ctxswitch.S @@ -0,0 +1,216 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/ke/amd64/ctxswitch.S + * PURPOSE: Thread Context Switching + * + * PROGRAMMER: Timo kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include + +.intel_syntax noprefix + +.altmacro +.macro UNIMPLEMENTED func + jmp 2f +1: + .ascii "Sorry, asm function " + .ascii func + .ascii " is unimplemented!\n\0" +2: + movabs rcx, offset 1b + call _DbgPrint + ret +.endm + + +/* FUNCTIONS ****************************************************************/ + +/*++ + * KiThreadStartup + * + * The KiThreadStartup routine is the beginning of any thread. + * + * Params: + * SystemRoutine - Pointer to the System Startup Routine. Either + * PspUserThreadStartup or PspSystemThreadStartup + * + * StartRoutine - For Kernel Threads only, specifies the starting execution + * point of the new thread. + * + * StartContext - For Kernel Threads only, specifies a pointer to variable + * context data to be sent to the StartRoutine above. + * + * UserThread - Indicates whether or not this is a user thread. This tells + * us if the thread has a context or not. + * + * TrapFrame - Pointer to the KTHREAD to which the caller wishes to + * switch from. + * + * Returns: + * Should never return for a system thread. Returns through the System Call + * Exit Dispatcher for a user thread. + * + * Remarks: + * If a return from a system thread is detected, a bug check will occur. + * + *--*/ + .func KiThreadStartup +.globl _KiThreadStartup +_KiThreadStartup: + + /* + * Clear all the non-volatile registers, so the thread won't be tempted to + * expect any static data (like some badly coded usermode/win9x apps do) + */ + xor rbx, rbx + xor rsi, rsi + xor rdi, rdi + xor rbp, rbp + xor r10, r10 + xor r11, r11 + xor r12, r12 + xor r13, r13 + xor r14, r14 + xor r15, r15 + + /* It's now safe to go to APC */ + mov rax, APC_LEVEL + mov cr8, rax + + /* + * Call the System Routine which is right on our stack now. + * After we pop the pointer, the Start Routine/Context is on the + * stack, we pop it as parameters to the System Routine into rcx + */ + pop rax + pop rcx + call rax + + /* The thread returned... was it a user-thread? */ + pop rcx + or rcx, rcx + jz BadThread + + /* Yes it was, set our trapframe for the System Call Exit Dispatcher */ + mov ebp, esp + + /* Exit back to user-mode */ +// jmp _KiServiceExit2 +UNIMPLEMENTED "KiThreadStartup->KiServiceExit2" + +BadThread: + + /* A system thread returned...this is very bad! */ + int 3 +.endfunc + + +/*++ + * KiSwapContextInternal + * + * The KiSwapContextInternal routine switches context to another thread. + * + * Params: + * ESI - Pointer to the KTHREAD to which the caller wishes to + * switch to. + * EDI - Pointer to the KTHREAD to which the caller wishes to + * switch from. + * + * Returns: + * None. + * + * Remarks: + * Absolutely all registers except ESP can be trampled here for maximum code flexibility. + * + *--*/ +.globl _KiSwapContextInternal +.func _KiSwapContextInternal, _KiSwapContextInternal +_KiSwapContextInternal: + UNIMPLEMENTED "KiSwapContextInternal" + ret + +.endfunc + +/** + * KiSwapContext + * + * \brief + * The KiSwapContext routine switches context to another thread. + * + * BOOLEAN + * KiSwapContext(PKTHREAD CurrentThread, PKTHREAD TargetThread); + * + * \param CurrentThread + * Pointer to the KTHREAD of the current thread. + * + * \param TargetThread + * Pointer to the KTHREAD to which the caller wishes to switch to. + * + * \returns + * The WaitStatus of the Target Thread. + * + * \remarks + * This is a wrapper around KiSwapContextInternal which will save all the + * non-volatile registers so that the Internal function can use all of + * them. It will also save the old current thread and set the new one. + * + * The calling thread does not return after KiSwapContextInternal until + * another thread switches to IT. + * + *--*/ +.globl _KiSwapContext +.func _KiSwapContext, _KiSwapContext +_KiSwapContext: + + /* Save 10 registers */ + sub rsp, 10 * 8 + + /* Save all the non-volatile ones */ + mov [rsp+72], r15 + mov [rsp+64], r14 + mov [rsp+56], r13 + mov [rsp+48], r12 + mov [rsp+40], r11 + mov [rsp+32], r10 + + mov [rsp+24], rbx + mov [rsp+16], rsi + mov [rsp+8], rdi + mov [rsp+0], rbp + + /* Get the PCR */ + mov rbx, gs:[KPCR_SELF] + + /* Get the current thread */ + mov rdi, rcx + + /* Get the New Thread */ + mov rsi, rdx + + /* Get the wait IRQL */ + movzx ecx, byte ptr [edi+KTHREAD_WAIT_IRQL] + + /* Do the swap with the registers correctly setup */ + call _KiSwapContextInternal + + /* Restore the registers */ + mov rbp, [rsp+0] + mov rdi, [rsp+8] + mov rsi, [rsp+16] + mov rbx, [rsp+24] + + mov r10, [rsp+32] + mov r11, [rsp+40] + mov r12, [rsp+48] + mov r13, [rsp+56] + mov r14, [rsp+64] + mov r15, [rsp+72] + + /* Clean stack */ + add esp, 10 * 8 + ret +.endfunc diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index 386fd266537..6e16934f4c7 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -92,6 +92,7 @@ boot.S cpu.c + ctxswitch.S except.c irql.c kiinit.c @@ -139,6 +140,11 @@ cmhardwr.c + + + cmhardwr.c + + cmhardwr.c From dfb5b8873c9d89ebd3ca58f7b68aa1e8ad72948b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 21:04:40 +0000 Subject: [PATCH 283/388] fix spec file svn path=/branches/ros-amd64-bringup/; revision=36393 --- reactos/drivers/storage/scsiport/scsiport.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/storage/scsiport/scsiport.spec b/reactos/drivers/storage/scsiport/scsiport.spec index 7d580bb2a81..65c75471c4d 100644 --- a/reactos/drivers/storage/scsiport/scsiport.spec +++ b/reactos/drivers/storage/scsiport/scsiport.spec @@ -1,4 +1,4 @@ -#ifdef _M_AMD64 +#ifdef __x86_64__ #define MAYBEFWD(x) #else #define MAYBEFWD(x) x From 6bcc5a5626456ad20db8accb7e732a7b1ef325b5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 22:34:38 +0000 Subject: [PATCH 284/388] revert 36379 svn path=/branches/ros-amd64-bringup/; revision=36395 --- .../rbuild/backend/mingw/modulehandler.cpp | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 4d851ef41e0..34b8554a1a5 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -1095,16 +1095,29 @@ Rule wmcRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc", "$(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); +Rule winebuildKMRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "\t$(ECHO_WINEBLD)\n" + "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c:\n" + "\t${cp} $(NUL) $@ 1>$(NUL)\n" + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "\t$(ECHO_CC)\n" + "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); Rule winebuildRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" "\t$(ECHO_WINEBLD)\n" - "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c:\n" - "\t${cp} $(NUL) $@ 1>$(NUL)\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(source)\n" + "$(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c: $(source_path)$(SEP)$(source_name_noext).spec $(WINEBUILD_TARGET)\n" + "\t$(ECHO_WINEBLD)\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c --pedll $(source_path)$(SEP)$(source_name_noext).spec\n" "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", @@ -1279,6 +1292,8 @@ MingwModuleHandler::GenerateCommands ( { HostDontCare, TypeDontCare, ".asm", &nasmRule }, { HostDontCare, TypeDontCare, ".rc", &windresRule }, { HostDontCare, TypeDontCare, ".mc", &wmcRule }, + { HostFalse, Kernel, ".spec", &winebuildKMRule }, + { HostFalse, KernelModeDLL, ".spec", &winebuildKMRule }, { HostDontCare, TypeDontCare, ".spec", &winebuildRule }, { HostDontCare, RpcServer, ".idl", &widlServerRule }, { HostDontCare, RpcClient, ".idl", &widlClientRule }, From 0e258751a6d8cedbd228a5ae2c723b1ec36a0ad2 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 22:37:57 +0000 Subject: [PATCH 285/388] use precompiler for .pspec files svn path=/branches/ros-amd64-bringup/; revision=36396 --- .../rbuild/backend/mingw/modulehandler.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 34b8554a1a5..12fe659412a 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -440,6 +440,8 @@ MingwModuleHandler::GetObjectFilename ( newExtension = ".rc"; else if ( extension == ".spec" || extension == ".SPEC" ) newExtension = ".stubs.o"; + else if ( extension == ".pspec" || extension == ".PSPEC" ) + newExtension = ".stubs.o"; else if ( extension == ".idl" || extension == ".IDL" ) { if ( module.type == RpcServer ) @@ -1109,6 +1111,21 @@ Rule winebuildKMRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_no "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); +Rule winebuildPCRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "\t$(ECHO_WINEBLD)\n" + "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "$(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c: $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec $(WINEBUILD_TARGET)\n" + "\t$(ECHO_WINEBLD)\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c --pedll $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "\t$(ECHO_CC)\n" + "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); Rule winebuildRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" "\t$(ECHO_WINEBLD)\n" "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(source)\n" @@ -1294,6 +1311,7 @@ MingwModuleHandler::GenerateCommands ( { HostDontCare, TypeDontCare, ".mc", &wmcRule }, { HostFalse, Kernel, ".spec", &winebuildKMRule }, { HostFalse, KernelModeDLL, ".spec", &winebuildKMRule }, + { HostDontCare, TypeDontCare, ".pspec", &winebuildPCRule }, { HostDontCare, TypeDontCare, ".spec", &winebuildRule }, { HostDontCare, RpcServer, ".idl", &widlServerRule }, { HostDontCare, RpcClient, ".idl", &widlClientRule }, From 91fa4b7fd0284309c4f8e23c02bde1782665b574 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 21 Sep 2008 22:38:52 +0000 Subject: [PATCH 286/388] rename .spec to .pspec svn path=/branches/ros-amd64-bringup/; revision=36397 --- .../drivers/storage/scsiport/{scsiport.spec => scsiport.pspec} | 0 reactos/drivers/storage/scsiport/scsiport.rbuild | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename reactos/drivers/storage/scsiport/{scsiport.spec => scsiport.pspec} (100%) diff --git a/reactos/drivers/storage/scsiport/scsiport.spec b/reactos/drivers/storage/scsiport/scsiport.pspec similarity index 100% rename from reactos/drivers/storage/scsiport/scsiport.spec rename to reactos/drivers/storage/scsiport/scsiport.pspec diff --git a/reactos/drivers/storage/scsiport/scsiport.rbuild b/reactos/drivers/storage/scsiport/scsiport.rbuild index 76f94a16d65..a389075c829 100644 --- a/reactos/drivers/storage/scsiport/scsiport.rbuild +++ b/reactos/drivers/storage/scsiport/scsiport.rbuild @@ -9,7 +9,7 @@ hal scsiport.c scsiport.rc - scsiport.spec + scsiport.pspec stubs.c From 5baf01f96f81a4c3cba91d5fe29c08ed8ed8aac7 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 04:07:16 +0000 Subject: [PATCH 287/388] Remove references to Infp Functions that collide with inflib names, call the actual functions instead of making small functions that shared the same parameters and just called into inflib anyway, with no changes whatsoever. Make InfpGetIntField's 3rd parameter an INT* svn path=/branches/ros-amd64-bringup/; revision=36443 --- reactos/base/setup/usetup/inffile.c | 40 ----------------------------- reactos/base/setup/usetup/inffile.h | 31 +++------------------- reactos/base/setup/usetup/usetup.h | 1 + reactos/lib/inflib/infget.c | 2 +- reactos/lib/inflib/infpriv.h | 2 +- reactos/lib/inflib/infros.h | 2 +- reactos/lib/inflib/infrosget.c | 2 +- 7 files changed, 9 insertions(+), 71 deletions(-) diff --git a/reactos/base/setup/usetup/inffile.c b/reactos/base/setup/usetup/inffile.c index 17d2cd25a62..173781c660a 100644 --- a/reactos/base/setup/usetup/inffile.c +++ b/reactos/base/setup/usetup/inffile.c @@ -65,46 +65,6 @@ InfpFindFirstLineW( return TRUE; } -BOOL WINAPI -InfpFindNextLine( - IN PINFCONTEXT ContextIn, - OUT PINFCONTEXT ContextOut) -{ - return InfFindNextLine(ContextIn, ContextOut); -} - -BOOL WINAPI -InfpGetBinaryField( - IN PINFCONTEXT Context, - IN ULONG FieldIndex, - IN OUT BYTE* ReturnBuffer, - IN ULONG ReturnBufferSize, - OUT PULONG RequiredSize) -{ - return InfGetBinaryField(Context, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize); -} - -DWORD WINAPI -InfpGetFieldCount( - IN PINFCONTEXT Context) -{ - return (DWORD)InfGetFieldCount(Context); -} - -BOOL WINAPI -InfpGetIntField( - IN PINFCONTEXT Context, - IN DWORD FieldIndex, - OUT PINT IntegerValue) -{ - LONG IntegerValueL; - BOOL ret; - - ret = InfGetIntField(Context, FieldIndex, &IntegerValueL); - *IntegerValue = (INT)IntegerValueL; - return ret; -} - BOOL WINAPI InfpGetMultiSzFieldW( IN PINFCONTEXT Context, diff --git a/reactos/base/setup/usetup/inffile.h b/reactos/base/setup/usetup/inffile.h index 7aa1e1c2752..f17e7cbb019 100644 --- a/reactos/base/setup/usetup/inffile.h +++ b/reactos/base/setup/usetup/inffile.h @@ -37,10 +37,10 @@ #define SetupCloseInfFile InfpCloseInfFile #define SetupFindFirstLineW InfpFindFirstLineW -#define SetupFindNextLine InfpFindNextLine -#define SetupGetBinaryField InfpGetBinaryField -#define SetupGetFieldCount InfpGetFieldCount -#define SetupGetIntField InfpGetIntField +#define SetupFindNextLine InfFindNextLine +#define SetupGetBinaryField InfGetBinaryField +#define SetupGetFieldCount InfGetFieldCount +#define SetupGetIntField InfGetIntField #define SetupGetMultiSzFieldW InfpGetMultiSzFieldW #define SetupGetStringFieldW InfpGetStringFieldW #define SetupOpenInfFileW InfpOpenInfFileW @@ -67,29 +67,6 @@ InfpFindFirstLineW( IN PCWSTR Key, IN OUT PINFCONTEXT Context); -BOOL WINAPI -InfpFindNextLine( - IN PINFCONTEXT ContextIn, - OUT PINFCONTEXT ContextOut); - -BOOL WINAPI -InfpGetBinaryField( - IN PINFCONTEXT Context, - IN ULONG FieldIndex, - IN OUT BYTE* ReturnBuffer, - IN ULONG ReturnBufferSize, - OUT PULONG RequiredSize); - -DWORD WINAPI -InfpGetFieldCount( - IN PINFCONTEXT Context); - -BOOL WINAPI -InfpGetIntField( - IN PINFCONTEXT Context, - IN DWORD FieldIndex, - OUT PINT IntegerValue); - BOOL WINAPI InfpGetMultiSzFieldW( IN PINFCONTEXT Context, diff --git a/reactos/base/setup/usetup/usetup.h b/reactos/base/setup/usetup/usetup.h index ce933d8a5a6..b634e06611d 100644 --- a/reactos/base/setup/usetup/usetup.h +++ b/reactos/base/setup/usetup/usetup.h @@ -54,6 +54,7 @@ /* Internal Headers */ #include "interface/consup.h" #include "partlist.h" +#include "infros.h" #include "inffile.h" #include "inicache.h" #include "progress.h" diff --git a/reactos/lib/inflib/infget.c b/reactos/lib/inflib/infget.c index ff23a2c3f7b..6e713d4d534 100644 --- a/reactos/lib/inflib/infget.c +++ b/reactos/lib/inflib/infget.c @@ -271,7 +271,7 @@ InfpGetBinaryField(PINFCONTEXT Context, INFSTATUS InfpGetIntField(PINFCONTEXT Context, ULONG FieldIndex, - PLONG IntegerValue) + INT* IntegerValue) { PINFCACHELINE CacheLine; PINFCACHEFIELD CacheField; diff --git a/reactos/lib/inflib/infpriv.h b/reactos/lib/inflib/infpriv.h index 2619b1ca77a..cde48d42579 100644 --- a/reactos/lib/inflib/infpriv.h +++ b/reactos/lib/inflib/infpriv.h @@ -116,7 +116,7 @@ extern INFSTATUS InfpGetBinaryField(PINFCONTEXT Context, PULONG RequiredSize); extern INFSTATUS InfpGetIntField(PINFCONTEXT Context, ULONG FieldIndex, - PLONG IntegerValue); + INT* IntegerValue); extern INFSTATUS InfpGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, PTSTR ReturnBuffer, diff --git a/reactos/lib/inflib/infros.h b/reactos/lib/inflib/infros.h index e959a72a9e7..77368cbdd24 100644 --- a/reactos/lib/inflib/infros.h +++ b/reactos/lib/inflib/infros.h @@ -49,7 +49,7 @@ extern BOOLEAN InfGetBinaryField(PINFCONTEXT Context, PULONG RequiredSize); extern BOOLEAN InfGetIntField(PINFCONTEXT Context, ULONG FieldIndex, - PLONG IntegerValue); + PINT IntegerValue); extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, PWSTR ReturnBuffer, diff --git a/reactos/lib/inflib/infrosget.c b/reactos/lib/inflib/infrosget.c index 9f3e7b06abf..ee919cb4288 100644 --- a/reactos/lib/inflib/infrosget.c +++ b/reactos/lib/inflib/infrosget.c @@ -84,7 +84,7 @@ InfGetBinaryField(PINFCONTEXT Context, BOOLEAN InfGetIntField(PINFCONTEXT Context, ULONG FieldIndex, - PLONG IntegerValue) + PINT IntegerValue) { return INF_SUCCESS(InfpGetIntField(Context, FieldIndex, IntegerValue)); } From da929aff6babdd817d6311922aa2035fae11110f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 04:24:45 +0000 Subject: [PATCH 288/388] Fix 64bit warning. svn path=/branches/ros-amd64-bringup/; revision=36444 --- reactos/base/setup/welcome/welcome.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/setup/welcome/welcome.c b/reactos/base/setup/welcome/welcome.c index b6a8167c193..2c93c43c5ba 100755 --- a/reactos/base/setup/welcome/welcome.c +++ b/reactos/base/setup/welcome/welcome.c @@ -386,7 +386,7 @@ OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam) rcLeftPanel.right - rcLeftPanel.left, dwHeight, hWnd, - (HMENU)i, + (HMENU)IntToPtr(i), hInstance, NULL); hwndDefaultTopic = hwndTopicButton[i]; From 86109204bf74dc1e22a5dcf8f45a896fde692006 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 04:36:35 +0000 Subject: [PATCH 289/388] Minor 64bit fixes. svn path=/branches/ros-amd64-bringup/; revision=36445 --- reactos/base/shell/cmd/cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/shell/cmd/cmd.c b/reactos/base/shell/cmd/cmd.c index 1dbd4c996ef..eef62f1f751 100644 --- a/reactos/base/shell/cmd/cmd.c +++ b/reactos/base/shell/cmd/cmd.c @@ -307,10 +307,10 @@ static BOOL RunFile(LPTSTR filename) ret = (hShExt)(NULL, _T("open"), filename, NULL, NULL, SW_SHOWNORMAL); - TRACE ("RunFile: ShellExecuteA/W returned %d\n", (DWORD)ret); + TRACE ("RunFile: ShellExecuteA/W returned %p\n", (DWORD_PTR)ret); FreeLibrary(hShell32); - return (((DWORD)ret) > 32); + return (((DWORD_PTR)ret) > 32); } From 2d4bc309096e508880c9878fc34f21944c94531a Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 05:06:55 +0000 Subject: [PATCH 290/388] It is blasphemy to say that DLGPROC returns BOOL. svn path=/branches/ros-amd64-bringup/; revision=36446 --- reactos/base/system/winlogon/sas.c | 2 +- reactos/base/system/winlogon/winlogon.c | 2 +- reactos/base/system/winlogon/wlx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/base/system/winlogon/sas.c b/reactos/base/system/winlogon/sas.c index 750b01fef94..b68c97640eb 100644 --- a/reactos/base/system/winlogon/sas.c +++ b/reactos/base/system/winlogon/sas.c @@ -505,7 +505,7 @@ HandleLogoff( return STATUS_SUCCESS; } -static BOOL CALLBACK +static LRESULT CALLBACK ShutdownComputerWindowProc( IN HWND hwndDlg, IN UINT uMsg, diff --git a/reactos/base/system/winlogon/winlogon.c b/reactos/base/system/winlogon/winlogon.c index bc70d65eeb6..454154acf06 100644 --- a/reactos/base/system/winlogon/winlogon.c +++ b/reactos/base/system/winlogon/winlogon.c @@ -185,7 +185,7 @@ RemoveStatusMessage( return Session->Gina.Functions.WlxRemoveStatusMessage(Session->Gina.Context); } -static BOOL CALLBACK +static LRESULT CALLBACK GinaLoadFailedWindowProc( IN HWND hwndDlg, IN UINT uMsg, diff --git a/reactos/base/system/winlogon/wlx.c b/reactos/base/system/winlogon/wlx.c index 86065decc8f..fc7c4782547 100644 --- a/reactos/base/system/winlogon/wlx.c +++ b/reactos/base/system/winlogon/wlx.c @@ -23,7 +23,7 @@ static UINT_PTR IdTimer; /* FUNCTIONS ****************************************************************/ -static BOOL CALLBACK +static LRESULT CALLBACK DefaultWlxWindowProc( IN HWND hwndDlg, IN UINT uMsg, From 684afa4491432630b1b56e716bd50b1b74c16bc7 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 05:08:25 +0000 Subject: [PATCH 291/388] Fix 64bit warnings/errors. svn path=/branches/ros-amd64-bringup/; revision=36447 --- reactos/base/system/smss/client.c | 2 +- reactos/base/system/smss/initss.c | 4 ++-- reactos/base/system/smss/smapicomp.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/base/system/smss/client.c b/reactos/base/system/smss/client.c index d63f10ea394..a70d0011bed 100644 --- a/reactos/base/system/smss/client.c +++ b/reactos/base/system/smss/client.c @@ -451,7 +451,7 @@ SmCreateClient (PRTL_USER_PROCESS_INFORMATION ProcessInfo, PWSTR ProgramName) SmpClientDirectory.CandidateClient->ServerProcess = (HANDLE) ProcessInfo->ProcessHandle; SmpClientDirectory.CandidateClient->ServerProcessId = - (ULONG) ProcessInfo->ClientId.UniqueProcess; + (DWORD_PTR) ProcessInfo->ClientId.UniqueProcess; /* * Copy the program name */ diff --git a/reactos/base/system/smss/initss.c b/reactos/base/system/smss/initss.c index 52f056f9fb6..5c1fee4c014 100644 --- a/reactos/base/system/smss/initss.c +++ b/reactos/base/system/smss/initss.c @@ -57,8 +57,8 @@ NTSTATUS STDCALL SmRegisterInternalSubsystem (LPWSTR PgmName, RtlZeroMemory (& ProcessInfo, sizeof ProcessInfo); ProcessInfo.Size = sizeof ProcessInfo; - ProcessInfo.ProcessHandle = (HANDLE) SmSsProcessId; - ProcessInfo.ClientId.UniqueProcess = (HANDLE) SmSsProcessId; + ProcessInfo.ProcessHandle = (HANDLE) UlongToPtr(SmSsProcessId); + ProcessInfo.ClientId.UniqueProcess = (HANDLE) UlongToPtr(SmSsProcessId); DPRINT("SM: %s: ProcessInfo.ProcessHandle=%p\n", __FUNCTION__,ProcessInfo.ProcessHandle); Status = SmCreateClient (& ProcessInfo, PgmName); diff --git a/reactos/base/system/smss/smapicomp.c b/reactos/base/system/smss/smapicomp.c index 5f30d4684f0..82ecb793ff0 100644 --- a/reactos/base/system/smss/smapicomp.c +++ b/reactos/base/system/smss/smapicomp.c @@ -40,7 +40,7 @@ SMAPI(SmCompSes) DPRINT("SM: %s: ClientId.UniqueProcess=%p\n", __FUNCTION__, Request->Header.ClientId.UniqueProcess); - Status = SmCompleteClientInitialization ((ULONG) Request->Header.ClientId.UniqueProcess); + Status = SmCompleteClientInitialization (PtrToUlong(Request->Header.ClientId.UniqueProcess)); if (!NT_SUCCESS(Status)) { DPRINT1("SM: %s: SmCompleteClientInitialization failed (Status=0x%08lx)\n", From bcd1bf1cd62746660efd66a7cb331d6e23cbe5f7 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 07:33:48 +0000 Subject: [PATCH 292/388] Sorry, these are DialogBoxParams.:( svn path=/branches/ros-amd64-bringup/; revision=36448 --- reactos/base/system/winlogon/sas.c | 2 +- reactos/base/system/winlogon/winlogon.c | 2 +- reactos/base/system/winlogon/wlx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/base/system/winlogon/sas.c b/reactos/base/system/winlogon/sas.c index b68c97640eb..898aa311079 100644 --- a/reactos/base/system/winlogon/sas.c +++ b/reactos/base/system/winlogon/sas.c @@ -505,7 +505,7 @@ HandleLogoff( return STATUS_SUCCESS; } -static LRESULT CALLBACK +static INT_PTR CALLBACK ShutdownComputerWindowProc( IN HWND hwndDlg, IN UINT uMsg, diff --git a/reactos/base/system/winlogon/winlogon.c b/reactos/base/system/winlogon/winlogon.c index 454154acf06..7c9a79e7c26 100644 --- a/reactos/base/system/winlogon/winlogon.c +++ b/reactos/base/system/winlogon/winlogon.c @@ -185,7 +185,7 @@ RemoveStatusMessage( return Session->Gina.Functions.WlxRemoveStatusMessage(Session->Gina.Context); } -static LRESULT CALLBACK +static INT_PTR CALLBACK GinaLoadFailedWindowProc( IN HWND hwndDlg, IN UINT uMsg, diff --git a/reactos/base/system/winlogon/wlx.c b/reactos/base/system/winlogon/wlx.c index fc7c4782547..fa32b5a5e20 100644 --- a/reactos/base/system/winlogon/wlx.c +++ b/reactos/base/system/winlogon/wlx.c @@ -23,7 +23,7 @@ static UINT_PTR IdTimer; /* FUNCTIONS ****************************************************************/ -static LRESULT CALLBACK +static INT_PTR CALLBACK DefaultWlxWindowProc( IN HWND hwndDlg, IN UINT uMsg, From 778d48d1a6238aaceff1d1d1de4f7216a9217064 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 09:39:44 +0000 Subject: [PATCH 293/388] Convert appwiz.cpl to spec svn path=/branches/ros-amd64-bringup/; revision=36452 --- reactos/dll/cpl/appwiz/appwiz.def | 9 --------- reactos/dll/cpl/appwiz/appwiz.rbuild | 3 ++- reactos/dll/cpl/appwiz/appwiz.spec | 4 ++++ 3 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 reactos/dll/cpl/appwiz/appwiz.def create mode 100644 reactos/dll/cpl/appwiz/appwiz.spec diff --git a/reactos/dll/cpl/appwiz/appwiz.def b/reactos/dll/cpl/appwiz/appwiz.def deleted file mode 100644 index 5cebd5894c2..00000000000 --- a/reactos/dll/cpl/appwiz/appwiz.def +++ /dev/null @@ -1,9 +0,0 @@ -LIBRARY appwiz.cpl - -EXPORTS -CPlApplet@16 -NewLinkHere@16 -NewLinkHereA@16 -NewLinkHereW@16 - -; EOF diff --git a/reactos/dll/cpl/appwiz/appwiz.rbuild b/reactos/dll/cpl/appwiz/appwiz.rbuild index 9c8370f5bd7..1ab4b807d33 100644 --- a/reactos/dll/cpl/appwiz/appwiz.rbuild +++ b/reactos/dll/cpl/appwiz/appwiz.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -19,4 +19,5 @@ createlink.c updates.c appwiz.rc + appwiz.spec diff --git a/reactos/dll/cpl/appwiz/appwiz.spec b/reactos/dll/cpl/appwiz/appwiz.spec new file mode 100644 index 00000000000..e9bad2d20a0 --- /dev/null +++ b/reactos/dll/cpl/appwiz/appwiz.spec @@ -0,0 +1,4 @@ +@ stdcall CPlApplet(ptr long ptr ptr) +@ stdcall NewLinkHere(ptr long ptr ptr) +@ stdcall NewLinkHereA(ptr long ptr ptr) +@ stdcall NewLinkHereW(ptr long ptr ptr) From 9128270195849530fb17405ada156e664cc491de Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 09:41:42 +0000 Subject: [PATCH 294/388] Convert to spec. svn path=/branches/ros-amd64-bringup/; revision=36453 --- reactos/dll/cpl/appwiz-new/appwiz.def | 9 --------- reactos/dll/cpl/appwiz-new/appwiz.rbuild | 3 ++- reactos/dll/cpl/appwiz-new/appwiz.spec | 4 ++++ 3 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 reactos/dll/cpl/appwiz-new/appwiz.def create mode 100644 reactos/dll/cpl/appwiz-new/appwiz.spec diff --git a/reactos/dll/cpl/appwiz-new/appwiz.def b/reactos/dll/cpl/appwiz-new/appwiz.def deleted file mode 100644 index d8f3e2e8e1f..00000000000 --- a/reactos/dll/cpl/appwiz-new/appwiz.def +++ /dev/null @@ -1,9 +0,0 @@ -LIBRARY appwiz.cpl - -EXPORTS -CPlApplet@16 -;NewLinkHere@16 -;NewLinkHereA@16 -;NewLinkHereW@16 - -; EOF diff --git a/reactos/dll/cpl/appwiz-new/appwiz.rbuild b/reactos/dll/cpl/appwiz-new/appwiz.rbuild index 1a77bdc7139..ba87358ae89 100644 --- a/reactos/dll/cpl/appwiz-new/appwiz.rbuild +++ b/reactos/dll/cpl/appwiz-new/appwiz.rbuild @@ -1,7 +1,7 @@ - + . 0x600 @@ -19,4 +19,5 @@ appwiz.c createlink.c appwiz.rc + appwiz.spec diff --git a/reactos/dll/cpl/appwiz-new/appwiz.spec b/reactos/dll/cpl/appwiz-new/appwiz.spec new file mode 100644 index 00000000000..4c13b14238e --- /dev/null +++ b/reactos/dll/cpl/appwiz-new/appwiz.spec @@ -0,0 +1,4 @@ +@ stdcall CPlApplet(ptr long ptr ptr) +#@ stdcall NewLinkHere(ptr long ptr ptr) +#@ stdcall NewLinkHereA(ptr long ptr ptr) +#@ stdcall NewLinkHereW(ptr long ptr ptr) \ No newline at end of file From 4aae8ef4d56d6cb9e29050e6d1043a3ecf3c8fd1 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 09:44:39 +0000 Subject: [PATCH 295/388] Minor 64bit fixes. svn path=/branches/ros-amd64-bringup/; revision=36454 --- reactos/dll/cpl/console/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/cpl/console/console.c b/reactos/dll/cpl/console/console.c index 801a0d35c3c..638c79284a9 100644 --- a/reactos/dll/cpl/console/console.c +++ b/reactos/dll/cpl/console/console.c @@ -12,7 +12,7 @@ #define WM_SETCONSOLE (WM_USER+10) -LONG APIENTRY InitApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam); +LONG APIENTRY InitApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam); INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK FontProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK LayoutProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); From 3f5eb93b2347e32b6e3c3277c0908b845e6feb51 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 09:48:04 +0000 Subject: [PATCH 296/388] Convert to spec. svn path=/branches/ros-amd64-bringup/; revision=36455 --- reactos/dll/cpl/desk/desk.def | 8 -------- reactos/dll/cpl/desk/desk.rbuild | 3 ++- reactos/dll/cpl/desk/desk.spec | 3 +++ 3 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 reactos/dll/cpl/desk/desk.def create mode 100644 reactos/dll/cpl/desk/desk.spec diff --git a/reactos/dll/cpl/desk/desk.def b/reactos/dll/cpl/desk/desk.def deleted file mode 100644 index 768565ec057..00000000000 --- a/reactos/dll/cpl/desk/desk.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY desk.cpl - -EXPORTS -CPlApplet@16 -DisplayClassInstaller@12 -DisplaySaveSettings@8 - -; EOF diff --git a/reactos/dll/cpl/desk/desk.rbuild b/reactos/dll/cpl/desk/desk.rbuild index 4fab693ed21..3e83899ae56 100644 --- a/reactos/dll/cpl/desk/desk.rbuild +++ b/reactos/dll/cpl/desk/desk.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -34,4 +34,5 @@ monslctl.c general.c desk.rc + desk.spec diff --git a/reactos/dll/cpl/desk/desk.spec b/reactos/dll/cpl/desk/desk.spec new file mode 100644 index 00000000000..ecbb6a51e9b --- /dev/null +++ b/reactos/dll/cpl/desk/desk.spec @@ -0,0 +1,3 @@ +@ stdcall CPlApplet(ptr long ptr ptr) +@ stdcall DisplayClassInstaller(ptr ptr ptr) +@ stdcall DisplaySaveSettings(ptr ptr) From 7bb3cd360e31d4ac8d308af2777c220508ae86c5 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 09:49:25 +0000 Subject: [PATCH 297/388] Convert to spec. svn path=/branches/ros-amd64-bringup/; revision=36456 --- reactos/dll/cpl/input/input.def | 6 ------ reactos/dll/cpl/input/input.rbuild | 3 ++- reactos/dll/cpl/input/input.spec | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 reactos/dll/cpl/input/input.def create mode 100644 reactos/dll/cpl/input/input.spec diff --git a/reactos/dll/cpl/input/input.def b/reactos/dll/cpl/input/input.def deleted file mode 100644 index 6a6654b3a9f..00000000000 --- a/reactos/dll/cpl/input/input.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY input.dll - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/input/input.rbuild b/reactos/dll/cpl/input/input.rbuild index 2e28fdc6a90..f90250b7aba 100644 --- a/reactos/dll/cpl/input/input.rbuild +++ b/reactos/dll/cpl/input/input.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -16,4 +16,5 @@ add.c changekeyseq.c input.rc + input.spec diff --git a/reactos/dll/cpl/input/input.spec b/reactos/dll/cpl/input/input.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/input/input.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From 3a756711d4a1a9df71ce84caf4656414fac6276b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 09:51:33 +0000 Subject: [PATCH 298/388] Convert to spec. Use tabs in rbuild file. svn path=/branches/ros-amd64-bringup/; revision=36457 --- reactos/dll/cpl/intl/intl.def | 6 ---- reactos/dll/cpl/intl/intl.rbuild | 47 ++++++++++++++++---------------- reactos/dll/cpl/intl/intl.spec | 1 + 3 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 reactos/dll/cpl/intl/intl.def create mode 100644 reactos/dll/cpl/intl/intl.spec diff --git a/reactos/dll/cpl/intl/intl.def b/reactos/dll/cpl/intl/intl.def deleted file mode 100644 index 6282d722bc3..00000000000 --- a/reactos/dll/cpl/intl/intl.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY intl.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/intl/intl.rbuild b/reactos/dll/cpl/intl/intl.rbuild index e25acc8c93e..fbd695b7464 100644 --- a/reactos/dll/cpl/intl/intl.rbuild +++ b/reactos/dll/cpl/intl/intl.rbuild @@ -1,27 +1,28 @@ - - . - 0x600 - 0x600 - 0x609 - kernel32 - user32 - comctl32 - advapi32 - setupapi - shell32 - currency.c - date.c - generalp.c - intl.c - inplocale.c - numbers.c - time.c - misc.c - languages.c - advanced.c - sort.c - intl.rc + + . + 0x600 + 0x600 + 0x609 + kernel32 + user32 + comctl32 + advapi32 + setupapi + shell32 + currency.c + date.c + generalp.c + intl.c + inplocale.c + numbers.c + time.c + misc.c + languages.c + advanced.c + sort.c + intl.rc + intl.spec diff --git a/reactos/dll/cpl/intl/intl.spec b/reactos/dll/cpl/intl/intl.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/intl/intl.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From cadf2f6abb8a9afb80f25feb27bd05d02a1d6eea Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:05:05 +0000 Subject: [PATCH 299/388] Convert to spec. Sprinkle IntToPtr all over mouse.c svn path=/branches/ros-amd64-bringup/; revision=36458 --- reactos/dll/cpl/main/main.def | 6 ------ reactos/dll/cpl/main/main.rbuild | 3 ++- reactos/dll/cpl/main/main.spec | 1 + reactos/dll/cpl/main/mouse.c | 24 ++++++++++++------------ 4 files changed, 15 insertions(+), 19 deletions(-) delete mode 100644 reactos/dll/cpl/main/main.def create mode 100644 reactos/dll/cpl/main/main.spec diff --git a/reactos/dll/cpl/main/main.def b/reactos/dll/cpl/main/main.def deleted file mode 100644 index bcdd1dd2402..00000000000 --- a/reactos/dll/cpl/main/main.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY main.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/main/main.rbuild b/reactos/dll/cpl/main/main.rbuild index 6867590fc24..b48a6b6c891 100644 --- a/reactos/dll/cpl/main/main.rbuild +++ b/reactos/dll/cpl/main/main.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -17,4 +17,5 @@ main.c mouse.c main.rc + main.spec diff --git a/reactos/dll/cpl/main/main.spec b/reactos/dll/cpl/main/main.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/main/main.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) diff --git a/reactos/dll/cpl/main/mouse.c b/reactos/dll/cpl/main/mouse.c index 424c7ce94d2..8efec21fe87 100644 --- a/reactos/dll/cpl/main/mouse.c +++ b/reactos/dll/cpl/main/mouse.c @@ -1260,7 +1260,7 @@ PointerProc(IN HWND hwndDlg, //#if (WINVER >= 0x0500) if (pPointerData->bOrigDropShadow != pPointerData->bDropShadow) { - SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + SystemParametersInfo(SPI_SETDROPSHADOW, 0, IntToPtr(pPointerData->bDropShadow), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); pPointerData->bOrigDropShadow = pPointerData->bDropShadow; } //#endif @@ -1269,7 +1269,7 @@ PointerProc(IN HWND hwndDlg, else if (lppsn->hdr.code == PSN_RESET) { //#if (WINVER >= 0x0500) - SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bOrigDropShadow, 0); + SystemParametersInfo(SPI_SETDROPSHADOW, 0, IntToPtr(pPointerData->bOrigDropShadow), 0); //#endif } break; @@ -1368,7 +1368,7 @@ PointerProc(IN HWND hwndDlg, SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); } //#if (WINVER >= 0x0500) - SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, 0); + SystemParametersInfo(SPI_SETDROPSHADOW, 0, IntToPtr(pPointerData->bDropShadow), 0); //#endif PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; @@ -1552,7 +1552,7 @@ OptionProc(IN HWND hwndDlg, pOptionData->bMouseVanish = TRUE; SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); } - SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)pOptionData->bMouseVanish, 0); + SystemParametersInfo(SPI_SETMOUSEVANISH, 0, IntToPtr(pOptionData->bMouseVanish), 0); break; case IDC_CHECK_SHOW_POINTER: @@ -1566,7 +1566,7 @@ OptionProc(IN HWND hwndDlg, pOptionData->bMouseSonar = TRUE; SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); } - SystemParametersInfo(SPI_SETMOUSESONAR, 0, (PVOID)pOptionData->bMouseSonar, 0); + SystemParametersInfo(SPI_SETMOUSESONAR, 0, IntToPtr(pOptionData->bMouseSonar), 0); break; } @@ -1580,7 +1580,7 @@ OptionProc(IN HWND hwndDlg, /* Set mouse speed */ if (pOptionData->ulOrigMouseSpeed != pOptionData->ulMouseSpeed) { - SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSpeed, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + SystemParametersInfo(SPI_SETMOUSESPEED, 0, IntToPtr(pOptionData->ulMouseSpeed), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); pOptionData->ulOrigMouseSpeed = pOptionData->ulMouseSpeed; } @@ -1610,14 +1610,14 @@ OptionProc(IN HWND hwndDlg, /* hide pointer while typing */ if (pOptionData->bOrigMouseVanish != pOptionData->bMouseVanish) { - SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)pOptionData->bMouseVanish, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + SystemParametersInfo(SPI_SETMOUSEVANISH, 0, IntToPtr(pOptionData->bMouseVanish), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); pOptionData->bOrigMouseVanish = pOptionData->bMouseVanish; } /* show pointer with Ctrl-Key */ if (pOptionData->bOrigMouseSonar != pOptionData->bMouseSonar) { - SystemParametersInfo(SPI_SETMOUSESONAR, 0, (PVOID)pOptionData->bMouseSonar, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + SystemParametersInfo(SPI_SETMOUSESONAR, 0, IntToPtr(pOptionData->bMouseSonar), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); pOptionData->bOrigMouseSonar = pOptionData->bMouseSonar; } return TRUE; @@ -1625,12 +1625,12 @@ OptionProc(IN HWND hwndDlg, else if (lppsn->hdr.code == PSN_RESET) { /* Set the original mouse speed */ - SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulOrigMouseSpeed, 0); + SystemParametersInfo(SPI_SETMOUSESPEED, 0, IntToPtr(pOptionData->ulOrigMouseSpeed), 0); SystemParametersInfo(SPI_SETMOUSE, 0, &pOptionData->OrigMouseAccel, 0); SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, (UINT)pOptionData->bOrigSnapToDefaultButton, 0, 0); SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uOrigMouseTrails, 0, 0); - SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)pOptionData->bOrigMouseVanish, 0); - SystemParametersInfo(SPI_SETMOUSESONAR, 0, (PVOID)pOptionData->bOrigMouseSonar, 0); + SystemParametersInfo(SPI_SETMOUSEVANISH, 0, IntToPtr(pOptionData->bOrigMouseVanish), 0); + SystemParametersInfo(SPI_SETMOUSESONAR, 0,IntToPtr(pOptionData->bOrigMouseSonar), 0); } break; @@ -1647,7 +1647,7 @@ OptionProc(IN HWND hwndDlg, case TB_BOTTOM: case TB_ENDTRACK: pOptionData->ulMouseSpeed = (ULONG)SendDlgItemMessage(hwndDlg, IDC_SLIDER_MOUSE_SPEED, TBM_GETPOS, 0, 0) + 1; - SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSpeed, SPIF_SENDCHANGE); + SystemParametersInfo(SPI_SETMOUSESPEED, 0, IntToPtr(pOptionData->ulMouseSpeed), SPIF_SENDCHANGE); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; #if 0 From a41608c1c6aba97e997ee901ccaf3204a9dccd07 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:18:20 +0000 Subject: [PATCH 300/388] Minor 64bit fixes. svn path=/branches/ros-amd64-bringup/; revision=36460 --- reactos/dll/cpl/mmsys/audio.c | 2 +- reactos/dll/cpl/mmsys/volume.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/dll/cpl/mmsys/audio.c b/reactos/dll/cpl/mmsys/audio.c index 5dd7bb07e7f..778d3dc5d4c 100644 --- a/reactos/dll/cpl/mmsys/audio.c +++ b/reactos/dll/cpl/mmsys/audio.c @@ -107,7 +107,7 @@ GetDevNum(HWND hControl, DWORD Id) if (DevNum == (UINT) CB_ERR) return 0; - if (mixerGetID((HMIXEROBJ) DevNum, &DevNum, Id) != MMSYSERR_NOERROR) + if (mixerGetID((HMIXEROBJ)IntToPtr(DevNum), &DevNum, Id) != MMSYSERR_NOERROR) return 0; return DevNum; diff --git a/reactos/dll/cpl/mmsys/volume.c b/reactos/dll/cpl/mmsys/volume.c index e0db2673c3e..7017e9983a3 100644 --- a/reactos/dll/cpl/mmsys/volume.c +++ b/reactos/dll/cpl/mmsys/volume.c @@ -237,14 +237,14 @@ InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData) return; } - if (mixerOpen(&pGlobalData->hMixer, 0, (DWORD)hwndDlg, 0, MIXER_OBJECTF_MIXER | CALLBACK_WINDOW) != MMSYSERR_NOERROR) + if (mixerOpen(&pGlobalData->hMixer, 0, PtrToUlong(hwndDlg), 0, MIXER_OBJECTF_MIXER | CALLBACK_WINDOW) != MMSYSERR_NOERROR) { MessageBox(hwndDlg, _T("Cannot open mixer"), NULL, MB_OK); return; } ZeroMemory(&mxc, sizeof(MIXERCAPS)); - if (mixerGetDevCaps((UINT)pGlobalData->hMixer, &mxc, sizeof(MIXERCAPS)) != MMSYSERR_NOERROR) + if (mixerGetDevCaps(PtrToUint(pGlobalData->hMixer), &mxc, sizeof(MIXERCAPS)) != MMSYSERR_NOERROR) { MessageBox(hwndDlg, _T("mixerGetDevCaps failed"), NULL, MB_OK); return; @@ -278,7 +278,7 @@ InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData) VOID LaunchSoundControl(HWND hwndDlg) { - if ((INT)ShellExecuteW(NULL, L"open", L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL) > 32) + if ((INT_PTR)ShellExecuteW(NULL, L"open", L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL) > 32) return; MessageBox(hwndDlg, _T("Cannot run sndvol32.exe"), NULL, MB_OK); } From 6e56a5e40b7ef7049711d1e3844ef0cc9d0dc773 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:26:21 +0000 Subject: [PATCH 301/388] Convert to spec. svn path=/branches/ros-amd64-bringup/; revision=36461 --- reactos/dll/cpl/ncpa/ncpa.def | 6 ------ reactos/dll/cpl/ncpa/ncpa.rbuild | 3 ++- reactos/dll/cpl/ncpa/ncpa.spec | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 reactos/dll/cpl/ncpa/ncpa.def create mode 100644 reactos/dll/cpl/ncpa/ncpa.spec diff --git a/reactos/dll/cpl/ncpa/ncpa.def b/reactos/dll/cpl/ncpa/ncpa.def deleted file mode 100644 index e278ea10114..00000000000 --- a/reactos/dll/cpl/ncpa/ncpa.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY ncpa.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/ncpa/ncpa.rbuild b/reactos/dll/cpl/ncpa/ncpa.rbuild index 7a49ac1bc88..26eead56dda 100644 --- a/reactos/dll/cpl/ncpa/ncpa.rbuild +++ b/reactos/dll/cpl/ncpa/ncpa.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x600 @@ -16,4 +16,5 @@ ncpa.c tcpip_properties.c ncpa.rc + ncpa.spec diff --git a/reactos/dll/cpl/ncpa/ncpa.spec b/reactos/dll/cpl/ncpa/ncpa.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/ncpa/ncpa.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From d4c08202f8777f92be64ec93746eaa3684e65c5c Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:28:59 +0000 Subject: [PATCH 302/388] Convert to spec. svn path=/branches/ros-amd64-bringup/; revision=36462 --- reactos/dll/cpl/odbccp32/odbccp32.def | 6 ------ reactos/dll/cpl/odbccp32/odbccp32.rbuild | 3 ++- reactos/dll/cpl/odbccp32/odbccp32.spec | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 reactos/dll/cpl/odbccp32/odbccp32.def create mode 100644 reactos/dll/cpl/odbccp32/odbccp32.spec diff --git a/reactos/dll/cpl/odbccp32/odbccp32.def b/reactos/dll/cpl/odbccp32/odbccp32.def deleted file mode 100644 index b91c0a78871..00000000000 --- a/reactos/dll/cpl/odbccp32/odbccp32.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY odbccp32.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/odbccp32/odbccp32.rbuild b/reactos/dll/cpl/odbccp32/odbccp32.rbuild index 925c1587b64..0c6933beec2 100644 --- a/reactos/dll/cpl/odbccp32/odbccp32.rbuild +++ b/reactos/dll/cpl/odbccp32/odbccp32.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -10,4 +10,5 @@ comctl32 odbccp32.c odbccp32.rc + odbccp32.spec diff --git a/reactos/dll/cpl/odbccp32/odbccp32.spec b/reactos/dll/cpl/odbccp32/odbccp32.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/odbccp32/odbccp32.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From fe87d3cecc764e07a401e3a80902aba7bd0de893 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:33:46 +0000 Subject: [PATCH 303/388] Convert to spec. svn path=/branches/ros-amd64-bringup/; revision=36463 --- reactos/dll/cpl/joy/joy.def | 6 ------ reactos/dll/cpl/joy/joy.rbuild | 3 ++- reactos/dll/cpl/joy/joy.spec | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 reactos/dll/cpl/joy/joy.def create mode 100644 reactos/dll/cpl/joy/joy.spec diff --git a/reactos/dll/cpl/joy/joy.def b/reactos/dll/cpl/joy/joy.def deleted file mode 100644 index b09a6f73dd4..00000000000 --- a/reactos/dll/cpl/joy/joy.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY joy.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/joy/joy.rbuild b/reactos/dll/cpl/joy/joy.rbuild index 8acde89a882..252d375d0aa 100644 --- a/reactos/dll/cpl/joy/joy.rbuild +++ b/reactos/dll/cpl/joy/joy.rbuild @@ -1,7 +1,7 @@ - + . 0x600 @@ -15,4 +15,5 @@ shell32 joy.c joy.rc + joy.spec diff --git a/reactos/dll/cpl/joy/joy.spec b/reactos/dll/cpl/joy/joy.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/joy/joy.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From b57f9697832162c87d5164c21207cf73ffea11ef Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:35:36 +0000 Subject: [PATCH 304/388] Minor 64bit fix. svn path=/branches/ros-amd64-bringup/; revision=36464 --- reactos/dll/cpl/access/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/cpl/access/display.c b/reactos/dll/cpl/access/display.c index e2ca3556473..c4b68238764 100644 --- a/reactos/dll/cpl/access/display.c +++ b/reactos/dll/cpl/access/display.c @@ -255,7 +255,7 @@ DisplayPageProc(HWND hwndDlg, SetCaretBlinkTime(pGlobalData->uCaretBlinkTime); SystemParametersInfo(SPI_SETCARETWIDTH, 0, - (PVOID)pGlobalData->uCaretWidth, + IntToPtr(pGlobalData->uCaretWidth), SPIF_UPDATEINIFILE | SPIF_SENDCHANGE /*0*/); SystemParametersInfo(SPI_SETHIGHCONTRAST, sizeof(HIGHCONTRAST), From 2edf4353289597f7280bb395f21034289846604e Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:41:07 +0000 Subject: [PATCH 305/388] Convert to spec. svn path=/branches/ros-amd64-bringup/; revision=36465 --- reactos/dll/cpl/powercfg/powercfg.def | 6 ------ reactos/dll/cpl/powercfg/powercfg.rbuild | 3 ++- reactos/dll/cpl/powercfg/powercfg.spec | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 reactos/dll/cpl/powercfg/powercfg.def create mode 100644 reactos/dll/cpl/powercfg/powercfg.spec diff --git a/reactos/dll/cpl/powercfg/powercfg.def b/reactos/dll/cpl/powercfg/powercfg.def deleted file mode 100644 index 5c8f7bf4520..00000000000 --- a/reactos/dll/cpl/powercfg/powercfg.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY powercfg.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/powercfg/powercfg.rbuild b/reactos/dll/cpl/powercfg/powercfg.rbuild index a21c05da971..4d46bdda72c 100644 --- a/reactos/dll/cpl/powercfg/powercfg.rbuild +++ b/reactos/dll/cpl/powercfg/powercfg.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine 0x600 @@ -18,4 +18,5 @@ advanced.c hibernate.c powercfg.rc + powercfg.spec diff --git a/reactos/dll/cpl/powercfg/powercfg.spec b/reactos/dll/cpl/powercfg/powercfg.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/powercfg/powercfg.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From 629e99b314ce9f7814815be72e136827dddb5bf7 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:41:39 +0000 Subject: [PATCH 306/388] Convert to spec. Minor 64bit fixes. svn path=/branches/ros-amd64-bringup/; revision=36466 --- reactos/dll/cpl/sysdm/hardware.c | 2 +- reactos/dll/cpl/sysdm/startrec.c | 6 +++--- reactos/dll/cpl/sysdm/sysdm.def | 6 ------ reactos/dll/cpl/sysdm/sysdm.rbuild | 3 ++- reactos/dll/cpl/sysdm/sysdm.spec | 1 + 5 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 reactos/dll/cpl/sysdm/sysdm.def create mode 100644 reactos/dll/cpl/sysdm/sysdm.spec diff --git a/reactos/dll/cpl/sysdm/hardware.c b/reactos/dll/cpl/sysdm/hardware.c index 134b3682d88..23f1d2b0801 100644 --- a/reactos/dll/cpl/sysdm/hardware.c +++ b/reactos/dll/cpl/sysdm/hardware.c @@ -17,7 +17,7 @@ LaunchDeviceManager(HWND hWndParent) { /* hack for ROS to start our devmgmt until we have mmc */ #ifdef __REACTOS__ - return ((INT)ShellExecuteW(NULL, L"open", L"devmgmt.exe", NULL, NULL, SW_SHOWNORMAL) > 32); + return ((INT_PTR)ShellExecuteW(NULL, L"open", L"devmgmt.exe", NULL, NULL, SW_SHOWNORMAL) > 32); #else HMODULE hDll; PDEVMGREXEC DevMgrExec; diff --git a/reactos/dll/cpl/sysdm/startrec.c b/reactos/dll/cpl/sysdm/startrec.c index 8c1dcf89825..b24b4f8ca98 100644 --- a/reactos/dll/cpl/sysdm/startrec.c +++ b/reactos/dll/cpl/sysdm/startrec.c @@ -437,7 +437,7 @@ DeleteBootRecords(HWND hwndDlg) for (index = 0; index szDumpFile, (_tcslen(pStartInfo->szDumpFile) + 1) * sizeof(TCHAR)); } - RegSetValueEx(hKey, _T("CrashDumpEnabled"), 0, REG_DWORD, (LPBYTE)pStartInfo->dwCrashDumpEnabled, sizeof(pStartInfo->dwCrashDumpEnabled)); + RegSetValueEx(hKey, _T("CrashDumpEnabled"), 0, REG_DWORD, (LPBYTE)(DWORD_PTR)pStartInfo->dwCrashDumpEnabled, sizeof(pStartInfo->dwCrashDumpEnabled)); RegCloseKey(hKey); } @@ -741,7 +741,7 @@ StartRecDlgProc(HWND hwndDlg, pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)lResult, (LPARAM)0); - if ((INT)pRecord != CB_ERR) + if ((INT_PTR)pRecord != CB_ERR) { if (pStartInfo->iFreeLdrIni == 1) // FreeLdrIni style { diff --git a/reactos/dll/cpl/sysdm/sysdm.def b/reactos/dll/cpl/sysdm/sysdm.def deleted file mode 100644 index f4110df42fa..00000000000 --- a/reactos/dll/cpl/sysdm/sysdm.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY sysdm.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/sysdm/sysdm.rbuild b/reactos/dll/cpl/sysdm/sysdm.rbuild index 2e4e351fd4a..dd1761330eb 100644 --- a/reactos/dll/cpl/sysdm/sysdm.rbuild +++ b/reactos/dll/cpl/sysdm/sysdm.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -29,5 +29,6 @@ userprofile.c virtmem.c sysdm.rc + sysdm.spec precomp.h diff --git a/reactos/dll/cpl/sysdm/sysdm.spec b/reactos/dll/cpl/sysdm/sysdm.spec new file mode 100644 index 00000000000..9c55a90e177 --- /dev/null +++ b/reactos/dll/cpl/sysdm/sysdm.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) \ No newline at end of file From 5ea1818ff49101a82b3ddc9820b41383118015c7 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:45:05 +0000 Subject: [PATCH 307/388] Convert to spec. two for the price of one. svn path=/branches/ros-amd64-bringup/; revision=36467 --- reactos/dll/cpl/telephon/telephon.def | 6 ------ reactos/dll/cpl/telephon/telephon.rbuild | 3 ++- reactos/dll/cpl/telephon/telephon.spec | 1 + reactos/dll/cpl/timedate/timedate.def | 6 ------ reactos/dll/cpl/timedate/timedate.rbuild | 4 +++- reactos/dll/cpl/timedate/timedate.spec | 1 + 6 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 reactos/dll/cpl/telephon/telephon.def create mode 100644 reactos/dll/cpl/telephon/telephon.spec delete mode 100644 reactos/dll/cpl/timedate/timedate.def create mode 100644 reactos/dll/cpl/timedate/timedate.spec diff --git a/reactos/dll/cpl/telephon/telephon.def b/reactos/dll/cpl/telephon/telephon.def deleted file mode 100644 index 91f33d26826..00000000000 --- a/reactos/dll/cpl/telephon/telephon.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY telephon.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/telephon/telephon.rbuild b/reactos/dll/cpl/telephon/telephon.rbuild index 49e8e385d78..e9634aedd95 100644 --- a/reactos/dll/cpl/telephon/telephon.rbuild +++ b/reactos/dll/cpl/telephon/telephon.rbuild @@ -1,7 +1,7 @@ - + . 0x600 @@ -15,4 +15,5 @@ shell32 telephon.c telephon.rc + telephon.spec diff --git a/reactos/dll/cpl/telephon/telephon.spec b/reactos/dll/cpl/telephon/telephon.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/telephon/telephon.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) diff --git a/reactos/dll/cpl/timedate/timedate.def b/reactos/dll/cpl/timedate/timedate.def deleted file mode 100644 index 8d67834a2ec..00000000000 --- a/reactos/dll/cpl/timedate/timedate.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY timedate.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/timedate/timedate.rbuild b/reactos/dll/cpl/timedate/timedate.rbuild index d90012a0b30..e78c8599dab 100644 --- a/reactos/dll/cpl/timedate/timedate.rbuild +++ b/reactos/dll/cpl/timedate/timedate.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -20,4 +20,6 @@ timedate.c timezone.c timedate.rc + timedate.spec + diff --git a/reactos/dll/cpl/timedate/timedate.spec b/reactos/dll/cpl/timedate/timedate.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/timedate/timedate.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From 274b9d1f57de83e0fbe8ddedb332684c1ba6e12c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 24 Sep 2008 10:45:58 +0000 Subject: [PATCH 308/388] Add MemoryBarrier definition for amd64 svn path=/branches/ros-amd64-bringup/; revision=36468 --- reactos/include/psdk/winnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 9e49480cb83..996489612d9 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -4703,7 +4703,7 @@ MemoryBarrier(VOID) __asm__ __volatile__("xchgl %%eax, %[Barrier]" : : [Barrier] "m" (Barrier) : "memory"); } #elif defined (_M_AMD64) -#define MemoryBarrier() +#define MemoryBarrier __faststorefence #elif defined(_M_PPC) #define MemoryBarrier() #elif defined(_M_ARM) From bfd898eae607f77a09fee42fbd7283c0288e26b5 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:50:50 +0000 Subject: [PATCH 309/388] Fix NetLocalGroupGetMembers prototype. svn path=/branches/ros-amd64-bringup/; revision=36469 --- reactos/include/psdk/lmaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/psdk/lmaccess.h b/reactos/include/psdk/lmaccess.h index 877bac2f326..c27e8ea93ea 100644 --- a/reactos/include/psdk/lmaccess.h +++ b/reactos/include/psdk/lmaccess.h @@ -594,7 +594,7 @@ NET_API_STATUS WINAPI NetLocalGroupSetInfo(LPCWSTR,LPCWSTR,DWORD,PBYTE,PDWORD); NET_API_STATUS WINAPI NetLocalGroupDel(LPCWSTR,LPCWSTR); NET_API_STATUS WINAPI NetLocalGroupDelMember(LPCWSTR,LPCWSTR,PSID); NET_API_STATUS WINAPI NetLocalGroupGetMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE*,DWORD, -PDWORD,PDWORD,PDWORD); +PDWORD,PDWORD,PDWORD_PTR); NET_API_STATUS WINAPI NetLocalGroupSetMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); NET_API_STATUS WINAPI NetLocalGroupAddMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); NET_API_STATUS WINAPI NetLocalGroupDelMembers(LPCWSTR,LPCWSTR,DWORD,PBYTE,DWORD); From bb39afaeaf0efee133ad351b3056e921e9493438 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 10:52:32 +0000 Subject: [PATCH 310/388] Convert to spec. Minor 64bit fixes. svn path=/branches/ros-amd64-bringup/; revision=36470 --- reactos/dll/cpl/usrmgr/groupprops.c | 4 ++-- reactos/dll/cpl/usrmgr/usrmgr.def | 6 ------ reactos/dll/cpl/usrmgr/usrmgr.rbuild | 3 ++- reactos/dll/cpl/usrmgr/usrmgr.spec | 1 + 4 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 reactos/dll/cpl/usrmgr/usrmgr.def create mode 100644 reactos/dll/cpl/usrmgr/usrmgr.spec diff --git a/reactos/dll/cpl/usrmgr/groupprops.c b/reactos/dll/cpl/usrmgr/groupprops.c index ac30a280c00..8fa86c79c63 100644 --- a/reactos/dll/cpl/usrmgr/groupprops.c +++ b/reactos/dll/cpl/usrmgr/groupprops.c @@ -270,9 +270,9 @@ AddUsersToGroup(HWND hwndDlg, // DebugPrintf(_T("Removed all users from the list!")); /* Set group members */ - NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1, (LPBYTE*)&membersInfo, + NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1, (LPBYTE*)(DWORD_PTR)&membersInfo, MAX_PREFERRED_LENGTH, &dwRead, &dwTotal, - &resumeHandle); + (PDWORD_PTR)&resumeHandle); for (i = 0; i < dwRead; i++) { diff --git a/reactos/dll/cpl/usrmgr/usrmgr.def b/reactos/dll/cpl/usrmgr/usrmgr.def deleted file mode 100644 index bf450f18180..00000000000 --- a/reactos/dll/cpl/usrmgr/usrmgr.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY usrmgr.cpl - -EXPORTS -CPlApplet@16 - -; EOF diff --git a/reactos/dll/cpl/usrmgr/usrmgr.rbuild b/reactos/dll/cpl/usrmgr/usrmgr.rbuild index 54783ddcaab..f355cfd844b 100644 --- a/reactos/dll/cpl/usrmgr/usrmgr.rbuild +++ b/reactos/dll/cpl/usrmgr/usrmgr.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -21,4 +21,5 @@ users.c usrmgr.c usrmgr.rc + usrmgr.spec diff --git a/reactos/dll/cpl/usrmgr/usrmgr.spec b/reactos/dll/cpl/usrmgr/usrmgr.spec new file mode 100644 index 00000000000..9e552162fb0 --- /dev/null +++ b/reactos/dll/cpl/usrmgr/usrmgr.spec @@ -0,0 +1 @@ +@ stdcall CPlApplet(ptr long ptr ptr) From 3686c8090fc982decfcb7db01e098b6f024b429a Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 11:38:39 +0000 Subject: [PATCH 311/388] remove unneeded "fixes" svn path=/branches/ros-amd64-bringup/; revision=36473 --- reactos/dll/cpl/usrmgr/groupprops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/cpl/usrmgr/groupprops.c b/reactos/dll/cpl/usrmgr/groupprops.c index 8fa86c79c63..ac30a280c00 100644 --- a/reactos/dll/cpl/usrmgr/groupprops.c +++ b/reactos/dll/cpl/usrmgr/groupprops.c @@ -270,9 +270,9 @@ AddUsersToGroup(HWND hwndDlg, // DebugPrintf(_T("Removed all users from the list!")); /* Set group members */ - NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1, (LPBYTE*)(DWORD_PTR)&membersInfo, + NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1, (LPBYTE*)&membersInfo, MAX_PREFERRED_LENGTH, &dwRead, &dwTotal, - (PDWORD_PTR)&resumeHandle); + &resumeHandle); for (i = 0; i < dwRead; i++) { From a870b6d07fa69208fe5b469a33be377235f47004 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 12:01:07 +0000 Subject: [PATCH 312/388] Fix ReadProcessMemory and Toolhelp32ReadProcessMemory prototypes. svn path=/branches/ros-amd64-bringup/; revision=36474 --- reactos/include/psdk/tlhelp32.h | 2 +- reactos/include/psdk/winbase.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/psdk/tlhelp32.h b/reactos/include/psdk/tlhelp32.h index 99540d4665f..9b697a73b66 100644 --- a/reactos/include/psdk/tlhelp32.h +++ b/reactos/include/psdk/tlhelp32.h @@ -119,7 +119,7 @@ BOOL WINAPI Process32Next(HANDLE,LPPROCESSENTRY32); BOOL WINAPI Process32NextW(HANDLE,LPPROCESSENTRY32W); BOOL WINAPI Thread32First(HANDLE,LPTHREADENTRY32); BOOL WINAPI Thread32Next(HANDLE,LPTHREADENTRY32); -BOOL WINAPI Toolhelp32ReadProcessMemory(DWORD,LPCVOID,LPVOID,DWORD,LPDWORD); +BOOL WINAPI Toolhelp32ReadProcessMemory(DWORD,LPCVOID,LPVOID,SIZE_T,SIZE_T*); HANDLE WINAPI CreateToolhelp32Snapshot(DWORD,DWORD); #ifdef UNICODE #define LPMODULEENTRY32 LPMODULEENTRY32W diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index 3b129ce1454..281a213b783 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -1974,7 +1974,7 @@ BOOL WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,PVOID,DWORD,DWORD *,DWORD *); BOOL WINAPI ReadFile(HANDLE,PVOID,DWORD,PDWORD,LPOVERLAPPED); BOOL WINAPI ReadFileEx(HANDLE,PVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE); BOOL WINAPI ReadFileScatter(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED); -BOOL WINAPI ReadProcessMemory(HANDLE,PCVOID,PVOID,DWORD,PDWORD); +BOOL WINAPI ReadProcessMemory(HANDLE,PCVOID,PVOID,SIZE_T,SIZE_T*); #if (_WIN32_WINNT >= 0x0600) VOID WINAPI RecoveryFinished(BOOL); HRESULT WINAPI RecoveryInProgress(OUT PBOOL); From 9d500537c2d6eef87273ef8a5ec6b09307c48884 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 12:03:27 +0000 Subject: [PATCH 313/388] - Fix ReadProcessMemory and Toolhelp32ReadProcessMemory definitions. - Numerous 64bit fixes. - Remove useless cast. - Remove Fls API exports as per trunk. svn path=/branches/ros-amd64-bringup/; revision=36475 --- reactos/dll/win32/kernel32/except/except.c | 16 +++++--------- reactos/dll/win32/kernel32/kernel32.spec | 8 +++---- reactos/dll/win32/kernel32/mem/procmem.c | 4 ++-- reactos/dll/win32/kernel32/mem/virtual.c | 2 +- reactos/dll/win32/kernel32/misc/toolhelp.c | 22 ++++++++++---------- reactos/dll/win32/kernel32/misc/utils.c | 2 +- reactos/dll/win32/kernel32/process/procsup.c | 2 +- 7 files changed, 25 insertions(+), 31 deletions(-) diff --git a/reactos/dll/win32/kernel32/except/except.c b/reactos/dll/win32/kernel32/except/except.c index 7cd8a3e6f25..b61648dd150 100644 --- a/reactos/dll/win32/kernel32/except/except.c +++ b/reactos/dll/win32/kernel32/except/except.c @@ -124,10 +124,11 @@ _module_name_from_addr(const void* addr, void **module_start_addr, return psz; } -#ifdef _M_IX86 + static VOID _dump_context(PCONTEXT pc) { +#ifdef _M_IX86 /* * Print out the CPU registers */ @@ -138,10 +139,7 @@ _dump_context(PCONTEXT pc) DbgPrint("EDX: %.8x EBP: %.8x ESI: %.8x ESP: %.8x\n", pc->Edx, pc->Ebp, pc->Esi, pc->Esp); DbgPrint("EDI: %.8x EFLAGS: %.8x\n", pc->Edi, pc->EFlags); -} #elif defined(_M_AMD64) -_dump_context(PCONTEXT pc) -{ DbgPrint("CS:EIP %x:%I64x\n", pc->SegCs&0xffff, pc->Rip ); DbgPrint("DS %x ES %x FS %x GS %x\n", pc->SegDs&0xffff, pc->SegEs&0xffff, pc->SegFs&0xffff, pc->SegGs&0xfff); @@ -150,14 +148,10 @@ _dump_context(PCONTEXT pc) DbgPrint("R8: %I64x R9: %I64x R10: %I64x R11: %I64x\n", pc->R8, pc->R9, pc->R10, pc->R11); DbgPrint("R12: %I64x R13: %I64x R14: %I64x R15: %I64x\n", pc->R12, pc->R13, pc->R14, pc->R15); DbgPrint("EFLAGS: %.8x\n", pc->EFlags); -} #else #warning Unknown architecture -static VOID -_dump_context(PCONTEXT pc) -{ -} #endif +} static LONG BasepCheckForReadOnlyResource(IN PVOID Ptr) @@ -225,7 +219,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo) LONG RetValue; HANDLE DebugPort = NULL; NTSTATUS ErrCode; - ULONG ErrorParameters[4]; + ULONG_PTR ErrorParameters[4]; ULONG ErrorResponse; if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION && @@ -322,7 +316,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo) /* Save exception code and address */ ErrorParameters[0] = (ULONG)ExceptionInfo->ExceptionRecord->ExceptionCode; - ErrorParameters[1] = (ULONG)ExceptionInfo->ExceptionRecord->ExceptionAddress; + ErrorParameters[1] = (ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress; if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION) { diff --git a/reactos/dll/win32/kernel32/kernel32.spec b/reactos/dll/win32/kernel32/kernel32.spec index a5471da0ecc..81fc6d49703 100644 --- a/reactos/dll/win32/kernel32/kernel32.spec +++ b/reactos/dll/win32/kernel32/kernel32.spec @@ -250,10 +250,10 @@ @ stdcall FindResourceW(long wstr wstr) @ stdcall FindVolumeClose(ptr) @ stdcall FindVolumeMountPointClose(ptr) -@ stdcall FlsAlloc(ptr) -@ stdcall FlsFree(long) -@ stdcall FlsGetValue(long) -@ stdcall FlsSetValue(long ptr) +#@ stdcall FlsAlloc(ptr) +#@ stdcall FlsFree(long) +#@ stdcall FlsGetValue(long) +#@ stdcall FlsSetValue(long ptr) @ stdcall FlushConsoleInputBuffer(long) @ stdcall FlushFileBuffers(long) @ stdcall FlushInstructionCache(long long long) diff --git a/reactos/dll/win32/kernel32/mem/procmem.c b/reactos/dll/win32/kernel32/mem/procmem.c index 630243e0ceb..354804e75c6 100644 --- a/reactos/dll/win32/kernel32/mem/procmem.c +++ b/reactos/dll/win32/kernel32/mem/procmem.c @@ -23,8 +23,8 @@ NTAPI ReadProcessMemory(IN HANDLE hProcess, IN LPCVOID lpBaseAddress, IN LPVOID lpBuffer, - IN DWORD nSize, - OUT LPDWORD lpNumberOfBytesRead) + IN SIZE_T nSize, + OUT SIZE_T* lpNumberOfBytesRead) { NTSTATUS Status; diff --git a/reactos/dll/win32/kernel32/mem/virtual.c b/reactos/dll/win32/kernel32/mem/virtual.c index 6caf2573bad..aa0b6e5607f 100644 --- a/reactos/dll/win32/kernel32/mem/virtual.c +++ b/reactos/dll/win32/kernel32/mem/virtual.c @@ -79,7 +79,7 @@ VirtualFreeEx(IN HANDLE hProcess, /* Free the memory */ Status = NtFreeVirtualMemory(hProcess, (PVOID *)&lpAddress, - (PULONG)&dwSize, + &dwSize, dwFreeType); if (!NT_SUCCESS(Status)) { diff --git a/reactos/dll/win32/kernel32/misc/toolhelp.c b/reactos/dll/win32/kernel32/misc/toolhelp.c index c2773f7e6a4..02cb298fa80 100644 --- a/reactos/dll/win32/kernel32/misc/toolhelp.c +++ b/reactos/dll/win32/kernel32/misc/toolhelp.c @@ -225,8 +225,8 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags, HANDLE hSection; PTH32SNAPSHOT Snapshot; ULONG_PTR DataOffset; - ULONG ViewSize, i; - ULONG nProcesses = 0, nThreads = 0, nHeaps = 0, nModules = 0; + SIZE_T ViewSize; + ULONG i, nProcesses = 0, nThreads = 0, nHeaps = 0, nModules = 0; ULONG RequiredSnapshotSize = sizeof(TH32SNAPSHOT); PRTL_PROCESS_HEAPS hi = NULL; PRTL_PROCESS_MODULES mi = NULL; @@ -670,7 +670,7 @@ Heap32ListFirst(HANDLE hSnapshot, LPHEAPLIST32 lphl) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lphl, sizeof(HEAPLIST32)); @@ -724,7 +724,7 @@ Heap32ListNext(HANDLE hSnapshot, LPHEAPLIST32 lphl) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lphl, sizeof(HEAPLIST32)); @@ -811,7 +811,7 @@ Module32FirstW(HANDLE hSnapshot, LPMODULEENTRY32W lpme) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lpme, sizeof(MODULEENTRY32W)); @@ -898,7 +898,7 @@ Module32NextW(HANDLE hSnapshot, LPMODULEENTRY32W lpme) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lpme, sizeof(MODULEENTRY32W)); @@ -985,7 +985,7 @@ Process32FirstW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lppe, sizeof(PROCESSENTRY32W)); @@ -1074,7 +1074,7 @@ Process32NextW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lppe, sizeof(PROCESSENTRY32W)); @@ -1128,7 +1128,7 @@ Thread32First(HANDLE hSnapshot, LPTHREADENTRY32 lpte) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lpte, sizeof(THREADENTRY32)); @@ -1182,7 +1182,7 @@ Thread32Next(HANDLE hSnapshot, LPTHREADENTRY32 lpte) { PTH32SNAPSHOT Snapshot; LARGE_INTEGER SOffset; - ULONG ViewSize; + SIZE_T ViewSize; NTSTATUS Status; CHECK_PARAM_SIZE(lpte, sizeof(THREADENTRY32)); @@ -1233,7 +1233,7 @@ Thread32Next(HANDLE hSnapshot, LPTHREADENTRY32 lpte) BOOL STDCALL Toolhelp32ReadProcessMemory(DWORD th32ProcessID, LPCVOID lpBaseAddress, - LPVOID lpBuffer, DWORD cbRead, LPDWORD lpNumberOfBytesRead) + LPVOID lpBuffer, SIZE_T cbRead, SIZE_T* lpNumberOfBytesRead) { HANDLE hProcess = OpenProcess(PROCESS_VM_READ, FALSE, th32ProcessID); if(hProcess != NULL) diff --git a/reactos/dll/win32/kernel32/misc/utils.c b/reactos/dll/win32/kernel32/misc/utils.c index dc663f0ff03..49c52e6d1ef 100644 --- a/reactos/dll/win32/kernel32/misc/utils.c +++ b/reactos/dll/win32/kernel32/misc/utils.c @@ -318,7 +318,7 @@ STDCALL BasepFreeStack(HANDLE hProcess, PINITIAL_TEB InitialTeb) { - ULONG Dummy = 0; + SIZE_T Dummy = 0; /* Free the Stack */ NtFreeVirtualMemory(hProcess, diff --git a/reactos/dll/win32/kernel32/process/procsup.c b/reactos/dll/win32/kernel32/process/procsup.c index 4f3c487e460..de69f054b99 100644 --- a/reactos/dll/win32/kernel32/process/procsup.c +++ b/reactos/dll/win32/kernel32/process/procsup.c @@ -288,7 +288,7 @@ BasepDuplicateAndWriteHandle(IN HANDLE ProcessHandle, { NTSTATUS Status; HANDLE DuplicatedHandle; - ULONG Dummy; + SIZE_T Dummy; DPRINT("BasepDuplicateAndWriteHandle. hProcess: %lx, Handle: %lx," "Address: %p\n", ProcessHandle, StandardHandle, Address); From d84724a86e47a54e846a3aeaabb815781105ec5a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 24 Sep 2008 12:21:04 +0000 Subject: [PATCH 314/388] add gdi32.spec taken from wine 1.13 svn path=/branches/ros-amd64-bringup/; revision=36476 --- reactos/dll/win32/gdi32/gdi32.spec | 532 +++++++++++++++++++++++++++++ 1 file changed, 532 insertions(+) create mode 100644 reactos/dll/win32/gdi32/gdi32.spec diff --git a/reactos/dll/win32/gdi32/gdi32.spec b/reactos/dll/win32/gdi32/gdi32.spec new file mode 100644 index 00000000000..99df6d1fc0a --- /dev/null +++ b/reactos/dll/win32/gdi32/gdi32.spec @@ -0,0 +1,532 @@ +# ordinal exports +100 stdcall @(long long str str str) GDI_CallDevInstall16 +101 stdcall @(long str str ptr) GDI_CallExtDeviceModePropSheet16 +102 stdcall @(long ptr str str ptr str long) GDI_CallExtDeviceMode16 +103 stdcall @(long str ptr ptr) GDI_CallAdvancedSetupDialog16 +104 stdcall @(str str long ptr ptr) GDI_CallDeviceCapabilities16 + +@ stdcall AbortDoc(long) +@ stdcall AbortPath(long) +@ stdcall AddFontMemResourceEx(ptr long ptr ptr) +@ stdcall AddFontResourceA(str) +@ stdcall AddFontResourceExA(str long ptr) +@ stdcall AddFontResourceExW(wstr long ptr) +@ stub AddFontResourceTracking +@ stdcall AddFontResourceW(wstr) +@ stdcall AngleArc(long long long long long long) +@ stdcall AnimatePalette(long long long ptr) +# @ stub AnyLinkedFonts +@ stdcall Arc(long long long long long long long long long) +@ stdcall ArcTo(long long long long long long long long long) +@ stdcall BeginPath(long) +@ stdcall BitBlt(long long long long long long long long long) +@ stub ByeByeGDI +@ stdcall CancelDC(long) +@ stub CheckColorsInGamut +@ stdcall ChoosePixelFormat(long ptr) +@ stdcall Chord(long long long long long long long long long) +# @ stub ClearBitmapAttributes +# @ stub ClearBrushAttributes +@ stdcall CloseEnhMetaFile(long) +@ stdcall CloseFigure(long) +@ stdcall CloseMetaFile(long) +@ stub ColorCorrectPalette +@ stub ColorMatchToTarget +@ stdcall CombineRgn(long long long long) +@ stdcall CombineTransform(ptr ptr ptr) +@ stdcall CopyEnhMetaFileA(long str) +@ stdcall CopyEnhMetaFileW(long wstr) +@ stdcall CopyMetaFileA(long str) +@ stdcall CopyMetaFileW(long wstr) +@ stdcall CreateBitmap(long long long long ptr) +@ stdcall CreateBitmapIndirect(ptr) +@ stdcall CreateBrushIndirect(ptr) +@ stdcall CreateColorSpaceA(ptr) +@ stdcall CreateColorSpaceW(ptr) +@ stdcall CreateCompatibleBitmap(long long long) +@ stdcall CreateCompatibleDC(long) +@ stdcall CreateDCA(str str str ptr) +@ stdcall CreateDCW(wstr wstr wstr ptr) +@ stdcall CreateDIBPatternBrush(long long) +@ stdcall CreateDIBPatternBrushPt(long long) +@ stdcall CreateDIBSection(long ptr long ptr long long) +@ stdcall CreateDIBitmap(long ptr long ptr ptr long) +@ stdcall CreateDiscardableBitmap(long long long) +@ stdcall CreateEllipticRgn(long long long long) +@ stdcall CreateEllipticRgnIndirect(ptr) +@ stdcall CreateEnhMetaFileA(long str ptr str) +@ stdcall CreateEnhMetaFileW(long wstr ptr wstr) +@ stdcall CreateFontA(long long long long long long long long long long long long long str) +@ stdcall CreateFontIndirectA(ptr) +# @ stub CreateFontIndirectExA +# @ stub CreateFontIndirectExW +@ stdcall CreateFontIndirectW(ptr) +@ stdcall CreateFontW(long long long long long long long long long long long long long wstr) +@ stdcall CreateHalftonePalette(long) +@ stdcall CreateHatchBrush(long long) +@ stdcall CreateICA(str str str ptr) +@ stdcall CreateICW(wstr wstr wstr ptr) +@ stdcall CreateMetaFileA(str) +@ stdcall CreateMetaFileW(wstr) +@ stdcall CreatePalette(ptr) +@ stdcall CreatePatternBrush(long) +@ stdcall CreatePen(long long long) +@ stdcall CreatePenIndirect(ptr) +@ stdcall CreatePolyPolygonRgn(ptr ptr long long) +@ stdcall CreatePolygonRgn(ptr long long) +@ stdcall CreateRectRgn(long long long long) +@ stdcall CreateRectRgnIndirect(ptr) +@ stdcall CreateRoundRectRgn(long long long long long long) +@ stdcall CreateScalableFontResourceA(long str str str) +@ stdcall CreateScalableFontResourceW(long wstr wstr wstr) +@ stdcall CreateSolidBrush(long) +@ stdcall DPtoLP(long ptr long) +@ stdcall DeleteColorSpace(long) +@ stdcall DeleteDC(long) +@ stdcall DeleteEnhMetaFile(long) +@ stdcall DeleteMetaFile(long) +@ stdcall DeleteObject(long) +@ stdcall DescribePixelFormat(long long long ptr) +@ stub DeviceCapabilitiesEx +@ stub DeviceCapabilitiesExA +@ stub DeviceCapabilitiesExW +@ stdcall DrawEscape(long long long ptr) +@ stdcall Ellipse(long long long long long) +@ stdcall EnableEUDC(long) +@ stdcall EndDoc(long) +# @ stub EndFormPage +@ stdcall EndPage(long) +@ stdcall EndPath(long) +@ stdcall EnumEnhMetaFile(long long ptr ptr ptr) +@ stdcall EnumFontFamiliesA(long str ptr long) +@ stdcall EnumFontFamiliesExA(long ptr ptr long long) +@ stdcall EnumFontFamiliesExW(long ptr ptr long long) +@ stdcall EnumFontFamiliesW(long wstr ptr long) +@ stdcall EnumFontsA(long str ptr long) +@ stdcall EnumFontsW(long wstr ptr long) +@ stdcall EnumICMProfilesA(long ptr long) +@ stdcall EnumICMProfilesW(long ptr long) +@ stdcall EnumMetaFile(long long ptr ptr) +@ stdcall EnumObjects(long long ptr long) +@ stdcall EqualRgn(long long) +@ stdcall Escape(long long long ptr ptr) +# @ stub EudcLoadLinkW +# @ stub EudcUnloadLinkW +@ stdcall ExcludeClipRect(long long long long long) +@ stdcall ExtCreatePen(long long ptr long ptr) +@ stdcall ExtCreateRegion(ptr long ptr) +@ stdcall ExtEscape(long long long ptr long ptr) +@ stdcall ExtFloodFill(long long long long long) +@ stdcall ExtSelectClipRgn(long long long) +@ stdcall ExtTextOutA(long long long long ptr str long ptr) +@ stdcall ExtTextOutW(long long long long ptr wstr long ptr) +@ stdcall FillPath(long) +@ stdcall FillRgn(long long long) +@ stdcall FixBrushOrgEx(long long long ptr) +@ stdcall FlattenPath(long) +@ stdcall FloodFill(long long long long) +@ stdcall FontIsLinked(long) +@ stdcall FrameRgn(long long long long long) +@ stub FreeImageColorMatcher +# @ stub GdiAddFontResourceW +# @ stub GdiAddGlsBounds +# @ stub GdiAddGlsRecord +@ stdcall GdiAlphaBlend(long long long long long long long long long long long) +# @ stub GdiArtificialDecrementDriver +@ stub GdiAssociateObject +@ stub GdiCleanCacheDC +@ stdcall GdiComment(long long ptr) +# @ stub GdiConsoleTextOut +@ stub GdiConvertAndCheckDC +@ stub GdiConvertBitmap +# @ stub GdiConvertBitmapV5 +@ stub GdiConvertBrush +@ stub GdiConvertDC +@ stub GdiConvertEnhMetaFile +@ stub GdiConvertFont +@ stub GdiConvertMetaFilePict +@ stub GdiConvertPalette +@ stub GdiConvertRegion +@ stdcall GdiConvertToDevmodeW(ptr) +@ stub GdiCreateLocalBitmap +@ stub GdiCreateLocalBrush +@ stub GdiCreateLocalEnhMetaFile +@ stub GdiCreateLocalFont +@ stub GdiCreateLocalMetaFilePict +@ stub GdiCreateLocalPalette +@ stub GdiCreateLocalRegion +@ stub GdiDciBeginAccess +@ stub GdiDciCreateOffscreenSurface +@ stub GdiDciCreateOverlaySurface +@ stub GdiDciCreatePrimarySurface +@ stub GdiDciDestroySurface +@ stub GdiDciDrawSurface +@ stub GdiDciEndAccess +@ stub GdiDciEnumSurface +@ stub GdiDciInitialize +@ stub GdiDciSetClipList +@ stub GdiDciSetDestination +@ stub GdiDeleteLocalDC +@ stub GdiDeleteLocalObject +# @ stub GdiDeleteSpoolFileHandle +# @ stub GdiDescribePixelFormat +@ stub GdiDllInitialize +# @ stub GdiDrawStream +# @ stub GdiEndDocEMF +# @ stub GdiEndPageEMF +# @ stub GdiFixUpHandle +@ stdcall GdiFlush() +# @ stub GdiFullscreenControl +@ stdcall GdiGetBatchLimit() +@ stdcall GdiGetCharDimensions(long ptr ptr) +@ stdcall GdiGetCodePage(long) +# @ stub GdiGetDC +# @ stub GdiGetDevmodeForPage +@ stub GdiGetLocalBitmap +@ stub GdiGetLocalBrush +@ stub GdiGetLocalDC +@ stub GdiGetLocalFont +# @ stub GdiGetPageCount +# @ stub GdiGetPageHandle +# @ stub GdiGetSpoolFileHandle +@ stdcall GdiGetSpoolMessage(ptr long ptr long) +@ stdcall GdiGradientFill(long ptr long ptr long long) +@ stdcall GdiInitSpool() +# @ stub GdiInitializeLanguagePack +@ stdcall GdiIsMetaFileDC(long) +@ stdcall GdiIsMetaPrintDC(long) +@ stdcall GdiIsPlayMetafileDC(long) +@ stub GdiPlayDCScript +# @ stub GdiPlayEMF +@ stub GdiPlayJournal +# @ stub GdiPlayPageEMF +# @ stub GdiPlayPrivatePageEMF +@ stub GdiPlayScript +# @ stub GdiPrinterThunk +# @ stub GdiProcessSetup +# @ stub GdiQueryFonts +# @ stub GdiQueryTable +@ stdcall GdiRealizationInfo(long ptr) +# @ stub GdiReleaseDC +@ stub GdiReleaseLocalDC +# @ stub GdiResetDCEMF +@ stub GdiSetAttrs +@ stdcall GdiSetBatchLimit(long) +# @ stub GdiSetLastError +# @ stub GdiSetPixelFormat +@ stub GdiSetServerAttr +# @ stub GdiStartDocEMF +# @ stub GdiStartPageEMF +# @ stub GdiSwapBuffers +@ stdcall GdiTransparentBlt(long long long long long long long long long long long) +# @ stub GdiValidateHandle +@ stub GdiWinWatchClose +@ stub GdiWinWatchDidStatusChange +@ stub GdiWinWatchGetClipList +@ stub GdiWinWatchOpen +@ stdcall GetArcDirection(long) +@ stdcall GetAspectRatioFilterEx(long ptr) +# @ stub GetBitmapAttributes +@ stdcall GetBitmapBits(long long ptr) +@ stdcall GetBitmapDimensionEx(long ptr) +@ stdcall GetBkColor(long) +@ stdcall GetBkMode(long) +@ stdcall GetBoundsRect(long ptr long) +# @ stub GetBrushAttributes +@ stdcall GetBrushOrgEx(long ptr) +@ stdcall GetCharABCWidthsA(long long long ptr) +@ stdcall GetCharABCWidthsFloatA(long long long ptr) +@ stdcall GetCharABCWidthsFloatW(long long long ptr) +@ stdcall GetCharABCWidthsI(long long long ptr ptr) +@ stdcall GetCharABCWidthsW(long long long ptr) +@ stdcall GetCharWidth32A(long long long long) +@ stdcall GetCharWidth32W(long long long long) +@ stdcall GetCharWidthA(long long long long) GetCharWidth32A +@ stdcall GetCharWidthFloatA(long long long ptr) +@ stdcall GetCharWidthFloatW(long long long ptr) +@ stdcall GetCharWidthI(ptr long long ptr ptr) +# @ stub GetCharWidthInfo +@ stdcall GetCharWidthW(long long long long) GetCharWidth32W +@ stub GetCharWidthWOW +@ stdcall GetCharacterPlacementA(long str long long ptr long) +@ stdcall GetCharacterPlacementW(long wstr long long ptr long) +@ stdcall GetClipBox(long ptr) +@ stdcall GetClipRgn(long long) +@ stdcall GetColorAdjustment(long ptr) +@ stdcall GetColorSpace(long) +@ stdcall GetCurrentObject(long long) +@ stdcall GetCurrentPositionEx(long ptr) +@ stdcall GetDCBrushColor(long) +@ stdcall GetDCOrgEx(long ptr) +@ stdcall GetDCPenColor(long) +@ stdcall GetDIBColorTable(long long long ptr) +@ stdcall GetDIBits(long long long long ptr ptr long) +@ stdcall GetDeviceCaps(long long) +@ stdcall GetDeviceGammaRamp(long ptr) +@ stub GetETM +# @ stub GetEUDCTimeStamp +# @ stub GetEUDCTimeStampExW +@ stdcall GetEnhMetaFileA(str) +@ stdcall GetEnhMetaFileBits(long long ptr) +@ stdcall GetEnhMetaFileDescriptionA(long long ptr) +@ stdcall GetEnhMetaFileDescriptionW(long long ptr) +@ stdcall GetEnhMetaFileHeader(long long ptr) +@ stdcall GetEnhMetaFilePaletteEntries (long long ptr) +# @ stub GetEnhMetaFilePixelFormat +@ stdcall GetEnhMetaFileW(wstr) +# @ stub GetFontAssocStatus +@ stdcall GetFontData(long long long ptr long) +@ stdcall GetFontLanguageInfo(long) +@ stub GetFontResourceInfo +@ stub GetFontResourceInfoW +@ stdcall GetFontUnicodeRanges(ptr ptr) +@ stdcall GetGlyphIndicesA(long ptr long ptr long) +@ stdcall GetGlyphIndicesW(long ptr long ptr long) +@ stdcall GetGlyphOutline(long long long ptr long ptr ptr) GetGlyphOutlineA +@ stdcall GetGlyphOutlineA(long long long ptr long ptr ptr) +@ stdcall GetGlyphOutlineW(long long long ptr long ptr ptr) +@ stub GetGlyphOutlineWow +@ stdcall GetGraphicsMode(long) +# @ stub GetHFONT +@ stdcall GetICMProfileA(long ptr ptr) +@ stdcall GetICMProfileW(long ptr ptr) +@ stdcall GetKerningPairs(long long ptr) GetKerningPairsA +@ stdcall GetKerningPairsA(long long ptr) +@ stdcall GetKerningPairsW(long long ptr) +@ stdcall GetLayout(long) +@ stdcall GetLogColorSpaceA(long ptr long) +@ stdcall GetLogColorSpaceW(long ptr long) +@ stdcall GetMapMode(long) +@ stdcall GetMetaFileA(str) +@ stdcall GetMetaFileBitsEx(long long ptr) +@ stdcall GetMetaFileW(wstr) +@ stdcall GetMetaRgn(long long) +@ stdcall GetMiterLimit(long ptr) +@ stdcall GetNearestColor(long long) +@ stdcall GetNearestPaletteIndex(long long) +@ stdcall GetObjectA(long long ptr) +@ stdcall GetObjectType(long) +@ stdcall GetObjectW(long long ptr) +@ stdcall GetOutlineTextMetricsA(long long ptr) +@ stdcall GetOutlineTextMetricsW(long long ptr) +@ stdcall GetPaletteEntries(long long long ptr) +@ stdcall GetPath(long ptr ptr long) +@ stdcall GetPixel(long long long) +@ stdcall GetPixelFormat(long) +@ stdcall GetPolyFillMode(long) +@ stdcall GetROP2(long) +@ stdcall GetRandomRgn(long long long) +@ stdcall GetRasterizerCaps(ptr long) +@ stdcall GetRegionData(long long ptr) +@ stdcall GetRelAbs(long long) +@ stdcall GetRgnBox(long ptr) +@ stdcall GetStockObject(long) +@ stdcall GetStretchBltMode(long) +# @ stub GetStringBitmapA +# @ stub GetStringBitmapW +@ stdcall GetSystemPaletteEntries(long long long ptr) +@ stdcall GetSystemPaletteUse(long) +@ stdcall GetTextAlign(long) +@ stdcall GetTextCharacterExtra(long) +@ stdcall GetTextCharset(long) +@ stdcall GetTextCharsetInfo(long ptr long) +@ stdcall GetTextColor(long) +@ stdcall GetTextExtentExPointA(long str long long ptr ptr ptr) +@ stdcall GetTextExtentExPointI(long ptr long long ptr ptr ptr) +@ stdcall GetTextExtentExPointW(long wstr long long ptr ptr ptr) +# @ stub GetTextExtentExPointWPri +@ stdcall GetTextExtentPoint32A(long str long ptr) +@ stdcall GetTextExtentPoint32W(long wstr long ptr) +@ stdcall GetTextExtentPointA(long str long ptr) +@ stdcall GetTextExtentPointI(long ptr long ptr) +@ stdcall GetTextExtentPointW(long wstr long ptr) +@ stdcall GetTextFaceA(long long ptr) +# @ stub GetTextFaceAliasW +@ stdcall GetTextFaceW(long long ptr) +@ stdcall GetTextMetricsA(long ptr) +@ stdcall GetTextMetricsW(long ptr) +@ stdcall GetTransform(long long ptr) +@ stdcall GetViewportExtEx(long ptr) +@ stdcall GetViewportOrgEx(long ptr) +@ stdcall GetWinMetaFileBits(long long ptr long long) +@ stdcall GetWindowExtEx(long ptr) +@ stdcall GetWindowOrgEx(long ptr) +@ stdcall GetWorldTransform(long ptr) +@ stdcall IntersectClipRect(long long long long long) +@ stdcall InvertRgn(long long) +# @ stub IsValidEnhMetaRecord +# @ stub IsValidEnhMetaRecordOffExt +@ stdcall LPtoDP(long ptr long) +@ stdcall LineDDA(long long long long ptr long) +@ stdcall LineTo(long long long) +@ stub LoadImageColorMatcherA +@ stub LoadImageColorMatcherW +@ stdcall MaskBlt(long long long long long long long long long long long long) +# @ stub MirrorRgn +@ stdcall ModifyWorldTransform(long ptr long) +@ stdcall MoveToEx(long long long ptr) +# @ stub NamedEscape +@ stdcall OffsetClipRgn(long long long) +@ stdcall OffsetRgn(long long long) +@ stdcall OffsetViewportOrgEx(long long long ptr) +@ stdcall OffsetWindowOrgEx(long long long ptr) +@ stdcall PaintRgn(long long) +@ stdcall PatBlt(long long long long long long) +@ stdcall PathToRegion(long) +@ stdcall Pie(long long long long long long long long long) +@ stdcall PlayEnhMetaFile(long long ptr) +@ stdcall PlayEnhMetaFileRecord(long ptr ptr long) +@ stdcall PlayMetaFile(long long) +@ stdcall PlayMetaFileRecord(long ptr ptr long) +@ stdcall PlgBlt(long ptr long long long long long long long long) +@ stdcall PolyBezier(long ptr long) +@ stdcall PolyBezierTo(long ptr long) +@ stdcall PolyDraw(long ptr ptr long) +# @ stub PolyPatBlt +@ stdcall PolyPolygon(long ptr ptr long) +@ stdcall PolyPolyline(long ptr ptr long) +@ stdcall PolyTextOutA(long ptr long) +@ stdcall PolyTextOutW(long ptr long) +@ stdcall Polygon(long ptr long) +@ stdcall Polyline(long ptr long) +@ stdcall PolylineTo(long ptr long) +@ stdcall PtInRegion(long long long) +@ stdcall PtVisible(long long long) +# @ stub QueryFontAssocStatus +@ stdcall RealizePalette(long) +@ stdcall RectInRegion(long ptr) +@ stdcall RectVisible(long ptr) +@ stdcall Rectangle(long long long long long) +@ stdcall RemoveFontMemResourceEx(ptr) +@ stdcall RemoveFontResourceA(str) +@ stdcall RemoveFontResourceExA(str long ptr) +@ stdcall RemoveFontResourceExW(wstr long ptr) +@ stub RemoveFontResourceTracking +@ stdcall RemoveFontResourceW(wstr) +@ stdcall ResetDCA(long ptr) +@ stdcall ResetDCW(long ptr) +@ stdcall ResizePalette(long long) +@ stdcall RestoreDC(long long) +@ stdcall RoundRect(long long long long long long long) +@ stdcall SaveDC(long) +@ stdcall ScaleViewportExtEx(long long long long long ptr) +@ stdcall ScaleWindowExtEx(long long long long long ptr) +@ stub SelectBrushLocal +@ stdcall SelectClipPath(long long) +@ stdcall SelectClipRgn(long long) +@ stub SelectFontLocal +@ stdcall SelectObject(long long) +@ stdcall SelectPalette(long long long) +@ stdcall SetAbortProc(long ptr) +@ stdcall SetArcDirection(long long) +# @ stub SetBitmapAttributes +@ stdcall SetBitmapBits(long long ptr) +@ stdcall SetBitmapDimensionEx(long long long ptr) +@ stdcall SetBkColor(long long) +@ stdcall SetBkMode(long long) +@ stdcall SetBoundsRect(long ptr long) +# @ stub SetBrushAttributes +@ stdcall SetBrushOrgEx(long long long ptr) +@ stdcall SetColorAdjustment(long ptr) +@ stdcall SetColorSpace(long long) +@ stdcall SetDCBrushColor(long long) +@ stdcall SetDCPenColor(long long) +@ stdcall SetDIBColorTable(long long long ptr) +@ stdcall SetDIBits(long long long long ptr ptr long) +@ stdcall SetDIBitsToDevice(long long long long long long long long long ptr ptr long) +@ stdcall SetDeviceGammaRamp(long ptr) +@ stdcall SetEnhMetaFileBits(long ptr) +@ stub SetFontEnumeration +@ stdcall SetGraphicsMode(long long) +@ stdcall SetICMMode(long long) +@ stdcall SetICMProfileA(long str) +@ stdcall SetICMProfileW(long wstr) +@ stdcall SetLayout(long long) +# @ stub SetLayoutWidth +@ stdcall SetMagicColors(ptr long long) +@ stdcall SetMapMode(long long) +@ stdcall SetMapperFlags(long long) +@ stdcall SetMetaFileBitsEx(long ptr) +@ stdcall SetMetaRgn(long) +@ stdcall SetMiterLimit(long long ptr) +@ stdcall SetObjectOwner(long long) +@ stdcall SetPaletteEntries(long long long ptr) +@ stdcall SetPixel(long long long long) +@ stdcall SetPixelFormat(long long ptr) +@ stdcall SetPixelV(long long long long) +@ stdcall SetPolyFillMode(long long) +@ stdcall SetROP2(long long) +@ stdcall SetRectRgn(long long long long long) +@ stdcall SetRelAbs(long long) +@ stdcall SetStretchBltMode(long long) +@ stdcall SetSystemPaletteUse(long long) +@ stdcall SetTextAlign(long long) +@ stdcall SetTextCharacterExtra(long long) +@ stdcall SetTextColor(long long) +@ stdcall SetTextJustification(long long long) +@ stdcall SetViewportExtEx(long long long ptr) +@ stdcall SetViewportOrgEx(long long long ptr) +@ stdcall SetVirtualResolution(long long long long long) +@ stdcall SetWinMetaFileBits(long ptr long ptr) +@ stdcall SetWindowExtEx(long long long ptr) +@ stdcall SetWindowOrgEx(long long long ptr) +@ stdcall SetWorldTransform(long ptr) +@ stdcall StartDocA(long ptr) +@ stdcall StartDocW(long ptr) +# @ stub StartFormPage +@ stdcall StartPage(long) +@ stdcall StretchBlt(long long long long long long long long long long long) +@ stdcall StretchDIBits(long long long long long long long long long ptr ptr long long) +@ stdcall StrokeAndFillPath(long) +@ stdcall StrokePath(long) +@ stdcall SwapBuffers(long) +@ stdcall TextOutA(long long long str long) +@ stdcall TextOutW(long long long wstr long) +@ stdcall TranslateCharsetInfo(ptr ptr long) +@ stub UnloadNetworkFonts +@ stdcall UnrealizeObject(long) +@ stdcall UpdateColors(long) +@ stdcall UpdateICMRegKey(long str str long) UpdateICMRegKeyA +@ stdcall UpdateICMRegKeyA(long str str long) +@ stdcall UpdateICMRegKeyW(long wstr wstr long) +@ stdcall WidenPath(long) +@ stub gdiPlaySpoolStream +@ extern pfnRealizePalette +@ extern pfnSelectPalette +@ stub pstackConnect + +################################################################ +# Wine extensions: OpenGL support +# +@ stdcall wglCopyContext(long long long) +@ stdcall wglCreateContext(long) +@ stdcall wglDeleteContext(long) +@ stdcall wglGetCurrentContext() +@ stdcall wglGetCurrentDC() +@ stdcall -private wglGetProcAddress(str) +@ stdcall wglMakeCurrent(long long) +@ stdcall wglShareLists(long long) +@ stdcall wglUseFontBitmapsA(long long long long) +@ stdcall wglUseFontBitmapsW(long long long long) + +################################################################ +# Wine extensions: Win16 functions that are needed by other dlls +# +@ stdcall CloseJob16(long) +@ stdcall DrvGetPrinterData16(str str ptr ptr long ptr) +@ stdcall DrvSetPrinterData16(str str long ptr long) +@ stdcall GetDCHook(long ptr) +@ stdcall OpenJob16(str str long) +@ stdcall SelectVisRgn(long long) +@ stdcall SetDCHook(long ptr long) +@ stdcall SetHookFlags(long long) +@ stdcall WriteSpool16(long ptr long) + +################################################################ +# Wine internal extensions +# +# All functions must be prefixed with '__wine_' (for internal functions) +# or 'wine_' (for user-visible functions) to avoid namespace conflicts. + +# GDI objects +@ cdecl __wine_make_gdi_object_system(long long) From 0a516495af22eface001f4a28a1b6ae0e69212e1 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 24 Sep 2008 12:33:59 +0000 Subject: [PATCH 315/388] Small 64bit fix. svn path=/branches/ros-amd64-bringup/; revision=36477 --- reactos/base/setup/vmwinst/vmwinst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/setup/vmwinst/vmwinst.c b/reactos/base/setup/vmwinst/vmwinst.c index 80484c9e908..8c4166ab8d0 100644 --- a/reactos/base/setup/vmwinst/vmwinst.c +++ b/reactos/base/setup/vmwinst/vmwinst.c @@ -504,7 +504,7 @@ done: } cleanup: - hThread = (HANDLE)InterlockedExchange((LONG*)&hInstallationThread, 0); + hThread = (HANDLE)(ULONG_PTR)InterlockedExchange((LONG*)&hInstallationThread, 0); if(hThread != NULL) { CloseHandle(hThread); From fa7128be01120d47b5d327f779ea99d52bc6359b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 25 Sep 2008 04:27:03 +0000 Subject: [PATCH 316/388] - Convert to spec. - No need to assert an offset thats only used in i386 specific code. svn path=/branches/ros-amd64-bringup/; revision=36502 --- reactos/dll/win32/opengl32/gl.c | 2 + reactos/dll/win32/opengl32/opengl32.def | 401 --------------------- reactos/dll/win32/opengl32/opengl32.rbuild | 3 +- reactos/dll/win32/opengl32/opengl32.spec | 401 +++++++++++++++++++++ 4 files changed, 405 insertions(+), 402 deletions(-) delete mode 100644 reactos/dll/win32/opengl32/opengl32.def create mode 100644 reactos/dll/win32/opengl32/opengl32.spec diff --git a/reactos/dll/win32/opengl32/gl.c b/reactos/dll/win32/opengl32/gl.c index fb2b86dbf83..e5e475df30d 100644 --- a/reactos/dll/win32/opengl32/gl.c +++ b/reactos/dll/win32/opengl32/gl.c @@ -22,7 +22,9 @@ #include "opengl32.h" +#if defined(_M_IX86) C_ASSERT(FIELD_OFFSET(TEB, glTable) == 0xbe8); +#endif int STDCALL glEmptyFunc0() { return 0; } int STDCALL glEmptyFunc4( long l1 ) { return 0; } diff --git a/reactos/dll/win32/opengl32/opengl32.def b/reactos/dll/win32/opengl32/opengl32.def deleted file mode 100644 index 8cf81acc08c..00000000000 --- a/reactos/dll/win32/opengl32/opengl32.def +++ /dev/null @@ -1,401 +0,0 @@ -; $Id$ -; -; opengl32.def -; -; ReactOS Operating System -; -LIBRARY opengl32.dll -EXPORTS -;DllInitialize - -glAccum@8 -glAlphaFunc@8 -glAreTexturesResident@12 -glArrayElement@4 -glBegin@4 -glBindTexture@8 -glBitmap@28 -glBlendFunc@8 -glCallList@4 -glCallLists@12 -glClear@4 -glClearAccum@16 -glClearColor@16 -glClearDepth@8 -glClearIndex@4 -glClearStencil@4 -glClipPlane@8 - -glColor3b@12 -glColor3bv@4 -glColor3d@24 -glColor3dv@4 -glColor3f@12 -glColor3fv@4 -glColor3i@12 -glColor3iv@4 -glColor3s@12 -glColor3sv@4 -glColor3ub@12 -glColor3ubv@4 -glColor3ui@12 -glColor3uiv@4 -glColor3us@12 -glColor3usv@4 - -glColor4b@16 -glColor4bv@4 -glColor4d@32 -glColor4dv@4 -glColor4f@16 -glColor4fv@4 -glColor4i@16 -glColor4iv@4 -glColor4s@16 -glColor4sv@4 -glColor4ub@16 -glColor4ubv@4 -glColor4ui@16 -glColor4uiv@4 -glColor4us@16 -glColor4usv@4 - -glColorMask@16 -glColorMaterial@8 -glColorPointer@16 -glCopyPixels@20 -glCopyTexImage1D@28 -glCopyTexImage2D@32 -glCopyTexSubImage1D@24 -glCopyTexSubImage2D@32 -glCullFace@4 -;glDebugEntry -glDeleteLists@8 -glDeleteTextures@8 -glDepthFunc@4 -glDepthMask@4 -glDepthRange@16 -glDisable@4 -glDisableClientState@4 -glDrawArrays@12 -glDrawBuffer@4 -glDrawElements@16 -glDrawPixels@20 -glEdgeFlag@4 -glEdgeFlagPointer@8 -glEdgeFlagv@4 -glEnable@4 -glEnableClientState@4 -glEnd@0 -glEndList@0 - -glEvalCoord1d@8 -glEvalCoord1dv@4 -glEvalCoord1f@4 -glEvalCoord1fv@4 -glEvalCoord2d@16 -glEvalCoord2dv@4 -glEvalCoord2f@8 -glEvalCoord2fv@4 - -glEvalMesh1@12 -glEvalMesh2@20 -glEvalPoint1@4 -glEvalPoint2@8 -glFeedbackBuffer@12 -glFinish@0 -glFlush@0 -glFogf@8 -glFogfv@8 -glFogi@8 -glFogiv@8 -glFrontFace@4 -glFrustum@48 -glGenLists@4 -glGenTextures@8 -glGetBooleanv@8 -glGetClipPlane@8 -glGetDoublev@8 -glGetError@0 -glGetFloatv@8 -glGetIntegerv@8 -glGetLightfv@12 -glGetLightiv@12 -glGetMapdv@12 -glGetMapfv@12 -glGetMapiv@12 -glGetMaterialfv@12 -glGetMaterialiv@12 -glGetPixelMapfv@8 -glGetPixelMapuiv@8 -glGetPixelMapusv@8 -glGetPointerv@8 -glGetPolygonStipple@4 -glGetString@4 -glGetTexEnvfv@12 -glGetTexEnviv@12 -glGetTexGendv@12 -glGetTexGenfv@12 -glGetTexGeniv@12 -glGetTexImage@20 -glGetTexLevelParameterfv@16 -glGetTexLevelParameteriv@16 -glGetTexParameterfv@12 -glGetTexParameteriv@12 -glHint@8 -glIndexd@8 -glIndexdv@4 -glIndexf@4 -glIndexfv@4 -glIndexi@4 -glIndexiv@4 -glIndexMask@4 -glIndexPointer@12 -glIndexs@4 -glIndexsv@4 -glIndexub@4 -glIndexubv@4 -glInitNames@0 -glInterleavedArrays@12 -glIsEnabled@4 -glIsList@4 -glIsTexture@4 - -glLightf@12 -glLightfv@12 -glLighti@12 -glLightiv@12 -glLightModelf@8 -glLightModelfv@8 -glLightModeli@8 -glLightModeliv@8 - -glLineStipple@8 -glLineWidth@4 -glListBase@4 -glLoadIdentity@0 -glLoadMatrixd@4 -glLoadMatrixf@4 -glLoadName@4 -glLogicOp@4 - -glMap1d@32 -glMap1f@24 -glMap2d@56 -glMap2f@40 -glMapGrid1d@20 -glMapGrid1f@12 -glMapGrid2d@40 -glMapGrid2f@24 - -glMaterialf@12 -glMaterialfv@12 -glMateriali@12 -glMaterialiv@12 - -glMatrixMode@4 -;GlmfBeginGlsBlock -;GlmfCloseMetaFile -;GlmfEndGlsBlock -;GlmfEndPlayback -;GlmfInitPlayback -;GlmfPlayGlsRecord -glMultMatrixd@4 -glMultMatrixf@4 -glNewList@8 - -glNormal3b@12 -glNormal3bv@4 -glNormal3d@24 -glNormal3dv@4 -glNormal3f@12 -glNormal3fv@4 -glNormal3i@12 -glNormal3iv@4 -glNormal3s@12 -glNormal3sv@4 -glNormalPointer@12 - -glOrtho@48 -glPassThrough@4 -glPixelMapfv@12 -glPixelMapuiv@12 -glPixelMapusv@12 -glPixelStoref@8 -glPixelStorei@8 -glPixelTransferf@8 -glPixelTransferi@8 -glPixelZoom@8 -glPointSize@4 -glPolygonMode@8 -glPolygonOffset@8 -glPolygonStipple@4 -glPopAttrib@0 -glPopClientAttrib@0 -glPopMatrix@0 -glPopName@0 -glPrioritizeTextures@12 -glPushAttrib@4 -glPushClientAttrib@4 -glPushMatrix@0 -glPushName@4 -glRasterPos2d@16 -glRasterPos2dv@4 -glRasterPos2f@8 -glRasterPos2fv@4 -glRasterPos2i@8 -glRasterPos2iv@4 -glRasterPos2s@8 -glRasterPos2sv@4 -glRasterPos3d@24 -glRasterPos3dv@4 -glRasterPos3f@12 -glRasterPos3fv@4 -glRasterPos3i@12 -glRasterPos3iv@4 -glRasterPos3s@12 -glRasterPos3sv@4 -glRasterPos4d@32 -glRasterPos4dv@4 -glRasterPos4f@16 -glRasterPos4fv@4 -glRasterPos4i@16 -glRasterPos4iv@4 -glRasterPos4s@16 -glRasterPos4sv@4 -glReadBuffer@4 -glReadPixels@28 -glRectd@32 -glRectdv@8 -glRectf@16 -glRectfv@8 -glRecti@16 -glRectiv@8 -glRects@16 -glRectsv@8 -glRenderMode@4 -glRotated@32 -glRotatef@16 -glScaled@24 -glScalef@12 -glScissor@16 -glSelectBuffer@8 -glShadeModel@4 -glStencilFunc@12 -glStencilMask@4 -glStencilOp@12 - -glTexCoord1d@8 -glTexCoord1dv@4 -glTexCoord1f@4 -glTexCoord1fv@4 -glTexCoord1i@4 -glTexCoord1iv@4 -glTexCoord1s@4 -glTexCoord1sv@4 - -glTexCoord2d@16 -glTexCoord2dv@4 -glTexCoord2f@8 -glTexCoord2fv@4 -glTexCoord2i@8 -glTexCoord2iv@4 -glTexCoord2s@8 -glTexCoord2sv@4 - -glTexCoord3d@24 -glTexCoord3dv@4 -glTexCoord3f@12 -glTexCoord3fv@4 -glTexCoord3i@12 -glTexCoord3iv@4 -glTexCoord3s@12 -glTexCoord3sv@4 - -glTexCoord4d@32 -glTexCoord4dv@4 -glTexCoord4f@16 -glTexCoord4fv@4 -glTexCoord4i@16 -glTexCoord4iv@4 -glTexCoord4s@16 -glTexCoord4sv@4 - -glTexCoordPointer@16 -glTexEnvf@12 -glTexEnvfv@12 -glTexEnvi@12 -glTexEnviv@12 -glTexGend@16 -glTexGendv@12 -glTexGenf@12 -glTexGenfv@12 -glTexGeni@12 -glTexGeniv@12 -glTexImage1D@32 -glTexImage2D@36 -glTexParameterf@12 -glTexParameterfv@12 -glTexParameteri@12 -glTexParameteriv@12 -glTexSubImage1D@28 -glTexSubImage2D@36 - -glTranslated@24 -glTranslatef@12 - -glVertex2d@16 -glVertex2dv@4 -glVertex2f@8 -glVertex2fv@4 -glVertex2i@8 -glVertex2iv@4 -glVertex2s@8 -glVertex2sv@4 - -glVertex3d@24 -glVertex3dv@4 -glVertex3f@12 -glVertex3fv@4 -glVertex3i@12 -glVertex3iv@4 -glVertex3s@12 -glVertex3sv@4 - -glVertex4d@32 -glVertex4dv@4 -glVertex4f@16 -glVertex4fv@4 -glVertex4i@16 -glVertex4iv@4 -glVertex4s@16 -glVertex4sv@4 - -glVertexPointer@16 -glViewport@16 - -wglChoosePixelFormat@8=rosglChoosePixelFormat@8 -wglCopyContext@12=rosglCopyContext@12 -wglCreateContext@4=rosglCreateContext@4 -wglCreateLayerContext@8=rosglCreateLayerContext@8 -wglDeleteContext@4=rosglDeleteContext@4 -wglDescribeLayerPlane@20=rosglDescribeLayerPlane@20 -wglDescribePixelFormat@16=rosglDescribePixelFormat@16 -wglGetCurrentContext@0=rosglGetCurrentContext@0 -wglGetCurrentDC@0=rosglGetCurrentDC@0 -wglGetDefaultProcAddress@4=rosglGetDefaultProcAddress@4 -wglGetLayerPaletteEntries@20=rosglGetLayerPaletteEntries@20 -wglGetPixelFormat@4=rosglGetPixelFormat@4 -wglGetProcAddress@4=rosglGetProcAddress@4 -wglMakeCurrent@8=rosglMakeCurrent@8 -wglRealizeLayerPalette@12=rosglRealizeLayerPalette@12 -wglSetLayerPaletteEntries@20=rosglSetLayerPaletteEntries@20 -wglSetPixelFormat@12=rosglSetPixelFormat@12 -wglShareLists@8=rosglShareLists@8 -wglSwapBuffers@4=rosglSwapBuffers@4 -wglSwapLayerBuffers@8=rosglSwapLayerBuffers@8 -;wglSwapMultipleBuffers=rosglSwapMultipleBuffers@ -wglUseFontBitmapsA@16=rosglUseFontBitmapsA@16 -wglUseFontBitmapsW@16=rosglUseFontBitmapsW@16 -wglUseFontOutlinesA@32=rosglUseFontOutlinesA@32 -wglUseFontOutlinesW@32=rosglUseFontOutlinesW@32 diff --git a/reactos/dll/win32/opengl32/opengl32.rbuild b/reactos/dll/win32/opengl32/opengl32.rbuild index f201ddd4e86..b1ac66616d1 100644 --- a/reactos/dll/win32/opengl32/opengl32.rbuild +++ b/reactos/dll/win32/opengl32/opengl32.rbuild @@ -1,5 +1,5 @@ - + ntdll kernel32 @@ -10,4 +10,5 @@ gl.c opengl32.c wgl.c + opengl32.spec diff --git a/reactos/dll/win32/opengl32/opengl32.spec b/reactos/dll/win32/opengl32/opengl32.spec new file mode 100644 index 00000000000..f7e31813fdf --- /dev/null +++ b/reactos/dll/win32/opengl32/opengl32.spec @@ -0,0 +1,401 @@ +@ stdcall glAccum( long long ) +@ stdcall glAlphaFunc( long long ) +@ stdcall glAreTexturesResident( long ptr ptr ) +@ stdcall glArrayElement( long ) +@ stdcall glBegin( long ) +@ stdcall glBindTexture( long long ) +@ stdcall glBitmap( long long long long long long ptr ) +#@ stdcall glBlendColor( long long long long ) +#@ stdcall glBlendEquation( long ) +@ stdcall glBlendFunc( long long ) +@ stdcall glCallList( long ) +@ stdcall glCallLists( long long ptr ) +@ stdcall glClear( long ) +@ stdcall glClearAccum( long long long long ) +@ stdcall glClearColor( long long long long ) +@ stdcall glClearDepth( double ) +@ stdcall glClearIndex( long ) +@ stdcall glClearStencil( long ) +@ stdcall glClipPlane( long ptr ) +@ stdcall glColor3b( long long long ) +@ stdcall glColor3bv( ptr ) +@ stdcall glColor3d( double double double ) +@ stdcall glColor3dv( ptr ) +@ stdcall glColor3f( long long long ) +@ stdcall glColor3fv( ptr ) +@ stdcall glColor3i( long long long ) +@ stdcall glColor3iv( ptr ) +@ stdcall glColor3s( long long long ) +@ stdcall glColor3sv( ptr ) +@ stdcall glColor3ub( long long long ) +@ stdcall glColor3ubv( ptr ) +@ stdcall glColor3ui( long long long ) +@ stdcall glColor3uiv( ptr ) +@ stdcall glColor3us( long long long ) +@ stdcall glColor3usv( ptr ) +@ stdcall glColor4b( long long long long ) +@ stdcall glColor4bv( ptr ) +@ stdcall glColor4d( double double double double ) +@ stdcall glColor4dv( ptr ) +@ stdcall glColor4f( long long long long ) +@ stdcall glColor4fv( ptr ) +@ stdcall glColor4i( long long long long ) +@ stdcall glColor4iv( ptr ) +@ stdcall glColor4s( long long long long ) +@ stdcall glColor4sv( ptr ) +@ stdcall glColor4ub( long long long long ) +@ stdcall glColor4ubv( ptr ) +@ stdcall glColor4ui( long long long long ) +@ stdcall glColor4uiv( ptr ) +@ stdcall glColor4us( long long long long ) +@ stdcall glColor4usv( ptr ) +@ stdcall glColorMask( long long long long ) +@ stdcall glColorMaterial( long long ) +@ stdcall glColorPointer( long long long ptr ) +#@ stdcall glColorSubTable( long long long long long ptr ) +#@ stdcall glColorTable( long long long long long ptr ) +#@ stdcall glColorTableParameterfv( long long ptr ) +#@ stdcall glColorTableParameteriv( long long ptr ) +#@ stdcall glConvolutionFilter1D( long long long long long ptr ) +#@ stdcall glConvolutionFilter2D( long long long long long long ptr ) +#@ stdcall glConvolutionParameterf( long long long ) +#@ stdcall glConvolutionParameterfv( long long ptr ) +#@ stdcall glConvolutionParameteri( long long long ) +#@ stdcall glConvolutionParameteriv( long long ptr ) +#@ stdcall glCopyColorSubTable( long long long long long ) +#@ stdcall glCopyColorTable( long long long long long ) +#@ stdcall glCopyConvolutionFilter1D( long long long long long ) +#@ stdcall glCopyConvolutionFilter2D( long long long long long long ) +@ stdcall glCopyPixels( long long long long long ) +@ stdcall glCopyTexImage1D( long long long long long long long ) +@ stdcall glCopyTexImage2D( long long long long long long long long ) +@ stdcall glCopyTexSubImage1D( long long long long long long ) +@ stdcall glCopyTexSubImage2D( long long long long long long long long ) +#@ stdcall glCopyTexSubImage3D( long long long long long long long long long ) +@ stdcall glCullFace( long ) +@ stdcall glDeleteLists( long long ) +@ stdcall glDeleteTextures( long ptr ) +@ stdcall glDepthFunc( long ) +@ stdcall glDepthMask( long ) +@ stdcall glDepthRange( double double ) +@ stdcall glDisable( long ) +@ stdcall glDisableClientState( long ) +@ stdcall glDrawArrays( long long long ) +@ stdcall glDrawBuffer( long ) +@ stdcall glDrawElements( long long long ptr ) +@ stdcall glDrawPixels( long long long long ptr ) +#@ stdcall glDrawRangeElements( long long long long long ptr ) +@ stdcall glEdgeFlag( long ) +@ stdcall glEdgeFlagPointer( long ptr ) +@ stdcall glEdgeFlagv( ptr ) +@ stdcall glEnable( long ) +@ stdcall glEnableClientState( long ) +@ stdcall glEnd( ) +@ stdcall glEndList( ) +@ stdcall glEvalCoord1d( double ) +@ stdcall glEvalCoord1dv( ptr ) +@ stdcall glEvalCoord1f( long ) +@ stdcall glEvalCoord1fv( ptr ) +@ stdcall glEvalCoord2d( double double ) +@ stdcall glEvalCoord2dv( ptr ) +@ stdcall glEvalCoord2f( long long ) +@ stdcall glEvalCoord2fv( ptr ) +@ stdcall glEvalMesh1( long long long ) +@ stdcall glEvalMesh2( long long long long long ) +@ stdcall glEvalPoint1( long ) +@ stdcall glEvalPoint2( long long ) +@ stdcall glFeedbackBuffer( long long ptr ) +@ stdcall glFinish( ) +@ stdcall glFlush( ) +@ stdcall glFogf( long long ) +@ stdcall glFogfv( long ptr ) +@ stdcall glFogi( long long ) +@ stdcall glFogiv( long ptr ) +@ stdcall glFrontFace( long ) +@ stdcall glFrustum( double double double double double double ) +@ stdcall glGenLists( long ) +@ stdcall glGenTextures( long ptr ) +@ stdcall glGetBooleanv( long ptr ) +@ stdcall glGetClipPlane( long ptr ) +#@ stdcall glGetColorTable( long long long ptr ) +#@ stdcall glGetColorTableParameterfv( long long ptr ) +#@ stdcall glGetColorTableParameteriv( long long ptr ) +#@ stdcall glGetConvolutionFilter( long long long ptr ) +#@ stdcall glGetConvolutionParameterfv( long long ptr ) +#@ stdcall glGetConvolutionParameteriv( long long ptr ) +@ stdcall glGetDoublev( long ptr ) +@ stdcall glGetError( ) +@ stdcall glGetFloatv( long ptr ) +#@ stdcall glGetHistogram( long long long long ptr ) +#@ stdcall glGetHistogramParameterfv( long long ptr ) +#@ stdcall glGetHistogramParameteriv( long long ptr ) +@ stdcall glGetIntegerv( long ptr ) +@ stub glGetLevelParameterfv +@ stub glGetLevelParameteriv +@ stdcall glGetLightfv( long long ptr ) +@ stdcall glGetLightiv( long long ptr ) +@ stdcall glGetMapdv( long long ptr ) +@ stdcall glGetMapfv( long long ptr ) +@ stdcall glGetMapiv( long long ptr ) +@ stdcall glGetMaterialfv( long long ptr ) +@ stdcall glGetMaterialiv( long long ptr ) +#@ stdcall glGetMinmax( long long long long ptr ) +#@ stdcall glGetMinmaxParameterfv( long long ptr ) +#@ stdcall glGetMinmaxParameteriv( long long ptr ) +@ stdcall glGetPixelMapfv( long ptr ) +@ stdcall glGetPixelMapuiv( long ptr ) +@ stdcall glGetPixelMapusv( long ptr ) +@ stdcall glGetPointerv( long ptr ) +@ stdcall glGetPolygonStipple( ptr ) +#@ stdcall glGetSeparableFilter( long long long ptr ptr ptr ) +@ stdcall glGetString( long ) +@ stdcall glGetTexEnvfv( long long ptr ) +@ stdcall glGetTexEnviv( long long ptr ) +@ stdcall glGetTexGendv( long long ptr ) +@ stdcall glGetTexGenfv( long long ptr ) +@ stdcall glGetTexGeniv( long long ptr ) +@ stdcall glGetTexImage( long long long long ptr ) +@ stdcall glGetTexLevelParameterfv( long long long ptr ) +@ stdcall glGetTexLevelParameteriv( long long long ptr ) +@ stdcall glGetTexParameterfv( long long ptr ) +@ stdcall glGetTexParameteriv( long long ptr ) +@ stdcall glHint( long long ) +#@ stdcall glHistogram( long long long long ) +@ stdcall glIndexMask( long ) +@ stdcall glIndexPointer( long long ptr ) +@ stdcall glIndexd( double ) +@ stdcall glIndexdv( ptr ) +@ stdcall glIndexf( long ) +@ stdcall glIndexfv( ptr ) +@ stdcall glIndexi( long ) +@ stdcall glIndexiv( ptr ) +@ stdcall glIndexs( long ) +@ stdcall glIndexsv( ptr ) +@ stdcall glIndexub( long ) +@ stdcall glIndexubv( ptr ) +@ stdcall glInitNames( ) +@ stdcall glInterleavedArrays( long long ptr ) +@ stdcall glIsEnabled( long ) +@ stdcall glIsList( long ) +@ stdcall glIsTexture( long ) +@ stdcall glLightModelf( long long ) +@ stdcall glLightModelfv( long ptr ) +@ stdcall glLightModeli( long long ) +@ stdcall glLightModeliv( long ptr ) +@ stdcall glLightf( long long long ) +@ stdcall glLightfv( long long ptr ) +@ stdcall glLighti( long long long ) +@ stdcall glLightiv( long long ptr ) +@ stdcall glLineStipple( long long ) +@ stdcall glLineWidth( long ) +@ stdcall glListBase( long ) +@ stdcall glLoadIdentity( ) +@ stdcall glLoadMatrixd( ptr ) +@ stdcall glLoadMatrixf( ptr ) +@ stdcall glLoadName( long ) +@ stdcall glLogicOp( long ) +@ stdcall glMap1d( long double double long long ptr ) +@ stdcall glMap1f( long long long long long ptr ) +@ stdcall glMap2d( long double double long long double double long long ptr ) +@ stdcall glMap2f( long long long long long long long long long ptr ) +@ stdcall glMapGrid1d( long double double ) +@ stdcall glMapGrid1f( long long long ) +@ stdcall glMapGrid2d( long double double long double double ) +@ stdcall glMapGrid2f( long long long long long long ) +@ stdcall glMaterialf( long long long ) +@ stdcall glMaterialfv( long long ptr ) +@ stdcall glMateriali( long long long ) +@ stdcall glMaterialiv( long long ptr ) +@ stdcall glMatrixMode( long ) +#@ stdcall glMinmax( long long long ) +@ stdcall glMultMatrixd( ptr ) +@ stdcall glMultMatrixf( ptr ) +@ stdcall glNewList( long long ) +@ stdcall glNormal3b( long long long ) +@ stdcall glNormal3bv( ptr ) +@ stdcall glNormal3d( double double double ) +@ stdcall glNormal3dv( ptr ) +@ stdcall glNormal3f( long long long ) +@ stdcall glNormal3fv( ptr ) +@ stdcall glNormal3i( long long long ) +@ stdcall glNormal3iv( ptr ) +@ stdcall glNormal3s( long long long ) +@ stdcall glNormal3sv( ptr ) +@ stdcall glNormalPointer( long long ptr ) +@ stdcall glOrtho( double double double double double double ) +@ stdcall glPassThrough( long ) +@ stdcall glPixelMapfv( long long ptr ) +@ stdcall glPixelMapuiv( long long ptr ) +@ stdcall glPixelMapusv( long long ptr ) +@ stdcall glPixelStoref( long long ) +@ stdcall glPixelStorei( long long ) +@ stdcall glPixelTransferf( long long ) +@ stdcall glPixelTransferi( long long ) +@ stdcall glPixelZoom( long long ) +@ stdcall glPointSize( long ) +@ stdcall glPolygonMode( long long ) +@ stdcall glPolygonOffset( long long ) +@ stdcall glPolygonStipple( ptr ) +@ stdcall glPopAttrib( ) +@ stdcall glPopClientAttrib( ) +@ stdcall glPopMatrix( ) +@ stdcall glPopName( ) +@ stdcall glPrioritizeTextures( long ptr ptr ) +@ stdcall glPushAttrib( long ) +@ stdcall glPushClientAttrib( long ) +@ stdcall glPushMatrix( ) +@ stdcall glPushName( long ) +@ stdcall glRasterPos2d( double double ) +@ stdcall glRasterPos2dv( ptr ) +@ stdcall glRasterPos2f( long long ) +@ stdcall glRasterPos2fv( ptr ) +@ stdcall glRasterPos2i( long long ) +@ stdcall glRasterPos2iv( ptr ) +@ stdcall glRasterPos2s( long long ) +@ stdcall glRasterPos2sv( ptr ) +@ stdcall glRasterPos3d( double double double ) +@ stdcall glRasterPos3dv( ptr ) +@ stdcall glRasterPos3f( long long long ) +@ stdcall glRasterPos3fv( ptr ) +@ stdcall glRasterPos3i( long long long ) +@ stdcall glRasterPos3iv( ptr ) +@ stdcall glRasterPos3s( long long long ) +@ stdcall glRasterPos3sv( ptr ) +@ stdcall glRasterPos4d( double double double double ) +@ stdcall glRasterPos4dv( ptr ) +@ stdcall glRasterPos4f( long long long long ) +@ stdcall glRasterPos4fv( ptr ) +@ stdcall glRasterPos4i( long long long long ) +@ stdcall glRasterPos4iv( ptr ) +@ stdcall glRasterPos4s( long long long long ) +@ stdcall glRasterPos4sv( ptr ) +@ stdcall glReadBuffer( long ) +@ stdcall glReadPixels( long long long long long long ptr ) +@ stdcall glRectd( double double double double ) +@ stdcall glRectdv( ptr ptr ) +@ stdcall glRectf( long long long long ) +@ stdcall glRectfv( ptr ptr ) +@ stdcall glRecti( long long long long ) +@ stdcall glRectiv( ptr ptr ) +@ stdcall glRects( long long long long ) +@ stdcall glRectsv( ptr ptr ) +@ stdcall glRenderMode( long ) +#@ stdcall glResetHistogram( long ) +#@ stdcall glResetMinmax( long ) +@ stdcall glRotated( double double double double ) +@ stdcall glRotatef( long long long long ) +@ stdcall glScaled( double double double ) +@ stdcall glScalef( long long long ) +@ stdcall glScissor( long long long long ) +@ stdcall glSelectBuffer( long ptr ) +#@ stdcall glSeparableFilter2D( long long long long long long ptr ptr ) +@ stdcall glShadeModel( long ) +@ stdcall glStencilFunc( long long long ) +@ stdcall glStencilMask( long ) +@ stdcall glStencilOp( long long long ) +@ stdcall glTexCoord1d( double ) +@ stdcall glTexCoord1dv( ptr ) +@ stdcall glTexCoord1f( long ) +@ stdcall glTexCoord1fv( ptr ) +@ stdcall glTexCoord1i( long ) +@ stdcall glTexCoord1iv( ptr ) +@ stdcall glTexCoord1s( long ) +@ stdcall glTexCoord1sv( ptr ) +@ stdcall glTexCoord2d( double double ) +@ stdcall glTexCoord2dv( ptr ) +@ stdcall glTexCoord2f( long long ) +@ stdcall glTexCoord2fv( ptr ) +@ stdcall glTexCoord2i( long long ) +@ stdcall glTexCoord2iv( ptr ) +@ stdcall glTexCoord2s( long long ) +@ stdcall glTexCoord2sv( ptr ) +@ stdcall glTexCoord3d( double double double ) +@ stdcall glTexCoord3dv( ptr ) +@ stdcall glTexCoord3f( long long long ) +@ stdcall glTexCoord3fv( ptr ) +@ stdcall glTexCoord3i( long long long ) +@ stdcall glTexCoord3iv( ptr ) +@ stdcall glTexCoord3s( long long long ) +@ stdcall glTexCoord3sv( ptr ) +@ stdcall glTexCoord4d( double double double double ) +@ stdcall glTexCoord4dv( ptr ) +@ stdcall glTexCoord4f( long long long long ) +@ stdcall glTexCoord4fv( ptr ) +@ stdcall glTexCoord4i( long long long long ) +@ stdcall glTexCoord4iv( ptr ) +@ stdcall glTexCoord4s( long long long long ) +@ stdcall glTexCoord4sv( ptr ) +@ stdcall glTexCoordPointer( long long long ptr ) +@ stdcall glTexEnvf( long long long ) +@ stdcall glTexEnvfv( long long ptr ) +@ stdcall glTexEnvi( long long long ) +@ stdcall glTexEnviv( long long ptr ) +@ stdcall glTexGend( long long double ) +@ stdcall glTexGendv( long long ptr ) +@ stdcall glTexGenf( long long long ) +@ stdcall glTexGenfv( long long ptr ) +@ stdcall glTexGeni( long long long ) +@ stdcall glTexGeniv( long long ptr ) +@ stdcall glTexImage1D( long long long long long long long ptr ) +@ stdcall glTexImage2D( long long long long long long long long ptr ) +#@ stdcall glTexImage3D( long long long long long long long long long ptr ) +@ stdcall glTexParameterf( long long long ) +@ stdcall glTexParameterfv( long long ptr ) +@ stdcall glTexParameteri( long long long ) +@ stdcall glTexParameteriv( long long ptr ) +@ stdcall glTexSubImage1D( long long long long long long ptr ) +@ stdcall glTexSubImage2D( long long long long long long long long ptr ) +#@ stdcall glTexSubImage3D( long long long long long long long long long long ptr ) +@ stdcall glTranslated( double double double ) +@ stdcall glTranslatef( long long long ) +@ stdcall glVertex2d( double double ) +@ stdcall glVertex2dv( ptr ) +@ stdcall glVertex2f( long long ) +@ stdcall glVertex2fv( ptr ) +@ stdcall glVertex2i( long long ) +@ stdcall glVertex2iv( ptr ) +@ stdcall glVertex2s( long long ) +@ stdcall glVertex2sv( ptr ) +@ stdcall glVertex3d( double double double ) +@ stdcall glVertex3dv( ptr ) +@ stdcall glVertex3f( long long long ) +@ stdcall glVertex3fv( ptr ) +@ stdcall glVertex3i( long long long ) +@ stdcall glVertex3iv( ptr ) +@ stdcall glVertex3s( long long long ) +@ stdcall glVertex3sv( ptr ) +@ stdcall glVertex4d( double double double double ) +@ stdcall glVertex4dv( ptr ) +@ stdcall glVertex4f( long long long long ) +@ stdcall glVertex4fv( ptr ) +@ stdcall glVertex4i( long long long long ) +@ stdcall glVertex4iv( ptr ) +@ stdcall glVertex4s( long long long long ) +@ stdcall glVertex4sv( ptr ) +@ stdcall glVertexPointer( long long long ptr ) +@ stdcall glViewport( long long long long ) + +@ stdcall wglChoosePixelFormat(long ptr) rosglChoosePixelFormat +@ stdcall wglCopyContext(long long long) rosglCopyContext +@ stdcall wglCreateContext(long) rosglCreateContext +@ stdcall wglCreateLayerContext(long long) rosglCreateLayerContext +@ stdcall wglDeleteContext(long) rosglDeleteContext +@ stdcall wglDescribeLayerPlane(long long long long ptr) rosglDescribeLayerPlane +@ stdcall wglDescribePixelFormat(long long long ptr) rosglDescribePixelFormat +@ stdcall wglGetCurrentContext() rosglGetCurrentContext +@ stdcall wglGetCurrentDC() rosglGetCurrentDC +@ stdcall wglGetDefaultProcAddress(ptr) rosglGetDefaultProcAddress +@ stdcall wglGetLayerPaletteEntries(long long long long ptr) rosglGetLayerPaletteEntries +@ stdcall wglGetPixelFormat(long) rosglGetPixelFormat +@ stdcall wglGetProcAddress(str) rosglGetProcAddress +@ stdcall wglMakeCurrent(long long) rosglMakeCurrent +@ stdcall wglRealizeLayerPalette(long long long) rosglRealizeLayerPalette +@ stdcall wglSetLayerPaletteEntries(long long long long ptr) rosglSetLayerPaletteEntries +@ stdcall wglSetPixelFormat(long long ptr) rosglSetPixelFormat +@ stdcall wglShareLists(long long) rosglShareLists +@ stdcall wglSwapBuffers(long) rosglSwapBuffers +@ stdcall wglSwapLayerBuffers(long long) rosglSwapLayerBuffers +@ stdcall wglUseFontBitmapsA(long long long long) rosglUseFontBitmapsA +@ stdcall wglUseFontBitmapsW(long long long long) rosglUseFontBitmapsW +@ stdcall wglUseFontOutlinesA(long long long long long long long ptr) rosglUseFontOutlinesA +@ stdcall wglUseFontOutlinesW(long long long long long long long ptr) rosglUseFontOutlinesW From fd1faed0cf6835dfb14318654c5d257b7d8de352 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 25 Sep 2008 05:13:21 +0000 Subject: [PATCH 317/388] Remove hack in cstub.c, it was caused by a hack in the rbuild file. Fix fill_table() definition for non i386. svn path=/branches/ros-amd64-bringup/; revision=36503 --- reactos/dll/win32/rpcrt4/cproxy.c | 2 +- reactos/dll/win32/rpcrt4/cstub.c | 2 +- reactos/dll/win32/rpcrt4/rpcrt4.rbuild | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/rpcrt4/cproxy.c b/reactos/dll/win32/rpcrt4/cproxy.c index 26e5c416c9c..084285a5458 100644 --- a/reactos/dll/win32/rpcrt4/cproxy.c +++ b/reactos/dll/win32/rpcrt4/cproxy.c @@ -56,7 +56,7 @@ typedef struct { static const IRpcProxyBufferVtbl StdProxy_Vtbl; -#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - FIELD_OFFSET(impl,field)) +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) /* How the Windows stubless proxy thunks work is explained at * http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp, diff --git a/reactos/dll/win32/rpcrt4/cstub.c b/reactos/dll/win32/rpcrt4/cstub.c index cd07c297390..d0b24c98dfb 100644 --- a/reactos/dll/win32/rpcrt4/cstub.c +++ b/reactos/dll/win32/rpcrt4/cstub.c @@ -194,7 +194,7 @@ static void fill_table(IUnknownVtbl *vtbl, void **methods, DWORD num) #else /* __i386__ */ typedef struct {int dummy;} vtbl_method_t; -static void fill_table(IUnknownVtbl *vtbl, DWORD num) +static void fill_table(IUnknownVtbl *vtbl, void **methods, DWORD num) { ERR("delegated stubs are not supported on this architecture\n"); } diff --git a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild index 092e9f17986..25ab4113d00 100644 --- a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild +++ b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild @@ -7,7 +7,6 @@ 0x600 0x501 0x501 - From 6f35805a2837bf1f7f59076e0c2aa3b615131619 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 25 Sep 2008 05:15:16 +0000 Subject: [PATCH 318/388] Fix redefinition warning. svn path=/branches/ros-amd64-bringup/; revision=36504 --- reactos/include/host/typedefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/host/typedefs.h b/reactos/include/host/typedefs.h index bdc4d3763e2..c292fff95ab 100644 --- a/reactos/include/host/typedefs.h +++ b/reactos/include/host/typedefs.h @@ -40,7 +40,7 @@ #define OPTIONAL #define FALSE 0 -#define TRUE (!(FALSE)) +#define TRUE 1 /* FIXME: this value is target specific, host tools MUST not use it * and this line has to be removed */ From 9efd1ef0be6a3762ebcaa733be50ffb39ac4b117 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 25 Sep 2008 05:43:26 +0000 Subject: [PATCH 319/388] Convert to spec. Protect _WIN32_WINNT from redefinition warning. svn path=/branches/ros-amd64-bringup/; revision=36505 --- reactos/dll/win32/glu32/glu32.def | 60 ------------------------- reactos/dll/win32/glu32/glu32.rbuild | 3 +- reactos/dll/win32/glu32/glu32.spec | 53 ++++++++++++++++++++++ reactos/dll/win32/glu32/include/gluos.h | 4 ++ 4 files changed, 59 insertions(+), 61 deletions(-) delete mode 100644 reactos/dll/win32/glu32/glu32.def create mode 100644 reactos/dll/win32/glu32/glu32.spec diff --git a/reactos/dll/win32/glu32/glu32.def b/reactos/dll/win32/glu32/glu32.def deleted file mode 100644 index d6255b19bed..00000000000 --- a/reactos/dll/win32/glu32/glu32.def +++ /dev/null @@ -1,60 +0,0 @@ -EXPORTS -gluBeginCurve@4 -gluBeginPolygon@4 -gluBeginSurface@4 -gluBeginTrim@4 -gluBuild1DMipmapLevels@36 -gluBuild1DMipmaps@24 -gluBuild2DMipmapLevels@40 -gluBuild2DMipmaps@28 -gluBuild3DMipmapLevels@44 -gluBuild3DMipmaps@32 -gluCheckExtension@8 -gluCylinder@36 -gluDeleteNurbsRenderer@4 -gluDeleteQuadric@4 -gluDeleteTess@4 -gluDisk@28 -gluEndCurve@4 -gluEndPolygon@4 -gluEndSurface@4 -gluEndTrim@4 -gluErrorString@4 -gluGetNurbsProperty@12 -gluGetString@4 -gluGetTessProperty@12 -gluLoadSamplingMatrices@16 -gluLookAt@72 -gluNewNurbsRenderer@0 -gluNewQuadric@0 -gluNewTess@0 -gluNextContour@8 -gluNurbsCallback@12 -gluNurbsCallbackData@8 -gluNurbsCallbackDataEXT@8 -gluNurbsCurve@28 -gluNurbsProperty@12 -gluNurbsSurface@44 -gluOrtho2D@32 -gluPartialDisk@44 -gluPerspective@32 -gluPickMatrix@36 -gluProject@48 -gluPwlCurve@20 -gluQuadricCallback@12 -gluQuadricDrawStyle@8 -gluQuadricNormals@8 -gluQuadricOrientation@8 -gluQuadricTexture@8 -gluScaleImage@36 -gluSphere@20 -gluTessBeginContour@4 -gluTessBeginPolygon@8 -gluTessCallback@12 -gluTessEndContour@4 -gluTessEndPolygon@4 -gluTessNormal@28 -gluTessProperty@16 -gluTessVertex@12 -gluUnProject@48 -gluUnProject4@76 diff --git a/reactos/dll/win32/glu32/glu32.rbuild b/reactos/dll/win32/glu32/glu32.rbuild index 4668301fc52..cb2aab1f3ea 100644 --- a/reactos/dll/win32/glu32/glu32.rbuild +++ b/reactos/dll/win32/glu32/glu32.rbuild @@ -1,5 +1,5 @@ - + include libnurbs/internals libnurbs/interface @@ -14,6 +14,7 @@ opengl32 kernel32 gdi32 + glu32.spec bezierEval.cc diff --git a/reactos/dll/win32/glu32/glu32.spec b/reactos/dll/win32/glu32/glu32.spec new file mode 100644 index 00000000000..392f187fd0e --- /dev/null +++ b/reactos/dll/win32/glu32/glu32.spec @@ -0,0 +1,53 @@ +@ stdcall gluBeginCurve(ptr) +@ stdcall gluBeginPolygon(ptr) +@ stdcall gluBeginSurface(ptr) +@ stdcall gluBeginTrim(ptr) +@ stdcall gluBuild1DMipmaps(long long long long long ptr) +@ stdcall gluBuild2DMipmaps(long long long long long long ptr) +@ stdcall gluCheckExtension(str ptr) +@ stdcall gluCylinder(ptr double double double long long) +@ stdcall gluDeleteNurbsRenderer(ptr) +@ stdcall gluDeleteQuadric(ptr) +@ stdcall gluDeleteTess(ptr) +@ stdcall gluDisk(ptr double double long long) +@ stdcall gluEndCurve(ptr) +@ stdcall gluEndPolygon(ptr) +@ stdcall gluEndSurface(ptr) +@ stdcall gluEndTrim(ptr) +@ stdcall gluErrorString(long) +@ stub gluErrorUnicodeStringEXT +@ stdcall gluGetNurbsProperty(ptr long ptr) +@ stdcall gluGetString(long) +@ stdcall gluGetTessProperty(ptr long double) +@ stdcall gluLoadSamplingMatrices(ptr ptr ptr ptr) +@ stdcall gluLookAt(double double double double double double double double double) +@ stdcall gluNewNurbsRenderer() +@ stdcall gluNewQuadric() +@ stdcall gluNewTess() +@ stdcall gluNextContour(ptr long) +@ stdcall gluNurbsCallback(ptr long ptr) +@ stdcall gluNurbsCurve(ptr long ptr long ptr long long) +@ stdcall gluNurbsProperty(ptr long long) +@ stdcall gluNurbsSurface(ptr long ptr long ptr long long ptr long long long) +@ stdcall gluOrtho2D(double double double double) +@ stdcall gluPartialDisk(ptr double double long long double double) +@ stdcall gluPerspective(double double double double) +@ stdcall gluPickMatrix(double double double double ptr) +@ stdcall gluProject(double double double ptr ptr ptr ptr ptr ptr) +@ stdcall gluPwlCurve(ptr long ptr long long) +@ stdcall gluQuadricCallback(ptr long ptr) +@ stdcall gluQuadricDrawStyle(ptr long) +@ stdcall gluQuadricNormals(ptr long) +@ stdcall gluQuadricOrientation(ptr long) +@ stdcall gluQuadricTexture(ptr long) +@ stdcall gluScaleImage(long long long long ptr long long long ptr) +@ stdcall gluSphere(ptr double long long) +@ stdcall gluTessBeginContour(ptr) +@ stdcall gluTessBeginPolygon(ptr ptr) +@ stdcall gluTessCallback(ptr long ptr) +@ stdcall gluTessEndContour(ptr) +@ stdcall gluTessEndPolygon(ptr) +@ stdcall gluTessNormal(ptr double double double) +@ stdcall gluTessProperty(ptr long double) +@ stdcall gluTessVertex(ptr ptr ptr) +@ stdcall gluUnProject(double double double ptr ptr ptr ptr ptr ptr) \ No newline at end of file diff --git a/reactos/dll/win32/glu32/include/gluos.h b/reactos/dll/win32/glu32/include/gluos.h index 755e8b6890c..9675bd78e54 100644 --- a/reactos/dll/win32/glu32/include/gluos.h +++ b/reactos/dll/win32/glu32/include/gluos.h @@ -40,7 +40,11 @@ #define NOIME #define NOMINMAX +#ifdef _WIN32_WINNT +#undef _WIN32_WINNT +#endif #define _WIN32_WINNT 0x0400 + #ifndef STRICT #define STRICT 1 #endif From 050cbc00403ad5479739585b84a7c07111795a81 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 25 Sep 2008 15:56:14 +0000 Subject: [PATCH 320/388] Fix the "fix". svn path=/branches/ros-amd64-bringup/; revision=36511 --- reactos/base/setup/vmwinst/vmwinst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/setup/vmwinst/vmwinst.c b/reactos/base/setup/vmwinst/vmwinst.c index 8c4166ab8d0..73695a5ee59 100644 --- a/reactos/base/setup/vmwinst/vmwinst.c +++ b/reactos/base/setup/vmwinst/vmwinst.c @@ -504,7 +504,7 @@ done: } cleanup: - hThread = (HANDLE)(ULONG_PTR)InterlockedExchange((LONG*)&hInstallationThread, 0); + hThread = InterlockedExchangePointer((PVOID*)&hInstallationThread, 0); if(hThread != NULL) { CloseHandle(hThread); From 5ebf3324ac11675e43f19f6a3180f0e8c2bccc5f Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 28 Sep 2008 08:47:44 +0000 Subject: [PATCH 321/388] Work around bug 3746. Use arch specific def files. svn path=/branches/ros-amd64-bringup/; revision=36562 --- reactos/lib/debugsup/debugsup-ntos-amd64.def | 20 +++++++++++++ ...bugsup-ntos.def => debugsup-ntos-i386.def} | 30 ++++++++++++------- reactos/lib/debugsup/debugsup.rbuild | 4 +-- 3 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 reactos/lib/debugsup/debugsup-ntos-amd64.def rename reactos/lib/debugsup/{debugsup-ntos.def => debugsup-ntos-i386.def} (50%) diff --git a/reactos/lib/debugsup/debugsup-ntos-amd64.def b/reactos/lib/debugsup/debugsup-ntos-amd64.def new file mode 100644 index 00000000000..835682a8b48 --- /dev/null +++ b/reactos/lib/debugsup/debugsup-ntos-amd64.def @@ -0,0 +1,20 @@ +EXPORTS +DbgBreakPoint +DbgBreakPointWithStatus +DbgPrint +DbgPrompt +DbgPrintEx +RtlAssert +RtlUnwind + +;EOF +EXPORTS +DbgBreakPoint +DbgBreakPointWithStatus +DbgPrint +DbgPrompt +DbgPrintEx +RtlAssert +RtlUnwind + +;EOF diff --git a/reactos/lib/debugsup/debugsup-ntos.def b/reactos/lib/debugsup/debugsup-ntos-i386.def similarity index 50% rename from reactos/lib/debugsup/debugsup-ntos.def rename to reactos/lib/debugsup/debugsup-ntos-i386.def index 74763e187e1..2feb454173e 100644 --- a/reactos/lib/debugsup/debugsup-ntos.def +++ b/reactos/lib/debugsup/debugsup-ntos-i386.def @@ -1,10 +1,20 @@ -EXPORTS -DbgBreakPoint@0 -DbgBreakPointWithStatus@4 -DbgPrint -DbgPrompt@12 -DbgPrintEx -RtlAssert@16 -RtlUnwind@16 - -;EOF +EXPORTS +DbgBreakPoint@0 +DbgBreakPointWithStatus@4 +DbgPrint +DbgPrompt@12 +DbgPrintEx +RtlAssert@16 +RtlUnwind@16 + +;EOF +EXPORTS +DbgBreakPoint@0 +DbgBreakPointWithStatus@4 +DbgPrint +DbgPrompt@12 +DbgPrintEx +RtlAssert@16 +RtlUnwind@16 + +;EOF diff --git a/reactos/lib/debugsup/debugsup.rbuild b/reactos/lib/debugsup/debugsup.rbuild index 726633a770e..8ffd7a7acb0 100644 --- a/reactos/lib/debugsup/debugsup.rbuild +++ b/reactos/lib/debugsup/debugsup.rbuild @@ -2,9 +2,9 @@ - + - + From f5ab6f6e1884654fe7d80214b2899647ef850748 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 28 Sep 2008 10:56:06 +0000 Subject: [PATCH 322/388] remove duplicate definitions svn path=/branches/ros-amd64-bringup/; revision=36570 --- reactos/hal/halx86/include/apic.h | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/reactos/hal/halx86/include/apic.h b/reactos/hal/halx86/include/apic.h index a05c0d78e90..87d3b52323d 100644 --- a/reactos/hal/halx86/include/apic.h +++ b/reactos/hal/halx86/include/apic.h @@ -119,30 +119,6 @@ #define APIC_TDCR_128 0x0A #define APIC_TDCR_1 0x0B -#define APIC_LVT_VECTOR (0xFF << 0) /* Vector */ -#define APIC_LVT_DS (0x1 << 12) /* Delivery Status */ -#define APIC_LVT_REMOTE_IRR (0x1 << 14) /* Remote IRR */ -#define APIC_LVT_LEVEL_TRIGGER (0x1 << 15) /* Lvel Triggered */ -#define APIC_LVT_MASKED (0x1 << 16) /* Mask */ -#define APIC_LVT_PERIODIC (0x1 << 17) /* Timer Mode */ - -#define APIC_LVT3_DM (0x7 << 8) -#define APIC_LVT3_IIPP (0x1 << 13) -#define APIC_LVT3_TM (0x1 << 15) -#define APIC_LVT3_MASKED (0x1 << 16) -#define APIC_LVT3_OS (0x1 << 17) - -#define APIC_TDCR_TMBASE (0x1 << 2) -#define APIC_TDCR_MASK 0x0F -#define APIC_TDCR_2 0x00 -#define APIC_TDCR_4 0x01 -#define APIC_TDCR_8 0x02 -#define APIC_TDCR_16 0x03 -#define APIC_TDCR_32 0x08 -#define APIC_TDCR_64 0x09 -#define APIC_TDCR_128 0x0A -#define APIC_TDCR_1 0x0B - #define APIC_TARGET_SELF 0x100 #define APIC_TARGET_ALL 0x200 #define APIC_TARGET_ALL_BUT_SELF 0x300 From de42bbb8651c172c064fcbce79a0ade2fc2913d6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 1 Oct 2008 09:44:53 +0000 Subject: [PATCH 323/388] fix usage of InterlockedIncrement svn path=/branches/ros-amd64-bringup/; revision=36605 --- reactos/lib/3rdparty/libxml2/threads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/lib/3rdparty/libxml2/threads.c b/reactos/lib/3rdparty/libxml2/threads.c index a0958e108d0..8cdda85369f 100644 --- a/reactos/lib/3rdparty/libxml2/threads.c +++ b/reactos/lib/3rdparty/libxml2/threads.c @@ -786,7 +786,7 @@ xmlOnceInit(void) { #if defined(HAVE_WIN32_THREADS) if (!run_once.done) { - if (InterlockedIncrement(&run_once.control) == 1) + if (InterlockedIncrement((PLONG)&run_once.control) == 1) { #if !defined(HAVE_COMPILER_TLS) globalkey = TlsAlloc(); From 389a6ea6835b7a044c797f5bf60a127a692708cf Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 1 Oct 2008 16:39:19 +0000 Subject: [PATCH 324/388] Convert to spec. Fix definitions (taken from WINE). svn path=/branches/ros-amd64-bringup/; revision=36614 --- reactos/dll/directx/d3d8/d3d8.c | 23 +++++++++++++++-------- reactos/dll/directx/d3d8/d3d8.def | 6 ------ reactos/dll/directx/d3d8/d3d8.rbuild | 3 ++- reactos/dll/directx/d3d8/d3d8.spec | 5 +++++ 4 files changed, 22 insertions(+), 15 deletions(-) delete mode 100644 reactos/dll/directx/d3d8/d3d8.def create mode 100644 reactos/dll/directx/d3d8/d3d8.spec diff --git a/reactos/dll/directx/d3d8/d3d8.c b/reactos/dll/directx/d3d8/d3d8.c index bcaec14f40d..a0c64966c0a 100644 --- a/reactos/dll/directx/d3d8/d3d8.c +++ b/reactos/dll/directx/d3d8/d3d8.c @@ -3,24 +3,31 @@ #include -HRESULT DLLAPI ValidatePixelShader(void) +HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto) { UNIMPLEMENTED return 0; } -HRESULT DLLAPI ValidateVertexShader(void) -{ - UNIMPLEMENTED - return 0; -} -HRESULT DLLAPI DebugSetMute(DWORD dw1) +HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto) { UNIMPLEMENTED return 0; } -DWORD DLLAPI Direct3DCreate8( UINT SDKVersion ) +HRESULT WINAPI D3D8GetSWInfo(void) +{ + UNIMPLEMENTED + return 0; +} + +HRESULT WINAPI DebugSetMute(void) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI Direct3DCreate8( UINT SDKVersion ) { UNIMPLEMENTED return 0; diff --git a/reactos/dll/directx/d3d8/d3d8.def b/reactos/dll/directx/d3d8/d3d8.def deleted file mode 100644 index c32c183573f..00000000000 --- a/reactos/dll/directx/d3d8/d3d8.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY d3d8 -EXPORTS - ValidatePixelShader - ValidateVertexShader - DebugSetMute - Direct3DCreate8 diff --git a/reactos/dll/directx/d3d8/d3d8.rbuild b/reactos/dll/directx/d3d8/d3d8.rbuild index 0bf477d53b2..274ccb7c1b4 100644 --- a/reactos/dll/directx/d3d8/d3d8.rbuild +++ b/reactos/dll/directx/d3d8/d3d8.rbuild @@ -1,7 +1,8 @@ - + d3d8.c d3d8.rc + d3d8.spec diff --git a/reactos/dll/directx/d3d8/d3d8.spec b/reactos/dll/directx/d3d8/d3d8.spec new file mode 100644 index 00000000000..446778e60d4 --- /dev/null +++ b/reactos/dll/directx/d3d8/d3d8.spec @@ -0,0 +1,5 @@ +@ stdcall D3D8GetSWInfo() +@ stdcall DebugSetMute() +@ stdcall Direct3DCreate8(long) +@ stdcall ValidatePixelShader(ptr long long ptr) +@ stdcall ValidateVertexShader(ptr ptr ptr long ptr) \ No newline at end of file From 5d353cec4ca0e9702aa5bd1552bbd41128c5544b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 7 Oct 2008 04:03:36 +0000 Subject: [PATCH 325/388] Fix incorrect parameter counts for NtGdiEngCreateBitmap, NtGdiEngCreateDeviceSurface, NtGdiEngCreateDeviceBitmap. Don't worry these were just stubs. svn path=/branches/ros-amd64-bringup/; revision=36672 --- reactos/subsystems/win32/win32k/w32ksvc.db | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/subsystems/win32/win32k/w32ksvc.db b/reactos/subsystems/win32/win32k/w32ksvc.db index bedb28e2cc8..d2677d4a28e 100644 --- a/reactos/subsystems/win32/win32k/w32ksvc.db +++ b/reactos/subsystems/win32/win32k/w32ksvc.db @@ -604,9 +604,9 @@ NtUserRemoteRedrawScreen 0 NtUserRemoteStopScreenUpdates 0 NtUserCtxDisplayIOCtl 3 NtGdiEngAssociateSurface 3 -NtGdiEngCreateBitmap 6 -NtGdiEngCreateDeviceSurface 4 -NtGdiEngCreateDeviceBitmap 4 +NtGdiEngCreateBitmap 5 +NtGdiEngCreateDeviceSurface 3 +NtGdiEngCreateDeviceBitmap 3 NtGdiEngCreatePalette 6 NtGdiEngComputeGlyphSet 3 NtGdiEngCopyBits 6 From 391bcc6b311a2ed4f92b5a728e0bb13bf569e342 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Tue, 7 Oct 2008 04:05:18 +0000 Subject: [PATCH 326/388] Finally convert gdi32 to spec file. svn path=/branches/ros-amd64-bringup/; revision=36673 --- reactos/dll/win32/gdi32/gdi32.rbuild | 3 +- reactos/dll/win32/gdi32/gdi32.spec | 478 +++++++++++++++++---------- reactos/dll/win32/gdi32/misc/stubs.c | 2 +- 3 files changed, 298 insertions(+), 185 deletions(-) diff --git a/reactos/dll/win32/gdi32/gdi32.rbuild b/reactos/dll/win32/gdi32/gdi32.rbuild index a1924217ef1..6d4062f63a0 100644 --- a/reactos/dll/win32/gdi32/gdi32.rbuild +++ b/reactos/dll/win32/gdi32/gdi32.rbuild @@ -1,5 +1,5 @@ - + include 0x0600 @@ -51,4 +51,5 @@ path.c gdi32.rc + gdi32.spec diff --git a/reactos/dll/win32/gdi32/gdi32.spec b/reactos/dll/win32/gdi32/gdi32.spec index 99df6d1fc0a..e3614ceddb3 100644 --- a/reactos/dll/win32/gdi32/gdi32.spec +++ b/reactos/dll/win32/gdi32/gdi32.spec @@ -1,10 +1,3 @@ -# ordinal exports -100 stdcall @(long long str str str) GDI_CallDevInstall16 -101 stdcall @(long str str ptr) GDI_CallExtDeviceModePropSheet16 -102 stdcall @(long ptr str str ptr str long) GDI_CallExtDeviceMode16 -103 stdcall @(long str ptr ptr) GDI_CallAdvancedSetupDialog16 -104 stdcall @(str str long ptr ptr) GDI_CallDeviceCapabilities16 - @ stdcall AbortDoc(long) @ stdcall AbortPath(long) @ stdcall AddFontMemResourceEx(ptr long ptr ptr) @@ -15,25 +8,35 @@ @ stdcall AddFontResourceW(wstr) @ stdcall AngleArc(long long long long long long) @ stdcall AnimatePalette(long long long ptr) -# @ stub AnyLinkedFonts +@ stdcall AnyLinkedFonts() NtGdiAnyLinkedFonts @ stdcall Arc(long long long long long long long long long) @ stdcall ArcTo(long long long long long long long long long) @ stdcall BeginPath(long) +@ stdcall bInitSystemAndFontsDirectoriesW(wstr wstr) @ stdcall BitBlt(long long long long long long long long long) +@ stdcall bMakePathNameW(wstr wstr wstr long) +@ stdcall BRUSHOBJ_hGetColorTransform(ptr) NtGdiBRUSHOBJ_hGetColorTransform +@ stdcall BRUSHOBJ_pvAllocRbrush(ptr long) NtGdiBRUSHOBJ_pvAllocRbrush +@ stdcall BRUSHOBJ_pvGetRbrush(ptr) NtGdiBRUSHOBJ_pvGetRbrush +@ stdcall BRUSHOBJ_ulGetBrushColor(ptr) NtGdiBRUSHOBJ_ulGetBrushColor @ stub ByeByeGDI @ stdcall CancelDC(long) -@ stub CheckColorsInGamut +@ stdcall cGetTTFFromFOT(long long long long long long long) +@ stdcall CheckColorsInGamut(ptr ptr ptr long) @ stdcall ChoosePixelFormat(long ptr) @ stdcall Chord(long long long long long long long long long) -# @ stub ClearBitmapAttributes -# @ stub ClearBrushAttributes +@ stdcall ClearBitmapAttributes(ptr long) +@ stdcall ClearBrushAttributes(ptr long) +@ stdcall CLIPOBJ_bEnum(ptr long long) NtGdiCLIPOBJ_bEnum +@ stdcall CLIPOBJ_cEnumStart(ptr long long long long) NtGdiCLIPOBJ_cEnumStart +@ stdcall CLIPOBJ_ppoGetPath(ptr) NtGdiCLIPOBJ_ppoGetPath @ stdcall CloseEnhMetaFile(long) @ stdcall CloseFigure(long) @ stdcall CloseMetaFile(long) -@ stub ColorCorrectPalette -@ stub ColorMatchToTarget +@ stdcall ColorCorrectPalette(ptr ptr long long) +@ stdcall ColorMatchToTarget(ptr ptr long) @ stdcall CombineRgn(long long long long) -@ stdcall CombineTransform(ptr ptr ptr) +@ stdcall CombineTransform(ptr ptr ptr) NtGdiCombineTransform @ stdcall CopyEnhMetaFileA(long str) @ stdcall CopyEnhMetaFileW(long wstr) @ stdcall CopyMetaFileA(long str) @@ -47,12 +50,12 @@ @ stdcall CreateCompatibleDC(long) @ stdcall CreateDCA(str str str ptr) @ stdcall CreateDCW(wstr wstr wstr ptr) +@ stdcall CreateDIBitmap(long ptr long ptr ptr long) @ stdcall CreateDIBPatternBrush(long long) @ stdcall CreateDIBPatternBrushPt(long long) @ stdcall CreateDIBSection(long ptr long ptr long long) -@ stdcall CreateDIBitmap(long ptr long ptr ptr long) @ stdcall CreateDiscardableBitmap(long long long) -@ stdcall CreateEllipticRgn(long long long long) +@ stdcall CreateEllipticRgn(long long long long) NtGdiCreateEllipticRgn @ stdcall CreateEllipticRgnIndirect(ptr) @ stdcall CreateEnhMetaFileA(long str ptr str) @ stdcall CreateEnhMetaFileW(long wstr ptr wstr) @@ -62,7 +65,7 @@ # @ stub CreateFontIndirectExW @ stdcall CreateFontIndirectW(ptr) @ stdcall CreateFontW(long long long long long long long long long long long long long wstr) -@ stdcall CreateHalftonePalette(long) +@ stdcall CreateHalftonePalette(long) NtGdiCreateHalftonePalette @ stdcall CreateHatchBrush(long long) @ stdcall CreateICA(str str str ptr) @ stdcall CreateICW(wstr wstr wstr ptr) @@ -76,27 +79,130 @@ @ stdcall CreatePolygonRgn(ptr long long) @ stdcall CreateRectRgn(long long long long) @ stdcall CreateRectRgnIndirect(ptr) -@ stdcall CreateRoundRectRgn(long long long long long long) +@ stdcall CreateRoundRectRgn(long long long long long long) NtGdiCreateRoundRectRgn @ stdcall CreateScalableFontResourceA(long str str str) @ stdcall CreateScalableFontResourceW(long wstr wstr wstr) @ stdcall CreateSolidBrush(long) -@ stdcall DPtoLP(long ptr long) -@ stdcall DeleteColorSpace(long) +@ stdcall DdEntry0(ptr ptr ptr ptr ptr ptr) NtGdiDxgGenericThunk +@ stdcall DdEntry10(ptr ptr) NtGdiDdBeginMoCompFrame +@ stdcall DdEntry11(ptr ptr ptr) NtGdiDdBlt +@ stdcall DdEntry12(ptr ptr) NtGdiDdCanCreateSurface +@ stdcall DdEntry13(ptr ptr) NtGdiDdCanCreateD3DBuffer +@ stdcall DdEntry14(ptr ptr) NtGdiDdColorControl +@ stdcall DdEntry15(ptr) NtGdiDdCreateDirectDrawObject +@ stdcall DdEntry16(ptr ptr ptr ptr ptr ptr ptr ptr) NtGdiDdCreateSurface +@ stdcall DdEntry17(ptr ptr ptr ptr ptr ptr ptr ptr) NtGdiDdCreateD3DBuffer +@ stdcall DdEntry18(ptr ptr) NtGdiDdCreateMoComp +@ stdcall DdEntry19(ptr ptr ptr ptr ptr long) NtGdiDdCreateSurfaceObject +@ stdcall DdEntry1(ptr ptr ptr ptr) NtGdiD3dContextCreate +@ stdcall DdEntry20(ptr) NtGdiDdDeleteDirectDrawObject +@ stdcall DdEntry21(ptr) NtGdiDdDeleteSurfaceObject +@ stdcall DdEntry22(ptr ptr) NtGdiDdDestroyMoComp +@ stdcall DdEntry23(ptr long) NtGdiDdDestroySurface +@ stdcall DdEntry24(ptr) NtGdiDdDestroyD3DBuffer +@ stdcall DdEntry25(ptr ptr) NtGdiDdEndMoCompFrame +@ stdcall DdEntry26(ptr ptr ptr ptr ptr) NtGdiDdFlip +@ stdcall DdEntry27(ptr long) NtGdiDdFlipToGDISurface +@ stdcall DdEntry28(ptr ptr) NtGdiDdGetAvailDriverMemory +@ stdcall DdEntry29(ptr ptr) NtGdiDdGetBltStatus +@ stdcall DdEntry2(ptr)NtGdiD3dContextDestroy +@ stdcall DdEntry30(ptr ptr) NtGdiDdGetDC +@ stdcall DdEntry31(ptr ptr) NtGdiDdGetDriverInfo +@ stdcall DdEntry32(ptr ptr long) NtGdiDdGetDxHandle +@ stdcall DdEntry33(ptr ptr) NtGdiDdGetFlipStatus +@ stdcall DdEntry34(ptr ptr) NtGdiDdGetInternalMoCompInfo +@ stdcall DdEntry35(ptr ptr) NtGdiDdGetMoCompBuffInfo +@ stdcall DdEntry36(ptr ptr) NtGdiDdGetMoCompGuids +@ stdcall DdEntry37(ptr ptr) NtGdiDdGetMoCompFormats +@ stdcall DdEntry38(ptr ptr) NtGdiDdGetScanLine +@ stdcall DdEntry39(ptr ptr ptr) NtGdiDdLock +@ stdcall DdEntry3(ptr) NtGdiD3dContextDestroyAll +@ stdcall DdEntry40(ptr ptr) NtGdiDdLockD3D +@ stdcall DdEntry41(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) NtGdiDdQueryDirectDrawObject +@ stdcall DdEntry42(ptr ptr) NtGdiDdQueryMoCompStatus +@ stdcall DdEntry43(ptr ptr) NtGdiDdReenableDirectDrawObject +@ stdcall DdEntry44(ptr) NtGdiDdReleaseDC +@ stdcall DdEntry45(ptr ptr) NtGdiDdRenderMoComp +@ stdcall DdEntry46(ptr ptr) NtGdiDdResetVisrgn +@ stdcall DdEntry47(ptr ptr) NtGdiDdSetColorKey +@ stdcall DdEntry48(ptr ptr) NtGdiDdSetExclusiveMode +@ stdcall DdEntry49(ptr ptr ptr) NtGdiDdSetGammaRamp +@ stdcall DdEntry4(ptr) NtGdiD3dValidateTextureStageState +@ stdcall DdEntry50(ptr ptr long)NtGdiDdCreateSurfaceEx +@ stdcall DdEntry51(ptr ptr ptr) NtGdiDdSetOverlayPosition +@ stdcall DdEntry52(ptr ptr) NtGdiDdUnattachSurface +@ stdcall DdEntry53(ptr ptr) NtGdiDdUnlock +@ stdcall DdEntry54(ptr ptr) NtGdiDdUnlockD3D +@ stdcall DdEntry55(ptr ptr long) NtGdiDdUpdateOverlay +@ stdcall DdEntry56(ptr ptr) NtGdiDdWaitForVerticalBlank +@ stdcall DdEntry5(ptr ptr ptr ptr ptr ptr ptr) NtGdiD3dDrawPrimitives2 +@ stdcall DdEntry6(ptr) NtGdiDdGetDriverState +@ stdcall DdEntry7(ptr ptr ptr) NtGdiDdAddAttachedSurface +@ stdcall DdEntry8(ptr ptr ptr) NtGdiDdAlphaBlt +@ stdcall DdEntry9(ptr ptr) NtGdiDdAttachSurface +@ stdcall DeleteColorSpace(long) NtGdiDeleteColorSpace @ stdcall DeleteDC(long) @ stdcall DeleteEnhMetaFile(long) @ stdcall DeleteMetaFile(long) @ stdcall DeleteObject(long) @ stdcall DescribePixelFormat(long long long ptr) @ stub DeviceCapabilitiesEx -@ stub DeviceCapabilitiesExA -@ stub DeviceCapabilitiesExW +@ stdcall DeviceCapabilitiesExA(str str long str ptr) +@ stdcall DeviceCapabilitiesExW(wstr wstr long wstr ptr) +@ stdcall DPtoLP(long ptr long) @ stdcall DrawEscape(long long long ptr) @ stdcall Ellipse(long long long long long) -@ stdcall EnableEUDC(long) +@ stdcall EnableEUDC(long) NtGdiEnableEudc @ stdcall EndDoc(long) -# @ stub EndFormPage +@ stdcall EndFormPage(ptr) @ stdcall EndPage(long) @ stdcall EndPath(long) +@ stdcall EngAcquireSemaphore(ptr) +@ stdcall EngAlphaBlend(ptr ptr ptr ptr ptr ptr ptr) NtGdiEngAlphaBlend +@ stdcall EngAssociateSurface(ptr ptr long) NtGdiEngAssociateSurface +@ stdcall EngBitBlt(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) NtGdiEngBitBlt +@ stdcall EngCheckAbort(ptr) NtGdiEngCheckAbort +@ stdcall EngComputeGlyphSet(ptr ptr ptr) +@ stdcall EngCopyBits(ptr ptr ptr ptr ptr ptr) NtGdiEngCopyBits +@ stdcall EngCreateBitmap(ptr long long ptr ptr) NtGdiEngCreateBitmap +@ stdcall EngCreateClip() NtGdiEngCreateClip +@ stdcall EngCreateDeviceBitmap(ptr ptr long) NtGdiEngCreateDeviceBitmap +@ stdcall EngCreateDeviceSurface(ptr ptr long) NtGdiEngCreateDeviceSurface +@ stdcall EngCreatePalette(long long ptr long long long) NtGdiEngCreatePalette +@ stdcall EngCreateSemaphore() +@ stdcall EngDeleteClip(ptr) NtGdiEngDeleteClip +@ stdcall EngDeletePalette(ptr) NtGdiEngDeletePalette +@ stdcall EngDeletePath(ptr) NtGdiEngDeletePath +@ stdcall EngDeleteSemaphore(ptr) +@ stdcall EngDeleteSurface(ptr) NtGdiEngDeleteSurface +@ stdcall EngEraseSurface(ptr ptr long) NtGdiEngEraseSurface +@ stdcall EngFillPath(ptr ptr ptr ptr ptr ptr ptr) NtGdiEngFillPath +@ stdcall EngFindResource(ptr long long ptr) +@ stdcall EngFreeModule(ptr) +@ stdcall EngGetCurrentCodePage(ptr ptr) +@ stdcall EngGetDriverName(ptr) +@ stdcall EngGetPrinterDataFileName(ptr) +@ stdcall EngGradientFill(ptr ptr ptr ptr long ptr long ptr ptr long) NtGdiEngGradientFill +@ stdcall EngLineTo(ptr ptr ptr long long long long ptr ptr) NtGdiEngLineTo +@ stdcall EngLoadModule(ptr) +@ stdcall EngLockSurface(ptr) NtGdiEngLockSurface +@ stdcall EngMarkBandingSurface(ptr) NtGdiEngMarkBandingSurface +@ stdcall EngMultiByteToUnicodeN(wstr long ptr str long) RtlMultiByteToUnicodeN +@ stdcall EngMultiByteToWideChar(long wstr long str long) +@ stdcall EngPaint(ptr ptr ptr ptr ptr) NtGdiEngPaint +@ stdcall EngPlgBlt(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr long) NtGdiEngPlgBlt +@ stdcall EngQueryEMFInfo(ptr ptr) +@ stdcall EngQueryLocalTime(ptr) +@ stdcall EngReleaseSemaphore(ptr) +@ stdcall EngStretchBlt(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr long) NtGdiEngStretchBlt +@ stdcall EngStretchBltROP(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr long ptr long) NtGdiEngStretchBltROP +@ stdcall EngStrokeAndFillPath(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) NtGdiEngStrokeAndFillPath +@ stdcall EngStrokePath(ptr ptr ptr ptr ptr ptr ptr ptr) NtGdiEngStrokePath +@ stdcall EngTextOut(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) NtGdiEngTextOut +@ stdcall EngTransparentBlt(ptr ptr ptr ptr ptr ptr long long) NtGdiEngTransparentBlt +@ stdcall EngUnicodeToMultiByteN(str long long wstr long) RtlUnicodeToMultiByteN +@ stdcall EngUnlockSurface(ptr) NtGdiEngUnlockSurface +@ stdcall EngWideCharToMultiByte(long wstr long str long) @ stdcall EnumEnhMetaFile(long long ptr ptr ptr) @ stdcall EnumFontFamiliesA(long str ptr long) @ stdcall EnumFontFamiliesExA(long ptr ptr long long) @@ -108,10 +214,10 @@ @ stdcall EnumICMProfilesW(long ptr long) @ stdcall EnumMetaFile(long long ptr ptr) @ stdcall EnumObjects(long long ptr long) -@ stdcall EqualRgn(long long) +@ stdcall EqualRgn(long long) NtGdiEqualRgn @ stdcall Escape(long long long ptr ptr) -# @ stub EudcLoadLinkW -# @ stub EudcUnloadLinkW +@ stdcall EudcLoadLinkW(wstr wstr long long) +@ stdcall EudcUnloadLinkW(wstr wstr) @ stdcall ExcludeClipRect(long long long long long) @ stdcall ExtCreatePen(long long ptr long ptr) @ stdcall ExtCreateRegion(ptr long ptr) @@ -125,28 +231,36 @@ @ stdcall FixBrushOrgEx(long long long ptr) @ stdcall FlattenPath(long) @ stdcall FloodFill(long long long long) -@ stdcall FontIsLinked(long) +@ stdcall FontIsLinked(long) NtGdiFontIsLinked +@ stdcall FONTOBJ_cGetAllGlyphHandles(ptr ptr) NtGdiFONTOBJ_cGetAllGlyphHandles +@ stdcall FONTOBJ_cGetGlyphs(ptr long long ptr ptr) NtGdiFONTOBJ_cGetGlyphs +@ stdcall FONTOBJ_pfdg(ptr) NtGdiFONTOBJ_pfdg +@ stdcall FONTOBJ_pifi(ptr) NtGdiFONTOBJ_pifi +@ stdcall FONTOBJ_pQueryGlyphAttrs(ptr long) NtGdiFONTOBJ_pQueryGlyphAttrs +@ stdcall FONTOBJ_pvTrueTypeFontFile(ptr ptr) NtGdiFONTOBJ_pvTrueTypeFontFile +@ stdcall FONTOBJ_pxoGetXform(ptr) NtGdiFONTOBJ_pxoGetXform +@ stdcall FONTOBJ_vGetInfo(ptr long ptr) NtGdiFONTOBJ_vGetInfo @ stdcall FrameRgn(long long long long long) @ stub FreeImageColorMatcher -# @ stub GdiAddFontResourceW -# @ stub GdiAddGlsBounds -# @ stub GdiAddGlsRecord +@ stdcall GdiAddFontResourceW(ptr ptr ptr) +@ stdcall GdiAddGlsBounds(ptr ptr) +@ stdcall GdiAddGlsRecord(ptr long ptr ptr) @ stdcall GdiAlphaBlend(long long long long long long long long long long long) -# @ stub GdiArtificialDecrementDriver +@ stdcall GdiArtificialDecrementDriver(wstr long) @ stub GdiAssociateObject -@ stub GdiCleanCacheDC +@ stdcall GdiCleanCacheDC(ptr) @ stdcall GdiComment(long long ptr) -# @ stub GdiConsoleTextOut +@ stdcall GdiConsoleTextOut(ptr ptr long ptr) NtGdiConsoleTextOut @ stub GdiConvertAndCheckDC @ stub GdiConvertBitmap -# @ stub GdiConvertBitmapV5 -@ stub GdiConvertBrush -@ stub GdiConvertDC -@ stub GdiConvertEnhMetaFile -@ stub GdiConvertFont -@ stub GdiConvertMetaFilePict -@ stub GdiConvertPalette -@ stub GdiConvertRegion +@ stdcall GdiConvertBitmapV5(ptr ptr long long) +@ stdcall GdiConvertBrush(ptr) +@ stdcall GdiConvertDC(ptr) +@ stdcall GdiConvertEnhMetaFile(ptr) +@ stdcall GdiConvertFont(ptr) +@ stdcall GdiConvertMetaFilePict(ptr) +@ stdcall GdiConvertPalette(ptr) +@ stdcall GdiConvertRegion(ptr) @ stdcall GdiConvertToDevmodeW(ptr) @ stub GdiCreateLocalBitmap @ stub GdiCreateLocalBrush @@ -168,126 +282,143 @@ @ stub GdiDciSetDestination @ stub GdiDeleteLocalDC @ stub GdiDeleteLocalObject -# @ stub GdiDeleteSpoolFileHandle -# @ stub GdiDescribePixelFormat -@ stub GdiDllInitialize -# @ stub GdiDrawStream -# @ stub GdiEndDocEMF -# @ stub GdiEndPageEMF -# @ stub GdiFixUpHandle +@ stdcall GdiDeleteSpoolFileHandle(ptr) +@ stdcall GdiDescribePixelFormat(ptr long long ptr) NtGdiDescribePixelFormat +@ stdcall GdiDllInitialize(ptr long ptr) +@ stdcall GdiDrawStream(ptr long ptr) +@ stdcall GdiEndDocEMF(ptr) +@ stdcall GdiEndPageEMF(ptr long) +#@ stdcall GdiEntry1 +#@ stdcall GdiEntry10 +#@ stdcall GdiEntry11 +#@ stdcall GdiEntry12 +#@ stdcall GdiEntry13 +#@ stdcall GdiEntry14 +#@ stdcall GdiEntry15 +#@ stdcall GdiEntry16 +#@ stdcall GdiEntry2 +#@ stdcall GdiEntry3 +#@ stdcall GdiEntry4 +#@ stdcall GdiEntry5 +#@ stdcall GdiEntry6 +#@ stdcall GdiEntry7 +#@ stdcall GdiEntry8 +#@ stdcall GdiEntry9 +@ stdcall GdiFixUpHandle(ptr) @ stdcall GdiFlush() -# @ stub GdiFullscreenControl +@ stdcall GdiFullscreenControl(ptr ptr long ptr ptr) NtGdiFullscreenControl @ stdcall GdiGetBatchLimit() @ stdcall GdiGetCharDimensions(long ptr ptr) @ stdcall GdiGetCodePage(long) -# @ stub GdiGetDC -# @ stub GdiGetDevmodeForPage +@ stdcall GdiGetDC(ptr) +@ stdcall GdiGetDevmodeForPage(ptr long ptr ptr) @ stub GdiGetLocalBitmap @ stub GdiGetLocalBrush @ stub GdiGetLocalDC @ stub GdiGetLocalFont -# @ stub GdiGetPageCount -# @ stub GdiGetPageHandle -# @ stub GdiGetSpoolFileHandle -@ stdcall GdiGetSpoolMessage(ptr long ptr long) +@ stdcall GdiGetPageCount(ptr) +@ stdcall GdiGetPageHandle(ptr long ptr) +@ stdcall GdiGetSpoolFileHandle(wstr ptr wstr) +@ stdcall GdiGetSpoolMessage(ptr long ptr long) NtGdiGetSpoolMessage @ stdcall GdiGradientFill(long ptr long ptr long long) -@ stdcall GdiInitSpool() -# @ stub GdiInitializeLanguagePack +@ stdcall GdiInitializeLanguagePack(long) +@ stdcall GdiInitSpool() NtGdiInitSpool @ stdcall GdiIsMetaFileDC(long) @ stdcall GdiIsMetaPrintDC(long) @ stdcall GdiIsPlayMetafileDC(long) -@ stub GdiPlayDCScript -# @ stub GdiPlayEMF -@ stub GdiPlayJournal -# @ stub GdiPlayPageEMF -# @ stub GdiPlayPrivatePageEMF -@ stub GdiPlayScript -# @ stub GdiPrinterThunk -# @ stub GdiProcessSetup -# @ stub GdiQueryFonts -# @ stub GdiQueryTable +@ stdcall GdiPlayDCScript(long long long long long long) +@ stdcall GdiPlayEMF(wstr ptr wstr ptr ptr) +@ stdcall GdiPlayJournal(long long long long long) +@ stdcall GdiPlayPageEMF(ptr ptr ptr ptr ptr) +@ stdcall GdiPlayPrivatePageEMF(ptr long ptr) +@ stdcall GdiPlayScript(ptr ptr ptr ptr ptr ptr ptr) +@ stdcall GdiPlaySpoolStream(long long long long long long) +@ stdcall GdiPrinterThunk(ptr ptr long) +@ stdcall GdiProcessSetup() +@ stdcall GdiQueryFonts(ptr long ptr) NtGdiQueryFonts +@ stdcall GdiQueryTable() @ stdcall GdiRealizationInfo(long ptr) -# @ stub GdiReleaseDC -@ stub GdiReleaseLocalDC -# @ stub GdiResetDCEMF -@ stub GdiSetAttrs +@ stdcall GdiReleaseDC(ptr) +@ stdcall GdiReleaseLocalDC(ptr) +@ stdcall GdiResetDCEMF(ptr ptr) +@ stdcall GdiSetAttrs(ptr) @ stdcall GdiSetBatchLimit(long) -# @ stub GdiSetLastError -# @ stub GdiSetPixelFormat -@ stub GdiSetServerAttr -# @ stub GdiStartDocEMF -# @ stub GdiStartPageEMF -# @ stub GdiSwapBuffers +@ stdcall GdiSetLastError(long) +@ stdcall GdiSetPixelFormat(ptr long) NtGdiSetPixelFormat +@ stdcall GdiSetServerAttr(ptr long) +@ stdcall GdiStartDocEMF(ptr ptr) +@ stdcall GdiStartPageEMF(ptr) +@ stub GdiSwapBuffers @ stdcall GdiTransparentBlt(long long long long long long long long long long long) -# @ stub GdiValidateHandle +@ stdcall GdiValidateHandle(ptr) @ stub GdiWinWatchClose @ stub GdiWinWatchDidStatusChange @ stub GdiWinWatchGetClipList @ stub GdiWinWatchOpen @ stdcall GetArcDirection(long) @ stdcall GetAspectRatioFilterEx(long ptr) -# @ stub GetBitmapAttributes -@ stdcall GetBitmapBits(long long ptr) -@ stdcall GetBitmapDimensionEx(long ptr) +@ stdcall GetBitmapAttributes(ptr) +@ stdcall GetBitmapBits(long long ptr) NtGdiGetBitmapBits +@ stdcall GetBitmapDimensionEx(long ptr) NtGdiGetBitmapDimension @ stdcall GetBkColor(long) @ stdcall GetBkMode(long) @ stdcall GetBoundsRect(long ptr long) -# @ stub GetBrushAttributes +@ stdcall GetBrushAttributes(ptr) @ stdcall GetBrushOrgEx(long ptr) @ stdcall GetCharABCWidthsA(long long long ptr) @ stdcall GetCharABCWidthsFloatA(long long long ptr) @ stdcall GetCharABCWidthsFloatW(long long long ptr) @ stdcall GetCharABCWidthsI(long long long ptr ptr) @ stdcall GetCharABCWidthsW(long long long ptr) +@ stdcall GetCharacterPlacementA(long str long long ptr long) +@ stdcall GetCharacterPlacementW(long wstr long long ptr long) @ stdcall GetCharWidth32A(long long long long) @ stdcall GetCharWidth32W(long long long long) @ stdcall GetCharWidthA(long long long long) GetCharWidth32A @ stdcall GetCharWidthFloatA(long long long ptr) @ stdcall GetCharWidthFloatW(long long long ptr) @ stdcall GetCharWidthI(ptr long long ptr ptr) -# @ stub GetCharWidthInfo -@ stdcall GetCharWidthW(long long long long) GetCharWidth32W +@ stdcall GetCharWidthInfo(ptr ptr) NtGdiGetCharWidthInfo +@ stdcall GetCharWidthW(long long long long) @ stub GetCharWidthWOW -@ stdcall GetCharacterPlacementA(long str long long ptr long) -@ stdcall GetCharacterPlacementW(long wstr long long ptr long) @ stdcall GetClipBox(long ptr) @ stdcall GetClipRgn(long long) -@ stdcall GetColorAdjustment(long ptr) +@ stdcall GetColorAdjustment(long ptr) NtGdiGetColorAdjustment @ stdcall GetColorSpace(long) @ stdcall GetCurrentObject(long long) @ stdcall GetCurrentPositionEx(long ptr) @ stdcall GetDCBrushColor(long) @ stdcall GetDCOrgEx(long ptr) @ stdcall GetDCPenColor(long) -@ stdcall GetDIBColorTable(long long long ptr) -@ stdcall GetDIBits(long long long long ptr ptr long) @ stdcall GetDeviceCaps(long long) @ stdcall GetDeviceGammaRamp(long ptr) -@ stub GetETM -# @ stub GetEUDCTimeStamp -# @ stub GetEUDCTimeStampExW +@ stdcall GetDIBColorTable(long long long ptr) +@ stdcall GetDIBits(long long long long ptr ptr long) @ stdcall GetEnhMetaFileA(str) @ stdcall GetEnhMetaFileBits(long long ptr) @ stdcall GetEnhMetaFileDescriptionA(long long ptr) @ stdcall GetEnhMetaFileDescriptionW(long long ptr) @ stdcall GetEnhMetaFileHeader(long long ptr) @ stdcall GetEnhMetaFilePaletteEntries (long long ptr) -# @ stub GetEnhMetaFilePixelFormat +@ stdcall GetEnhMetaFilePixelFormat(ptr long ptr) @ stdcall GetEnhMetaFileW(wstr) +@ stub GetETM +# @ stub GetEUDCTimeStamp +# @ stub GetEUDCTimeStampExW # @ stub GetFontAssocStatus @ stdcall GetFontData(long long long ptr long) @ stdcall GetFontLanguageInfo(long) @ stub GetFontResourceInfo @ stub GetFontResourceInfoW -@ stdcall GetFontUnicodeRanges(ptr ptr) +@ stdcall GetFontUnicodeRanges(ptr ptr) NtGdiGetFontUnicodeRanges @ stdcall GetGlyphIndicesA(long ptr long ptr long) -@ stdcall GetGlyphIndicesW(long ptr long ptr long) +@ stdcall GetGlyphIndicesW(long ptr long ptr long) NtGdiGetGlyphIndicesW @ stdcall GetGlyphOutline(long long long ptr long ptr ptr) GetGlyphOutlineA @ stdcall GetGlyphOutlineA(long long long ptr long ptr ptr) @ stdcall GetGlyphOutlineW(long long long ptr long ptr ptr) -@ stub GetGlyphOutlineWow +@ stdcall GetGlyphOutlineWow(long long long long long long long) @ stdcall GetGraphicsMode(long) -# @ stub GetHFONT +@ stdcall GetHFONT(ptr) @ stdcall GetICMProfileA(long ptr ptr) @ stdcall GetICMProfileW(long ptr ptr) @ stdcall GetKerningPairs(long long ptr) GetKerningPairsA @@ -301,9 +432,9 @@ @ stdcall GetMetaFileBitsEx(long long ptr) @ stdcall GetMetaFileW(wstr) @ stdcall GetMetaRgn(long long) -@ stdcall GetMiterLimit(long ptr) -@ stdcall GetNearestColor(long long) -@ stdcall GetNearestPaletteIndex(long long) +@ stdcall GetMiterLimit(long ptr) NtGdiGetMiterLimit +@ stdcall GetNearestColor(long long) NtGdiGetNearestColor +@ stdcall GetNearestPaletteIndex(long long) NtGdiGetNearestPaletteIndex @ stdcall GetObjectA(long long ptr) @ stdcall GetObjectType(long) @ stdcall GetObjectW(long long ptr) @@ -314,64 +445,71 @@ @ stdcall GetPixel(long long long) @ stdcall GetPixelFormat(long) @ stdcall GetPolyFillMode(long) -@ stdcall GetROP2(long) -@ stdcall GetRandomRgn(long long long) -@ stdcall GetRasterizerCaps(ptr long) +@ stdcall GetRandomRgn(long long long) NtGdiGetRandomRgn +@ stdcall GetRasterizerCaps(ptr long) NtGdiGetRasterizerCaps @ stdcall GetRegionData(long long ptr) @ stdcall GetRelAbs(long long) @ stdcall GetRgnBox(long ptr) +@ stdcall GetROP2(long) @ stdcall GetStockObject(long) @ stdcall GetStretchBltMode(long) -# @ stub GetStringBitmapA -# @ stub GetStringBitmapW +@ stdcall GetStringBitmapA(ptr str long long ptr) +@ stdcall GetStringBitmapW(ptr wstr long long ptr) @ stdcall GetSystemPaletteEntries(long long long ptr) -@ stdcall GetSystemPaletteUse(long) +@ stdcall GetSystemPaletteUse(long) NtGdiGetSystemPaletteUse @ stdcall GetTextAlign(long) @ stdcall GetTextCharacterExtra(long) @ stdcall GetTextCharset(long) -@ stdcall GetTextCharsetInfo(long ptr long) +@ stdcall GetTextCharsetInfo(long ptr long) NtGdiGetTextCharsetInfo @ stdcall GetTextColor(long) @ stdcall GetTextExtentExPointA(long str long long ptr ptr ptr) @ stdcall GetTextExtentExPointI(long ptr long long ptr ptr ptr) @ stdcall GetTextExtentExPointW(long wstr long long ptr ptr ptr) -# @ stub GetTextExtentExPointWPri +@ stdcall GetTextExtentExPointWPri(ptr wstr long long long ptr ptr) @ stdcall GetTextExtentPoint32A(long str long ptr) @ stdcall GetTextExtentPoint32W(long wstr long ptr) @ stdcall GetTextExtentPointA(long str long ptr) @ stdcall GetTextExtentPointI(long ptr long ptr) @ stdcall GetTextExtentPointW(long wstr long ptr) @ stdcall GetTextFaceA(long long ptr) -# @ stub GetTextFaceAliasW +@ stdcall GetTextFaceAliasW(ptr long wstr) @ stdcall GetTextFaceW(long long ptr) @ stdcall GetTextMetricsA(long ptr) @ stdcall GetTextMetricsW(long ptr) -@ stdcall GetTransform(long long ptr) +@ stdcall GetTransform(long long ptr) NtGdiGetTransform @ stdcall GetViewportExtEx(long ptr) @ stdcall GetViewportOrgEx(long ptr) -@ stdcall GetWinMetaFileBits(long long ptr long long) @ stdcall GetWindowExtEx(long ptr) @ stdcall GetWindowOrgEx(long ptr) +@ stdcall GetWinMetaFileBits(long long ptr long long) @ stdcall GetWorldTransform(long ptr) +@ stdcall HT_Get8BPPFormatPalette(ptr long long long) NtGdiHT_Get8BPPFormatPalette +@ stdcall HT_Get8BPPMaskPalette(ptr long long long long long) NtGdiHT_Get8BPPMaskPalette @ stdcall IntersectClipRect(long long long long long) @ stdcall InvertRgn(long long) -# @ stub IsValidEnhMetaRecord -# @ stub IsValidEnhMetaRecordOffExt -@ stdcall LPtoDP(long ptr long) +@ stdcall IsValidEnhMetaRecord(long long) +@ stdcall IsValidEnhMetaRecordOffExt(long long long long) @ stdcall LineDDA(long long long long ptr long) @ stdcall LineTo(long long long) +@ stdcall LPtoDP(long ptr long) @ stub LoadImageColorMatcherA @ stub LoadImageColorMatcherW @ stdcall MaskBlt(long long long long long long long long long long long long) -# @ stub MirrorRgn +@ stdcall MirrorRgn(ptr ptr) @ stdcall ModifyWorldTransform(long ptr long) @ stdcall MoveToEx(long long long ptr) -# @ stub NamedEscape +@ stdcall NamedEscape(ptr wstr long long str long str) @ stdcall OffsetClipRgn(long long long) @ stdcall OffsetRgn(long long long) @ stdcall OffsetViewportOrgEx(long long long ptr) @ stdcall OffsetWindowOrgEx(long long long ptr) @ stdcall PaintRgn(long long) @ stdcall PatBlt(long long long long long long) +@ stdcall PATHOBJ_bEnum(ptr ptr) NtGdiPATHOBJ_bEnum +@ stdcall PATHOBJ_bEnumClipLines(ptr long ptr) NtGdiPATHOBJ_bEnumClipLines +@ stdcall PATHOBJ_vEnumStart(ptr) NtGdiPATHOBJ_vEnumStart +@ stdcall PATHOBJ_vEnumStartClipLines(ptr ptr ptr ptr) NtGdiPATHOBJ_vEnumStartClipLines +@ stdcall PATHOBJ_vGetBounds(ptr ptr) NtGdiPATHOBJ_vGetBounds @ stdcall PathToRegion(long) @ stdcall Pie(long long long long long long long long long) @ stdcall PlayEnhMetaFile(long long ptr) @@ -382,26 +520,26 @@ @ stdcall PolyBezier(long ptr long) @ stdcall PolyBezierTo(long ptr long) @ stdcall PolyDraw(long ptr ptr long) -# @ stub PolyPatBlt +@ stdcall Polygon(long ptr long) +@ stdcall Polyline(long ptr long) +@ stdcall PolylineTo(long ptr long) +@ stdcall PolyPatBlt(ptr long ptr long long) @ stdcall PolyPolygon(long ptr ptr long) @ stdcall PolyPolyline(long ptr ptr long) @ stdcall PolyTextOutA(long ptr long) @ stdcall PolyTextOutW(long ptr long) -@ stdcall Polygon(long ptr long) -@ stdcall Polyline(long ptr long) -@ stdcall PolylineTo(long ptr long) @ stdcall PtInRegion(long long long) -@ stdcall PtVisible(long long long) -# @ stub QueryFontAssocStatus +@ stdcall PtVisible(long long long) NtGdiPtVisible +@ stdcall QueryFontAssocStatus() @ stdcall RealizePalette(long) -@ stdcall RectInRegion(long ptr) -@ stdcall RectVisible(long ptr) @ stdcall Rectangle(long long long long long) +@ stdcall RectInRegion(long ptr) +@ stdcall RectVisible(long ptr) NtGdiRectVisible @ stdcall RemoveFontMemResourceEx(ptr) @ stdcall RemoveFontResourceA(str) @ stdcall RemoveFontResourceExA(str long ptr) @ stdcall RemoveFontResourceExW(wstr long ptr) -@ stub RemoveFontResourceTracking +@ stdcall RemoveFontResourceTracking(ptr long) @ stdcall RemoveFontResourceW(wstr) @ stdcall ResetDCA(long ptr) @ stdcall ResetDCW(long ptr) @@ -411,122 +549,96 @@ @ stdcall SaveDC(long) @ stdcall ScaleViewportExtEx(long long long long long ptr) @ stdcall ScaleWindowExtEx(long long long long long ptr) -@ stub SelectBrushLocal +@ stdcall SelectBrushLocal(ptr ptr) @ stdcall SelectClipPath(long long) @ stdcall SelectClipRgn(long long) -@ stub SelectFontLocal +@ stdcall SelectFontLocal(ptr ptr) @ stdcall SelectObject(long long) @ stdcall SelectPalette(long long long) @ stdcall SetAbortProc(long ptr) @ stdcall SetArcDirection(long long) -# @ stub SetBitmapAttributes -@ stdcall SetBitmapBits(long long ptr) -@ stdcall SetBitmapDimensionEx(long long long ptr) +@ stdcall SetBitmapAttributes(ptr long) +@ stdcall SetBitmapBits(long long ptr) NtGdiSetBitmapBits +@ stdcall SetBitmapDimensionEx(long long long ptr) NtGdiSetBitmapDimension @ stdcall SetBkColor(long long) @ stdcall SetBkMode(long long) @ stdcall SetBoundsRect(long ptr long) -# @ stub SetBrushAttributes +@ stdcall SetBrushAttributes(ptr long) @ stdcall SetBrushOrgEx(long long long ptr) @ stdcall SetColorAdjustment(long ptr) @ stdcall SetColorSpace(long long) @ stdcall SetDCBrushColor(long long) @ stdcall SetDCPenColor(long long) +@ stdcall SetDeviceGammaRamp(long ptr) @ stdcall SetDIBColorTable(long long long ptr) @ stdcall SetDIBits(long long long long ptr ptr long) @ stdcall SetDIBitsToDevice(long long long long long long long long long ptr ptr long) -@ stdcall SetDeviceGammaRamp(long ptr) @ stdcall SetEnhMetaFileBits(long ptr) -@ stub SetFontEnumeration +@ stdcall SetFontEnumeration(ptr) NtGdiSetFontEnumeration @ stdcall SetGraphicsMode(long long) @ stdcall SetICMMode(long long) @ stdcall SetICMProfileA(long str) @ stdcall SetICMProfileW(long wstr) @ stdcall SetLayout(long long) -# @ stub SetLayoutWidth -@ stdcall SetMagicColors(ptr long long) +@ stdcall SetLayoutWidth(ptr long long) +@ stdcall SetMagicColors(ptr long long) NtGdiSetMagicColors @ stdcall SetMapMode(long long) @ stdcall SetMapperFlags(long long) @ stdcall SetMetaFileBitsEx(long ptr) @ stdcall SetMetaRgn(long) @ stdcall SetMiterLimit(long long ptr) -@ stdcall SetObjectOwner(long long) +#@ stdcall SetObjectOwner(long long) @ stdcall SetPaletteEntries(long long long ptr) @ stdcall SetPixel(long long long long) @ stdcall SetPixelFormat(long long ptr) @ stdcall SetPixelV(long long long long) @ stdcall SetPolyFillMode(long long) -@ stdcall SetROP2(long long) @ stdcall SetRectRgn(long long long long long) @ stdcall SetRelAbs(long long) +@ stdcall SetROP2(long long) @ stdcall SetStretchBltMode(long long) -@ stdcall SetSystemPaletteUse(long long) +@ stdcall SetSystemPaletteUse(long long) NtGdiSetSystemPaletteUse @ stdcall SetTextAlign(long long) @ stdcall SetTextCharacterExtra(long long) @ stdcall SetTextColor(long long) @ stdcall SetTextJustification(long long long) @ stdcall SetViewportExtEx(long long long ptr) @ stdcall SetViewportOrgEx(long long long ptr) -@ stdcall SetVirtualResolution(long long long long long) -@ stdcall SetWinMetaFileBits(long ptr long ptr) +@ stdcall SetVirtualResolution(long long long long long) NtGdiSetVirtualResolution @ stdcall SetWindowExtEx(long long long ptr) @ stdcall SetWindowOrgEx(long long long ptr) +@ stdcall SetWinMetaFileBits(long ptr long ptr) @ stdcall SetWorldTransform(long ptr) @ stdcall StartDocA(long ptr) @ stdcall StartDocW(long ptr) -# @ stub StartFormPage +@ stdcall StartFormPage(ptr) @ stdcall StartPage(long) @ stdcall StretchBlt(long long long long long long long long long long long) @ stdcall StretchDIBits(long long long long long long long long long ptr ptr long long) +@ stdcall STROBJ_bEnum(ptr ptr ptr) NtGdiSTROBJ_bEnum +@ stdcall STROBJ_bEnumPositionsOnly(ptr ptr ptr) NtGdiSTROBJ_bEnumPositionsOnly +@ stdcall STROBJ_bGetAdvanceWidths(ptr long long ptr) NtGdiSTROBJ_bGetAdvanceWidths +@ stdcall STROBJ_dwGetCodePage(ptr) NtGdiSTROBJ_dwGetCodePage +@ stdcall STROBJ_vEnumStart(ptr) NtGdiSTROBJ_vEnumStart @ stdcall StrokeAndFillPath(long) @ stdcall StrokePath(long) @ stdcall SwapBuffers(long) @ stdcall TextOutA(long long long str long) @ stdcall TextOutW(long long long wstr long) @ stdcall TranslateCharsetInfo(ptr ptr long) -@ stub UnloadNetworkFonts +@ stdcall UnloadNetworkFonts(long) @ stdcall UnrealizeObject(long) @ stdcall UpdateColors(long) @ stdcall UpdateICMRegKey(long str str long) UpdateICMRegKeyA @ stdcall UpdateICMRegKeyA(long str str long) @ stdcall UpdateICMRegKeyW(long wstr wstr long) @ stdcall WidenPath(long) -@ stub gdiPlaySpoolStream -@ extern pfnRealizePalette -@ extern pfnSelectPalette -@ stub pstackConnect - -################################################################ -# Wine extensions: OpenGL support -# -@ stdcall wglCopyContext(long long long) -@ stdcall wglCreateContext(long) -@ stdcall wglDeleteContext(long) -@ stdcall wglGetCurrentContext() -@ stdcall wglGetCurrentDC() -@ stdcall -private wglGetProcAddress(str) -@ stdcall wglMakeCurrent(long long) -@ stdcall wglShareLists(long long) -@ stdcall wglUseFontBitmapsA(long long long long) -@ stdcall wglUseFontBitmapsW(long long long long) - -################################################################ -# Wine extensions: Win16 functions that are needed by other dlls -# -@ stdcall CloseJob16(long) -@ stdcall DrvGetPrinterData16(str str ptr ptr long ptr) -@ stdcall DrvSetPrinterData16(str str long ptr long) -@ stdcall GetDCHook(long ptr) -@ stdcall OpenJob16(str str long) -@ stdcall SelectVisRgn(long long) -@ stdcall SetDCHook(long ptr long) -@ stdcall SetHookFlags(long long) -@ stdcall WriteSpool16(long ptr long) - -################################################################ -# Wine internal extensions -# -# All functions must be prefixed with '__wine_' (for internal functions) -# or 'wine_' (for user-visible functions) to avoid namespace conflicts. - -# GDI objects -@ cdecl __wine_make_gdi_object_system(long long) +@ stdcall XFORMOBJ_bApplyXform(ptr long long ptr ptr) NtGdiXFORMOBJ_bApplyXform +@ stdcall XFORMOBJ_iGetXform(ptr ptr) NtGdiXFORMOBJ_iGetXform +@ stdcall XLATEOBJ_cGetPalette(ptr long long ptr) NtGdiXLATEOBJ_cGetPalette +@ stdcall XLATEOBJ_hGetColorTransform(ptr) NtGdiXLATEOBJ_hGetColorTransform +@ stdcall XLATEOBJ_iXlate(ptr long) +@ stdcall XLATEOBJ_piVector(ptr) +#@ extern pfnRealizePalette +#@ extern pfnSelectPalette +#@ stub pstackConnect diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index d8766ae4c4b..59ea4a8cae6 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -968,7 +968,7 @@ GetGlyphOutlineWow( */ DWORD STDCALL -gdiPlaySpoolStream( +GdiPlaySpoolStream( DWORD a0, DWORD a1, DWORD a2, From ec98fd847aae3b7bc0303afb887f1db7c759225b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 10 Oct 2008 23:35:34 +0000 Subject: [PATCH 327/388] Sorry forgot this one. Fix build. svn path=/branches/ros-amd64-bringup/; revision=36710 --- reactos/ntoskrnl/mm/amd64/page.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/reactos/ntoskrnl/mm/amd64/page.c b/reactos/ntoskrnl/mm/amd64/page.c index b21af64f9f7..3a8aa446df2 100644 --- a/reactos/ntoskrnl/mm/amd64/page.c +++ b/reactos/ntoskrnl/mm/amd64/page.c @@ -44,12 +44,6 @@ MiFlushTlb(PULONG Pt, PVOID Address) -PULONG_PTR -MmGetPageDirectory(VOID) -{ - return (PULONG_PTR)__readcr3(); -} - static ULONG ProtectToPTE(ULONG flProtect) { From df93fedafec1a06b8b761b75e0fc579c8642b353 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 12 Oct 2008 06:58:31 +0000 Subject: [PATCH 328/388] Fix: "1" may not appear in macro parameter list svn path=/branches/ros-amd64-bringup/; revision=36725 --- reactos/include/ddk/winddi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/include/ddk/winddi.h b/reactos/include/ddk/winddi.h index 84f4d37431b..c3f25e529e3 100644 --- a/reactos/include/ddk/winddi.h +++ b/reactos/include/ddk/winddi.h @@ -2472,9 +2472,9 @@ FLOATOBJ_SubLong( #define FLOATOBJ_Equal(pf, pf1) (*(pf) == *(pf1)) #define FLOATOBJ_GreaterThan(pf, pf1) (*(pf) > *(pf1)) #define FLOATOBJ_LessThan(pf, pf1) (*(pf) < *(pf1)) -#define FLOATOBJ_EqualLong(pf, 1) (*(pf) == (FLOAT)(1)) -#define FLOATOBJ_GreaterThanLong(pf, 1) (*(pf) > (FLOAT)(1)) -#define FLOATOBJ_LessThanLong(pf, 1) (*(pf) < (FLOAT)(1)) +#define FLOATOBJ_EqualLong(pf, l) (*(pf) == (FLOAT)(l)) +#define FLOATOBJ_GreaterThanLong(pf, l) (*(pf) > (FLOAT)(l)) +#define FLOATOBJ_LessThanLong(pf, l) (*(pf) < (FLOAT)(l)) #endif From 3c567dc3996d9df67d8a86d7c474033f5d0d22f2 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 12 Oct 2008 07:17:20 +0000 Subject: [PATCH 329/388] Stub setjmp and longjmp on freetype. This hack should be removed. svn path=/branches/ros-amd64-bringup/; revision=36726 --- reactos/dll/3rdparty/freetype/amd64/setjmplongjmp.s | 8 ++++++++ reactos/dll/3rdparty/freetype/freetype.rbuild | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 reactos/dll/3rdparty/freetype/amd64/setjmplongjmp.s diff --git a/reactos/dll/3rdparty/freetype/amd64/setjmplongjmp.s b/reactos/dll/3rdparty/freetype/amd64/setjmplongjmp.s new file mode 100644 index 00000000000..81976537fc1 --- /dev/null +++ b/reactos/dll/3rdparty/freetype/amd64/setjmplongjmp.s @@ -0,0 +1,8 @@ + +.globl __setjmp +__setjmp: + ret + +.globl _longjmp +_longjmp: + ret diff --git a/reactos/dll/3rdparty/freetype/freetype.rbuild b/reactos/dll/3rdparty/freetype/freetype.rbuild index 5d6c44b4294..4a6fa0f6986 100644 --- a/reactos/dll/3rdparty/freetype/freetype.rbuild +++ b/reactos/dll/3rdparty/freetype/freetype.rbuild @@ -7,6 +7,7 @@ + libcntpr @@ -15,9 +16,16 @@ ntoskrnl libcntpr + setjmplongjmp.s + + + + setjmplongjmp.s + + ftsystem.c From 0139a4e5b80f528d8ed5bc0c7cf1d7fff1b9a5c1 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 12 Oct 2008 19:15:57 +0000 Subject: [PATCH 330/388] Set svn:eol-style property svn path=/branches/ros-amd64-bringup/; revision=36734 --- reactos/dll/win32/gdi32/objects/arc.c | 448 +++++++++++++------------- 1 file changed, 224 insertions(+), 224 deletions(-) diff --git a/reactos/dll/win32/gdi32/objects/arc.c b/reactos/dll/win32/gdi32/objects/arc.c index f1761a4c0a5..b3d534afc4e 100644 --- a/reactos/dll/win32/gdi32/objects/arc.c +++ b/reactos/dll/win32/gdi32/objects/arc.c @@ -1,57 +1,57 @@ -#include "precomp.h" - -BOOL -WINAPI -Arc( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXStartArc, - int nYStartArc, - int nXEndArc, - int nYEndArc -) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) -// Call Wine (rewrite of) MFDRV_MetaParam8 - return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { -// Call Wine (rewrite of) EMFDRV_ArcChordPie - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeArc, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXStartArc, - nYStartArc, - nXEndArc, - nYEndArc); -} - - +#include "precomp.h" + +BOOL +WINAPI +Arc( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXStartArc, + int nYStartArc, + int nXEndArc, + int nYEndArc +) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) +// Call Wine (rewrite of) MFDRV_MetaParam8 + return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { +// Call Wine (rewrite of) EMFDRV_ArcChordPie + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeArc, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXStartArc, + nYStartArc, + nXEndArc, + nYEndArc); +} + + /* * @implemented */ @@ -64,175 +64,175 @@ AngleArc(HDC hDC, FLOAT StartAngle, FLOAT SweepAngle) { - gxf_long worker, worker1; - - worker.f = StartAngle; - worker1.f = SweepAngle; - -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return FALSE; //No meta support for AngleArc - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_AngleArc( hDC, X, Y, Radius, StartAngle, SweepAngle); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l); + gxf_long worker, worker1; + + worker.f = StartAngle; + worker1.f = SweepAngle; + +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return FALSE; //No meta support for AngleArc + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_AngleArc( hDC, X, Y, Radius, StartAngle, SweepAngle); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l); } -BOOL -WINAPI -ArcTo( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return FALSE; //No meta support for ArcTo - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeArcTo, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); -} - -BOOL -WINAPI -Chord( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeChord, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); -} - - -/* - * @unimplemented - */ -BOOL -STDCALL -Pie( - HDC hDC, - int a1, - int a2, - int a3, - int a4, - int a5, - int a6, - int a7, - int a8 - ) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8); -} - - +BOOL +WINAPI +ArcTo( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXRadial1, + int nYRadial1, + int nXRadial2, + int nYRadial2) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return FALSE; //No meta support for ArcTo + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeArcTo, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXRadial1, + nYRadial1, + nXRadial2, + nYRadial2); +} + +BOOL +WINAPI +Chord( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXRadial1, + int nYRadial1, + int nXRadial2, + int nYRadial2) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeChord, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXRadial1, + nYRadial1, + nXRadial2, + nYRadial2); +} + + +/* + * @unimplemented + */ +BOOL +STDCALL +Pie( + HDC hDC, + int a1, + int a2, + int a3, + int a4, + int a5, + int a6, + int a7, + int a8 + ) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8); +} + + From 942724fb7ca8949b44ebdae24cdf6c47dfdbc1d6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Oct 2008 12:17:06 +0000 Subject: [PATCH 331/388] fix __rdtsc on amd64 build, "=A" doesn't work. svn path=/branches/ros-amd64-bringup/; revision=36840 --- reactos/include/psdk/intrin_x86.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 7b5cbc2f1d3..09803e566c6 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -1054,9 +1054,15 @@ static __inline__ __attribute__((always_inline)) void __cpuid(int CPUInfo[], con static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void) { +#ifdef _M_AMD64 + unsigned long long low, high; + __asm__ __volatile__("rdtsc" : "=a"(low), "=d"(high)); + return low | (high << 32); +#else unsigned long long retval; __asm__ __volatile__("rdtsc" : "=A"(retval)); return retval; +#endif } static __inline__ __attribute__((always_inline)) void __writeeflags(uintptr_t Value) From c52881dbc7c5c535a489b10bd047d434e5b25931 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Oct 2008 12:21:07 +0000 Subject: [PATCH 332/388] - set the new idt in the pcr svn path=/branches/ros-amd64-bringup/; revision=36841 --- reactos/ntoskrnl/ke/amd64/except.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/ntoskrnl/ke/amd64/except.c b/reactos/ntoskrnl/ke/amd64/except.c index 1eaae2903f1..f7aee62dd07 100644 --- a/reactos/ntoskrnl/ke/amd64/except.c +++ b/reactos/ntoskrnl/ke/amd64/except.c @@ -87,6 +87,7 @@ KeInitExceptions(VOID) KiIdt[i].Reserved1 = 0; } + KeGetPcr()->IdtBase = KiIdt; __lidt(&KiIdtDescriptor.Limit); } From c54e4eca9ea4f505c142b72289b5ba00fb318888 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Oct 2008 12:22:41 +0000 Subject: [PATCH 333/388] display unexpected interrupts svn path=/branches/ros-amd64-bringup/; revision=36842 --- reactos/ntoskrnl/ke/amd64/trap.S | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S index a79ea919213..89c5cd15e78 100644 --- a/reactos/ntoskrnl/ke/amd64/trap.S +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -216,7 +216,6 @@ jmp $ .global _KiUnexpectedInterrupt _KiUnexpectedInterrupt: -jmp $ movabs rcx, offset _MsgUnexpectedInterrupt movabs rax, offset _FrLdrDbgPrint call [rax] From 66c6550f747db159a9eebee65e01f15632f7bf6a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Oct 2008 19:11:57 +0000 Subject: [PATCH 334/388] Some ULONG -> SIZE_T / ULONG_PTR fixes svn path=/branches/ros-amd64-bringup/; revision=36852 --- reactos/ntoskrnl/include/internal/mm.h | 8 ++++---- reactos/ntoskrnl/include/internal/ntoskrnl.h | 2 +- reactos/ntoskrnl/mm/anonmem.c | 2 +- reactos/ntoskrnl/mm/mm.c | 4 ++-- reactos/ntoskrnl/mm/section.c | 2 +- reactos/ntoskrnl/mm/virtual.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 9348182698a..e586b1f465f 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -752,7 +752,7 @@ MmQueryAnonMem( PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength + PSIZE_T ResultLength ); VOID @@ -1410,7 +1410,7 @@ MmQuerySectionView( PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength + PSIZE_T ResultLength ); NTSTATUS @@ -1503,8 +1503,8 @@ MiQueryVirtualMemory( IN PVOID Address, IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass, OUT PVOID VirtualMemoryInformation, - IN ULONG Length, - OUT PULONG ResultLength + IN SIZE_T Length, + OUT PSIZE_T ResultLength ); /* sysldr.c ******************************************************************/ diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 884f3c068ca..0b5a232cce3 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -212,7 +212,7 @@ DefaultQueryInfoBufferCheck(ULONG Class, ULONG ClassListEntries, PVOID Buffer, ULONG BufferLength, - PULONG ReturnLength, + PSIZE_T ReturnLength, KPROCESSOR_MODE PreviousMode) { NTSTATUS Status = STATUS_SUCCESS; diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index ddda8b89287..c0ba5b873cc 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -1034,7 +1034,7 @@ NTSTATUS STDCALL MmQueryAnonMem(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength) + PSIZE_T ResultLength) { PMM_REGION Region; PVOID RegionBase = NULL; diff --git a/reactos/ntoskrnl/mm/mm.c b/reactos/ntoskrnl/mm/mm.c index 2e4f8885120..54faf9810de 100644 --- a/reactos/ntoskrnl/mm/mm.c +++ b/reactos/ntoskrnl/mm/mm.c @@ -438,9 +438,9 @@ NTAPI NtGetWriteWatch(IN HANDLE ProcessHandle, IN ULONG Flags, IN PVOID BaseAddress, - IN ULONG RegionSize, + IN SIZE_T RegionSize, IN PVOID *UserAddressArray, - OUT PULONG EntriesInUserAddressArray, + OUT PULONG_PTR EntriesInUserAddressArray, OUT PULONG Granularity) { UNIMPLEMENTED; diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 55002bee021..98942baefc7 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -2052,7 +2052,7 @@ NTSTATUS STDCALL MmQuerySectionView(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, - PULONG ResultLength) + PSIZE_T ResultLength) { PMM_REGION Region; PVOID RegionBaseAddress; diff --git a/reactos/ntoskrnl/mm/virtual.c b/reactos/ntoskrnl/mm/virtual.c index f34354c8493..4ea2fddaf78 100644 --- a/reactos/ntoskrnl/mm/virtual.c +++ b/reactos/ntoskrnl/mm/virtual.c @@ -762,7 +762,7 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle, KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); PEPROCESS Process; NTSTATUS Status = STATUS_SUCCESS; - ULONG BytesWritten = 0; + SIZE_T BytesWritten = 0; PAGED_CODE(); /* Check if we came from user mode */ From d5e22f20328328950aa19cce8990c4d9672c6da2 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Oct 2008 19:12:41 +0000 Subject: [PATCH 335/388] remove functions from stubs file, fix some warnings svn path=/branches/ros-amd64-bringup/; revision=36853 --- reactos/ntoskrnl/amd64stubs.c | 4 ---- reactos/ntoskrnl/mm/amd64/page.c | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/reactos/ntoskrnl/amd64stubs.c b/reactos/ntoskrnl/amd64stubs.c index 86a2d2a5ad3..b4a6d7de516 100644 --- a/reactos/ntoskrnl/amd64stubs.c +++ b/reactos/ntoskrnl/amd64stubs.c @@ -181,7 +181,6 @@ STUB(PsGetCurrentThreadTeb) STUB(PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion) STUB(PsGetProcessSessionIdEx) STUB(PsGetProcessWow64Process) -STUB(PsIsSystemProcess) STUB(PsProcessType) STUB(PsWrapApcWow64Thread) STUB(RtlAnsiStringToUnicodeSize) @@ -218,12 +217,9 @@ STUB(VfIsVerificationEnabled) STUB(WmiFlushTrace) STUB(WmiGetClock) STUB(WmiQueryTrace) -STUB(WmiQueryTraceInformation) STUB(WmiStartTrace) STUB(WmiStopTrace) STUB(WmiTraceFastEvent) -STUB(WmiTraceMessage) -STUB(WmiTraceMessageVa) STUB(WmiUpdateTrace) STUB(XIPDispatch) STUB(__C_specific_handler) diff --git a/reactos/ntoskrnl/mm/amd64/page.c b/reactos/ntoskrnl/mm/amd64/page.c index 3a8aa446df2..06e6cf6289d 100644 --- a/reactos/ntoskrnl/mm/amd64/page.c +++ b/reactos/ntoskrnl/mm/amd64/page.c @@ -43,13 +43,13 @@ MiFlushTlb(PULONG Pt, PVOID Address) } - +/* static ULONG ProtectToPTE(ULONG flProtect) { - + return 0; } - +*/ NTSTATUS NTAPI Mmi386ReleaseMmInfo(PEPROCESS Process) @@ -323,7 +323,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) if (Index != VAtoPXI(PXE_BASE)) { (void)InterlockedCompareExchangePointer((PVOID*)&Pde[Index], - MmGlobalKernelPageDirectory[Index], + (PVOID)MmGlobalKernelPageDirectory[Index], 0); } } From 7bbdd8988063563b75ba36542c336de4fa019959 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Oct 2008 19:15:40 +0000 Subject: [PATCH 336/388] Some ULONG -> SIZE_T / ULONG_PTR fixes svn path=/branches/ros-amd64-bringup/; revision=36854 --- reactos/include/ddk/winddk.h | 8 ++++---- reactos/lib/rtl/thread.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 9f5c8b3c1c2..4a1a1f7c553 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -11207,8 +11207,8 @@ NtMapViewOfSection( IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN ULONG CommitSize, + IN ULONG_PTR ZeroBits, + IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, @@ -11222,8 +11222,8 @@ ZwMapViewOfSection( IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN ULONG CommitSize, + IN ULONG_PTR ZeroBits, + IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, diff --git a/reactos/lib/rtl/thread.c b/reactos/lib/rtl/thread.c index 23ea94af439..3213b338e64 100644 --- a/reactos/lib/rtl/thread.c +++ b/reactos/lib/rtl/thread.c @@ -31,7 +31,8 @@ RtlpCreateUserStack(IN HANDLE hProcess, PIMAGE_NT_HEADERS Headers; ULONG_PTR Stack = 0; BOOLEAN UseGuard = FALSE; - ULONG Dummy, GuardPageSize; + ULONG Dummy; + SIZE_T GuardPageSize; /* Get some memory information */ Status = ZwQuerySystemInformation(SystemBasicInformation, From 868810d82e12606dc54fcfc9c8c48d9b97497615 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 20 Oct 2008 21:37:19 +0000 Subject: [PATCH 337/388] delete this directory as in trunk svn path=/branches/ros-amd64-bringup/; revision=36863 From c6441a9d8a1b9bac6bb063ecc5ef7d2e14ed48dc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 20 Oct 2008 23:40:10 +0000 Subject: [PATCH 338/388] revert rtl build changes svn path=/branches/ros-amd64-bringup/; revision=36865 --- reactos/boot/freeldr/freeldr/freeldr.rbuild | 2 +- reactos/boot/freeldr/freeldr/setupldr.rbuild | 2 +- reactos/lib/rtl/rtl.rbuild | 114 +++++++++++++++++-- reactos/ntoskrnl/ntoskrnl-generic.rbuild | 2 +- 4 files changed, 105 insertions(+), 15 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/freeldr.rbuild b/reactos/boot/freeldr/freeldr/freeldr.rbuild index aac20bb0bf1..91e102d101b 100644 --- a/reactos/boot/freeldr/freeldr/freeldr.rbuild +++ b/reactos/boot/freeldr/freeldr/freeldr.rbuild @@ -11,7 +11,7 @@ freeldr_main rossym cmlib - rtl_kmode + rtl libcntpr -static -lgcc diff --git a/reactos/boot/freeldr/freeldr/setupldr.rbuild b/reactos/boot/freeldr/freeldr/setupldr.rbuild index 9ecae2e2285..acd2166b655 100644 --- a/reactos/boot/freeldr/freeldr/setupldr.rbuild +++ b/reactos/boot/freeldr/freeldr/setupldr.rbuild @@ -9,7 +9,7 @@ setupldr_main rossym cmlib - rtl_kmode + rtl libcntpr -nostartfiles -nostdlib diff --git a/reactos/lib/rtl/rtl.rbuild b/reactos/lib/rtl/rtl.rbuild index e3bb0219b12..e5f9796b3e3 100644 --- a/reactos/lib/rtl/rtl.rbuild +++ b/reactos/lib/rtl/rtl.rbuild @@ -1,15 +1,105 @@ + + + + + + + . + + + debug_asm.S + except_asm.s + except.c + random_asm.S + rtlswap.S + rtlmem.s + res_asm.s + thread.c + + + + + debug.c + except.c + interlocked.c + rtlmem.s + rtlswap.s + thread.c + + + + + debug_asm.S + + mem.c + memgen.c + + + + debug_asm.S + + + + avl.c + tree.c + - - - - - - - - - - - - + access.c + acl.c + actctx.c + atom.c + bitmap.c + bootdata.c + compress.c + condvar.c + crc32.c + critical.c + dbgbuffer.c + debug.c + dos8dot3.c + encode.c + env.c + error.c + exception.c + generictable.c + handle.c + heap.c + image.c + interlck.c + message.c + largeint.c + luid.c + network.c + nls.c + path.c + ppb.c + process.c + propvar.c + qsort.c + random.c + rangelist.c + registry.c + res.c + resource.c + sd.c + security.c + slist.c + sid.c + sprintf.c + srw.c + swprintf.c + splaytree.c + thread.c + time.c + timezone.c + timerqueue.c + unicode.c + unicodeprefix.c + vectoreh.c + version.c + wait.c + workitem.c + rtl.h + diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index a015affecc0..ab039c94e7f 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -26,7 +26,7 @@ hal pseh cmlib - rtl_kmode + rtl rossym libcntpr kdcom From e2f4cae55d520f0352d4d7cd54692b2ae64001ce Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Wed, 22 Oct 2008 02:07:16 +0000 Subject: [PATCH 339/388] Revert last. (rtl straggler) svn path=/branches/ros-amd64-bringup/; revision=36886 --- reactos/dll/ntdll/ntdll.rbuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/ntdll/ntdll.rbuild b/reactos/dll/ntdll/ntdll.rbuild index 2f350e5313b..d45a85793e7 100644 --- a/reactos/dll/ntdll/ntdll.rbuild +++ b/reactos/dll/ntdll/ntdll.rbuild @@ -12,7 +12,7 @@ 0x0502 - rtl_umode + rtl ntdllsys libcntpr pseh @@ -55,4 +55,4 @@ ntdll.rc - \ No newline at end of file + From 64f8abb1268897d2360c91aa735721b8bd621a92 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 02:25:18 +0000 Subject: [PATCH 340/388] - Fix CryptReleaseContext definition. - Make SERVICE_STATUS_HANDLE and CLIENT_HANDLE HANDLEs. - Fix LSAPR_HANDLE, SC_RPC_HANDLE definitions. - Fixes 64bit advapi32 build. svn path=/branches/ros-amd64-bringup/; revision=36898 --- reactos/dll/win32/advapi32/reg/reg.c | 6 +++--- reactos/dll/win32/advapi32/sec/lsa.c | 4 ++-- reactos/dll/win32/advapi32/service/sctrl.c | 2 +- reactos/include/psdk/wincrypt.h | 2 +- reactos/include/psdk/winsvc.h | 2 +- reactos/include/reactos/idl/lsa.idl | 2 +- reactos/include/reactos/idl/svcctl.idl | 2 +- reactos/include/reactos/services/services.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index 8753be1b9c1..c6bd78f0f6d 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -400,7 +400,7 @@ RegCloseKey (HKEY hKey) NTSTATUS Status; /* don't close null handle or a pseudo handle */ - if ((!hKey) || (((ULONG)hKey & 0xF0000000) == 0x80000000)) + if ((!hKey) || (((ULONG_PTR)hKey & 0xF0000000) == 0x80000000)) { return ERROR_INVALID_HANDLE; } @@ -1018,7 +1018,7 @@ RegCreateKeyExA (HKEY hKey, { return RtlNtStatusToDosError (Status); } - TRACE("ParentKey %x\n", (ULONG)ParentKey); + TRACE("ParentKey %p\n", ParentKey); if (lpClass != NULL) { @@ -1091,7 +1091,7 @@ RegCreateKeyExW (HKEY hKey, { return RtlNtStatusToDosError(Status); } - TRACE("ParentKey %x\n", (ULONG)ParentKey); + TRACE("ParentKey %p\n", ParentKey); RtlInitUnicodeString (&ClassString, lpClass); diff --git a/reactos/dll/win32/advapi32/sec/lsa.c b/reactos/dll/win32/advapi32/sec/lsa.c index 831c6ea70bc..00677ef0f3d 100644 --- a/reactos/dll/win32/advapi32/sec/lsa.c +++ b/reactos/dll/win32/advapi32/sec/lsa.c @@ -93,7 +93,7 @@ LsaClose(LSA_HANDLE ObjectHandle) LSAHandleBind(); return LsarClose(LSABindingHandle, - (unsigned long *)&ObjectHandle); + &ObjectHandle); } @@ -108,7 +108,7 @@ LsaDelete(LSA_HANDLE ObjectHandle) LSAHandleBind(); return LsarDelete(LSABindingHandle, - (unsigned long)ObjectHandle); + ObjectHandle); } diff --git a/reactos/dll/win32/advapi32/service/sctrl.c b/reactos/dll/win32/advapi32/service/sctrl.c index d6b3380e6e4..b8cce996942 100644 --- a/reactos/dll/win32/advapi32/service/sctrl.c +++ b/reactos/dll/win32/advapi32/service/sctrl.c @@ -457,7 +457,7 @@ RegisterServiceCtrlHandlerW(LPCWSTR lpServiceName, Service = ScLookupServiceByServiceName((LPWSTR)lpServiceName); if (Service == NULL) { - return (SERVICE_STATUS_HANDLE)NULL; + return INVALID_HANDLE_VALUE; } Service->HandlerFunction = lpHandlerProc; diff --git a/reactos/include/psdk/wincrypt.h b/reactos/include/psdk/wincrypt.h index 7ca1b51c373..2816dc2b841 100644 --- a/reactos/include/psdk/wincrypt.h +++ b/reactos/include/psdk/wincrypt.h @@ -3788,7 +3788,7 @@ WINADVAPI BOOL WINAPI CryptGetUserKey (HCRYPTPROV, DWORD, HCRYPTKEY *); WINADVAPI BOOL WINAPI CryptHashData (HCRYPTHASH, CONST BYTE *, DWORD, DWORD); WINADVAPI BOOL WINAPI CryptHashSessionKey (HCRYPTHASH, HCRYPTKEY, DWORD); WINADVAPI BOOL WINAPI CryptImportKey (HCRYPTPROV, CONST BYTE *, DWORD, HCRYPTKEY, DWORD, HCRYPTKEY *); -WINADVAPI BOOL WINAPI CryptReleaseContext (HCRYPTPROV, ULONG_PTR); +WINADVAPI BOOL WINAPI CryptReleaseContext (HCRYPTPROV, DWORD); WINADVAPI BOOL WINAPI CryptSetHashParam (HCRYPTHASH, DWORD, CONST BYTE *, DWORD); WINADVAPI BOOL WINAPI CryptSetKeyParam (HCRYPTKEY, DWORD, CONST BYTE *, DWORD); WINADVAPI BOOL WINAPI CryptSetProviderA (LPCSTR, DWORD); diff --git a/reactos/include/psdk/winsvc.h b/reactos/include/psdk/winsvc.h index cfc3f57a9d2..781a17785a5 100644 --- a/reactos/include/psdk/winsvc.h +++ b/reactos/include/psdk/winsvc.h @@ -158,7 +158,7 @@ typedef struct _SERVICE_TABLE_ENTRYW { DECLARE_HANDLE(SC_HANDLE); typedef SC_HANDLE *LPSC_HANDLE; typedef PVOID SC_LOCK; -typedef DWORD SERVICE_STATUS_HANDLE; +DECLARE_HANDLE(SERVICE_STATUS_HANDLE); typedef VOID(WINAPI *LPHANDLER_FUNCTION)(DWORD); typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)(DWORD,DWORD,LPVOID,LPVOID); typedef struct _SERVICE_DESCRIPTIONA { diff --git a/reactos/include/reactos/idl/lsa.idl b/reactos/include/reactos/idl/lsa.idl index a09896cc760..0d4bd61b007 100644 --- a/reactos/include/reactos/idl/lsa.idl +++ b/reactos/include/reactos/idl/lsa.idl @@ -4,7 +4,7 @@ #include -typedef /*[context_handle]*/ unsigned long LSAPR_HANDLE; +typedef [context_handle] void* LSAPR_HANDLE; typedef LSAPR_HANDLE *PLSAPR_HANDLE; cpp_quote("#ifndef _WINNT_H") diff --git a/reactos/include/reactos/idl/svcctl.idl b/reactos/include/reactos/idl/svcctl.idl index 943a979338a..8d4e0789e31 100644 --- a/reactos/include/reactos/idl/svcctl.idl +++ b/reactos/include/reactos/idl/svcctl.idl @@ -17,7 +17,7 @@ const unsigned short SC_MAX_ARGUMENTS = 1024; typedef /*[handle]*/ LPSTR SVCCTL_HANDLEA; typedef /*[handle]*/ LPWSTR SVCCTL_HANDLEW; -typedef /*[context_handle]*/ ULONG_PTR SC_RPC_HANDLE; +typedef [context_handle] void* SC_RPC_HANDLE; typedef SC_RPC_HANDLE* LPSC_RPC_HANDLE; typedef /*[context_handle]*/ unsigned long SC_RPC_LOCK; typedef SC_RPC_LOCK* LPSC_RPC_LOCK; diff --git a/reactos/include/reactos/services/services.h b/reactos/include/reactos/services/services.h index e32d8bcae8c..21a6085bf6c 100644 --- a/reactos/include/reactos/services/services.h +++ b/reactos/include/reactos/services/services.h @@ -11,7 +11,7 @@ #define SERVICE_CONTROL_START 0 -typedef DWORD CLIENT_HANDLE; +DECLARE_HANDLE(CLIENT_HANDLE); typedef struct _SCM_CONTROL_PACKET { From 58309240e439c28b9d2f7c82f6f2012afef58322 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 02:59:56 +0000 Subject: [PATCH 341/388] - Fix modMessage definition - Fix beepmidi build. svn path=/branches/ros-amd64-bringup/; revision=36899 --- reactos/dll/win32/beepmidi/beepmidi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/beepmidi/beepmidi.c b/reactos/dll/win32/beepmidi/beepmidi.c index 8665bec17d4..0b129717c7f 100644 --- a/reactos/dll/win32/beepmidi/beepmidi.c +++ b/reactos/dll/win32/beepmidi/beepmidi.c @@ -242,7 +242,7 @@ CallClient( DWORD parameter1, DWORD parameter2) { - DPRINT("Calling client - callback 0x%x mmhandle 0x%x\n", (int) device_info->callback, (int) device_info->mme_handle); + DPRINT("Calling client - callback 0x%x mmhandle 0x%x\n", (int) device_info->callback, device_info->mme_handle); return DriverCallback(device_info->callback, HIWORD(device_info->flags), device_info->mme_handle, @@ -747,7 +747,7 @@ ProcessLongMidiMessage( header->dwFlags |= MHDR_DONE; header->dwFlags &= ~ MHDR_INQUEUE; - DPRINT("Success? %d\n", (int) CallClient(the_device, MOM_DONE, (DWORD) header, 0)); + DPRINT("Success? %d\n", CallClient(the_device, MOM_DONE, (DWORD_PTR) header, 0)); return MMSYSERR_NOERROR; } @@ -757,14 +757,14 @@ ProcessLongMidiMessage( Exported function that receives messages from WINMM (the MME API.) */ -FAR PASCAL +WINAPI MMRESULT modMessage( UINT device_id, UINT message, - DWORD private_data, - DWORD parameter1, - DWORD parameter2) + DWORD_PTR private_data, + DWORD_PTR parameter1, + DWORD_PTR parameter2) { switch ( message ) { From ba40b225d63202b78ca8e042bf47c2765d6073e8 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 03:14:39 +0000 Subject: [PATCH 342/388] - Fix COMBOBOXEXITEA/W noticed by Daniel Verkamp. - Fixes 64bit wordpad crash on windows 64!!! svn path=/branches/ros-amd64-bringup/; revision=36900 --- reactos/include/psdk/commctrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/psdk/commctrl.h b/reactos/include/psdk/commctrl.h index 10224374bf1..92d51896d3a 100644 --- a/reactos/include/psdk/commctrl.h +++ b/reactos/include/psdk/commctrl.h @@ -4270,7 +4270,7 @@ static const WCHAR WC_COMBOBOXEXW[] = { 'C','o','m','b','o', typedef struct tagCOMBOBOXEXITEMA { UINT mask; - int iItem; + INT_PTR iItem; LPSTR pszText; int cchTextMax; int iImage; @@ -4284,7 +4284,7 @@ typedef COMBOBOXEXITEMA const *PCCOMBOEXITEMA; /* Yes, there's a BOX missing */ typedef struct tagCOMBOBOXEXITEMW { UINT mask; - int iItem; + INT_PTR iItem; LPWSTR pszText; int cchTextMax; int iImage; From 0d08f181b55294ad4c546d44e541791a93db8f38 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 03:28:07 +0000 Subject: [PATCH 343/388] - Fix NMHDR definition. noticed by Daniel Verkamp. - Fixes taskmgr(and other) tabs on windows 64!!! svn path=/branches/ros-amd64-bringup/; revision=36901 --- reactos/include/psdk/winuser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/psdk/winuser.h b/reactos/include/psdk/winuser.h index e24f392b439..57794e3b15e 100644 --- a/reactos/include/psdk/winuser.h +++ b/reactos/include/psdk/winuser.h @@ -2921,7 +2921,7 @@ typedef struct _ICONINFO { } ICONINFO,*PICONINFO; typedef struct tagNMHDR { HWND hwndFrom; - UINT idFrom; + UINT_PTR idFrom; UINT code; } NMHDR,*LPNMHDR; typedef struct _WNDCLASSA { From ec4d73dafca441f0b27021057573be4353f335b5 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 03:53:09 +0000 Subject: [PATCH 344/388] WTH happened here!? svn path=/branches/ros-amd64-bringup/; revision=36902 --- reactos/lib/debugsup/debugsup-ntos-amd64.def | 12 +----------- reactos/lib/debugsup/debugsup-ntos-i386.def | 10 +--------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/reactos/lib/debugsup/debugsup-ntos-amd64.def b/reactos/lib/debugsup/debugsup-ntos-amd64.def index 835682a8b48..3b074271559 100644 --- a/reactos/lib/debugsup/debugsup-ntos-amd64.def +++ b/reactos/lib/debugsup/debugsup-ntos-amd64.def @@ -6,15 +6,5 @@ DbgPrompt DbgPrintEx RtlAssert RtlUnwind - -;EOF -EXPORTS -DbgBreakPoint -DbgBreakPointWithStatus -DbgPrint -DbgPrompt -DbgPrintEx -RtlAssert -RtlUnwind - +vDbgPrintExWithPrefix ;EOF diff --git a/reactos/lib/debugsup/debugsup-ntos-i386.def b/reactos/lib/debugsup/debugsup-ntos-i386.def index 2feb454173e..323ead9580b 100644 --- a/reactos/lib/debugsup/debugsup-ntos-i386.def +++ b/reactos/lib/debugsup/debugsup-ntos-i386.def @@ -1,12 +1,3 @@ -EXPORTS -DbgBreakPoint@0 -DbgBreakPointWithStatus@4 -DbgPrint -DbgPrompt@12 -DbgPrintEx -RtlAssert@16 -RtlUnwind@16 - ;EOF EXPORTS DbgBreakPoint@0 @@ -16,5 +7,6 @@ DbgPrompt@12 DbgPrintEx RtlAssert@16 RtlUnwind@16 +vDbgPrintExWithPrefix ;EOF From f5bb33d51fd11fa1b7c0b68b46a16c9f5ef999c3 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 04:12:08 +0000 Subject: [PATCH 345/388] Fix ScmGetServiceEntryByClientHandle definition. svn path=/branches/ros-amd64-bringup/; revision=36903 --- reactos/base/system/services/database.c | 2 +- reactos/base/system/services/rpcserver.c | 2 +- reactos/base/system/services/services.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/base/system/services/database.c b/reactos/base/system/services/database.c index 3fd38d94ae6..b9b8228f51a 100644 --- a/reactos/base/system/services/database.c +++ b/reactos/base/system/services/database.c @@ -117,7 +117,7 @@ ScmGetServiceEntryByResumeCount(DWORD dwResumeCount) PSERVICE -ScmGetServiceEntryByClientHandle(ULONG Handle) +ScmGetServiceEntryByClientHandle(HANDLE Handle) { PLIST_ENTRY ServiceEntry; PSERVICE CurrentService; diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index 81bff1d7d55..5e2a8377a4a 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -1026,7 +1026,7 @@ DWORD RSetServiceStatus( return ERROR_INVALID_HANDLE; } - lpService = ScmGetServiceEntryByClientHandle((ULONG)hServiceStatus); + lpService = ScmGetServiceEntryByClientHandle(hServiceStatus); if (lpService == NULL) { DPRINT1("lpService == NULL!\n"); diff --git a/reactos/base/system/services/services.h b/reactos/base/system/services/services.h index 9bfb452195f..bfd0544bfef 100644 --- a/reactos/base/system/services/services.h +++ b/reactos/base/system/services/services.h @@ -107,7 +107,7 @@ DWORD ScmStartService(PSERVICE Service, PSERVICE ScmGetServiceEntryByName(LPWSTR lpServiceName); PSERVICE ScmGetServiceEntryByDisplayName(LPWSTR lpDisplayName); PSERVICE ScmGetServiceEntryByResumeCount(DWORD dwResumeCount); -PSERVICE ScmGetServiceEntryByClientHandle(ULONG ThreadId); +PSERVICE ScmGetServiceEntryByClientHandle(HANDLE Handle); DWORD ScmCreateNewServiceRecord(LPWSTR lpServiceName, PSERVICE *lpServiceRecord); VOID ScmDeleteServiceRecord(PSERVICE lpService); From 87ac3a92a3256e179cc429f2e875522aa513f463 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 14:27:06 +0000 Subject: [PATCH 346/388] - Fix definitions of CDHOOKPROC, PROC, FARPROC, NEARPROC - Fix definitions of SYSTEM_INFO, COMPAREITEMSTRUCT, COPYDATASTRUCT, DELETEITEMSTRUCT, DRAWITEMSTRUCT, MENUITEMINFOA/W, HELPINFO, MSGBOXPARAMSA/W, MOUSEHOOKSTRUCT, DROPSTRUCT, KBDLLHOOKSTRUCT - Fix definitions of GetProcessAffinityMask, SetProcessAffinityMask, DragObject, InsertMenuA/W, ModifyMenuA/W, WinHelpA/W, RT_GROUP_CURSOR, RT_GROUP_ICON - Fix Treeview in 64bit regedit. - Patch by Daniel Verkamp. svn path=/branches/ros-amd64-bringup/; revision=36906 --- reactos/include/psdk/commctrl.h | 8 +++--- reactos/include/psdk/commdlg.h | 2 +- reactos/include/psdk/winbase.h | 6 ++--- reactos/include/psdk/windef.h | 6 ++--- reactos/include/psdk/winuser.h | 46 ++++++++++++++++----------------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/reactos/include/psdk/commctrl.h b/reactos/include/psdk/commctrl.h index 92d51896d3a..ddc64aed850 100644 --- a/reactos/include/psdk/commctrl.h +++ b/reactos/include/psdk/commctrl.h @@ -2412,10 +2412,10 @@ static const WCHAR WC_TREEVIEWW[] = { 'S','y','s', #define TVIF_INTEGRAL 0x0080 #define TVIF_DI_SETITEM 0x1000 -#define TVI_ROOT ((HTREEITEM)0xffff0000) /* -65536 */ -#define TVI_FIRST ((HTREEITEM)0xffff0001) /* -65535 */ -#define TVI_LAST ((HTREEITEM)0xffff0002) /* -65534 */ -#define TVI_SORT ((HTREEITEM)0xffff0003) /* -65533 */ +#define TVI_ROOT ((HTREEITEM)(ULONG_PTR)-0x10000) /* -65536 */ +#define TVI_FIRST ((HTREEITEM)(ULONG_PTR)-0x0FFFF) /* -65535 */ +#define TVI_LAST ((HTREEITEM)(ULONG_PTR)-0x0FFFE) /* -65534 */ +#define TVI_SORT ((HTREEITEM)(ULONG_PTR)-0x0FFFD) /* -65533 */ #define TVIS_FOCUSED 0x0001 #define TVIS_SELECTED 0x0002 diff --git a/reactos/include/psdk/commdlg.h b/reactos/include/psdk/commdlg.h index c39904c5295..557efd99227 100644 --- a/reactos/include/psdk/commdlg.h +++ b/reactos/include/psdk/commdlg.h @@ -216,7 +216,7 @@ extern "C" { #define CommDlg_OpenSave_HideControl(d,i) ((void)SNDMSG((d),CDM_HIDECONTROL,(i),0)) #define CommDlg_OpenSave_SetDefExt(d,e) ((void)SNDMSG((d),CDM_SETDEFEXT,0,(LPARAM)(e))) -typedef UINT (APIENTRY *__CDHOOKPROC)(HWND,UINT,WPARAM,LPARAM); +typedef UINT_PTR (APIENTRY *__CDHOOKPROC)(HWND,UINT,WPARAM,LPARAM); typedef __CDHOOKPROC LPCCHOOKPROC; typedef __CDHOOKPROC LPCFHOOKPROC; typedef __CDHOOKPROC LPFRHOOKPROC; diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index 045085f6772..e3157a0b79b 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -910,7 +910,7 @@ typedef struct _SYSTEM_INFO { DWORD dwPageSize; PVOID lpMinimumApplicationAddress; PVOID lpMaximumApplicationAddress; - DWORD dwActiveProcessorMask; + DWORD_PTR dwActiveProcessorMask; DWORD dwNumberOfProcessors; DWORD dwProcessorType; DWORD dwAllocationGranularity; @@ -1530,7 +1530,7 @@ DWORD WINAPI GetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,DWORD,LPCWS BOOL WINAPI GetPrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR); BOOL WINAPI GetPrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR); FARPROC WINAPI GetProcAddress(HINSTANCE,LPCSTR); -BOOL WINAPI GetProcessAffinityMask(HANDLE,PDWORD,PDWORD); +BOOL WINAPI GetProcessAffinityMask(HANDLE,PDWORD_PTR,PDWORD_PTR); #if (_WIN32_WINNT >= 0x0502) BOOL WINAPI GetProcessHandleCount(HANDLE,PDWORD); #endif @@ -2071,7 +2071,7 @@ BOOL WINAPI SetMailslotInfo(HANDLE,DWORD); BOOL WINAPI SetNamedPipeHandleState(HANDLE,PDWORD,PDWORD,PDWORD); BOOL WINAPI SetPriorityClass(HANDLE,DWORD); BOOL WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR *,PGENERIC_MAPPING,HANDLE); -BOOL WINAPI SetProcessAffinityMask(HANDLE,DWORD); +BOOL WINAPI SetProcessAffinityMask(HANDLE,DWORD_PTR); BOOL WINAPI SetProcessPriorityBoost(HANDLE,BOOL); BOOL WINAPI SetProcessShutdownParameters(DWORD,DWORD); BOOL WINAPI SetProcessWorkingSetSize(HANDLE,SIZE_T,SIZE_T); diff --git a/reactos/include/psdk/windef.h b/reactos/include/psdk/windef.h index a98ea8fe7b3..e8eb5c01346 100644 --- a/reactos/include/psdk/windef.h +++ b/reactos/include/psdk/windef.h @@ -348,9 +348,9 @@ DECLARE_HANDLE(HKL); typedef int HFILE; typedef HICON HCURSOR; typedef DWORD COLORREF; -typedef int (WINAPI *FARPROC)(); -typedef int (WINAPI *NEARPROC)(); -typedef int (WINAPI *PROC)(); +typedef INT_PTR (WINAPI *FARPROC)(); +typedef INT_PTR (WINAPI *NEARPROC)(); +typedef INT_PTR (WINAPI *PROC)(); typedef struct tagRECT { LONG left; LONG top; diff --git a/reactos/include/psdk/winuser.h b/reactos/include/psdk/winuser.h index 57794e3b15e..6c2dfb0d735 100644 --- a/reactos/include/psdk/winuser.h +++ b/reactos/include/psdk/winuser.h @@ -615,8 +615,8 @@ extern "C" { #define RT_RCDATA MAKEINTRESOURCE(10) #define RT_MESSAGETABLE MAKEINTRESOURCE(11) #define DIFFERENCE 11 -#define RT_GROUP_CURSOR MAKEINTRESOURCE((DWORD)RT_CURSOR+DIFFERENCE) -#define RT_GROUP_ICON MAKEINTRESOURCE((DWORD)RT_ICON+DIFFERENCE) +#define RT_GROUP_CURSOR MAKEINTRESOURCE((ULONG_PTR)RT_CURSOR+DIFFERENCE) +#define RT_GROUP_ICON MAKEINTRESOURCE((ULONG_PTR)RT_ICON+DIFFERENCE) #define RT_VERSION MAKEINTRESOURCE(16) #define RT_DLGINCLUDE MAKEINTRESOURCE(17) #define RT_PLUGPLAY MAKEINTRESOURCE(19) @@ -2804,13 +2804,13 @@ typedef struct tagCOMPAREITEMSTRUCT { UINT CtlID; HWND hwndItem; UINT itemID1; - DWORD itemData1; + ULONG_PTR itemData1; UINT itemID2; - DWORD itemData2; + ULONG_PTR itemData2; DWORD dwLocaleId; } COMPAREITEMSTRUCT,*LPCOMPAREITEMSTRUCT; typedef struct tagCOPYDATASTRUCT { - DWORD dwData; + ULONG_PTR dwData; DWORD cbData; PVOID lpData; } COPYDATASTRUCT,*PCOPYDATASTRUCT; @@ -2848,7 +2848,7 @@ typedef struct tagDELETEITEMSTRUCT { UINT CtlID; UINT itemID; HWND hwndItem; - UINT itemData; + ULONG_PTR itemData; } DELETEITEMSTRUCT,*PDELETEITEMSTRUCT,*LPDELETEITEMSTRUCT; #pragma pack(push,2) typedef struct { @@ -2887,7 +2887,7 @@ typedef struct tagDRAWITEMSTRUCT { HWND hwndItem; HDC hDC; RECT rcItem; - DWORD itemData; + ULONG_PTR itemData; } DRAWITEMSTRUCT,*LPDRAWITEMSTRUCT,*PDRAWITEMSTRUCT; typedef struct { UINT cbSize; @@ -2985,7 +2985,7 @@ typedef struct tagMENUITEMINFOA { HMENU hSubMenu; HBITMAP hbmpChecked; HBITMAP hbmpUnchecked; - DWORD dwItemData; + ULONG_PTR dwItemData; LPSTR dwTypeData; UINT cch; #if (_WIN32_WINNT >= 0x0500) @@ -3002,7 +3002,7 @@ typedef struct tagMENUITEMINFOW { HMENU hSubMenu; HBITMAP hbmpChecked; HBITMAP hbmpUnchecked; - DWORD dwItemData; + ULONG_PTR dwItemData; LPWSTR dwTypeData; UINT cch; #if (_WIN32_WINNT >= 0x0500) @@ -3043,7 +3043,7 @@ typedef struct tagHELPINFO { int iContextType; int iCtrlId; HANDLE hItemHandle; - DWORD dwContextId; + DWORD_PTR dwContextId; POINT MousePos; } HELPINFO,*LPHELPINFO; typedef void(CALLBACK *MSGBOXCALLBACK)(LPHELPINFO); @@ -3055,7 +3055,7 @@ typedef struct { LPCSTR lpszCaption; DWORD dwStyle; LPCSTR lpszIcon; - DWORD dwContextHelpId; + DWORD_PTR dwContextHelpId; MSGBOXCALLBACK lpfnMsgBoxCallback; DWORD dwLanguageId; } MSGBOXPARAMSA,*PMSGBOXPARAMSA,*LPMSGBOXPARAMSA; @@ -3067,7 +3067,7 @@ typedef struct { LPCWSTR lpszCaption; DWORD dwStyle; LPCWSTR lpszIcon; - DWORD dwContextHelpId; + DWORD_PTR dwContextHelpId; MSGBOXCALLBACK lpfnMsgBoxCallback; DWORD dwLanguageId; } MSGBOXPARAMSW,*PMSGBOXPARAMSW,*LPMSGBOXPARAMSW; @@ -3220,7 +3220,7 @@ typedef struct tagMOUSEHOOKSTRUCT { POINT pt; HWND hwnd; UINT wHitTestCode; - DWORD dwExtraInfo; + ULONG_PTR dwExtraInfo; } MOUSEHOOKSTRUCT,*LPMOUSEHOOKSTRUCT,*PMOUSEHOOKSTRUCT; #if ( _WIN32_WINNT >= 0x0500 ) #ifdef __cplusplus @@ -3306,13 +3306,13 @@ typedef struct tagMEASUREITEMSTRUCT { UINT itemID; UINT itemWidth; UINT itemHeight; - DWORD itemData; + ULONG_PTR itemData; } MEASUREITEMSTRUCT,*PMEASUREITEMSTRUCT,*LPMEASUREITEMSTRUCT; typedef struct tagDROPSTRUCT { HWND hwndSource; HWND hwndSink; DWORD wFmt; - DWORD dwData; + ULONG_PTR dwData; POINT ptDrop; DWORD dwControlData; } DROPSTRUCT,*PDROPSTRUCT,*LPDROPSTRUCT; @@ -3451,7 +3451,7 @@ typedef struct tagKBDLLHOOKSTRUCT { DWORD scanCode; DWORD flags; DWORD time; - DWORD dwExtraInfo; + ULONG_PTR dwExtraInfo; } KBDLLHOOKSTRUCT,*LPKBDLLHOOKSTRUCT,*PKBDLLHOOKSTRUCT; typedef struct tagMSLLHOOKSTRUCT { @@ -3750,7 +3750,7 @@ BOOL WINAPI DlgDirSelectComboBoxExW(HWND,LPWSTR,int,int); BOOL WINAPI DlgDirSelectExA(HWND,LPSTR,int,int); BOOL WINAPI DlgDirSelectExW(HWND,LPWSTR,int,int); BOOL WINAPI DragDetect(HWND,POINT); -DWORD WINAPI DragObject(HWND,HWND,UINT,DWORD,HCURSOR); +DWORD WINAPI DragObject(HWND,HWND,UINT,ULONG_PTR,HCURSOR); BOOL WINAPI DrawAnimatedRects(HWND,int,LPCRECT,LPCRECT); BOOL WINAPI DrawCaption(HWND,HDC,LPCRECT,UINT); BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT); @@ -3988,8 +3988,8 @@ BOOL WINAPI InSendMessage(void); #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410) DWORD WINAPI InSendMessageEx(LPVOID); #endif -BOOL WINAPI InsertMenuA(HMENU,UINT,UINT,UINT,LPCSTR); -BOOL WINAPI InsertMenuW(HMENU,UINT,UINT,UINT,LPCWSTR); +BOOL WINAPI InsertMenuA(HMENU,UINT,UINT,UINT_PTR,LPCSTR); +BOOL WINAPI InsertMenuW(HMENU,UINT,UINT,UINT_PTR,LPCWSTR); BOOL WINAPI InsertMenuItemA(HMENU,UINT,BOOL,LPCMENUITEMINFOA); BOOL WINAPI InsertMenuItemW(HMENU,UINT,BOOL,LPCMENUITEMINFOW); INT WINAPI InternalGetWindowText(HWND,LPWSTR,INT); @@ -4069,8 +4069,8 @@ int WINAPI MessageBoxExA(HWND,LPCSTR,LPCSTR,UINT,WORD); int WINAPI MessageBoxExW(HWND,LPCWSTR,LPCWSTR,UINT,WORD); int WINAPI MessageBoxIndirectA(CONST MSGBOXPARAMSA*); int WINAPI MessageBoxIndirectW(CONST MSGBOXPARAMSW*); -BOOL WINAPI ModifyMenuA(HMENU,UINT,UINT,UINT,LPCSTR); -BOOL WINAPI ModifyMenuW(HMENU,UINT,UINT,UINT,LPCWSTR); +BOOL WINAPI ModifyMenuA(HMENU,UINT,UINT,UINT_PTR,LPCSTR); +BOOL WINAPI ModifyMenuW(HMENU,UINT,UINT,UINT_PTR,LPCWSTR); HMONITOR WINAPI MonitorFromPoint(POINT,DWORD); HMONITOR WINAPI MonitorFromRect(LPCRECT,DWORD); HMONITOR WINAPI MonitorFromWindow(HWND,DWORD); @@ -4284,8 +4284,8 @@ BOOL WINAPI WaitMessage(void); HWND WINAPI WindowFromDC(HDC hDC); HWND WINAPI WindowFromPoint(POINT); UINT WINAPI WinExec(LPCSTR,UINT); -BOOL WINAPI WinHelpA(HWND,LPCSTR,UINT,DWORD); -BOOL WINAPI WinHelpW(HWND,LPCWSTR,UINT,DWORD); +BOOL WINAPI WinHelpA(HWND,LPCSTR,UINT,ULONG_PTR); +BOOL WINAPI WinHelpW(HWND,LPCWSTR,UINT,ULONG_PTR); int WINAPIV wsprintfA(LPSTR,LPCSTR,...); int WINAPIV wsprintfW(LPWSTR,LPCWSTR,...); int WINAPI wvsprintfA(LPSTR,LPCSTR,va_list arglist); From a641a8d16b7bc9c3df5391374152c236a43d2883 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 14:43:08 +0000 Subject: [PATCH 347/388] Fix taskmgr build after GetProcessAffinityMask definition change. svn path=/branches/ros-amd64-bringup/; revision=36907 --- reactos/base/applications/taskmgr/affinity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/taskmgr/affinity.c b/reactos/base/applications/taskmgr/affinity.c index c2bb40538b4..0b96bef70d7 100644 --- a/reactos/base/applications/taskmgr/affinity.c +++ b/reactos/base/applications/taskmgr/affinity.c @@ -75,8 +75,8 @@ void ProcessPage_OnSetAffinity(void) INT_PTR CALLBACK AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - DWORD dwProcessAffinityMask = 0; - DWORD dwSystemAffinityMask = 0; + DWORD_PTR dwProcessAffinityMask = 0; + DWORD_PTR dwSystemAffinityMask = 0; WCHAR strErrorText[260]; WCHAR szTitle[256]; BYTE nCpu; From 0fd068c2b359f793696ce2a9b8c9e0e37a597c97 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 14:52:38 +0000 Subject: [PATCH 348/388] Fix 64bit build. svn path=/branches/ros-amd64-bringup/; revision=36908 --- reactos/dll/cpl/ncpa/ncpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/cpl/ncpa/ncpa.c b/reactos/dll/cpl/ncpa/ncpa.c index 1af077d6844..5019e07f9a1 100644 --- a/reactos/dll/cpl/ncpa/ncpa.c +++ b/reactos/dll/cpl/ncpa/ncpa.c @@ -25,7 +25,7 @@ DisplayApplet(VOID) wcscpy(szParameters, L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}"); - return (int) ShellExecuteW(NULL, L"open", L"explorer.exe", szParameters, NULL, SW_SHOWDEFAULT) > 32; + return (INT_PTR) ShellExecuteW(NULL, L"open", L"explorer.exe", szParameters, NULL, SW_SHOWDEFAULT) > 32; } /* Control Panel Callback */ From 0b4379ec37fe627bd366b2306e6bff940f8b41dd Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 15:09:55 +0000 Subject: [PATCH 349/388] Ntdll build fixes. svn path=/branches/ros-amd64-bringup/; revision=36909 --- reactos/dll/ntdll/ldr/utils.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/dll/ntdll/ldr/utils.c b/reactos/dll/ntdll/ldr/utils.c index 88c2a10bec1..8740ed108a7 100644 --- a/reactos/dll/ntdll/ldr/utils.c +++ b/reactos/dll/ntdll/ldr/utils.c @@ -1226,7 +1226,8 @@ LdrPerformRelocations(PIMAGE_NT_HEADERS NTHeaders, { PIMAGE_DATA_DIRECTORY RelocationDDir; PIMAGE_BASE_RELOCATION RelocationDir, RelocationEnd; - ULONG Count, ProtectSize, OldProtect, OldProtect2; + ULONG Count, OldProtect, OldProtect2; + SIZE_T ProtectSize; PVOID Page, ProtectPage, ProtectPage2; PUSHORT TypeOffset; ULONG_PTR Delta; @@ -1413,7 +1414,7 @@ LdrpProcessImportDirectoryEntry(PLDR_DATA_TABLE_ENTRY Module, PVOID IATBase; ULONG OldProtect; ULONG Ordinal; - ULONG IATSize; + SIZE_T IATSize; if (ImportModuleDirectory == NULL || ImportModuleDirectory->Name == 0) { @@ -1559,7 +1560,7 @@ LdrpAdjustImportDirectory(PLDR_DATA_TABLE_ENTRY Module, PVOID IATBase; ULONG OldProtect; ULONG Offset; - ULONG IATSize; + SIZE_T IATSize; PIMAGE_NT_HEADERS NTHeaders; PCHAR Name; ULONG Size; @@ -2559,7 +2560,7 @@ LdrpDetachProcess(BOOLEAN UnloadAll) { TRACE_LDR("Unload %wZ - Calling entry point at %x\n", &Module->BaseDllName, Module->EntryPoint); - LdrpCallDllEntry(Module, DLL_PROCESS_DETACH, (PVOID)(Module->LoadCount == 0xFFFF ? 1 : 0)); + LdrpCallDllEntry(Module, DLL_PROCESS_DETACH, (PVOID)(INT_PTR)(Module->LoadCount == 0xFFFF ? 1 : 0)); } else { @@ -2644,7 +2645,7 @@ LdrpAttachProcess(VOID) Module->Flags |= LDRP_LOAD_IN_PROGRESS; TRACE_LDR("%wZ loaded - Calling init routine at %x for process attaching\n", &Module->BaseDllName, Module->EntryPoint); - Result = LdrpCallDllEntry(Module, DLL_PROCESS_ATTACH, (PVOID)(Module->LoadCount == 0xFFFF ? 1 : 0)); + Result = LdrpCallDllEntry(Module, DLL_PROCESS_ATTACH, (PVOID)(INT_PTR)(Module->LoadCount == 0xFFFF ? 1 : 0)); if (!Result) { Status = STATUS_DLL_INIT_FAILED; From 9e9ba41f715b6d7ea6aeb9a4b45572c95c25dd41 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 23 Oct 2008 15:18:23 +0000 Subject: [PATCH 350/388] Reorganize a bit, remove unneeded . svn path=/branches/ros-amd64-bringup/; revision=36910 --- reactos/tools/rsym.h | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/reactos/tools/rsym.h b/reactos/tools/rsym.h index ccc6934489c..8f23daaf5a8 100644 --- a/reactos/tools/rsym.h +++ b/reactos/tools/rsym.h @@ -7,6 +7,17 @@ #define IMAGE_PE_MAGIC 0x00004550 #define IMAGE_SIZEOF_SHORT_NAME 8 +#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 +#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 +#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 + +#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 + +#define IMAGE_SCN_TYPE_NOLOAD 0x00000002 +#define IMAGE_SCN_LNK_REMOVE 0x00000800 +#define IMAGE_SCN_MEM_READ 0x40000000 +#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 + #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 typedef unsigned char BYTE; @@ -34,6 +45,7 @@ typedef unsigned long ULONG_PTR; #endif #pragma pack(push,2) + typedef struct _IMAGE_DOS_HEADER { WORD e_magic; WORD e_cblp; @@ -57,10 +69,6 @@ typedef struct _IMAGE_DOS_HEADER { } IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; #pragma pack(pop) -#define IMAGE_FILE_LINE_NUMS_STRIPPED 4 -#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8 -#define IMAGE_FILE_DEBUG_STRIPPED 512 - #pragma pack(push,4) typedef struct _IMAGE_FILE_HEADER { WORD Machine; @@ -145,41 +153,15 @@ typedef struct _IMAGE_OPTIONAL_HEADER64 { IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; } IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64; -#pragma pack(push,4) -typedef struct _IMAGE_NT_HEADERS32 { - DWORD Signature; - IMAGE_FILE_HEADER FileHeader; - IMAGE_OPTIONAL_HEADER32 OptionalHeader; -} IMAGE_NT_HEADERS32,*PIMAGE_NT_HEADERS32; -#pragma pack(pop) - -#pragma pack(push,4) -typedef struct _IMAGE_NT_HEADERS64 { - DWORD Signature; - IMAGE_FILE_HEADER FileHeader; - IMAGE_OPTIONAL_HEADER64 OptionalHeader; -} IMAGE_NT_HEADERS64,*PIMAGE_NT_HEADERS64; -#pragma pack(pop) #ifdef _TARGET_PE64 typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER; -typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS; -typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS; #else typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER; typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER; -typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS; -typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS; #endif -#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 - -#define IMAGE_SCN_TYPE_NOLOAD 0x00000002 -#define IMAGE_SCN_LNK_REMOVE 0x00000800 -#define IMAGE_SCN_MEM_READ 0x40000000 -#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 - typedef struct _IMAGE_SECTION_HEADER { BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; union { @@ -200,6 +182,7 @@ typedef struct _IMAGE_SECTION_HEADER { typedef struct _IMAGE_BASE_RELOCATION { DWORD VirtualAddress; DWORD SizeOfBlock; + WORD TypeOffset[1]; } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; #pragma pack(pop) From 80dff8a90040aac9fc1d763584984558e179cc06 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 24 Oct 2008 17:19:17 +0000 Subject: [PATCH 351/388] merge trunk changes to r36869 svn path=/branches/ros-amd64-bringup/; revision=36923 --- reactos/dll/win32/gdi32/misc/stubs.c | 14 -- reactos/dll/win32/gdi32/objects/dc.c | 173 ++++++++++++++++++ .../drivers/network/ndis/include/miniport.h | 6 + reactos/drivers/network/ndis/ndis/miniport.c | 20 +- reactos/drivers/network/ndis/ndis/protocol.c | 61 +++++- reactos/include/reactos/win32k/ntuser.h | 33 +++- reactos/lib/drivers/ip/network/neighbor.c | 2 +- reactos/lib/drivers/ip/network/ports.c | 9 +- reactos/lib/drivers/ip/network/router.c | 2 +- reactos/lib/drivers/ip/network/transmit.c | 20 +- .../subsystems/win32/win32k/ntuser/ntstubs.c | 8 +- 11 files changed, 317 insertions(+), 31 deletions(-) diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index 4754b612f3b..6e440053f8f 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -2004,20 +2004,6 @@ GdiConvertBitmapV5( return FALSE; } - -/* - * @implemented - * - */ -int -STDCALL -GetDeviceCaps(HDC hdc, - int i) -{ - /* FIXME some part need be done in user mode */ - return NtGdiGetDeviceCaps(hdc,i); -} - /* * @implemented * diff --git a/reactos/dll/win32/gdi32/objects/dc.c b/reactos/dll/win32/gdi32/objects/dc.c index 610a31b08e9..bdb6d6b56c1 100644 --- a/reactos/dll/win32/gdi32/objects/dc.c +++ b/reactos/dll/win32/gdi32/objects/dc.c @@ -465,6 +465,179 @@ GetCurrentObject(HDC hdc, return GetDCObject(hdc, uObjectType); } +/* + * @implemented + * + */ +int +STDCALL +GetDeviceCaps(HDC hDC, + int i) +{ + PDC_ATTR Dc_Attr; + PLDC pLDC; + PDEVCAPS pDevCaps = GdiDevCaps; // Primary display device capabilities. + DPRINT("Device CAPS1\n"); + + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + { + if ( i == TECHNOLOGY) return DT_METAFILE; + return 0; + } + else + { + pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return 0; + } + if (!(pLDC->Flags & LDC_DEVCAPS)) + { + if (!NtGdiGetDeviceCapsAll(hDC, &pLDC->DevCaps)) + SetLastError(ERROR_INVALID_PARAMETER); + pLDC->Flags |= LDC_DEVCAPS; + } + pDevCaps = &pLDC->DevCaps; + } + } + else + { + // HAX!!!! + // Due to winlogon process/thread mapping issues we have this hax! + // + return NtGdiGetDeviceCaps(hDC,i); + + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) + return 0; + if (!(Dc_Attr->ulDirty_ & DC_PRIMARY_DISPLAY) ) + return NtGdiGetDeviceCaps(hDC,i); + } + DPRINT("Device CAPS2\n"); + + switch (i) + { + case DRIVERVERSION: + return pDevCaps->ulVersion; + + case TECHNOLOGY: + return pDevCaps->ulTechnology; + + case HORZSIZE: + return pDevCaps->ulHorzSize; + + case VERTSIZE: + return pDevCaps->ulVertSize; + + case HORZRES: + return pDevCaps->ulHorzRes; + + case VERTRES: + return pDevCaps->ulVertRes; + + case LOGPIXELSX: + return pDevCaps->ulLogPixelsX; + + case LOGPIXELSY: + return pDevCaps->ulLogPixelsY; + + case BITSPIXEL: + return pDevCaps->ulBitsPixel; + + case PLANES: + return pDevCaps->ulPlanes; + + case NUMBRUSHES: + return -1; + + case NUMPENS: + return pDevCaps->ulNumPens; + + case NUMFONTS: + return pDevCaps->ulNumFonts; + + case NUMCOLORS: + return pDevCaps->ulNumColors; + + case ASPECTX: + return pDevCaps->ulAspectX; + + case ASPECTY: + return pDevCaps->ulAspectY; + + case ASPECTXY: + return pDevCaps->ulAspectXY; + + case CLIPCAPS: + return CP_RECTANGLE; + + case SIZEPALETTE: + return pDevCaps->ulSizePalette; + + case NUMRESERVED: + return 20; + + case COLORRES: + return pDevCaps->ulColorRes; + + case DESKTOPVERTRES: + return pDevCaps->ulVertRes; + + case DESKTOPHORZRES: + return pDevCaps->ulHorzRes; + + case BLTALIGNMENT: + return pDevCaps->ulBltAlignment; + + case SHADEBLENDCAPS: + return pDevCaps->ulShadeBlend; + + case COLORMGMTCAPS: + return pDevCaps->ulColorMgmtCaps; + + case PHYSICALWIDTH: + return pDevCaps->ulPhysicalWidth; + + case PHYSICALHEIGHT: + return pDevCaps->ulPhysicalHeight; + + case PHYSICALOFFSETX: + return pDevCaps->ulPhysicalOffsetX; + + case PHYSICALOFFSETY: + return pDevCaps->ulPhysicalOffsetY; + + case VREFRESH: + return pDevCaps->ulVRefresh; + + case RASTERCAPS: + return pDevCaps->ulRasterCaps; + + case CURVECAPS: + return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE | + CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT); + + case LINECAPS: + return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE | + LC_STYLED | LC_WIDESTYLED | LC_INTERIORS); + + case POLYGONALCAPS: + return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE | + PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS); + + case TEXTCAPS: + return pDevCaps->ulTextCaps; + + case PDEVICESIZE: + case SCALINGFACTORX: + case SCALINGFACTORY: + default: + return 0; + } + return 0; +} /* * @implemented diff --git a/reactos/drivers/network/ndis/include/miniport.h b/reactos/drivers/network/ndis/include/miniport.h index 90ffb0335cb..2302ddbde16 100644 --- a/reactos/drivers/network/ndis/include/miniport.h +++ b/reactos/drivers/network/ndis/include/miniport.h @@ -163,6 +163,12 @@ VOID NTAPI MiniportWorker(IN PVOID WorkItem); +VOID NTAPI +MiniSendComplete( + IN NDIS_HANDLE MiniportAdapterHandle, + IN PNDIS_PACKET Packet, + IN NDIS_STATUS Status); + #endif /* __MINIPORT_H */ /* EOF */ diff --git a/reactos/drivers/network/ndis/ndis/miniport.c b/reactos/drivers/network/ndis/ndis/miniport.c index ae7231c7d25..0f300d812ce 100644 --- a/reactos/drivers/network/ndis/ndis/miniport.c +++ b/reactos/drivers/network/ndis/ndis/miniport.c @@ -265,11 +265,29 @@ MiniResetComplete( IN BOOLEAN AddressingReset) { PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle; + PLIST_ENTRY CurrentEntry; + PADAPTER_BINDING AdapterBinding; KIRQL OldIrql; - NDIS_DbgPrint(MIN_TRACE, ("FIXME: MiniResetComplete is partially implemented\n")); + NdisMIndicateStatus(Adapter, NDIS_STATUS_RESET_END, NULL, 0); + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); + + CurrentEntry = Adapter->ProtocolListHead.Flink; + + while (CurrentEntry != &Adapter->ProtocolListHead) + { + AdapterBinding = CONTAINING_RECORD(CurrentEntry, ADAPTER_BINDING, AdapterListEntry); + + (*AdapterBinding->ProtocolBinding->Chars.ResetCompleteHandler)( + AdapterBinding->NdisOpenBlock.ProtocolBindingContext, + Status); + + CurrentEntry = CurrentEntry->Flink; + } + Adapter->MiniportBusy = FALSE; + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); } diff --git a/reactos/drivers/network/ndis/ndis/protocol.c b/reactos/drivers/network/ndis/ndis/protocol.c index 046101f283b..9121f8f1d1f 100644 --- a/reactos/drivers/network/ndis/ndis/protocol.c +++ b/reactos/drivers/network/ndis/ndis/protocol.c @@ -296,7 +296,66 @@ ProSendPackets( IN PPNDIS_PACKET PacketArray, IN UINT NumberOfPackets) { - UNIMPLEMENTED + PADAPTER_BINDING AdapterBinding = NdisBindingHandle; + PLOGICAL_ADAPTER Adapter = AdapterBinding->Adapter; + KIRQL RaiseOldIrql; + NDIS_STATUS NdisStatus; + UINT i; + + if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler) + { + if(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE) + { + (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)( + Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray, NumberOfPackets); + for (i = 0; i < NumberOfPackets; i++) + { + NdisStatus = NDIS_GET_PACKET_STATUS(PacketArray[i]); + if (NdisStatus != NDIS_STATUS_PENDING) + MiniSendComplete(Adapter, PacketArray[i], NdisStatus); + } + } + else + { + /* SendPackets is called at DISPATCH_LEVEL for all serialized miniports */ + KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); + (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)( + Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray, NumberOfPackets); + KeLowerIrql(RaiseOldIrql); + for (i = 0; i < NumberOfPackets; i++) + { + NdisStatus = NDIS_GET_PACKET_STATUS(PacketArray[i]); + if (NdisStatus != NDIS_STATUS_PENDING) + MiniSendComplete(Adapter, PacketArray[i], NdisStatus); + } + } + } + else + { + if(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE) + { + for (i = 0; i < NumberOfPackets; i++) + { + NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)( + Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray[i], 0); + if (NdisStatus != NDIS_STATUS_PENDING) + MiniSendComplete(Adapter, PacketArray[i], NdisStatus); + } + } + else + { + /* Send is called at DISPATCH_LEVEL for all serialized miniports */ + KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql); + for (i = 0; i < NumberOfPackets; i++) + { + NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)( + Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray[i], 0); + if (NdisStatus != NDIS_STATUS_PENDING) + MiniSendComplete(Adapter, PacketArray[i], NdisStatus); + } + KeLowerIrql(RaiseOldIrql); + } + } } diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index ef4977aee11..963f6d76058 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -414,6 +414,31 @@ typedef struct _BROADCASTPARM PW32THREADINFO GetW32ThreadInfo(VOID); PW32PROCESSINFO GetW32ProcessInfo(VOID); +typedef struct _WNDMSG +{ + DWORD maxMsgs; + DWORD abMsgs; +} WNDMSG, *PWNDMSG; + +typedef struct _SHAREDINFO +{ + PSERVERINFO psi; // global Server Info + PVOID aheList; // Handle Entry List + PVOID pDispInfo; // global PDISPLAYINFO pointer + ULONG_PTR ulSharedDelta; // Heap delta + WNDMSG awmControl[31]; + WNDMSG DefWindowMsgs; + WNDMSG DefWindowSpecMsgs; +} SHAREDINFO, *PSHAREDINFO; + +typedef struct _USERCONNECT +{ + DWORD Unknown0; + DWORD Unknown1; + DWORD Unknown2; + SHAREDINFO ShareInfo; +} USERCONNECT, *PUSERCONNECT; + // // Non SDK Window Message types. // @@ -1916,12 +1941,12 @@ NtUserPrintWindow( HDC hdcBlt, UINT nFlags); -DWORD +NTSTATUS NTAPI NtUserProcessConnect( - DWORD dwUnknown1, - DWORD dwUnknown2, - DWORD dwUnknown3); + IN HANDLE Process, + OUT PUSERCONNECT pUserConnect, + IN DWORD dwSize); // sizeof(USERCONNECT) DWORD NTAPI diff --git a/reactos/lib/drivers/ip/network/neighbor.c b/reactos/lib/drivers/ip/network/neighbor.c index f777d9145fd..3eee6265019 100644 --- a/reactos/lib/drivers/ip/network/neighbor.c +++ b/reactos/lib/drivers/ip/network/neighbor.c @@ -76,7 +76,7 @@ VOID NBFlushPacketQueue( PNEIGHBOR_CACHE_ENTRY NCE, ASSERT_KM_POINTER(Packet->Complete); Packet->Complete( Packet->Context, Packet->Packet, - NDIS_STATUS_REQUEST_ABORTED ); + ErrorCode ); } PoolFreeBuffer( Packet ); diff --git a/reactos/lib/drivers/ip/network/ports.c b/reactos/lib/drivers/ip/network/ports.c index 04ec39946c4..6630b5e77c3 100644 --- a/reactos/lib/drivers/ip/network/ports.c +++ b/reactos/lib/drivers/ip/network/ports.c @@ -44,6 +44,7 @@ BOOLEAN AllocatePort( PPORT_SET PortSet, ULONG Port ) { Port = htons(Port); ASSERT(Port >= PortSet->StartingPort); + ASSERT(Port < PortSet->StartingPort + PortSet->PortsToOversee); Port -= PortSet->StartingPort; ExAcquireFastMutex( &PortSet->Mutex ); @@ -67,7 +68,7 @@ ULONG AllocateAnyPort( PPORT_SET PortSet ) { Next -= PortSet->StartingPort; ExAcquireFastMutex( &PortSet->Mutex ); - AllocatedPort = RtlFindClearBits( &PortSet->ProtoBitmap, 1, 0 ); + AllocatedPort = RtlFindClearBits( &PortSet->ProtoBitmap, 1, Next ); if( AllocatedPort != (ULONG)-1 ) { RtlSetBit( &PortSet->ProtoBitmap, AllocatedPort ); AllocatedPort += PortSet->StartingPort; @@ -77,6 +78,9 @@ ULONG AllocateAnyPort( PPORT_SET PortSet ) { AllocatedPort = htons(AllocatedPort); + ASSERT(AllocatedPort >= PortSet->StartingPort); + ASSERT(AllocatedPort < PortSet->StartingPort + PortSet->PortsToOversee); + return AllocatedPort; } @@ -109,5 +113,8 @@ ULONG AllocatePortFromRange( PPORT_SET PortSet, ULONG Lowest, ULONG Highest ) { AllocatedPort = htons(AllocatedPort); + ASSERT(AllocatedPort >= PortSet->StartingPort); + ASSERT(AllocatedPort < PortSet->StartingPort + PortSet->PortsToOversee); + return AllocatedPort; } diff --git a/reactos/lib/drivers/ip/network/router.c b/reactos/lib/drivers/ip/network/router.c index 8e4c62cb925..4706efb9414 100644 --- a/reactos/lib/drivers/ip/network/router.c +++ b/reactos/lib/drivers/ip/network/router.c @@ -390,7 +390,7 @@ NTSTATUS RouterRemoveRoute(PIP_ADDRESS Target, PIP_ADDRESS Router) TI_DbgPrint(DEBUG_ROUTER, ("Leaving\n")); - return Found ? STATUS_NO_SUCH_FILE : STATUS_SUCCESS; + return Found ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } diff --git a/reactos/lib/drivers/ip/network/transmit.c b/reactos/lib/drivers/ip/network/transmit.c index 810c4854337..4684ddf487f 100644 --- a/reactos/lib/drivers/ip/network/transmit.c +++ b/reactos/lib/drivers/ip/network/transmit.c @@ -28,6 +28,7 @@ VOID IPSendComplete */ { PIPFRAGMENT_CONTEXT IFC = (PIPFRAGMENT_CONTEXT)Context; + NTSTATUS Status; TI_DbgPrint (MAX_TRACE, @@ -35,8 +36,14 @@ VOID IPSendComplete Context, NdisPacket, NdisStatus)); if (NT_SUCCESS(NdisStatus) && PrepareNextFragment(IFC)) { - /* A fragment was prepared for transmission, so send it */ - IPSendFragment(IFC->NdisPacket, IFC->NCE, IFC); + /* A fragment was prepared for transmission, so send it */ + Status = IPSendFragment(IFC->NdisPacket, IFC->NCE, IFC); + if (!NT_SUCCESS(Status)) + { + FreeNdisPacket(IFC->NdisPacket); + IFC->Complete(IFC->Context, IFC->Datagram, Status); + exFreePool(IFC); + } } else { TI_DbgPrint(MAX_TRACE, ("Calling completion handler.\n")); @@ -87,7 +94,7 @@ BOOLEAN PrepareNextFragment( TI_DbgPrint(MAX_TRACE, ("Called. IFC (0x%X)\n", IFC)); - if (IFC->BytesLeft != 0) { + if (IFC->BytesLeft > 0) { TI_DbgPrint(MAX_TRACE, ("Preparing 1 fragment.\n")); @@ -203,7 +210,12 @@ NTSTATUS SendFragments( /* Prepare next fragment for transmission and send it */ - PrepareNextFragment(IFC); + if (!PrepareNextFragment(IFC)) { + FreeNdisPacket(IFC->NdisPacket); + ExFreePool(IFC); + return NDIS_STATUS_FAILURE; + } + return IPSendFragment(IFC->NdisPacket, NCE, IFC); } diff --git a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c index 9622484c592..50d84e36e12 100644 --- a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c +++ b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c @@ -850,12 +850,12 @@ NtUserPrintWindow( return 0; } -DWORD +NTSTATUS NTAPI NtUserProcessConnect( - DWORD dwUnknown1, - DWORD dwUnknown2, - DWORD dwUnknown3) + HANDLE Process, + PUSERCONNECT pUserConnect, + DWORD Size) { UNIMPLEMENTED; return 0; From 20e0231813836ed04fe7d6c5e3a648aa7dd26568 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Fri, 24 Oct 2008 19:20:07 +0000 Subject: [PATCH 352/388] - Sync to trunk 36919. - Modified a few rbuild files to conform to trunk rbuild. svn path=/branches/ros-amd64-bringup/; revision=36924 --- .../kbswitch/kbsdll/kbsdll.rbuild | 3 +- .../base/applications/regedit/clb/clb.rbuild | 3 +- .../screensavers/3dtext/3dtext.rbuild | 3 +- .../screensavers/logon/logon.rbuild | 3 +- reactos/base/services/dhcp/dhclient.c | 32 +- reactos/base/system/userinit/userinit.c | 2 +- reactos/dll/cpl/access/access.rbuild | 3 +- reactos/dll/cpl/appwiz-new/appwiz.rbuild | 2 +- reactos/dll/cpl/appwiz/appwiz.rbuild | 2 +- reactos/dll/cpl/console/console.rbuild | 3 +- reactos/dll/cpl/desk/desk.rbuild | 2 +- reactos/dll/cpl/hdwwiz/hdwwiz.rbuild | 3 +- reactos/dll/cpl/input/input.rbuild | 2 +- reactos/dll/cpl/intl/intl.rbuild | 2 +- reactos/dll/cpl/joy/joy.rbuild | 2 +- reactos/dll/cpl/main/main.rbuild | 2 +- reactos/dll/cpl/mmsys/mmsys.rbuild | 3 +- reactos/dll/cpl/ncpa/ncpa.rbuild | 2 +- reactos/dll/cpl/odbccp32/odbccp32.rbuild | 2 +- reactos/dll/cpl/powercfg/powercfg.rbuild | 2 +- reactos/dll/cpl/sysdm/sysdm.rbuild | 2 +- reactos/dll/cpl/telephon/telephon.rbuild | 2 +- reactos/dll/cpl/timedate/timedate.rbuild | 2 +- reactos/dll/cpl/usrmgr/usrmgr.rbuild | 2 +- reactos/dll/directx/d3d8/d3d8.rbuild | 2 +- reactos/dll/directx/d3d9/d3d9.rbuild | 3 +- reactos/dll/directx/devenum/devenum.rbuild | 3 +- reactos/dll/directx/dinput/dinput.rbuild | 3 +- reactos/dll/directx/dinput8/dinput8.rbuild | 3 +- reactos/dll/directx/dplay/dplay.rbuild | 3 +- reactos/dll/directx/dplayx/dplayx.rbuild | 3 +- reactos/dll/directx/dsound/dsound.rbuild | 3 +- reactos/dll/directx/dxdiagn/dxdiagn.rbuild | 3 +- reactos/dll/directx/ksproxy/ksproxy.rbuild | 3 +- reactos/dll/directx/msdmo/msdmo.rbuild | 2 +- reactos/dll/directx/qedit/qedit.rbuild | 3 +- reactos/dll/directx/quartz/quartz.rbuild | 2 +- reactos/dll/directx/wine/d3d8/d3d8.rbuild | 3 +- reactos/dll/directx/wine/d3d9/d3d9.rbuild | 2 +- reactos/dll/keyboard/kbda1/kbda1.rbuild | 3 +- reactos/dll/keyboard/kbda2/kbda2.rbuild | 3 +- reactos/dll/keyboard/kbda3/kbda3.rbuild | 3 +- reactos/dll/keyboard/kbdal/kbdal.rbuild | 3 +- reactos/dll/keyboard/kbdarme/kbdarme.rbuild | 3 +- reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild | 3 +- reactos/dll/keyboard/kbdaze/kbdaze.rbuild | 3 +- reactos/dll/keyboard/kbdazel/kbdazel.rbuild | 3 +- reactos/dll/keyboard/kbdbe/kbdbe.rbuild | 3 +- reactos/dll/keyboard/kbdbga/kbdbga.rbuild | 3 +- reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild | 3 +- reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild | 3 +- reactos/dll/keyboard/kbdblr/kbdblr.rbuild | 3 +- reactos/dll/keyboard/kbdbr/kbdbr.rbuild | 3 +- reactos/dll/keyboard/kbdbur/kbdbur.rbuild | 3 +- reactos/dll/keyboard/kbdcan/kbdcan.rbuild | 3 +- reactos/dll/keyboard/kbdcr/kbdcr.rbuild | 3 +- reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild | 3 +- reactos/dll/keyboard/kbdda/kbdda.rbuild | 3 +- reactos/dll/keyboard/kbddv/kbddv.rbuild | 3 +- reactos/dll/keyboard/kbdes/kbdes.rbuild | 3 +- reactos/dll/keyboard/kbdest/kbdest.rbuild | 3 +- reactos/dll/keyboard/kbdfc/kbdfc.rbuild | 3 +- reactos/dll/keyboard/kbdfi/kbdfi.rbuild | 3 +- reactos/dll/keyboard/kbdfr/kbdfr.rbuild | 3 +- reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild | 3 +- reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild | 3 +- reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild | 3 +- reactos/dll/keyboard/kbdgr/kbdgr.rbuild | 3 +- reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild | 3 +- reactos/dll/keyboard/kbdhe/kbdhe.rbuild | 3 +- reactos/dll/keyboard/kbdheb/kbdheb.rbuild | 3 +- reactos/dll/keyboard/kbdhu/kbdhu.rbuild | 3 +- reactos/dll/keyboard/kbdic/kbdic.rbuild | 3 +- reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild | 3 +- reactos/dll/keyboard/kbdinben/kbdinben.rbuild | 3 +- reactos/dll/keyboard/kbdindev/kbdindev.rbuild | 3 +- reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild | 3 +- reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild | 3 +- reactos/dll/keyboard/kbdir/kbdir.rbuild | 3 +- reactos/dll/keyboard/kbdit/kbdit.rbuild | 3 +- reactos/dll/keyboard/kbdja/kbdja.rbuild | 3 +- reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild | 3 +- reactos/dll/keyboard/kbdko/kbdko.rbuild | 3 +- reactos/dll/keyboard/kbdla/kbdla.rbuild | 3 +- reactos/dll/keyboard/kbdlt/kbdlt.rbuild | 3 +- reactos/dll/keyboard/kbdlv/kbdlv.rbuild | 3 +- reactos/dll/keyboard/kbdmac/kbdmac.rbuild | 3 +- reactos/dll/keyboard/kbdne/kbdne.rbuild | 3 +- reactos/dll/keyboard/kbdno/kbdno.rbuild | 3 +- reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild | 3 +- reactos/dll/keyboard/kbdpo/kbdpo.rbuild | 3 +- reactos/dll/keyboard/kbdro/kbdro.rbuild | 3 +- reactos/dll/keyboard/kbdru/kbdru.rbuild | 3 +- reactos/dll/keyboard/kbdru1/kbdru1.rbuild | 3 +- reactos/dll/keyboard/kbdsg/kbdsg.rbuild | 3 +- reactos/dll/keyboard/kbdsk/kbdsk.rbuild | 3 +- reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild | 3 +- reactos/dll/keyboard/kbdsw/kbdsw.rbuild | 3 +- reactos/dll/keyboard/kbdtat/kbdtat.rbuild | 3 +- reactos/dll/keyboard/kbdth0/kbdth0.rbuild | 3 +- reactos/dll/keyboard/kbdth1/kbdth1.rbuild | 3 +- reactos/dll/keyboard/kbdth2/kbdth2.rbuild | 3 +- reactos/dll/keyboard/kbdth3/kbdth3.rbuild | 3 +- reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild | 3 +- reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild | 3 +- reactos/dll/keyboard/kbduk/kbduk.rbuild | 3 +- reactos/dll/keyboard/kbdur/kbdur.rbuild | 3 +- reactos/dll/keyboard/kbdurs/kbdurs.rbuild | 3 +- reactos/dll/keyboard/kbdus/kbdus.rbuild | 3 +- reactos/dll/keyboard/kbdusa/kbdusa.rbuild | 3 +- reactos/dll/keyboard/kbdusl/kbdusl.rbuild | 3 +- reactos/dll/keyboard/kbdusr/kbdusr.rbuild | 3 +- reactos/dll/keyboard/kbdusx/kbdusx.rbuild | 3 +- reactos/dll/keyboard/kbduzb/kbduzb.rbuild | 3 +- reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild | 3 +- reactos/dll/keyboard/kbdycc/kbdycc.rbuild | 3 +- reactos/dll/keyboard/kbdycl/kbdycl.rbuild | 3 +- reactos/dll/shellext/deskadp/deskadp.rbuild | 3 +- reactos/dll/shellext/deskmon/deskmon.rbuild | 2 +- reactos/dll/shellext/fontext/fontext.rbuild | 2 +- reactos/dll/win32/acledit/acledit.rbuild | 2 +- reactos/dll/win32/aclui/aclui.rbuild | 2 +- reactos/dll/win32/advapi32/advapi32.rbuild | 2 +- reactos/dll/win32/advapi32/advapi32.spec | 20 +- reactos/dll/win32/advpack/advpack.rbuild | 2 +- reactos/dll/win32/atl/atl.rbuild | 2 +- reactos/dll/win32/avifil32/avifil32.rbuild | 2 +- reactos/dll/win32/browseui/browseui.rbuild | 2 +- reactos/dll/win32/cabinet/cabinet.rbuild | 2 +- reactos/dll/win32/cards/cards.rbuild | 2 +- reactos/dll/win32/clusapi/clusapi.rbuild | 2 +- reactos/dll/win32/comcat/comcat.rbuild | 2 +- reactos/dll/win32/comctl32/comctl32.rbuild | 2 +- reactos/dll/win32/comdlg32/comdlg32.rbuild | 2 +- reactos/dll/win32/compstui/compstui.rbuild | 2 +- reactos/dll/win32/credui/credui.rbuild | 2 +- reactos/dll/win32/crtdll/crtdll.rbuild | 2 +- reactos/dll/win32/crypt32/crypt32.rbuild | 2 +- reactos/dll/win32/cryptdll/cryptdll.rbuild | 2 +- reactos/dll/win32/cryptnet/cryptnet.rbuild | 2 +- reactos/dll/win32/cryptui/cryptui.rbuild | 2 +- reactos/dll/win32/dbghelp/dbghelp.rbuild | 2 +- reactos/dll/win32/dciman32/dciman32.rbuild | 2 +- reactos/dll/win32/devmgr/devmgr.rbuild | 2 +- reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild | 2 +- reactos/dll/win32/fusion/fusion.rbuild | 2 +- reactos/dll/win32/gdi32/gdi32.def | 624 ------- reactos/dll/win32/gdi32/gdi32.rbuild | 2 +- reactos/dll/win32/gdiplus/gdiplus.rbuild | 2 +- reactos/dll/win32/getuname/getuname.rbuild | 2 +- reactos/dll/win32/glu32/glu32.rbuild | 2 +- .../dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild | 2 +- reactos/dll/win32/hlink/hlink.rbuild | 2 +- reactos/dll/win32/icmp/icmp.rbuild | 2 +- reactos/dll/win32/imagehlp/imagehlp.rbuild | 2 +- reactos/dll/win32/imm32/imm32.rbuild | 2 +- reactos/dll/win32/inetcomm/inetcomm.rbuild | 2 +- reactos/dll/win32/inetmib1/inetmib1.rbuild | 2 +- reactos/dll/win32/iphlpapi/iphlpapi.rbuild | 2 +- reactos/dll/win32/iphlpapi/resinfo_reactos.c | 70 +- reactos/dll/win32/jscript/jscript.rbuild | 2 +- reactos/dll/win32/kernel32/kernel32.rbuild | 2 +- reactos/dll/win32/kernel32/mem/section.c | 6 +- reactos/dll/win32/lpk/lpk.rbuild | 2 +- reactos/dll/win32/lz32/lz32.rbuild | 2 +- reactos/dll/win32/mapi32/mapi32.rbuild | 2 +- reactos/dll/win32/mlang/mlang.rbuild | 2 +- reactos/dll/win32/mmdrv/mmdrv.rbuild | 2 +- reactos/dll/win32/modemui/modemui.rbuild | 2 +- reactos/dll/win32/mpr/mpr.rbuild | 2 +- reactos/dll/win32/mprapi/mprapi.rbuild | 2 +- reactos/dll/win32/msacm32/msacm32.rbuild | 2 +- reactos/dll/win32/mscoree/mscoree.rbuild | 2 +- reactos/dll/win32/msgina/msgina.rbuild | 2 +- .../dll/win32/mshtml.tlb/mshtml.tlb.rbuild | 2 +- reactos/dll/win32/mshtml/mshtml.rbuild | 2 +- reactos/dll/win32/msi/msi.rbuild | 2 +- reactos/dll/win32/msimg32/msimg32.rbuild | 2 +- reactos/dll/win32/mstask/mstask.rbuild | 2 +- reactos/dll/win32/msvcrt20/msvcrt20.rbuild | 2 +- reactos/dll/win32/msvcrt40/msvcrt40.rbuild | 2 +- reactos/dll/win32/msvfw32/msvfw32.rbuild | 2 +- reactos/dll/win32/msxml3/msxml3.rbuild | 2 +- reactos/dll/win32/nddeapi/nddeapi.rbuild | 2 +- reactos/dll/win32/netapi32/netapi32.rbuild | 2 +- reactos/dll/win32/netcfgx/lang/pl-PL.rc | 180 +- reactos/dll/win32/netcfgx/netcfgx.rbuild | 2 +- reactos/dll/win32/netcfgx/tcpipconf_notify.c | 1 + reactos/dll/win32/netid/netid.rbuild | 2 +- reactos/dll/win32/netshell/lang/bg-BG.rc | 22 +- reactos/dll/win32/netshell/lang/cs-CZ.rc | 21 + reactos/dll/win32/netshell/lang/da-DK.rc | 21 + reactos/dll/win32/netshell/lang/de-DE.rc | 20 + reactos/dll/win32/netshell/lang/el-GR.rc | 21 + reactos/dll/win32/netshell/lang/en-US.rc | 20 + reactos/dll/win32/netshell/lang/es-ES.rc | 20 + reactos/dll/win32/netshell/lang/fr-FR.rc | 21 + reactos/dll/win32/netshell/lang/hu-HU.rc | 21 + reactos/dll/win32/netshell/lang/id-ID.rc | 21 + reactos/dll/win32/netshell/lang/it-IT.rc | 20 + reactos/dll/win32/netshell/lang/ja-JP.rc | 21 + reactos/dll/win32/netshell/lang/nl-NL.rc | 21 + reactos/dll/win32/netshell/lang/no-NO.rc | 20 + reactos/dll/win32/netshell/lang/pl-PL.rc | 29 +- reactos/dll/win32/netshell/lang/ru-RU.rc | 21 + reactos/dll/win32/netshell/lang/sk-SK.rc | 21 + reactos/dll/win32/netshell/lang/sv-SE.rc | 21 + reactos/dll/win32/netshell/lang/uk-UA.rc | 21 + reactos/dll/win32/netshell/lang/zh-CN.rc | 21 + reactos/dll/win32/netshell/lanstatusui.c | 205 ++- reactos/dll/win32/netshell/netshell.rbuild | 2 +- reactos/dll/win32/netshell/netshell.rc | 1 - reactos/dll/win32/netshell/resource.h | 17 +- reactos/dll/win32/newdev/newdev.rbuild | 2 +- reactos/dll/win32/ntdsapi/ntdsapi.rbuild | 2 +- reactos/dll/win32/ntmarta/ntmarta.rbuild | 2 +- reactos/dll/win32/objsel/objsel.rbuild | 2 +- reactos/dll/win32/odbc32/odbc32.rbuild | 2 +- reactos/dll/win32/odbccp32/odbccp32.rbuild | 2 +- reactos/dll/win32/ole32/ole32.rbuild | 2 +- reactos/dll/win32/oleacc/oleacc.rbuild | 2 +- reactos/dll/win32/oleaut32/oleaut32.rbuild | 2 +- reactos/dll/win32/oledlg/oledlg.rbuild | 2 +- reactos/dll/win32/olepro32/olepro32.rbuild | 2 +- reactos/dll/win32/opengl32/opengl32.rbuild | 2 +- reactos/dll/win32/pdh/pdh.rbuild | 2 +- reactos/dll/win32/powrprof/powrprof.rbuild | 2 +- reactos/dll/win32/printui/printui.rbuild | 2 +- reactos/dll/win32/pstorec/pstorec.rbuild | 2 +- reactos/dll/win32/rasapi32/rasapi32.rbuild | 2 +- reactos/dll/win32/rasdlg/rasdlg.rbuild | 2 +- reactos/dll/win32/rasman/rasman.rbuild | 2 +- reactos/dll/win32/riched20/riched20.rbuild | 2 +- reactos/dll/win32/riched32/riched32.rbuild | 2 +- reactos/dll/win32/rpcrt4/rpcrt4.rbuild | 2 +- reactos/dll/win32/rsabase/rsabase.rbuild | 2 +- reactos/dll/win32/rsaenh/rsaenh.rbuild | 2 +- reactos/dll/win32/samsrv/samsrv.rbuild | 2 +- reactos/dll/win32/schannel/schannel.rbuild | 2 +- reactos/dll/win32/sensapi/sensapi.rbuild | 2 +- reactos/dll/win32/serialui/serialui.rbuild | 2 +- reactos/dll/win32/setupapi/setupapi.rbuild | 2 +- reactos/dll/win32/sfc/sfc.rbuild | 2 +- reactos/dll/win32/sfc_os/sfc_os.rbuild | 2 +- reactos/dll/win32/shdocvw/shdocvw.rbuild | 2 +- reactos/dll/win32/shell32/cpanelfolder.c | 1373 --------------- reactos/dll/win32/shell32/shell32.rbuild | 2 +- reactos/dll/win32/shell32/shfldr_cpanel.c | 4 + reactos/dll/win32/shfolder/shfolder.rbuild | 2 +- reactos/dll/win32/shimgvw/shimgvw.rbuild | 2 +- reactos/dll/win32/shlwapi/shlwapi.rbuild | 2 +- reactos/dll/win32/snmpapi/snmpapi.rbuild | 2 +- reactos/dll/win32/stdole2.tlb/stdole2.rbuild | 2 +- .../dll/win32/stdole32.tlb/stdole32.rbuild | 2 +- reactos/dll/win32/sxs/sxs.rbuild | 2 +- reactos/dll/win32/tapi32/tapi32.rbuild | 2 +- reactos/dll/win32/urlmon/urlmon.rbuild | 2 +- reactos/dll/win32/user32/user32.rbuild | 2 +- reactos/dll/win32/usp10/usp10.rbuild | 2 +- reactos/dll/win32/uxtheme/uxtheme.rbuild | 2 +- reactos/dll/win32/vdmdbg/vdmdbg.rbuild | 2 +- reactos/dll/win32/version/version.rbuild | 2 +- reactos/dll/win32/wdmaud.drv/wdmaud.rbuild | 2 +- reactos/dll/win32/winhttp/winhttp.rbuild | 2 +- reactos/dll/win32/wininet/wininet.rbuild | 2 +- .../dll/win32/winmm/midimap/midimap.rbuild | 2 +- .../dll/win32/winmm/wavemap/wavemap.rbuild | 2 +- reactos/dll/win32/winmm/winmm.rbuild | 2 +- reactos/dll/win32/winspool/winspool.rbuild | 2 +- reactos/dll/win32/wintrust/wintrust.rbuild | 2 +- reactos/dll/win32/wldap32/wldap32.rbuild | 2 +- reactos/dll/win32/ws2_32/ws2_32.rbuild | 2 +- reactos/dll/win32/wshtcpip/wshtcpip.rbuild | 2 +- reactos/dll/win32/wtsapi32/wtsapi32.rbuild | 2 +- reactos/drivers/base/bootvid/bootvid.rbuild | 2 +- reactos/drivers/base/kdcom/kdcom.rbuild | 2 +- reactos/drivers/directx/dxapi/dxapi.rbuild | 2 +- reactos/drivers/directx/dxg/dxg.rbuild | 2 +- reactos/drivers/directx/dxgthk/dxgthk.rbuild | 2 +- reactos/drivers/filesystems/fastfat/dirwr.c | 2 +- reactos/drivers/ksfilter/ks/ks.rbuild | 2 +- reactos/drivers/network/tcpip/tcpip.rbuild | 2 +- .../drivers/network/tcpip/tcpip/dispatch.c | 121 +- .../storage/class/class2/class2.rbuild | 2 +- .../storage/ide/pciidex/pciidex.rbuild | 2 +- .../storage/port/diskdump/diskdump.rbuild | 2 +- .../drivers/storage/scsiport/scsiport.pspec | 51 - .../drivers/storage/scsiport/scsiport.rbuild | 7 +- .../drivers/storage/scsiport/scsiport.spec | 45 + reactos/drivers/storage/scsiport/stubs.c | 250 --- reactos/drivers/usb/usbd/usbd.rbuild | 2 +- .../video/displays/framebuf/framebuf.rbuild | 2 +- .../displays/framebufacc/framebufacc.rbuild | 2 +- .../drivers/video/displays/vga/vgaddi.rbuild | 2 +- .../drivers/video/videoprt/videoprt.rbuild | 2 +- .../wdm/audio/backpln/portcls/portcls.rbuild | 2 +- .../drivers/wdm/audio/drm/drmk/drmk.rbuild | 2 +- reactos/drivers/wmi/wmilib.rbuild | 2 +- reactos/hal/hal/hal.rbuild | 2 +- reactos/hal/hal/hal.spec | 1 + reactos/hal/halarm/up/halup.rbuild | 2 +- reactos/hal/halx86/halmp.rbuild | 2 +- reactos/hal/halx86/halup.rbuild | 2 +- reactos/hal/halx86/halxbox.rbuild | 2 +- reactos/include/ndk/asm.h | 1 + reactos/include/ndk/extypes.h | 2 +- reactos/include/ndk/i386/ketypes.h | 4 + reactos/include/ndk/ketypes.h | 2 +- reactos/include/psdk/winbase.h | 4 +- reactos/include/reactos/win32k/ntuser.h | 20 + reactos/lib/debugsup/debugsup-ntos-amd64.def | 10 - reactos/lib/debugsup/debugsup-ntos-i386.def | 12 - reactos/lib/debugsup/debugsup-ntos.spec | 8 + reactos/lib/debugsup/debugsup.rbuild | 4 +- reactos/lib/rtl/actctx.c | 18 + reactos/media/inf/NET_NIC.inf | Bin 2250 -> 2478 bytes reactos/media/inf/acpi.inf | Bin 3056 -> 3272 bytes reactos/media/inf/cdrom.inf | Bin 2136 -> 2370 bytes reactos/media/inf/cpu.inf | Bin 3578 -> 4138 bytes reactos/media/inf/display.inf | Bin 5278 -> 5918 bytes reactos/media/inf/fdc.inf | Bin 5086 -> 5738 bytes reactos/media/inf/hdc.inf | Bin 6330 -> 7218 bytes reactos/media/inf/keyboard.inf | Bin 4976 -> 5502 bytes reactos/media/inf/machine.inf | Bin 30634 -> 38172 bytes reactos/media/inf/msmouse.inf | Bin 14282 -> 16672 bytes reactos/media/inf/netisa.inf | Bin 3900 -> 4106 bytes reactos/media/inf/ports.inf | Bin 7620 -> 8238 bytes reactos/media/inf/scsi.inf | Bin 5260 -> 5624 bytes reactos/media/inf/usb.inf | Bin 3312 -> 3562 bytes reactos/media/inf/usbport.inf | Bin 11600 -> 12660 bytes reactos/media/inf/usbstor.inf | Bin 3698 -> 3970 bytes reactos/ntoskrnl/config/cmdelay.c | 2 + reactos/ntoskrnl/config/i386/cmhardwr.c | 3 +- reactos/ntoskrnl/ex/profile.c | 5 +- reactos/ntoskrnl/ex/shutdown.c | 2 +- reactos/ntoskrnl/include/internal/ntoskrnl.h | 1 + reactos/ntoskrnl/ke/arm/usercall.c | 2 +- reactos/ntoskrnl/ke/i386/ctxswitch.S | 22 +- reactos/ntoskrnl/ke/i386/trap.s | 21 +- reactos/ntoskrnl/ke/i386/v86vdm.c | 4 +- reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild | 3 +- reactos/ntoskrnl/ntoskrnl-generic.rbuild | 2 +- reactos/ntoskrnl/ntoskrnl_amd64.def | 1516 ----------------- reactos/subsystems/win32/csrss/video.c | 10 +- reactos/subsystems/win32/win32k/eng/mem.c | 4 +- .../subsystems/win32/win32k/include/hook.h | 2 +- .../subsystems/win32/win32k/ntuser/event.c | 10 +- .../subsystems/win32/win32k/ntuser/metric.c | 6 +- .../subsystems/win32/win32k/ntuser/msgqueue.c | 4 +- .../rbuild/backend/mingw/modulehandler.cpp | 186 +- .../rbuild/backend/mingw/modulehandler.h | 2 + reactos/tools/rbuild/module.cpp | 6 - 352 files changed, 1425 insertions(+), 4535 deletions(-) delete mode 100644 reactos/dll/win32/gdi32/gdi32.def delete mode 100644 reactos/dll/win32/shell32/cpanelfolder.c delete mode 100644 reactos/drivers/storage/scsiport/scsiport.pspec create mode 100644 reactos/drivers/storage/scsiport/scsiport.spec delete mode 100644 reactos/drivers/storage/scsiport/stubs.c delete mode 100644 reactos/lib/debugsup/debugsup-ntos-amd64.def delete mode 100644 reactos/lib/debugsup/debugsup-ntos-i386.def create mode 100644 reactos/lib/debugsup/debugsup-ntos.spec delete mode 100644 reactos/ntoskrnl/ntoskrnl_amd64.def diff --git a/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild b/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild index c84b3edc5aa..bf0ef3bb216 100644 --- a/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild +++ b/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild @@ -1,7 +1,7 @@ - + . 0x0500 0x0600 @@ -11,5 +11,4 @@ comctl32 kbsdll.c kbsdll.rc - kbsdll.spec diff --git a/reactos/base/applications/regedit/clb/clb.rbuild b/reactos/base/applications/regedit/clb/clb.rbuild index 2e8d86aa7fb..f7086619344 100644 --- a/reactos/base/applications/regedit/clb/clb.rbuild +++ b/reactos/base/applications/regedit/clb/clb.rbuild @@ -1,7 +1,7 @@ - + . 0x0500 0x0600 @@ -13,6 +13,5 @@ comctl32 clb.c clb.rc - clb.spec precomp.h diff --git a/reactos/base/applications/screensavers/3dtext/3dtext.rbuild b/reactos/base/applications/screensavers/3dtext/3dtext.rbuild index 03e2f504a12..365f917ef88 100644 --- a/reactos/base/applications/screensavers/3dtext/3dtext.rbuild +++ b/reactos/base/applications/screensavers/3dtext/3dtext.rbuild @@ -1,7 +1,7 @@ - + scrnsave kernel32 user32 @@ -13,7 +13,6 @@ 3dtext.c settings.c rsrc.rc - 3dtext.spec diff --git a/reactos/base/applications/screensavers/logon/logon.rbuild b/reactos/base/applications/screensavers/logon/logon.rbuild index 32085fbd859..6176f166a94 100644 --- a/reactos/base/applications/screensavers/logon/logon.rbuild +++ b/reactos/base/applications/screensavers/logon/logon.rbuild @@ -1,7 +1,7 @@ - + . scrnsave kernel32 @@ -12,5 +12,4 @@ logon.c logon.rc - logon.spec diff --git a/reactos/base/services/dhcp/dhclient.c b/reactos/base/services/dhcp/dhclient.c index 9f04b6f754a..ed7ff2d6eab 100644 --- a/reactos/base/services/dhcp/dhclient.c +++ b/reactos/base/services/dhcp/dhclient.c @@ -451,9 +451,16 @@ dhcpack(struct packet *packet) } void set_name_servers( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) { + CHAR Buffer[200] = "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\"; + HKEY RegKey; + + strcat(Buffer, Adapter->DhclientInfo.name); + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, Buffer, 0, KEY_WRITE, &RegKey ) != ERROR_SUCCESS) + return; + + if( new_lease->options[DHO_DOMAIN_NAME_SERVERS].len ) { - CHAR Buffer[200] = "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\"; - HKEY RegKey; + struct iaddr nameserver; char *nsbuf; int i, addrs = @@ -462,13 +469,9 @@ void set_name_servers( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) { /* XXX I'm setting addrs to 1 until we are ready up the chain */ addrs = 1; nsbuf = malloc( addrs * sizeof(IP_ADDRESS_STRING) ); - nsbuf[0] = 0; - strcat(Buffer, Adapter->DhclientInfo.name); - if( nsbuf && !RegOpenKeyEx - ( HKEY_LOCAL_MACHINE, - Buffer, - 0, KEY_WRITE, &RegKey ) ) { + if( nsbuf) { + nsbuf[0] = 0; for( i = 0; i < addrs; i++ ) { nameserver.len = sizeof(ULONG); memcpy( nameserver.iabuf, @@ -480,12 +483,17 @@ void set_name_servers( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) { DH_DbgPrint(MID_TRACE,("Setting DhcpNameserver: %s\n", nsbuf)); - RegSetValueEx( RegKey, "DhcpNameServer", 0, REG_SZ, - (LPBYTE)nsbuf, strlen(nsbuf) + 1); + RegSetValueExA( RegKey, "DhcpNameServer", 0, REG_SZ, + (LPBYTE)nsbuf, strlen(nsbuf) + 1 ); + free( nsbuf ); } - // free(NULL) is defined to be OK too - free( nsbuf ); + + } else { + RegDeleteValueW( RegKey, L"DhcpNameServer" ); } + + RegCloseKey( RegKey ); + } void setup_adapter( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) { diff --git a/reactos/base/system/userinit/userinit.c b/reactos/base/system/userinit/userinit.c index 6b81fe38bfa..5c43608f8ab 100644 --- a/reactos/base/system/userinit/userinit.c +++ b/reactos/base/system/userinit/userinit.c @@ -580,9 +580,9 @@ wWinMain(IN HINSTANCE hInst, IN LPWSTR lpszCmdLine, IN int nCmdShow) { - NotifyLogon(); SetUserSettings(); StartShell(); + NotifyLogon(); return 0; } diff --git a/reactos/dll/cpl/access/access.rbuild b/reactos/dll/cpl/access/access.rbuild index 825eef4914b..2a900952614 100644 --- a/reactos/dll/cpl/access/access.rbuild +++ b/reactos/dll/cpl/access/access.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x600 @@ -18,5 +18,4 @@ mouse.c sound.c access.rc - access.spec diff --git a/reactos/dll/cpl/appwiz-new/appwiz.rbuild b/reactos/dll/cpl/appwiz-new/appwiz.rbuild index ba87358ae89..ca09ede0cb3 100644 --- a/reactos/dll/cpl/appwiz-new/appwiz.rbuild +++ b/reactos/dll/cpl/appwiz-new/appwiz.rbuild @@ -1,7 +1,7 @@ - + . 0x600 diff --git a/reactos/dll/cpl/appwiz/appwiz.rbuild b/reactos/dll/cpl/appwiz/appwiz.rbuild index 1ab4b807d33..ed1f57fd75e 100644 --- a/reactos/dll/cpl/appwiz/appwiz.rbuild +++ b/reactos/dll/cpl/appwiz/appwiz.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/cpl/console/console.rbuild b/reactos/dll/cpl/console/console.rbuild index 7fce9201d08..7531fb381d8 100644 --- a/reactos/dll/cpl/console/console.rbuild +++ b/reactos/dll/cpl/console/console.rbuild @@ -1,5 +1,5 @@ - + . 0x600 0x501 @@ -13,6 +13,5 @@ layout.c colors.c console.rc - console.spec console.h diff --git a/reactos/dll/cpl/desk/desk.rbuild b/reactos/dll/cpl/desk/desk.rbuild index 3e83899ae56..2fd0d649c50 100644 --- a/reactos/dll/cpl/desk/desk.rbuild +++ b/reactos/dll/cpl/desk/desk.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild b/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild index 628c1012c15..65a4ad19db7 100644 --- a/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild +++ b/reactos/dll/cpl/hdwwiz/hdwwiz.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -9,5 +9,4 @@ kernel32 hdwwiz.c hdwwiz.rc - hdwwiz.spec diff --git a/reactos/dll/cpl/input/input.rbuild b/reactos/dll/cpl/input/input.rbuild index f90250b7aba..e424b995725 100644 --- a/reactos/dll/cpl/input/input.rbuild +++ b/reactos/dll/cpl/input/input.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/cpl/intl/intl.rbuild b/reactos/dll/cpl/intl/intl.rbuild index fbd695b7464..291b8c24a68 100644 --- a/reactos/dll/cpl/intl/intl.rbuild +++ b/reactos/dll/cpl/intl/intl.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x600 diff --git a/reactos/dll/cpl/joy/joy.rbuild b/reactos/dll/cpl/joy/joy.rbuild index 252d375d0aa..b7b919d17da 100644 --- a/reactos/dll/cpl/joy/joy.rbuild +++ b/reactos/dll/cpl/joy/joy.rbuild @@ -1,7 +1,7 @@ - + . 0x600 diff --git a/reactos/dll/cpl/main/main.rbuild b/reactos/dll/cpl/main/main.rbuild index b48a6b6c891..b26aa2a1b1d 100644 --- a/reactos/dll/cpl/main/main.rbuild +++ b/reactos/dll/cpl/main/main.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/cpl/mmsys/mmsys.rbuild b/reactos/dll/cpl/mmsys/mmsys.rbuild index 918a87a7d93..5eb9ee6ef21 100644 --- a/reactos/dll/cpl/mmsys/mmsys.rbuild +++ b/reactos/dll/cpl/mmsys/mmsys.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 @@ -20,5 +20,4 @@ audio.c voice.c mmsys.rc - mmsys.spec diff --git a/reactos/dll/cpl/ncpa/ncpa.rbuild b/reactos/dll/cpl/ncpa/ncpa.rbuild index bfb2d75d0fd..4211cc49796 100644 --- a/reactos/dll/cpl/ncpa/ncpa.rbuild +++ b/reactos/dll/cpl/ncpa/ncpa.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x600 diff --git a/reactos/dll/cpl/odbccp32/odbccp32.rbuild b/reactos/dll/cpl/odbccp32/odbccp32.rbuild index 0c6933beec2..d1644c2c92c 100644 --- a/reactos/dll/cpl/odbccp32/odbccp32.rbuild +++ b/reactos/dll/cpl/odbccp32/odbccp32.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/cpl/powercfg/powercfg.rbuild b/reactos/dll/cpl/powercfg/powercfg.rbuild index 4d46bdda72c..597f30a110c 100644 --- a/reactos/dll/cpl/powercfg/powercfg.rbuild +++ b/reactos/dll/cpl/powercfg/powercfg.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine 0x600 diff --git a/reactos/dll/cpl/sysdm/sysdm.rbuild b/reactos/dll/cpl/sysdm/sysdm.rbuild index dd1761330eb..096336d8eca 100644 --- a/reactos/dll/cpl/sysdm/sysdm.rbuild +++ b/reactos/dll/cpl/sysdm/sysdm.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/cpl/telephon/telephon.rbuild b/reactos/dll/cpl/telephon/telephon.rbuild index e9634aedd95..1611894b71a 100644 --- a/reactos/dll/cpl/telephon/telephon.rbuild +++ b/reactos/dll/cpl/telephon/telephon.rbuild @@ -1,7 +1,7 @@ - + . 0x600 diff --git a/reactos/dll/cpl/timedate/timedate.rbuild b/reactos/dll/cpl/timedate/timedate.rbuild index e78c8599dab..4758c1741da 100644 --- a/reactos/dll/cpl/timedate/timedate.rbuild +++ b/reactos/dll/cpl/timedate/timedate.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/cpl/usrmgr/usrmgr.rbuild b/reactos/dll/cpl/usrmgr/usrmgr.rbuild index f355cfd844b..28b5f054c3b 100644 --- a/reactos/dll/cpl/usrmgr/usrmgr.rbuild +++ b/reactos/dll/cpl/usrmgr/usrmgr.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x501 diff --git a/reactos/dll/directx/d3d8/d3d8.rbuild b/reactos/dll/directx/d3d8/d3d8.rbuild index ee82042391c..3c14ab2b963 100644 --- a/reactos/dll/directx/d3d8/d3d8.rbuild +++ b/reactos/dll/directx/d3d8/d3d8.rbuild @@ -1,7 +1,7 @@ - + d3d8.c d3d8.rc d3d8.spec diff --git a/reactos/dll/directx/d3d9/d3d9.rbuild b/reactos/dll/directx/d3d9/d3d9.rbuild index 61369d65d50..6d273c7e415 100644 --- a/reactos/dll/directx/d3d9/d3d9.rbuild +++ b/reactos/dll/directx/d3d9/d3d9.rbuild @@ -1,7 +1,7 @@ - + advapi32 kernel32 @@ -31,5 +31,4 @@ device.c format.c d3d9.rc - d3d9.spec diff --git a/reactos/dll/directx/devenum/devenum.rbuild b/reactos/dll/directx/devenum/devenum.rbuild index 98166aa5e19..85536a2934f 100644 --- a/reactos/dll/directx/devenum/devenum.rbuild +++ b/reactos/dll/directx/devenum/devenum.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine 0x600 @@ -25,5 +25,4 @@ factory.c mediacatenum.c parsedisplayname.c - devenum.spec diff --git a/reactos/dll/directx/dinput/dinput.rbuild b/reactos/dll/directx/dinput/dinput.rbuild index 9ec004c3048..9d363d5c64d 100644 --- a/reactos/dll/directx/dinput/dinput.rbuild +++ b/reactos/dll/directx/dinput/dinput.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine 0x600 @@ -27,5 +27,4 @@ keyboard.c mouse.c regsvr.c - dinput.spec diff --git a/reactos/dll/directx/dinput8/dinput8.rbuild b/reactos/dll/directx/dinput8/dinput8.rbuild index 539b9273ccc..6f10621ecda 100644 --- a/reactos/dll/directx/dinput8/dinput8.rbuild +++ b/reactos/dll/directx/dinput8/dinput8.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine 0x600 @@ -20,5 +20,4 @@ dinput version.rc dinput8_main.c - dinput8.spec diff --git a/reactos/dll/directx/dplay/dplay.rbuild b/reactos/dll/directx/dplay/dplay.rbuild index 81144bac274..337fa3925bc 100644 --- a/reactos/dll/directx/dplay/dplay.rbuild +++ b/reactos/dll/directx/dplay/dplay.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine 0x600 @@ -19,5 +19,4 @@ dinput version.rc dplay_main.c - dplay.spec diff --git a/reactos/dll/directx/dplayx/dplayx.rbuild b/reactos/dll/directx/dplayx/dplayx.rbuild index fb4bde9eff9..be389321d33 100644 --- a/reactos/dll/directx/dplayx/dplayx.rbuild +++ b/reactos/dll/directx/dplayx/dplayx.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine 0x600 @@ -28,5 +28,4 @@ lobbysp.c name_server.c regsvr.c - dplayx.spec diff --git a/reactos/dll/directx/dsound/dsound.rbuild b/reactos/dll/directx/dsound/dsound.rbuild index f27fe9b205f..5c08fb27ce7 100644 --- a/reactos/dll/directx/dsound/dsound.rbuild +++ b/reactos/dll/directx/dsound/dsound.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine 0x600 @@ -34,5 +34,4 @@ dxroslayer.c getguidfromstring.c - dsound.spec diff --git a/reactos/dll/directx/dxdiagn/dxdiagn.rbuild b/reactos/dll/directx/dxdiagn/dxdiagn.rbuild index df69d270643..1155eba1a42 100644 --- a/reactos/dll/directx/dxdiagn/dxdiagn.rbuild +++ b/reactos/dll/directx/dxdiagn/dxdiagn.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine 0x600 @@ -22,5 +22,4 @@ dxdiag_main.c provider.c regsvr.c - dxdiagn.spec diff --git a/reactos/dll/directx/ksproxy/ksproxy.rbuild b/reactos/dll/directx/ksproxy/ksproxy.rbuild index fddad2c54ea..d5b065e6509 100644 --- a/reactos/dll/directx/ksproxy/ksproxy.rbuild +++ b/reactos/dll/directx/ksproxy/ksproxy.rbuild @@ -2,7 +2,7 @@ - + . 0x600 0x600 @@ -11,6 +11,5 @@ ntdll ksproxy.c ksproxy.rc - ksproxy.spec diff --git a/reactos/dll/directx/msdmo/msdmo.rbuild b/reactos/dll/directx/msdmo/msdmo.rbuild index 57670d04ac3..a74951d3260 100644 --- a/reactos/dll/directx/msdmo/msdmo.rbuild +++ b/reactos/dll/directx/msdmo/msdmo.rbuild @@ -2,7 +2,7 @@ - + . 0x600 0x600 diff --git a/reactos/dll/directx/qedit/qedit.rbuild b/reactos/dll/directx/qedit/qedit.rbuild index 6f2363b2051..30d54b21cf1 100644 --- a/reactos/dll/directx/qedit/qedit.rbuild +++ b/reactos/dll/directx/qedit/qedit.rbuild @@ -2,7 +2,7 @@ - + . 0x600 0x600 @@ -11,6 +11,5 @@ ntdll qedit.c qedit.rc - qedit.spec diff --git a/reactos/dll/directx/quartz/quartz.rbuild b/reactos/dll/directx/quartz/quartz.rbuild index 831eef5b9c4..a482805d839 100644 --- a/reactos/dll/directx/quartz/quartz.rbuild +++ b/reactos/dll/directx/quartz/quartz.rbuild @@ -3,7 +3,7 @@ - + . 0x600 0x600 diff --git a/reactos/dll/directx/wine/d3d8/d3d8.rbuild b/reactos/dll/directx/wine/d3d8/d3d8.rbuild index 65c823288c0..fb8183949c2 100644 --- a/reactos/dll/directx/wine/d3d8/d3d8.rbuild +++ b/reactos/dll/directx/wine/d3d8/d3d8.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine 0x600 @@ -37,5 +37,4 @@ volume.c volumetexture.c version.rc - d3d8.spec diff --git a/reactos/dll/directx/wine/d3d9/d3d9.rbuild b/reactos/dll/directx/wine/d3d9/d3d9.rbuild index e6a43e34ea7..5c333aafcb1 100644 --- a/reactos/dll/directx/wine/d3d9/d3d9.rbuild +++ b/reactos/dll/directx/wine/d3d9/d3d9.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine 0x600 diff --git a/reactos/dll/keyboard/kbda1/kbda1.rbuild b/reactos/dll/keyboard/kbda1/kbda1.rbuild index f4535a84a1d..0786e9f0786 100644 --- a/reactos/dll/keyboard/kbda1/kbda1.rbuild +++ b/reactos/dll/keyboard/kbda1/kbda1.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbda1.c kbda1.rc - kbda1.spec diff --git a/reactos/dll/keyboard/kbda2/kbda2.rbuild b/reactos/dll/keyboard/kbda2/kbda2.rbuild index 13c311dae83..b173ed16c22 100644 --- a/reactos/dll/keyboard/kbda2/kbda2.rbuild +++ b/reactos/dll/keyboard/kbda2/kbda2.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbda2.c kbda2.rc - kbda2.spec diff --git a/reactos/dll/keyboard/kbda3/kbda3.rbuild b/reactos/dll/keyboard/kbda3/kbda3.rbuild index b3d213c52aa..6082e66c83e 100644 --- a/reactos/dll/keyboard/kbda3/kbda3.rbuild +++ b/reactos/dll/keyboard/kbda3/kbda3.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbda3.c kbda3.rc - kbda3.spec diff --git a/reactos/dll/keyboard/kbdal/kbdal.rbuild b/reactos/dll/keyboard/kbdal/kbdal.rbuild index e45eb3d8862..bac4abe3cfb 100644 --- a/reactos/dll/keyboard/kbdal/kbdal.rbuild +++ b/reactos/dll/keyboard/kbdal/kbdal.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdal.c kbdal.rc - kbdal.spec diff --git a/reactos/dll/keyboard/kbdarme/kbdarme.rbuild b/reactos/dll/keyboard/kbdarme/kbdarme.rbuild index 008efd44374..fd7bdd86f0a 100644 --- a/reactos/dll/keyboard/kbdarme/kbdarme.rbuild +++ b/reactos/dll/keyboard/kbdarme/kbdarme.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdarme.c kbdarme.rc - kbdarme.spec diff --git a/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild b/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild index 37383830f23..56df98d708f 100644 --- a/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild +++ b/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdarmw.c kbdarmw.rc - kbdarmw.spec diff --git a/reactos/dll/keyboard/kbdaze/kbdaze.rbuild b/reactos/dll/keyboard/kbdaze/kbdaze.rbuild index fdeeb8af0e0..52baa9e3012 100644 --- a/reactos/dll/keyboard/kbdaze/kbdaze.rbuild +++ b/reactos/dll/keyboard/kbdaze/kbdaze.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdaze.c kbdaze.rc - kbdaze.spec diff --git a/reactos/dll/keyboard/kbdazel/kbdazel.rbuild b/reactos/dll/keyboard/kbdazel/kbdazel.rbuild index 3011162513c..f97e3440706 100644 --- a/reactos/dll/keyboard/kbdazel/kbdazel.rbuild +++ b/reactos/dll/keyboard/kbdazel/kbdazel.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdazel.c kbdazel.rc - kbdazel.spec diff --git a/reactos/dll/keyboard/kbdbe/kbdbe.rbuild b/reactos/dll/keyboard/kbdbe/kbdbe.rbuild index d17d60ce6ca..efca0ec41da 100644 --- a/reactos/dll/keyboard/kbdbe/kbdbe.rbuild +++ b/reactos/dll/keyboard/kbdbe/kbdbe.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdbe.c kbdbe.rc - kbdbe.spec diff --git a/reactos/dll/keyboard/kbdbga/kbdbga.rbuild b/reactos/dll/keyboard/kbdbga/kbdbga.rbuild index 70aabd09dd2..5a1c4cb64a9 100644 --- a/reactos/dll/keyboard/kbdbga/kbdbga.rbuild +++ b/reactos/dll/keyboard/kbdbga/kbdbga.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdbga.c kbdbga.rc - kbdbga.spec diff --git a/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild b/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild index 1bad67104e9..c6ea382c38c 100644 --- a/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild +++ b/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdbgm.c kbdbgm.rc - kbdbgm.spec diff --git a/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild b/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild index 43d911488c9..e89c17c7f03 100644 --- a/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild +++ b/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdbgt.c kbdbgt.rc - kbdbgt.spec diff --git a/reactos/dll/keyboard/kbdblr/kbdblr.rbuild b/reactos/dll/keyboard/kbdblr/kbdblr.rbuild index 51303bb3408..a912d5aca07 100644 --- a/reactos/dll/keyboard/kbdblr/kbdblr.rbuild +++ b/reactos/dll/keyboard/kbdblr/kbdblr.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdblr.c kbdblr.rc - kbdblr.spec diff --git a/reactos/dll/keyboard/kbdbr/kbdbr.rbuild b/reactos/dll/keyboard/kbdbr/kbdbr.rbuild index e0a2d6d7bb2..87a8230a8ce 100644 --- a/reactos/dll/keyboard/kbdbr/kbdbr.rbuild +++ b/reactos/dll/keyboard/kbdbr/kbdbr.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdbr.c kbdbr.rc - kbdbr.spec diff --git a/reactos/dll/keyboard/kbdbur/kbdbur.rbuild b/reactos/dll/keyboard/kbdbur/kbdbur.rbuild index 81efd760fcb..c92f791f3fb 100644 --- a/reactos/dll/keyboard/kbdbur/kbdbur.rbuild +++ b/reactos/dll/keyboard/kbdbur/kbdbur.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdbur.c kbdbur.rc - kbdbur.spec diff --git a/reactos/dll/keyboard/kbdcan/kbdcan.rbuild b/reactos/dll/keyboard/kbdcan/kbdcan.rbuild index 9857e8f2f3b..0646e3142fd 100644 --- a/reactos/dll/keyboard/kbdcan/kbdcan.rbuild +++ b/reactos/dll/keyboard/kbdcan/kbdcan.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdcan.c kbdcan.rc - kbdcan.spec diff --git a/reactos/dll/keyboard/kbdcr/kbdcr.rbuild b/reactos/dll/keyboard/kbdcr/kbdcr.rbuild index f709a9eb03c..5c157079f9a 100644 --- a/reactos/dll/keyboard/kbdcr/kbdcr.rbuild +++ b/reactos/dll/keyboard/kbdcr/kbdcr.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdcr.c kbdcr.rc - kbdcr.spec diff --git a/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild b/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild index c9d22a60f84..378e7f5507c 100644 --- a/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild +++ b/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdcz1.c kbdcz1.rc - kbdcz1.spec diff --git a/reactos/dll/keyboard/kbdda/kbdda.rbuild b/reactos/dll/keyboard/kbdda/kbdda.rbuild index b3582afa281..6e87af1f15c 100644 --- a/reactos/dll/keyboard/kbdda/kbdda.rbuild +++ b/reactos/dll/keyboard/kbdda/kbdda.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdda.c kbdda.rc - kbdda.spec diff --git a/reactos/dll/keyboard/kbddv/kbddv.rbuild b/reactos/dll/keyboard/kbddv/kbddv.rbuild index 89a765ca6a0..5705ccc8853 100644 --- a/reactos/dll/keyboard/kbddv/kbddv.rbuild +++ b/reactos/dll/keyboard/kbddv/kbddv.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbddv.c kbddv.rc - kbddv.spec diff --git a/reactos/dll/keyboard/kbdes/kbdes.rbuild b/reactos/dll/keyboard/kbdes/kbdes.rbuild index 45cfdf8cd34..9f760d13c47 100644 --- a/reactos/dll/keyboard/kbdes/kbdes.rbuild +++ b/reactos/dll/keyboard/kbdes/kbdes.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdes.c kbdes.rc - kbdes.spec diff --git a/reactos/dll/keyboard/kbdest/kbdest.rbuild b/reactos/dll/keyboard/kbdest/kbdest.rbuild index 39c3b196b6b..ce719a5e7df 100644 --- a/reactos/dll/keyboard/kbdest/kbdest.rbuild +++ b/reactos/dll/keyboard/kbdest/kbdest.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdest.c kbdest.rc - kbdest.spec diff --git a/reactos/dll/keyboard/kbdfc/kbdfc.rbuild b/reactos/dll/keyboard/kbdfc/kbdfc.rbuild index 7d20ce4c4b1..1bf5206b146 100644 --- a/reactos/dll/keyboard/kbdfc/kbdfc.rbuild +++ b/reactos/dll/keyboard/kbdfc/kbdfc.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdfc.c kbdfc.rc - kbdfc.spec diff --git a/reactos/dll/keyboard/kbdfi/kbdfi.rbuild b/reactos/dll/keyboard/kbdfi/kbdfi.rbuild index 8def34916a1..847f5e72fd3 100644 --- a/reactos/dll/keyboard/kbdfi/kbdfi.rbuild +++ b/reactos/dll/keyboard/kbdfi/kbdfi.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdfi.c kbdfi.rc - kbdfi.spec diff --git a/reactos/dll/keyboard/kbdfr/kbdfr.rbuild b/reactos/dll/keyboard/kbdfr/kbdfr.rbuild index 3b9251409c1..dd364bf3084 100644 --- a/reactos/dll/keyboard/kbdfr/kbdfr.rbuild +++ b/reactos/dll/keyboard/kbdfr/kbdfr.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdfr.c kbdfr.rc - kbdfr.spec diff --git a/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild b/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild index cf930f80c1b..dc0e32d67a1 100644 --- a/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild +++ b/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdgeo.c kbdgeo.rc - kbdgeo.spec diff --git a/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild b/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild index 5f282da5e46..4ac2eab4389 100644 --- a/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild +++ b/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdgerg.c kbdgerg.rc - kbdgerg.spec diff --git a/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild b/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild index 44403a40538..724ae2f1da8 100644 --- a/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild +++ b/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdgneo.c kbdgneo.rc - kbdgneo.spec diff --git a/reactos/dll/keyboard/kbdgr/kbdgr.rbuild b/reactos/dll/keyboard/kbdgr/kbdgr.rbuild index d992f6ec3e7..99d000934e0 100644 --- a/reactos/dll/keyboard/kbdgr/kbdgr.rbuild +++ b/reactos/dll/keyboard/kbdgr/kbdgr.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdgr.c kbdgr.rc - kbdgr.spec diff --git a/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild b/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild index 5f228231848..f3391e13738 100644 --- a/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild +++ b/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdgrist.c kbdgrist.rc - kbdgrist.spec diff --git a/reactos/dll/keyboard/kbdhe/kbdhe.rbuild b/reactos/dll/keyboard/kbdhe/kbdhe.rbuild index 8dfa25cde1f..6bcb456c8af 100644 --- a/reactos/dll/keyboard/kbdhe/kbdhe.rbuild +++ b/reactos/dll/keyboard/kbdhe/kbdhe.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdhe.c kbdhe.rc - kbdhe.spec diff --git a/reactos/dll/keyboard/kbdheb/kbdheb.rbuild b/reactos/dll/keyboard/kbdheb/kbdheb.rbuild index f163665fc92..a4c522b72e8 100644 --- a/reactos/dll/keyboard/kbdheb/kbdheb.rbuild +++ b/reactos/dll/keyboard/kbdheb/kbdheb.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdheb.c kbdheb.rc - kbdheb.spec diff --git a/reactos/dll/keyboard/kbdhu/kbdhu.rbuild b/reactos/dll/keyboard/kbdhu/kbdhu.rbuild index 33d5a8ae5fa..037c29b5325 100644 --- a/reactos/dll/keyboard/kbdhu/kbdhu.rbuild +++ b/reactos/dll/keyboard/kbdhu/kbdhu.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdhu.c kbdhu.rc - kbdhu.spec diff --git a/reactos/dll/keyboard/kbdic/kbdic.rbuild b/reactos/dll/keyboard/kbdic/kbdic.rbuild index ca14176da38..765fe5473bf 100644 --- a/reactos/dll/keyboard/kbdic/kbdic.rbuild +++ b/reactos/dll/keyboard/kbdic/kbdic.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdic.c kbdic.rc - kbdic.spec diff --git a/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild b/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild index eb093ceb3e8..62d0874588f 100644 --- a/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild +++ b/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdinasa.c kbdinasa.rc - kbdinasa.spec diff --git a/reactos/dll/keyboard/kbdinben/kbdinben.rbuild b/reactos/dll/keyboard/kbdinben/kbdinben.rbuild index 418fbe7e0ae..3114edcbc65 100644 --- a/reactos/dll/keyboard/kbdinben/kbdinben.rbuild +++ b/reactos/dll/keyboard/kbdinben/kbdinben.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdinben.c kbdinben.rc - kbdinben.spec diff --git a/reactos/dll/keyboard/kbdindev/kbdindev.rbuild b/reactos/dll/keyboard/kbdindev/kbdindev.rbuild index 67c41f377f3..a413b9fea5e 100644 --- a/reactos/dll/keyboard/kbdindev/kbdindev.rbuild +++ b/reactos/dll/keyboard/kbdindev/kbdindev.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdindev.c kbdindev.rc - kbdindev.spec diff --git a/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild b/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild index aca7a777e64..ceb9e680381 100644 --- a/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild +++ b/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdinguj.c kbdinguj.rc - kbdinguj.spec diff --git a/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild b/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild index 4d4f50b79fb..f18261ae53d 100644 --- a/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild +++ b/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdinmal.c kbdinmal.rc - kbdinmal.spec diff --git a/reactos/dll/keyboard/kbdir/kbdir.rbuild b/reactos/dll/keyboard/kbdir/kbdir.rbuild index 4d35719d649..98bf4f0ed04 100644 --- a/reactos/dll/keyboard/kbdir/kbdir.rbuild +++ b/reactos/dll/keyboard/kbdir/kbdir.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdir.c kbdir.rc - kbdir.spec diff --git a/reactos/dll/keyboard/kbdit/kbdit.rbuild b/reactos/dll/keyboard/kbdit/kbdit.rbuild index eeca81895ee..eedfc129454 100644 --- a/reactos/dll/keyboard/kbdit/kbdit.rbuild +++ b/reactos/dll/keyboard/kbdit/kbdit.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdit.c kbdit.rc - kbdit.spec diff --git a/reactos/dll/keyboard/kbdja/kbdja.rbuild b/reactos/dll/keyboard/kbdja/kbdja.rbuild index 3453ab78d76..1ab11a9d104 100644 --- a/reactos/dll/keyboard/kbdja/kbdja.rbuild +++ b/reactos/dll/keyboard/kbdja/kbdja.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdja.c kbdja.rc - kbdja.spec diff --git a/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild b/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild index 646a0738040..9e1754efa2b 100644 --- a/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild +++ b/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdkaz.c kbdkaz.rc - kbdkaz.spec diff --git a/reactos/dll/keyboard/kbdko/kbdko.rbuild b/reactos/dll/keyboard/kbdko/kbdko.rbuild index f6ad227e060..952be1f2718 100644 --- a/reactos/dll/keyboard/kbdko/kbdko.rbuild +++ b/reactos/dll/keyboard/kbdko/kbdko.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdko.c kbdko.rc - kbdko.spec diff --git a/reactos/dll/keyboard/kbdla/kbdla.rbuild b/reactos/dll/keyboard/kbdla/kbdla.rbuild index f6eff54f57c..80a223ae50c 100644 --- a/reactos/dll/keyboard/kbdla/kbdla.rbuild +++ b/reactos/dll/keyboard/kbdla/kbdla.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdla.c kbdla.rc - kbdla.spec diff --git a/reactos/dll/keyboard/kbdlt/kbdlt.rbuild b/reactos/dll/keyboard/kbdlt/kbdlt.rbuild index 682e2fcb547..7bf85785bff 100644 --- a/reactos/dll/keyboard/kbdlt/kbdlt.rbuild +++ b/reactos/dll/keyboard/kbdlt/kbdlt.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdlt.c kbdlt.rc - kbdlt.spec diff --git a/reactos/dll/keyboard/kbdlv/kbdlv.rbuild b/reactos/dll/keyboard/kbdlv/kbdlv.rbuild index 9d099e8dc9f..779582a315c 100644 --- a/reactos/dll/keyboard/kbdlv/kbdlv.rbuild +++ b/reactos/dll/keyboard/kbdlv/kbdlv.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdlv.c kbdlv.rc - kbdlv.spec diff --git a/reactos/dll/keyboard/kbdmac/kbdmac.rbuild b/reactos/dll/keyboard/kbdmac/kbdmac.rbuild index ed855b1ed3c..dde788de457 100644 --- a/reactos/dll/keyboard/kbdmac/kbdmac.rbuild +++ b/reactos/dll/keyboard/kbdmac/kbdmac.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdmac.c kbdmac.rc - kbdmac.spec diff --git a/reactos/dll/keyboard/kbdne/kbdne.rbuild b/reactos/dll/keyboard/kbdne/kbdne.rbuild index 926c5b01d61..448491cddab 100644 --- a/reactos/dll/keyboard/kbdne/kbdne.rbuild +++ b/reactos/dll/keyboard/kbdne/kbdne.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdne.c kbdne.rc - kbdne.spec diff --git a/reactos/dll/keyboard/kbdno/kbdno.rbuild b/reactos/dll/keyboard/kbdno/kbdno.rbuild index 8c53f1afb43..65696b4402d 100644 --- a/reactos/dll/keyboard/kbdno/kbdno.rbuild +++ b/reactos/dll/keyboard/kbdno/kbdno.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdno.c kbdno.rc - kbdno.spec diff --git a/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild b/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild index c67bec16713..a39be73c83a 100644 --- a/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild +++ b/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdpl1.c kbdpl1.rc - kbdpl1.spec diff --git a/reactos/dll/keyboard/kbdpo/kbdpo.rbuild b/reactos/dll/keyboard/kbdpo/kbdpo.rbuild index 2610aff858f..f5dc73a3d4f 100644 --- a/reactos/dll/keyboard/kbdpo/kbdpo.rbuild +++ b/reactos/dll/keyboard/kbdpo/kbdpo.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdpo.c kbdpo.rc - kbdpo.spec diff --git a/reactos/dll/keyboard/kbdro/kbdro.rbuild b/reactos/dll/keyboard/kbdro/kbdro.rbuild index 15fee3807ef..84f2718c80d 100644 --- a/reactos/dll/keyboard/kbdro/kbdro.rbuild +++ b/reactos/dll/keyboard/kbdro/kbdro.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdro.c kbdro.rc - kbdro.spec diff --git a/reactos/dll/keyboard/kbdru/kbdru.rbuild b/reactos/dll/keyboard/kbdru/kbdru.rbuild index 7d84ce5d932..a446920cf37 100644 --- a/reactos/dll/keyboard/kbdru/kbdru.rbuild +++ b/reactos/dll/keyboard/kbdru/kbdru.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdru.c kbdru.rc - kbdru.spec diff --git a/reactos/dll/keyboard/kbdru1/kbdru1.rbuild b/reactos/dll/keyboard/kbdru1/kbdru1.rbuild index 104e57ba165..fe413e17238 100644 --- a/reactos/dll/keyboard/kbdru1/kbdru1.rbuild +++ b/reactos/dll/keyboard/kbdru1/kbdru1.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdru1.c kbdru1.rc - kbdru1.spec diff --git a/reactos/dll/keyboard/kbdsg/kbdsg.rbuild b/reactos/dll/keyboard/kbdsg/kbdsg.rbuild index dfb5dcabe71..0a883c31bf5 100644 --- a/reactos/dll/keyboard/kbdsg/kbdsg.rbuild +++ b/reactos/dll/keyboard/kbdsg/kbdsg.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdsg.c kbdsg.rc - kbdsg.spec diff --git a/reactos/dll/keyboard/kbdsk/kbdsk.rbuild b/reactos/dll/keyboard/kbdsk/kbdsk.rbuild index db0938767a2..e2ee24e52a1 100644 --- a/reactos/dll/keyboard/kbdsk/kbdsk.rbuild +++ b/reactos/dll/keyboard/kbdsk/kbdsk.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdsk.c kbdsk.rc - kbdsk.spec diff --git a/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild b/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild index e639566fd9c..7f15ccddcb4 100644 --- a/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild +++ b/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdsk1.c kbdsk1.rc - kbdsk1.spec diff --git a/reactos/dll/keyboard/kbdsw/kbdsw.rbuild b/reactos/dll/keyboard/kbdsw/kbdsw.rbuild index 70733e95c0a..32cf47df585 100644 --- a/reactos/dll/keyboard/kbdsw/kbdsw.rbuild +++ b/reactos/dll/keyboard/kbdsw/kbdsw.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdsw.c kbdsw.rc - kbdsw.spec diff --git a/reactos/dll/keyboard/kbdtat/kbdtat.rbuild b/reactos/dll/keyboard/kbdtat/kbdtat.rbuild index b158a4bed4d..ddffed3fad0 100644 --- a/reactos/dll/keyboard/kbdtat/kbdtat.rbuild +++ b/reactos/dll/keyboard/kbdtat/kbdtat.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdtat.c kbdtat.rc - kbdtat.spec diff --git a/reactos/dll/keyboard/kbdth0/kbdth0.rbuild b/reactos/dll/keyboard/kbdth0/kbdth0.rbuild index 57dac75db54..2083fbf53b1 100644 --- a/reactos/dll/keyboard/kbdth0/kbdth0.rbuild +++ b/reactos/dll/keyboard/kbdth0/kbdth0.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdth0.c kbdth0.rc - kbdth0.spec diff --git a/reactos/dll/keyboard/kbdth1/kbdth1.rbuild b/reactos/dll/keyboard/kbdth1/kbdth1.rbuild index 918ccaef910..ff027cf46cb 100644 --- a/reactos/dll/keyboard/kbdth1/kbdth1.rbuild +++ b/reactos/dll/keyboard/kbdth1/kbdth1.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdth1.c kbdth1.rc - kbdth1.spec diff --git a/reactos/dll/keyboard/kbdth2/kbdth2.rbuild b/reactos/dll/keyboard/kbdth2/kbdth2.rbuild index 23028cde79c..986a062abec 100644 --- a/reactos/dll/keyboard/kbdth2/kbdth2.rbuild +++ b/reactos/dll/keyboard/kbdth2/kbdth2.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdth2.c kbdth2.rc - kbdth2.spec diff --git a/reactos/dll/keyboard/kbdth3/kbdth3.rbuild b/reactos/dll/keyboard/kbdth3/kbdth3.rbuild index 8d4599d7fbf..9cd3614ce5f 100644 --- a/reactos/dll/keyboard/kbdth3/kbdth3.rbuild +++ b/reactos/dll/keyboard/kbdth3/kbdth3.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdth3.c kbdth3.rc - kbdth3.spec diff --git a/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild b/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild index 5b0064c6adf..ba720c1f13f 100644 --- a/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild +++ b/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdtuf.c kbdtuf.rc - kbdtuf.spec diff --git a/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild b/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild index 1cc516fcce8..501ef71db18 100644 --- a/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild +++ b/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdtuq.c kbdtuq.rc - kbdtuq.spec diff --git a/reactos/dll/keyboard/kbduk/kbduk.rbuild b/reactos/dll/keyboard/kbduk/kbduk.rbuild index 50cc9b84b18..a0eadb44a6f 100644 --- a/reactos/dll/keyboard/kbduk/kbduk.rbuild +++ b/reactos/dll/keyboard/kbduk/kbduk.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbduk.c kbduk.rc - kbduk.spec diff --git a/reactos/dll/keyboard/kbdur/kbdur.rbuild b/reactos/dll/keyboard/kbdur/kbdur.rbuild index c38ab572c03..bc4e4a39dee 100644 --- a/reactos/dll/keyboard/kbdur/kbdur.rbuild +++ b/reactos/dll/keyboard/kbdur/kbdur.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdur.c kbdur.rc - kbdur.spec diff --git a/reactos/dll/keyboard/kbdurs/kbdurs.rbuild b/reactos/dll/keyboard/kbdurs/kbdurs.rbuild index 91c94bdb1ef..069e3ee707e 100644 --- a/reactos/dll/keyboard/kbdurs/kbdurs.rbuild +++ b/reactos/dll/keyboard/kbdurs/kbdurs.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdurs.c kbdurs.rc - kbdurs.spec diff --git a/reactos/dll/keyboard/kbdus/kbdus.rbuild b/reactos/dll/keyboard/kbdus/kbdus.rbuild index 42c7ca0e090..adb0126939c 100644 --- a/reactos/dll/keyboard/kbdus/kbdus.rbuild +++ b/reactos/dll/keyboard/kbdus/kbdus.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdus.c kbdus.rc - kbdus.spec diff --git a/reactos/dll/keyboard/kbdusa/kbdusa.rbuild b/reactos/dll/keyboard/kbdusa/kbdusa.rbuild index c9dc1b90799..b3b451427c4 100644 --- a/reactos/dll/keyboard/kbdusa/kbdusa.rbuild +++ b/reactos/dll/keyboard/kbdusa/kbdusa.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdusa.c kbdusa.rc - kbdusa.spec diff --git a/reactos/dll/keyboard/kbdusl/kbdusl.rbuild b/reactos/dll/keyboard/kbdusl/kbdusl.rbuild index 80de56da78a..a93f20d8e1d 100644 --- a/reactos/dll/keyboard/kbdusl/kbdusl.rbuild +++ b/reactos/dll/keyboard/kbdusl/kbdusl.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdusl.c kbdusl.rc - kbdusl.spec diff --git a/reactos/dll/keyboard/kbdusr/kbdusr.rbuild b/reactos/dll/keyboard/kbdusr/kbdusr.rbuild index 3fa2412a282..68a04241eaa 100644 --- a/reactos/dll/keyboard/kbdusr/kbdusr.rbuild +++ b/reactos/dll/keyboard/kbdusr/kbdusr.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdusr.c kbdusr.rc - kbdusr.spec diff --git a/reactos/dll/keyboard/kbdusx/kbdusx.rbuild b/reactos/dll/keyboard/kbdusx/kbdusx.rbuild index c2eb6e9bece..e6e5df680d9 100644 --- a/reactos/dll/keyboard/kbdusx/kbdusx.rbuild +++ b/reactos/dll/keyboard/kbdusx/kbdusx.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdusx.c kbdusx.rc - kbdusx.spec diff --git a/reactos/dll/keyboard/kbduzb/kbduzb.rbuild b/reactos/dll/keyboard/kbduzb/kbduzb.rbuild index cf995a05315..da804ac5ec9 100644 --- a/reactos/dll/keyboard/kbduzb/kbduzb.rbuild +++ b/reactos/dll/keyboard/kbduzb/kbduzb.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbduzb.c kbduzb.rc - kbduzb.spec diff --git a/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild b/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild index 472e3f9ce11..b3b07712b88 100644 --- a/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild +++ b/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdvntc.c kbdvntc.rc - kbdvntc.spec diff --git a/reactos/dll/keyboard/kbdycc/kbdycc.rbuild b/reactos/dll/keyboard/kbdycc/kbdycc.rbuild index bc81aa50ea5..18eba58c332 100644 --- a/reactos/dll/keyboard/kbdycc/kbdycc.rbuild +++ b/reactos/dll/keyboard/kbdycc/kbdycc.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdycc.c kbdycc.rc - kbdycc.spec diff --git a/reactos/dll/keyboard/kbdycl/kbdycl.rbuild b/reactos/dll/keyboard/kbdycl/kbdycl.rbuild index 4da9d79adb4..eff20bb5603 100644 --- a/reactos/dll/keyboard/kbdycl/kbdycl.rbuild +++ b/reactos/dll/keyboard/kbdycl/kbdycl.rbuild @@ -1,11 +1,10 @@ - + include 0x0500 kbdycl.c kbdycl.rc - kbdycl.spec diff --git a/reactos/dll/shellext/deskadp/deskadp.rbuild b/reactos/dll/shellext/deskadp/deskadp.rbuild index 8b454cdd576..3f26d05c64b 100644 --- a/reactos/dll/shellext/deskadp/deskadp.rbuild +++ b/reactos/dll/shellext/deskadp/deskadp.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x0600 @@ -14,6 +14,5 @@ deskadp.c shxiface.c deskadp.rc - deskadp.spec precomp.h diff --git a/reactos/dll/shellext/deskmon/deskmon.rbuild b/reactos/dll/shellext/deskmon/deskmon.rbuild index b78bcba1a99..02b01f0e87a 100644 --- a/reactos/dll/shellext/deskmon/deskmon.rbuild +++ b/reactos/dll/shellext/deskmon/deskmon.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x0600 diff --git a/reactos/dll/shellext/fontext/fontext.rbuild b/reactos/dll/shellext/fontext/fontext.rbuild index c299cd8675a..d8311253d67 100644 --- a/reactos/dll/shellext/fontext/fontext.rbuild +++ b/reactos/dll/shellext/fontext/fontext.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x0600 diff --git a/reactos/dll/win32/acledit/acledit.rbuild b/reactos/dll/win32/acledit/acledit.rbuild index cad5f42e0aa..047b0aceea9 100644 --- a/reactos/dll/win32/acledit/acledit.rbuild +++ b/reactos/dll/win32/acledit/acledit.rbuild @@ -1,5 +1,5 @@ - + . diff --git a/reactos/dll/win32/aclui/aclui.rbuild b/reactos/dll/win32/aclui/aclui.rbuild index 5dd969b4fe3..ecbffd50a63 100644 --- a/reactos/dll/win32/aclui/aclui.rbuild +++ b/reactos/dll/win32/aclui/aclui.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x0600 diff --git a/reactos/dll/win32/advapi32/advapi32.rbuild b/reactos/dll/win32/advapi32/advapi32.rbuild index f602ac5d4ce..150f7fcd94e 100644 --- a/reactos/dll/win32/advapi32/advapi32.rbuild +++ b/reactos/dll/win32/advapi32/advapi32.rbuild @@ -1,6 +1,6 @@ - + . . . diff --git a/reactos/dll/win32/advapi32/advapi32.spec b/reactos/dll/win32/advapi32/advapi32.spec index b601d258df2..51dcae155a2 100644 --- a/reactos/dll/win32/advapi32/advapi32.spec +++ b/reactos/dll/win32/advapi32/advapi32.spec @@ -102,12 +102,12 @@ @ stdcall CreateServiceW (long ptr ptr long long long long ptr ptr ptr ptr ptr ptr) @ stub CreateTraceInstanceId @ stdcall CreateWellKnownSid(long ptr ptr ptr) - @ stub CredDeleteA #(str long long) - @ stub CredDeleteW #(wstr long long) - @ stub CredEnumerateA #(str long ptr ptr) - @ stub CredEnumerateW #(wstr long ptr ptr) - @ stub CredFree #(ptr) - @ stub CredGetSessionTypes #(long ptr) + @ stdcall CredDeleteA (str long long) + @ stdcall CredDeleteW (wstr long long) + @ stdcall CredEnumerateA (str long ptr ptr) + @ stdcall CredEnumerateW (wstr long ptr ptr) + @ stdcall CredFree (ptr) + @ stdcall CredGetSessionTypes (long ptr) @ stub CredGetTargetInfoA @ stub CredGetTargetInfoW @ stub CredIsMarshaledCredentialA @@ -115,18 +115,18 @@ @ stub CredMarshalCredentialA @ stub CredMarshalCredentialW @ stub CredProfileLoaded - @ stub CredReadA #(str long long ptr) + @ stdcall CredReadA (str long long ptr) @ stub CredReadDomainCredentialsA @ stub CredReadDomainCredentialsW - @ stub CredReadW #(wstr long long ptr) + @ stdcall CredReadW (wstr long long ptr) @ stub CredRenameA @ stub CredRenameW @ stub CredUnmarshalCredentialA @ stub CredUnmarshalCredentialW - @ stub CredWriteA #(ptr long) + @ stdcall CredWriteA(ptr long) @ stub CredWriteDomainCredentialsA @ stub CredWriteDomainCredentialsW - @ stub CredWriteW #(ptr long) + @ stdcall CredWriteW (ptr long) @ stub CredpConvertCredential @ stub CredpConvertTargetInfo @ stub CredpDecodeCredential diff --git a/reactos/dll/win32/advpack/advpack.rbuild b/reactos/dll/win32/advpack/advpack.rbuild index de904cbb218..b0a4a121719 100644 --- a/reactos/dll/win32/advpack/advpack.rbuild +++ b/reactos/dll/win32/advpack/advpack.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/atl/atl.rbuild b/reactos/dll/win32/atl/atl.rbuild index eed64fffb52..cdbfa23cd10 100644 --- a/reactos/dll/win32/atl/atl.rbuild +++ b/reactos/dll/win32/atl/atl.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/avifil32/avifil32.rbuild b/reactos/dll/win32/avifil32/avifil32.rbuild index 854672b482c..e5a053d824d 100644 --- a/reactos/dll/win32/avifil32/avifil32.rbuild +++ b/reactos/dll/win32/avifil32/avifil32.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/browseui/browseui.rbuild b/reactos/dll/win32/browseui/browseui.rbuild index 671f9ccfa33..2c19c0dd57a 100644 --- a/reactos/dll/win32/browseui/browseui.rbuild +++ b/reactos/dll/win32/browseui/browseui.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine . diff --git a/reactos/dll/win32/cabinet/cabinet.rbuild b/reactos/dll/win32/cabinet/cabinet.rbuild index f8e369dcfdf..20a6ca889a1 100644 --- a/reactos/dll/win32/cabinet/cabinet.rbuild +++ b/reactos/dll/win32/cabinet/cabinet.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/cards/cards.rbuild b/reactos/dll/win32/cards/cards.rbuild index ace4c0c4a7c..065b1e17fa1 100644 --- a/reactos/dll/win32/cards/cards.rbuild +++ b/reactos/dll/win32/cards/cards.rbuild @@ -1,5 +1,5 @@ - + . diff --git a/reactos/dll/win32/clusapi/clusapi.rbuild b/reactos/dll/win32/clusapi/clusapi.rbuild index 410acc5dc57..1ea58a0c870 100644 --- a/reactos/dll/win32/clusapi/clusapi.rbuild +++ b/reactos/dll/win32/clusapi/clusapi.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/comcat/comcat.rbuild b/reactos/dll/win32/comcat/comcat.rbuild index d9c2fb76d6a..551b99d1010 100644 --- a/reactos/dll/win32/comcat/comcat.rbuild +++ b/reactos/dll/win32/comcat/comcat.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/comctl32/comctl32.rbuild b/reactos/dll/win32/comctl32/comctl32.rbuild index 9139d732f74..6079903eb26 100644 --- a/reactos/dll/win32/comctl32/comctl32.rbuild +++ b/reactos/dll/win32/comctl32/comctl32.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/comdlg32/comdlg32.rbuild b/reactos/dll/win32/comdlg32/comdlg32.rbuild index bce7564e654..57e7c2244d3 100644 --- a/reactos/dll/win32/comdlg32/comdlg32.rbuild +++ b/reactos/dll/win32/comdlg32/comdlg32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/compstui/compstui.rbuild b/reactos/dll/win32/compstui/compstui.rbuild index 8d7403a9796..cd7ce261511 100644 --- a/reactos/dll/win32/compstui/compstui.rbuild +++ b/reactos/dll/win32/compstui/compstui.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/credui/credui.rbuild b/reactos/dll/win32/credui/credui.rbuild index e07e0f8a580..0ef5423d39c 100644 --- a/reactos/dll/win32/credui/credui.rbuild +++ b/reactos/dll/win32/credui/credui.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/crtdll/crtdll.rbuild b/reactos/dll/win32/crtdll/crtdll.rbuild index f7166eb3ea6..883bf0c9c03 100644 --- a/reactos/dll/win32/crtdll/crtdll.rbuild +++ b/reactos/dll/win32/crtdll/crtdll.rbuild @@ -1,5 +1,5 @@ - + . include diff --git a/reactos/dll/win32/crypt32/crypt32.rbuild b/reactos/dll/win32/crypt32/crypt32.rbuild index 69026ee8d94..f70d712affc 100644 --- a/reactos/dll/win32/crypt32/crypt32.rbuild +++ b/reactos/dll/win32/crypt32/crypt32.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/cryptdll/cryptdll.rbuild b/reactos/dll/win32/cryptdll/cryptdll.rbuild index d8a3f478dbd..23da95bff75 100644 --- a/reactos/dll/win32/cryptdll/cryptdll.rbuild +++ b/reactos/dll/win32/cryptdll/cryptdll.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/cryptnet/cryptnet.rbuild b/reactos/dll/win32/cryptnet/cryptnet.rbuild index d8a50dda11b..c263f11f28d 100644 --- a/reactos/dll/win32/cryptnet/cryptnet.rbuild +++ b/reactos/dll/win32/cryptnet/cryptnet.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/cryptui/cryptui.rbuild b/reactos/dll/win32/cryptui/cryptui.rbuild index 63a6d1a2fd2..bab940f40ff 100644 --- a/reactos/dll/win32/cryptui/cryptui.rbuild +++ b/reactos/dll/win32/cryptui/cryptui.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/dbghelp/dbghelp.rbuild b/reactos/dll/win32/dbghelp/dbghelp.rbuild index 236536ac3e5..ff2a5c2fe75 100644 --- a/reactos/dll/win32/dbghelp/dbghelp.rbuild +++ b/reactos/dll/win32/dbghelp/dbghelp.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/dciman32/dciman32.rbuild b/reactos/dll/win32/dciman32/dciman32.rbuild index 35367a62417..9b03c62d68a 100644 --- a/reactos/dll/win32/dciman32/dciman32.rbuild +++ b/reactos/dll/win32/dciman32/dciman32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/devmgr/devmgr.rbuild b/reactos/dll/win32/devmgr/devmgr.rbuild index 226979ae493..926ce289878 100644 --- a/reactos/dll/win32/devmgr/devmgr.rbuild +++ b/reactos/dll/win32/devmgr/devmgr.rbuild @@ -1,6 +1,6 @@ . - + 0x600 0x501 0x501 diff --git a/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild b/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild index 9ccf4e5979c..01f7644d0d7 100644 --- a/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild +++ b/reactos/dll/win32/dhcpcsvc/dhcpcsvc.rbuild @@ -1,5 +1,5 @@ - + include diff --git a/reactos/dll/win32/fusion/fusion.rbuild b/reactos/dll/win32/fusion/fusion.rbuild index 90cabde35b4..0d3badf7635 100644 --- a/reactos/dll/win32/fusion/fusion.rbuild +++ b/reactos/dll/win32/fusion/fusion.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/gdi32/gdi32.def b/reactos/dll/win32/gdi32/gdi32.def deleted file mode 100644 index 2f18b8c7015..00000000000 --- a/reactos/dll/win32/gdi32/gdi32.def +++ /dev/null @@ -1,624 +0,0 @@ -; $Id$ -; -; gdi32.def -; -; ReactOS Operating System -; From Anders Norlander's w32api-0.1.5 gdi32.def. -; -LIBRARY gdi32.dll -EXPORTS -AbortDoc@4 -AbortPath@4 -AddFontMemResourceEx@16 -AddFontResourceA@4 -AddFontResourceExA@12 -AddFontResourceExW@12 -AddFontResourceTracking@8 -AddFontResourceW@4 -AngleArc@24 -AnimatePalette@16 -AnyLinkedFonts@0=NtGdiAnyLinkedFonts@0 -Arc@36 -ArcTo@36 -BRUSHOBJ_hGetColorTransform@4=NtGdiBRUSHOBJ_hGetColorTransform@4 -BRUSHOBJ_pvAllocRbrush@8=NtGdiBRUSHOBJ_pvAllocRbrush@8 -BRUSHOBJ_pvGetRbrush@4=NtGdiBRUSHOBJ_pvGetRbrush@4 -BRUSHOBJ_ulGetBrushColor@4=NtGdiBRUSHOBJ_ulGetBrushColor@4 -BeginPath@4 -BitBlt@36 -CLIPOBJ_bEnum@12=NtGdiCLIPOBJ_bEnum@12 -CLIPOBJ_cEnumStart@20=NtGdiCLIPOBJ_cEnumStart@20 -CLIPOBJ_ppoGetPath@4=NtGdiCLIPOBJ_ppoGetPath@4 -CancelDC@4 -CheckColorsInGamut@16 -ChoosePixelFormat@8 -Chord@36 -ClearBitmapAttributes@8 -ClearBrushAttributes@8 -CloseEnhMetaFile@4 -CloseFigure@4 -CloseMetaFile@4 -ColorCorrectPalette@16 -ColorMatchToTarget@12 -CombineRgn@16 -CombineTransform@12=NtGdiCombineTransform@12 -CopyEnhMetaFileA@8 -CopyEnhMetaFileW@8 -CopyMetaFileA@8 -CopyMetaFileW@8 -CreateBitmap@20 -CreateBitmapIndirect@4 -CreateBrushIndirect@4 -CreateColorSpaceA@4 -CreateColorSpaceW@4 -CreateCompatibleBitmap@12 -CreateCompatibleDC@4 -CreateDCA@16 -CreateDCW@16 -CreateDIBPatternBrush@8 -CreateDIBPatternBrushPt@8 -CreateDIBSection@24 -CreateDIBitmap@24 -CreateDiscardableBitmap@12 -CreateEllipticRgn@16=NtGdiCreateEllipticRgn@16 -CreateEllipticRgnIndirect@4 -CreateEnhMetaFileA@16 -CreateEnhMetaFileW@16 -CreateFontA@56 -CreateFontIndirectA@4 -CreateFontIndirectExA@4 -CreateFontIndirectExW@4 -CreateFontIndirectW@4 -CreateFontW@56 -CreateHalftonePalette@4=NtGdiCreateHalftonePalette@4 -CreateHatchBrush@8 -CreateICA@16 -CreateICW@16 -CreateMetaFileA@4 -CreateMetaFileW@4 -CreatePalette@4 -CreatePatternBrush@4 -CreatePen@12 -CreatePenIndirect@4 -CreatePolyPolygonRgn@16 -CreatePolygonRgn@12 -CreateRectRgn@16 -CreateRectRgnIndirect@4 -CreateRoundRectRgn@24=NtGdiCreateRoundRectRgn@24 -CreateScalableFontResourceA@16 -CreateScalableFontResourceW@16 -CreateSolidBrush@4 -DPtoLP@12 -DdEntry0@24=NtGdiDxgGenericThunk@24 -DdEntry10@8=NtGdiDdBeginMoCompFrame@8 -DdEntry11@12=NtGdiDdBlt@12 -DdEntry12@8=NtGdiDdCanCreateSurface@8 -DdEntry13@8=NtGdiDdCanCreateD3DBuffer@8 -DdEntry14@8=NtGdiDdColorControl@8 -DdEntry15@4=NtGdiDdCreateDirectDrawObject@4 -DdEntry16@32=NtGdiDdCreateSurface@32 -DdEntry17@32=NtGdiDdCreateD3DBuffer@32 -DdEntry18@8=NtGdiDdCreateMoComp@8 -DdEntry19@24=NtGdiDdCreateSurfaceObject@24 -DdEntry1@16=NtGdiD3dContextCreate@16 -DdEntry20@4=NtGdiDdDeleteDirectDrawObject@4 -DdEntry21@4=NtGdiDdDeleteSurfaceObject@4 -DdEntry22@8=NtGdiDdDestroyMoComp@8 -DdEntry23@8=NtGdiDdDestroySurface@8 -DdEntry24@4=NtGdiDdDestroyD3DBuffer@4 -DdEntry25@8=NtGdiDdEndMoCompFrame@8 -DdEntry26@20=NtGdiDdFlip@20 -DdEntry27@8=NtGdiDdFlipToGDISurface@8 -DdEntry28@8=NtGdiDdGetAvailDriverMemory@8 -DdEntry29@8=NtGdiDdGetBltStatus@8 -DdEntry2@4=NtGdiD3dContextDestroy@4 -DdEntry30@8=NtGdiDdGetDC@8 -DdEntry31@8=NtGdiDdGetDriverInfo@8 -DdEntry32@12=NtGdiDdGetDxHandle@12 -DdEntry33@8=NtGdiDdGetFlipStatus@8 -DdEntry34@8=NtGdiDdGetInternalMoCompInfo@8 -DdEntry35@8=NtGdiDdGetMoCompBuffInfo@8 -DdEntry36@8=NtGdiDdGetMoCompGuids@8 -DdEntry37@8=NtGdiDdGetMoCompFormats@8 -DdEntry38@8=NtGdiDdGetScanLine@8 -DdEntry39@12=NtGdiDdLock@12 -DdEntry3@4=NtGdiD3dContextDestroyAll@4 -DdEntry40@8=NtGdiDdLockD3D@8 -DdEntry41@44=NtGdiDdQueryDirectDrawObject@44 -DdEntry42@8=NtGdiDdQueryMoCompStatus@8 -DdEntry43@8=NtGdiDdReenableDirectDrawObject@8 -DdEntry44@4=NtGdiDdReleaseDC@4 -DdEntry45@8=NtGdiDdRenderMoComp@8 -DdEntry46@8=NtGdiDdResetVisrgn@8 -DdEntry47@8=NtGdiDdSetColorKey@8 -DdEntry48@8=NtGdiDdSetExclusiveMode@8 -DdEntry49@12=NtGdiDdSetGammaRamp@12 -DdEntry4@4=NtGdiD3dValidateTextureStageState@4 -DdEntry50@12=NtGdiDdCreateSurfaceEx@12 -DdEntry51@12=NtGdiDdSetOverlayPosition@12 -DdEntry52@8=NtGdiDdUnattachSurface@8 -DdEntry53@8=NtGdiDdUnlock@8 -DdEntry54@8=NtGdiDdUnlockD3D@8 -DdEntry55@12=NtGdiDdUpdateOverlay@12 -DdEntry56@8=NtGdiDdWaitForVerticalBlank@8 -DdEntry5@28=NtGdiD3dDrawPrimitives2@28 -DdEntry6@4=NtGdiDdGetDriverState@4 -DdEntry7@12=NtGdiDdAddAttachedSurface@12 -DdEntry8@12=NtGdiDdAlphaBlt@12 -DdEntry9@8=NtGdiDdAttachSurface@8 -DeleteColorSpace@4=NtGdiDeleteColorSpace@4 -DeleteDC@4 -DeleteEnhMetaFile@4 -DeleteMetaFile@4 -DeleteObject@4 -DescribePixelFormat@16 -DeviceCapabilitiesExA@20 -DeviceCapabilitiesExW@20 -DrawEscape@16 -Ellipse@20 -EnableEUDC@4=NtGdiEnableEudc@4 -EndDoc@4 -EndFormPage@4 -EndPage@4 -EndPath@4 -EngAcquireSemaphore@4 -EngAlphaBlend@28=NtGdiEngAlphaBlend@28 -EngAssociateSurface@12=NtGdiEngAssociateSurface@12 -EngBitBlt@44=NtGdiEngBitBlt@44 -EngCheckAbort@4=NtGdiEngCheckAbort@4 -EngComputeGlyphSet@12 -EngCopyBits@24=NtGdiEngCopyBits@24 -EngCreateBitmap@24=NtGdiEngCreateBitmap@24 -EngCreateClip@0=NtGdiEngCreateClip@0 -EngCreateDeviceBitmap@16=NtGdiEngCreateDeviceBitmap@16 -EngCreateDeviceSurface@16=NtGdiEngCreateDeviceSurface@16 -EngCreatePalette@24=NtGdiEngCreatePalette@24 -EngCreateSemaphore@0 -EngDeleteClip@4=NtGdiEngDeleteClip@4 -EngDeletePalette@4=NtGdiEngDeletePalette@4 -EngDeletePath@4=NtGdiEngDeletePath@4 -EngDeleteSemaphore@4 -EngDeleteSurface@4=NtGdiEngDeleteSurface@4 -EngEraseSurface@12=NtGdiEngEraseSurface@12 -EngFillPath@28=NtGdiEngFillPath@28 -EngFindResource@16 -EngFreeModule@4 -EngGetCurrentCodePage@8 -EngGetDriverName@4 -EngGetPrinterDataFileName@4 -EngGradientFill@40=NtGdiEngGradientFill@40 -EngLineTo@36=NtGdiEngLineTo@36 -EngLoadModule@4 -EngLockSurface@4=NtGdiEngLockSurface@4 -EngMarkBandingSurface@4=NtGdiEngMarkBandingSurface@4 -EngMultiByteToUnicodeN@20=RtlMultiByteToUnicodeN@20 -EngMultiByteToWideChar@20 -EngPaint@20=NtGdiEngPaint@20 -EngPlgBlt@44=NtGdiEngPlgBlt@44 -EngQueryEMFInfo@8 -EngQueryLocalTime@4 -EngReleaseSemaphore@4 -EngStretchBlt@44=NtGdiEngStretchBlt@44 -EngStretchBltROP@52=NtGdiEngStretchBltROP@52 -EngStrokeAndFillPath@40=NtGdiEngStrokeAndFillPath@40 -EngStrokePath@32=NtGdiEngStrokePath@32 -EngTextOut@40=NtGdiEngTextOut@40 -EngTransparentBlt@32=NtGdiEngTransparentBlt@32 -EngUnicodeToMultiByteN@20=RtlUnicodeToMultiByteN@20 -EngUnlockSurface@4=NtGdiEngUnlockSurface@4 -EngWideCharToMultiByte@20 -EnumEnhMetaFile@20 -EnumFontFamiliesA@16 -EnumFontFamiliesExA@20 -EnumFontFamiliesExW@20 -EnumFontFamiliesW@16 -EnumFontsA@16 -EnumFontsW@16 -EnumICMProfilesA@12 -EnumICMProfilesW@12 -EnumMetaFile@16 -EnumObjects@16 -EqualRgn@8=NtGdiEqualRgn@8 -Escape@20 -EudcLoadLinkW@16 -EudcUnloadLinkW@8 -ExcludeClipRect@20 -ExtCreatePen@20 -ExtCreateRegion@12 -ExtEscape@24 -ExtFloodFill@20 -ExtSelectClipRgn@12 -ExtTextOutA@32 -ExtTextOutW@32 -FONTOBJ_cGetAllGlyphHandles@8=NtGdiFONTOBJ_cGetAllGlyphHandles@8 -FONTOBJ_cGetGlyphs@20=NtGdiFONTOBJ_cGetGlyphs@20 -FONTOBJ_pQueryGlyphAttrs@8=NtGdiFONTOBJ_pQueryGlyphAttrs@8 -FONTOBJ_pfdg@4=NtGdiFONTOBJ_pfdg@4 -FONTOBJ_pifi@4=NtGdiFONTOBJ_pifi@4 -FONTOBJ_pvTrueTypeFontFile@8=NtGdiFONTOBJ_pvTrueTypeFontFile@8 -FONTOBJ_pxoGetXform@4=NtGdiFONTOBJ_pxoGetXform@4 -FONTOBJ_vGetInfo@12=NtGdiFONTOBJ_vGetInfo@12 -FillPath@4 -FillRgn@12 -FixBrushOrgEx@16 -FlattenPath@4 -FloodFill@16 -FontIsLinked@4=NtGdiFontIsLinked@4 -FrameRgn@20 -GdiAddFontResourceW@12 -GdiAddGlsBounds@8 -GdiAddGlsRecord@16 -GdiAlphaBlend@44 -GdiArtificialDecrementDriver@8 -GdiCleanCacheDC@4 -GdiComment@12 -GdiConsoleTextOut@16=NtGdiConsoleTextOut@16 -GdiConvertAndCheckDC@4 -GdiConvertBitmap@4 -GdiConvertBitmapV5@16 -GdiConvertBrush@4 -GdiConvertDC@4 -GdiConvertEnhMetaFile@4 -GdiConvertFont@4 -GdiConvertMetaFilePict@4 -GdiConvertPalette@4 -GdiConvertRegion@4 -GdiConvertToDevmodeW@4 -GdiCreateLocalEnhMetaFile@4 -GdiCreateLocalMetaFilePict@4 -GdiDeleteLocalDC@4 -GdiDeleteSpoolFileHandle@4 -GdiDescribePixelFormat@16=NtGdiDescribePixelFormat@16 -GdiDllInitialize@12 -GdiDrawStream@12 -GdiEndDocEMF@4 -GdiEndPageEMF@8 -GdiEntry10@8 -GdiEntry11@8 -GdiEntry12@8 -GdiEntry13@0 -GdiEntry14@12 -GdiEntry15@12 -GdiEntry16@12 -GdiEntry1@8 -GdiEntry2@44 -GdiEntry3@4 -GdiEntry4@8 -GdiEntry5@4 -GdiEntry6@8 -GdiEntry7@8 -GdiEntry8@4 -GdiEntry9@24 -GdiFixUpHandle@4 -GdiFlush@0 -GdiFullscreenControl@20=NtGdiFullscreenControl@20 -GdiGetBatchLimit@0 -GdiGetCharDimensions@12 -GdiGetCodePage@4 -GdiGetDC@4 -GdiGetDevmodeForPage@16 -GdiGetLocalBrush@4 -GdiGetLocalDC@4 -GdiGetLocalFont@4 -GdiGetPageCount@4 -GdiGetPageHandle@12 -GdiGetSpoolFileHandle@12 -GdiGetSpoolMessage@16=NtGdiGetSpoolMessage@16 -GdiGradientFill@24 -GdiInitSpool@0=NtGdiInitSpool@0 -GdiInitializeLanguagePack@4 -GdiIsMetaFileDC@4 -GdiIsMetaPrintDC@4 -GdiIsPlayMetafileDC@4 -GdiPlayDCScript@24 -GdiPlayEMF@20 -GdiPlayJournal@20 -GdiPlayPageEMF@20 -GdiPlayPrivatePageEMF@12 -GdiPlayScript@28 -GdiPrinterThunk@12 -GdiProcessSetup@0 -GdiQueryFonts@12=NtGdiQueryFonts@12 -GdiQueryTable@0 -GdiRealizationInfo@8 -GdiReleaseDC@4 -GdiReleaseLocalDC@4 -GdiResetDCEMF@8 -GdiSetAttrs@4 -GdiSetBatchLimit@4 -GdiSetLastError@4 -GdiSetPixelFormat@8=NtGdiSetPixelFormat@8 -GdiSetServerAttr@8 -GdiStartDocEMF@8 -GdiStartPageEMF@4 -GdiSwapBuffers@4=NtGdiSwapBuffers@4 -GdiTransparentBlt@44 -GdiValidateHandle@4 -GetArcDirection@4 -GetAspectRatioFilterEx@8 -GetBitmapAttributes@4 -GetBitmapBits@12=NtGdiGetBitmapBits@12 -GetBitmapDimensionEx@8=NtGdiGetBitmapDimension@8 -GetBkColor@4 -GetBkMode@4 -GetBoundsRect@12 -GetBrushOrgEx@8 -GetCharABCWidthsA@16 -GetCharABCWidthsFloatA@16 -GetCharABCWidthsFloatW@16 -GetCharABCWidthsI@20 -GetCharABCWidthsW@16 -GetCharWidth32A@16 -GetCharWidth32W@16 -GetCharWidthA@16 -GetCharWidthFloatA@16 -GetCharWidthFloatW@16 -GetCharWidthI@20 -GetCharWidthInfo@8=NtGdiGetCharWidthInfo@8 -GetCharWidthW@16 -GetCharacterPlacementA@24 -GetCharacterPlacementW@24 -GetClipBox@8 -GetClipRgn@8 -GetColorAdjustment@8=NtGdiGetColorAdjustment@8 -GetColorSpace@4 -GetCurrentObject@8 -GetCurrentPositionEx@8 -GetDCBrushColor@4 -GetDCOrgEx@8 -GetDCPenColor@4 -GetDIBColorTable@16 -GetDIBits@28 -GetDeviceCaps@8 -GetDeviceGammaRamp@8 -GetETM@8 -GetEUDCTimeStamp@0 -GetEUDCTimeStampExW@4 -GetEnhMetaFileA@4 -GetEnhMetaFileBits@12 -GetEnhMetaFileDescriptionA@12 -GetEnhMetaFileDescriptionW@12 -GetEnhMetaFileHeader@12 -GetEnhMetaFilePaletteEntries@12 -GetEnhMetaFilePixelFormat@12 -GetEnhMetaFileW@4 -GetFontAssocStatus@4 -GetFontData@20 -GetFontLanguageInfo@4 -GetFontResourceInfoW@16 -GetFontUnicodeRanges@8=NtGdiGetFontUnicodeRanges@8 -GetGlyphIndicesA@20 -GetGlyphIndicesW@20=NtGdiGetGlyphIndicesW@20 -GetGlyphOutline@28=GetGlyphOutlineA@28 -GetGlyphOutlineA@28 -GetGlyphOutlineW@28 -GetGlyphOutlineWow@28 -GetGraphicsMode@4 -GetHFONT@4 -GetICMProfileA@12 -GetICMProfileW@12 -GetKerningPairs@12=GetKerningPairsA@12 -GetKerningPairsA@12 -GetKerningPairsW@12 -GetLayout@4 -GetLogColorSpaceA@12 -GetLogColorSpaceW@12 -GetMapMode@4 -GetMetaFileA@4 -GetMetaFileBitsEx@12 -GetMetaFileW@4 -GetMetaRgn@8 -GetMiterLimit@8=NtGdiGetMiterLimit@8 -GetNearestColor@8=NtGdiGetNearestColor@8 -GetNearestPaletteIndex@8=NtGdiGetNearestPaletteIndex@8 -GetObjectA@12 -GetObjectType@4 -GetObjectW@12 -GetOutlineTextMetricsA@12 -GetOutlineTextMetricsW@12 -GetPaletteEntries@16 -GetPath@16 -GetPixel@12 -GetPixelFormat@4 -GetPolyFillMode@4 -GetROP2@4 -GetRandomRgn@12=NtGdiGetRandomRgn@12 -GetRasterizerCaps@8=NtGdiGetRasterizerCaps@8 -GetRegionData@12 -GetRelAbs@8 -GetRgnBox@8 -GetStockObject@4 -GetStretchBltMode@4 -GetStringBitmapA@20 -GetStringBitmapW@20 -GetSystemPaletteEntries@16 -GetSystemPaletteUse@4=NtGdiGetSystemPaletteUse@4 -GetTextAlign@4 -GetTextCharacterExtra@4 -GetTextCharset@4 -GetTextCharsetInfo@12=NtGdiGetTextCharsetInfo@12 -GetTextColor@4 -GetTextExtentExPointA@28 -GetTextExtentExPointI@28 -GetTextExtentExPointW@28 -GetTextExtentExPointWPri@28 -GetTextExtentPoint32A@16 -GetTextExtentPoint32W@16 -GetTextExtentPointA@16 -GetTextExtentPointI@16 -GetTextExtentPointW@16 -GetTextFaceA@12 -GetTextFaceAliasW@12 -GetTextFaceW@12 -GetTextMetricsA@8 -GetTextMetricsW@8 -GetTransform@12=NtGdiGetTransform@12 -GetViewportExtEx@8 -GetViewportOrgEx@8 -GetWinMetaFileBits@20 -GetWindowExtEx@8 -GetWindowOrgEx@8 -GetWorldTransform@8 -HT_Get8BPPFormatPalette@16=NtGdiHT_Get8BPPFormatPalette@16 -HT_Get8BPPMaskPalette@24=NtGdiHT_Get8BPPMaskPalette@24 -IntersectClipRect@20 -InvertRgn@8 -IsValidEnhMetaRecord@8 -IsValidEnhMetaRecordOffExt@16 -LPtoDP@12 -LineDDA@24 -LineTo@12 -MaskBlt@48 -MirrorRgn@8 -ModifyWorldTransform@12 -MoveToEx@16 -NamedEscape@28 -OffsetClipRgn@12 -OffsetRgn@12 -OffsetViewportOrgEx@16 -OffsetWindowOrgEx@16 -PATHOBJ_bEnum@8=NtGdiPATHOBJ_bEnum@8 -PATHOBJ_bEnumClipLines@12=NtGdiPATHOBJ_bEnumClipLines@12 -PATHOBJ_vEnumStart@4=NtGdiPATHOBJ_vEnumStart@4 -PATHOBJ_vEnumStartClipLines@16=NtGdiPATHOBJ_vEnumStartClipLines@16 -PATHOBJ_vGetBounds@8=NtGdiPATHOBJ_vGetBounds@8 -PaintRgn@8 -PatBlt@24 -PathToRegion@4 -Pie@36 -PlayEnhMetaFile@12 -PlayEnhMetaFileRecord@16 -PlayMetaFile@8 -PlayMetaFileRecord@16 -PlgBlt@40 -PolyBezier@12 -PolyBezierTo@12 -PolyDraw@16 -PolyPatBlt@20 -PolyPolygon@16 -PolyPolyline@16 -PolyTextOutA@12 -PolyTextOutW@12 -Polygon@12 -Polyline@12 -PolylineTo@12 -PtInRegion@12 -PtVisible@12=NtGdiPtVisible@12 -QueryFontAssocStatus@0 -RealizePalette@4 -RectInRegion@8 -RectVisible@8=NtGdiRectVisible@8 -Rectangle@20 -RemoveFontMemResourceEx@4 -RemoveFontResourceA@4 -RemoveFontResourceExA@12 -RemoveFontResourceExW@12 -RemoveFontResourceTracking@8 -RemoveFontResourceW@4 -ResetDCA@8 -ResetDCW@8 -ResizePalette@8 -RestoreDC@8 -RoundRect@28 -STROBJ_bEnum@12=NtGdiSTROBJ_bEnum@12 -STROBJ_bEnumPositionsOnly@12=NtGdiSTROBJ_bEnumPositionsOnly@12 -STROBJ_bGetAdvanceWidths@16=NtGdiSTROBJ_bGetAdvanceWidths@16 -STROBJ_dwGetCodePage@4=NtGdiSTROBJ_dwGetCodePage@4 -STROBJ_vEnumStart@4=NtGdiSTROBJ_vEnumStart@4 -SaveDC@4 -ScaleViewportExtEx@24 -ScaleWindowExtEx@24 -SelectBrushLocal@8 -SelectClipPath@8 -SelectClipRgn@8 -SelectFontLocal@8 -SelectObject@8 -SelectPalette@12 -SetAbortProc@8 -SetArcDirection@8 -SetBitmapBits@12=NtGdiSetBitmapBits@12 -SetBitmapDimensionEx@16=NtGdiSetBitmapDimension@16 -SetBkColor@8 -SetBkMode@8 -SetBoundsRect@12 -SetBrushOrgEx@16 -SetColorAdjustment@8 -SetColorSpace@8 -SetDCBrushColor@8 -SetDCPenColor@8 -SetDIBColorTable@16 -SetDIBits@28 -SetDIBitsToDevice@48 -SetDeviceGammaRamp@8 -SetEnhMetaFileBits@8 -SetFontEnumeration@4=NtGdiSetFontEnumeration@4 -SetGraphicsMode@8 -SetICMMode@8 -SetICMProfileA@8 -SetICMProfileW@8 -SetLayout@8 -SetLayoutWidth@12 -SetMagicColors@12=NtGdiSetMagicColors@12 -SetMapMode@8 -SetMapperFlags@8 -SetMetaFileBitsEx@8 -SetMetaRgn@4 -SetMiterLimit@12 -SetPaletteEntries@16 -SetPixel@16 -SetPixelFormat@12 -SetPixelV@16 -SetPolyFillMode@8 -SetROP2@8 -SetRectRgn@20 -SetRelAbs@8 -SetStretchBltMode@8 -SetSystemPaletteUse@8=NtGdiSetSystemPaletteUse@8 -SetTextAlign@8 -SetTextCharacterExtra@8 -SetTextColor@8 -SetTextJustification@12 -SetViewportExtEx@16 -SetViewportOrgEx@16 -SetVirtualResolution@20=NtGdiSetVirtualResolution@20 -SetWinMetaFileBits@16 -SetWindowExtEx@16 -SetWindowOrgEx@16 -SetWorldTransform@8 -StartDocA@8 -StartDocW@8 -StartFormPage@4 -StartPage@4 -StretchBlt@44 -StretchDIBits@52 -StrokeAndFillPath@4 -StrokePath@4 -SwapBuffers@4 -TextOutA@20 -TextOutW@20 -TranslateCharsetInfo@12 -UnloadNetworkFonts@4 -UnrealizeObject@4 -UpdateColors@4 -UpdateICMRegKeyA@16 -UpdateICMRegKeyW@16 -WidenPath@4 -XFORMOBJ_bApplyXform@20=NtGdiXFORMOBJ_bApplyXform@20 -XFORMOBJ_iGetXform@8=NtGdiXFORMOBJ_iGetXform@8 -XLATEOBJ_cGetPalette@16=NtGdiXLATEOBJ_cGetPalette@16 -XLATEOBJ_hGetColorTransform@4=NtGdiXLATEOBJ_hGetColorTransform@4 - - - -GetBrushAttributes@4 -GetGlyphIndicesA@20 -GetTextExtentExPointWPri@28 -GetTextExtentPoint32A@16 -SetBitmapAttributes@8 -SetBrushAttributes@8 -XLATEOBJ_iXlate@8 -XLATEOBJ_piVector@4 -bInitSystemAndFontsDirectoriesW@8 -bMakePathNameW@16 -cGetTTFFromFOT@28 -gdiPlaySpoolStream@24 diff --git a/reactos/dll/win32/gdi32/gdi32.rbuild b/reactos/dll/win32/gdi32/gdi32.rbuild index 6d4062f63a0..1883cc890dc 100644 --- a/reactos/dll/win32/gdi32/gdi32.rbuild +++ b/reactos/dll/win32/gdi32/gdi32.rbuild @@ -1,5 +1,5 @@ - + include 0x0600 diff --git a/reactos/dll/win32/gdiplus/gdiplus.rbuild b/reactos/dll/win32/gdiplus/gdiplus.rbuild index eb165bb85c3..fe7281c21ae 100644 --- a/reactos/dll/win32/gdiplus/gdiplus.rbuild +++ b/reactos/dll/win32/gdiplus/gdiplus.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/getuname/getuname.rbuild b/reactos/dll/win32/getuname/getuname.rbuild index d10a924d570..a576b6baf48 100644 --- a/reactos/dll/win32/getuname/getuname.rbuild +++ b/reactos/dll/win32/getuname/getuname.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x600 diff --git a/reactos/dll/win32/glu32/glu32.rbuild b/reactos/dll/win32/glu32/glu32.rbuild index cb2aab1f3ea..bb5185877d4 100644 --- a/reactos/dll/win32/glu32/glu32.rbuild +++ b/reactos/dll/win32/glu32/glu32.rbuild @@ -1,5 +1,5 @@ - + include libnurbs/internals libnurbs/interface diff --git a/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild b/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild index 53bbdf244bb..6c7cfc888b6 100644 --- a/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild +++ b/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine include/reactos diff --git a/reactos/dll/win32/hlink/hlink.rbuild b/reactos/dll/win32/hlink/hlink.rbuild index 531c3ff8d5b..b5b5eb85391 100644 --- a/reactos/dll/win32/hlink/hlink.rbuild +++ b/reactos/dll/win32/hlink/hlink.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/icmp/icmp.rbuild b/reactos/dll/win32/icmp/icmp.rbuild index e490e9e7ce1..b965ca19120 100644 --- a/reactos/dll/win32/icmp/icmp.rbuild +++ b/reactos/dll/win32/icmp/icmp.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine 0x501 diff --git a/reactos/dll/win32/imagehlp/imagehlp.rbuild b/reactos/dll/win32/imagehlp/imagehlp.rbuild index c65b8f5ee09..b03f5af077a 100644 --- a/reactos/dll/win32/imagehlp/imagehlp.rbuild +++ b/reactos/dll/win32/imagehlp/imagehlp.rbuild @@ -1,5 +1,5 @@ - + . 0x600 0x0600 diff --git a/reactos/dll/win32/imm32/imm32.rbuild b/reactos/dll/win32/imm32/imm32.rbuild index 90253745461..421b1a0c9c5 100644 --- a/reactos/dll/win32/imm32/imm32.rbuild +++ b/reactos/dll/win32/imm32/imm32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/inetcomm/inetcomm.rbuild b/reactos/dll/win32/inetcomm/inetcomm.rbuild index 428f45bed9d..0bc13f6fac9 100644 --- a/reactos/dll/win32/inetcomm/inetcomm.rbuild +++ b/reactos/dll/win32/inetcomm/inetcomm.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/inetmib1/inetmib1.rbuild b/reactos/dll/win32/inetmib1/inetmib1.rbuild index ad685b8fcc2..0f4fd6a5249 100644 --- a/reactos/dll/win32/inetmib1/inetmib1.rbuild +++ b/reactos/dll/win32/inetmib1/inetmib1.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/iphlpapi/iphlpapi.rbuild b/reactos/dll/win32/iphlpapi/iphlpapi.rbuild index b93ab591916..5acca9019ed 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi.rbuild +++ b/reactos/dll/win32/iphlpapi/iphlpapi.rbuild @@ -1,5 +1,5 @@ - + include include/reactos/wine wine diff --git a/reactos/dll/win32/iphlpapi/resinfo_reactos.c b/reactos/dll/win32/iphlpapi/resinfo_reactos.c index a4625efb805..81ddec8fe3f 100644 --- a/reactos/dll/win32/iphlpapi/resinfo_reactos.c +++ b/reactos/dll/win32/iphlpapi/resinfo_reactos.c @@ -124,10 +124,10 @@ static void EnumInterfaces( PVOID Data, EnumInterfacesFunc cb ) { void EnumNameServers( HANDLE RegHandle, PWCHAR Interface, PVOID Data, EnumNameServersFunc cb ) { PWCHAR NameServerString = - QueryRegistryValueString(RegHandle, L"NameServer"); + QueryRegistryValueString(RegHandle, L"DhcpNameServer"); if (!NameServerString) - NameServerString = QueryRegistryValueString(RegHandle, L"DhcpNameServer"); + NameServerString = QueryRegistryValueString(RegHandle, L"NameServer"); if (NameServerString) { /* Now, count the non-empty comma separated */ @@ -181,12 +181,18 @@ VOID CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server, PVOID _Data ) { PNAME_SERVER_LIST_PRIVATE Data = (PNAME_SERVER_LIST_PRIVATE)_Data; - RtlUnicodeToMultiByteN((PCHAR)&Data->AddrString[Data->CurrentName], - sizeof(Data->AddrString[0]), - NULL, - Server, - wcslen(Server)); - Data->CurrentName++; + + if (WideCharToMultiByte(CP_ACP, 0, Server, -1, + Data->AddrString[Data->CurrentName].String, + 16, NULL, NULL)) + { + Data->AddrString[Data->CurrentName].String[15] = '\0'; + Data->CurrentName++; + } + else + { + Data->AddrString[Data->CurrentName].String[0] = '\0'; + } } static void CreateNameServerListEnumIfFunc( HKEY RegHandle, @@ -207,43 +213,19 @@ static void MakeNameServerList( PNAME_SERVER_LIST_PRIVATE PrivateData ) { } PIPHLP_RES_INFO getResInfo() { - DWORD i, ServerCount, ExtraServer; - HKEY hKey; - LONG errCode; - PWCHAR Str; - IP_ADDR_STRING AddrString; + DWORD i, ServerCount; NAME_SERVER_LIST_PRIVATE PrivateNSEnum = { 0 }; PIPHLP_RES_INFO ResInfo; struct sockaddr_in *AddrList; ServerCount = CountNameServers( &PrivateNSEnum ); - errCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE, - "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\" - "Parameters", 0, KEY_READ, &hKey); - if (errCode != ERROR_SUCCESS) { - RegCloseKey( hKey ); - return NULL; - } - - Str = QueryRegistryValueString( hKey, L"NameServer" ); - - /* If NameServer is empty */ - if (!Str || *Str == L'\0') - { - /* Then use DhcpNameServer */ - Str = QueryRegistryValueString( hKey, L"DhcpNameServer" ); - } - - ExtraServer = Str ? 1 : 0; - - ServerCount += ExtraServer; - PrivateNSEnum.NumServers = ServerCount; PrivateNSEnum.AddrString = (PIP_ADDRESS_STRING) RtlAllocateHeap( GetProcessHeap(), 0, ServerCount * sizeof(IP_ADDRESS_STRING) ); + PrivateNSEnum.CurrentName = 0; ResInfo = (PIPHLP_RES_INFO)RtlAllocateHeap @@ -253,7 +235,6 @@ PIPHLP_RES_INFO getResInfo() { if( !ResInfo ) { RtlFreeHeap( GetProcessHeap(), 0, PrivateNSEnum.AddrString ); - RegCloseKey( hKey ); return NULL; } @@ -264,30 +245,15 @@ PIPHLP_RES_INFO getResInfo() { MakeNameServerList( &PrivateNSEnum ); - if( ExtraServer ) { - ULONG ResultSize; - - for( ResultSize = 0; Str[ResultSize]; ResultSize++ ) - ((PCHAR)&AddrString)[ResultSize] = Str[ResultSize]; - - ((PCHAR)&AddrString)[ResultSize] = 0; - ResInfo->riAddressList[0].sin_family = AF_INET; - ResInfo->riAddressList[0].sin_addr.s_addr = - inet_addr( (PCHAR)&AddrString ); - ResInfo->riAddressList[0].sin_port = 0; - ConsumeRegValueString( Str ); - } - - for( i = ExtraServer; i < ServerCount; i++ ) { + for( i = 0; i < PrivateNSEnum.CurrentName; i++ ) { /* Hmm seems that dns servers are always AF_INET but ... */ ResInfo->riAddressList[i].sin_family = AF_INET; ResInfo->riAddressList[i].sin_addr.s_addr = - inet_addr( (PCHAR)&PrivateNSEnum.AddrString[i - ExtraServer] ); + inet_addr(PrivateNSEnum.AddrString[i].String ); ResInfo->riAddressList[i].sin_port = 0; } RtlFreeHeap( GetProcessHeap(), 0, PrivateNSEnum.AddrString ); - RegCloseKey( hKey ); return ResInfo; } diff --git a/reactos/dll/win32/jscript/jscript.rbuild b/reactos/dll/win32/jscript/jscript.rbuild index b9308743f38..eca0c55f9c3 100644 --- a/reactos/dll/win32/jscript/jscript.rbuild +++ b/reactos/dll/win32/jscript/jscript.rbuild @@ -1,7 +1,7 @@ - + . . include/reactos/wine diff --git a/reactos/dll/win32/kernel32/kernel32.rbuild b/reactos/dll/win32/kernel32/kernel32.rbuild index 91452dcc82e..795d91de6b7 100644 --- a/reactos/dll/win32/kernel32/kernel32.rbuild +++ b/reactos/dll/win32/kernel32/kernel32.rbuild @@ -128,7 +128,7 @@ - + . . include diff --git a/reactos/dll/win32/kernel32/mem/section.c b/reactos/dll/win32/kernel32/mem/section.c index 7829ba153e5..92e74a40348 100644 --- a/reactos/dll/win32/kernel32/mem/section.c +++ b/reactos/dll/win32/kernel32/mem/section.c @@ -158,12 +158,12 @@ MapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, - DWORD dwNumberOfBytesToMap, + SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress) { NTSTATUS Status; LARGE_INTEGER SectionOffset; - ULONG ViewSize; + SIZE_T ViewSize; ULONG Protect; LPVOID ViewBase; @@ -224,7 +224,7 @@ MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, - DWORD dwNumberOfBytesToMap) + SIZE_T dwNumberOfBytesToMap) { /* Call the extended API */ return MapViewOfFileEx(hFileMappingObject, diff --git a/reactos/dll/win32/lpk/lpk.rbuild b/reactos/dll/win32/lpk/lpk.rbuild index eacdef6f384..41a294f658f 100644 --- a/reactos/dll/win32/lpk/lpk.rbuild +++ b/reactos/dll/win32/lpk/lpk.rbuild @@ -1,5 +1,5 @@ - + include 0x0600 diff --git a/reactos/dll/win32/lz32/lz32.rbuild b/reactos/dll/win32/lz32/lz32.rbuild index 423239537d9..f4fb312f701 100644 --- a/reactos/dll/win32/lz32/lz32.rbuild +++ b/reactos/dll/win32/lz32/lz32.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/mapi32/mapi32.rbuild b/reactos/dll/win32/mapi32/mapi32.rbuild index dc600d6dd3f..e24d1158627 100644 --- a/reactos/dll/win32/mapi32/mapi32.rbuild +++ b/reactos/dll/win32/mapi32/mapi32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/mlang/mlang.rbuild b/reactos/dll/win32/mlang/mlang.rbuild index 46a20c9a0d0..cc083279adc 100644 --- a/reactos/dll/win32/mlang/mlang.rbuild +++ b/reactos/dll/win32/mlang/mlang.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/mmdrv/mmdrv.rbuild b/reactos/dll/win32/mmdrv/mmdrv.rbuild index f9627195b51..44430714713 100644 --- a/reactos/dll/win32/mmdrv/mmdrv.rbuild +++ b/reactos/dll/win32/mmdrv/mmdrv.rbuild @@ -1,5 +1,5 @@ - + . ntdll diff --git a/reactos/dll/win32/modemui/modemui.rbuild b/reactos/dll/win32/modemui/modemui.rbuild index afa5a91eeef..c316c0dd5e8 100644 --- a/reactos/dll/win32/modemui/modemui.rbuild +++ b/reactos/dll/win32/modemui/modemui.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 diff --git a/reactos/dll/win32/mpr/mpr.rbuild b/reactos/dll/win32/mpr/mpr.rbuild index 8df5fd1b614..cc17d609e5f 100644 --- a/reactos/dll/win32/mpr/mpr.rbuild +++ b/reactos/dll/win32/mpr/mpr.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/mprapi/mprapi.rbuild b/reactos/dll/win32/mprapi/mprapi.rbuild index 542f8afc47c..0044f108913 100644 --- a/reactos/dll/win32/mprapi/mprapi.rbuild +++ b/reactos/dll/win32/mprapi/mprapi.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/msacm32/msacm32.rbuild b/reactos/dll/win32/msacm32/msacm32.rbuild index 9d83ecfa107..337a99b911b 100644 --- a/reactos/dll/win32/msacm32/msacm32.rbuild +++ b/reactos/dll/win32/msacm32/msacm32.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine 0x600 diff --git a/reactos/dll/win32/mscoree/mscoree.rbuild b/reactos/dll/win32/mscoree/mscoree.rbuild index 7c805276357..76726a3e57f 100644 --- a/reactos/dll/win32/mscoree/mscoree.rbuild +++ b/reactos/dll/win32/mscoree/mscoree.rbuild @@ -1,5 +1,5 @@ - + . wine kernel32 diff --git a/reactos/dll/win32/msgina/msgina.rbuild b/reactos/dll/win32/msgina/msgina.rbuild index d000673cc6a..951dc1c97e2 100644 --- a/reactos/dll/win32/msgina/msgina.rbuild +++ b/reactos/dll/win32/msgina/msgina.rbuild @@ -1,5 +1,5 @@ - + . include ntdll diff --git a/reactos/dll/win32/mshtml.tlb/mshtml.tlb.rbuild b/reactos/dll/win32/mshtml.tlb/mshtml.tlb.rbuild index 2f476623d86..a4ff711eb15 100644 --- a/reactos/dll/win32/mshtml.tlb/mshtml.tlb.rbuild +++ b/reactos/dll/win32/mshtml.tlb/mshtml.tlb.rbuild @@ -4,7 +4,7 @@ mshtml_tlb.idl - + . mshtml_tlb diff --git a/reactos/dll/win32/mshtml/mshtml.rbuild b/reactos/dll/win32/mshtml/mshtml.rbuild index 5db3ddd01a1..5bff1fc90af 100644 --- a/reactos/dll/win32/mshtml/mshtml.rbuild +++ b/reactos/dll/win32/mshtml/mshtml.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/msi/msi.rbuild b/reactos/dll/win32/msi/msi.rbuild index c2c37e79369..99d557331b1 100644 --- a/reactos/dll/win32/msi/msi.rbuild +++ b/reactos/dll/win32/msi/msi.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/msimg32/msimg32.rbuild b/reactos/dll/win32/msimg32/msimg32.rbuild index 117fccb59ab..c8f9a0912c6 100644 --- a/reactos/dll/win32/msimg32/msimg32.rbuild +++ b/reactos/dll/win32/msimg32/msimg32.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/mstask/mstask.rbuild b/reactos/dll/win32/mstask/mstask.rbuild index ea4d1f62eb3..02843751570 100644 --- a/reactos/dll/win32/mstask/mstask.rbuild +++ b/reactos/dll/win32/mstask/mstask.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/msvcrt20/msvcrt20.rbuild b/reactos/dll/win32/msvcrt20/msvcrt20.rbuild index 42a0f5bde48..bea191594d2 100644 --- a/reactos/dll/win32/msvcrt20/msvcrt20.rbuild +++ b/reactos/dll/win32/msvcrt20/msvcrt20.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/msvcrt40/msvcrt40.rbuild b/reactos/dll/win32/msvcrt40/msvcrt40.rbuild index 1771c772327..e3516be4215 100644 --- a/reactos/dll/win32/msvcrt40/msvcrt40.rbuild +++ b/reactos/dll/win32/msvcrt40/msvcrt40.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/msvfw32/msvfw32.rbuild b/reactos/dll/win32/msvfw32/msvfw32.rbuild index d1e3f508f60..5cf4f895a3d 100644 --- a/reactos/dll/win32/msvfw32/msvfw32.rbuild +++ b/reactos/dll/win32/msvfw32/msvfw32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/msxml3/msxml3.rbuild b/reactos/dll/win32/msxml3/msxml3.rbuild index ce4fd47524b..e61d94bc43f 100644 --- a/reactos/dll/win32/msxml3/msxml3.rbuild +++ b/reactos/dll/win32/msxml3/msxml3.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine . diff --git a/reactos/dll/win32/nddeapi/nddeapi.rbuild b/reactos/dll/win32/nddeapi/nddeapi.rbuild index 8700ed6b8ff..80aacc2ef6d 100644 --- a/reactos/dll/win32/nddeapi/nddeapi.rbuild +++ b/reactos/dll/win32/nddeapi/nddeapi.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/netapi32/netapi32.rbuild b/reactos/dll/win32/netapi32/netapi32.rbuild index 9c2ef41ff14..dd6e1f85b29 100644 --- a/reactos/dll/win32/netapi32/netapi32.rbuild +++ b/reactos/dll/win32/netapi32/netapi32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/netcfgx/lang/pl-PL.rc b/reactos/dll/win32/netcfgx/lang/pl-PL.rc index 9040297102b..c01995ac2af 100644 --- a/reactos/dll/win32/netcfgx/lang/pl-PL.rc +++ b/reactos/dll/win32/netcfgx/lang/pl-PL.rc @@ -48,22 +48,22 @@ END IDD_TCPIP_ADVIP_DLG DIALOGEX DISCARDABLE 0, 0, 247, 247 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION -CAPTION "IP Settings" +CAPTION "Ustawienia protoko³u IP" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "IP addressen", -1, 5, 5, 240, 90 + GROUPBOX "Adresy IP", -1, 5, 5, 240, 90 CONTROL "", IDC_IPLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 15, 210, 55 - PUSHBUTTON "Add...", IDC_IPADD, 60, 75, 50, 14, WS_TABSTOP - PUSHBUTTON "Edit...", IDC_IPMOD, 120, 75, 50, 14, WS_TABSTOP - PUSHBUTTON "Remove", IDC_IPDEL, 180, 75, 50, 14, WS_TABSTOP - GROUPBOX "Default gateways:", -1, 5, 100, 240, 90 + PUSHBUTTON "Dodaj...", IDC_IPADD, 60, 75, 50, 14, WS_TABSTOP + PUSHBUTTON "Edytuj...", IDC_IPMOD, 120, 75, 50, 14, WS_TABSTOP + PUSHBUTTON "Usuñ", IDC_IPDEL, 180, 75, 50, 14, WS_TABSTOP + GROUPBOX "Domyœlne bramy:", -1, 5, 100, 240, 90 CONTROL "", IDC_GWLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 110, 210, 55 - PUSHBUTTON "Add...", IDC_GWADD, 60, 170, 50, 14, WS_TABSTOP - PUSHBUTTON "Edit...", IDC_GWMOD, 120, 170, 50, 14, WS_TABSTOP - PUSHBUTTON "Remove", IDC_GWDEL, 180, 170, 50, 14, WS_TABSTOP + PUSHBUTTON "Dodaj...", IDC_GWADD, 60, 170, 50, 14, WS_TABSTOP + PUSHBUTTON "Edytuj...", IDC_GWMOD, 120, 170, 50, 14, WS_TABSTOP + PUSHBUTTON "Usuñ", IDC_GWDEL, 180, 170, 50, 14, WS_TABSTOP GROUPBOX "", -1, 5, 200, 240, 30 - CHECKBOX "Automatic metric", IDC_AUTOMETRIC, 9, 200, 90, 12, BS_AUTOCHECKBOX | WS_TABSTOP - LTEXT "Interface metric:", -1, 15, 215, 90, 12 + CHECKBOX "Metryka automatyczna", IDC_AUTOMETRIC, 9, 200, 90, 12, BS_AUTOCHECKBOX | WS_TABSTOP + LTEXT "Metryka interfejsu:", -1, 15, 215, 90, 12 EDITTEXT IDC_METRIC, 110, 212, 50, 12, WS_TABSTOP | ES_NUMBER END @@ -73,157 +73,157 @@ CAPTION "DNS" FONT 8, "MS Shell Dlg" BEGIN LISTBOX IDC_DNSADDRLIST, 5, 15, 180, 60, LBS_NOTIFY - LTEXT "D&NS server addresses, in order of use:", -1, 5, 5, 180, 12 - PUSHBUTTON "Up", IDC_DNSADDRUP, 190, 30, 50, 14, WS_TABSTOP - PUSHBUTTON "Down", IDC_DNSADDRDOWN, 190, 50, 50, 14, WS_TABSTOP - PUSHBUTTON "&Add...", IDC_DNSADDRADD, 30, 70, 50, 14, WS_TABSTOP - PUSHBUTTON "&Edit...", IDC_DNSADDRMOD, 100, 70, 50, 14, WS_TABSTOP - PUSHBUTTON "Remo&ve", IDC_DNSADDRDEL, 170, 70, 50, 14, WS_TABSTOP - LTEXT "The following three settings are applied to all connections with TCP/IP enabled. For resolution of unqualified names:", -1, 5, 90, 220, 24 - CONTROL "Append &primary and connection specific DNS suffixes", IDC_PRIMSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 110, 160, 12 - CHECKBOX "Append parent suffi&xes of the primary DNS suffix", IDC_TOPPRIMSUFFIX, 15, 125, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP - CONTROL "Append t&hese DNS suffixes(in order):", IDC_SELSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 140, 190, 12 + LTEXT "Adresy serwerów D&NS wed³ug kolejnoœci u¿ywania:", -1, 5, 5, 180, 12 + PUSHBUTTON "W górê", IDC_DNSADDRUP, 190, 30, 50, 14, WS_TABSTOP + PUSHBUTTON "W dó³", IDC_DNSADDRDOWN, 190, 50, 50, 14, WS_TABSTOP + PUSHBUTTON "&Dodaj...", IDC_DNSADDRADD, 30, 70, 50, 14, WS_TABSTOP + PUSHBUTTON "&Edytuj...", IDC_DNSADDRMOD, 100, 70, 50, 14, WS_TABSTOP + PUSHBUTTON "&Usuñ", IDC_DNSADDRDEL, 170, 70, 50, 14, WS_TABSTOP + LTEXT "Trzy poni¿sze ustawienia dotycz¹ wszystkich po³¹czeñ o w³¹czonym protokole TCP/IP. W celu rozpoznawania nazw niekwalifikowanych:", -1, 5, 90, 220, 24 + CONTROL "D&o³¹cz sufiksy DNS: podstawowy i konkretnego po³¹czenia", IDC_PRIMSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 110, 160, 12 + CHECKBOX "Do³¹cz su&fiksy nadrzêdne podstawowego sufiksu DNS", IDC_TOPPRIMSUFFIX, 15, 125, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CONTROL "Do³¹&cz poni¿sze sufiksy DNS (w podanej kolejnoœci):", IDC_SELSUFFIX, "BUTTON", BS_AUTORADIOBUTTON, 5, 140, 190, 12 LISTBOX IDC_DNSSUFFIXLIST, 5, 155, 180, 60, LBS_NOTIFY - PUSHBUTTON "Up", IDC_DNSSUFFIXUP, 190, 170, 50, 14, WS_TABSTOP - PUSHBUTTON "Down", IDC_DNSSUFFIXDOWN, 190, 190, 50, 14, WS_TABSTOP - PUSHBUTTON "&Add...", IDC_DNSSUFFIXADD, 30, 210, 50, 14, WS_TABSTOP - PUSHBUTTON "&Edit...", IDC_DNSSUFFIXMOD, 100, 210, 50, 14, WS_TABSTOP - PUSHBUTTON "Remo&ve", IDC_DNSSUFFIXDEL, 170, 210, 50, 14, WS_TABSTOP - LTEXT "DNS &suffix for this connection:", -1, 5, 225, 110, 14 + PUSHBUTTON "W górê", IDC_DNSSUFFIXUP, 190, 170, 50, 14, WS_TABSTOP + PUSHBUTTON "W dó³", IDC_DNSSUFFIXDOWN, 190, 190, 50, 14, WS_TABSTOP + PUSHBUTTON "Dod&aj...", IDC_DNSSUFFIXADD, 30, 210, 50, 14, WS_TABSTOP + PUSHBUTTON "Ed&ytuj...", IDC_DNSSUFFIXMOD, 100, 210, 50, 14, WS_TABSTOP + PUSHBUTTON "U&suñ", IDC_DNSSUFFIXDEL, 170, 210, 50, 14, WS_TABSTOP + LTEXT "Sufiks DNS dla &tego po³¹czenia:", -1, 5, 225, 110, 14 EDITTEXT IDC_SUFFIX, 120, 225, 100, 12, WS_TABSTOP - CHECKBOX "&Register this connection's addresses in DNS", IDC_REGSUFFIX, 15, 240, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP - CHECKBOX "&Use this connection's DNS suffix in DNS registration", IDC_USESUFFIX, 15, 255, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "&Zarejestruj adresy tego po³¹czenia w DNS", IDC_REGSUFFIX, 15, 240, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "U¿y&j sufiksu DNS tego po³¹czenia do rejestracji w DNS", IDC_USESUFFIX, 15, 255, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP END IDD_TCPIP_ADVOPT_DLG DIALOGEX DISCARDABLE 0, 0, 247, 247 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION -CAPTION "Options" +CAPTION "Opcje" FONT 8, "MS Shell Dlg" BEGIN LISTBOX IDC_OPTLIST, 5, 30, 230, 70 - LTEXT "&Optional settings", -1, 5, 15, 130, 12 - PUSHBUTTON "&Properties", IDC_OPTPROP, 160, 100, 70, 14, WS_TABSTOP - GROUPBOX "Description:", -1, 5, 120, 240, 70 + LTEXT "&Ustawienia opcjonalne", -1, 5, 15, 130, 12 + PUSHBUTTON "&W³aœciwoœci", IDC_OPTPROP, 160, 100, 70, 14, WS_TABSTOP + GROUPBOX "Opis:", -1, 5, 120, 240, 70 LTEXT "", IDC_OPTDESC, 15, 130, 220, 33 END IDD_TCPIPADDIP_DLG DIALOGEX DISCARDABLE 0, 0, 200, 70 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "TCP/IP Address" +CAPTION "Adres TCP/IP" FONT 8, "MS Shell Dlg" BEGIN CONTROL "",IDC_IPADDR,"SysIPAddress32",WS_TABSTOP, 100, 15, 80, 12 - LTEXT "IP address:", -1, 5, 15, 70, 12 - LTEXT "Subnet mask:", -1, 5, 30, 70, 12 + LTEXT "Adres IP:", -1, 5, 15, 70, 12 + LTEXT "Maska podsieci:", -1, 5, 30, 70, 12 CONTROL "",IDC_SUBNETMASK,"SysIPAddress32", WS_TABSTOP, 100, 30, 80, 12 PUSHBUTTON "", IDC_OK, 50, 50, 50, 14, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP END IDD_TCPIPGW_DLG DIALOGEX DISCARDABLE 0, 0, 200, 80 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "TCP/IP Gateway Address" +CAPTION "Adres bramy TCP/IP" FONT 8, "MS Shell Dlg" BEGIN CONTROL "",IDC_IPADDR,"SysIPAddress32",WS_TABSTOP, 100, 15, 80, 12 - LTEXT "Gateway:", -1, 5, 15, 70, 12 - CHECKBOX "Automatic metric", IDC_USEMETRIC, 15, 30, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP - LTEXT "&Metric:", IDC_METRICTXT, 5, 45, 45, 12, WS_DISABLED + LTEXT "Brama:", -1, 5, 15, 70, 12 + CHECKBOX "Metryka automatyczna", IDC_USEMETRIC, 15, 30, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP + LTEXT "&Metryka:", IDC_METRICTXT, 5, 45, 45, 12, WS_DISABLED EDITTEXT IDC_METRIC, 100, 45, 50, 12, WS_TABSTOP | ES_NUMBER | WS_DISABLED PUSHBUTTON "", IDC_OK, 50, 60, 50, 14, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 110, 60, 50, 14, WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 110, 60, 50, 14, WS_TABSTOP END IDD_TCPIPDNS_DLG DIALOGEX DISCARDABLE 0, 0, 200, 80 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "TCP/IP DNS Server" +CAPTION "Serwer DNS TCP/IP" FONT 8, "MS Shell Dlg" BEGIN CONTROL "",IDC_IPADDR,"SysIPAddress32",WS_TABSTOP, 5, 25, 80, 12 - LTEXT "DNS server:", -1, 5, 10, 120, 12 + LTEXT "Serwer DNS:", -1, 5, 10, 120, 12 PUSHBUTTON "", IDC_OK, 50, 50, 50, 14, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP END IDD_TCPIPSUFFIX_DLG DIALOGEX DISCARDABLE 0, 0, 200, 80 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "TCP/IP Domain Suffix" +CAPTION "Sufiks domeny TCP/IP" FONT 8, "MS Shell Dlg" BEGIN EDITTEXT IDC_SUFFIX, 5, 25, 190, 12, WS_TABSTOP - LTEXT "Domain suffix:", -1, 5, 10, 120, 12 + LTEXT "Sufiks domeny:", -1, 5, 10, 120, 12 PUSHBUTTON "", IDC_OK, 50, 50, 50, 14, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 110, 50, 50, 14, WS_TABSTOP END IDD_TCPIP_FILTER_DLG DIALOGEX DISCARDABLE 0, 0, 305, 220 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "TCP/IP Filtering" +CAPTION "Filtrowanie TCP/IP" FONT 8, "MS Shell Dlg" BEGIN - CHECKBOX "Enable TCP/IP-Filtering (All adapters)", IDC_USE_FILTER, 15, 5, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "W³¹cz filtrowanie TCP/IP (wszystkie karty)", IDC_USE_FILTER, 15, 5, 190, 12, BS_AUTOCHECKBOX | WS_TABSTOP GROUPBOX "", -1, 5, 30, 90, 150 - CONTROL "Permit All", IDC_TCP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 30, 70, 12 - CONTROL "Permit Only", IDC_TCP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 44, 70, 12 + CONTROL "Pozwalaj wszystkim", IDC_TCP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 30, 70, 12 + CONTROL "Pozwalaj tylko", IDC_TCP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 15, 44, 70, 12 CONTROL "", IDC_TCP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 11, 62, 72, 75 - PUSHBUTTON "Add", IDC_TCP_ADD, 15, 141, 50, 14, WS_TABSTOP - PUSHBUTTON "Remove", IDC_TCP_DEL, 15, 161, 50, 14, WS_TABSTOP + PUSHBUTTON "Dodaj", IDC_TCP_ADD, 15, 141, 50, 14, WS_TABSTOP + PUSHBUTTON "Usuñ", IDC_TCP_DEL, 15, 161, 50, 14, WS_TABSTOP GROUPBOX "", -1, 105, 30, 90, 150 - CONTROL "Permit All", IDC_UDP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 30, 70, 12 - CONTROL "Permit Only", IDC_UDP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 44, 70, 12 + CONTROL "Pozwalaj wszystkim", IDC_UDP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 30, 70, 12 + CONTROL "Pozwalaj tylko", IDC_UDP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 115, 44, 70, 12 CONTROL "", IDC_UDP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 111, 62, 72, 75 - PUSHBUTTON "Add", IDC_UDP_ADD, 115, 141, 50, 14, WS_TABSTOP - PUSHBUTTON "Remove", IDC_UDP_DEL, 115, 161, 50, 14, WS_TABSTOP + PUSHBUTTON "Dodaj", IDC_UDP_ADD, 115, 141, 50, 14, WS_TABSTOP + PUSHBUTTON "Usuñ", IDC_UDP_DEL, 115, 161, 50, 14, WS_TABSTOP GROUPBOX "", -1, 205, 30, 90, 150 - CONTROL "Permit All", IDC_IP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 30, 70, 12 - CONTROL "Permit Only", IDC_IP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 44, 70, 12 + CONTROL "Pozwalaj wszystkim", IDC_IP_ALLOW_ALL, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 30, 70, 12 + CONTROL "Pozwalaj tylko", IDC_IP_RESTRICT, "BUTTON", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 215, 44, 70, 12 CONTROL "", IDC_IP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 211, 62, 72, 75 - PUSHBUTTON "Add", IDC_IP_ADD, 215, 141, 50, 14, WS_TABSTOP - PUSHBUTTON "Remove", IDC_IP_DEL, 215, 161, 50, 14, WS_TABSTOP + PUSHBUTTON "Dodaj", IDC_IP_ADD, 215, 141, 50, 14, WS_TABSTOP + PUSHBUTTON "Usuñ", IDC_IP_DEL, 215, 161, 50, 14, WS_TABSTOP PUSHBUTTON "OK", IDC_OK, 150, 190, 50, 14, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 210, 190, 50, 14, WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 210, 190, 50, 14, WS_TABSTOP END IDD_TCPIP_PORT_DLG DIALOGEX DISCARDABLE 0, 0, 200, 60 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Add Filter" +CAPTION "Dodaj filtr" FONT 8, "MS Shell Dlg" BEGIN EDITTEXT IDC_PORT_VAL, 5, 30, 70, 12, WS_TABSTOP | ES_NUMBER LTEXT "", IDC_PORT_DESC, 5, 15, 40, 12 PUSHBUTTON "OK", IDC_OK, 120, 15, 50, 14, WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 120, 30, 50, 14, WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 120, 30, 50, 14, WS_TABSTOP END STRINGTABLE BEGIN IDS_NET_CONNECT "Po³¹czenie sieciowe" - IDS_NO_IPADDR_SET "The adapter requires at least one IP address. Please enter one." - IDS_NO_SUBMASK_SET "You have entered an address that is missing its subnet mask. Please add a subnet mask." - IDS_TCPFILTERDESC "TCP/IP filtering allows you to control the type of TCP/IP network traffic that reaches your computer." - IDS_TCPFILTER "TCP/IP Filtering" - IDS_IPADDR "IP address" - IDS_SUBMASK "Subnet mask" - IDS_GATEWAY "Gateway" - IDS_METRIC "Metric" - IDS_DHCPACTIVE "DHCP Enabled" - IDS_AUTOMATIC "Automatic" - IDS_NOITEMSEL "You have not selected an item. Select one first." + IDS_NO_IPADDR_SET "Ta karta wymaga co najmniej jednego adresu IP. WprowadŸ adres IP." + IDS_NO_SUBMASK_SET "Wprowadzono adres, w którym brakuje maski podsieci. WprowadŸ maskê podsieci." + IDS_TCPFILTERDESC "Filtrowanie pakietów TCP/IP pozwala na kontrolowanie w sieci tego typu ruchu TCP/IP, który dociera do danego komputera." + IDS_TCPFILTER "Filtrowanie protoko³u TCP/IP" + IDS_IPADDR "Adres IP" + IDS_SUBMASK "Maska podsieci" + IDS_GATEWAY "Brama" + IDS_METRIC "Metryka" + IDS_DHCPACTIVE "DHCP w³¹czone" + IDS_AUTOMATIC "Automatyczna" + IDS_NOITEMSEL "Nie wybrano ¿adnego elementu. Najpierw wybierz element." IDS_TCPIP "ReactOS-TCP/IP" - IDS_ADD "Add" + IDS_ADD "Dodaj" IDS_MOD "OK" - IDS_TCP_PORTS "TCP Ports" - IDS_UDP_PORTS "UDP Ports" - IDS_IP_PROTO "IP protocols" - IDS_PORT_RANGE "Port numbers must be greater than 0 and less than 65536. Please enter a number within this range." - IDS_PROT_RANGE "Protocol numbers must be greater than 0 and less than 256. Please enter a number within this range." - IDS_DUP_NUMBER "The number you are trying to add is already in the list. Please enter a different number." - IDS_DISABLE_FILTER "Disabling this global TCP/IP setting will affect all adapters." - IDS_NO_SUFFIX "The current setting of search method requires at least one DNS suffix. Please enter one or change the setting." - IDS_DOMAIN_SUFFIX "Domain suffix is not a valid suffix." - IDS_DNS_SUFFIX "The DNS domain name ""%s"" is not a valid DNS name." - IDS_DUP_SUFFIX "The DNS suffix is already on the list." - IDS_DUP_IPADDR "The IP address is already on the list." - IDS_DUP_GW "The default gateway is already on the list." + IDS_TCP_PORTS "Porty TCP" + IDS_UDP_PORTS "Porty UDP" + IDS_IP_PROTO "Protoko³y IP" + IDS_PORT_RANGE "Numery portów musz¹ byæ wiêksze od 0 i mniejsze od 65536. WprowadŸ liczbê z tego zakresu." + IDS_PROT_RANGE "Numery protoko³ów musz¹ byæ wiêksze od 0 i mniejsze od 256. WprowadŸ liczbê z tego zakresu." + IDS_DUP_NUMBER "Podana liczba znajduje siê ju¿ na liœcie. WprowadŸ inn¹ liczbê." + IDS_DISABLE_FILTER "Wy³¹czenie tego globalnego ustawienia protoko³u TCP/IP bêdzie mia³o wp³yw na wszystkie karty." + IDS_NO_SUFFIX "Aktualne ustawienie przeszukiwania wymaga podania przynajmniej jednego sufiksu DNS. WprowadŸ sufiks DNS lub zmieñ ustawienia." + IDS_DOMAIN_SUFFIX "Podany sufiks domeny jest nieprawid³owy." + IDS_DNS_SUFFIX "Nazwa domeny DNS ""%s"" jest nieprawid³owa." + IDS_DUP_SUFFIX "Sufiks DNS znajduje siê ju¿ na liœcie." + IDS_DUP_IPADDR "Adres IP znajduje siê ju¿ na liœcie." + IDS_DUP_GW "Domyœlna brama znajduje siê ju¿ na liœcie." END diff --git a/reactos/dll/win32/netcfgx/netcfgx.rbuild b/reactos/dll/win32/netcfgx/netcfgx.rbuild index 8c6e0e37106..c6d7998e184 100644 --- a/reactos/dll/win32/netcfgx/netcfgx.rbuild +++ b/reactos/dll/win32/netcfgx/netcfgx.rbuild @@ -1,5 +1,5 @@ - + ntdll rpcrt4 diff --git a/reactos/dll/win32/netcfgx/tcpipconf_notify.c b/reactos/dll/win32/netcfgx/tcpipconf_notify.c index ad1089032cd..270f432d702 100644 --- a/reactos/dll/win32/netcfgx/tcpipconf_notify.c +++ b/reactos/dll/win32/netcfgx/tcpipconf_notify.c @@ -3194,6 +3194,7 @@ INetCfgComponentControl_fnApplyRegistryChanges( if(pStr) { RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)pStr, dwSize); + RegDeleteValueW(hKey, L"DhcpNameServer"); CoTaskMemFree(pStr); } } diff --git a/reactos/dll/win32/netid/netid.rbuild b/reactos/dll/win32/netid/netid.rbuild index 0bab404e897..021663c41ed 100644 --- a/reactos/dll/win32/netid/netid.rbuild +++ b/reactos/dll/win32/netid/netid.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x0600 diff --git a/reactos/dll/win32/netshell/lang/bg-BG.rc b/reactos/dll/win32/netshell/lang/bg-BG.rc index 45beb541a8a..990a2ae89c7 100644 --- a/reactos/dll/win32/netshell/lang/bg-BG.rc +++ b/reactos/dll/win32/netshell/lang/bg-BG.rc @@ -19,7 +19,7 @@ BEGIN CHECKBOX "Óâåäîìÿâàíå ïðè îãðàíè÷åíà èëè ëèïñâàùà ñâúðçàíîñò", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP END -IDD_NETSTATUS DIALOGEX DISCARDABLE 0, 0, 200,180 +IDD_STATUS DIALOGEX DISCARDABLE 0, 0, 200,180 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION CAPTION "Îáùè" FONT 8, "MS Shell Dlg" @@ -68,9 +68,29 @@ BEGIN PUSHBUTTON "&Ïîäðîáíîñòè...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Ìðåæîâî ñâúðçâàíå" IDS_SHV_COLUMN_NAME "Èìå" IDS_SHV_COLUMN_TYPE "Âèä" diff --git a/reactos/dll/win32/netshell/lang/cs-CZ.rc b/reactos/dll/win32/netshell/lang/cs-CZ.rc index b3ecf07a017..1ee4842ba96 100644 --- a/reactos/dll/win32/netshell/lang/cs-CZ.rc +++ b/reactos/dll/win32/netshell/lang/cs-CZ.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Detaily...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/da-DK.rc b/reactos/dll/win32/netshell/lang/da-DK.rc index 657918b9396..2cf64a4966f 100644 --- a/reactos/dll/win32/netshell/lang/da-DK.rc +++ b/reactos/dll/win32/netshell/lang/da-DK.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/de-DE.rc b/reactos/dll/win32/netshell/lang/de-DE.rc index bc466e3cc20..4d1fd057f1b 100644 --- a/reactos/dll/win32/netshell/lang/de-DE.rc +++ b/reactos/dll/win32/netshell/lang/de-DE.rc @@ -68,9 +68,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Netzwerkverbindungen" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Typ" diff --git a/reactos/dll/win32/netshell/lang/el-GR.rc b/reactos/dll/win32/netshell/lang/el-GR.rc index 8dd4faffbf7..a5d731b9fad 100644 --- a/reactos/dll/win32/netshell/lang/el-GR.rc +++ b/reactos/dll/win32/netshell/lang/el-GR.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/en-US.rc b/reactos/dll/win32/netshell/lang/en-US.rc index 73b3b2f9c83..b9e369ef61e 100644 --- a/reactos/dll/win32/netshell/lang/en-US.rc +++ b/reactos/dll/win32/netshell/lang/en-US.rc @@ -68,9 +68,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/es-ES.rc b/reactos/dll/win32/netshell/lang/es-ES.rc index ace64aaadb6..63af8a01ae3 100644 --- a/reactos/dll/win32/netshell/lang/es-ES.rc +++ b/reactos/dll/win32/netshell/lang/es-ES.rc @@ -62,9 +62,29 @@ BEGIN PUSHBUTTON "&Detalles...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Conexiones de red" IDS_SHV_COLUMN_NAME "Nombre" IDS_SHV_COLUMN_TYPE "Tipo" diff --git a/reactos/dll/win32/netshell/lang/fr-FR.rc b/reactos/dll/win32/netshell/lang/fr-FR.rc index 663ae61ac99..ddfda855668 100644 --- a/reactos/dll/win32/netshell/lang/fr-FR.rc +++ b/reactos/dll/win32/netshell/lang/fr-FR.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Détails...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/hu-HU.rc b/reactos/dll/win32/netshell/lang/hu-HU.rc index 8b228365f77..e4643445413 100644 --- a/reactos/dll/win32/netshell/lang/hu-HU.rc +++ b/reactos/dll/win32/netshell/lang/hu-HU.rc @@ -68,8 +68,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/id-ID.rc b/reactos/dll/win32/netshell/lang/id-ID.rc index 973dbe7137c..e555ac7ed95 100644 --- a/reactos/dll/win32/netshell/lang/id-ID.rc +++ b/reactos/dll/win32/netshell/lang/id-ID.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Detil...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/it-IT.rc b/reactos/dll/win32/netshell/lang/it-IT.rc index 131d1be17db..7dce9bfda50 100644 --- a/reactos/dll/win32/netshell/lang/it-IT.rc +++ b/reactos/dll/win32/netshell/lang/it-IT.rc @@ -72,9 +72,29 @@ BEGIN PUSHBUTTON "&Dettagli...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Connessione di rete" IDS_SHV_COLUMN_NAME "Nome" IDS_SHV_COLUMN_TYPE "Tipo" diff --git a/reactos/dll/win32/netshell/lang/ja-JP.rc b/reactos/dll/win32/netshell/lang/ja-JP.rc index fb2a60ff2d9..41586c80409 100644 --- a/reactos/dll/win32/netshell/lang/ja-JP.rc +++ b/reactos/dll/win32/netshell/lang/ja-JP.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/nl-NL.rc b/reactos/dll/win32/netshell/lang/nl-NL.rc index c4880bd0af6..e96a830aa85 100644 --- a/reactos/dll/win32/netshell/lang/nl-NL.rc +++ b/reactos/dll/win32/netshell/lang/nl-NL.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/no-NO.rc b/reactos/dll/win32/netshell/lang/no-NO.rc index a759863d6d1..3042245d057 100644 --- a/reactos/dll/win32/netshell/lang/no-NO.rc +++ b/reactos/dll/win32/netshell/lang/no-NO.rc @@ -71,9 +71,29 @@ BEGIN PUSHBUTTON "&Detaljer...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Nettverk tilkobling" IDS_SHV_COLUMN_NAME "Navn" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/pl-PL.rc b/reactos/dll/win32/netshell/lang/pl-PL.rc index bd09608632b..04eeae89095 100644 --- a/reactos/dll/win32/netshell/lang/pl-PL.rc +++ b/reactos/dll/win32/netshell/lang/pl-PL.rc @@ -21,7 +21,7 @@ END IDD_STATUS DIALOGEX DISCARDABLE 0, 0, 200, 280 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Properties" +CAPTION "W³aœciwoœci" FONT 8, "MS Shell Dlg" BEGIN END @@ -60,7 +60,7 @@ BEGIN LTEXT "Maska podsieci:", -1, 22, 48, 80, 8 LTEXT "Domyœlna brama:", -1, 22, 62, 80, 8 - RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 + RTEXT "n/d", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 @@ -68,8 +68,29 @@ BEGIN PUSHBUTTON "&Szczegó³y...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Po³¹czenie sieciowe" IDS_SHV_COLUMN_NAME "Nazwa" IDS_SHV_COLUMN_TYPE "Typ" @@ -97,8 +118,8 @@ BEGIN IDS_FORMAT_KBIT "%u KBit/s" IDS_FORMAT_MBIT "%u MBit/s" IDS_FORMAT_GBIT "%u GBit/s" - IDS_DURATION_DAY "%d Day %s" - IDS_DURATION_DAYS "%d Days %s" + IDS_DURATION_DAY "%d Dzieñ %s" + IDS_DURATION_DAYS "%d Dni %s" IDS_ASSIGNED_DHCP "Przydzielony przez DHCP" IDS_ASSIGNED_MANUAL "Ustawiony rêcznie" END diff --git a/reactos/dll/win32/netshell/lang/ru-RU.rc b/reactos/dll/win32/netshell/lang/ru-RU.rc index d9441d39f0e..80f2b34ed82 100644 --- a/reactos/dll/win32/netshell/lang/ru-RU.rc +++ b/reactos/dll/win32/netshell/lang/ru-RU.rc @@ -68,8 +68,29 @@ BEGIN PUSHBUTTON "&Äîïîëíèòåëüíî...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Ñåòåâûå ïîäêëþ÷åíèÿ" IDS_SHV_COLUMN_NAME "Èìÿ" IDS_SHV_COLUMN_TYPE "Òèï" diff --git a/reactos/dll/win32/netshell/lang/sk-SK.rc b/reactos/dll/win32/netshell/lang/sk-SK.rc index dfd73347535..11bb32ecdfd 100644 --- a/reactos/dll/win32/netshell/lang/sk-SK.rc +++ b/reactos/dll/win32/netshell/lang/sk-SK.rc @@ -73,8 +73,29 @@ BEGIN PUSHBUTTON "Po&drobnosti...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Názov" IDS_SHV_COLUMN_TYPE "Typ" diff --git a/reactos/dll/win32/netshell/lang/sv-SE.rc b/reactos/dll/win32/netshell/lang/sv-SE.rc index bff057fac09..db65eef9647 100644 --- a/reactos/dll/win32/netshell/lang/sv-SE.rc +++ b/reactos/dll/win32/netshell/lang/sv-SE.rc @@ -68,8 +68,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/uk-UA.rc b/reactos/dll/win32/netshell/lang/uk-UA.rc index faf3414c416..0a0eecbad2c 100644 --- a/reactos/dll/win32/netshell/lang/uk-UA.rc +++ b/reactos/dll/win32/netshell/lang/uk-UA.rc @@ -70,8 +70,29 @@ BEGIN PUSHBUTTON "&Ñêëàä...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lang/zh-CN.rc b/reactos/dll/win32/netshell/lang/zh-CN.rc index 284994f7cea..cb98d3d6ba5 100644 --- a/reactos/dll/win32/netshell/lang/zh-CN.rc +++ b/reactos/dll/win32/netshell/lang/zh-CN.rc @@ -67,8 +67,29 @@ BEGIN PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END +IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Network Connection Details" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 +END + STRINGTABLE DISCARDABLE BEGIN + IDS_PHYSICAL_ADDRESS "Physical Address" + IDS_IP_ADDRESS "IP Address" + IDS_SUBNET_MASK "Subnet Mask" + IDS_DEF_GATEWAY "Default Gateway" + IDS_DHCP_SERVER "DHCP Server" + IDS_LEASE_OBTAINED "Lease Obtained" + IDS_LEASE_EXPIRES "Lease Expires" + IDS_DNS_SERVERS "DNS Servers" + IDS_WINS_SERVERS "WINS Servers" + IDS_PROPERTY "Property" + IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connection" IDS_SHV_COLUMN_NAME "Name" IDS_SHV_COLUMN_TYPE "Type" diff --git a/reactos/dll/win32/netshell/lanstatusui.c b/reactos/dll/win32/netshell/lanstatusui.c index 24bb0289225..84f52f7a7ca 100644 --- a/reactos/dll/win32/netshell/lanstatusui.c +++ b/reactos/dll/win32/netshell/lanstatusui.c @@ -289,6 +289,199 @@ InitializeLANStatusUiDlg(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext) NcFreeNetconProperties(pProperties); } +VOID +InsertColumnToListView( + HWND hDlgCtrl, + UINT ResId, + UINT SubItem, + UINT Size) +{ + WCHAR szBuffer[200]; + LVCOLUMNW lc; + + if (!LoadStringW(netshell_hInstance, ResId, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + return; + + memset(&lc, 0, sizeof(LV_COLUMN) ); + lc.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT; + lc.iSubItem = SubItem; + lc.fmt = LVCFMT_FIXED_WIDTH; + lc.cx = Size; + lc.cchTextMax = wcslen(szBuffer); + lc.pszText = szBuffer; + + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, SubItem, (LPARAM)&lc); +} + +VOID +AddIPAddressToListView( + HWND hDlgCtrl, + PIP_ADDR_STRING pAddr, + INT Index) +{ + LVITEMW li; + PIP_ADDR_STRING pCur; + WCHAR szBuffer[100]; + UINT SubIndex; + + ZeroMemory(&li, sizeof(LVITEMW)); + li.mask = LVIF_TEXT; + li.iItem = Index; + pCur = pAddr; + SubIndex = 0; + + do + { + if (SubIndex) + { + ZeroMemory(&li, sizeof(LVITEMW)); + li.mask = LVIF_TEXT; + li.iItem = ListView_GetItemCount(hDlgCtrl); + li.iSubItem = 0; + li.pszText = L""; + li.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&li); + } + + if (MultiByteToWideChar(CP_ACP, 0, pCur->IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + { + li.pszText = szBuffer; + li.iSubItem = 1; + li.iItem = ListView_GetItemCount(hDlgCtrl); + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + } + SubIndex++; + pCur = pCur->Next; + }while(pCur && pCur->IpAddress.String[0]); +} + +INT +InsertItemToListView( + HWND hDlgCtrl, + UINT ResId) +{ + LVITEMW li; + WCHAR szBuffer[100]; + + ZeroMemory(&li, sizeof(LVITEMW)); + li.mask = LVIF_TEXT; + li.iItem = ListView_GetItemCount(hDlgCtrl); + if (LoadStringW(netshell_hInstance, IDS_PHYSICAL_ADDRESS, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + { + li.pszText = szBuffer; + return (INT)SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&li); + } + return -1; +} + + +INT_PTR +CALLBACK +LANStatusUiDetailsDlg( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam +) +{ + LANSTATUSUI_CONTEXT * pContext; + LVITEMW li; + WCHAR szBuffer[100]; + PIP_ADAPTER_INFO pAdapterInfo, pCurAdapter; + PIP_PER_ADAPTER_INFO pPerAdapter; + DWORD dwSize; + HWND hDlgCtrl; + + switch(uMsg) + { + case WM_INITDIALOG: + pContext = (LANSTATUSUI_CONTEXT*)lParam; + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_DETAILS); + InsertColumnToListView(hDlgCtrl, IDS_PROPERTY, 0, 80); + InsertColumnToListView(hDlgCtrl, IDS_VALUE, 0, 80); + + dwSize = 0; + pCurAdapter = NULL; + pAdapterInfo = NULL; + if (GetAdaptersInfo(NULL, &dwSize) == ERROR_BUFFER_OVERFLOW) + { + pAdapterInfo = (PIP_ADAPTER_INFO)CoTaskMemAlloc(dwSize); + if (pAdapterInfo) + { + if (GetAdaptersInfo(pAdapterInfo, &dwSize) == NO_ERROR) + { + pCurAdapter = pAdapterInfo; + while(pCurAdapter && pCurAdapter->Index != pContext->dwAdapterIndex) + pCurAdapter = pCurAdapter->Next; + + if(pCurAdapter->Index != pContext->dwAdapterIndex) + pCurAdapter = NULL; + } + } + } + + ZeroMemory(&li, sizeof(LVITEMW)); + li.mask = LVIF_TEXT; + li.iSubItem = 1; + li.pszText = szBuffer; + + if (pCurAdapter) + { + li.iItem = InsertItemToListView(hDlgCtrl, IDS_PHYSICAL_ADDRESS); + if (li.iItem >= 0) + if (MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pCurAdapter->Address, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + + li.iItem = InsertItemToListView(hDlgCtrl, IDS_IP_ADDRESS); + if (li.iItem >= 0) + if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->IpAddressList.IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + + li.iItem = InsertItemToListView(hDlgCtrl, IDS_SUBNET_MASK); + if (li.iItem >= 0) + if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->IpAddressList.IpMask.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + + li.iItem = InsertItemToListView(hDlgCtrl, IDS_DEF_GATEWAY); + if (li.iItem >= 0) + if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->DhcpServer.IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + +#if 0 + li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_OBTAINED); + li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_EXPIRES); +#endif + } + + dwSize = 0; + if (GetPerAdapterInfo(pContext->dwAdapterIndex, NULL, &dwSize) == ERROR_BUFFER_OVERFLOW) + { + pPerAdapter = (PIP_PER_ADAPTER_INFO)CoTaskMemAlloc(dwSize); + if (pPerAdapter) + { + if (GetPerAdapterInfo(pContext->dwAdapterIndex, pPerAdapter, &dwSize) == ERROR_SUCCESS) + { + li.iItem = InsertItemToListView(hDlgCtrl, IDS_DNS_SERVERS); + if (li.iItem >= 0) + AddIPAddressToListView(hDlgCtrl, &pPerAdapter->DnsServerList, li.iItem); + } + CoTaskMemFree(pPerAdapter); + } + } +#if 0 + if (pCurAdapter) + { + li.iItem = InsertItemToListView(hDlgCtrl, IDS_WINS_SERVERS); + AddIPAddressToListView(hDlgCtrl, &pCurAdapter->PrimaryWinsServer, li.iItem); + AddIPAddressToListView(hDlgCtrl, &pCurAdapter->SecondaryWinsServer, li.iItem+1); + } +#endif + CoTaskMemFree(pAdapterInfo); + break; + } + return FALSE; +} + INT_PTR CALLBACK LANStatusUiAdvancedDlg( @@ -334,8 +527,18 @@ LANStatusUiAdvancedDlg( THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); SendDlgItemMessageW(hwndDlg, IDC_DETAILSGATEWAY, WM_SETTEXT, 0, (LPARAM)szBuffer); - return TRUE; + case WM_COMMAND: + if (LOWORD(wParam) == IDC_DETAILS) + { + pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER); + if (pContext) + { + DialogBoxParamW(netshell_hInstance, MAKEINTRESOURCEW(IDD_LAN_NETSTATUSDETAILS), GetParent(hwndDlg), + LANStatusUiDetailsDlg, (LPARAM)pContext); + } + } + break; default: break; } diff --git a/reactos/dll/win32/netshell/netshell.rbuild b/reactos/dll/win32/netshell/netshell.rbuild index 474472e69ef..23440f88854 100644 --- a/reactos/dll/win32/netshell/netshell.rbuild +++ b/reactos/dll/win32/netshell/netshell.rbuild @@ -1,6 +1,6 @@ - + . 0x600 0x600 diff --git a/reactos/dll/win32/netshell/netshell.rc b/reactos/dll/win32/netshell/netshell.rc index 8723b30561b..e23580bc601 100644 --- a/reactos/dll/win32/netshell/netshell.rc +++ b/reactos/dll/win32/netshell/netshell.rc @@ -4,7 +4,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL - #define REACTOS_VERSION_DLL #define REACTOS_STR_FILE_DESCRIPTION "Shell for Network Connections\0" #define REACTOS_STR_INTERNAL_NAME "netshell.dll\0" diff --git a/reactos/dll/win32/netshell/resource.h b/reactos/dll/win32/netshell/resource.h index 03b8f27ee4a..d6a4dd69b1e 100644 --- a/reactos/dll/win32/netshell/resource.h +++ b/reactos/dll/win32/netshell/resource.h @@ -17,12 +17,12 @@ #define IDD_LAN_NETSTATUS 401 #define IDD_STATUS 402 #define IDD_LAN_NETSTATUSADVANCED 403 - +#define IDD_LAN_NETSTATUSDETAILS 404 /* dialog controls */ #define IDC_NETCARDNAME 1000 #define IDC_CONFIGURE 1001 -#define IDC_COMPONENTSLIST 2800 +#define IDC_COMPONENTSLIST 1002 #define IDC_INSTALL 1003 #define IDC_UNINSTALL 1004 #define IDC_PROPERTIES 1005 @@ -45,6 +45,7 @@ #define IDC_DETAILSGATEWAY 1203 #define IDC_DETAILS 1204 +#define IDC_CLOSE 1300 /* resource constants */ @@ -81,3 +82,15 @@ #define IDS_ASSIGNED_DHCP 10206 #define IDS_ASSIGNED_MANUAL 10207 +#define IDS_PHYSICAL_ADDRESS 10300 +#define IDS_IP_ADDRESS 10301 +#define IDS_SUBNET_MASK 10302 +#define IDS_DEF_GATEWAY 10303 +#define IDS_DHCP_SERVER 10304 +#define IDS_LEASE_OBTAINED 10305 +#define IDS_LEASE_EXPIRES 10306 +#define IDS_DNS_SERVERS 10307 +#define IDS_WINS_SERVERS 10308 +#define IDS_PROPERTY 10309 +#define IDS_VALUE 10310 + diff --git a/reactos/dll/win32/newdev/newdev.rbuild b/reactos/dll/win32/newdev/newdev.rbuild index 910f54260b4..d080d200889 100644 --- a/reactos/dll/win32/newdev/newdev.rbuild +++ b/reactos/dll/win32/newdev/newdev.rbuild @@ -1,6 +1,6 @@ . - + 0x0600 0x0501 newdev.c diff --git a/reactos/dll/win32/ntdsapi/ntdsapi.rbuild b/reactos/dll/win32/ntdsapi/ntdsapi.rbuild index ea1a3ac2b07..5b922872fe9 100644 --- a/reactos/dll/win32/ntdsapi/ntdsapi.rbuild +++ b/reactos/dll/win32/ntdsapi/ntdsapi.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/ntmarta/ntmarta.rbuild b/reactos/dll/win32/ntmarta/ntmarta.rbuild index bbe1ac33df6..3f3b2e893ae 100644 --- a/reactos/dll/win32/ntmarta/ntmarta.rbuild +++ b/reactos/dll/win32/ntmarta/ntmarta.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x600 diff --git a/reactos/dll/win32/objsel/objsel.rbuild b/reactos/dll/win32/objsel/objsel.rbuild index 18c6dbf05df..e5e0b17ea1b 100644 --- a/reactos/dll/win32/objsel/objsel.rbuild +++ b/reactos/dll/win32/objsel/objsel.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/odbc32/odbc32.rbuild b/reactos/dll/win32/odbc32/odbc32.rbuild index 4a968919a51..cddd6fa713c 100644 --- a/reactos/dll/win32/odbc32/odbc32.rbuild +++ b/reactos/dll/win32/odbc32/odbc32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/odbccp32/odbccp32.rbuild b/reactos/dll/win32/odbccp32/odbccp32.rbuild index f8d461c36a8..2e112681434 100644 --- a/reactos/dll/win32/odbccp32/odbccp32.rbuild +++ b/reactos/dll/win32/odbccp32/odbccp32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/ole32/ole32.rbuild b/reactos/dll/win32/ole32/ole32.rbuild index 47082efd6b3..37fa9b7faee 100644 --- a/reactos/dll/win32/ole32/ole32.rbuild +++ b/reactos/dll/win32/ole32/ole32.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/oleacc/oleacc.rbuild b/reactos/dll/win32/oleacc/oleacc.rbuild index 46b65e27095..6fc3183658e 100644 --- a/reactos/dll/win32/oleacc/oleacc.rbuild +++ b/reactos/dll/win32/oleacc/oleacc.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/oleaut32/oleaut32.rbuild b/reactos/dll/win32/oleaut32/oleaut32.rbuild index 83a0e2da883..4e37d00e9db 100644 --- a/reactos/dll/win32/oleaut32/oleaut32.rbuild +++ b/reactos/dll/win32/oleaut32/oleaut32.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/oledlg/oledlg.rbuild b/reactos/dll/win32/oledlg/oledlg.rbuild index 53fd2511cc9..ca987921f71 100644 --- a/reactos/dll/win32/oledlg/oledlg.rbuild +++ b/reactos/dll/win32/oledlg/oledlg.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/olepro32/olepro32.rbuild b/reactos/dll/win32/olepro32/olepro32.rbuild index 192485486c1..f14d281d911 100644 --- a/reactos/dll/win32/olepro32/olepro32.rbuild +++ b/reactos/dll/win32/olepro32/olepro32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/opengl32/opengl32.rbuild b/reactos/dll/win32/opengl32/opengl32.rbuild index b1ac66616d1..5471e4e9dab 100644 --- a/reactos/dll/win32/opengl32/opengl32.rbuild +++ b/reactos/dll/win32/opengl32/opengl32.rbuild @@ -1,5 +1,5 @@ - + ntdll kernel32 diff --git a/reactos/dll/win32/pdh/pdh.rbuild b/reactos/dll/win32/pdh/pdh.rbuild index 1a3e081e3d3..c1b30627257 100644 --- a/reactos/dll/win32/pdh/pdh.rbuild +++ b/reactos/dll/win32/pdh/pdh.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/powrprof/powrprof.rbuild b/reactos/dll/win32/powrprof/powrprof.rbuild index 1cea520825c..8425b685b1d 100644 --- a/reactos/dll/win32/powrprof/powrprof.rbuild +++ b/reactos/dll/win32/powrprof/powrprof.rbuild @@ -1,7 +1,7 @@ - + . 0x600 0x600 diff --git a/reactos/dll/win32/printui/printui.rbuild b/reactos/dll/win32/printui/printui.rbuild index de3560df3ac..216ec665db7 100644 --- a/reactos/dll/win32/printui/printui.rbuild +++ b/reactos/dll/win32/printui/printui.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/pstorec/pstorec.rbuild b/reactos/dll/win32/pstorec/pstorec.rbuild index ea4383dddd1..493a30f22df 100644 --- a/reactos/dll/win32/pstorec/pstorec.rbuild +++ b/reactos/dll/win32/pstorec/pstorec.rbuild @@ -1,5 +1,5 @@ - + . wine kernel32 diff --git a/reactos/dll/win32/rasapi32/rasapi32.rbuild b/reactos/dll/win32/rasapi32/rasapi32.rbuild index 67451d51c7b..d78b7e17979 100644 --- a/reactos/dll/win32/rasapi32/rasapi32.rbuild +++ b/reactos/dll/win32/rasapi32/rasapi32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/rasdlg/rasdlg.rbuild b/reactos/dll/win32/rasdlg/rasdlg.rbuild index 22759f66b03..6f31a16681f 100644 --- a/reactos/dll/win32/rasdlg/rasdlg.rbuild +++ b/reactos/dll/win32/rasdlg/rasdlg.rbuild @@ -1,5 +1,5 @@ - + . wine diff --git a/reactos/dll/win32/rasman/rasman.rbuild b/reactos/dll/win32/rasman/rasman.rbuild index 5f72da00a9d..5df7820ec03 100644 --- a/reactos/dll/win32/rasman/rasman.rbuild +++ b/reactos/dll/win32/rasman/rasman.rbuild @@ -1,5 +1,5 @@ - + . wine diff --git a/reactos/dll/win32/riched20/riched20.rbuild b/reactos/dll/win32/riched20/riched20.rbuild index 49bcba6bbb3..95c54845fdd 100644 --- a/reactos/dll/win32/riched20/riched20.rbuild +++ b/reactos/dll/win32/riched20/riched20.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/riched32/riched32.rbuild b/reactos/dll/win32/riched32/riched32.rbuild index 0b370e2af45..948f6ea43c5 100644 --- a/reactos/dll/win32/riched32/riched32.rbuild +++ b/reactos/dll/win32/riched32/riched32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild index 6265e7b9404..5ac1047c51f 100644 --- a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild +++ b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild @@ -1,6 +1,6 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/rsabase/rsabase.rbuild b/reactos/dll/win32/rsabase/rsabase.rbuild index 50d0c58b31d..a57bdcc262e 100644 --- a/reactos/dll/win32/rsabase/rsabase.rbuild +++ b/reactos/dll/win32/rsabase/rsabase.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/rsaenh/rsaenh.rbuild b/reactos/dll/win32/rsaenh/rsaenh.rbuild index e9805c06545..6b0446a00e4 100644 --- a/reactos/dll/win32/rsaenh/rsaenh.rbuild +++ b/reactos/dll/win32/rsaenh/rsaenh.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/samsrv/samsrv.rbuild b/reactos/dll/win32/samsrv/samsrv.rbuild index 44f8c06f6d9..fb0e46298a3 100644 --- a/reactos/dll/win32/samsrv/samsrv.rbuild +++ b/reactos/dll/win32/samsrv/samsrv.rbuild @@ -1,7 +1,7 @@ - + . ntdll kernel32 diff --git a/reactos/dll/win32/schannel/schannel.rbuild b/reactos/dll/win32/schannel/schannel.rbuild index 3a085816706..52251fe4619 100644 --- a/reactos/dll/win32/schannel/schannel.rbuild +++ b/reactos/dll/win32/schannel/schannel.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/sensapi/sensapi.rbuild b/reactos/dll/win32/sensapi/sensapi.rbuild index 0fd2ccb4355..e4cc7043caa 100644 --- a/reactos/dll/win32/sensapi/sensapi.rbuild +++ b/reactos/dll/win32/sensapi/sensapi.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/serialui/serialui.rbuild b/reactos/dll/win32/serialui/serialui.rbuild index 5d09b18436c..eb43bd52fea 100644 --- a/reactos/dll/win32/serialui/serialui.rbuild +++ b/reactos/dll/win32/serialui/serialui.rbuild @@ -1,5 +1,5 @@ - + . kernel32 user32 diff --git a/reactos/dll/win32/setupapi/setupapi.rbuild b/reactos/dll/win32/setupapi/setupapi.rbuild index 0a0301a917d..9f5a3ba20f0 100644 --- a/reactos/dll/win32/setupapi/setupapi.rbuild +++ b/reactos/dll/win32/setupapi/setupapi.rbuild @@ -1,7 +1,7 @@ - + . include/reactos/wine . diff --git a/reactos/dll/win32/sfc/sfc.rbuild b/reactos/dll/win32/sfc/sfc.rbuild index d3ad6561cb4..263c55ca301 100644 --- a/reactos/dll/win32/sfc/sfc.rbuild +++ b/reactos/dll/win32/sfc/sfc.rbuild @@ -1,5 +1,5 @@ - + . kernel32 sfc.c diff --git a/reactos/dll/win32/sfc_os/sfc_os.rbuild b/reactos/dll/win32/sfc_os/sfc_os.rbuild index 2e02263c20e..6cc89c87ae9 100644 --- a/reactos/dll/win32/sfc_os/sfc_os.rbuild +++ b/reactos/dll/win32/sfc_os/sfc_os.rbuild @@ -1,5 +1,5 @@ - + . kernel32 sfc_os.c diff --git a/reactos/dll/win32/shdocvw/shdocvw.rbuild b/reactos/dll/win32/shdocvw/shdocvw.rbuild index 0e8a337d0a7..5678ab47b69 100644 --- a/reactos/dll/win32/shdocvw/shdocvw.rbuild +++ b/reactos/dll/win32/shdocvw/shdocvw.rbuild @@ -1,6 +1,6 @@ - + . include/reactos/wine 0x600 diff --git a/reactos/dll/win32/shell32/cpanelfolder.c b/reactos/dll/win32/shell32/cpanelfolder.c deleted file mode 100644 index d96ba91746b..00000000000 --- a/reactos/dll/win32/shell32/cpanelfolder.c +++ /dev/null @@ -1,1373 +0,0 @@ -/* - * Control panel folder - * - * Copyright 2003 Martin Fuchs - * - * 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 - */ - - -#include - - -WINE_DEFAULT_DEBUG_CHANNEL(shell); - -/*********************************************************************** -* control panel implementation in shell namespace -*/ - -typedef struct { - const IShellFolder2Vtbl *lpVtbl; - LONG ref; - const IPersistFolder2Vtbl *lpVtblPersistFolder2; - const IShellExecuteHookWVtbl *lpVtblShellExecuteHookW; - const IShellExecuteHookAVtbl *lpVtblShellExecuteHookA; - const IContextMenu2Vtbl *lpVtblContextMenu; - IUnknown *pUnkOuter; /* used for aggregation */ - - /* both paths are parsible from the desktop */ - LPITEMIDLIST pidlRoot; /* absolute pidl */ - int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */ - LPCITEMIDLIST *apidl; - UINT cidl; -} ICPanelImpl, *LPICPanelImpl; - -static const IShellFolder2Vtbl vt_ShellFolder2; -static const IPersistFolder2Vtbl vt_PersistFolder2; -static const IShellExecuteHookWVtbl vt_ShellExecuteHookW; -static const IShellExecuteHookAVtbl vt_ShellExecuteHookA; -static const IContextMenu2Vtbl vt_ContextMenu; - -static LPICPanelImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface ) -{ - return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2)); -} - -static LPICPanelImpl __inline impl_from_IContextMenu( IContextMenu2 *iface ) -{ - return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblContextMenu)); -} - - -static LPICPanelImpl __inline impl_from_IShellExecuteHookW( IShellExecuteHookW *iface ) -{ - return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW)); -} - -static LPICPanelImpl __inline impl_from_IShellExecuteHookA( IShellExecuteHookA *iface ) -{ - return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA)); -} - - -/* - converts This to an interface pointer -*/ -#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) -#define _IShellFolder2_(This) (IShellFolder2*)&(This->lpVtbl) - -#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2) -#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2) -#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2) -#define _IShellExecuteHookW_(This) (IShellExecuteHookW*)&(This->lpVtblShellExecuteHookW) -#define _IShellExecuteHookA_(This) (IShellExecuteHookA*)&(This->lpVtblShellExecuteHookA) - - -/*********************************************************************** -* IShellFolder [ControlPanel] implementation -*/ - -static const shvheader ControlPanelSFHeader[] = { - {IDS_SHV_COLUMN8, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},/*FIXME*/ - {IDS_SHV_COLUMN9, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 200},/*FIXME*/ -}; - -#define CONROLPANELSHELLVIEWCOLUMNS 2 - -/************************************************************************** -* IControlPanel_Constructor -*/ -HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID * ppv) -{ - ICPanelImpl *sf; - - TRACE("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid(riid)); - - if (!ppv) - return E_POINTER; - if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown)) - return CLASS_E_NOAGGREGATION; - - sf = (ICPanelImpl *) LocalAlloc(LMEM_ZEROINIT, sizeof(ICPanelImpl)); - if (!sf) - return E_OUTOFMEMORY; - - sf->ref = 0; - sf->apidl = NULL; - sf->cidl = 0; - sf->lpVtbl = &vt_ShellFolder2; - sf->lpVtblPersistFolder2 = &vt_PersistFolder2; - sf->lpVtblShellExecuteHookW = &vt_ShellExecuteHookW; - sf->lpVtblShellExecuteHookA = &vt_ShellExecuteHookA; - sf->lpVtblContextMenu = &vt_ContextMenu; - sf->pidlRoot = _ILCreateControlPanel(); /* my qualified pidl */ - sf->pUnkOuter = pUnkOuter ? pUnkOuter : _IUnknown_ (sf); - - if (!SUCCEEDED(IUnknown_QueryInterface(_IUnknown_(sf), riid, ppv))) { - IUnknown_Release(_IUnknown_(sf)); - return E_NOINTERFACE; - } - - TRACE("--(%p)\n", sf); - return S_OK; -} - -/************************************************************************** - * ISF_ControlPanel_fnQueryInterface - * - * NOTES supports not IPersist/IPersistFolder - */ -static HRESULT WINAPI ISF_ControlPanel_fnQueryInterface(IShellFolder2 * iface, REFIID riid, LPVOID * ppvObject) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - TRACE("(%p)->(%s,%p)\n", This, shdebugstr_guid(riid), ppvObject); - - *ppvObject = NULL; - - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IShellFolder) || IsEqualIID(riid, &IID_IShellFolder2)) - *ppvObject = This; - else if (IsEqualIID(riid, &IID_IPersist) || - IsEqualIID(riid, &IID_IPersistFolder) || IsEqualIID(riid, &IID_IPersistFolder2)) - *ppvObject = _IPersistFolder2_(This); - else if (IsEqualIID(riid, &IID_IShellExecuteHookW)) - *ppvObject = _IShellExecuteHookW_(This); - else if (IsEqualIID(riid, &IID_IShellExecuteHookA)) - *ppvObject = _IShellExecuteHookA_(This); - - if (*ppvObject) { - IUnknown_AddRef((IUnknown *)(*ppvObject)); - TRACE("-- Interface:(%p)->(%p)\n", ppvObject, *ppvObject); - return S_OK; - } - TRACE("-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; -} - -static ULONG WINAPI ISF_ControlPanel_fnAddRef(IShellFolder2 * iface) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - ULONG refCount = InterlockedIncrement(&This->ref); - - TRACE("(%p)->(count=%u)\n", This, refCount - 1); - - return refCount; -} - -static ULONG WINAPI ISF_ControlPanel_fnRelease(IShellFolder2 * iface) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - ULONG refCount = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(count=%u)\n", This, refCount + 1); - - if (!refCount) { - TRACE("-- destroying IShellFolder(%p)\n", This); - SHFree(This->pidlRoot); - LocalFree((HLOCAL) This); - } - return refCount; -} - -/************************************************************************** -* ISF_ControlPanel_fnParseDisplayName -*/ -static HRESULT WINAPI -ISF_ControlPanel_fnParseDisplayName(IShellFolder2 * iface, - HWND hwndOwner, - LPBC pbc, - LPOLESTR lpszDisplayName, - DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - HRESULT hr = E_INVALIDARG; - - FIXME("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", - This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), pchEaten, ppidl, pdwAttributes); - - *ppidl = 0; - if (pchEaten) - *pchEaten = 0; - - TRACE("(%p)->(-- ret=0x%08x)\n", This, hr); - - return hr; -} - -static LPITEMIDLIST _ILCreateCPanelApplet(LPCSTR name, LPCSTR displayName, - LPCSTR comment, int iconIdx) -{ - PIDLCPanelStruct *p; - LPITEMIDLIST pidl; - PIDLDATA tmp; - int size0 = (char*)&tmp.u.cpanel.szName-(char*)&tmp.u.cpanel; - int size = size0; - int l; - - tmp.type = PT_CPLAPPLET; - tmp.u.cpanel.dummy = 0; - tmp.u.cpanel.iconIdx = iconIdx; - - l = strlen(name); - size += l+1; - - tmp.u.cpanel.offsDispName = l+1; - l = strlen(displayName); - size += l+1; - - tmp.u.cpanel.offsComment = tmp.u.cpanel.offsDispName+1+l; - l = strlen(comment); - size += l+1; - - pidl = SHAlloc(size+4); - if (!pidl) - return NULL; - - pidl->mkid.cb = size+2; - memcpy(pidl->mkid.abID, &tmp, 2+size0); - - p = &((PIDLDATA*)pidl->mkid.abID)->u.cpanel; - strcpy(p->szName, name); - strcpy(p->szName+tmp.u.cpanel.offsDispName, displayName); - strcpy(p->szName+tmp.u.cpanel.offsComment, comment); - - *(WORD*)((char*)pidl+(size+2)) = 0; - - pcheck(pidl); - - return pidl; -} - -/************************************************************************** - * _ILGetCPanelPointer() - * gets a pointer to the control panel struct stored in the pidl - */ -static PIDLCPanelStruct* _ILGetCPanelPointer(LPCITEMIDLIST pidl) -{ - LPPIDLDATA pdata = _ILGetDataPointer(pidl); - - if (pdata && pdata->type==PT_CPLAPPLET) - return (PIDLCPanelStruct*)&(pdata->u.cpanel); - - return NULL; -} - - /************************************************************************** - * ISF_ControlPanel_fnEnumObjects - */ -static BOOL SHELL_RegisterCPanelApp(IEnumIDList* list, LPCSTR path) -{ - LPITEMIDLIST pidl; - CPlApplet* applet; - CPanel panel; - CPLINFO info; - unsigned i; - int iconIdx; - - char displayName[MAX_PATH]; - char comment[MAX_PATH]; - - WCHAR wpath[MAX_PATH]; - - MultiByteToWideChar(CP_ACP, 0, path, -1, wpath, MAX_PATH); - - panel.first = NULL; - applet = Control_LoadApplet(0, wpath, &panel); - - if (applet) - { - for(i=0; icount; ++i) - { - WideCharToMultiByte(CP_ACP, 0, applet->info[i].szName, -1, displayName, MAX_PATH, 0, 0); - WideCharToMultiByte(CP_ACP, 0, applet->info[i].szInfo, -1, comment, MAX_PATH, 0, 0); - - applet->proc(0, CPL_INQUIRE, i, (LPARAM)&info); - - if (info.idIcon > 0) - iconIdx = -info.idIcon; /* negative icon index instead of icon number */ - else - iconIdx = 0; - - pidl = _ILCreateCPanelApplet(path, displayName, comment, iconIdx); - - if (pidl) - AddToEnumList(list, pidl); - } - Control_UnloadApplet(applet); - } - return TRUE; -} - -static int SHELL_RegisterRegistryCPanelApps(IEnumIDList* list, HKEY hkey_root, LPCSTR szRepPath) -{ - char name[MAX_PATH]; - char value[MAX_PATH]; - HKEY hkey; - - int cnt = 0; - - if (RegOpenKeyA(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS) - { - int idx = 0; - - for(;; ++idx) - { - DWORD nameLen = MAX_PATH; - DWORD valueLen = MAX_PATH; - - if (RegEnumValueA(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)&value, &valueLen) != ERROR_SUCCESS) - break; - - if (SHELL_RegisterCPanelApp(list, value)) - ++cnt; - } - RegCloseKey(hkey); - } - - return cnt; -} - -static int SHELL_RegisterCPanelFolders(IEnumIDList* list, HKEY hkey_root, LPCSTR szRepPath) -{ - char name[MAX_PATH]; - HKEY hkey; - - int cnt = 0; - - if (RegOpenKeyA(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS) - { - int idx = 0; - for(;; ++idx) - { - if (RegEnumKeyA(hkey, idx, name, MAX_PATH) != ERROR_SUCCESS) - break; - - if (*name == '{') - { - LPITEMIDLIST pidl = _ILCreateGuidFromStrA(name); - - if (pidl && AddToEnumList(list, pidl)) - ++cnt; - } - } - - RegCloseKey(hkey); - } - - return cnt; -} - -/************************************************************************** - * CreateCPanelEnumList() - */ -static BOOL CreateCPanelEnumList( - IEnumIDList * iface, - DWORD dwFlags) -{ - CHAR szPath[MAX_PATH]; - WIN32_FIND_DATAA wfd; - HANDLE hFile; - - TRACE("(%p)->(flags=0x%08x)\n", iface, dwFlags); - - /* enumerate control panel folders */ - if (dwFlags & SHCONTF_FOLDERS) - SHELL_RegisterCPanelFolders(iface, HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace"); - - /* enumerate the control panel applets */ - if (dwFlags & SHCONTF_NONFOLDERS) - { - LPSTR p; - - GetSystemDirectoryA(szPath, MAX_PATH); - p = PathAddBackslashA(szPath); - strcpy(p, "*.cpl"); - - TRACE("-- (%p)-> enumerate SHCONTF_NONFOLDERS of %s\n",iface,debugstr_a(szPath)); - hFile = FindFirstFileA(szPath, &wfd); - - if (hFile != INVALID_HANDLE_VALUE) - { - do - { - if (!(dwFlags & SHCONTF_INCLUDEHIDDEN) && (wfd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) - continue; - - if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - strcpy(p, wfd.cFileName); - SHELL_RegisterCPanelApp((IEnumIDList*)iface, szPath); - } - } while(FindNextFileA(hFile, &wfd)); - FindClose(hFile); - } - - SHELL_RegisterRegistryCPanelApps((IEnumIDList*)iface, HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); - SHELL_RegisterRegistryCPanelApps((IEnumIDList*)iface, HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); - } - return TRUE; -} - -/************************************************************************** -* ISF_ControlPanel_fnEnumObjects -*/ -static HRESULT WINAPI -ISF_ControlPanel_fnEnumObjects(IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - TRACE("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList); - - *ppEnumIDList = IEnumIDList_Constructor(); - if (*ppEnumIDList) - CreateCPanelEnumList(*ppEnumIDList, dwFlags); - - TRACE("--(%p)->(new ID List: %p)\n", This, *ppEnumIDList); - - return(*ppEnumIDList) ? S_OK : E_OUTOFMEMORY; -} - -/************************************************************************** -* ISF_ControlPanel_fnBindToObject -*/ -static HRESULT WINAPI -ISF_ControlPanel_fnBindToObject(IShellFolder2 * iface, LPCITEMIDLIST pidl, - LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut); - - return SHELL32_BindToChild(This->pidlRoot, NULL, pidl, riid, ppvOut); -} - -/************************************************************************** -* ISF_ControlPanel_fnBindToStorage -*/ -static HRESULT WINAPI -ISF_ControlPanel_fnBindToStorage(IShellFolder2 * iface, - LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut); - - *ppvOut = NULL; - return E_NOTIMPL; -} - -/************************************************************************** -* ISF_ControlPanel_fnCompareIDs -*/ - -static HRESULT WINAPI -ISF_ControlPanel_fnCompareIDs(IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - int nReturn; - - TRACE("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2); - nReturn = SHELL32_CompareIDs(_IShellFolder_(This), lParam, pidl1, pidl2); - TRACE("-- %i\n", nReturn); - return nReturn; -} - -/************************************************************************** -* ISF_ControlPanel_fnCreateViewObject -*/ -static HRESULT WINAPI -ISF_ControlPanel_fnCreateViewObject(IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - LPSHELLVIEW pShellView; - HRESULT hr = E_INVALIDARG; - - TRACE("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid(riid), ppvOut); - - if (ppvOut) { - *ppvOut = NULL; - - if (IsEqualIID(riid, &IID_IDropTarget)) { - WARN("IDropTarget not implemented\n"); - hr = E_NOTIMPL; - } else if (IsEqualIID(riid, &IID_IContextMenu)) { - WARN("IContextMenu not implemented\n"); - hr = E_NOTIMPL; - } else if (IsEqualIID(riid, &IID_IShellView)) { - pShellView = IShellView_Constructor((IShellFolder *) iface); - if (pShellView) { - hr = IShellView_QueryInterface(pShellView, riid, ppvOut); - IShellView_Release(pShellView); - } - } - } - TRACE("--(%p)->(interface=%p)\n", This, ppvOut); - return hr; -} - -/************************************************************************** -* ISF_ControlPanel_fnGetAttributesOf -*/ -static HRESULT WINAPI -ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - HRESULT hr = S_OK; - - TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", - This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); - - if (!rgfInOut) - return E_INVALIDARG; - if (cidl && !apidl) - return E_INVALIDARG; - - if (*rgfInOut == 0) - *rgfInOut = ~0; - - while(cidl > 0 && *apidl) { - pdump(*apidl); - SHELL32_GetItemAttributes(_IShellFolder_(This), *apidl, rgfInOut); - apidl++; - cidl--; - } - /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ - *rgfInOut &= ~SFGAO_VALIDATE; - - TRACE("-- result=0x%08x\n", *rgfInOut); - return hr; -} - -/************************************************************************** -* ISF_ControlPanel_fnGetUIObjectOf -* -* PARAMETERS -* HWND hwndOwner, //[in ] Parent window for any output -* UINT cidl, //[in ] array size -* LPCITEMIDLIST* apidl, //[in ] simple pidl array -* REFIID riid, //[in ] Requested Interface -* UINT* prgfInOut, //[ ] reserved -* LPVOID* ppvObject) //[out] Resulting Interface -* -*/ -static HRESULT WINAPI -ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 * iface, - HWND hwndOwner, - UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - LPITEMIDLIST pidl; - IUnknown *pObj = NULL; - HRESULT hr = E_INVALIDARG; - - TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", - This, hwndOwner, cidl, apidl, shdebugstr_guid(riid), prgfInOut, ppvOut); - - if (ppvOut) { - *ppvOut = NULL; - - if (IsEqualIID(riid, &IID_IContextMenu) &&(cidl >= 1)) { - pObj = (IUnknown*)(&This->lpVtblContextMenu); - This->apidl = apidl; - This->cidl = cidl; - IUnknown_AddRef(pObj); - } else if (IsEqualIID(riid, &IID_IDataObject) &&(cidl >= 1)) { - pObj = (LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl); - hr = S_OK; - } else if (IsEqualIID(riid, &IID_IExtractIconA) &&(cidl == 1)) { - pidl = ILCombine(This->pidlRoot, apidl[0]); - pObj = (LPUNKNOWN) IExtractIconA_Constructor(pidl); - SHFree(pidl); - hr = S_OK; - } else if (IsEqualIID(riid, &IID_IExtractIconW) &&(cidl == 1)) { - pidl = ILCombine(This->pidlRoot, apidl[0]); - pObj = (LPUNKNOWN) IExtractIconW_Constructor(pidl); - SHFree(pidl); - hr = S_OK; - } else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA)) - && (cidl == 1)) { - pidl = ILCombine(This->pidlRoot, apidl[0]); - hr = IShellLink_ConstructFromFile(NULL, riid, pidl,(LPVOID*)&pObj); - SHFree(pidl); - } else { - hr = E_NOINTERFACE; - } - - if (SUCCEEDED(hr) && !pObj) - hr = E_OUTOFMEMORY; - - *ppvOut = pObj; - } - TRACE("(%p)->hr=0x%08x\n", This, hr); - return hr; -} - -/************************************************************************** -* ISF_ControlPanel_fnGetDisplayNameOf -*/ -static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - CHAR szPath[MAX_PATH]; - WCHAR wszPath[MAX_PATH+1]; /* +1 for potential backslash */ - PIDLCPanelStruct* pcpanel; - - *szPath = '\0'; - - TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet); - pdump(pidl); - - if (!pidl || !strRet) - return E_INVALIDARG; - - pcpanel = _ILGetCPanelPointer(pidl); - - if (pcpanel) { - lstrcpyA(szPath, pcpanel->szName+pcpanel->offsDispName); - - if (!(dwFlags & SHGDN_FORPARSING)) - FIXME("retrieve display name from control panel app\n"); - } - /* take names of special folders only if it's only this folder */ - else if (_ILIsSpecialFolder(pidl)) { - BOOL bSimplePidl = _ILIsPidlSimple(pidl); - - if (bSimplePidl) { - _ILSimpleGetTextW(pidl, wszPath, MAX_PATH); /* append my own path */ - } else { - FIXME("special pidl\n"); - } - - if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) { /* go deeper if needed */ - int len = 0; - - PathAddBackslashW(wszPath); - len = wcslen(wszPath); - - if (!SUCCEEDED - (SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags, wszPath + len, MAX_PATH + 1 - len))) - return E_OUTOFMEMORY; - if (!WideCharToMultiByte(CP_ACP, 0, wszPath, -1, szPath, MAX_PATH, NULL, NULL)) - wszPath[0] = '\0'; - } else { - if (bSimplePidl) { - if (!WideCharToMultiByte(CP_ACP, 0, wszPath, -1, szPath, MAX_PATH, NULL, NULL)) - wszPath[0] = '\0'; - } - } - } - - strRet->uType = STRRET_CSTR; - lstrcpynA(strRet->u.cStr, szPath, MAX_PATH); - - TRACE("--(%p)->(%s)\n", This, szPath); - return S_OK; -} - -/************************************************************************** -* ISF_ControlPanel_fnSetNameOf -* Changes the name of a file object or subfolder, possibly changing its item -* identifier in the process. -* -* PARAMETERS -* HWND hwndOwner, //[in ] Owner window for output -* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change -* LPCOLESTR lpszName, //[in ] the items new display name -* DWORD dwFlags, //[in ] SHGNO formatting flags -* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned -*/ -static HRESULT WINAPI ISF_ControlPanel_fnSetNameOf(IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */ - LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - FIXME("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, hwndOwner, pidl, debugstr_w(lpName), dwFlags, pPidlOut); - return E_FAIL; -} - -static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultSearchGUID(IShellFolder2 * iface, GUID * pguid) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - FIXME("(%p)\n", This); - return E_NOTIMPL; -} -static HRESULT WINAPI ISF_ControlPanel_fnEnumSearches(IShellFolder2 * iface, IEnumExtraSearch ** ppenum) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - FIXME("(%p)\n", This); - return E_NOTIMPL; -} -static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumn(IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - TRACE("(%p)\n", This); - - if (pSort) *pSort = 0; - if (pDisplay) *pDisplay = 0; - return S_OK; -} -static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumnState(IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - TRACE("(%p)\n", This); - - if (!pcsFlags || iColumn >= CONROLPANELSHELLVIEWCOLUMNS) return E_INVALIDARG; - *pcsFlags = ControlPanelSFHeader[iColumn].pcsFlags; - return S_OK; -} -static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsEx(IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - FIXME("(%p)\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - HRESULT hr; - - TRACE("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); - - if (!psd || iColumn >= CONROLPANELSHELLVIEWCOLUMNS) - return E_INVALIDARG; - - if (!pidl) { - psd->fmt = ControlPanelSFHeader[iColumn].fmt; - psd->cxChar = ControlPanelSFHeader[iColumn].cxChar; - psd->str.uType = STRRET_CSTR; - LoadStringA(shell32_hInstance, ControlPanelSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH); - return S_OK; - } else { - psd->str.u.cStr[0] = 0x00; - psd->str.uType = STRRET_CSTR; - switch(iColumn) { - case 0: /* name */ - hr = IShellFolder_GetDisplayNameOf(iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str); - break; - case 1: /* comment */ - _ILGetFileType(pidl, psd->str.u.cStr, MAX_PATH); - break; - } - hr = S_OK; - } - - return hr; -} -static HRESULT WINAPI ISF_ControlPanel_fnMapColumnToSCID(IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - FIXME("(%p)\n", This); - return E_NOTIMPL; -} - -static const IShellFolder2Vtbl vt_ShellFolder2 = -{ - - ISF_ControlPanel_fnQueryInterface, - ISF_ControlPanel_fnAddRef, - ISF_ControlPanel_fnRelease, - ISF_ControlPanel_fnParseDisplayName, - ISF_ControlPanel_fnEnumObjects, - ISF_ControlPanel_fnBindToObject, - ISF_ControlPanel_fnBindToStorage, - ISF_ControlPanel_fnCompareIDs, - ISF_ControlPanel_fnCreateViewObject, - ISF_ControlPanel_fnGetAttributesOf, - ISF_ControlPanel_fnGetUIObjectOf, - ISF_ControlPanel_fnGetDisplayNameOf, - ISF_ControlPanel_fnSetNameOf, - - /* ShellFolder2 */ - ISF_ControlPanel_fnGetDefaultSearchGUID, - ISF_ControlPanel_fnEnumSearches, - ISF_ControlPanel_fnGetDefaultColumn, - ISF_ControlPanel_fnGetDefaultColumnState, - ISF_ControlPanel_fnGetDetailsEx, - ISF_ControlPanel_fnGetDetailsOf, - ISF_ControlPanel_fnMapColumnToSCID -}; - -/************************************************************************ - * ICPanel_PersistFolder2_QueryInterface - */ -static HRESULT WINAPI ICPanel_PersistFolder2_QueryInterface(IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObject) -{ - ICPanelImpl *This = impl_from_IPersistFolder2(iface); - - TRACE("(%p)\n", This); - - return IUnknown_QueryInterface(_IUnknown_(This), iid, ppvObject); -} - -/************************************************************************ - * ICPanel_PersistFolder2_AddRef - */ -static ULONG WINAPI ICPanel_PersistFolder2_AddRef(IPersistFolder2 * iface) -{ - ICPanelImpl *This = impl_from_IPersistFolder2(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_AddRef(_IUnknown_(This)); -} - -/************************************************************************ - * ISFPersistFolder_Release - */ -static ULONG WINAPI ICPanel_PersistFolder2_Release(IPersistFolder2 * iface) -{ - ICPanelImpl *This = impl_from_IPersistFolder2(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_Release(_IUnknown_(This)); -} - -/************************************************************************ - * ICPanel_PersistFolder2_GetClassID - */ -static HRESULT WINAPI ICPanel_PersistFolder2_GetClassID(IPersistFolder2 * iface, CLSID * lpClassId) -{ - ICPanelImpl *This = impl_from_IPersistFolder2(iface); - - TRACE("(%p)\n", This); - - if (!lpClassId) - return E_POINTER; - *lpClassId = CLSID_ControlPanel; - - return S_OK; -} - -/************************************************************************ - * ICPanel_PersistFolder2_Initialize - * - * NOTES: it makes no sense to change the pidl - */ -static HRESULT WINAPI ICPanel_PersistFolder2_Initialize(IPersistFolder2 * iface, LPCITEMIDLIST pidl) -{ - ICPanelImpl *This = impl_from_IPersistFolder2(iface); - if (This->pidlRoot) - SHFree((LPVOID)This->pidlRoot); - - This->pidlRoot = ILClone(pidl); - return S_OK; -} - -/************************************************************************** - * IPersistFolder2_fnGetCurFolder - */ -static HRESULT WINAPI ICPanel_PersistFolder2_GetCurFolder(IPersistFolder2 * iface, LPITEMIDLIST * pidl) -{ - ICPanelImpl *This = impl_from_IPersistFolder2(iface); - - TRACE("(%p)->(%p)\n", This, pidl); - - if (!pidl) - return E_POINTER; - *pidl = ILClone(This->pidlRoot); - return S_OK; -} - -static const IPersistFolder2Vtbl vt_PersistFolder2 = -{ - - ICPanel_PersistFolder2_QueryInterface, - ICPanel_PersistFolder2_AddRef, - ICPanel_PersistFolder2_Release, - ICPanel_PersistFolder2_GetClassID, - ICPanel_PersistFolder2_Initialize, - ICPanel_PersistFolder2_GetCurFolder -}; - -HRESULT CPanel_GetIconLocationW(LPCITEMIDLIST pidl, - LPWSTR szIconFile, UINT cchMax, int* piIndex) -{ - PIDLCPanelStruct* pcpanel = _ILGetCPanelPointer(pidl); - - if (!pcpanel) - return E_INVALIDARG; - - MultiByteToWideChar(CP_ACP, 0, pcpanel->szName, -1, szIconFile, cchMax); - *piIndex = pcpanel->iconIdx!=-1? pcpanel->iconIdx: 0; - - return S_OK; -} - - -/************************************************************************** -* IShellExecuteHookW Implementation -*/ - -static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface( - IShellExecuteHookW* iface, REFIID riid, void** ppvObject) -{ - ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject); -} - -static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnAddRef(IShellExecuteHookW* iface) -{ - ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_AddRef(This->pUnkOuter); -} - -static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnRelease(IShellExecuteHookW* iface) -{ - ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); - - TRACE("(%p)\n", This); - - return IUnknown_Release(This->pUnkOuter); -} - -HRESULT -ExecuteAppletFromCLSID(LPOLESTR pOleStr) -{ - WCHAR szCmd[MAX_PATH]; - WCHAR szExpCmd[MAX_PATH]; - PROCESS_INFORMATION pi; - STARTUPINFOW si; - WCHAR szBuffer[90] = { 'C', 'L', 'S', 'I', 'D', '\\', 0 }; - DWORD dwType, dwSize; - - wcscpy(&szBuffer[6], pOleStr); - wcscat(szBuffer, L"\\shell\\open\\command"); - - dwSize = sizeof(szCmd); - if (RegGetValueW(HKEY_CLASSES_ROOT, szBuffer, NULL, RRF_RT_REG_SZ, &dwType, (PVOID)szCmd, &dwSize) != ERROR_SUCCESS) - { - ERR("RegGetValueW failed with %u\n", GetLastError()); - return E_FAIL; - } - -#if 0 - if (dwType != RRF_RT_REG_SZ && dwType != RRF_RT_REG_EXPAND_SZ) - return E_FAIL; -#endif - - if (!ExpandEnvironmentStringsW(szCmd, szExpCmd, sizeof(szExpCmd)/sizeof(WCHAR))) - return E_FAIL; - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - if (!CreateProcessW(NULL, szExpCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - return E_FAIL; - - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - return S_OK; -} - - -static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW* iface, LPSHELLEXECUTEINFOW psei) -{ - static const WCHAR wCplopen[] = {'c','p','l','o','p','e','n','\0'}; - ICPanelImpl *This = (ICPanelImpl *)iface; - - SHELLEXECUTEINFOW sei_tmp; - PIDLCPanelStruct* pcpanel; - WCHAR path[MAX_PATH]; - WCHAR params[MAX_PATH]; - BOOL ret; - HRESULT hr; - int l; - - TRACE("(%p)->execute(%p)\n", This, psei); - - if (!psei) - return E_INVALIDARG; - - pcpanel = _ILGetCPanelPointer(ILFindLastID(psei->lpIDList)); - - if (!pcpanel) - { - LPOLESTR pOleStr; - - IID * iid = _ILGetGUIDPointer(ILFindLastID(psei->lpIDList)); - if (!iid) - return E_INVALIDARG; - if (StringFromCLSID(iid, &pOleStr) == S_OK) - { - - hr = ExecuteAppletFromCLSID(pOleStr); - CoTaskMemFree(pOleStr); - return hr; - } - - return E_INVALIDARG; - } - path[0] = '\"'; - /* Return value from MultiByteToWideChar includes terminating NUL, which - * compensates for the starting double quote we just put in */ - l = MultiByteToWideChar(CP_ACP, 0, pcpanel->szName, -1, path+1, MAX_PATH); - - /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */ - path[l++] = '"'; - path[l] = '\0'; - - MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, params, MAX_PATH); - - memcpy(&sei_tmp, psei, sizeof(sei_tmp)); - sei_tmp.lpFile = path; - sei_tmp.lpParameters = params; - sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; - sei_tmp.lpVerb = wCplopen; - - ret = ShellExecuteExW(&sei_tmp); - if (ret) - return S_OK; - else - return S_FALSE; -} - -static const IShellExecuteHookWVtbl vt_ShellExecuteHookW = -{ - - IShellExecuteHookW_fnQueryInterface, - IShellExecuteHookW_fnAddRef, - IShellExecuteHookW_fnRelease, - - IShellExecuteHookW_fnExecute -}; - - -/************************************************************************** -* IShellExecuteHookA Implementation -*/ - -static HRESULT WINAPI IShellExecuteHookA_fnQueryInterface(IShellExecuteHookA* iface, REFIID riid, void** ppvObject) -{ - ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject); -} - -static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnAddRef(IShellExecuteHookA* iface) -{ - ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_AddRef(This->pUnkOuter); -} - -static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnRelease(IShellExecuteHookA* iface) -{ - ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); - - TRACE("(%p)\n", This); - - return IUnknown_Release(This->pUnkOuter); -} - -static HRESULT WINAPI IShellExecuteHookA_fnExecute(IShellExecuteHookA* iface, LPSHELLEXECUTEINFOA psei) -{ - ICPanelImpl *This = (ICPanelImpl *)iface; - - SHELLEXECUTEINFOA sei_tmp; - PIDLCPanelStruct* pcpanel; - char path[MAX_PATH]; - BOOL ret; - - TRACE("(%p)->execute(%p)\n", This, psei); - - if (!psei) - return E_INVALIDARG; - - pcpanel = _ILGetCPanelPointer(ILFindLastID(psei->lpIDList)); - - if (!pcpanel) - return E_INVALIDARG; - - path[0] = '\"'; - lstrcpyA(path+1, pcpanel->szName); - - /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */ - lstrcatA(path, "\" "); - lstrcatA(path, pcpanel->szName+pcpanel->offsDispName); - - memcpy(&sei_tmp, psei, sizeof(sei_tmp)); - sei_tmp.lpFile = path; - sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; - - ret = ShellExecuteExA(&sei_tmp); - if (ret) - return S_OK; - else - return S_FALSE; -} - -static const IShellExecuteHookAVtbl vt_ShellExecuteHookA = -{ - IShellExecuteHookA_fnQueryInterface, - IShellExecuteHookA_fnAddRef, - IShellExecuteHookA_fnRelease, - IShellExecuteHookA_fnExecute -}; - -/************************************************************************** -* IContextMenu2 Implementation -*/ - -/************************************************************************ - * ICPanel_IContextMenu_QueryInterface - */ -static HRESULT WINAPI ICPanel_IContextMenu2_QueryInterface(IContextMenu2 * iface, REFIID iid, LPVOID * ppvObject) -{ - ICPanelImpl *This = impl_from_IContextMenu(iface); - - TRACE("(%p)\n", This); - - return IUnknown_QueryInterface(_IUnknown_(This), iid, ppvObject); -} - -/************************************************************************ - * ICPanel_IContextMenu_AddRef - */ -static ULONG WINAPI ICPanel_IContextMenu2_AddRef(IContextMenu2 * iface) -{ - ICPanelImpl *This = impl_from_IContextMenu(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_AddRef(_IUnknown_(This)); -} - -/************************************************************************ - * ICPanel_IContextMenu_Release - */ -static ULONG WINAPI ICPanel_IContextMenu2_Release(IContextMenu2 * iface) -{ - ICPanelImpl *This = impl_from_IContextMenu(iface); - - TRACE("(%p)->(count=%u)\n", This, This->ref); - - return IUnknown_Release(_IUnknown_(This)); -} - -/************************************************************************** -* ICPanel_IContextMenu_QueryContextMenu() -*/ -static HRESULT WINAPI ICPanel_IContextMenu2_QueryContextMenu( - IContextMenu2 *iface, - HMENU hMenu, - UINT indexMenu, - UINT idCmdFirst, - UINT idCmdLast, - UINT uFlags) -{ - WCHAR szBuffer[30] = {0}; - ULONG Count = 1; - - ICPanelImpl *This = impl_from_IContextMenu(iface); - - TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", - This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); - - if (LoadStringW(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) - { - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); - Count++; - } - - if (LoadStringW(shell32_hInstance, IDS_CREATELINK, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) - { - if (Count) - { - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_SEPARATOR, NULL, MFS_ENABLED); - } - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - - _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); - Count++; - } - return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count); -} - - -/************************************************************************** -* ICPanel_IContextMenu_InvokeCommand() -*/ -static HRESULT WINAPI ICPanel_IContextMenu2_InvokeCommand( - IContextMenu2 *iface, - LPCMINVOKECOMMANDINFO lpcmi) -{ - SHELLEXECUTEINFOW sei; - WCHAR szPath[MAX_PATH]; - char szTarget[MAX_PATH]; - STRRET strret; - WCHAR* pszPath; - INT Length, cLength; - PIDLCPanelStruct *pcpanel; - IPersistFile * ppf; - IShellLinkA * isl; - ICPanelImpl *This = impl_from_IContextMenu(iface); - - TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); - - if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) - { - ZeroMemory(&sei, sizeof(sei)); - sei.cbSize = sizeof(sei); - sei.fMask = SEE_MASK_INVOKEIDLIST; - sei.lpIDList = ILCombine(This->pidlRoot, This->apidl[0]); - sei.hwnd = lpcmi->hwnd; - sei.nShow = SW_SHOWNORMAL; - sei.lpVerb = L"open"; - ShellExecuteExW(&sei); - if (sei.hInstApp <= (HINSTANCE)32) - return E_FAIL; - } - else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2)) - { - if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_DESKTOPDIRECTORY, FALSE)) - return E_FAIL; - - pszPath = PathAddBackslashW(szPath); - if (!pszPath) - return E_FAIL; - - if (IShellFolder_GetDisplayNameOf((IShellFolder*)This, This->apidl[0], SHGDN_FORPARSING, &strret) != S_OK) - return E_FAIL; - - Length = MAX_PATH - (pszPath - szPath); - cLength = strlen(strret.u.cStr); - if (Length < cLength + 5) - { - FIXME("\n"); - return E_FAIL; - } - - if (MultiByteToWideChar(CP_ACP, 0, strret.u.cStr, cLength +1, pszPath, Length)) - { - pszPath += cLength; - Length -= cLength; - } - - if (Length > 10) - { - wcscpy(pszPath, L" - "); - cLength = LoadStringW(shell32_hInstance, IDS_LNK_FILE, &pszPath[3], Length -4) + 3; - if (cLength + 5 > Length) - cLength = Length - 5; - Length -= cLength; - pszPath += cLength; - } - wcscpy(pszPath, L".lnk"); - - pcpanel = _ILGetCPanelPointer(ILFindLastID(This->apidl[0])); - if (pcpanel) - { - strncpy(szTarget, pcpanel->szName, MAX_PATH); - } - else - { - FIXME("\n"); - return E_FAIL; - } - if (SUCCEEDED(IShellLink_Constructor(NULL, &IID_IShellLinkA, (LPVOID*)&isl))) - { - IShellLinkA_SetPath(isl, szTarget); - if (SUCCEEDED(IShellLinkA_QueryInterface(isl, &IID_IPersistFile, (LPVOID*)&ppf))) - { - IPersistFile_Save(ppf, szPath, TRUE); - IPersistFile_Release(ppf); - } - IShellLinkA_Release(isl); - } - return NOERROR; - } - return S_OK; -} - -/************************************************************************** - * ICPanel_IContextMenu_GetCommandString() - * - */ -static HRESULT WINAPI ICPanel_IContextMenu2_GetCommandString( - IContextMenu2 *iface, - UINT_PTR idCommand, - UINT uFlags, - UINT* lpReserved, - LPSTR lpszName, - UINT uMaxNameLen) -{ - ICPanelImpl *This = impl_from_IContextMenu(iface); - - TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); - - - FIXME("unknown command string\n"); - return E_FAIL; -} - - - -/************************************************************************** -* ICPanel_IContextMenu_HandleMenuMsg() -*/ -static HRESULT WINAPI ICPanel_IContextMenu2_HandleMenuMsg( - IContextMenu2 *iface, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - ICPanelImpl *This = impl_from_IContextMenu(iface); - - TRACE("ICPanel_IContextMenu_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",This, uMsg, wParam, lParam); - - return E_NOTIMPL; -} - -static const IContextMenu2Vtbl vt_ContextMenu = -{ - ICPanel_IContextMenu2_QueryInterface, - ICPanel_IContextMenu2_AddRef, - ICPanel_IContextMenu2_Release, - ICPanel_IContextMenu2_QueryContextMenu, - ICPanel_IContextMenu2_InvokeCommand, - ICPanel_IContextMenu2_GetCommandString, - ICPanel_IContextMenu2_HandleMenuMsg -}; - diff --git a/reactos/dll/win32/shell32/shell32.rbuild b/reactos/dll/win32/shell32/shell32.rbuild index d3eeeef2782..7bc769c32f4 100644 --- a/reactos/dll/win32/shell32/shell32.rbuild +++ b/reactos/dll/win32/shell32/shell32.rbuild @@ -1,6 +1,6 @@ - + . . include/reactos/wine diff --git a/reactos/dll/win32/shell32/shfldr_cpanel.c b/reactos/dll/win32/shell32/shfldr_cpanel.c index 6639b42c32e..066c99bdc0e 100644 --- a/reactos/dll/win32/shell32/shfldr_cpanel.c +++ b/reactos/dll/win32/shell32/shfldr_cpanel.c @@ -596,10 +596,14 @@ ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 * iface, *ppvOut = NULL; if (IsEqualIID(riid, &IID_IContextMenu) &&(cidl >= 1)) { + // TODO + // create a seperate item struct + // pObj = (IUnknown*)(&This->lpVtblContextMenu); This->apidl = apidl; This->cidl = cidl; IUnknown_AddRef(pObj); + hr = S_OK; } else if (IsEqualIID(riid, &IID_IDataObject) &&(cidl >= 1)) { pObj = (LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl); hr = S_OK; diff --git a/reactos/dll/win32/shfolder/shfolder.rbuild b/reactos/dll/win32/shfolder/shfolder.rbuild index 1d3aa77c526..2b08ca47d79 100644 --- a/reactos/dll/win32/shfolder/shfolder.rbuild +++ b/reactos/dll/win32/shfolder/shfolder.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/shimgvw/shimgvw.rbuild b/reactos/dll/win32/shimgvw/shimgvw.rbuild index 99e1d1364cc..07ff24d7d27 100644 --- a/reactos/dll/win32/shimgvw/shimgvw.rbuild +++ b/reactos/dll/win32/shimgvw/shimgvw.rbuild @@ -1,5 +1,5 @@ - + . kernel32 diff --git a/reactos/dll/win32/shlwapi/shlwapi.rbuild b/reactos/dll/win32/shlwapi/shlwapi.rbuild index cd9a166d915..2fda4a456b6 100644 --- a/reactos/dll/win32/shlwapi/shlwapi.rbuild +++ b/reactos/dll/win32/shlwapi/shlwapi.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/snmpapi/snmpapi.rbuild b/reactos/dll/win32/snmpapi/snmpapi.rbuild index e6ee0f88dc8..ad9960e078a 100644 --- a/reactos/dll/win32/snmpapi/snmpapi.rbuild +++ b/reactos/dll/win32/snmpapi/snmpapi.rbuild @@ -1,5 +1,5 @@ - + . ntdll diff --git a/reactos/dll/win32/stdole2.tlb/stdole2.rbuild b/reactos/dll/win32/stdole2.tlb/stdole2.rbuild index 4d9fd38f6bc..8d346b7cc78 100644 --- a/reactos/dll/win32/stdole2.tlb/stdole2.rbuild +++ b/reactos/dll/win32/stdole2.tlb/stdole2.rbuild @@ -9,7 +9,7 @@ std_ole_v2.idl - + . . include/reactos/wine diff --git a/reactos/dll/win32/stdole32.tlb/stdole32.rbuild b/reactos/dll/win32/stdole32.tlb/stdole32.rbuild index 137073c2f0b..fe379917cf8 100644 --- a/reactos/dll/win32/stdole32.tlb/stdole32.rbuild +++ b/reactos/dll/win32/stdole32.tlb/stdole32.rbuild @@ -9,7 +9,7 @@ std_ole_v1.idl - + . . include/reactos/wine diff --git a/reactos/dll/win32/sxs/sxs.rbuild b/reactos/dll/win32/sxs/sxs.rbuild index 7559626a809..e9d8e47ef50 100644 --- a/reactos/dll/win32/sxs/sxs.rbuild +++ b/reactos/dll/win32/sxs/sxs.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/tapi32/tapi32.rbuild b/reactos/dll/win32/tapi32/tapi32.rbuild index f1564856f9e..c4547d66036 100644 --- a/reactos/dll/win32/tapi32/tapi32.rbuild +++ b/reactos/dll/win32/tapi32/tapi32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/urlmon/urlmon.rbuild b/reactos/dll/win32/urlmon/urlmon.rbuild index 9493c102eed..710fb19a372 100644 --- a/reactos/dll/win32/urlmon/urlmon.rbuild +++ b/reactos/dll/win32/urlmon/urlmon.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/user32/user32.rbuild b/reactos/dll/win32/user32/user32.rbuild index 63c32e179af..1d78e98b001 100644 --- a/reactos/dll/win32/user32/user32.rbuild +++ b/reactos/dll/win32/user32/user32.rbuild @@ -1,5 +1,5 @@ - + . include include/reactos/subsys diff --git a/reactos/dll/win32/usp10/usp10.rbuild b/reactos/dll/win32/usp10/usp10.rbuild index cb7b18c0abb..6f2af469aa8 100644 --- a/reactos/dll/win32/usp10/usp10.rbuild +++ b/reactos/dll/win32/usp10/usp10.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/uxtheme/uxtheme.rbuild b/reactos/dll/win32/uxtheme/uxtheme.rbuild index 38b1f7b9c6b..a67bdaf8c4a 100644 --- a/reactos/dll/win32/uxtheme/uxtheme.rbuild +++ b/reactos/dll/win32/uxtheme/uxtheme.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/vdmdbg/vdmdbg.rbuild b/reactos/dll/win32/vdmdbg/vdmdbg.rbuild index 80e2434d146..8ccedce0b41 100644 --- a/reactos/dll/win32/vdmdbg/vdmdbg.rbuild +++ b/reactos/dll/win32/vdmdbg/vdmdbg.rbuild @@ -1,5 +1,5 @@ - + . ntdll kernel32 diff --git a/reactos/dll/win32/version/version.rbuild b/reactos/dll/win32/version/version.rbuild index 5ed46283e03..11a760fec56 100644 --- a/reactos/dll/win32/version/version.rbuild +++ b/reactos/dll/win32/version/version.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild b/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild index c9db2a8999c..dd285bf5cdf 100644 --- a/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild +++ b/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild @@ -1,5 +1,5 @@ - + . advapi32 diff --git a/reactos/dll/win32/winhttp/winhttp.rbuild b/reactos/dll/win32/winhttp/winhttp.rbuild index 5841090544c..923e4bd3d4d 100644 --- a/reactos/dll/win32/winhttp/winhttp.rbuild +++ b/reactos/dll/win32/winhttp/winhttp.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/wininet/wininet.rbuild b/reactos/dll/win32/wininet/wininet.rbuild index 29700bafdee..454c96e1f5c 100644 --- a/reactos/dll/win32/wininet/wininet.rbuild +++ b/reactos/dll/win32/wininet/wininet.rbuild @@ -3,7 +3,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/winmm/midimap/midimap.rbuild b/reactos/dll/win32/winmm/midimap/midimap.rbuild index 6573f5d48bf..bdeb0ee36c3 100644 --- a/reactos/dll/win32/winmm/midimap/midimap.rbuild +++ b/reactos/dll/win32/winmm/midimap/midimap.rbuild @@ -1,5 +1,5 @@ - + . include/wine 0x600 diff --git a/reactos/dll/win32/winmm/wavemap/wavemap.rbuild b/reactos/dll/win32/winmm/wavemap/wavemap.rbuild index c493f035482..16c62d48024 100644 --- a/reactos/dll/win32/winmm/wavemap/wavemap.rbuild +++ b/reactos/dll/win32/winmm/wavemap/wavemap.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/wine 0x600 diff --git a/reactos/dll/win32/winmm/winmm.rbuild b/reactos/dll/win32/winmm/winmm.rbuild index 59205881b1e..799805fee37 100644 --- a/reactos/dll/win32/winmm/winmm.rbuild +++ b/reactos/dll/win32/winmm/winmm.rbuild @@ -8,7 +8,7 @@ - + . include/reactos/wine 0x600 diff --git a/reactos/dll/win32/winspool/winspool.rbuild b/reactos/dll/win32/winspool/winspool.rbuild index c44d0bfad7c..beb41a4cd27 100644 --- a/reactos/dll/win32/winspool/winspool.rbuild +++ b/reactos/dll/win32/winspool/winspool.rbuild @@ -1,5 +1,5 @@ - + . ntdll diff --git a/reactos/dll/win32/wintrust/wintrust.rbuild b/reactos/dll/win32/wintrust/wintrust.rbuild index baa9b29f178..0cc4f790eb5 100644 --- a/reactos/dll/win32/wintrust/wintrust.rbuild +++ b/reactos/dll/win32/wintrust/wintrust.rbuild @@ -1,6 +1,6 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/wldap32/wldap32.rbuild b/reactos/dll/win32/wldap32/wldap32.rbuild index 2829f918105..ca149a87e25 100644 --- a/reactos/dll/win32/wldap32/wldap32.rbuild +++ b/reactos/dll/win32/wldap32/wldap32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/dll/win32/ws2_32/ws2_32.rbuild b/reactos/dll/win32/ws2_32/ws2_32.rbuild index 08d974ab554..639deae04ad 100644 --- a/reactos/dll/win32/ws2_32/ws2_32.rbuild +++ b/reactos/dll/win32/ws2_32/ws2_32.rbuild @@ -1,5 +1,5 @@ - + include include/reactos/wine diff --git a/reactos/dll/win32/wshtcpip/wshtcpip.rbuild b/reactos/dll/win32/wshtcpip/wshtcpip.rbuild index 6bf2724e9e7..dd64752960a 100644 --- a/reactos/dll/win32/wshtcpip/wshtcpip.rbuild +++ b/reactos/dll/win32/wshtcpip/wshtcpip.rbuild @@ -1,7 +1,7 @@ - + . ntdll kernel32 diff --git a/reactos/dll/win32/wtsapi32/wtsapi32.rbuild b/reactos/dll/win32/wtsapi32/wtsapi32.rbuild index 89b77a161b8..c0bb0125481 100644 --- a/reactos/dll/win32/wtsapi32/wtsapi32.rbuild +++ b/reactos/dll/win32/wtsapi32/wtsapi32.rbuild @@ -2,7 +2,7 @@ - + . include/reactos/wine diff --git a/reactos/drivers/base/bootvid/bootvid.rbuild b/reactos/drivers/base/bootvid/bootvid.rbuild index d1174a8b07c..bcf54dd0ff5 100644 --- a/reactos/drivers/base/bootvid/bootvid.rbuild +++ b/reactos/drivers/base/bootvid/bootvid.rbuild @@ -1,7 +1,7 @@ - + . ntoskrnl diff --git a/reactos/drivers/base/kdcom/kdcom.rbuild b/reactos/drivers/base/kdcom/kdcom.rbuild index 0a16e8b1f6c..180fc07bfb3 100644 --- a/reactos/drivers/base/kdcom/kdcom.rbuild +++ b/reactos/drivers/base/kdcom/kdcom.rbuild @@ -1,7 +1,7 @@ - + . ntoskrnl diff --git a/reactos/drivers/directx/dxapi/dxapi.rbuild b/reactos/drivers/directx/dxapi/dxapi.rbuild index 55dbdf266e9..8d6d446640e 100644 --- a/reactos/drivers/directx/dxapi/dxapi.rbuild +++ b/reactos/drivers/directx/dxapi/dxapi.rbuild @@ -2,7 +2,7 @@ - + . diff --git a/reactos/drivers/directx/dxg/dxg.rbuild b/reactos/drivers/directx/dxg/dxg.rbuild index 920183fa3b9..5747373114b 100644 --- a/reactos/drivers/directx/dxg/dxg.rbuild +++ b/reactos/drivers/directx/dxg/dxg.rbuild @@ -1,7 +1,7 @@ - + . include subsystems/win32/win32k/include diff --git a/reactos/drivers/directx/dxgthk/dxgthk.rbuild b/reactos/drivers/directx/dxgthk/dxgthk.rbuild index c69bce2e9c4..a7de8b79655 100644 --- a/reactos/drivers/directx/dxgthk/dxgthk.rbuild +++ b/reactos/drivers/directx/dxgthk/dxgthk.rbuild @@ -2,7 +2,7 @@ - + . win32k diff --git a/reactos/drivers/filesystems/fastfat/dirwr.c b/reactos/drivers/filesystems/fastfat/dirwr.c index c965a5201cc..c2f3168c0f5 100644 --- a/reactos/drivers/filesystems/fastfat/dirwr.c +++ b/reactos/drivers/filesystems/fastfat/dirwr.c @@ -478,7 +478,7 @@ FATAddEntry( if (RequestedOptions & FILE_DIRECTORY_FILE) { FileOffset.QuadPart = 0; - CcMapData((*Fcb)->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, TRUE, + CcPinRead((*Fcb)->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster, TRUE, &Context, (PVOID*)&pFatEntry); /* clear the new directory cluster */ RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster); diff --git a/reactos/drivers/ksfilter/ks/ks.rbuild b/reactos/drivers/ksfilter/ks/ks.rbuild index 4e9301005b3..e89c090aa31 100644 --- a/reactos/drivers/ksfilter/ks/ks.rbuild +++ b/reactos/drivers/ksfilter/ks/ks.rbuild @@ -4,7 +4,7 @@ . .. ../include - + ntoskrnl diff --git a/reactos/drivers/network/tcpip/tcpip.rbuild b/reactos/drivers/network/tcpip/tcpip.rbuild index 273f679de74..3919ba7a436 100644 --- a/reactos/drivers/network/tcpip/tcpip.rbuild +++ b/reactos/drivers/network/tcpip/tcpip.rbuild @@ -1,7 +1,7 @@ - + include include diff --git a/reactos/drivers/network/tcpip/tcpip/dispatch.c b/reactos/drivers/network/tcpip/tcpip/dispatch.c index 2b14914b82a..9962f4b0406 100644 --- a/reactos/drivers/network/tcpip/tcpip/dispatch.c +++ b/reactos/drivers/network/tcpip/tcpip/dispatch.c @@ -50,7 +50,7 @@ NTSTATUS DispPrepareIrpForCancel( TI_DbgPrint(DEBUG_IRP, ("Leaving (IRP was already cancelled).\n")); - return IRPFinish(Irp, STATUS_CANCELLED); + return Irp->IoStatus.Status; } VOID DispDataRequestComplete( @@ -384,16 +384,20 @@ NTSTATUS DispTdiConnect( /* Get associated connection endpoint file object. Quit if none exists */ + TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + TranContext = IrpSp->FileObject->FsContext; if (!TranContext) { TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } Connection = (PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext; if (!Connection) { TI_DbgPrint(MID_TRACE, ("No connection endpoint file object.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } Parameters = (PTDI_REQUEST_KERNEL)&IrpSp->Parameters; @@ -405,6 +409,14 @@ NTSTATUS DispTdiConnect( DispDataRequestComplete, Irp ); +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, 0); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + TI_DbgPrint(MAX_TRACE, ("TCP Connect returned %08x\n", Status)); return Status; @@ -523,18 +535,22 @@ NTSTATUS DispTdiListen( /* Get associated connection endpoint file object. Quit if none exists */ + TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + TranContext = IrpSp->FileObject->FsContext; if (TranContext == NULL) { TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } Connection = (PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext; if (Connection == NULL) { TI_DbgPrint(MID_TRACE, ("No connection endpoint file object.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } Parameters = (PTDI_REQUEST_KERNEL)&IrpSp->Parameters; @@ -588,6 +604,14 @@ NTSTATUS DispTdiListen( Irp ); } +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, 0); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + TI_DbgPrint(MID_TRACE,("Leaving %x\n", Status)); return Status; @@ -738,17 +762,21 @@ NTSTATUS DispTdiReceive( IrpSp = IoGetCurrentIrpStackLocation(Irp); ReceiveInfo = (PTDI_REQUEST_KERNEL_RECEIVE)&(IrpSp->Parameters); + TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + TranContext = IrpSp->FileObject->FsContext; if (TranContext == NULL) { TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } if (TranContext->Handle.ConnectionContext == NULL) { TI_DbgPrint(MID_TRACE, ("No connection endpoint file object.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } /* Initialize a receive request */ @@ -760,9 +788,6 @@ NTSTATUS DispTdiReceive( TI_DbgPrint(MID_TRACE,("TCPIP<<< Got an MDL: %x\n", Irp->MdlAddress)); if (NT_SUCCESS(Status)) { - /* Lock here so we're sure we've got the following 'mark pending' */ - TcpipRecursiveMutexEnter( &TCPLock, TRUE ); - Status = TCPReceiveData( TranContext->Handle.ConnectionContext, (PNDIS_BUFFER)Irp->MdlAddress, @@ -771,16 +796,16 @@ NTSTATUS DispTdiReceive( ReceiveInfo->ReceiveFlags, DispDataRequestComplete, Irp); - if (Status != STATUS_PENDING) - { - DispDataRequestComplete(Irp, Status, BytesReceived); - } else { - IoMarkIrpPending(Irp); - } - - TcpipRecursiveMutexLeave( &TCPLock ); } +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, BytesReceived); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status)); return Status; @@ -809,11 +834,14 @@ NTSTATUS DispTdiReceiveDatagram( IrpSp = IoGetCurrentIrpStackLocation(Irp); DgramInfo = (PTDI_REQUEST_KERNEL_RECEIVEDG)&(IrpSp->Parameters); + TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + TranContext = IrpSp->FileObject->FsContext; if (TranContext == NULL) { TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); - return STATUS_INVALID_ADDRESS; + Status = STATUS_INVALID_CONNECTION; + goto done; } /* Initialize a receive request */ @@ -846,12 +874,16 @@ NTSTATUS DispTdiReceiveDatagram( (PDATAGRAM_COMPLETION_ROUTINE)DispDataRequestComplete, Irp, Irp); - if (Status != STATUS_PENDING) { - DispDataRequestComplete(Irp, Status, BytesReceived); - } else - IoMarkIrpPending(Irp); } +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, BytesReceived); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status)); return Status; @@ -879,17 +911,21 @@ NTSTATUS DispTdiSend( IrpSp = IoGetCurrentIrpStackLocation(Irp); SendInfo = (PTDI_REQUEST_KERNEL_SEND)&(IrpSp->Parameters); + TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + TranContext = IrpSp->FileObject->FsContext; if (TranContext == NULL) { TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } if (TranContext->Handle.ConnectionContext == NULL) { TI_DbgPrint(MID_TRACE, ("No connection endpoint file object.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } Status = DispPrepareIrpForCancel( @@ -914,13 +950,16 @@ NTSTATUS DispTdiSend( SendInfo->SendFlags, DispDataRequestComplete, Irp); - if (Status != STATUS_PENDING) - { - DispDataRequestComplete(Irp, Status, BytesSent); - } else - IoMarkIrpPending( Irp ); } +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, BytesSent); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status)); return Status; @@ -947,7 +986,16 @@ NTSTATUS DispTdiSendDatagram( IrpSp = IoGetCurrentIrpStackLocation(Irp); DgramInfo = (PTDI_REQUEST_KERNEL_SENDDG)&(IrpSp->Parameters); + + TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + TranContext = IrpSp->FileObject->FsContext; + if (TranContext == NULL) + { + TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); + Status = STATUS_INVALID_CONNECTION; + goto done; + } /* Initialize a send request */ Request.Handle.AddressHandle = TranContext->Handle.AddressHandle; @@ -988,13 +1036,16 @@ NTSTATUS DispTdiSendDatagram( } else Status = STATUS_UNSUCCESSFUL; - - if (Status != STATUS_PENDING) { - DispDataRequestComplete(Irp, Status, Irp->IoStatus.Information); - } else - IoMarkIrpPending( Irp ); } +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, Irp->IoStatus.Information); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + TI_DbgPrint(DEBUG_IRP, ("Leaving.\n")); return Status; diff --git a/reactos/drivers/storage/class/class2/class2.rbuild b/reactos/drivers/storage/class/class2/class2.rbuild index 769ef89f2e9..48ea7b56920 100644 --- a/reactos/drivers/storage/class/class2/class2.rbuild +++ b/reactos/drivers/storage/class/class2/class2.rbuild @@ -2,7 +2,7 @@ - + ntoskrnl hal scsiport diff --git a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild index 0691c33b3cf..2941d0f52a3 100644 --- a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild +++ b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild @@ -1,7 +1,7 @@ - + ntoskrnl fdo.c miniport.c diff --git a/reactos/drivers/storage/port/diskdump/diskdump.rbuild b/reactos/drivers/storage/port/diskdump/diskdump.rbuild index 35ff83526e2..df39c1636b0 100644 --- a/reactos/drivers/storage/port/diskdump/diskdump.rbuild +++ b/reactos/drivers/storage/port/diskdump/diskdump.rbuild @@ -2,7 +2,7 @@ - + include/reactos/drivers ntoskrnl hal diff --git a/reactos/drivers/storage/scsiport/scsiport.pspec b/reactos/drivers/storage/scsiport/scsiport.pspec deleted file mode 100644 index 65c75471c4d..00000000000 --- a/reactos/drivers/storage/scsiport/scsiport.pspec +++ /dev/null @@ -1,51 +0,0 @@ -#ifdef __x86_64__ -#define MAYBEFWD(x) -#else -#define MAYBEFWD(x) x -#endif - -@ cdecl ScsiDebugPrint() -@ stdcall ScsiPortCompleteRequest(ptr long long long long) -@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long) -@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) MAYBEFWD(NTOSKRNL.RtlConvertUlongToLargeInteger) -@ stdcall ScsiPortFlushDma(ptr) -@ stdcall ScsiPortFreeDeviceBase(ptr ptr) -@ stdcall ScsiPortGetBusData(ptr long long long ptr long) -@ stdcall ScsiPortGetDeviceBase(ptr long long long long long long) -@ stdcall ScsiPortGetLogicalUnit(ptr long long long) -@ stdcall ScsiPortGetPhysicalAddress(ptr ptr ptr long) -@ stdcall ScsiPortGetSrb(ptr long long long long) -@ stdcall ScsiPortGetUncachedExtension(ptr ptr long) -@ stdcall ScsiPortGetVirtualAddress(ptr long long) -@ stdcall ScsiPortInitialize(ptr ptr ptr ptr) -@ stdcall ScsiPortIoMapTransfer(ptr ptr long long) -@ stdcall ScsiPortLogError(ptr ptr long long long long long) -@ stdcall ScsiPortMoveMemory(ptr ptr long) -@ cdecl ScsiPortNotification() -@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_UCHAR) -@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_USHORT) -@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_ULONG) -@ stdcall ScsiPortReadPortUchar(ptr) MAYBEFWD(HAL.READ_PORT_UCHAR) -@ stdcall ScsiPortReadPortUshort(ptr) MAYBEFWD(HAL.READ_PORT_USHORT) -@ stdcall ScsiPortReadPortUlong(ptr) MAYBEFWD(HAL.READ_PORT_ULONG) -@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_UCHAR) -@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_USHORT) -@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_ULONG) -@ stdcall ScsiPortReadRegisterUchar(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_UCHAR) -@ stdcall ScsiPortReadRegisterUshort(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_USHORT) -@ stdcall ScsiPortReadRegisterUlong(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_ULONG) -@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long) -@ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor -@ stdcall ScsiPortValidateRange(ptr long long long long long long) -@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_UCHAR) -@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_USHORT) -@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_ULONG) -@ stdcall ScsiPortWritePortUchar(ptr long) MAYBEFWD(HAL.WRITE_PORT_UCHAR) -@ stdcall ScsiPortWritePortUshort(ptr long) MAYBEFWD(HAL.WRITE_PORT_USHORT) -@ stdcall ScsiPortWritePortUlong(ptr long) MAYBEFWD(HAL.WRITE_PORT_ULONG) -@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR) -@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT) -@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG) -@ stdcall ScsiPortWriteRegisterUchar(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_UCHAR) -@ stdcall ScsiPortWriteRegisterUshort(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_USHORT) -@ stdcall ScsiPortWriteRegisterUlong(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_ULONG) diff --git a/reactos/drivers/storage/scsiport/scsiport.rbuild b/reactos/drivers/storage/scsiport/scsiport.rbuild index a389075c829..81a67633467 100644 --- a/reactos/drivers/storage/scsiport/scsiport.rbuild +++ b/reactos/drivers/storage/scsiport/scsiport.rbuild @@ -3,14 +3,11 @@ - + . ntoskrnl hal scsiport.c scsiport.rc - scsiport.pspec - - stubs.c - + scsiport.spec diff --git a/reactos/drivers/storage/scsiport/scsiport.spec b/reactos/drivers/storage/scsiport/scsiport.spec new file mode 100644 index 00000000000..b779b1ee557 --- /dev/null +++ b/reactos/drivers/storage/scsiport/scsiport.spec @@ -0,0 +1,45 @@ +@ cdecl ScsiDebugPrint() +@ stdcall ScsiPortCompleteRequest(ptr long long long long) +@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long) +@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) NTOSKRNL.RtlConvertUlongToLargeInteger +@ stdcall ScsiPortFlushDma(ptr) +@ stdcall ScsiPortFreeDeviceBase(ptr ptr) +@ stdcall ScsiPortGetBusData(ptr long long long ptr long) +@ stdcall ScsiPortGetDeviceBase(ptr long long long long long long) +@ stdcall ScsiPortGetLogicalUnit(ptr long long long) +@ stdcall ScsiPortGetPhysicalAddress(ptr ptr ptr long) +@ stdcall ScsiPortGetSrb(ptr long long long long) +@ stdcall ScsiPortGetUncachedExtension(ptr ptr long) +@ stdcall ScsiPortGetVirtualAddress(ptr long long) +@ stdcall ScsiPortInitialize(ptr ptr ptr ptr) +@ stdcall ScsiPortIoMapTransfer(ptr ptr long long) +@ stdcall ScsiPortLogError(ptr ptr long long long long long) +@ stdcall ScsiPortMoveMemory(ptr ptr long) +@ cdecl ScsiPortNotification() +@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) HAL.READ_PORT_BUFFER_UCHAR +@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT +@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) HAL.READ_PORT_BUFFER_ULONG +@ stdcall ScsiPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR +@ stdcall ScsiPortReadPortUshort(ptr) HAL.READ_PORT_USHORT +@ stdcall ScsiPortReadPortUlong(ptr) HAL.READ_PORT_ULONG +@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_UCHAR +@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT +@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_ULONG +@ stdcall ScsiPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR +@ stdcall ScsiPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT +@ stdcall ScsiPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG +@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long) +@ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor +@ stdcall ScsiPortValidateRange(ptr long long long long long long) +@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) HAL.WRITE_PORT_BUFFER_UCHAR +@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) HAL.WRITE_PORT_BUFFER_USHORT +@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) HAL.WRITE_PORT_BUFFER_ULONG +@ stdcall ScsiPortWritePortUchar(ptr long) HAL.WRITE_PORT_UCHAR +@ stdcall ScsiPortWritePortUshort(ptr long) HAL.WRITE_PORT_USHORT +@ stdcall ScsiPortWritePortUlong(ptr long) HAL.WRITE_PORT_ULONG +@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR +@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT +@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG +@ stdcall ScsiPortWriteRegisterUchar(ptr long) NTOSKRNL.WRITE_REGISTER_UCHAR +@ stdcall ScsiPortWriteRegisterUshort(ptr long) NTOSKRNL.WRITE_REGISTER_USHORT +@ stdcall ScsiPortWriteRegisterUlong(ptr long) NTOSKRNL.WRITE_REGISTER_ULONG diff --git a/reactos/drivers/storage/scsiport/stubs.c b/reactos/drivers/storage/scsiport/stubs.c deleted file mode 100644 index 9e286d186f4..00000000000 --- a/reactos/drivers/storage/scsiport/stubs.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Storage Stack - * FILE: drivers/storage/scsiport/stubs.c - * PURPOSE: SCSI port driver - * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) - */ - -/* INCLUDES *****************************************************************/ - -#include -#include - -#define NDEBUG -#include - -#ifdef _MSC_VER - #define DDKAPI -#endif - -SCSI_PHYSICAL_ADDRESS -DDKAPI -ScsiPortConvertUlongToPhysicalAddress( - IN ULONG UlongAddress) -{ - return RtlConvertUlongToLargeInteger(UlongAddress); -} - -VOID -DDKAPI -ScsiPortReadPortBufferUchar( - IN PUCHAR Port, - IN PUCHAR Buffer, - IN ULONG Count) -{ - READ_PORT_BUFFER_UCHAR(Port, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortReadPortBufferUshort( - IN PUSHORT Port, - IN PUSHORT Buffer, - IN ULONG Count) -{ - READ_PORT_BUFFER_USHORT(Port, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortReadPortBufferUlong( - IN PULONG Port, - IN PULONG Buffer, - IN ULONG Count) -{ - READ_PORT_BUFFER_ULONG(Port, Buffer, Count); -} - -UCHAR -DDKAPI -ScsiPortReadPortUchar( - IN PUCHAR Port) -{ - return READ_PORT_UCHAR(Port); -} - -USHORT -DDKAPI -ScsiPortReadPortUshort( - IN PUSHORT Port) -{ - return READ_PORT_USHORT(Port); -} - -ULONG -DDKAPI -ScsiPortReadPortUlong( - IN PULONG Port) -{ - return READ_PORT_ULONG(Port); -} - -VOID -DDKAPI -ScsiPortReadRegisterBufferUchar( - IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count) -{ - READ_REGISTER_BUFFER_UCHAR(Register, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortReadRegisterBufferUshort( - IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count) -{ - READ_REGISTER_BUFFER_USHORT(Register, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortReadRegisterBufferUlong( - IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count) -{ - READ_REGISTER_BUFFER_ULONG(Register, Buffer, Count); -} - -UCHAR -DDKAPI -ScsiPortReadRegisterUchar( - IN PUCHAR Register) -{ - return READ_REGISTER_UCHAR(Register); -} - -USHORT -DDKAPI -ScsiPortReadRegisterUshort( - IN PUSHORT Register) -{ - return READ_REGISTER_USHORT(Register); -} - -ULONG -DDKAPI -ScsiPortReadRegisterUlong( - IN PULONG Register) -{ - return READ_REGISTER_ULONG(Register); -} - -VOID -DDKAPI -ScsiPortWritePortBufferUchar( - IN PUCHAR Port, - IN PUCHAR Buffer, - IN ULONG Count) -{ - WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortWritePortBufferUshort( - IN PUSHORT Port, - IN PUSHORT Buffer, - IN ULONG Count) -{ - WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortWritePortBufferUlong( - IN PULONG Port, - IN PULONG Buffer, - IN ULONG Count) -{ - WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortWritePortUchar( - IN PUCHAR Port, - IN UCHAR Value) -{ - WRITE_PORT_UCHAR(Port, Value); -} - -VOID -DDKAPI -ScsiPortWritePortUshort( - IN PUSHORT Port, - IN USHORT Value) -{ - WRITE_PORT_USHORT(Port, Value); -} - -VOID -DDKAPI -ScsiPortWritePortUlong( - IN PULONG Port, - IN ULONG Value) -{ - WRITE_PORT_ULONG(Port, Value); -} - -VOID -DDKAPI -ScsiPortWriteRegisterBufferUchar( - IN PUCHAR Register, - IN PUCHAR Buffer, - IN ULONG Count) -{ - WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortWriteRegisterBufferUshort( - IN PUSHORT Register, - IN PUSHORT Buffer, - IN ULONG Count) -{ - WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortWriteRegisterBufferUlong( - IN PULONG Register, - IN PULONG Buffer, - IN ULONG Count) -{ - WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count); -} - -VOID -DDKAPI -ScsiPortWriteRegisterUchar( - IN PUCHAR Register, - IN ULONG Value) -{ - WRITE_REGISTER_UCHAR(Register, Value); -} - -VOID -DDKAPI -ScsiPortWriteRegisterUshort( - IN PUSHORT Register, - IN USHORT Value) -{ - WRITE_REGISTER_USHORT(Register, Value); -} - -VOID -DDKAPI -ScsiPortWriteRegisterUlong( - IN PULONG Register, - IN ULONG Value) -{ - WRITE_REGISTER_ULONG(Register, Value); -} - diff --git a/reactos/drivers/usb/usbd/usbd.rbuild b/reactos/drivers/usb/usbd/usbd.rbuild index 5a9f43661cf..1759f89e7a7 100644 --- a/reactos/drivers/usb/usbd/usbd.rbuild +++ b/reactos/drivers/usb/usbd/usbd.rbuild @@ -1,7 +1,7 @@ - + ntoskrnl hal usbd.c diff --git a/reactos/drivers/video/displays/framebuf/framebuf.rbuild b/reactos/drivers/video/displays/framebuf/framebuf.rbuild index cdadcab0007..8426b162842 100644 --- a/reactos/drivers/video/displays/framebuf/framebuf.rbuild +++ b/reactos/drivers/video/displays/framebuf/framebuf.rbuild @@ -1,7 +1,7 @@ - + . win32k libcntpr diff --git a/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild b/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild index 47c32ec3e4d..bfc08f00751 100644 --- a/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild +++ b/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild @@ -1,7 +1,7 @@ - + . win32k libcntpr diff --git a/reactos/drivers/video/displays/vga/vgaddi.rbuild b/reactos/drivers/video/displays/vga/vgaddi.rbuild index ca0d329f0e9..4166883f01d 100644 --- a/reactos/drivers/video/displays/vga/vgaddi.rbuild +++ b/reactos/drivers/video/displays/vga/vgaddi.rbuild @@ -1,7 +1,7 @@ - + . libcntpr win32k diff --git a/reactos/drivers/video/videoprt/videoprt.rbuild b/reactos/drivers/video/videoprt/videoprt.rbuild index 4555223509e..a2e1304098e 100644 --- a/reactos/drivers/video/videoprt/videoprt.rbuild +++ b/reactos/drivers/video/videoprt/videoprt.rbuild @@ -1,7 +1,7 @@ - + . include diff --git a/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild b/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild index 6f2fc9c06e2..fb4d99c3d9d 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild +++ b/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild @@ -8,7 +8,7 @@ -fno-rtti --> -Wno-non-virtual-dtor - + diff --git a/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild b/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild index beef05a26fb..ec0bf226283 100644 --- a/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild +++ b/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild @@ -4,7 +4,7 @@ . .. ../include - + ntoskrnl stubs.cpp diff --git a/reactos/drivers/wmi/wmilib.rbuild b/reactos/drivers/wmi/wmilib.rbuild index 27501ff536c..edfaa729329 100644 --- a/reactos/drivers/wmi/wmilib.rbuild +++ b/reactos/drivers/wmi/wmilib.rbuild @@ -1,7 +1,7 @@ - + . ntoskrnl wmilib.c diff --git a/reactos/hal/hal/hal.rbuild b/reactos/hal/hal/hal.rbuild index 8d7628a69b6..de3da9915b3 100644 --- a/reactos/hal/hal/hal.rbuild +++ b/reactos/hal/hal/hal.rbuild @@ -14,7 +14,7 @@ - + include ntoskrnl diff --git a/reactos/hal/hal/hal.spec b/reactos/hal/hal/hal.spec index 2d5ec886f52..b3ccd27b812 100644 --- a/reactos/hal/hal/hal.spec +++ b/reactos/hal/hal/hal.spec @@ -20,6 +20,7 @@ @ fastcall KfRaiseIrql(long) @ fastcall KfReleaseSpinLock(ptr long) + @ stdcall HalAcquireDisplayOwnership(ptr) @ stdcall HalAdjustResourceList(ptr) @ stdcall HalAllProcessorsStarted() diff --git a/reactos/hal/halarm/up/halup.rbuild b/reactos/hal/halarm/up/halup.rbuild index 1d13227b541..c2950733365 100644 --- a/reactos/hal/halarm/up/halup.rbuild +++ b/reactos/hal/halarm/up/halup.rbuild @@ -1,7 +1,7 @@ - + ../include include diff --git a/reactos/hal/halx86/halmp.rbuild b/reactos/hal/halx86/halmp.rbuild index 55954536167..724e7896531 100644 --- a/reactos/hal/halx86/halmp.rbuild +++ b/reactos/hal/halx86/halmp.rbuild @@ -2,7 +2,7 @@ - + include include diff --git a/reactos/hal/halx86/halup.rbuild b/reactos/hal/halx86/halup.rbuild index c588db52f8e..c206b7ed8a7 100644 --- a/reactos/hal/halx86/halup.rbuild +++ b/reactos/hal/halx86/halup.rbuild @@ -2,7 +2,7 @@ - + include include diff --git a/reactos/hal/halx86/halxbox.rbuild b/reactos/hal/halx86/halxbox.rbuild index 6dff278830f..923583a7e6a 100644 --- a/reactos/hal/halx86/halxbox.rbuild +++ b/reactos/hal/halx86/halxbox.rbuild @@ -2,7 +2,7 @@ - + include include diff --git a/reactos/include/ndk/asm.h b/reactos/include/ndk/asm.h index 39706d32b2f..c516a185709 100644 --- a/reactos/include/ndk/asm.h +++ b/reactos/include/ndk/asm.h @@ -222,6 +222,7 @@ Author: #define KPCR_PRCB_DPC_LAST_COUNT 0xA80 #define KPCR_PRCB_TIMER_REQUEST 0xA88 #define KPCR_PRCB_QUANTUM_END 0xAA1 +#define KPCR_PRCB_IDLE_SCHEDULE 0xAA3 #define KPCR_PRCB_DEFERRED_READY_LIST_HEAD 0xC10 #define KPCR_PRCB_POWER_STATE_IDLE_FUNCTION 0xEC0 diff --git a/reactos/include/ndk/extypes.h b/reactos/include/ndk/extypes.h index b6b69c09383..580e1bbb2f4 100644 --- a/reactos/include/ndk/extypes.h +++ b/reactos/include/ndk/extypes.h @@ -532,7 +532,7 @@ typedef struct _EPROFILE PKPROFILE ProfileObject; PVOID LockedBufferAddress; PMDL Mdl; - ULONG Segment; + PVOID Segment; KPROFILE_SOURCE ProfileSource; KAFFINITY Affinity; } EPROFILE, *PEPROFILE; diff --git a/reactos/include/ndk/i386/ketypes.h b/reactos/include/ndk/i386/ketypes.h index 8738d169a57..55e3454e75e 100644 --- a/reactos/include/ndk/i386/ketypes.h +++ b/reactos/include/ndk/i386/ketypes.h @@ -142,7 +142,11 @@ Author: #ifndef CONFIG_SMP #define SYNCH_LEVEL DISPATCH_LEVEL #else +#if (NTDDI_VERSION < NTDDI_WS03) #define SYNCH_LEVEL (IPI_LEVEL - 1) +#else +#define SYNCH_LEVEL (IPI_LEVEL - 2) +#endif #endif // diff --git a/reactos/include/ndk/ketypes.h b/reactos/include/ndk/ketypes.h index 48f50e37a50..8b4468ff64d 100644 --- a/reactos/include/ndk/ketypes.h +++ b/reactos/include/ndk/ketypes.h @@ -593,7 +593,7 @@ typedef struct _KPROFILE PVOID RangeLimit; ULONG BucketShift; PVOID Buffer; - ULONG Segment; + PVOID Segment; KAFFINITY Affinity; KPROFILE_SOURCE Source; BOOLEAN Started; diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index e3157a0b79b..475a23b4c90 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -1890,8 +1890,8 @@ BOOL WINAPI MakeAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL #define MakeProcInstance(p,i) (p) BOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD); VOID WINAPI MapGenericMask(PDWORD,PGENERIC_MAPPING); -PVOID WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,DWORD); -PVOID WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,PVOID); +PVOID WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,SIZE_T); +PVOID WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,SIZE_T,PVOID); BOOL WINAPI MoveFileA(LPCSTR,LPCSTR); BOOL WINAPI MoveFileExA(LPCSTR,LPCSTR,DWORD); BOOL WINAPI MoveFileExW(LPCWSTR,LPCWSTR,DWORD); diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index 963f6d76058..f220aa2939c 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -1060,6 +1060,26 @@ NtUserCreateWindowEx( DWORD dwShowMode, BOOL bUnicodeWindow, DWORD dwUnknown); +#if 0 +HWND +NTAPI +NtUserCreateWindowEx( + DWORD dwExStyle, + PLARGE_UNICODE_STRING plustrClassName, + PLARGE_UNICODE_STRING plustrClsVesrion, + PLARGE_UNICODE_STRING plustrWindowName, + DWORD dwStyle, + int x, + int y, + int nWidth, + int nHeight, + HWND hWndParent, + HMENU hMenu, + HINSTANCE hInstance, + LPVOID lpParam, + DWORD dwFlags, + PVOID acbiBuffer); +#endif HWINSTA NTAPI diff --git a/reactos/lib/debugsup/debugsup-ntos-amd64.def b/reactos/lib/debugsup/debugsup-ntos-amd64.def deleted file mode 100644 index 3b074271559..00000000000 --- a/reactos/lib/debugsup/debugsup-ntos-amd64.def +++ /dev/null @@ -1,10 +0,0 @@ -EXPORTS -DbgBreakPoint -DbgBreakPointWithStatus -DbgPrint -DbgPrompt -DbgPrintEx -RtlAssert -RtlUnwind -vDbgPrintExWithPrefix -;EOF diff --git a/reactos/lib/debugsup/debugsup-ntos-i386.def b/reactos/lib/debugsup/debugsup-ntos-i386.def deleted file mode 100644 index 323ead9580b..00000000000 --- a/reactos/lib/debugsup/debugsup-ntos-i386.def +++ /dev/null @@ -1,12 +0,0 @@ -;EOF -EXPORTS -DbgBreakPoint@0 -DbgBreakPointWithStatus@4 -DbgPrint -DbgPrompt@12 -DbgPrintEx -RtlAssert@16 -RtlUnwind@16 -vDbgPrintExWithPrefix - -;EOF diff --git a/reactos/lib/debugsup/debugsup-ntos.spec b/reactos/lib/debugsup/debugsup-ntos.spec new file mode 100644 index 00000000000..8814568092c --- /dev/null +++ b/reactos/lib/debugsup/debugsup-ntos.spec @@ -0,0 +1,8 @@ +@ stdcall DbgBreakPoint() +@ stdcall DbgBreakPointWithStatus(long) +@ varargs DbgPrint() +@ varargs DbgPrintEx() +@ stdcall DbgPrompt(ptr ptr long) +@ stdcall RtlAssert(ptr ptr long ptr) +@ stdcall RtlUnwind(ptr ptr ptr ptr) +@ stdcall vDbgPrintExWithPrefix(ptr long long ptr ptr) \ No newline at end of file diff --git a/reactos/lib/debugsup/debugsup.rbuild b/reactos/lib/debugsup/debugsup.rbuild index 8ffd7a7acb0..3e833c9b8fb 100644 --- a/reactos/lib/debugsup/debugsup.rbuild +++ b/reactos/lib/debugsup/debugsup.rbuild @@ -2,9 +2,9 @@ - + - + diff --git a/reactos/lib/rtl/actctx.c b/reactos/lib/rtl/actctx.c index 21b6753b299..f24ae51fad4 100644 --- a/reactos/lib/rtl/actctx.c +++ b/reactos/lib/rtl/actctx.c @@ -13,6 +13,8 @@ #define NDEBUG #include +#define QUERY_ACTCTX_FLAG_ACTIVE (0x00000001) + /* FUNCTIONS ***************************************************************/ VOID @@ -80,6 +82,22 @@ RtlQueryInformationActivationContext(DWORD dwFlags, return STATUS_NOT_IMPLEMENTED; } +NTSTATUS +NTAPI +RtlQueryInformationActiveActivationContext(ULONG ulInfoClass, + PVOID pvBuffer, + SIZE_T cbBuffer OPTIONAL, + SIZE_T *pcbWrittenOrRequired OPTIONAL) +{ + return RtlQueryInformationActivationContext(QUERY_ACTCTX_FLAG_ACTIVE, + NULL, + NULL, + ulInfoClass, + pvBuffer, + cbBuffer, + pcbWrittenOrRequired); +} + NTSTATUS NTAPI RtlZombifyActivationContext(PVOID Context) diff --git a/reactos/media/inf/NET_NIC.inf b/reactos/media/inf/NET_NIC.inf index 7721fc6c30496abf39c10ca5f453fa27aea6d7ca..c3122c08f6b3c65045087eb0e5628000c4bbffc4 100644 GIT binary patch delta 109 zcmX>lxK4P31v{g~ShI}BI$xs5sWni`fLkdGGg92Ez7$}~~kjsz= th`9XYx1LtN5t_@58A%g^I diff --git a/reactos/media/inf/cdrom.inf b/reactos/media/inf/cdrom.inf index 16bbcf5a4ec72ad7e04588c50ac12b33df8e1c9d..03a9da9844c3e98eff502740c6872d8b096b8f60 100644 GIT binary patch delta 65 zcmca1a7bvw3^ry9hSkbVFdn47SZp><1VDBhv*4 diff --git a/reactos/media/inf/cpu.inf b/reactos/media/inf/cpu.inf index 0d44ab23c02f4bbda18cbb35812b39720e476970..d07fe4c409e4b96a254120b782f93b21a6f97660 100644 GIT binary patch delta 178 zcmew*y-H!j2~I|f$$L4>C8jbTVBX5S4~P#kZ)V=ee3%fsuRm3``BZPBc?oEDhG3naeyv8EOEgG3vMbK(eu9b0uLwb zXk5{<`w4G9;Ziu4Hsnaq#f(iJMugWG68E_4;!sU-X6PC>cB*zL5itD^8fCG>l)AJy zEvZREY-x&4ZFAOnTYbM(q#~voMB{~T;)k2OpVg8lGyIl@Du#{J-@Lj;iq2g-1YaPg BUOfN+ delta 12 TcmbQIH&1iJJ^sycLI+p?Bd7%! diff --git a/reactos/media/inf/fdc.inf b/reactos/media/inf/fdc.inf index a9a5b7909b46a3a1f0395bcbbf268c091a4be46f..10f76c1ee0647826f5437590e74e213cf4f86199 100644 GIT binary patch delta 295 zcmcbo{z_-V8(v0>$&7;PN>iD4GjCF2=hATL(B>cQ>^Ln77tw`F|g0*cy*Onk)hNSHbSP`-|h;10!1h|zL6G2XsbY{qB z$YUsBC<4+s42cXWK)Q$_m7#dDBfmIf>g0<;nyT2lAT delta 12 TcmaE*b5DK48{W+o0-sm`Dy;?g diff --git a/reactos/media/inf/hdc.inf b/reactos/media/inf/hdc.inf index 03d7dc987ea12cfde5c7f5104a8617ef807d9904..55d774db7bb5fad693616a9f05c1627f5593ceb0 100644 GIT binary patch delta 439 zcmdmGxXEI}GC@X*$^XUF^`&{7zUyZ!%EBUgn)Zq5VK91%|B{Mxbc1;kEH0tR;ZKnZc7m0f=1~T!FL( z(B7TQ2Y^PO0a~$(c_YxuH9+1@=E)6WX6gt7LDDcyvyhZ2G4L{QO)eCcXEtC+1bKDx zIYBPne1;r`M1~ZGe1;;1REA=pMJYfUL}mhc$v|<4SSe6Ge=?(xsVcG#giRp5B@7Q4 z@_;%M8Hy%v6t{JB2I|fOiUM^a*^&q}9ZfY*1k<}fH%(>~j^#&FJ2_uiaq|*EF?Imm CyL6@i delta 12 TcmdmFvCDA7GQrJqq9W`7BAx_3 diff --git a/reactos/media/inf/keyboard.inf b/reactos/media/inf/keyboard.inf index 00826d8e10adb3df64dc4fde7ff34665adfaa49f..ae57c066c782fcf7f8d257aead08dcfee4afee9a 100644 GIT binary patch delta 212 zcmeyM_D^d=8b71OhydtvL73^nLV&G-qn(WA@$e0MSl{1h3r}|7Q`(%y&&2`&`j0-l delta 12 TcmeyT^+9bz8vo`JK`s^mCbk5s diff --git a/reactos/media/inf/machine.inf b/reactos/media/inf/machine.inf index c9692a04e11d33295b96180c5e3df5bd10ccab45..3c2e3c4cc3f670b7ebfd740d1af0220a95171134 100644 GIT binary patch delta 2124 zcmbVN-Aj{E7(eSki4+LsG&MVZ(qMCDjkWP zi=vAl$dn<`7rL^#@uEK=p_?wEqPuSD_ng;P-BSBN_P*~q=Xrj=-}7-EAAYe+Jlr&u z@3tJE)OkncefdVdme1r2-jC!fsl;o&GcPCQ3pp+4#by_X<2Y{HBFY$W;wt1|ctOCm5Y&=n$e?vY8R}upGkU5*hap4ivXscB> z=_aLOo5-fc$`Xs8yU)=qLSk6N#2}s_k-%?6e=89XLBztl!`Kgsi11Ul%hvEu z9zY0c|3wi6qF=;mdgp%1X~=dCiZIpzu*LB<`9iQ`wmAMSL02#M2eB6te$fN3 zAlli*73qI!gjyQu*z$-&jI5P`q{S&oJ-`~nCZ67MO~gOD)%(yd35)48>eNMEC;sJ z;i7VSKd{xsWL{j?ljuyRmJtU2fcA;v$@OL_Tz{p{{US_5U9Pgz&=Q9w=VGNg>D_Q` zS1vU+l{7aH1F~3fzeJ z1ndwn1}PQIqp@zggb&SjdsP$c5~vtQVx&IEodWxQ@fkRnD()-}BxWp%Y0|DLfA<;& z58nay<_H;4Po%L^>e$-tZW6B5V3~r96rf1-v$=g=x?oNXw?B6W3;zrOTofZ^efS!{ zwY$>N=DeikvDM1hbKu(?6KPF=Yc|wTNMGyJULS(vzzk2*nmx^NmFYR&b7%uE6Cu+p zHB?VIZJP_Z>0aN-rMbN) kFFn=f|0V}{pvzaUC^{1OgUx8gIvC4^UY_5{eE0RbUx=_3UjP6A delta 14 WcmbQUifPq*#tjm7o4cYXSpontt_Dm1 diff --git a/reactos/media/inf/msmouse.inf b/reactos/media/inf/msmouse.inf index 4e5ed0a88557228bc425f8cc0b0f4b758171a34e..5779b0340aa08ab7067644186bc3a84efbb7f073 100644 GIT binary patch delta 815 zcmah`ze_?<6h3m68Y-bd(9&xtS_XxNHYqd|K~`8xqo{)vS^k2Sg8qOA?$RhUv=kX8 zq!C)`QW^dW{R!3D(Dxpdujdetd(XY+eBXDzbKhgCaA+vbxD2y$z~-4RaExx1eiV5`5V|Oh9 zrxx3NJUy~)37E9V6vZe9S6NC)yLDK0gu|CpJ0XKkU8Nnx6_!xAC@j((g{5IMHl%fcxnylT-2a=Crip_d#M#7(24V1oN?zBA@e67s;-&xq delta 13 UcmZ3`#CR%ygNgd)E`wpm14E_whK$aTAWEpWSd2|J- zKxHKi4;k_pQWz2$iYDs|n_DBRQ2>gk0<|Xt4a@}^p2v_0WG4b~CQu{~D2Hr~AyB{g z^ Ch9yA& delta 12 TcmeyN-J`i-9sg!2!FwzKB;*AK diff --git a/reactos/media/inf/usb.inf b/reactos/media/inf/usb.inf index 4418f00db03fc5f14223b89055d6ec71df8341e0..a51d4d08fb6d41148cb3c0517a5b019c2caf932f 100644 GIT binary patch delta 106 zcmew$`AT|22`6LXWO*Ld$+I|x)KeJp8HyMbfH;xiEkhNM70M9I-~^;o8HyQ77#=dD T0A-3MpXUrDR_*3M&iTv$rI;Dq delta 12 TcmaDQ{Xud=3FqcKt{P?lC7=Z6 diff --git a/reactos/media/inf/usbport.inf b/reactos/media/inf/usbport.inf index b967fd17e89f30ace8c134428be75fb08e9ae13d..35db81d195ba8896d3785605745a759bfca3d015 100644 GIT binary patch delta 301 zcmcZ*^(AS;H#x?{$%c~ZljY>OJo6cH7!ny$81fm4fOIi~0+5{wB$F6Q!MtK1uZSTN zELO^p2V|9jMT&u{bAakJ7(y9>8Jrk2Cm$5m)OP{O7c&$9O)CbnO2De~fvO;C6o5L5 zfuawA=A;1i7ft3DbDV6az{Lr7#pKuWu}D0Bg;)`|9MBywlP2e=_yIMtP3BVM;fFY0 t0qlXd3{{g2<%K6t5pMw*ER03-KdNY$htQ`JG%69{{rWMkfFO delta 12 Tcmey8bRlZPH@VGH%29j(Ec^wX diff --git a/reactos/media/inf/usbstor.inf b/reactos/media/inf/usbstor.inf index 011b6cc6ee358de82d74494a797595b95d3342b1..8f0c0287eebcf6445b2052d5d3f08cf4d4b9632b 100644 GIT binary patch delta 132 zcmew)(w)h9x~)H yq%b5h6ixok9&U+CPYO`A0#H>BLoSd^2J-TNbS}_L5UYeCe{wvx=H@D{AItzVogXj& delta 12 TcmZpY|0J`ahHG;V_cvw$BFF_P diff --git a/reactos/ntoskrnl/config/cmdelay.c b/reactos/ntoskrnl/config/cmdelay.c index 4c181ae033b..c6c8a191f82 100644 --- a/reactos/ntoskrnl/config/cmdelay.c +++ b/reactos/ntoskrnl/config/cmdelay.c @@ -284,6 +284,8 @@ CmpDelayDerefKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb) LARGE_INTEGER Timeout; PCM_DELAY_DEREF_KCB_ITEM Entry; PAGED_CODE(); + CMTRACE(CM_REFERENCE_DEBUG, + "%s - Dereferencing KCB: %p\n", __FUNCTION__, Kcb); /* Get the previous reference count */ OldRefCount = *(PLONG)&Kcb->RefCount; diff --git a/reactos/ntoskrnl/config/i386/cmhardwr.c b/reactos/ntoskrnl/config/i386/cmhardwr.c index f89cbce224d..ac35483609a 100644 --- a/reactos/ntoskrnl/config/i386/cmhardwr.c +++ b/reactos/ntoskrnl/config/i386/cmhardwr.c @@ -232,7 +232,8 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc { UNICODE_STRING KeyName, ValueName, Data, SectionName; OBJECT_ATTRIBUTES ObjectAttributes; - ULONG HavePae, CacheSize, ViewSize, Length, TotalLength = 0, i, Disposition; + ULONG HavePae, CacheSize, Length, TotalLength = 0, i, Disposition; + SIZE_T ViewSize; NTSTATUS Status; HANDLE KeyHandle, BiosHandle, SystemHandle, FpuHandle, SectionHandle; CONFIGURATION_COMPONENT_DATA ConfigData; diff --git a/reactos/ntoskrnl/ex/profile.c b/reactos/ntoskrnl/ex/profile.c index d5dfce8937a..bec9a46e402 100644 --- a/reactos/ntoskrnl/ex/profile.c +++ b/reactos/ntoskrnl/ex/profile.c @@ -103,7 +103,8 @@ NtCreateProfile(OUT PHANDLE ProfileHandle, KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS Status = STATUS_SUCCESS; - ULONG Segment = 0, Log2 = 0; + ULONG Log2 = 0; + PVOID Segment = NULL; PAGED_CODE(); /* Easy way out */ @@ -116,7 +117,7 @@ NtCreateProfile(OUT PHANDLE ProfileHandle, if (BufferSize < sizeof(ULONG)) return STATUS_INVALID_PARAMETER_7; /* This will become a segmented profile object */ - Segment = (ULONG)RangeBase; + Segment = RangeBase; RangeBase = 0; /* Recalculate the bucket size */ diff --git a/reactos/ntoskrnl/ex/shutdown.c b/reactos/ntoskrnl/ex/shutdown.c index abf92ee2747..db8a92da48b 100644 --- a/reactos/ntoskrnl/ex/shutdown.c +++ b/reactos/ntoskrnl/ex/shutdown.c @@ -87,7 +87,7 @@ ShutdownThreadMain(PVOID Context) "Until then, there must be no regrets, no fears, no anxieties.\n" "Just go forward in all your beliefs, and prove to me that I am not mistaken in\n" "mine.\n", - "Lowest possible energy state reached! Switch off now to achive a Bose-Einstein\n" + "Lowest possible energy state reached! Switch off now to achieve a Bose-Einstein\n" "condensate.\n", "Hasta la vista, BABY!\n", "They live, we sleep!\n", diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 0b5a232cce3..ab2a2dd1413 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -325,6 +325,7 @@ C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DeferredReadyListHe C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PowerState) == KPCR_PRCB_POWER_STATE_IDLE_FUNCTION); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PrcbLock) == KPCR_PRCB_PRCB_LOCK); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcStack) == KPCR_PRCB_DPC_STACK); +C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, IdleSchedule) == KPCR_PRCB_IDLE_SCHEDULE); C_ASSERT(sizeof(FX_SAVE_AREA) == SIZEOF_FX_SAVE_AREA); /* Platform specific checks */ diff --git a/reactos/ntoskrnl/ke/arm/usercall.c b/reactos/ntoskrnl/ke/arm/usercall.c index 6d6997d1178..1621983c1c7 100644 --- a/reactos/ntoskrnl/ke/arm/usercall.c +++ b/reactos/ntoskrnl/ke/arm/usercall.c @@ -148,7 +148,7 @@ KiSystemService(IN PKTHREAD Thread, // Check how many arguments this system call takes // ArgumentCount = DescriptorTable->Number[Number] / 4; - ASSERT(ArgumentCount <= 20); + ASSERT(ArgumentCount <= 17); // // Copy the register-arguments first diff --git a/reactos/ntoskrnl/ke/i386/ctxswitch.S b/reactos/ntoskrnl/ke/i386/ctxswitch.S index 940cb6331a6..e54649c33af 100644 --- a/reactos/ntoskrnl/ke/i386/ctxswitch.S +++ b/reactos/ntoskrnl/ke/i386/ctxswitch.S @@ -13,6 +13,7 @@ #include .intel_syntax noprefix +#define Ready 1 #define Running 2 #define WrDispatchInt 0x1F @@ -349,7 +350,7 @@ BadThread: #ifdef CONFIG_SMP GetSwapLock: /* Acquire the swap lock */ - cmp [esi+KTHREAD_SWAP_BUSY], 0 + cmp byte ptr [esi+KTHREAD_SWAP_BUSY], 0 jz NotBusy pause jmp GetSwapLock @@ -562,6 +563,16 @@ NewCr0: mov cr0, ecx jmp StackOk +#ifdef CONFIG_SMP +NpxLoaded: + + /* FIXME: TODO */ + int 3 + + /* Jump back */ + jmp SetStack +#endif + WmiTrace: /* No WMI support yet */ @@ -705,8 +716,7 @@ CheckSchedule: #ifdef CONFIG_SMP /* There is, raise IRQL to synch level */ - mov ecx, SYNCH_LEVEL - call @KfRaiseIrql@4 + call _KeRaiseIrqlToSynchLevel@0 #endif sti @@ -716,7 +726,7 @@ CheckSchedule: mov byte ptr [edi+KTHREAD_SWAP_BUSY], 1 /* Acquire the PRCB Lock */ - lock bts [ebx+KPCR_PRCB_PRCB_LOCK], 0 + lock bts dword ptr [ebx+KPCR_PRCB_PRCB_LOCK], 0 jnb CheckNext lea ecx, [ebx+KPCR_PRCB_PRCB_LOCK] call @KefAcquireSpinLockAtDpcLevel@4 @@ -740,7 +750,7 @@ CheckNext: #ifdef CONFIG_SMP /* Disable the idle scheduler and release the PRCB lock */ and byte ptr [ebx+KPCR_PRCB_IDLE_SCHEDULE], 0 - and [ebx+KPCR_PRCB_PRCB_LOCK], 0 + and dword ptr [ebx+KPCR_PRCB_PRCB_LOCK], 0 #endif SwapContext: @@ -773,7 +783,7 @@ NoNextThread: jz CpuIdle /* It is, so call the scheduler */ - lea ecx, [ebx+KPCR_PRCBDATA] + lea ecx, [ebx+KPCR_PRCB_DATA] call @KiIdleSchedule@4 test eax, eax diff --git a/reactos/ntoskrnl/ke/i386/trap.s b/reactos/ntoskrnl/ke/i386/trap.s index 2f3aec94e87..d438650c2f3 100644 --- a/reactos/ntoskrnl/ke/i386/trap.s +++ b/reactos/ntoskrnl/ke/i386/trap.s @@ -2455,9 +2455,20 @@ CheckQuantum: mov edi, [ebx+KPCR_CURRENT_THREAD] #ifdef CONFIG_SMP - #error SMP Interrupt not handled! + /* Raise to synch level */ + call _KeRaiseIrqlToSynchLevel@0 + + /* Set context swap busy */ + mov byte ptr [edi+KTHREAD_SWAP_BUSY], 1 + + /* Acquire the PRCB Lock */ + lock bts dword ptr [ebx+KPCR_PRCB_PRCB_LOCK], 0 + jnb GetNext + lea ecx, [ebx+KPCR_PRCB_PRCB_LOCK] + call @KefAcquireSpinLockAtDpcLevel@4 #endif +GetNext: /* Get the next thread and clear it */ mov esi, [ebx+KPCR_PRCB_NEXT_THREAD] and dword ptr [ebx+KPCR_PRCB_NEXT_THREAD], 0 @@ -2476,6 +2487,12 @@ CheckQuantum: mov cl, APC_LEVEL call @KiSwapContextInternal@0 +#ifdef CONFIG_SMP + /* Lower IRQL back to dispatch */ + mov cl, DISPATCH_LEVEL + call @KfLowerIrql@4 +#endif + /* Restore registers */ mov ebp, [esp+0] mov edi, [esp+4] @@ -2617,7 +2634,7 @@ SpuriousInt: #ifdef CONFIG_SMP IntSpin: - SPIN_ON_LOCK esi, GetIntLock + SPIN_ON_LOCK(esi, GetIntLock) #endif IsrTimeout: diff --git a/reactos/ntoskrnl/ke/i386/v86vdm.c b/reactos/ntoskrnl/ke/i386/v86vdm.c index 71014a3dfcb..0a9a1da5e95 100644 --- a/reactos/ntoskrnl/ke/i386/v86vdm.c +++ b/reactos/ntoskrnl/ke/i386/v86vdm.c @@ -86,8 +86,8 @@ Ke386CallBios(IN ULONG Int, KeSetSystemAffinityThread(1); /* Make sure there's space for two IOPMs, then copy & clear the current */ - //ASSERT(((PKGDTENTRY)&KeGetPcr()->GDT[KGDT_TSS / 8])->LimitLow >= - // (0x2000 + IOPM_OFFSET - 1)); + ASSERT(((PKIPCR)KeGetPcr())->GDT[KGDT_TSS / 8].LimitLow >= + (0x2000 + IOPM_OFFSET - 1)); RtlCopyMemory(Ki386IopmSaveArea, &Tss->IoMaps[0].IoMap, PAGE_SIZE * 2); RtlZeroMemory(&Tss->IoMaps[0].IoMap, PAGE_SIZE * 2); diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index 6e16934f4c7..fe0109bb631 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -2,7 +2,7 @@ - + @@ -483,6 +483,7 @@ wmi.c ntoskrnl.rc + ntoskrnl.spec ntoskrnl_$(ARCH).lnk diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index ab039c94e7f..2387103809a 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -2,7 +2,7 @@ - + diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.def b/reactos/ntoskrnl/ntoskrnl_amd64.def deleted file mode 100644 index e69168fa2cd..00000000000 --- a/reactos/ntoskrnl/ntoskrnl_amd64.def +++ /dev/null @@ -1,1516 +0,0 @@ -; reactos/ntoskrnl/ntoskrnl.def -; -; ReactOS Operating System -; -EXPORTS -; -CcCanIWrite -CcCopyRead -CcCopyWrite -CcDeferWrite -CcFastCopyRead -CcFastCopyWrite -CcFastMdlReadWait -CcFastReadNotPossible -CcFastReadWait -CcFlushCache -CcGetDirtyPages -CcGetFileObjectFromBcb -CcGetFileObjectFromSectionPtrs -CcGetFlushedValidData -CcGetLsnForFileObject -CcInitializeCacheMap -CcIsThereDirtyData -CcMapData -CcMdlRead -CcMdlReadComplete -CcMdlWriteAbort -CcMdlWriteComplete -CcPinMappedData -CcPinRead -CcPrepareMdlWrite -CcPreparePinWrite -CcPurgeCacheSection -CcRemapBcb -CcRepinBcb -CcScheduleReadAhead -CcSetAdditionalCacheAttributes -CcSetBcbOwnerPointer -CcSetDirtyPageThreshold -CcSetDirtyPinnedData -CcSetFileSizes -CcSetLogHandleForFile -CcSetReadAheadGranularity -CcUninitializeCacheMap -CcUnpinData -CcUnpinDataForThread -CcUnpinRepinnedBcb -CcWaitForCurrentLazyWriterActivity -CcZeroData -CmRegisterCallback -CmUnRegisterCallback -DbgBreakPoint -DbgBreakPointWithStatus -DbgCommandString -DbgLoadImageSymbols -DbgPrint -DbgPrintEx -DbgPrintReturnControlC -DbgPrompt -DbgQueryDebugFilterState -DbgSetDebugFilterState -ExAcquireFastMutex -ExAcquireFastMutexUnsafe -ExAcquireResourceExclusiveLite -ExAcquireResourceSharedLite -ExAcquireRundownProtection -ExAcquireRundownProtectionCacheAware -ExAcquireRundownProtectionCacheAwareEx -ExAcquireRundownProtectionEx -ExAcquireSharedStarveExclusive -ExAcquireSharedWaitForExclusive -ExAllocateCacheAwareRundownProtection -ExAllocateFromPagedLookasideList -ExAllocatePool -ExAllocatePoolWithQuota -ExAllocatePoolWithQuotaTag -ExAllocatePoolWithTag -ExAllocatePoolWithTagPriority -ExConvertExclusiveToSharedLite -ExCreateCallback -ExDeleteNPagedLookasideList -ExDeletePagedLookasideList -ExDeleteResourceLite -ExDesktopObjectType -ExDisableResourceBoostLite -ExEnterCriticalRegionAndAcquireFastMutexUnsafe -ExEnterCriticalRegionAndAcquireResourceExclusive -ExEnterCriticalRegionAndAcquireResourceShared -ExEnterCriticalRegionAndAcquireSharedWaitForExclusive -ExEnumHandleTable -ExEventObjectType -ExExtendZone -ExFreeCacheAwareRundownProtection -ExFreePool -ExFreePoolWithTag -ExFreeToPagedLookasideList -ExGetCurrentProcessorCounts -ExGetCurrentProcessorCpuUsage -ExGetExclusiveWaiterCount -ExGetPreviousMode -ExGetSharedWaiterCount -ExInitializeNPagedLookasideList -ExInitializePagedLookasideList -ExInitializeResourceLite -ExInitializeRundownProtection -ExInitializeRundownProtectionCacheAware -ExInitializeZone -ExInterlockedAddLargeInteger -ExInterlockedAddUlong -ExInterlockedExtendZone -ExInterlockedInsertHeadList -ExInterlockedInsertTailList -ExInterlockedPopEntryList -ExInterlockedPushEntryList -ExInterlockedRemoveHeadList -ExIsProcessorFeaturePresent -ExIsResourceAcquiredExclusiveLite -ExIsResourceAcquiredSharedLite -ExLocalTimeToSystemTime -ExNotifyCallback -ExQueryDepthSList -ExQueryPoolBlockSize -ExQueueWorkItem -ExRaiseAccessViolation -ExRaiseDatatypeMisalignment -ExRaiseException -ExRaiseHardError -ExRaiseStatus -ExReInitializeRundownProtection -ExReInitializeRundownProtectionCacheAware -ExRegisterCallback -ExReinitializeResourceLite -ExReleaseFastMutex -ExReleaseFastMutexUnsafe -ExReleaseFastMutexUnsafeAndLeaveCriticalRegion -ExReleaseResourceAndLeaveCriticalRegion -ExReleaseResourceForThreadLite -ExReleaseResourceLite -ExReleaseRundownProtection -ExReleaseRundownProtectionCacheAware -ExReleaseRundownProtectionCacheAwareEx -ExReleaseRundownProtectionEx -ExRundownCompleted -ExRundownCompletedCacheAware -ExSemaphoreObjectType -ExSetResourceOwnerPointer -ExSetTimerResolution -ExSizeOfRundownProtectionCacheAware -ExSystemExceptionFilter -ExSystemTimeToLocalTime -ExTryToAcquireFastMutex -ExUnregisterCallback -ExUuidCreate -ExVerifySuite -ExWaitForRundownProtectionRelease -ExWaitForRundownProtectionReleaseCacheAware -ExWindowStationObjectType -ExfAcquirePushLockExclusive -ExfAcquirePushLockShared -ExfReleasePushLock -ExfReleasePushLockExclusive -ExfReleasePushLockShared -ExfTryToWakePushLock -ExfUnblockPushLock -ExpInterlockedFlushSList -ExpInterlockedPopEntrySList -ExpInterlockedPushEntrySList -FsRtlAcquireFileExclusive -FsRtlAddBaseMcbEntry -FsRtlAddLargeMcbEntry -FsRtlAddMcbEntry -FsRtlAddToTunnelCache -FsRtlAllocateFileLock -FsRtlAllocatePool -FsRtlAllocatePoolWithQuota -FsRtlAllocatePoolWithQuotaTag -FsRtlAllocatePoolWithTag -FsRtlAllocateResource -FsRtlAreNamesEqual -FsRtlBalanceReads -FsRtlCheckLockForReadAccess -FsRtlCheckLockForWriteAccess -FsRtlCheckOplock -FsRtlCopyRead -FsRtlCopyWrite -FsRtlCreateSectionForDataScan -FsRtlCurrentBatchOplock -FsRtlDeleteKeyFromTunnelCache -FsRtlDeleteTunnelCache -FsRtlDeregisterUncProvider -FsRtlDissectDbcs -FsRtlDissectName -FsRtlDoesDbcsContainWildCards -FsRtlDoesNameContainWildCards -FsRtlFastCheckLockForRead -FsRtlFastCheckLockForWrite -FsRtlFastUnlockAll -FsRtlFastUnlockAllByKey -FsRtlFastUnlockSingle -FsRtlFindInTunnelCache -FsRtlFreeFileLock -FsRtlGetFileSize -FsRtlGetNextBaseMcbEntry -FsRtlGetNextFileLock -FsRtlGetNextLargeMcbEntry -FsRtlGetNextMcbEntry -FsRtlIncrementCcFastReadNoWait -FsRtlIncrementCcFastReadNotPossible -FsRtlIncrementCcFastReadResourceMiss -FsRtlIncrementCcFastReadWait -FsRtlInitializeBaseMcb -FsRtlInitializeFileLock -FsRtlInitializeLargeMcb -FsRtlInitializeMcb -FsRtlInitializeOplock -FsRtlInitializeTunnelCache -FsRtlInsertPerFileObjectContext -FsRtlInsertPerStreamContext -FsRtlIsDbcsInExpression -FsRtlIsFatDbcsLegal -FsRtlIsHpfsDbcsLegal -FsRtlIsNameInExpression -FsRtlIsNtstatusExpected -FsRtlIsPagingFile -FsRtlIsTotalDeviceFailure -FsRtlLegalAnsiCharacterArray -FsRtlLookupBaseMcbEntry -FsRtlLookupLargeMcbEntry -FsRtlLookupLastBaseMcbEntry -FsRtlLookupLastBaseMcbEntryAndIndex -FsRtlLookupLastLargeMcbEntry -FsRtlLookupLastLargeMcbEntryAndIndex -FsRtlLookupLastMcbEntry -FsRtlLookupMcbEntry -FsRtlLookupPerFileObjectContext -FsRtlLookupPerStreamContextInternal -FsRtlMdlRead -FsRtlMdlReadComplete -FsRtlMdlReadCompleteDev -FsRtlMdlReadDev -FsRtlMdlWriteComplete -FsRtlMdlWriteCompleteDev -FsRtlNormalizeNtstatus -FsRtlNotifyChangeDirectory -FsRtlNotifyCleanup -FsRtlNotifyFilterChangeDirectory -FsRtlNotifyFilterReportChange -FsRtlNotifyFullChangeDirectory -FsRtlNotifyFullReportChange -FsRtlNotifyInitializeSync -FsRtlNotifyReportChange -FsRtlNotifyUninitializeSync -FsRtlNotifyVolumeEvent -FsRtlNumberOfRunsInBaseMcb -FsRtlNumberOfRunsInLargeMcb -FsRtlNumberOfRunsInMcb -FsRtlOplockFsctrl -FsRtlOplockIsFastIoPossible -FsRtlPostPagingFileStackOverflow -FsRtlPostStackOverflow -FsRtlPrepareMdlWrite -FsRtlPrepareMdlWriteDev -FsRtlPrivateLock -FsRtlProcessFileLock -FsRtlRegisterFileSystemFilterCallbacks -FsRtlRegisterUncProvider -FsRtlReleaseFile -FsRtlRemoveBaseMcbEntry -FsRtlRemoveLargeMcbEntry -FsRtlRemoveMcbEntry -FsRtlRemovePerFileObjectContext -FsRtlRemovePerStreamContext -FsRtlResetBaseMcb -FsRtlResetLargeMcb -FsRtlSplitBaseMcb -FsRtlSplitLargeMcb -FsRtlSyncVolumes -FsRtlTeardownPerStreamContexts -FsRtlTruncateBaseMcb -FsRtlTruncateLargeMcb -FsRtlTruncateMcb -FsRtlUninitializeBaseMcb -FsRtlUninitializeFileLock -FsRtlUninitializeLargeMcb -FsRtlUninitializeMcb -FsRtlUninitializeOplock -HalDispatchTable -HalExamineMBR -HalPrivateDispatchTable -HeadlessDispatch -InbvAcquireDisplayOwnership -InbvCheckDisplayOwnership -InbvDisplayString -InbvEnableBootDriver -InbvEnableDisplayString -InbvInstallDisplayStringFilter -InbvIsBootDriverInstalled -InbvNotifyDisplayOwnershipLost -InbvResetDisplay -InbvSetScrollRegion -InbvSetTextColor -InbvSolidColorFill -InitSafeBootMode -InitializeSListHead -IoAcquireCancelSpinLock -IoAcquireRemoveLockEx -IoAcquireVpbSpinLock -IoAdapterObjectType -IoAllocateAdapterChannel -IoAllocateController -IoAllocateDriverObjectExtension -IoAllocateErrorLogEntry -IoAllocateIrp -IoAllocateMdl -IoAllocateWorkItem -IoAssignDriveLetters -IoAssignResources -IoAttachDevice -IoAttachDeviceByPointer -IoAttachDeviceToDeviceStack -IoAttachDeviceToDeviceStackSafe -IoBuildAsynchronousFsdRequest -IoBuildDeviceIoControlRequest -IoBuildPartialMdl -IoBuildSynchronousFsdRequest -IoCallDriver -IoCancelFileOpen -IoCancelIrp -IoCheckDesiredAccess -IoCheckEaBufferValidity -IoCheckFunctionAccess -IoCheckQuerySetFileInformation -IoCheckQuerySetVolumeInformation -IoCheckQuotaBufferValidity -IoCheckShareAccess -IoCompleteRequest -IoConnectInterrupt -IoCreateController -IoCreateDevice -IoCreateDisk -IoCreateDriver -IoCreateFile -IoCreateFileSpecifyDeviceObjectHint -IoCreateNotificationEvent -IoCreateStreamFileObject -IoCreateStreamFileObjectEx -IoCreateStreamFileObjectLite -IoCreateSymbolicLink -IoCreateSynchronizationEvent -IoCreateUnprotectedSymbolicLink -IoCsqInitialize -IoCsqInitializeEx -IoCsqInsertIrp -IoCsqInsertIrpEx -IoCsqRemoveIrp -IoCsqRemoveNextIrp -IoDeleteController -IoDeleteDevice -IoDeleteDriver -IoDeleteSymbolicLink -IoDetachDevice -IoDeviceHandlerObjectSize -IoDeviceHandlerObjectType -IoDeviceObjectType -IoDisconnectInterrupt -IoDriverObjectType -IoEnqueueIrp -IoEnumerateDeviceObjectList -IoEnumerateRegisteredFiltersList -IoFastQueryNetworkAttributes -IoFileObjectType -IoForwardAndCatchIrp -IoForwardIrpSynchronously -IoFreeController -IoFreeErrorLogEntry -IoFreeIrp -IoFreeMdl -IoFreeWorkItem -IoGetAttachedDevice -IoGetAttachedDeviceReference -IoGetBaseFileSystemDeviceObject -IoGetBootDiskInformation -IoGetConfigurationInformation -IoGetCurrentProcess -IoGetDeviceAttachmentBaseRef -IoGetDeviceInterfaceAlias -IoGetDeviceInterfaces -IoGetDeviceObjectPointer -IoGetDeviceProperty -IoGetDeviceToVerify -IoGetDiskDeviceObject -IoGetDmaAdapter -IoGetDriverObjectExtension -IoGetFileObjectGenericMapping -IoGetInitialStack -IoGetLowerDeviceObject -IoGetPagingIoPriority -IoGetRelatedDeviceObject -IoGetRequestorProcess -IoGetRequestorProcessId -IoGetRequestorSessionId -IoGetStackLimits -IoGetTopLevelIrp -IoInitializeIrp -IoInitializeRemoveLockEx -IoInitializeTimer -IoInvalidateDeviceRelations -IoInvalidateDeviceState -IoIs32bitProcess -IoIsFileOriginRemote -IoIsOperationSynchronous -IoIsSystemThread -IoIsValidNameGraftingBuffer -IoIsWdmVersionAvailable -IoMakeAssociatedIrp -IoOpenDeviceInterfaceRegistryKey -IoOpenDeviceRegistryKey -IoPageRead -IoPnPDeliverServicePowerNotification -IoQueryDeviceDescription -IoQueryFileDosDeviceName -IoQueryFileInformation -IoQueryVolumeInformation -IoQueueThreadIrp -IoQueueWorkItem -IoRaiseHardError -IoRaiseInformationalHardError -IoReadDiskSignature -IoReadOperationCount -IoReadPartitionTable -IoReadPartitionTableEx -IoReadTransferCount -IoRegisterBootDriverReinitialization -IoRegisterDeviceInterface -IoRegisterDriverReinitialization -IoRegisterFileSystem -IoRegisterFsRegistrationChange -IoRegisterLastChanceShutdownNotification -IoRegisterPlugPlayNotification -IoRegisterShutdownNotification -IoReleaseCancelSpinLock -IoReleaseRemoveLockAndWaitEx -IoReleaseRemoveLockEx -IoReleaseVpbSpinLock -IoRemoveShareAccess -IoReportDetectedDevice -IoReportHalResourceUsage -IoReportResourceForDetection -IoReportResourceUsage -IoReportTargetDeviceChange -IoReportTargetDeviceChangeAsynchronous -IoRequestDeviceEject -IoReuseIrp -IoSetCompletionRoutineEx -IoSetDeviceInterfaceState -IoSetDeviceToVerify -IoSetFileOrigin -IoSetHardErrorOrVerifyDevice -IoSetInformation -IoSetIoCompletion -IoSetPartitionInformation -IoSetPartitionInformationEx -IoSetShareAccess -IoSetStartIoAttributes -IoSetSystemPartition -IoSetThreadHardErrorMode -IoSetTopLevelIrp -IoStartNextPacket -IoStartNextPacketByKey -IoStartPacket -IoStartTimer -IoStatisticsLock -IoStopTimer -IoSynchronousInvalidateDeviceRelations -IoSynchronousPageWrite -IoThreadToProcess -IoTranslateBusAddress -IoUnregisterFileSystem -IoUnregisterFsRegistrationChange -IoUnregisterPlugPlayNotification -IoUnregisterShutdownNotification -IoUpdateShareAccess -IoValidateDeviceIoControlAccess -IoVerifyPartitionTable -IoVerifyVolume -IoVolumeDeviceToDosName -IoWMIAllocateInstanceIds -IoWMIDeviceObjectToInstanceName -IoWMIDeviceObjectToProviderId -IoWMIExecuteMethod -IoWMIHandleToInstanceName -IoWMIOpenBlock -IoWMIQueryAllData -IoWMIQueryAllDataMultiple -IoWMIQuerySingleInstance -IoWMIQuerySingleInstanceMultiple -IoWMIRegistrationControl -IoWMISetNotificationCallback -IoWMISetSingleInstance -IoWMISetSingleItem -IoWMISuggestInstanceName -IoWMIWriteEvent -IoWriteErrorLogEntry -IoWriteOperationCount -IoWritePartitionTable -IoWritePartitionTableEx -IoWriteTransferCount -IofCallDriver -IofCompleteRequest -KdChangeOption -KdDebuggerEnabled -KdDebuggerNotPresent -KdDisableDebugger -KdEnableDebugger -KdEnteredDebugger -KdPollBreakIn -KdPowerTransition -KdRefreshDebuggerNotPresent -KdSystemDebugControl -KeAcquireGuardedMutex -KeAcquireGuardedMutexUnsafe -KeAcquireInStackQueuedSpinLock -KeAcquireInStackQueuedSpinLockAtDpcLevel -KeAcquireInStackQueuedSpinLockForDpc -KeAcquireInStackQueuedSpinLockRaiseToSynch -KeAcquireInterruptSpinLock -KeAcquireQueuedSpinLock -KeAcquireQueuedSpinLockRaiseToSynch -KeAcquireSpinLockAtDpcLevel -KeAcquireSpinLockForDpc -KeAcquireSpinLockRaiseToDpc -KeAcquireSpinLockRaiseToSynch -KeAddSystemServiceTable -KeAreAllApcsDisabled -KeAreApcsDisabled -KeAttachProcess -KeBugCheck -KeBugCheckEx -KeCancelTimer -KeCapturePersistentThreadState -KeClearEvent -KeConnectInterrupt -KeDelayExecutionThread -KeDeregisterBugCheckCallback -KeDeregisterBugCheckReasonCallback -KeDeregisterNmiCallback -KeDetachProcess -KeDisconnectInterrupt -KeEnterCriticalRegion -KeEnterGuardedRegion -KeEnterKernelDebugger -KeExpandKernelStackAndCallout -KeFindConfigurationEntry -KeFindConfigurationNextEntry -KeFlushEntireTb -KeFlushQueuedDpcs -KeGenericCallDpc -KeGetCurrentIrql=KxGetCurrentIrql -KeGetCurrentThread -KeGetRecommendedSharedDataAlignment -KeInitializeApc -KeInitializeCrashDumpHeader -KeInitializeDeviceQueue -KeInitializeDpc -KeInitializeEvent -KeInitializeGuardedMutex -KeInitializeInterrupt -KeInitializeMutant -KeInitializeMutex -KeInitializeQueue -KeInitializeSemaphore -KeInitializeThreadedDpc -KeInitializeTimer -KeInitializeTimerEx -KeInsertByKeyDeviceQueue -KeInsertDeviceQueue -KeInsertHeadQueue -KeInsertQueue -KeInsertQueueApc -KeInsertQueueDpc -KeInvalidateAllCaches -KeIpiGenericCall -KeIsAttachedProcess -KeIsWaitListEmpty -KeLastBranchMSR -KeLeaveCriticalRegion -KeLeaveGuardedRegion -KeLoaderBlock -KeLowerIrql=KxLowerIrql -KeNumberProcessors -KeProfileInterruptWithSource -KePulseEvent -KeQueryActiveProcessors -KeQueryMultiThreadProcessorSet -KeQueryPrcbAddress -KeQueryPriorityThread -KeQueryRuntimeThread -KeQueryTimeIncrement -KeRaiseIrqlToDpcLevel=KxRaiseIrqlToDpcLevel -KeRaiseUserException -KeReadStateEvent -KeReadStateMutant -KeReadStateMutex -KeReadStateQueue -KeReadStateSemaphore -KeReadStateTimer -KeRegisterBugCheckCallback -KeRegisterBugCheckReasonCallback -KeRegisterNmiCallback -KeReleaseGuardedMutex -KeReleaseGuardedMutexUnsafe -KeReleaseInStackQueuedSpinLock -KeReleaseInStackQueuedSpinLockForDpc -KeReleaseInStackQueuedSpinLockFromDpcLevel -KeReleaseInterruptSpinLock -KeReleaseMutant -KeReleaseMutex -KeReleaseQueuedSpinLock -KeReleaseSemaphore -KeReleaseSpinLock -KeReleaseSpinLockForDpc -KeReleaseSpinLockFromDpcLevel -KeRemoveByKeyDeviceQueue -KeRemoveByKeyDeviceQueueIfBusy -KeRemoveDeviceQueue -KeRemoveEntryDeviceQueue -KeRemoveQueue -KeRemoveQueueDpc -KeRemoveSystemServiceTable -KeResetEvent -KeRestoreFloatingPointState -KeRevertToUserAffinityThread -KeRundownQueue -KeSaveFloatingPointState -KeSaveStateForHibernate -KeServiceDescriptorTable -KeSetAffinityThread -KeSetBasePriorityThread -KeSetDmaIoCoherency -KeSetEvent -KeSetEventBoostPriority -KeSetIdealProcessorThread -KeSetImportanceDpc -KeSetKernelStackSwapEnable -KeSetPriorityThread -KeSetProfileIrql -KeSetSystemAffinityThread -KeSetTargetProcessorDpc -KeSetTimeIncrement -KeSetTimer -KeSetTimerEx -KeSignalCallDpcDone -KeSignalCallDpcSynchronize -KeStackAttachProcess -KeSynchronizeExecution -KeTerminateThread -KeTestSpinLock -KeTryToAcquireGuardedMutex -KeTryToAcquireQueuedSpinLock -KeTryToAcquireQueuedSpinLockRaiseToSynch -KeTryToAcquireSpinLockAtDpcLevel -KeUnstackDetachProcess -KeUpdateRunTime -KeUpdateSystemTime -KeUserModeCallback -KeWaitForMultipleObjects -KeWaitForMutexObject -KeWaitForSingleObject -KfRaiseIrql=KxRaiseIrql -KiBugCheckData -KiCheckForKernelApcDelivery -KiCpuId -LdrAccessResource -LdrEnumResources -LdrFindResourceDirectory_U -LdrFindResource_U -LpcPortObjectType -LpcRequestPort -LpcRequestWaitReplyPort -LsaCallAuthenticationPackage -LsaDeregisterLogonProcess -LsaFreeReturnBuffer -LsaLogonUser -LsaLookupAuthenticationPackage -LsaRegisterLogonProcess -Mm64BitPhysicalAddress -MmAddPhysicalMemory -MmAddVerifierThunks -MmAdjustWorkingSetSize -MmAdvanceMdl -MmAllocateContiguousMemory -MmAllocateContiguousMemorySpecifyCache -MmAllocateMappingAddress -MmAllocateNonCachedMemory -MmAllocatePagesForMdl -MmAllocatePagesForMdlEx -MmBuildMdlForNonPagedPool -MmCanFileBeTruncated -MmCommitSessionMappedView -MmCreateMdl -MmCreateMirror -MmCreateSection -MmDisableModifiedWriteOfSection -MmFlushImageSection -MmForceSectionClosed -MmFreeContiguousMemory -MmFreeContiguousMemorySpecifyCache -MmFreeMappingAddress -MmFreeNonCachedMemory -MmFreePagesFromMdl -MmGetPhysicalAddress -MmGetPhysicalMemoryRanges -MmGetSystemRoutineAddress -MmGetVirtualForPhysical -MmGrowKernelStack -MmHighestUserAddress -MmIsAddressValid -MmIsDriverVerifying -MmIsIoSpaceActive -MmIsNonPagedSystemAddressValid -MmIsRecursiveIoFault -MmIsThisAnNtAsSystem -MmIsVerifierEnabled -MmLockPagableDataSection -MmLockPagableImageSection -MmLockPagableSectionByHandle -MmMapIoSpace -MmMapLockedPages -MmMapLockedPagesSpecifyCache -MmMapLockedPagesWithReservedMapping -MmMapMemoryDumpMdl -MmMapUserAddressesToPage -MmMapVideoDisplay -MmMapViewInSessionSpace -MmMapViewInSystemSpace -MmMapViewOfSection -MmMarkPhysicalMemoryAsBad -MmMarkPhysicalMemoryAsGood -MmPageEntireDriver -MmPrefetchPages -MmProbeAndLockPages -MmProbeAndLockProcessPages -MmProbeAndLockSelectedPages -MmProtectMdlSystemAddress -MmQuerySystemSize -MmRemovePhysicalMemory -MmResetDriverPaging -MmSectionObjectType -MmSecureVirtualMemory -MmSetAddressRangeModified -MmSetBankedSection -MmSizeOfMdl -MmSystemRangeStart -MmTrimAllSystemPagableMemory -MmUnlockPagableImageSection -MmUnlockPages -MmUnmapIoSpace -MmUnmapLockedPages -MmUnmapReservedMapping -MmUnmapVideoDisplay -MmUnmapViewInSessionSpace -MmUnmapViewInSystemSpace -MmUnmapViewOfSection -MmUnsecureVirtualMemory -MmUserProbeAddress -NlsAnsiCodePage -NlsLeadByteInfo -NlsMbCodePageTag -NlsMbOemCodePageTag -NlsOemCodePage -NlsOemLeadByteInfo -NtAddAtom -NtAdjustPrivilegesToken -NtAllocateLocallyUniqueId -NtAllocateUuids -NtAllocateVirtualMemory -NtBuildNumber -NtClose -NtConnectPort -NtCreateEvent -NtCreateFile -NtCreateSection -NtDeleteAtom -NtDeleteFile -NtDeviceIoControlFile -NtDuplicateObject -NtDuplicateToken -NtFindAtom -NtFreeVirtualMemory -NtFsControlFile -NtGlobalFlag -NtLockFile -NtMakePermanentObject -NtMapViewOfSection -NtNotifyChangeDirectoryFile -NtOpenFile -NtOpenProcess -NtOpenProcessToken -NtOpenProcessTokenEx -NtOpenThread -NtOpenThreadToken -NtOpenThreadTokenEx -NtQueryDirectoryFile -NtQueryEaFile -NtQueryInformationAtom -NtQueryInformationFile -NtQueryInformationProcess -NtQueryInformationThread -NtQueryInformationToken -NtQueryQuotaInformationFile -NtQuerySecurityObject -NtQuerySystemInformation -NtQueryVolumeInformationFile -NtReadFile -NtRequestPort -NtRequestWaitReplyPort -NtSetEaFile -NtSetEvent -NtSetInformationFile -NtSetInformationProcess -NtSetInformationThread -NtSetQuotaInformationFile -NtSetSecurityObject -NtSetVolumeInformationFile -NtShutdownSystem -NtTraceEvent -NtUnlockFile -NtVdmControl -NtWaitForSingleObject -NtWriteFile -ObAssignSecurity -ObCheckCreateObjectAccess -ObCheckObjectAccess -ObCloseHandle -ObCreateObject -ObCreateObjectType -ObDeleteCapturedInsertInfo -ObDereferenceObject -ObDereferenceSecurityDescriptor -ObFindHandleForObject -ObGetObjectSecurity -ObInsertObject -ObLogSecurityDescriptor -ObMakeTemporaryObject -ObOpenObjectByName -ObOpenObjectByPointer -ObQueryNameString -ObQueryObjectAuditingByHandle -ObReferenceObjectByHandle -ObReferenceObjectByName -ObReferenceObjectByPointer -ObReferenceSecurityDescriptor -ObReleaseObjectSecurity -ObSetHandleAttributes -ObSetSecurityDescriptorInfo -ObSetSecurityObjectByPointer -ObfDereferenceObject -ObfReferenceObject -PfxFindPrefix -PfxInitialize -PfxInsertPrefix -PfxRemovePrefix -PoCallDriver -PoCancelDeviceNotify -PoQueueShutdownWorkItem -PoRegisterDeviceForIdleDetection -PoRegisterDeviceNotify -PoRegisterSystemState -PoRequestPowerIrp -PoRequestShutdownEvent -PoSetHiberRange -PoSetPowerState -PoSetSystemState -PoShutdownBugCheck -PoStartNextPowerIrp -PoUnregisterSystemState -ProbeForRead -ProbeForWrite -PsAssignImpersonationToken -PsChargePoolQuota -PsChargeProcessNonPagedPoolQuota -PsChargeProcessPagedPoolQuota -PsChargeProcessPoolQuota -PsCreateSystemProcess -PsCreateSystemThread -PsDereferenceImpersonationToken -PsDereferencePrimaryToken -PsDisableImpersonation -PsEstablishWin32Callouts -PsGetContextThread -PsGetCurrentProcess -PsGetCurrentProcessId -PsGetCurrentProcessSessionId -PsGetCurrentProcessWin32Process -PsGetCurrentProcessWow64Process -PsGetCurrentThread -PsGetCurrentThreadId -PsGetCurrentThreadPreviousMode -PsGetCurrentThreadProcess -PsGetCurrentThreadProcessId -PsGetCurrentThreadStackBase -PsGetCurrentThreadStackLimit -PsGetCurrentThreadTeb -PsGetCurrentThreadWin32Thread -PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion -PsGetJobLock -PsGetJobSessionId -PsGetJobUIRestrictionsClass -PsGetProcessCreateTimeQuadPart -PsGetProcessDebugPort -PsGetProcessExitProcessCalled -PsGetProcessExitStatus -PsGetProcessExitTime -PsGetProcessId -PsGetProcessImageFileName -PsGetProcessInheritedFromUniqueProcessId -PsGetProcessJob -PsGetProcessPeb -PsGetProcessPriorityClass -PsGetProcessSectionBaseAddress -PsGetProcessSecurityPort -PsGetProcessSessionId -PsGetProcessSessionIdEx -PsGetProcessWin32Process -PsGetProcessWin32WindowStation -PsGetProcessWow64Process -PsGetThreadFreezeCount -PsGetThreadHardErrorsAreDisabled -PsGetThreadId -PsGetThreadProcess -PsGetThreadProcessId -PsGetThreadSessionId -PsGetThreadTeb -PsGetThreadWin32Thread -PsGetVersion -PsImpersonateClient -PsInitialSystemProcess -PsIsProcessBeingDebugged -PsIsSystemProcess -PsIsSystemThread -PsIsThreadImpersonating -PsIsThreadTerminating -PsJobType -PsLookupProcessByProcessId -PsLookupProcessThreadByCid -PsLookupThreadByThreadId -PsProcessType -PsReferenceImpersonationToken -PsReferencePrimaryToken -PsRemoveCreateThreadNotifyRoutine -PsRemoveLoadImageNotifyRoutine -PsRestoreImpersonation -PsReturnPoolQuota -PsReturnProcessNonPagedPoolQuota -PsReturnProcessPagedPoolQuota -PsRevertThreadToSelf -PsRevertToSelf -PsSetContextThread -PsSetCreateProcessNotifyRoutine -PsSetCreateThreadNotifyRoutine -PsSetJobUIRestrictionsClass -PsSetLegoNotifyRoutine -PsSetLoadImageNotifyRoutine -PsSetProcessPriorityByClass -PsSetProcessPriorityClass -PsSetProcessSecurityPort -PsSetProcessWin32Process -PsSetProcessWindowStation -PsSetThreadHardErrorsAreDisabled -PsSetThreadWin32Thread -PsTerminateSystemThread -PsThreadType -PsWrapApcWow64Thread -RtlAbsoluteToSelfRelativeSD -RtlAddAccessAllowedAce -RtlAddAccessAllowedAceEx -RtlAddAce -RtlAddAtomToAtomTable -RtlAddRange -RtlAllocateHeap -RtlAnsiCharToUnicodeChar -RtlAnsiStringToUnicodeSize -RtlAnsiStringToUnicodeString -RtlAppendAsciizToString -RtlAppendStringToString -RtlAppendUnicodeStringToString -RtlAppendUnicodeToString -RtlAreAllAccessesGranted -RtlAreAnyAccessesGranted -RtlAreBitsClear -RtlAreBitsSet -RtlAssert -RtlCaptureContext -RtlCaptureStackBackTrace -RtlCharToInteger -RtlCheckRegistryKey -RtlClearAllBits -RtlClearBit -RtlClearBits -RtlCompareMemory -RtlCompareMemoryUlong -RtlCompareString -RtlCompareUnicodeString -RtlCompressBuffer -RtlCompressChunks -RtlConvertSidToUnicodeString -RtlCopyLuid -RtlCopyMemory -RtlCopyMemoryNonTemporal -RtlCopyRangeList -RtlCopySid -RtlCopyString -RtlCopyUnicodeString -RtlCreateAcl -RtlCreateAtomTable -RtlCreateHeap -RtlCreateRegistryKey -RtlCreateSecurityDescriptor -RtlCreateSystemVolumeInformationFolder -RtlCreateUnicodeString -RtlCustomCPToUnicodeN -RtlDecompressBuffer -RtlDecompressChunks -RtlDecompressFragment -RtlDelete -RtlDeleteAce -RtlDeleteAtomFromAtomTable -RtlDeleteElementGenericTable -RtlDeleteElementGenericTableAvl -RtlDeleteNoSplay -RtlDeleteOwnersRanges -RtlDeleteRange -RtlDeleteRegistryValue -RtlDescribeChunk -RtlDestroyAtomTable -RtlDestroyHeap -RtlDowncaseUnicodeString -RtlEmptyAtomTable -RtlEnumerateGenericTable -RtlEnumerateGenericTableAvl -RtlEnumerateGenericTableLikeADirectory -RtlEnumerateGenericTableWithoutSplaying -RtlEnumerateGenericTableWithoutSplayingAvl -RtlEqualLuid -RtlEqualSid -RtlEqualString -RtlEqualUnicodeString -RtlFillMemory -RtlFindClearBits -RtlFindClearBitsAndSet -RtlFindClearRuns -RtlFindFirstRunClear -RtlFindLastBackwardRunClear -RtlFindLeastSignificantBit -RtlFindLongestRunClear -RtlFindMessage -RtlFindMostSignificantBit -RtlFindNextForwardRunClear -RtlFindRange -RtlFindSetBits -RtlFindSetBitsAndClear -RtlFindUnicodePrefix -RtlFormatCurrentUserKeyPath -RtlFreeAnsiString -RtlFreeHeap -RtlFreeOemString -RtlFreeRangeList -RtlFreeUnicodeString -RtlGUIDFromString -RtlGenerate8dot3Name -RtlGetAce -RtlGetCallersAddress -RtlGetCompressionWorkSpaceSize -RtlGetDaclSecurityDescriptor -RtlGetDefaultCodePage -RtlGetElementGenericTable -RtlGetElementGenericTableAvl -RtlGetFirstRange -RtlGetGroupSecurityDescriptor -RtlGetNextRange -RtlGetNtGlobalFlags -RtlGetOwnerSecurityDescriptor -RtlGetSaclSecurityDescriptor -RtlGetSetBootStatusData -RtlGetVersion -RtlHashUnicodeString -RtlImageDirectoryEntryToData -RtlImageNtHeader -RtlInitAnsiString -RtlInitAnsiStringEx -RtlInitCodePageTable -RtlInitString -RtlInitUnicodeString -RtlInitUnicodeStringEx -RtlInitializeBitMap -RtlInitializeGenericTable -RtlInitializeGenericTableAvl -RtlInitializeRangeList -RtlInitializeSid -RtlInitializeUnicodePrefix -RtlInsertElementGenericTable -RtlInsertElementGenericTableAvl -RtlInsertElementGenericTableFull -RtlInsertElementGenericTableFullAvl -RtlInsertUnicodePrefix -RtlInt64ToUnicodeString -RtlIntegerToChar -RtlIntegerToUnicode -RtlIntegerToUnicodeString -RtlInvertRangeList -RtlIpv4AddressToStringA -RtlIpv4AddressToStringExA -RtlIpv4AddressToStringExW -RtlIpv4AddressToStringW -RtlIpv4StringToAddressA -RtlIpv4StringToAddressExA -RtlIpv4StringToAddressExW -RtlIpv4StringToAddressW -RtlIpv6AddressToStringA -RtlIpv6AddressToStringExA -RtlIpv6AddressToStringExW -RtlIpv6AddressToStringW -RtlIpv6StringToAddressA -RtlIpv6StringToAddressExA -RtlIpv6StringToAddressExW -RtlIpv6StringToAddressW -RtlIsGenericTableEmpty -RtlIsGenericTableEmptyAvl -RtlIsNameLegalDOS8Dot3 -RtlIsRangeAvailable -RtlIsValidOemCharacter -RtlLengthRequiredSid -RtlLengthSecurityDescriptor -RtlLengthSid -RtlLockBootStatusData -RtlLookupAtomInAtomTable -RtlLookupElementGenericTable -RtlLookupElementGenericTableAvl -RtlLookupElementGenericTableFull -RtlLookupElementGenericTableFullAvl -RtlLookupFunctionEntry -RtlMapGenericMask -RtlMapSecurityErrorToNtStatus -RtlMergeRangeLists -RtlMoveMemory -RtlMultiByteToUnicodeN -RtlMultiByteToUnicodeSize -RtlNextUnicodePrefix -RtlNtStatusToDosError -RtlNtStatusToDosErrorNoTeb -RtlNumberGenericTableElements -RtlNumberGenericTableElementsAvl -RtlNumberOfClearBits -RtlNumberOfSetBits -RtlOemStringToCountedUnicodeString -RtlOemStringToUnicodeSize -RtlOemStringToUnicodeString -RtlOemToUnicodeN -RtlPcToFileHeader -RtlPinAtomInAtomTable -RtlPrefetchMemoryNonTemporal -RtlPrefixString -RtlPrefixUnicodeString -RtlQueryAtomInAtomTable -RtlQueryRegistryValues -RtlQueryTimeZoneInformation -RtlRaiseException -RtlRandom -RtlRandomEx -RtlRealPredecessor -RtlRealSuccessor -RtlRemoveUnicodePrefix -RtlReserveChunk -RtlRestoreContext -RtlSecondsSince1970ToTime -RtlSecondsSince1980ToTime -RtlSelfRelativeToAbsoluteSD -RtlSelfRelativeToAbsoluteSD2 -RtlSetAllBits -RtlSetBit -RtlSetBits -RtlSetDaclSecurityDescriptor -RtlSetGroupSecurityDescriptor -RtlSetOwnerSecurityDescriptor -RtlSetSaclSecurityDescriptor -RtlSetTimeZoneInformation -RtlSizeHeap -RtlSplay -RtlStringFromGUID -RtlSubAuthorityCountSid -RtlSubAuthoritySid -RtlSubtreePredecessor -RtlSubtreeSuccessor -RtlTestBit -RtlTimeFieldsToTime -RtlTimeToElapsedTimeFields -RtlTimeToSecondsSince1970 -RtlTimeToSecondsSince1980 -RtlTimeToTimeFields -RtlTraceDatabaseAdd -RtlTraceDatabaseCreate -RtlTraceDatabaseDestroy -RtlTraceDatabaseEnumerate -RtlTraceDatabaseFind -RtlTraceDatabaseLock -RtlTraceDatabaseUnlock -RtlTraceDatabaseValidate -RtlUnicodeStringToAnsiSize -RtlUnicodeStringToAnsiString -RtlUnicodeStringToCountedOemString -RtlUnicodeStringToInteger -RtlUnicodeStringToOemSize -RtlUnicodeStringToOemString -RtlUnicodeToCustomCPN -RtlUnicodeToMultiByteN -RtlUnicodeToMultiByteSize -RtlUnicodeToOemN -RtlUnlockBootStatusData -RtlUnwind -RtlUnwindEx -RtlUpcaseUnicodeChar -RtlUpcaseUnicodeString -RtlUpcaseUnicodeStringToAnsiString -RtlUpcaseUnicodeStringToCountedOemString -RtlUpcaseUnicodeStringToOemString -RtlUpcaseUnicodeToCustomCPN -RtlUpcaseUnicodeToMultiByteN -RtlUpcaseUnicodeToOemN -RtlUpperChar -RtlUpperString -RtlValidRelativeSecurityDescriptor -RtlValidSecurityDescriptor -RtlValidSid -RtlVerifyVersionInfo -RtlVirtualUnwind -RtlVolumeDeviceToDosName -RtlWalkFrameChain -RtlWriteRegistryValue -RtlZeroHeap -RtlZeroMemory -RtlxAnsiStringToUnicodeSize -RtlxOemStringToUnicodeSize -RtlxUnicodeStringToAnsiSize -RtlxUnicodeStringToOemSize -SeAccessCheck -SeAppendPrivileges -SeAssignSecurity -SeAssignSecurityEx -SeAuditHardLinkCreation -SeAuditingFileEvents -SeAuditingFileEventsWithContext -SeAuditingFileOrGlobalEvents -SeAuditingHardLinkEvents -SeAuditingHardLinkEventsWithContext -SeCaptureSecurityDescriptor -SeCaptureSubjectContext -SeCloseObjectAuditAlarm -SeCreateAccessState -SeCreateClientSecurity -SeCreateClientSecurityFromSubjectContext -SeDeassignSecurity -SeDeleteAccessState -SeDeleteObjectAuditAlarm -SeExports -SeFilterToken -SeFreePrivileges -SeImpersonateClient -SeImpersonateClientEx -SeLockSubjectContext -SeMarkLogonSessionForTerminationNotification -SeOpenObjectAuditAlarm -SeOpenObjectForDeleteAuditAlarm -SePrivilegeCheck -SePrivilegeObjectAuditAlarm -SePublicDefaultDacl -SeQueryAuthenticationIdToken -SeQueryInformationToken -SeQuerySecurityDescriptorInfo -SeQuerySessionIdToken -SeRegisterLogonSessionTerminatedRoutine -SeReleaseSecurityDescriptor -SeReleaseSubjectContext -SeReportSecurityEvent -SeSetAccessStateGenericMapping -SeSetAuditParameter -SeSetSecurityDescriptorInfo -SeSetSecurityDescriptorInfoEx -SeSinglePrivilegeCheck -SeSystemDefaultDacl -SeTokenImpersonationLevel -SeTokenIsAdmin -SeTokenIsRestricted -SeTokenObjectType -SeTokenType -SeUnlockSubjectContext -SeUnregisterLogonSessionTerminatedRoutine -SeValidSecurityDescriptor -VerSetConditionMask -VfFailDeviceNode -VfFailDriver -VfFailSystemBIOS -VfIsVerificationEnabled -WmiFlushTrace -WmiGetClock -WmiQueryTrace -WmiQueryTraceInformation -WmiStartTrace -WmiStopTrace -WmiTraceFastEvent -WmiTraceMessage -WmiTraceMessageVa -WmiUpdateTrace -XIPDispatch -ZwAccessCheckAndAuditAlarm -ZwAddBootEntry -ZwAddDriverEntry -ZwAdjustPrivilegesToken -ZwAlertThread -ZwAllocateVirtualMemory -ZwAssignProcessToJobObject -ZwCancelIoFile -ZwCancelTimer -ZwClearEvent -ZwClose -ZwCloseObjectAuditAlarm -ZwConnectPort -ZwCreateDirectoryObject -ZwCreateEvent -ZwCreateFile -ZwCreateJobObject -ZwCreateKey -ZwCreateSection -ZwCreateSymbolicLinkObject -ZwCreateTimer -ZwDeleteBootEntry -ZwDeleteDriverEntry -ZwDeleteFile -ZwDeleteKey -ZwDeleteValueKey -ZwDeviceIoControlFile -ZwDisplayString -ZwDuplicateObject -ZwDuplicateToken -ZwEnumerateBootEntries -ZwEnumerateDriverEntries -ZwEnumerateKey -ZwEnumerateValueKey -ZwFlushInstructionCache -ZwFlushKey -ZwFlushVirtualMemory -ZwFreeVirtualMemory -ZwFsControlFile -ZwInitiatePowerAction -ZwIsProcessInJob -ZwLoadDriver -ZwLoadKey -ZwMakeTemporaryObject -ZwMapViewOfSection -ZwModifyBootEntry -ZwModifyDriverEntry -ZwNotifyChangeKey -ZwOpenDirectoryObject -ZwOpenEvent -ZwOpenFile -ZwOpenJobObject -ZwOpenKey -ZwOpenProcess -ZwOpenProcessToken -ZwOpenProcessTokenEx -ZwOpenSection -ZwOpenSymbolicLinkObject -ZwOpenThread -ZwOpenThreadToken -ZwOpenThreadTokenEx -ZwOpenTimer -ZwPowerInformation -ZwPulseEvent -ZwQueryBootEntryOrder -ZwQueryBootOptions -ZwQueryDefaultLocale -ZwQueryDefaultUILanguage -ZwQueryDirectoryFile -ZwQueryDirectoryObject -ZwQueryDriverEntryOrder -ZwQueryEaFile -ZwQueryFullAttributesFile -ZwQueryInformationFile -ZwQueryInformationJobObject -ZwQueryInformationProcess -ZwQueryInformationThread -ZwQueryInformationToken -ZwQueryInstallUILanguage -ZwQueryKey -ZwQueryObject -ZwQuerySection -ZwQuerySecurityObject -ZwQuerySymbolicLinkObject -ZwQuerySystemInformation -ZwQueryValueKey -ZwQueryVolumeInformationFile -ZwReadFile -ZwReplaceKey -ZwRequestWaitReplyPort -ZwResetEvent -ZwRestoreKey -ZwSaveKey -ZwSaveKeyEx -ZwSecureConnectPort -ZwSetBootEntryOrder -ZwSetBootOptions -ZwSetDefaultLocale -ZwSetDefaultUILanguage -ZwSetDriverEntryOrder -ZwSetEaFile -ZwSetEvent -ZwSetInformationFile -ZwSetInformationJobObject -ZwSetInformationObject -ZwSetInformationProcess -ZwSetInformationThread -ZwSetSecurityObject -ZwSetSystemInformation -ZwSetSystemTime -ZwSetTimer -ZwSetValueKey -ZwSetVolumeInformationFile -ZwTerminateJobObject -ZwTerminateProcess -ZwTranslateFilePath -ZwUnloadDriver -ZwUnloadKey -ZwUnmapViewOfSection -ZwWaitForMultipleObjects -ZwWaitForSingleObject -ZwWriteFile -ZwYieldExecution -__C_specific_handler -__chkstk -__misaligned_access -_itoa -_itow -_local_unwind -_purecall -_setjmp -_setjmpex -_snprintf -_snwprintf -_stricmp -_strlwr -_strnicmp -_strnset -_strrev -_strset -_strupr -_vsnprintf -_vsnwprintf -_wcsicmp -_wcslwr -_wcsnicmp -_wcsnset -_wcsrev -_wcsupr -atoi -atol -isdigit -islower -isprint -isspace -isupper -isxdigit -longjmp -mbstowcs -mbtowc -memchr -memcmp -memcpy -memmove -memset -qsort -rand -sprintf -srand -strcat -strchr -strcmp -strcpy -strlen -strncat -strncmp -strncpy -strrchr -strspn -strstr -swprintf -tolower -toupper -towlower -towupper -vDbgPrintEx -vDbgPrintExWithPrefix -vsprintf -wcscat -wcschr -wcscmp -wcscpy -wcscspn -wcslen -wcsncat -wcsncmp -wcsncpy -wcsrchr -wcsspn -wcsstr -wcstombs -wctomb -KiSystemStartup diff --git a/reactos/subsystems/win32/csrss/video.c b/reactos/subsystems/win32/csrss/video.c index 454c3f61581..fa9b65bb274 100644 --- a/reactos/subsystems/win32/csrss/video.c +++ b/reactos/subsystems/win32/csrss/video.c @@ -68,8 +68,8 @@ InitializeVideoAddressSpace(VOID) if (BaseAddress != (PVOID)0xa0000) { - DPRINT1("Couldn't map physical memory at the right address " - "(was %x)\n", BaseAddress); + DPRINT1("Couldn't map physical memory at the right address (was %x)\n", + BaseAddress); return 0; } @@ -91,8 +91,8 @@ InitializeVideoAddressSpace(VOID) } if (BaseAddress != (PVOID)0x0) { - DPRINT1("Failed to allocate virtual memory at right address " - "(was %x)\n", BaseAddress); + DPRINT1("Failed to allocate virtual memory at right address (was %x)\n", + BaseAddress); return 0; } @@ -100,7 +100,7 @@ InitializeVideoAddressSpace(VOID) Status = NtVdmControl(VdmInitialize, IVTAndBda); if (!NT_SUCCESS(Status)) { - DbgPrint("NtVdmControl failed (status %x)\n", Status); + DPRINT1("NtVdmControl failed (status %x)\n", Status); return 0; } diff --git a/reactos/subsystems/win32/win32k/eng/mem.c b/reactos/subsystems/win32/win32k/eng/mem.c index e8ad590b5ee..9ae8e11f2ab 100644 --- a/reactos/subsystems/win32/win32k/eng/mem.c +++ b/reactos/subsystems/win32/win32k/eng/mem.c @@ -76,7 +76,7 @@ EngAllocUserMem(SIZE_T cj, ULONG Tag) { PVOID NewMem = NULL; NTSTATUS Status; - ULONG MemSize = sizeof(USERMEMHEADER) + cj; + SIZE_T MemSize = sizeof(USERMEMHEADER) + cj; PUSERMEMHEADER Header; Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &NewMem, 0, &MemSize, MEM_COMMIT, PAGE_READWRITE); @@ -100,7 +100,7 @@ VOID STDCALL EngFreeUserMem(PVOID pv) { PUSERMEMHEADER Header = ((PUSERMEMHEADER) pv) - 1; - ULONG MemSize = sizeof(USERMEMHEADER) + Header->MemSize; + SIZE_T MemSize = sizeof(USERMEMHEADER) + Header->MemSize; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID *) &Header, &MemSize, MEM_RELEASE); } diff --git a/reactos/subsystems/win32/win32k/include/hook.h b/reactos/subsystems/win32/win32k/include/hook.h index f471362820a..d24a57db89f 100644 --- a/reactos/subsystems/win32/win32k/include/hook.h +++ b/reactos/subsystems/win32/win32k/include/hook.h @@ -48,7 +48,7 @@ typedef struct tagEVENTTABLE } EVENTTABLE, *PEVENTTABLE; LRESULT FASTCALL co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam); -LRESULT FASTCALL co_EVENT_CallEvents(DWORD, HWND, LONG, LONG); +LRESULT FASTCALL co_EVENT_CallEvents(DWORD, HWND, UINT_PTR, LONG_PTR); VOID FASTCALL HOOK_DestroyThreadHooks(PETHREAD Thread); PHOOK FASTCALL IntGetHookObject(HHOOK); PHOOK FASTCALL IntGetNextHook(PHOOK Hook); diff --git a/reactos/subsystems/win32/win32k/ntuser/event.c b/reactos/subsystems/win32/win32k/ntuser/event.c index 43dc0530adf..20a9b975f48 100644 --- a/reactos/subsystems/win32/win32k/ntuser/event.c +++ b/reactos/subsystems/win32/win32k/ntuser/event.c @@ -141,8 +141,8 @@ LRESULT FASTCALL co_EVENT_CallEvents( DWORD event, HWND hwnd, - LONG idObject, - LONG idChild) + UINT_PTR idObject, + LONG_PTR idChild) { PEVENTHOOK pEH; LRESULT Result; @@ -185,14 +185,14 @@ IntNotifyWinEvent( if ((pEH->Thread != PsGetCurrentThread()) && (pEH->Thread != NULL)) { // if all process || all thread || other thread same process if (!(pEH->idProcess) || !(pEH->idThread) || - ((DWORD)(NtCurrentTeb()->ClientId).UniqueProcess == pEH->idProcess)) + (NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)pEH->idProcess)) { Result = IntCallLowLevelEvent(pEH, Event, Window->hSelf, idObject, idChild); } }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process) else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) && ( ((pEH->idProcess && - (DWORD)(NtCurrentTeb()->ClientId).UniqueProcess == pEH->idProcess) && + NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)pEH->idProcess) && !(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) || !pEH->idProcess ) ) { @@ -201,7 +201,7 @@ IntNotifyWinEvent( Window->hSelf, idObject, idChild, - (DWORD)(NtCurrentTeb()->ClientId).UniqueThread, + PtrToUint(NtCurrentTeb()->ClientId.UniqueThread), (DWORD)EngGetTickCount(), pEH->Proc); } diff --git a/reactos/subsystems/win32/win32k/ntuser/metric.c b/reactos/subsystems/win32/win32k/ntuser/metric.c index 28eb9d99f8a..73c747ca4b3 100644 --- a/reactos/subsystems/win32/win32k/ntuser/metric.c +++ b/reactos/subsystems/win32/win32k/ntuser/metric.c @@ -85,7 +85,7 @@ InitMetrics(VOID) gpsi->SystemMetrics[SM_CYVSCROLL] = 16; gpsi->SystemMetrics[SM_CXHSCROLL] = 16; gpsi->SystemMetrics[SM_DEBUG] = 0; - gpsi->SystemMetrics[SM_SWAPBUTTON] = CurInfo ? CurInfo->SwapButtons : 0xFFFFFFFF; + gpsi->SystemMetrics[SM_SWAPBUTTON] = CurInfo ? CurInfo->SwapButtons : 0; gpsi->SystemMetrics[SM_RESERVED1] = 0; gpsi->SystemMetrics[SM_RESERVED2] = 0; gpsi->SystemMetrics[SM_RESERVED3] = 0; @@ -98,8 +98,8 @@ InitMetrics(VOID) gpsi->SystemMetrics[SM_CYFRAME] = 4; gpsi->SystemMetrics[SM_CXMINTRACK] = 112; gpsi->SystemMetrics[SM_CYMINTRACK] = 27; - gpsi->SystemMetrics[SM_CXDOUBLECLK] = CurInfo ? CurInfo->DblClickWidth : 0xFFFFFFFF; - gpsi->SystemMetrics[SM_CYDOUBLECLK] = CurInfo ? CurInfo->DblClickWidth : 0xFFFFFFFF; + gpsi->SystemMetrics[SM_CXDOUBLECLK] = CurInfo ? CurInfo->DblClickWidth : 4; + gpsi->SystemMetrics[SM_CYDOUBLECLK] = CurInfo ? CurInfo->DblClickWidth : 4; gpsi->SystemMetrics[SM_CXICONSPACING] = 64; gpsi->SystemMetrics[SM_CYICONSPACING] = 64; gpsi->SystemMetrics[SM_MENUDROPALIGNMENT] = 0; diff --git a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c index d12b9c03e87..1b3b5778a60 100644 --- a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c @@ -942,8 +942,8 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) { Result = co_EVENT_CallEvents( Message->Msg.message, Message->Msg.hwnd, - (LONG) Message->Msg.wParam, - (LONG) Message->Msg.lParam); + Message->Msg.wParam, + Message->Msg.lParam); } else { diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 7892ebc3f3d..0f98bf0a27a 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -310,6 +310,7 @@ void MingwModuleHandler::OutputCopyCommand ( const FileLocation& source, const FileLocation& destination ) { + fprintf ( fMakefile, "# OUTPUT COPY COMMAND\n" ); fprintf ( fMakefile, "\t$(ECHO_CP)\n" ); fprintf ( fMakefile, @@ -408,9 +409,7 @@ MingwModuleHandler::GetObjectFilename ( else if ( extension == ".mc" || extension == ".MC" ) newExtension = ".rc"; else if ( extension == ".spec" || extension == ".SPEC" ) - newExtension = ".stubs.o"; - else if ( extension == ".pspec" || extension == ".PSPEC" ) - newExtension = ".stubs.o"; + newExtension = "_" + module.name + ".stubs.o"; else if ( extension == ".idl" || extension == ".IDL" ) { if ( module.type == RpcServer ) @@ -462,6 +461,7 @@ MingwModuleHandler::GenerateCleanTarget () const if ( module.type == Alias ) return; + fprintf ( fMakefile, "# CLEAN TARGET\n" ); fprintf ( fMakefile, ".PHONY: %s_clean\n", module.name.c_str() ); @@ -503,6 +503,7 @@ MingwModuleHandler::GenerateInstallTarget () const { if ( !module.install ) return; + fprintf ( fMakefile, "# INSTALL TARGET\n" ); fprintf ( fMakefile, ".PHONY: %s_install\n", module.name.c_str() ); fprintf ( fMakefile, "%s_install: %s\n", @@ -513,6 +514,7 @@ MingwModuleHandler::GenerateInstallTarget () const void MingwModuleHandler::GenerateDependsTarget () const { + fprintf ( fMakefile, "# DEPENDS TARGET\n" ); fprintf ( fMakefile, ".PHONY: %s_depends\n", module.name.c_str() ); @@ -785,6 +787,7 @@ MingwModuleHandler::GenerateMacros ( const vector* linkerFlags, set& used_defs ) { + fprintf ( fMakefile, "# MACROS\n" ); GenerateMacro ( assignmentOperation, cflagsMacro, data, @@ -843,6 +846,7 @@ MingwModuleHandler::GenerateSourceMacros ( { size_t i; + fprintf ( fMakefile, "# SOURCE MACROS\n" ); const vector& compilationUnits = data.compilationUnits; vector headers; if ( compilationUnits.size () > 0 ) @@ -889,6 +893,7 @@ MingwModuleHandler::GenerateObjectMacros ( vector headers; vector mcheaders; vector mcresources; + fprintf ( fMakefile, "# OBJECT MACROS\n" ); if ( compilationUnits.size () > 0 ) { for ( i = 0; i < compilationUnits.size (); i++ ) @@ -1024,7 +1029,7 @@ MingwModuleHandler::GetPrecompiledHeaderFilename () const module.pch->file->name + ".gch" ); } -Rule arRule1 ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).a: $($(module_name)_OBJS) | $(INTERMEDIATE)$(SEP)$(source_dir)\n", +Rule arRule1 ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).a: $($(module_name)_OBJS) $(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).a", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); Rule arRule2 ( "\t$(ECHO_AR)\n" @@ -1066,47 +1071,36 @@ Rule wmcRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc", "$(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); -Rule winebuildKMRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" - "\t$(ECHO_WINEBLD)\n" - "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c:\n" +Rule winebuildKMDefRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "\t$(ECHO_WINEBLD)\n" + "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext)_$(module_name).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n\n", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).spec.def", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); +Rule winebuildKMRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.c:\n" "\t${cp} $(NUL) $@ 1>$(NUL)\n" - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.c", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.o", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); -Rule winebuildPCRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" - "\t$(ECHO_WINEBLD)\n" - "\t${gcc} -xc -E $(source) -I. > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "$(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c: $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec $(WINEBUILD_TARGET)\n" - "\t$(ECHO_WINEBLD)\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c --pedll $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec\n" - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" - "\t$(ECHO_CC)\n" - "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); -Rule winebuildRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" +Rule winebuildDefRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "\t$(ECHO_WINEBLD)\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext)_$(module_name).spec.def --def -E $(source)\n\n", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).spec.def", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); +Rule winebuildRule ( "$(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext)_$(module_name).stubs.c: $(source_path)$(SEP)$(source_name_noext).spec $(WINEBUILD_TARGET)\n" "\t$(ECHO_WINEBLD)\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(source)\n" - "$(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c: $(source_path)$(SEP)$(source_name_noext).spec $(WINEBUILD_TARGET)\n" - "\t$(ECHO_WINEBLD)\n" - "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c --pedll $(source_path)$(SEP)$(source_name_noext).spec\n" - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" + "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext)_$(module_name).stubs.c --pedll $(source_path)$(SEP)$(source_name_noext).spec\n" + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.c$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" "\t$(ECHO_CC)\n" "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c", - "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.c", + "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).stubs.o", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); Rule widlHeaderRule ( "$(source): ${$(module_name)_precondition}\n" "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).h: $(source)$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" @@ -1279,7 +1273,6 @@ MingwModuleHandler::GenerateCommands ( { HostDontCare, TypeDontCare, ".mc", &wmcRule }, { HostFalse, Kernel, ".spec", &winebuildKMRule }, { HostFalse, KernelModeDLL, ".spec", &winebuildKMRule }, - { HostDontCare, TypeDontCare, ".pspec", &winebuildPCRule }, { HostDontCare, TypeDontCare, ".spec", &winebuildRule }, { HostDontCare, RpcServer, ".idl", &widlServerRule }, { HostDontCare, RpcClient, ".idl", &widlClientRule }, @@ -1299,6 +1292,8 @@ MingwModuleHandler::GenerateCommands ( size_t i; Rule *customRule = NULL; + fprintf ( fMakefile, "# COMMANDS\n" ); + for ( i = 0; i < sizeof ( rules ) / sizeof ( rules[0] ); i++ ) { if ( rules[i].host != HostDontCare && rules[i].host != ModuleHandlerInformations[module.type].DefaultHost ) @@ -1332,6 +1327,8 @@ MingwModuleHandler::GenerateCommands ( void MingwModuleHandler::GenerateBuildMapCode ( const FileLocation *mapTarget ) { + fprintf ( fMakefile, "# BUILD MAP CODE\n" ); + fprintf ( fMakefile, "ifeq ($(ROS_BUILDMAP),full)\n" ); @@ -1369,6 +1366,8 @@ MingwModuleHandler::GenerateBuildMapCode ( const FileLocation *mapTarget ) void MingwModuleHandler::GenerateBuildNonSymbolStrippedCode () { + fprintf ( fMakefile, "# BUILD NO STRIP CODE\n" ); + fprintf ( fMakefile, "ifeq ($(ROS_BUILDNOSTRIP),yes)\n" ); @@ -1445,6 +1444,7 @@ MingwModuleHandler::GenerateCleanObjectsAsYouGoCode () const void MingwModuleHandler::GenerateRunRsymCode () const { + fprintf ( fMakefile, "# RUN RSYM CODE\n" ); fprintf ( fMakefile, "ifneq ($(ROS_GENERATE_RSYM),no)\n" ); fprintf ( fMakefile, @@ -1458,6 +1458,7 @@ MingwModuleHandler::GenerateRunRsymCode () const void MingwModuleHandler::GenerateRunStripCode () const { + fprintf ( fMakefile, "# RUN STRIP CODE\n" ); fprintf ( fMakefile, "ifeq ($(ROS_LEAN_AND_MEAN),yes)\n" ); fprintf ( fMakefile, @@ -1480,6 +1481,8 @@ MingwModuleHandler::GenerateLinkerCommand ( string objectsMacro = GetObjectsMacro ( module ); string libsMacro = GetLibsMacro (); + fprintf ( fMakefile, "# LINKER COMMAND\n" ); + string target_macro ( GetTargetMacro ( module ) ); string target_folder ( backend->GetFullPath ( *target_file ) ); @@ -1573,6 +1576,7 @@ MingwModuleHandler::GeneratePhonyTarget() const string targetMacro ( GetTargetMacro ( module ) ); const FileLocation *target_file = GetTargetFilename ( module, NULL ); + fprintf ( fMakefile, "# PHONY TARGET\n" ); fprintf ( fMakefile, ".PHONY: %s\n\n", targetMacro.c_str ()); @@ -1589,6 +1593,8 @@ MingwModuleHandler::GenerateObjectFileTargets ( const IfableData& data ) size_t i; string moduleDependencies; + fprintf ( fMakefile, "# OBJECT FILE TARGETS\n" ); + const vector& compilationUnits = data.compilationUnits; for ( i = 0; i < compilationUnits.size (); i++ ) { @@ -1625,6 +1631,8 @@ MingwModuleHandler::GenerateObjectFileTargets () { const FileLocation *pchFilename = GetPrecompiledHeaderFilename (); + fprintf ( fMakefile, "# OBJECT FILE TARGETS\n" ); + if ( pchFilename ) { string cc = ( ModuleHandlerInformations[module.type].DefaultHost == HostTrue ? "${host_gcc}" : "${gcc}" ); @@ -1664,10 +1672,17 @@ MingwModuleHandler::GenerateArchiveTarget () const FileLocation *archiveFilename = GetModuleArchiveFilename (); const FileLocation *definitionFilename = GetDefinitionFilename (); - arRule1.Execute ( fMakefile, backend, module, archiveFilename, clean_files ); + fprintf ( fMakefile, "# ARCHIVE TARGET\n" ); if ( IsStaticLibrary ( module ) && definitionFilename ) { + arRule1.Execute ( fMakefile, + backend, + module, + archiveFilename, + clean_files, + backend->GetFullName ( *definitionFilename ).c_str () ); + fprintf ( fMakefile, "\t${dlltool} --dllname %s --def %s --output-lib $@%s%s\n", module.importLibrary->dllname.c_str (), @@ -1675,6 +1690,8 @@ MingwModuleHandler::GenerateArchiveTarget () module.mangledSymbols ? "" : " --kill-at", module.underscoreSymbols ? " --add-underscore" : "" ); } + else + arRule1.Execute ( fMakefile, backend, module, archiveFilename, clean_files ); if ( definitionFilename ) delete definitionFilename; @@ -1763,6 +1780,7 @@ MingwModuleHandler::GenerateObjectMacro () void MingwModuleHandler::GenerateTargetMacro () { + fprintf ( fMakefile, "# TARGET MACRO\n" ); fprintf ( fMakefile, "%s := %s\n", GetTargetMacro ( module, false ).c_str (), @@ -1824,6 +1842,8 @@ MingwModuleHandler::GenerateOtherMacros () { set used_defs; + fprintf ( fMakefile, "# OTHER MACROS\n" ); + cflagsMacro = ssprintf ("%s_CFLAGS", module.name.c_str ()); nasmflagsMacro = ssprintf ("%s_NASMFLAGS", module.name.c_str ()); windresflagsMacro = ssprintf ("%s_RCFLAGS", module.name.c_str ()); @@ -1847,21 +1867,11 @@ MingwModuleHandler::GenerateOtherMacros () used_defs ); } - vector s; - if ( module.importLibrary ) - { - const vector& compilationUnits = module.non_if_data.compilationUnits; - for ( size_t i = 0; i < compilationUnits.size (); i++ ) - { - CompilationUnit& compilationUnit = *compilationUnits[i]; - const FileLocation& sourceFile = compilationUnit.GetFilename (); - string extension = GetExtension ( sourceFile ); - if ( extension == ".spec" || extension == ".SPEC" ) - GetSpecObjectDependencies ( s, &sourceFile ); - } - } - if ( s.size () > 0 ) + if ( IsWineModule() ) { + vector s; + GetSpecImplibDependencies ( s, module.importLibrary->source ); + fprintf ( fMakefile, "%s +=", @@ -1989,6 +1999,7 @@ MingwModuleHandler::GenerateOtherMacros () void MingwModuleHandler::GenerateRules () { + fprintf ( fMakefile, "# RULES\n" ); string targetMacro = GetTargetMacro ( module ); //CLEAN_FILE ( targetMacro ); CLEAN_FILE ( FileLocation ( SourceDirectory, "", targetMacro ) ); @@ -2015,6 +2026,18 @@ MingwModuleHandler::GenerateRules () delete ar_target; } + if ( IsWineModule() ) + { + Rule * defRule; + + if ( module.type == Kernel || module.type == KernelModeDLL || module.type == KernelModeDriver ) + defRule = &winebuildKMDefRule; + else + defRule = &winebuildDefRule; + + defRule->Execute ( fMakefile, backend, module, module.importLibrary->source, clean_files ); + } + GenerateObjectFileTargets (); } @@ -2039,6 +2062,8 @@ MingwModuleHandler::GenerateInvocations () const if ( module.invocations.size () == 0 ) return; + fprintf ( fMakefile, "# INVOCATIONS\n" ); + size_t iend = module.invocations.size (); for ( size_t i = 0; i < iend; i++ ) { @@ -2135,6 +2160,7 @@ MingwModuleHandler::GetDefaultDependencies ( void MingwModuleHandler::GeneratePreconditionDependencies () { + fprintf ( fMakefile, "# PRECONDITION DEPENDENCIES\n" ); string preconditionDependenciesName = GetPreconditionDependenciesName (); string_list dependencies; GetDefaultDependencies ( dependencies ); @@ -2163,7 +2189,7 @@ MingwModuleHandler::IsWineModule () const if ( module.importLibrary == NULL) return false; - size_t index = module.importLibrary->source->name.rfind ( ".spec.def" ); + size_t index = module.importLibrary->source->name.rfind ( ".spec" ); return ( index != string::npos ); } @@ -2174,15 +2200,18 @@ MingwModuleHandler::GetDefinitionFilename () const if ( module.importLibrary == NULL ) return NULL; - DirectoryLocation directory; if ( IsWineModule () ) - directory = IntermediateDirectory; + { + return new FileLocation ( IntermediateDirectory, + module.importLibrary->source->relative_path, + GetBasename ( module.importLibrary->source->name ) + "_" + module.name + ".spec.def" ); + } else - directory = SourceDirectory; - - return new FileLocation ( directory, - module.importLibrary->source->relative_path, - module.importLibrary->source->name ); + { + return new FileLocation ( SourceDirectory, + module.importLibrary->source->relative_path, + module.importLibrary->source->name ); + } } void @@ -2197,7 +2226,7 @@ MingwModuleHandler::GenerateImportLibraryTargetIfNeeded () vector deps; GetDefinitionDependencies ( deps ); - fprintf ( fMakefile, "# IMPORT LIBRARY RULE:\n" ); + fprintf ( fMakefile, "# IMPORT LIBRARY RULE\n" ); fprintf ( fMakefile, "%s:", backend->GetFullName ( *library_target ).c_str () ); @@ -2238,17 +2267,19 @@ MingwModuleHandler::GetSpecObjectDependencies ( vector& dependencies, const FileLocation *file ) const { - string basename = GetBasename ( file->name ); + dependencies.push_back ( FileLocation ( IntermediateDirectory, + file->relative_path, + GetBasename ( file->name ) + "_" + module.name + ".stubs.c" ) ); +} - FileLocation defDependency ( IntermediateDirectory, - file->relative_path, - basename + ".spec.def" ); - dependencies.push_back ( defDependency ); - - FileLocation stubsDependency ( IntermediateDirectory, - file->relative_path, - basename + ".stubs.c" ); - dependencies.push_back ( stubsDependency ); +void +MingwModuleHandler::GetSpecImplibDependencies ( + vector& dependencies, + const FileLocation *file ) const +{ + dependencies.push_back ( FileLocation ( IntermediateDirectory, + file->relative_path, + GetBasename ( file->name ) + "_" + module.name + ".spec.def" ) ); } void @@ -2355,6 +2386,8 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget () GenerateRules (); + fprintf ( fMakefile, "# BUILD TOOL MODULE TARGET\n" ); + string linker; if ( module.cplusplus ) linker = "${host_gpp}"; @@ -2862,6 +2895,8 @@ MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget () GenerateRules (); + fprintf ( fMakefile, "# BOOT LOADER MODULE TARGET\n" ); + const FileLocation *target_file = GetTargetFilename ( module, NULL ); fprintf ( fMakefile, "%s: %s %s | %s\n", targetMacro.c_str (), @@ -2938,6 +2973,8 @@ MingwBootProgramModuleHandler::GenerateBootProgramModuleTarget () GenerateRules (); + fprintf ( fMakefile, "# BOOT PROGRAM MODULE TARGET\n" ); + const FileLocation *target_file = GetTargetFilename ( module, NULL ); fprintf ( fMakefile, "%s: %s %s %s | %s\n", targetMacro.c_str (), @@ -3112,6 +3149,7 @@ MingwIsoModuleHandler::GetCdFiles ( void MingwIsoModuleHandler::GenerateIsoModuleTarget () { + fprintf ( fMakefile, "# ISO MODULE TARGET\n" ); string bootcdDirectory = "cd"; FileLocation bootcd ( OutputDirectory, bootcdDirectory, @@ -3305,6 +3343,7 @@ MingwLiveIsoModuleHandler::OutputLoaderCommands ( string& livecdDirectory ) void MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory ) { + fprintf ( fMakefile, "# REGISTRY COMMANDS\n" ); FileLocation reactosSystem32ConfigDirectory ( OutputDirectory, livecdDirectory + sSep + "reactos" + sSep + "system32" + sSep + "config", "" ); @@ -3319,6 +3358,7 @@ MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory ) void MingwLiveIsoModuleHandler::GenerateLiveIsoModuleTarget () { + fprintf ( fMakefile, "# LIVE ISO MODULE TARGET\n" ); string livecdDirectory = module.name; FileLocation livecd ( OutputDirectory, livecdDirectory, "" ); @@ -3453,6 +3493,7 @@ MingwCabinetModuleHandler::Process () GenerateRules (); + fprintf ( fMakefile, "# CABINET MODULE TARGET\n" ); const FileLocation *target_file = GetTargetFilename ( module, NULL ); fprintf ( fMakefile, "%s: $(CABMAN_TARGET) | %s\n", targetMacro.c_str (), @@ -3484,6 +3525,7 @@ MingwElfExecutableModuleHandler::Process () GenerateRules (); + fprintf ( fMakefile, "# ELF EXECUTABLE TARGET\n" ); const FileLocation *target_file = GetTargetFilename ( module, NULL ); fprintf ( fMakefile, "%s: %s %s | %s\n", targetMacro.c_str (), diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index ac300459a82..bf5e4a6e16d 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -148,6 +148,8 @@ private: const FileLocation *file ) const; void GetSpecObjectDependencies ( std::vector& dependencies, const FileLocation *file ) const; + void GetSpecImplibDependencies ( std::vector& dependencies, + const FileLocation *file ) const; void GetWidlObjectDependencies ( std::vector& dependencies, const FileLocation *file ) const; void GetDefaultDependencies ( string_list& dependencies ) const; diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index d710f7c1eeb..ba94ea8a8c0 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -1721,12 +1721,6 @@ ImportLibrary::ImportLibrary ( const Project& project, "root", att->value ); } - else - { - size_t index = definition->value.rfind ( ".spec.def" ); - if ( index != string::npos ) - directory = IntermediateDirectory; - } if ( dllname ) this->dllname = dllname->value; From 24967a19d447460826519a32a4c2fed52392f85f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 24 Oct 2008 20:53:05 +0000 Subject: [PATCH 353/388] fix ntoskrnl spec file svn path=/branches/ros-amd64-bringup/; revision=36925 --- reactos/ntoskrnl/ntoskrnl.spec | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/reactos/ntoskrnl/ntoskrnl.spec b/reactos/ntoskrnl/ntoskrnl.spec index c742bd33ccf..9fb2550a30c 100644 --- a/reactos/ntoskrnl/ntoskrnl.spec +++ b/reactos/ntoskrnl/ntoskrnl.spec @@ -55,6 +55,9 @@ @ stdcall DbgPrompt(str ptr long) @ stdcall DbgQueryDebugFilterState(long long) @ stdcall DbgSetDebugFilterState(long long long) +#ifdef __x86_64__ +@ fastcall ExAcquireFastMutex(ptr) +#endif @ fastcall ExAcquireFastMutexUnsafe(ptr) @ stdcall ExAcquireResourceExclusiveLite(ptr long) @ stdcall ExAcquireResourceSharedLite(ptr long) @@ -103,18 +106,26 @@ @ stdcall ExInterlockedAddLargeInteger(ptr long long ptr) @ fastcall ExInterlockedAddLargeStatistic(ptr long) @ stdcall ExInterlockedAddUlong(ptr long ptr) +#ifndef __x86_64__ @ fastcall ExInterlockedCompareExchange64(ptr ptr ptr ptr) @ stdcall ExInterlockedDecrementLong(ptr ptr) @ stdcall ExInterlockedExchangeUlong(ptr long ptr) +#endif @ stdcall ExInterlockedExtendZone(ptr ptr long ptr) +#ifndef __x86_64__ @ fastcall ExInterlockedFlushSList(ptr) @ stdcall ExInterlockedIncrementLong(ptr ptr) +#endif @ stdcall ExInterlockedInsertHeadList(ptr ptr ptr) @ stdcall ExInterlockedInsertTailList(ptr ptr ptr) @ stdcall ExInterlockedPopEntryList(ptr ptr) +#ifndef __x86_64__ @ fastcall ExInterlockedPopEntrySList(ptr ptr) +#endif @ stdcall ExInterlockedPushEntryList(ptr ptr ptr) +#ifndef __x86_64__ @ fastcall ExInterlockedPushEntrySList(ptr ptr ptr) +#endif @ stdcall ExInterlockedRemoveHeadList(ptr ptr) @ stdcall ExIsProcessorFeaturePresent(long) @ stdcall ExIsResourceAcquiredExclusiveLite(ptr) @@ -132,6 +143,9 @@ @ fastcall ExReInitializeRundownProtectionCacheAware(ptr) ExfReInitializeRundownProtectionCacheAware @ stdcall ExRegisterCallback(ptr ptr ptr) @ stdcall ExReinitializeResourceLite(ptr) +#ifdef __x86_64__ +@ fastcall ExReleaseFastMutex(ptr) +#endif @ fastcall ExReleaseFastMutexUnsafe(ptr) @ fastcall ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(ptr) @ fastcall ExReleaseResourceAndLeaveCriticalRegion(ptr) @@ -149,6 +163,9 @@ @ stdcall ExSizeOfRundownProtectionCacheAware() @ stdcall ExSystemExceptionFilter() @ stdcall ExSystemTimeToLocalTime(ptr ptr) +#ifdef __x86_64__ +@ fastcall ExTryToAcquireFastMutex(ptr) +#endif @ stdcall ExUnregisterCallback(ptr) @ stdcall ExUuidCreate(ptr) @ stdcall ExVerifySuite(long) @@ -157,6 +174,7 @@ @ extern ExWindowStationObjectType @ fastcall ExfAcquirePushLockExclusive(ptr) @ fastcall ExfAcquirePushLockShared(ptr) +#ifndef __x86_64__ @ fastcall ExfInterlockedAddUlong(ptr long ptr) @ fastcall ExfInterlockedCompareExchange64(ptr ptr ptr) @ fastcall ExfInterlockedInsertHeadList(ptr ptr ptr) @@ -164,11 +182,17 @@ @ fastcall ExfInterlockedPopEntryList(ptr ptr) @ fastcall ExfInterlockedPushEntryList(ptr ptr ptr) @ fastcall ExfInterlockedRemoveHeadList(ptr ptr) +#endif @ fastcall ExfReleasePushLock(ptr) @ fastcall ExfReleasePushLockExclusive(ptr) @ fastcall ExfReleasePushLockShared(ptr) @ fastcall ExfTryToWakePushLock(ptr) @ fastcall ExfUnblockPushLock(ptr ptr) +#ifdef __x86_64__ +@ stdcall ExpInterlockedFlushSList(ptr) +@ stdcall ExpInterlockedPopEntrySList(ptr ptr) +@ stdcall ExpInterlockedPushEntrySList(ptr ptr) +#endif #ifdef _M_IX86 @ fastcall Exfi386InterlockedDecrementLong(ptr) @ fastcall Exfi386InterlockedExchangeUlong(ptr long) @@ -177,9 +201,11 @@ @ stdcall Exi386InterlockedExchangeUlong(ptr long long) @ stdcall Exi386InterlockedIncrementLong(ptr) #endif +#ifdef _M_IX86 @ fastcall ExiAcquireFastMutex(ptr) ExAcquireFastMutex @ fastcall ExiReleaseFastMutex(ptr) ExReleaseFastMutex @ fastcall ExiTryToAcquireFastMutex(ptr) ExTryToAcquireFastMutex +#endif @ stdcall FsRtlAcquireFileExclusive(ptr) ;FsRtlAddBaseMcbEntry @ stdcall FsRtlAddLargeMcbEntry(ptr long long long long long long) @@ -321,8 +347,10 @@ @ fastcall InterlockedExchange(ptr long) @ fastcall InterlockedExchangeAdd(ptr long) @ fastcall InterlockedIncrement(ptr) +#ifndef __x86_64__ @ fastcall InterlockedPopEntrySList(ptr) @ fastcall InterlockedPushEntrySList(ptr ptr) +#endif @ stdcall IoAcquireCancelSpinLock(ptr) @ stdcall IoAcquireRemoveLockEx(ptr ptr str long long) @ stdcall IoAcquireVpbSpinLock(ptr) @@ -549,6 +577,9 @@ @ stdcall KeAcquireInterruptSpinLock(ptr) @ stdcall KeAcquireSpinLockAtDpcLevel(ptr) @ fastcall KeAcquireSpinLockForDpc(ptr) +#ifdef __x86_64__ +@ stdcall KeAcquireSpinLockRaiseToDpc(ptr) +#endif @ stdcall KeAddSystemServiceTable(ptr ptr long ptr long) @ stdcall KeAreAllApcsDisabled() @ stdcall KeAreApcsDisabled() @@ -599,7 +630,9 @@ @ stdcall KeInitializeMutex(ptr long) @ stdcall KeInitializeQueue(ptr long) @ stdcall KeInitializeSemaphore(ptr long long) +#ifndef __x86_64__ @ stdcall KeInitializeSpinLock(ptr) +#endif @ stdcall KeInitializeThreadedDpc(ptr ptr ptr) @ stdcall KeInitializeTimer(ptr) @ stdcall KeInitializeTimerEx(ptr long) @@ -622,10 +655,14 @@ @ stdcall KeProfileInterruptWithSource(ptr long) @ stdcall KePulseEvent(ptr long long) @ stdcall KeQueryActiveProcessors() +#ifndef __x86_64__ @ stdcall KeQueryInterruptTime() +#endif @ stdcall KeQueryPriorityThread(ptr) @ stdcall KeQueryRuntimeThread(ptr ptr) +#ifndef __x86_64__ @ stdcall KeQuerySystemTime(ptr) +#endif @ stdcall KeQueryTickCount(ptr) @ stdcall KeQueryTimeIncrement() @ stdcall KeRaiseUserException(long) @@ -646,6 +683,9 @@ @ stdcall KeReleaseMutant(ptr long long long) @ stdcall KeReleaseMutex(ptr long) @ stdcall KeReleaseSemaphore(ptr long long long) +#ifdef __x86_64__ +@ stdcall KeReleaseSpinLock(ptr long) +#endif @ fastcall KeReleaseSpinLockForDpc(ptr long) @ stdcall KeReleaseSpinLockFromDpcLevel(ptr) @ stdcall KeRemoveByKeyDeviceQueue(ptr long) @@ -1023,12 +1063,14 @@ @ stdcall PsTerminateSystemThread(long) @ extern PsThreadType _PsThreadType ;PsWrapApcWow64Thread +#ifndef __x86_64__ @ stdcall READ_REGISTER_BUFFER_UCHAR(ptr ptr long) @ stdcall READ_REGISTER_BUFFER_ULONG(ptr ptr long) @ stdcall READ_REGISTER_BUFFER_USHORT(ptr ptr long) @ stdcall READ_REGISTER_UCHAR(ptr) @ stdcall READ_REGISTER_ULONG(ptr) @ stdcall READ_REGISTER_USHORT(ptr) +#endif @ stdcall KeRosDumpStackFrames(ptr long) @ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr) @ stdcall RtlAddAccessAllowedAce(ptr long long ptr) @@ -1276,8 +1318,10 @@ ;RtlTraceDatabaseLock ;RtlTraceDatabaseUnlock ;RtlTraceDatabaseValidate +#ifndef __x86_64__ @ fastcall RtlUlongByteSwap(long) @ fastcall RtlUlonglongByteSwap(long long) +#endif @ stdcall RtlUnicodeStringToAnsiSize(ptr) RtlxUnicodeStringToAnsiSize @ stdcall RtlUnicodeStringToAnsiString(ptr ptr long) @ stdcall RtlUnicodeStringToCountedOemString(ptr ptr long) @@ -1300,7 +1344,9 @@ @ stdcall RtlUpcaseUnicodeToOemN(ptr long ptr wstr long) @ stdcall RtlUpperChar(long) @ stdcall RtlUpperString(ptr ptr) +#ifndef __x86_64__ @ fastcall RtlUshortByteSwap(long) +#endif @ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) @ stdcall RtlValidSecurityDescriptor(ptr) @ stdcall RtlValidSid(ptr) @@ -1371,12 +1417,14 @@ ;VfFailDriver ;VfFailSystemBIOS ;VfIsVerificationEnabled +#ifndef __x86_64__ @ stdcall WRITE_REGISTER_BUFFER_UCHAR(ptr ptr long) @ stdcall WRITE_REGISTER_BUFFER_ULONG(ptr ptr long) @ stdcall WRITE_REGISTER_BUFFER_USHORT(ptr ptr long) @ stdcall WRITE_REGISTER_UCHAR(ptr long) @ stdcall WRITE_REGISTER_ULONG(ptr long) @ stdcall WRITE_REGISTER_USHORT(ptr long) +#endif ;WmiFlushTrace ;WmiGetClock ;WmiQueryTrace @@ -1515,7 +1563,9 @@ ;_CIcos ;_CIsin ;_CIsqrt +#ifndef __x86_64 @ cdecl _abnormal_termination() +#endif #ifdef _M_IX86 @ cdecl _alldiv() @ cdecl _alldvrm() @@ -1529,12 +1579,16 @@ @ cdecl _aullrem() @ cdecl _aullshr() #endif +#ifndef __x86_64 @ cdecl _except_handler2() @ cdecl _except_handler3() @ cdecl _global_unwind2() +#endif @ cdecl _itoa() @ cdecl _itow() +#ifndef __x86_64 @ cdecl _local_unwind2() +#endif @ cdecl _purecall() @ cdecl _snprintf() @ cdecl _snwprintf() From 0aec5330db22419d071e7a558ed64b5bf39c547d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 24 Oct 2008 20:58:06 +0000 Subject: [PATCH 354/388] sync to trunk head (36925) svn path=/branches/ros-amd64-bringup/; revision=36926 --- reactos/drivers/network/afd/afd/connect.c | 10 +++---- reactos/drivers/network/afd/afd/listen.c | 10 +++---- reactos/drivers/network/afd/afd/read.c | 21 ++++++++------- reactos/drivers/network/afd/afd/write.c | 26 +++++++++---------- .../drivers/network/tcpip/tcpip/dispatch.c | 20 +++++++++++--- reactos/drivers/network/tcpip/tcpip/main.c | 1 + reactos/lib/drivers/ip/network/arp.c | 2 +- .../drivers/ip/transport/datagram/datagram.c | 3 +++ 8 files changed, 55 insertions(+), 38 deletions(-) diff --git a/reactos/drivers/network/afd/afd/connect.c b/reactos/drivers/network/afd/afd/connect.c index 4c02da62f56..5d4bddf4509 100644 --- a/reactos/drivers/network/afd/afd/connect.c +++ b/reactos/drivers/network/afd/afd/connect.c @@ -77,11 +77,6 @@ static NTSTATUS NTAPI StreamSocketConnectComplete AFD_DbgPrint(MID_TRACE,("Called: FCB %x, FO %x\n", Context, FCB->FileObject)); - if( Irp->Cancel ) { - if( FCB ) FCB->ConnectIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - /* I was wrong about this before as we can have pending writes to a not * yet connected socket */ if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; @@ -91,6 +86,11 @@ static NTSTATUS NTAPI StreamSocketConnectComplete FCB->ConnectIrp.InFlightRequest = NULL; + if( Irp->Cancel ) { + SocketStateUnlock( FCB ); + return STATUS_CANCELLED; + } + if( NT_SUCCESS(Irp->IoStatus.Status) ) { FCB->PollState |= AFD_EVENT_CONNECT | AFD_EVENT_SEND; AFD_DbgPrint(MID_TRACE,("Going to connected state %d\n", FCB->State)); diff --git a/reactos/drivers/network/afd/afd/listen.c b/reactos/drivers/network/afd/afd/listen.c index 061342cb774..552d1a2d248 100644 --- a/reactos/drivers/network/afd/afd/listen.c +++ b/reactos/drivers/network/afd/afd/listen.c @@ -102,15 +102,15 @@ static NTSTATUS NTAPI ListenComplete PAFD_FCB FCB = (PAFD_FCB)Context; PAFD_TDI_OBJECT_QELT Qelt; - if( Irp->Cancel ) { - if( FCB ) FCB->ListenIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->ListenIrp.InFlightRequest = NULL; + if( Irp->Cancel ) { + SocketStateUnlock( FCB ); + return STATUS_CANCELLED; + } + if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); DestroySocket( FCB ); diff --git a/reactos/drivers/network/afd/afd/read.c b/reactos/drivers/network/afd/afd/read.c index 2271a986d89..365eafcabe8 100644 --- a/reactos/drivers/network/afd/afd/read.c +++ b/reactos/drivers/network/afd/afd/read.c @@ -234,14 +234,15 @@ NTSTATUS NTAPI ReceiveComplete ASSERT_IRQL(APC_LEVEL); - if( Irp->Cancel ) { - if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->ReceiveIrp.InFlightRequest = NULL; + + if( Irp->Cancel ) { + SocketStateUnlock( FCB ); + return STATUS_CANCELLED; + } + FCB->Recv.Content = Irp->IoStatus.Information; FCB->Recv.BytesUsed = 0; @@ -455,15 +456,15 @@ PacketSocketRecvComplete( AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); - if( Irp->Cancel ) { - if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->ReceiveIrp.InFlightRequest = NULL; + if( Irp->Cancel ) { + SocketStateUnlock( FCB ); + return STATUS_CANCELLED; + } + if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); DestroySocket( FCB ); diff --git a/reactos/drivers/network/afd/afd/write.c b/reactos/drivers/network/afd/afd/write.c index a6bdd134427..bb326e575f3 100644 --- a/reactos/drivers/network/afd/afd/write.c +++ b/reactos/drivers/network/afd/afd/write.c @@ -40,16 +40,16 @@ static NTSTATUS NTAPI SendComplete ASSERT_IRQL(APC_LEVEL); - if( Irp->Cancel ) { - if( FCB ) FCB->SendIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->SendIrp.InFlightRequest = NULL; /* Request is not in flight any longer */ + if( Irp->Cancel ) { + SocketStateUnlock( FCB ); + return STATUS_CANCELLED; + } + if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); DestroySocket( FCB ); @@ -176,20 +176,20 @@ static NTSTATUS NTAPI PacketSocketSendComplete Irp->IoStatus.Status, Irp->IoStatus.Information)); - if( Irp->Cancel ) { - if( FCB ) FCB->SendIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - /* It's ok if the FCB already died */ if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS; - FCB->PollState |= AFD_EVENT_SEND; - PollReeval( FCB->DeviceExt, FCB->FileObject ); - FCB->SendIrp.InFlightRequest = NULL; /* Request is not in flight any longer */ + if( Irp->Cancel ) { + SocketStateUnlock( FCB ); + return STATUS_CANCELLED; + } + + FCB->PollState |= AFD_EVENT_SEND; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); DestroySocket( FCB ); diff --git a/reactos/drivers/network/tcpip/tcpip/dispatch.c b/reactos/drivers/network/tcpip/tcpip/dispatch.c index 9962f4b0406..6f66cf7f362 100644 --- a/reactos/drivers/network/tcpip/tcpip/dispatch.c +++ b/reactos/drivers/network/tcpip/tcpip/dispatch.c @@ -485,18 +485,22 @@ NTSTATUS DispTdiDisconnect( IrpSp = IoGetCurrentIrpStackLocation(Irp); DisReq = (PTDI_REQUEST_KERNEL_DISCONNECT)&IrpSp->Parameters; + TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + /* Get associated connection endpoint file object. Quit if none exists */ TranContext = IrpSp->FileObject->FsContext; if (!TranContext) { TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } Connection = (PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext; if (!Connection) { TI_DbgPrint(MID_TRACE, ("No connection endpoint file object.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; } Status = TCPDisconnect( @@ -507,7 +511,15 @@ NTSTATUS DispTdiDisconnect( DispDataRequestComplete, Irp ); - TI_DbgPrint(MAX_TRACE, ("TCP Connect returned %08x\n", Status)); +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, 0); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + + TI_DbgPrint(MAX_TRACE, ("TCP Disconnect returned %08x\n", Status)); return Status; } @@ -1494,7 +1506,7 @@ NTSTATUS DispTdiSetInformationEx( TI_DbgPrint(DEBUG_IRP, ("Completing IRP at (0x%X).\n", Irp)); - return IRPFinish(Irp, STATUS_INVALID_PARAMETER); + return Irp->IoStatus.Status; } Status = DispPrepareIrpForCancel(TranContext, Irp, NULL); diff --git a/reactos/drivers/network/tcpip/tcpip/main.c b/reactos/drivers/network/tcpip/tcpip/main.c index 70c9df483b5..d5c94d7da0b 100644 --- a/reactos/drivers/network/tcpip/tcpip/main.c +++ b/reactos/drivers/network/tcpip/tcpip/main.c @@ -437,6 +437,7 @@ TiDispatchInternal( case TDI_DISCONNECT: Status = DispTdiDisconnect(Irp); + Complete = FALSE; break; case TDI_ASSOCIATE_ADDRESS: diff --git a/reactos/lib/drivers/ip/network/arp.c b/reactos/lib/drivers/ip/network/arp.c index 5c830589ca8..124ea51f97a 100644 --- a/reactos/lib/drivers/ip/network/arp.c +++ b/reactos/lib/drivers/ip/network/arp.c @@ -230,7 +230,7 @@ VOID ARPReceive( Header->HWAddrLen, NUD_REACHABLE); } - if (Header->Opcode != ARP_OPCODE_REQUEST) + if (Header->Opcode != ARP_OPCODE_REQUEST || !NCE) return; /* This is a request for our address. Swap the addresses and diff --git a/reactos/lib/drivers/ip/transport/datagram/datagram.c b/reactos/lib/drivers/ip/transport/datagram/datagram.c index 0b701338075..8f4d81ba1ba 100644 --- a/reactos/lib/drivers/ip/transport/datagram/datagram.c +++ b/reactos/lib/drivers/ip/transport/datagram/datagram.c @@ -254,6 +254,9 @@ NTSTATUS DGReceiveDatagram( { ReceiveRequest->RemotePort = 0; } + + IoMarkIrpPending(Irp); + ReceiveRequest->ReturnInfo = ReturnInfo; ReceiveRequest->Buffer = BufferData; ReceiveRequest->BufferSize = ReceiveLength; From 47867bdabcdad6e847e430df25697fbb76a4c763 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 25 Oct 2008 07:04:51 +0000 Subject: [PATCH 355/388] Fix more rbuild files and fix up gdi32 and glu32 spec files. svn path=/branches/ros-amd64-bringup/; revision=36930 --- reactos/dll/win32/fmifs/fmifs.rbuild | 2 +- reactos/dll/win32/gdi32/gdi32.spec | 32 +++++++++++++------------- reactos/dll/win32/glu32/glu32.spec | 2 +- reactos/dll/win32/lsasrv/lsasrv.rbuild | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/reactos/dll/win32/fmifs/fmifs.rbuild b/reactos/dll/win32/fmifs/fmifs.rbuild index b3d73948ea6..51dc83594f0 100644 --- a/reactos/dll/win32/fmifs/fmifs.rbuild +++ b/reactos/dll/win32/fmifs/fmifs.rbuild @@ -1,5 +1,5 @@ - + . 0x0600 diff --git a/reactos/dll/win32/gdi32/gdi32.spec b/reactos/dll/win32/gdi32/gdi32.spec index e3614ceddb3..34f2f096c29 100644 --- a/reactos/dll/win32/gdi32/gdi32.spec +++ b/reactos/dll/win32/gdi32/gdi32.spec @@ -288,22 +288,22 @@ @ stdcall GdiDrawStream(ptr long ptr) @ stdcall GdiEndDocEMF(ptr) @ stdcall GdiEndPageEMF(ptr long) -#@ stdcall GdiEntry1 -#@ stdcall GdiEntry10 -#@ stdcall GdiEntry11 -#@ stdcall GdiEntry12 -#@ stdcall GdiEntry13 -#@ stdcall GdiEntry14 -#@ stdcall GdiEntry15 -#@ stdcall GdiEntry16 -#@ stdcall GdiEntry2 -#@ stdcall GdiEntry3 -#@ stdcall GdiEntry4 -#@ stdcall GdiEntry5 -#@ stdcall GdiEntry6 -#@ stdcall GdiEntry7 -#@ stdcall GdiEntry8 -#@ stdcall GdiEntry9 +@ stdcall GdiEntry1(ptr ptr) gdi32.DdCreateDirectDrawObject +@ stdcall GdiEntry10(ptr long) gdi32.DdReenableDirectDrawObject +@ stdcall GdiEntry11(ptr ptr) gdi32.DdAttachSurface +@ stdcall GdiEntry12(ptr ptr) gdi32.DdUnattachSurface +@ stdcall GdiEntry13() gdi32.DdQueryDisplaySettingsUniqueness +@ stdcall GdiEntry14(ptr ptr long) gdi32.DdGetDxHandle +@ stdcall GdiEntry15(ptr ptr ptr) gdi32.DdSetGammaRamp +@ stub GdiEntry16 +@ stdcall GdiEntry2(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) gdi32.DdQueryDirectDrawObject +@ stdcall GdiEntry3(ptr) gdi32.DdDeleteDirectDrawObject +@ stdcall GdiEntry4(ptr long) gdi32.DdCreateSurfaceObject +@ stdcall GdiEntry5(ptr) gdi32.DdDeleteSurfaceObject +@ stdcall GdiEntry6(ptr ptr) gdi32.DdResetVisrgn +@ stdcall GdiEntry7(ptr ptr) gdi32.DdGetDC +@ stdcall GdiEntry8(ptr) gdi32.DdReleaseDC +@ stdcall GdiEntry9(ptr ptr ptr ptr ptr ptr) gdi32.DdCreateDIBSection @ stdcall GdiFixUpHandle(ptr) @ stdcall GdiFlush() @ stdcall GdiFullscreenControl(ptr ptr long ptr ptr) NtGdiFullscreenControl diff --git a/reactos/dll/win32/glu32/glu32.spec b/reactos/dll/win32/glu32/glu32.spec index 392f187fd0e..79a654814b1 100644 --- a/reactos/dll/win32/glu32/glu32.spec +++ b/reactos/dll/win32/glu32/glu32.spec @@ -18,7 +18,7 @@ @ stub gluErrorUnicodeStringEXT @ stdcall gluGetNurbsProperty(ptr long ptr) @ stdcall gluGetString(long) -@ stdcall gluGetTessProperty(ptr long double) +@ stdcall gluGetTessProperty(ptr ptr ptr) @ stdcall gluLoadSamplingMatrices(ptr ptr ptr ptr) @ stdcall gluLookAt(double double double double double double double double double) @ stdcall gluNewNurbsRenderer() diff --git a/reactos/dll/win32/lsasrv/lsasrv.rbuild b/reactos/dll/win32/lsasrv/lsasrv.rbuild index 5614f96ed79..53d014f491b 100644 --- a/reactos/dll/win32/lsasrv/lsasrv.rbuild +++ b/reactos/dll/win32/lsasrv/lsasrv.rbuild @@ -1,5 +1,5 @@ - + . . 0x600 From 7d76ec86b67694643ef110cb68b881f7459db65e Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 25 Oct 2008 07:58:51 +0000 Subject: [PATCH 356/388] - Covert to spec. - Fix 64bit build. - Could benefit from a WINE sync. ;) svn path=/branches/ros-amd64-bringup/; revision=36935 --- reactos/dll/win32/secur32/lsa.c | 4 +- reactos/dll/win32/secur32/secur32.def | 79 ------------------------ reactos/dll/win32/secur32/secur32.rbuild | 3 +- reactos/dll/win32/secur32/secur32.spec | 73 ++++++++++++++++++++++ 4 files changed, 77 insertions(+), 82 deletions(-) delete mode 100644 reactos/dll/win32/secur32/secur32.def create mode 100644 reactos/dll/win32/secur32/secur32.spec diff --git a/reactos/dll/win32/secur32/lsa.c b/reactos/dll/win32/secur32/lsa.c index b8ff26041c1..187508cc1c5 100644 --- a/reactos/dll/win32/secur32/lsa.c +++ b/reactos/dll/win32/secur32/lsa.c @@ -256,8 +256,8 @@ LsaLogonUser(HANDLE LsaHandle, 0, Reply->d.LogonUserReply.ProfileBufferLength); memcpy(*ProfileBuffer, - (PVOID)((ULONG)Reply->d.LogonUserReply.Data + - (ULONG)Reply->d.LogonUserReply.ProfileBuffer), + (PVOID)((ULONG_PTR)Reply->d.LogonUserReply.Data + + (ULONG_PTR)Reply->d.LogonUserReply.ProfileBuffer), Reply->d.LogonUserReply.ProfileBufferLength); *LogonId = Reply->d.LogonUserReply.LogonId; *Token = Reply->d.LogonUserReply.Token; diff --git a/reactos/dll/win32/secur32/secur32.def b/reactos/dll/win32/secur32/secur32.def deleted file mode 100644 index 38ae5e343a5..00000000000 --- a/reactos/dll/win32/secur32/secur32.def +++ /dev/null @@ -1,79 +0,0 @@ -LIBRARY SECUR32.DLL -EXPORTS -LsaRegisterLogonProcess@12 -LsaLogonUser@56 -LsaDeregisterLogonProcess@4 -LsaConnectUntrusted@4 -LsaLookupAuthenticationPackage@12 -LsaFreeReturnBuffer@4 -LsaCallAuthenticationPackage@28 -;AcceptSecurityContext@36 -AcquireCredentialsHandleA@36 -AcquireCredentialsHandleW@36 -;@AddCredentialsA -;@AddCredentialsW -;@AddSecurityPackageA -;@AddSecurityPackageW -;ApplyControlTokenA@8 -ApplyControlToken@8=ApplyControlTokenW@8 -CompleteAuthToken@8 -;@CredMarshalTargetInfo -;@CredUnmarshalTargetInfo -DecryptMessage@16 -DeleteSecurityContext@4 -;@DeleteSecurityPackageA -;@DeleteSecurityPackageW -EncryptMessage@16 -EnumerateSecurityPackagesA@8 -EnumerateSecurityPackagesW@8 -;@ExportSecurityContext -FreeContextBuffer@4 -FreeCredentialsHandle@4 -GetComputerObjectNameA@12 -GetComputerObjectNameW@12 -;GetSecurityUserInfo -GetUserNameExA@12 -GetUserNameExW@12 -;ImpersonateSecurityContext@4 -;@ImportSecurityContextA -;@ImportSecurityContextW -;@InitSecurityInterfaceA -InitSecurityInterfaceW@0 -InitializeSecurityContextA@48 -InitializeSecurityContextW@48 -LsaEnumerateLogonSessions@8 -LsaGetLogonSessionData@8 -LsaRegisterPolicyChangeNotification@8 -LsaUnregisterPolicyChangeNotification@8 -MakeSignature@16 -QueryContextAttributesA@12 -QueryContextAttributesW@12 -;QueryCredentialsAttributesA@12 -;QueryCredentialsAttributesW@12 -;@QuerySecurityContextToken -QuerySecurityPackageInfoA@8 -QuerySecurityPackageInfoW@8 -;RevertSecurityContext@4 -;@SaslAcceptSecurityContext -;@SaslEnumerateProfilesA -;@SaslEnumerateProfilesW -;@SaslGetProfilePackageA -;@SaslGetProfilePackageW -;@SaslIdentifyPackageA -;@SaslIdentifyPackageW -;@SaslInitializeSecurityContextA -;@SaslInitializeSecurityContextW -;SealMessage -;SecCacheSspiPackages -;SecDeleteUserModeContext -;SecGetLocaleSpecificEncryptionRules -;SecInitUserModeContext -;SecpFreeMemory -;SecpTranslateName -;SecpTranslateNameEx -;@SetContextAttributesA -;@SetContextAttributesW -;TranslateNameA@20 -;TranslateNameW@20 -;UnsealMessage -VerifySignature@16 diff --git a/reactos/dll/win32/secur32/secur32.rbuild b/reactos/dll/win32/secur32/secur32.rbuild index a1f0d8298dc..9ba0169787e 100644 --- a/reactos/dll/win32/secur32/secur32.rbuild +++ b/reactos/dll/win32/secur32/secur32.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/subsys @@ -12,5 +12,6 @@ secext.c sspi.c secur32.rc + secur32.spec precomp.h diff --git a/reactos/dll/win32/secur32/secur32.spec b/reactos/dll/win32/secur32/secur32.spec new file mode 100644 index 00000000000..9fe6114d369 --- /dev/null +++ b/reactos/dll/win32/secur32/secur32.spec @@ -0,0 +1,73 @@ + 1 stub SecDeleteUserModeContext + 2 stub SecInitUserModeContext + + #@ stdcall AcceptSecurityContext(ptr ptr ptr long long ptr ptr ptr ptr) + @ stdcall AcquireCredentialsHandleA(str str long ptr ptr ptr ptr ptr ptr) + @ stdcall AcquireCredentialsHandleW(wstr wstr long ptr ptr ptr ptr ptr ptr) + #@ stdcall AddCredentialsA(ptr str str long ptr ptr ptr ptr) + #@ stdcall AddCredentialsW(ptr wstr wstr long ptr ptr ptr ptr) + @ stub AddSecurityPackageA + @ stub AddSecurityPackageW + #@ stdcall ApplyControlToken(ptr ptr) + @ stdcall CompleteAuthToken(ptr ptr) + @ stdcall DecryptMessage(ptr ptr long ptr) + @ stdcall DeleteSecurityContext(ptr) + @ stub DeleteSecurityPackageA + @ stub DeleteSecurityPackageW + @ stdcall EncryptMessage(ptr long ptr long) + @ stdcall EnumerateSecurityPackagesA(ptr ptr) + @ stdcall EnumerateSecurityPackagesW(ptr ptr) + #@ stdcall ExportSecurityContext(ptr long ptr ptr) + @ stdcall FreeContextBuffer(ptr) + @ stdcall FreeCredentialsHandle(ptr) + @ stdcall GetComputerObjectNameA(long ptr ptr) + @ stdcall GetComputerObjectNameW(long ptr ptr) + @ stub GetSecurityUserInfo + @ stdcall GetUserNameExA(long ptr ptr) + @ stdcall GetUserNameExW(long ptr ptr) + #@ stdcall ImpersonateSecurityContext(ptr) + #@ stdcall ImportSecurityContextA(str ptr ptr ptr) + #@ stdcall ImportSecurityContextW(wstr ptr ptr ptr) + #@ stdcall InitSecurityInterfaceA() + @ stdcall InitSecurityInterfaceW() + @ stdcall InitializeSecurityContextA(ptr ptr str long long long ptr long ptr ptr ptr ptr) + @ stdcall InitializeSecurityContextW(ptr ptr wstr long long long ptr long ptr ptr ptr ptr) + @ stdcall LsaCallAuthenticationPackage(long long ptr long ptr ptr ptr) + @ stdcall LsaConnectUntrusted(long) + @ stdcall LsaDeregisterLogonProcess(long) + @ stdcall LsaEnumerateLogonSessions(ptr ptr) + @ stdcall LsaFreeReturnBuffer(ptr) + @ stdcall LsaGetLogonSessionData(ptr ptr) + @ stdcall LsaLogonUser(ptr ptr long long ptr long ptr ptr ptr ptr ptr ptr ptr ptr) + @ stdcall LsaLookupAuthenticationPackage(ptr ptr ptr) + @ stdcall LsaRegisterLogonProcess(ptr ptr ptr) + @ stub LsaRegisterPolicyChangeNotification + @ stub LsaUnregisterPolicyChangeNotification + @ stdcall MakeSignature(ptr long ptr long) + @ stdcall QueryContextAttributesA(ptr long ptr) + @ stdcall QueryContextAttributesW(ptr long ptr) + #@ stdcall QueryCredentialsAttributesA(ptr long ptr) + #@ stdcall QueryCredentialsAttributesW(ptr long ptr) + #@ stdcall QuerySecurityContextToken(ptr ptr) + @ stdcall QuerySecurityPackageInfoA(str ptr) + @ stdcall QuerySecurityPackageInfoW(wstr ptr) + #@ stdcall RevertSecurityContext(ptr) + @ stub SaslAcceptSecurityContext + @ stub SaslEnumerateProfilesA + @ stub SaslEnumerateProfilesW + @ stub SaslGetProfilePackageA + @ stub SaslGetProfilePackageW + @ stub SaslIdentifyPackageA + @ stub SaslIdentifyPackageW + @ stub SaslInitializeSecurityContextA + @ stub SaslInitializeSecurityContextW + @ stdcall SealMessage(ptr long ptr long) EncryptMessage + @ stub SecCacheSspiPackages + @ stub SecGetLocaleSpecificEncryptionRules + @ stub SecpFreeMemory + @ stub SecpTranslateName + @ stub SecpTranslateNameEx + #@ stdcall TranslateNameA(str long long ptr ptr) + #@ stdcall TranslateNameW(wstr long long ptr ptr) + @ stdcall UnsealMessage(ptr ptr long ptr) DecryptMessage + @ stdcall VerifySignature(ptr ptr long ptr) From 18fd3fd66bd85512eda0d9c5709b32ab61e9c611 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 25 Oct 2008 08:22:11 +0000 Subject: [PATCH 357/388] Fix build after widl changes. svn path=/branches/ros-amd64-bringup/; revision=36936 --- reactos/dll/win32/lsasrv/lsasrv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/dll/win32/lsasrv/lsasrv.c b/reactos/dll/win32/lsasrv/lsasrv.c index 94d643bb41c..758cc05e2eb 100644 --- a/reactos/dll/win32/lsasrv/lsasrv.c +++ b/reactos/dll/win32/lsasrv/lsasrv.c @@ -3,6 +3,8 @@ #define NTOS_MODE_USER #include +DECLARE_HANDLE(LSAPR_HANDLE); + #define NDEBUG #include @@ -40,5 +42,9 @@ void __RPC_USER midl_user_free(void __RPC_FAR * ptr) RtlFreeHeap(RtlGetProcessHeap(), 0, ptr); } +void __RPC_USER LSAPR_HANDLE_rundown(LSAPR_HANDLE hObject) +{ +} + /* EOF */ From 874dc977176f2418527cd9b3b972e27f9ab60a9b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 25 Oct 2008 08:57:39 +0000 Subject: [PATCH 358/388] - Remove merge artifact - Fix user32 spec. - Fix userenv.rbuild svn path=/branches/ros-amd64-bringup/; revision=36937 --- reactos/dll/win32/netcfgx/lang/de-DE.rc | 1 - reactos/dll/win32/user32/user32.spec | 4 ++-- reactos/dll/win32/userenv/userenv.rbuild | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/netcfgx/lang/de-DE.rc b/reactos/dll/win32/netcfgx/lang/de-DE.rc index 71977108fb9..f0a31d0b450 100644 --- a/reactos/dll/win32/netcfgx/lang/de-DE.rc +++ b/reactos/dll/win32/netcfgx/lang/de-DE.rc @@ -227,4 +227,3 @@ BEGIN IDS_DUP_IPADDR "Die IP-Adresse ist bereits in der Liste vorhanden." IDS_DUP_GW "Der Standardgateway ist bereits in der Liste vorhanden." END ->>>>>>> .merge-right.r36700 diff --git a/reactos/dll/win32/user32/user32.spec b/reactos/dll/win32/user32/user32.spec index 672efb1fb42..b30e2af15f0 100644 --- a/reactos/dll/win32/user32/user32.spec +++ b/reactos/dll/win32/user32/user32.spec @@ -625,7 +625,7 @@ @ stdcall SetInternalWindowPos(long long ptr ptr) @ stdcall SetKeyboardState(ptr) @ stdcall SetLastErrorEx(long long) -@ stdcall SetLayeredWindowAttributes(ptr long long long) win32k.NtUserSetLayeredWindowAttributes +@ stdcall SetLayeredWindowAttributes(ptr long long long) NtUserSetLayeredWindowAttributes @ stdcall SetLogonNotifyWindow(long long) @ stdcall SetMenu(long long) @ stdcall SetMenuContextHelpId(long long) @@ -725,7 +725,7 @@ @ stdcall UnregisterHotKey(long long) NtUserUnregisterHotKey # @ stub UnregisterMessagePumpHook # @ stub UnregisterUserApiHook -@ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) +@ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) NtUserUpdateLayeredWindow @ stdcall UpdatePerUserSystemParameters(long long) @ stdcall UpdateWindow(long) @ stdcall User32InitializeImmEntryTable(ptr) diff --git a/reactos/dll/win32/userenv/userenv.rbuild b/reactos/dll/win32/userenv/userenv.rbuild index bf0447a1715..d1010331829 100644 --- a/reactos/dll/win32/userenv/userenv.rbuild +++ b/reactos/dll/win32/userenv/userenv.rbuild @@ -1,5 +1,5 @@ - + . 0x0500 0x0600 From 12569cc78d0f0f930559e58ae38533b69d17b58c Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 16:00:42 +0000 Subject: [PATCH 359/388] - Fix NTFS FSD compilation (correct 2 casts) svn path=/branches/ros-amd64-bringup/; revision=36949 --- reactos/drivers/filesystems/ntfs/attrib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/ntfs/attrib.c b/reactos/drivers/filesystems/ntfs/attrib.c index 95a5af6630b..e334ba98b00 100644 --- a/reactos/drivers/filesystems/ntfs/attrib.c +++ b/reactos/drivers/filesystems/ntfs/attrib.c @@ -88,7 +88,7 @@ FindRun (PNONRESIDENT_ATTRIBUTE NresAttr, *lcn = 0; - for (run = (PUCHAR)((ULONG)NresAttr + NresAttr->RunArrayOffset); + for (run = (PUCHAR)((ULONG_PTR)NresAttr + NresAttr->RunArrayOffset); *run != 0; run += RunLength(run)) { *lcn += RunLCN(run); @@ -248,7 +248,7 @@ NtfsDumpAttribute (PATTRIBUTE Attribute) { Name.Length = Attribute->NameLength * sizeof(WCHAR); Name.MaximumLength = Name.Length; - Name.Buffer = (PWCHAR)((ULONG)Attribute + Attribute->NameOffset); + Name.Buffer = (PWCHAR)((ULONG_PTR)Attribute + Attribute->NameOffset); DbgPrint("'%wZ' ", &Name); } From 360b21c776510cbc77b76660927cd68ee4d1c99b Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 16:12:03 +0000 Subject: [PATCH 360/388] - Fix ne2000 compilation (treat pointer size as ULONG_PTR, correct function prototypes) svn path=/branches/ros-amd64-bringup/; revision=36951 --- reactos/drivers/network/dd/ne2000/include/ne2000.h | 10 +++++----- reactos/drivers/network/dd/ne2000/ne2000/8390.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/drivers/network/dd/ne2000/include/ne2000.h b/reactos/drivers/network/dd/ne2000/include/ne2000.h index eb14bcdb9ac..fd16ea383d1 100644 --- a/reactos/drivers/network/dd/ne2000/include/ne2000.h +++ b/reactos/drivers/network/dd/ne2000/include/ne2000.h @@ -79,7 +79,7 @@ typedef struct _NIC_ADAPTER NDIS_MINIPORT_INTERRUPT Interrupt; /* I/O base address and interrupt number of adapter */ - ULONG IoBaseAddress; + ULONG_PTR IoBaseAddress; ULONG InterruptLevel; ULONG InterruptVector; BOOLEAN InterruptShared; @@ -221,24 +221,24 @@ VOID NICUpdateCounters( VOID NICReadDataAlign( PNIC_ADAPTER Adapter, PUSHORT Target, - ULONG Source, + ULONG_PTR Source, USHORT Length); VOID NICWriteDataAlign( PNIC_ADAPTER Adapter, - ULONG Target, + ULONG_PTR Target, PUSHORT Source, USHORT Length); VOID NICReadData( PNIC_ADAPTER Adapter, PUCHAR Target, - ULONG Source, + ULONG_PTR Source, USHORT Length); VOID NICWriteData( PNIC_ADAPTER Adapter, - ULONG Target, + ULONG_PTR Target, PUCHAR Source, USHORT Length); diff --git a/reactos/drivers/network/dd/ne2000/ne2000/8390.c b/reactos/drivers/network/dd/ne2000/ne2000/8390.c index 7e9d58e6c9a..1ce001bd91e 100644 --- a/reactos/drivers/network/dd/ne2000/ne2000/8390.c +++ b/reactos/drivers/network/dd/ne2000/ne2000/8390.c @@ -11,10 +11,10 @@ #include /* Null-terminated array of ports to probe. This is "semi-risky" (Don Becker). */ -ULONG ProbeAddressList[] = { 0x280, 0x300, 0x320, 0x340, 0x360, 0x380, 0 }; +ULONG_PTR ProbeAddressList[] = { 0x280, 0x300, 0x320, 0x340, 0x360, 0x380, 0 }; static BOOLEAN ProbeAddressForNIC( - ULONG address) + ULONG_PTR address) /* * FUNCTION: Probes an address for a NIC * ARGUMENTS: @@ -129,7 +129,7 @@ static BOOLEAN NICTestRAM( * Start at 1KB and test for every 1KB up to 64KB */ { - ULONG Base; + ULONG_PTR Base; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); From fb787b7deb69d9fea762bd64fbe6f63324bfd026 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 16:26:30 +0000 Subject: [PATCH 361/388] - More correct MmGetSystemAddressForMdlSafe macro svn path=/branches/ros-amd64-bringup/; revision=36952 --- reactos/include/ddk/winddk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 0da9b567577..937f96508c0 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -10428,11 +10428,11 @@ MmMarkPhysicalMemoryAsGood( * IN MM_PAGE_PRIORITY Priority) */ #define MmGetSystemAddressForMdlSafe(_Mdl, _Priority) \ - ((_Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA \ + (((_Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA \ | MDL_SOURCE_IS_NONPAGED_POOL)) ? \ (_Mdl)->MappedSystemVa : \ (PVOID) MmMapLockedPagesSpecifyCache((_Mdl), \ - KernelMode, MmCached, NULL, FALSE, _Priority) + KernelMode, MmCached, NULL, FALSE, (_Priority))) NTKERNELAPI PVOID From c194188c58d26f0b1f4e23e73754f8ac87fb7a6a Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 17:15:23 +0000 Subject: [PATCH 362/388] - Fix AFD compilation for 64-bit (treat handles as ULONG_PTR-sized) - Also correct Winsock's SOCKET definition svn path=/branches/ros-amd64-bringup/; revision=36953 --- reactos/drivers/network/afd/include/afd.h | 2 +- reactos/include/psdk/winsock2.h | 2 +- reactos/include/reactos/drivers/afd/shared.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/drivers/network/afd/include/afd.h b/reactos/drivers/network/afd/include/afd.h index aa67e747a38..8ab352e7d1c 100644 --- a/reactos/drivers/network/afd/include/afd.h +++ b/reactos/drivers/network/afd/include/afd.h @@ -112,7 +112,7 @@ typedef struct IPADDR_ENTRY { * We do this in order to get some storage for the locked handle table * Maybe I'll use some tail item in the irp instead */ #define AFD_HANDLES(x) ((PAFD_HANDLE)(x)->Exclusive) -#define SET_AFD_HANDLES(x,y) (((x)->Exclusive) = (ULONG)(y)) +#define SET_AFD_HANDLES(x,y) (((x)->Exclusive) = (ULONG_PTR)(y)) typedef struct _AFD_MAPBUF { PVOID BufferAddress; diff --git a/reactos/include/psdk/winsock2.h b/reactos/include/psdk/winsock2.h index 5ccc222776b..3f20889f404 100644 --- a/reactos/include/psdk/winsock2.h +++ b/reactos/include/psdk/winsock2.h @@ -33,7 +33,7 @@ typedef unsigned int u_int; typedef unsigned long u_long; #define _BSDTYPES_DEFINED #endif /* ! def _BSDTYPES_DEFINED */ -typedef u_int SOCKET; +typedef UINT_PTR SOCKET; #ifndef FD_SETSIZE #define FD_SETSIZE 64 #endif diff --git a/reactos/include/reactos/drivers/afd/shared.h b/reactos/include/reactos/drivers/afd/shared.h index 9810d75b517..2416ae198db 100644 --- a/reactos/include/reactos/drivers/afd/shared.h +++ b/reactos/include/reactos/drivers/afd/shared.h @@ -46,7 +46,7 @@ typedef struct _AFD_LISTEN_DATA { } AFD_LISTEN_DATA, *PAFD_LISTEN_DATA; typedef struct _AFD_HANDLE_ { - SOCKET Handle; + HANDLE Handle; ULONG Events; NTSTATUS Status; } AFD_HANDLE, *PAFD_HANDLE; @@ -54,7 +54,7 @@ typedef struct _AFD_HANDLE_ { typedef struct _AFD_POLL_INFO { LARGE_INTEGER Timeout; ULONG HandleCount; - ULONG Exclusive; + ULONG_PTR Exclusive; AFD_HANDLE Handles[1]; } AFD_POLL_INFO, *PAFD_POLL_INFO; From b1fb36d59425225d3ec61a7edd6e16e089b306e0 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 17:50:42 +0000 Subject: [PATCH 363/388] - Fix isapnp compilation for 64-bit svn path=/branches/ros-amd64-bringup/; revision=36958 --- reactos/drivers/bus/isapnp/isapnp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/drivers/bus/isapnp/isapnp.c b/reactos/drivers/bus/isapnp/isapnp.c index 656e28d9335..29cdcd6431e 100644 --- a/reactos/drivers/bus/isapnp/isapnp.c +++ b/reactos/drivers/bus/isapnp/isapnp.c @@ -153,7 +153,7 @@ static VOID WriteUlong(UCHAR Index, ULONG Value) } #endif -static __inline VOID SetReadDataPort(ULONG Port) +static __inline VOID SetReadDataPort(ULONG_PTR Port) { IsaPnPReadPort = (PUCHAR)Port; WriteUchar(0x00, (UCHAR) (Port >> 2)); @@ -214,13 +214,13 @@ static VOID DeactivateLogicalDevice(UCHAR LogicalDevice) #define READ_DATA_PORT_STEP 32 /* Minimum is 4 */ -static ULONG FindNextReadPort(VOID) +static ULONG_PTR FindNextReadPort(VOID) { - ULONG Port; + ULONG_PTR Port; - Port = (ULONG)IsaPnPReadPort; + Port = (ULONG_PTR)IsaPnPReadPort; while (TRUE) { @@ -260,7 +260,7 @@ static ULONG FindNextReadPort(VOID) static BOOLEAN IsolateReadDataPortSelect(VOID) { - ULONG Port; + ULONG_PTR Port; SendWait(); SendKey(); @@ -333,7 +333,7 @@ static ULONG IsolatePnPCards(VOID) KeStallExecutionProcessor(250); iteration++; SendWake(0x00); - SetReadDataPort((ULONG)IsaPnPReadPort); + SetReadDataPort((ULONG_PTR)IsaPnPReadPort); KeStallExecutionProcessor(1000); WriteAddress(0x01); KeStallExecutionProcessor(1000); @@ -1305,7 +1305,7 @@ static NTSTATUS BuildResourceLists(PISAPNP_LOGICAL_DEVICE LogicalDevice) do { Status = BuildResourceList(LogicalDevice, p, Priority); if (NT_SUCCESS(Status)) { - p = (PIO_RESOURCE_LIST)((ULONG)p + SingleListSize); + p = (PIO_RESOURCE_LIST)((ULONG_PTR)p + SingleListSize); Priority++; } } while (Status != STATUS_NOT_FOUND); @@ -1477,7 +1477,7 @@ ISAPNPQueryBusRelations( CurrentEntry = CurrentEntry->Flink; } - Irp->IoStatus.Information = (ULONG)Relations; + Irp->IoStatus.Information = (ULONG_PTR)Relations; return Status; } From 2121dff3f781518b96239f683f4a7ac542a29fb2 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 17:58:43 +0000 Subject: [PATCH 364/388] - Make serial build for 64 bit -- explicitly cast first parameter to InterlockedCompareExchangePointer to PVOID (not needed, with ros headers, on 32-bit for whatever reason) svn path=/branches/ros-amd64-bringup/; revision=36961 --- reactos/drivers/serial/serial/devctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/serial/serial/devctrl.c b/reactos/drivers/serial/serial/devctrl.c index f37002dfebd..2f8f563d6a0 100644 --- a/reactos/drivers/serial/serial/devctrl.c +++ b/reactos/drivers/serial/serial/devctrl.c @@ -802,7 +802,7 @@ SerialDeviceControl( * as pending, it might be possible to complete the * Irp before pending it, leading to a crash! */ WaitingIrp = InterlockedCompareExchangePointer( - &DeviceExtension->WaitOnMaskIrp, + (PVOID)&DeviceExtension->WaitOnMaskIrp, Irp, NULL); From e26b7859549e1f6d726701e4fb1ff4cfb1804261 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 18:18:03 +0000 Subject: [PATCH 365/388] - Fix DXG 64-bit compilation (fix not entirely correct though) svn path=/branches/ros-amd64-bringup/; revision=36964 --- reactos/drivers/directx/dxg/ddhmg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/directx/dxg/ddhmg.c b/reactos/drivers/directx/dxg/ddhmg.c index 9e71e43f244..173ee90a303 100644 --- a/reactos/drivers/directx/dxg/ddhmg.c +++ b/reactos/drivers/directx/dxg/ddhmg.c @@ -26,7 +26,7 @@ BOOL FASTCALL VerifyObjectOwner(PDD_ENTRY pEntry) { - DWORD Pid = (DWORD) PsGetCurrentProcessId() & 0xFFFFFFFC; + DWORD Pid = (DWORD)(DWORD_PTR)PsGetCurrentProcessId() & 0xFFFFFFFC; DWORD check = pEntry->ObjectOwner.ulObj & 0xFFFFFFFE; return ( (check == Pid) || (!check)); } @@ -147,7 +147,7 @@ FASTCALL DdHmgLock( HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned) { - DWORD Index = (DWORD)DdHandle & 0x1FFFFF; + DWORD Index = (DWORD)(DWORD_PTR)DdHandle & 0x1FFFFF; PDD_ENTRY pEntry = NULL; PVOID Object = NULL; From fa5b3a90b9d1d7744d4d84cd19be889499010453 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 22:33:55 +0000 Subject: [PATCH 366/388] - Make videoprt compile for 64-bit - Disable Int10 support as it uses x86 specific structures (is this support still available on amd64?) - Disable VideoPortEnable/DisableInterrupt -- HalEnable/DisableSystemInterrupt are not apparently present on NT AMD64, so need to figure out what else to use (and if these routine are still present on amd64 videoprt) svn path=/branches/ros-amd64-bringup/; revision=36969 --- reactos/drivers/video/videoprt/agp.c | 8 ++++---- reactos/drivers/video/videoprt/int10.c | 8 ++++++++ reactos/drivers/video/videoprt/interrupt.c | 12 ++++++++++++ reactos/drivers/video/videoprt/resource.c | 4 ++-- reactos/drivers/video/videoprt/services.c | 3 ++- reactos/drivers/video/videoprt/spinlock.c | 4 ++-- reactos/drivers/video/videoprt/videoprt.c | 6 +++--- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/reactos/drivers/video/videoprt/agp.c b/reactos/drivers/video/videoprt/agp.c index bf6194437a6..56b04af816f 100644 --- a/reactos/drivers/video/videoprt/agp.c +++ b/reactos/drivers/video/videoprt/agp.c @@ -275,7 +275,7 @@ IntAgpCommitVirtual( else /* ProcessHandle != NULL */ { /* Release some virtual memory */ - ULONG Size = Pages * PAGE_SIZE; + SIZE_T Size = Pages * PAGE_SIZE; ULONG OffsetInBytes = Offset * PAGE_SIZE; BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + OffsetInBytes); @@ -349,7 +349,7 @@ IntAgpFreeVirtual( else /* ProcessHandle != NULL */ { /* Unmap the section view */ - ULONG Size = Pages * PAGE_SIZE; + SIZE_T Size = Pages * PAGE_SIZE; ULONG OffsetInBytes = Offset * PAGE_SIZE; BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + OffsetInBytes); @@ -400,7 +400,7 @@ IntAgpReleaseVirtual( else /* ProcessHandle != NULL */ { /* Release the allocated virtual memory */ - ULONG Size = VirtualMapping->AgpMapping->NumberOfPages * PAGE_SIZE; + SIZE_T Size = VirtualMapping->AgpMapping->NumberOfPages * PAGE_SIZE; Status = ZwFreeVirtualMemory(VirtualMapping->ProcessHandle, &VirtualMapping->MappedAddress, &Size, MEM_RELEASE); @@ -452,7 +452,7 @@ IntAgpReserveVirtual( else /* ProcessHandle != NULL */ { /* Reserve memory for usermode */ - ULONG Size = AgpMapping->NumberOfPages * PAGE_SIZE; + SIZE_T Size = AgpMapping->NumberOfPages * PAGE_SIZE; MappedAddress = NULL; Status = ZwAllocateVirtualMemory(ProcessHandle, &MappedAddress, 0, &Size, MEM_RESERVE, PAGE_NOACCESS); diff --git a/reactos/drivers/video/videoprt/int10.c b/reactos/drivers/video/videoprt/int10.c index 257bec06d1e..d1c9392f119 100644 --- a/reactos/drivers/video/videoprt/int10.c +++ b/reactos/drivers/video/videoprt/int10.c @@ -25,6 +25,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ +#if defined(_M_IX86) VP_STATUS NTAPI IntInt10AllocateBuffer( IN PVOID Context, @@ -190,6 +191,7 @@ IntInt10CallBios( IntDetachFromCSRSS(&CallingProcess, &ApcState); return Status; } +#endif /* PUBLIC FUNCTIONS ***********************************************************/ @@ -202,6 +204,7 @@ VideoPortInt10( IN PVOID HwDeviceExtension, IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments) { +#if defined(_M_IX86) KV86M_REGISTERS Regs; NTSTATUS Status; PKPROCESS CallingProcess; @@ -243,4 +246,9 @@ VideoPortInt10( IntDetachFromCSRSS(&CallingProcess, &ApcState); return Status; +#else + /* Not implemented for anything else than X86*/ + DPRINT1("Int10 not available on non-x86!\n"); + return ERROR_INVALID_FUNCTION; +#endif } diff --git a/reactos/drivers/video/videoprt/interrupt.c b/reactos/drivers/video/videoprt/interrupt.c index f27bb84162c..aec40c9e7bb 100644 --- a/reactos/drivers/video/videoprt/interrupt.c +++ b/reactos/drivers/video/videoprt/interrupt.c @@ -111,6 +111,7 @@ IntVideoPortSetupInterrupt( VP_STATUS NTAPI VideoPortEnableInterrupt(IN PVOID HwDeviceExtension) { +#ifndef _M_AMD64 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; BOOLEAN Status; @@ -124,6 +125,11 @@ VideoPortEnableInterrupt(IN PVOID HwDeviceExtension) DeviceExtension->InterruptLevel); return Status ? NO_ERROR : ERROR_INVALID_ACCESS; +#else + /* FIXME: Function still present? If so what to use instead of HalEnableSystemInterrupt? */ + UNIMPLEMENTED; + return ERROR_INVALID_ACCESS; +#endif } /* @@ -133,6 +139,7 @@ VideoPortEnableInterrupt(IN PVOID HwDeviceExtension) VP_STATUS NTAPI VideoPortDisableInterrupt(IN PVOID HwDeviceExtension) { +#ifndef _M_AMD64 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; BOOLEAN Status; @@ -145,4 +152,9 @@ VideoPortDisableInterrupt(IN PVOID HwDeviceExtension) 0); return Status ? NO_ERROR : ERROR_INVALID_ACCESS; +#else + /* FIXME: Function still present? If so what to use instead of HalDisableSystemInterrupt? */ + UNIMPLEMENTED; + return ERROR_INVALID_ACCESS; +#endif } diff --git a/reactos/drivers/video/videoprt/resource.c b/reactos/drivers/video/videoprt/resource.c index 43414966c02..6a4352c31a9 100644 --- a/reactos/drivers/video/videoprt/resource.c +++ b/reactos/drivers/video/videoprt/resource.c @@ -164,7 +164,7 @@ IntVideoPortMapMemory( if (Status) *Status = NO_ERROR; - return (PVOID)TranslatedAddress.u.LowPart; + return (PVOID)(ULONG_PTR)TranslatedAddress.u.LowPart; } /* user space */ @@ -272,7 +272,7 @@ IntVideoPortUnmapMemory( Status = ZwUnmapViewOfSection(NtCurrentProcess(), MappedAddress); if (!NT_SUCCESS(Status)) { - WARN_(VIDEOPRT, "Warning: Mapping for address 0x%x not found!\n", (ULONG)MappedAddress); + WARN_(VIDEOPRT, "Warning: Mapping for address 0x%p not found!\n", MappedAddress); } } diff --git a/reactos/drivers/video/videoprt/services.c b/reactos/drivers/video/videoprt/services.c index 7b6b5e9b084..ec44a411676 100644 --- a/reactos/drivers/video/videoprt/services.c +++ b/reactos/drivers/video/videoprt/services.c @@ -44,6 +44,7 @@ VideoPortQueryServices( switch (ServicesType) { +#if defined(_M_IX86) case VideoPortServicesInt10: if (Interface->Version >= VIDEO_PORT_INT10_INTERFACE_VERSION_1 || Interface->Size >= sizeof(VIDEO_PORT_INT10_INTERFACE)) @@ -61,7 +62,7 @@ VideoPortQueryServices( return NO_ERROR; } break; - +#endif case VideoPortServicesAGP: if ((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 && Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) || diff --git a/reactos/drivers/video/videoprt/spinlock.c b/reactos/drivers/video/videoprt/spinlock.c index 342485bdcaf..acbcffa5237 100644 --- a/reactos/drivers/video/videoprt/spinlock.c +++ b/reactos/drivers/video/videoprt/spinlock.c @@ -77,7 +77,7 @@ VideoPortAcquireSpinLockAtDpcLevel( IN PSPIN_LOCK SpinLock) { TRACE_(VIDEOPRT, "VideoPortAcquireSpinLockAtDpcLevel\n"); - KefAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock); + KeAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock); } /* @@ -104,5 +104,5 @@ VideoPortReleaseSpinLockFromDpcLevel( IN PSPIN_LOCK SpinLock) { TRACE_(VIDEOPRT, "VideoPortReleaseSpinLockFromDpcLevel\n"); - KefReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock); + KeReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock); } diff --git a/reactos/drivers/video/videoprt/videoprt.c b/reactos/drivers/video/videoprt/videoprt.c index 636b7120f5a..55c30bc541c 100644 --- a/reactos/drivers/video/videoprt/videoprt.c +++ b/reactos/drivers/video/videoprt/videoprt.c @@ -332,7 +332,7 @@ IntVideoPortFindAdapter( { WCHAR DeviceVideoBuffer[20]; PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; - ULONG Size; + SIZE_T Size; NTSTATUS Status; VIDEO_PORT_CONFIG_INFO ConfigInfo; SYSTEM_BASIC_INFORMATION SystemBasicInfo; @@ -1045,12 +1045,12 @@ VideoPortSynchronizeExecution( case VpHighPriority: OldIrql = KeGetCurrentIrql(); if (OldIrql < SYNCH_LEVEL) - OldIrql = KfRaiseIrql(SYNCH_LEVEL); + KeRaiseIrql(SYNCH_LEVEL, &OldIrql); Ret = (*SynchronizeRoutine)(Context); if (OldIrql < SYNCH_LEVEL) - KfLowerIrql(OldIrql); + KeLowerIrql(OldIrql); break; default: From 02a9619cec7f7c8294caef0cb03dea96fdb1da79 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 22:48:28 +0000 Subject: [PATCH 367/388] - Don't typedef ULONG_PTR to a 32-bit value svn path=/branches/ros-amd64-bringup/; revision=36971 --- reactos/drivers/usb/nt4compat/usbdriver/usb.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/reactos/drivers/usb/nt4compat/usbdriver/usb.h b/reactos/drivers/usb/nt4compat/usbdriver/usb.h index a9bc705a470..4036d8656c0 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/usb.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/usb.h @@ -4,8 +4,6 @@ * Some USB bandwidth allocation constants. */ -typedef unsigned long ULONG_PTR, *PULONG_PTR; - #define USB2_HOST_DELAY 5 /* nsec, guess */ #define BW_HOST_DELAY 1000L /* nanoseconds */ #define BW_HUB_LS_SETUP 333L /* nanoseconds */ From 5d8f94e352585d95e4910a79a7f2b2afe818b049 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 25 Oct 2008 22:57:16 +0000 Subject: [PATCH 368/388] - When doing pointer arithmetic, ULONG_PTR is your friend svn path=/branches/ros-amd64-bringup/; revision=36972 --- reactos/drivers/video/displays/vga/main/enable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/video/displays/vga/main/enable.c b/reactos/drivers/video/displays/vga/main/enable.c index 50df4146e9f..9ec4c9fce1c 100644 --- a/reactos/drivers/video/displays/vga/main/enable.c +++ b/reactos/drivers/video/displays/vga/main/enable.c @@ -562,7 +562,7 @@ DrvGetModes(IN HANDLE Driver, /* next DEVMODE entry */ OutputModes--; - DM = (PDEVMODEW) ( ((ULONG)DM) + sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); + DM = (PDEVMODEW) ( ((ULONG_PTR)DM) + sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); OutputSize += (sizeof(DEVMODEW) + DRIVER_EXTRA_SIZE); } From 1ca859a549b701847b260e754264661436eacb9b Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sun, 26 Oct 2008 13:56:59 +0000 Subject: [PATCH 369/388] - Fix user32 compilation errors. - Don't let stefan steal the glory. svn path=/branches/ros-amd64-bringup/; revision=36987 --- reactos/dll/win32/user32/misc/stubs.c | 2 +- reactos/dll/win32/user32/misc/winhelp.c | 4 ++-- reactos/dll/win32/user32/windows/menu.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/dll/win32/user32/misc/stubs.c b/reactos/dll/win32/user32/misc/stubs.c index 03eaa0bce91..e73a2f71122 100644 --- a/reactos/dll/win32/user32/misc/stubs.c +++ b/reactos/dll/win32/user32/misc/stubs.c @@ -206,7 +206,7 @@ DragObject( HWND hwnd1, HWND hwnd2, UINT u1, - DWORD dw1, + ULONG_PTR dw1, HCURSOR hc1 ) { diff --git a/reactos/dll/win32/user32/misc/winhelp.c b/reactos/dll/win32/user32/misc/winhelp.c index 8acdf2ebd4c..e8d01e5dd25 100644 --- a/reactos/dll/win32/user32/misc/winhelp.c +++ b/reactos/dll/win32/user32/misc/winhelp.c @@ -51,7 +51,7 @@ typedef struct */ BOOL STDCALL -WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData) +WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, ULONG_PTR dwData) { static WORD WM_WINHELP = 0; HWND hDest; @@ -137,7 +137,7 @@ WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData) */ BOOL STDCALL -WinHelpW(HWND hWnd, LPCWSTR lpszHelp, UINT uCommand, DWORD dwData) +WinHelpW(HWND hWnd, LPCWSTR lpszHelp, UINT uCommand, ULONG_PTR dwData) { INT len; LPSTR file; diff --git a/reactos/dll/win32/user32/windows/menu.c b/reactos/dll/win32/user32/windows/menu.c index ce6a82b101e..bf187f4c4e6 100644 --- a/reactos/dll/win32/user32/windows/menu.c +++ b/reactos/dll/win32/user32/windows/menu.c @@ -4523,7 +4523,7 @@ InsertMenuA( HMENU hMenu, UINT uPosition, UINT uFlags, - UINT uIDNewItem, + UINT_PTR uIDNewItem, LPCSTR lpNewItem) { MENUITEMINFOA mii; @@ -4645,7 +4645,7 @@ InsertMenuW( HMENU hMenu, UINT uPosition, UINT uFlags, - UINT uIDNewItem, + UINT_PTR uIDNewItem, LPCWSTR lpNewItem) { MENUITEMINFOW mii; @@ -4784,7 +4784,7 @@ ModifyMenuA( HMENU hMnu, UINT uPosition, UINT uFlags, - UINT uIDNewItem, + UINT_PTR uIDNewItem, LPCSTR lpNewItem) { ROSMENUINFO mi; @@ -4831,7 +4831,7 @@ ModifyMenuW( HMENU hMnu, UINT uPosition, UINT uFlags, - UINT uIDNewItem, + UINT_PTR uIDNewItem, LPCWSTR lpNewItem) { ROSMENUINFO mi; From b58ab412dfbbffc61cd80a460c5801298f86665b Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 26 Oct 2008 14:25:12 +0000 Subject: [PATCH 370/388] - Make user32 compile and link by defining Get/SetClass/WindowLongPtrA/W svn path=/branches/ros-amd64-bringup/; revision=36988 --- reactos/dll/win32/user32/user32.spec | 28 ++++-- reactos/dll/win32/user32/windows/class.c | 106 +++++++++++++++++++++++ 2 files changed, 126 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/user32/user32.spec b/reactos/dll/win32/user32/user32.spec index b30e2af15f0..4d136a1327d 100644 --- a/reactos/dll/win32/user32/user32.spec +++ b/reactos/dll/win32/user32/user32.spec @@ -256,8 +256,11 @@ @ stdcall GetClassInfoW(long wstr ptr) @ stdcall GetClassLongA(long long) @ stdcall GetClassLongW(long long) -@ stub GetClassLongPtrA -@ stub GetClassLongPtrW + +; FIXME -- Only for Win64 +@ stdcall GetClassLongPtrA(ptr long) +@ stdcall GetClassLongPtrW(ptr long) + @ stdcall GetClassNameA(long ptr long) @ stdcall GetClassNameW(long ptr long) @ stdcall GetClassWord(long long) @@ -375,8 +378,11 @@ @ stdcall GetWindowDC(long) @ stdcall GetWindowInfo(long ptr) @ stdcall GetWindowLongA(long long) -@ stub GetWindowLongPtrA -@ stub GetWindowLongPtrW + +; FIXME -- Only for Win64 +@ stdcall GetWindowLongPtrA(ptr long) +@ stdcall GetWindowLongPtrW(ptr long) + @ stdcall GetWindowLongW(long long) @ stdcall GetWindowModuleFileName(long ptr long) GetWindowModuleFileNameA @ stdcall GetWindowModuleFileNameA(long ptr long) @@ -603,8 +609,11 @@ @ stdcall SetCaretBlinkTime(long) @ stdcall SetCaretPos(long long) @ stdcall SetClassLongA(long long long) -@ stub SetClassLongPtrA #(long long long) -@ stub SetClassLongPtrW #(long long long) + +; FIXME -- Only for Win64 +@ stdcall SetClassLongPtrA(ptr long ptr) +@ stdcall SetClassLongPtrW(ptr long ptr) + @ stdcall SetClassLongW(long long long) @ stdcall SetClassWord(long long long) @ stdcall SetClipboardData(long long) @@ -665,8 +674,11 @@ @ stdcall SetWindowContextHelpId(long long) @ stub SetWindowFullScreenState @ stdcall SetWindowLongA(long long long) -@ stub SetWindowLongPtrA #(long long long) -@ stub SetWindowLongPtrW #(long long long) + +; FIXME -- Only for Win64 +@ stdcall SetWindowLongPtrA(ptr long ptr) +@ stdcall SetWindowLongPtrW(ptr long ptr) + @ stdcall SetWindowLongW(long long long) @ stdcall SetWindowPlacement(long ptr) @ stdcall SetWindowPos(long long long long long long long) diff --git a/reactos/dll/win32/user32/windows/class.c b/reactos/dll/win32/user32/windows/class.c index c43eb4b75da..43ad5a5ebea 100644 --- a/reactos/dll/win32/user32/windows/class.c +++ b/reactos/dll/win32/user32/windows/class.c @@ -410,6 +410,32 @@ GetClassLongW ( HWND hWnd, int nIndex ) return Ret; } +#ifdef _WIN64 +/* + * @unimplemented + */ +ULONG_PTR +WINAPI +GetClassLongPtrA(HWND hWnd, + INT nIndex) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +ULONG_PTR +WINAPI +GetClassLongPtrW(HWND hWnd, + INT nIndex) +{ + UNIMPLEMENTED; + return 0; +} +#endif + /* * @implemented @@ -602,6 +628,32 @@ GetWindowLongW(HWND hWnd, int nIndex) } } +#ifdef _WIN64 +/* + * @unimplemented + */ +LONG_PTR +WINAPI +GetWindowLongPtrA(HWND hWnd, + INT nIndex) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +LONG_PTR +WINAPI +GetWindowLongPtrW(HWND hWnd, + INT nIndex) +{ + UNIMPLEMENTED; + return 0; +} +#endif // _WIN64 + /* * @implemented */ @@ -1159,6 +1211,33 @@ SetClassLongW(HWND hWnd, FALSE); } +#ifdef _WIN64 +/* + * @unimplemented + */ +ULONG_PTR +WINAPI +SetClassLongPtrA(HWND hWnd, + INT nIndex, + LONG_PTR dwNewLong) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +ULONG_PTR +WINAPI +SetClassLongPtrW(HWND hWnd, + INT nIndex, + LONG_PTR dwNewLong) +{ + UNIMPLEMENTED; + return 0; +} +#endif // _WIN64 /* * @implemented @@ -1207,6 +1286,33 @@ SetWindowLongW( return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); } +#ifdef _WIN64 +/* + * @unimplemented + */ +LONG_PTR +WINAPI +SetWindowLongPtrA(HWND hWnd, + INT nIndex, + LONG_PTR dwNewLong) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +LONG_PTR +WINAPI +SetWindowLongPtrW(HWND hWnd, + INT nIndex, + LONG_PTR dwNewLong) +{ + UNIMPLEMENTED; + return 0; +} +#endif /* * @implemented From 1d619ca266205cf73b4b1b89f7e997de702e80c8 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 26 Oct 2008 14:45:13 +0000 Subject: [PATCH 371/388] - Fix function definitions to match header changes - Don't use x86 fiber assembly for amd64, just stub it out completely - Use AMD64 definitions in BasepInitializeContext, and add a broken KGDT_64_R3_TEB svn path=/branches/ros-amd64-bringup/; revision=36990 --- reactos/dll/win32/kernel32/misc/utils.c | 10 +- reactos/dll/win32/kernel32/process/proc.c | 6 +- .../dll/win32/kernel32/thread/amd64/fiber.S | 109 +----------------- reactos/include/ndk/amd64/ketypes.h | 1 + 4 files changed, 10 insertions(+), 116 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/utils.c b/reactos/dll/win32/kernel32/misc/utils.c index 49c52e6d1ef..0a61194a821 100644 --- a/reactos/dll/win32/kernel32/misc/utils.c +++ b/reactos/dll/win32/kernel32/misc/utils.c @@ -386,11 +386,11 @@ BasepInitializeContext(IN PCONTEXT Context, /* The other registers are undefined */ /* Setup the Segments */ - Context->SegFs = KGDT_R3_TEB | RPL_MASK; - Context->SegEs = KGDT_R3_DATA | RPL_MASK; - Context->SegDs = KGDT_R3_DATA | RPL_MASK; - Context->SegCs = KGDT_R3_CODE | RPL_MASK; - Context->SegSs = KGDT_R3_DATA | RPL_MASK; + Context->SegFs = KGDT_64_R3_TEB | RPL_MASK; + Context->SegEs = KGDT_64_DATA | RPL_MASK; + Context->SegDs = KGDT_64_DATA | RPL_MASK; + Context->SegCs = KGDT_64_R3_CODE | RPL_MASK; + Context->SegSs = KGDT_64_DATA | RPL_MASK; Context->SegGs = 0; /* Set the EFLAGS */ diff --git a/reactos/dll/win32/kernel32/process/proc.c b/reactos/dll/win32/kernel32/process/proc.c index 7fe90e6844a..f86cf80f537 100644 --- a/reactos/dll/win32/kernel32/process/proc.c +++ b/reactos/dll/win32/kernel32/process/proc.c @@ -33,8 +33,8 @@ RegisterWaitForInputIdle(WaitForInputIdleType lpfnRegisterWaitForInputIdle); */ BOOL STDCALL GetProcessAffinityMask (HANDLE hProcess, - LPDWORD lpProcessAffinityMask, - LPDWORD lpSystemAffinityMask) + PDWORD_PTR lpProcessAffinityMask, + PDWORD_PTR lpSystemAffinityMask) { PROCESS_BASIC_INFORMATION ProcessInfo; SYSTEM_BASIC_INFORMATION SystemInfo; @@ -73,7 +73,7 @@ GetProcessAffinityMask (HANDLE hProcess, */ BOOL STDCALL SetProcessAffinityMask (HANDLE hProcess, - DWORD dwProcessAffinityMask) + DWORD_PTR dwProcessAffinityMask) { NTSTATUS Status; diff --git a/reactos/dll/win32/kernel32/thread/amd64/fiber.S b/reactos/dll/win32/kernel32/thread/amd64/fiber.S index 233174bcf78..ed500c6c468 100644 --- a/reactos/dll/win32/kernel32/thread/amd64/fiber.S +++ b/reactos/dll/win32/kernel32/thread/amd64/fiber.S @@ -9,116 +9,9 @@ #include -#define CONTEXT_FULL 0x10007 -#define CONTEXT_FLOATING_POINT 0xF - .globl _SwitchToFiber .intel_syntax noprefix _SwitchToFiber: - /* Get the TEB */ - mov edx, fs:[KGDT_R3_TEB] - - /* Get the Fiber */ - mov eax, [edx+TEB_FIBER_DATA] - - /* Save the non-volatile registers */ - mov [eax+FIBER_CONTEXT_EBX], ebx - mov [eax+FIBER_CONTEXT_ESI], esi - mov [eax+FIBER_CONTEXT_EDI], edi - mov [eax+FIBER_CONTEXT_EBP], ebp - - /* Check if we're to save FPU State */ - cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL + CONTEXT_FLOATING_POINT - jnz NoFpuStateSave - - /* Save the FPU State (Status and Control)*/ - fstsw [eax+FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD] - fstcw [eax+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] - - /* Check if the CPU supports SIMD MXCSR State Save */ - cmp byte ptr ds:[PROCESSOR_FEATURE_FXSR], 0 - jnz NoFpuStateSave - stmxcsr [eax+FIBER_CONTEXT_DR6] - -NoFpuStateSave: - - /* Save stack since we're not touching it anymore */ - mov [eax+FIBER_CONTEXT_ESP], esp - - /* Transfer some data from the TEB */ - mov ecx, [edx+TEB_FLS_DATA] - mov [eax+FIBER_FLS_DATA], ecx - mov ecx, [edx+TEB_ACTIVATION_CONTEXT_STACK_POINTER] - mov [eax+FIBER_ACTIVATION_CONTEXT_STACK], ecx - - /* Transfer some data related to the Stack */ - mov ecx, [edx+TEB_EXCEPTION_LIST] - mov [eax+FIBER_EXCEPTION_LIST], ecx - mov ecx, [edx+TEB_STACK_LIMIT] - mov [eax+FIBER_STACK_LIMIT], ecx - mov ecx, [edx+TEB_GUARANTEED_STACK_BYTES] - mov [eax+FIBER_GUARANTEED_STACK_BYTES], ecx - - /* Switch to the new fiber */ - mov ecx, [esp+4] - mov [edx+TEB_FIBER_DATA], ecx - - /* Switch Fiber Data */ - mov esi, [ecx+FIBER_EXCEPTION_LIST] - mov [edx+TEB_EXCEPTION_LIST], esi - mov esi, [ecx+FIBER_STACK_BASE] - mov [edx+TEB_STACK_BASE], esi - mov esi, [ecx+FIBER_STACK_LIMIT] - mov [edx+TEB_STACK_LIMIT], esi - mov esi, [ecx+FIBER_DEALLOCATION_STACK] - mov [edx+TEB_DEALLOCATION_STACK], esi - mov esi, [ecx+FIBER_GUARANTEED_STACK_BYTES] - mov [edx+TEB_GUARANTEED_STACK_BYTES], esi - mov esi, [ecx+FIBER_ACTIVATION_CONTEXT_STACK] - mov [edx+TEB_ACTIVATION_CONTEXT_STACK_POINTER], esi - - /* Restore FPU State */ - cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL + CONTEXT_FLOATING_POINT - jnz NoFpuStateRestore - - /* Check if the Status Word Changed */ - mov esi, [eax+FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD] - cmp si, word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD] - jnz StatusWordChanged - - /* Check if the Control Word Changed */ - mov esi, [eax+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] - cmp si, word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] - jz ControlWordEqual - -StatusWordChanged: - - /* Load the new one */ - mov word ptr [ecx+FIBER_CONTEXT_FLOAT_SAVE_TAG_WORD], 0xFFFF - fldenv [ecx+FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD] - -ControlWordEqual: - - /* Load the new one */ - cmp byte ptr ds:[PROCESSOR_FEATURE_FXSR], 0 - jnz NoFpuStateRestore - ldmxcsr [ecx+FIBER_CONTEXT_DR6] - -NoFpuStateRestore: - - /* Restore non-volatile registers */ - mov esi, [ecx+FIBER_CONTEXT_ESI] - mov edi, [ecx+FIBER_CONTEXT_EDI] - mov ebx, [ecx+FIBER_CONTEXT_EBX] - mov ebp, [ecx+FIBER_CONTEXT_EBP] - mov esp, [ecx+FIBER_CONTEXT_ESP] - - /* Restore FLS Data */ - mov eax, [ecx+FIBER_FLS_DATA] - mov [edx+TEB_FLS_DATA], eax - - /* Return */ + /* FIXME: TODO */ ret 4 - -/* EOF */ diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 583669c97a3..69db15dec5e 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -64,6 +64,7 @@ Author: #define KGDT_64_R3_CODE 0x0030 // 33 #define KGDT_TSS 0x0040 #define KGDT_32_R3_TEB 0x0050 // 53 +#define KGDT_64_R3_TEB 0x0000 // FIXME // From 3120b5e9f97525d0ed08baa846336e7837fcbcb3 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 26 Oct 2008 15:23:00 +0000 Subject: [PATCH 372/388] - Fix csrss compilation (treat handles as pointer sized, use SIZE_T where appropriate) svn path=/branches/ros-amd64-bringup/; revision=36992 --- reactos/subsystems/win32/csrss/api/handle.c | 10 +++++----- reactos/subsystems/win32/csrss/api/process.c | 6 +++--- reactos/subsystems/win32/csrss/api/user.c | 4 ++-- reactos/subsystems/win32/csrss/api/wapi.c | 4 ++-- reactos/subsystems/win32/csrss/video.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reactos/subsystems/win32/csrss/api/handle.c b/reactos/subsystems/win32/csrss/api/handle.c index 5a9efda16ff..b8b8c5f922e 100644 --- a/reactos/subsystems/win32/csrss/api/handle.c +++ b/reactos/subsystems/win32/csrss/api/handle.c @@ -22,7 +22,7 @@ static PCSRSS_OBJECT_DEFINITION ObjectDefinitions = NULL; static BOOL CsrIsConsoleHandle(HANDLE Handle) { - return ((ULONG)Handle & 0x10000003) == 0x3; + return ((ULONG_PTR)Handle & 0x10000003) == 0x3; } @@ -63,7 +63,7 @@ CsrRegisterObjectDefinitions(PCSRSS_OBJECT_DEFINITION NewDefinitions) NTSTATUS STDCALL CsrGetObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Handle, Object_t **Object, DWORD Access ) { - ULONG h = (ULONG)Handle >> 2; + ULONG_PTR h = (ULONG_PTR)Handle >> 2; DPRINT("CsrGetObject, Object: %x, %x, %x\n", Object, Handle, ProcessData ? ProcessData->HandleTableSize : 0); RtlEnterCriticalSection(&ProcessData->HandleTableLock); @@ -110,7 +110,7 @@ NTSTATUS STDCALL CsrReleaseObject(PCSRSS_PROCESS_DATA ProcessData, HANDLE Handle) { - ULONG h = (ULONG)Handle >> 2; + ULONG_PTR h = (ULONG_PTR)Handle >> 2; Object_t *Object; RtlEnterCriticalSection(&ProcessData->HandleTableLock); @@ -164,7 +164,7 @@ NTSTATUS STDCALL CsrInsertObject(PCSRSS_PROCESS_DATA ProcessData, ProcessData->HandleTable[i].Object = Object; ProcessData->HandleTable[i].Access = Access; ProcessData->HandleTable[i].Inheritable = Inheritable; - *Handle = (HANDLE)((i << 2) | 0x3); + *Handle = (HANDLE)(ULONG_PTR)((i << 2) | 0x3); _InterlockedIncrement( &Object->ReferenceCount ); RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return(STATUS_SUCCESS); @@ -208,7 +208,7 @@ NTSTATUS STDCALL CsrDuplicateHandleTable(PCSRSS_PROCESS_DATA SourceProcessData, NTSTATUS STDCALL CsrVerifyObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Handle ) { - ULONG h = (ULONG)Handle >> 2; + ULONG_PTR h = (ULONG_PTR)Handle >> 2; if (h >= ProcessData->HandleTableSize || ProcessData->HandleTable[h].Object == NULL) diff --git a/reactos/subsystems/win32/csrss/api/process.c b/reactos/subsystems/win32/csrss/api/process.c index b3d954d9e95..d5394d3d9fe 100644 --- a/reactos/subsystems/win32/csrss/api/process.c +++ b/reactos/subsystems/win32/csrss/api/process.c @@ -243,7 +243,7 @@ CSR_API(CsrCreateProcess) if (Request->Data.CreateProcessRequest.Flags & CREATE_NEW_PROCESS_GROUP) { - NewProcessData->ProcessGroup = (DWORD)NewProcessData->ProcessId; + NewProcessData->ProcessGroup = (DWORD)(ULONG_PTR)NewProcessData->ProcessId; } else { @@ -362,14 +362,14 @@ CSR_API(CsrVerifyHandle) CSR_API(CsrDuplicateHandle) { - ULONG Index; + ULONG_PTR Index; PCSRSS_HANDLE Entry; DWORD DesiredAccess; Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); - Index = (ULONG)Request->Data.DuplicateHandleRequest.Handle >> 2; + Index = (ULONG_PTR)Request->Data.DuplicateHandleRequest.Handle >> 2; RtlEnterCriticalSection(&ProcessData->HandleTableLock); if (Index >= ProcessData->HandleTableSize || (Entry = &ProcessData->HandleTable[Index])->Object == NULL) diff --git a/reactos/subsystems/win32/csrss/api/user.c b/reactos/subsystems/win32/csrss/api/user.c index de963da0a9a..d89e463cecc 100644 --- a/reactos/subsystems/win32/csrss/api/user.c +++ b/reactos/subsystems/win32/csrss/api/user.c @@ -19,7 +19,7 @@ /* GLOBALS *******************************************************************/ static BOOLEAN ServicesProcessIdValid = FALSE; -static ULONG ServicesProcessId; +static ULONG_PTR ServicesProcessId; /* FUNCTIONS *****************************************************************/ @@ -36,7 +36,7 @@ CSR_API(CsrRegisterServicesProcess) } else { - ServicesProcessId = (ULONG)Request->Data.RegisterServicesProcessRequest.ProcessId; + ServicesProcessId = (ULONG_PTR)Request->Data.RegisterServicesProcessRequest.ProcessId; ServicesProcessIdValid = TRUE; return STATUS_SUCCESS; } diff --git a/reactos/subsystems/win32/csrss/api/wapi.c b/reactos/subsystems/win32/csrss/api/wapi.c index 1261bc79b09..5a4d0192702 100644 --- a/reactos/subsystems/win32/csrss/api/wapi.c +++ b/reactos/subsystems/win32/csrss/api/wapi.c @@ -272,8 +272,8 @@ ClientConnectionThread(HANDLE ServerPort) } if (ProcessData->Terminated) { - DPRINT1("Message %d: process %d already terminated\n", - Request->Type, (ULONG)Request->Header.ClientId.UniqueProcess); + DPRINT1("Message %d: process %p already terminated\n", + Request->Type, Request->Header.ClientId.UniqueProcess); continue; } diff --git a/reactos/subsystems/win32/csrss/video.c b/reactos/subsystems/win32/csrss/video.c index fa9b65bb274..8282c15bd7a 100644 --- a/reactos/subsystems/win32/csrss/video.c +++ b/reactos/subsystems/win32/csrss/video.c @@ -24,7 +24,7 @@ InitializeVideoAddressSpace(VOID) HANDLE PhysMemHandle; PVOID BaseAddress; LARGE_INTEGER Offset; - ULONG ViewSize; + SIZE_T ViewSize; CHAR IVTAndBda[1024+256]; /* Open the physical memory section */ From a9ef487300421aa0a6ecd1a8d29309381f3fafe5 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 26 Oct 2008 15:34:08 +0000 Subject: [PATCH 373/388] - Convert to .spec svn path=/branches/ros-amd64-bringup/; revision=36993 --- reactos/dll/win32/smdll/smdll.def | 7 ------- reactos/dll/win32/smdll/smdll.rbuild | 2 +- reactos/dll/win32/smdll/smdll.spec | 5 +++++ 3 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 reactos/dll/win32/smdll/smdll.def create mode 100644 reactos/dll/win32/smdll/smdll.spec diff --git a/reactos/dll/win32/smdll/smdll.def b/reactos/dll/win32/smdll/smdll.def deleted file mode 100644 index 938851cc85a..00000000000 --- a/reactos/dll/win32/smdll/smdll.def +++ /dev/null @@ -1,7 +0,0 @@ -LIBRARY SMDLL.DLL -EXPORTS -SmCompleteSession@12 -SmConnectApiPort@16 -SmExecuteProgram@8 -SmQueryInformation@20 -SmLookupSubsystem@20 diff --git a/reactos/dll/win32/smdll/smdll.rbuild b/reactos/dll/win32/smdll/smdll.rbuild index 770a1ddceb9..b36561fd7f8 100644 --- a/reactos/dll/win32/smdll/smdll.rbuild +++ b/reactos/dll/win32/smdll/smdll.rbuild @@ -1,5 +1,5 @@ - + . include/reactos/subsys diff --git a/reactos/dll/win32/smdll/smdll.spec b/reactos/dll/win32/smdll/smdll.spec new file mode 100644 index 00000000000..a917bf979a7 --- /dev/null +++ b/reactos/dll/win32/smdll/smdll.spec @@ -0,0 +1,5 @@ +@ stdcall SmCompleteSession(ptr ptr ptr) +@ stdcall SmConnectApiPort(ptr ptr long ptr) +@ stdcall SmExecuteProgram(ptr ptr) +@ stdcall SmQueryInformation(ptr long ptr long ptr) +@ stdcall SmLookupSubsystem(ptr ptr ptr ptr ptr) From 054ccf1593e0f0929a77b5fb2d84c0b84c79aea7 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 26 Oct 2008 21:35:03 +0000 Subject: [PATCH 374/388] - Remove ntdll exports not applicable for amd64, fix a couple of broken export names and stub out RtlInitializeCriticalSectionEx until its parameters are determined - Add rtl and ntdll stubs for arch specific routines - Now ntdll almost links, but some missing crt support is left to do svn path=/branches/ros-amd64-bringup/; revision=37004 --- reactos/dll/ntdll/def/ntdll_amd64.def | 63 ++++++++----------- reactos/dll/ntdll/dispatch/amd64/stubs.c | 43 +++++++++++++ reactos/dll/ntdll/ntdll.rbuild | 5 ++ reactos/lib/rtl/amd64/stubs.c | 77 ++++++++++++++++++++++++ reactos/lib/rtl/rtl.rbuild | 3 + 5 files changed, 153 insertions(+), 38 deletions(-) create mode 100644 reactos/dll/ntdll/dispatch/amd64/stubs.c create mode 100644 reactos/lib/rtl/amd64/stubs.c diff --git a/reactos/dll/ntdll/def/ntdll_amd64.def b/reactos/dll/ntdll/def/ntdll_amd64.def index 6d1c9cb0639..95c49012282 100644 --- a/reactos/dll/ntdll/def/ntdll_amd64.def +++ b/reactos/dll/ntdll/def/ntdll_amd64.def @@ -39,9 +39,6 @@ KiRaiseUserExceptionDispatcher KiUserApcDispatcher KiUserCallbackDispatcher KiUserExceptionDispatcher -KiIntSystemCall -KiFastSystemCallRet -KiFastSystemCall LdrAccessResource LdrAddRefDll LdrDisableThreadCalloutsForDll @@ -475,7 +472,7 @@ RtlFreeSid RtlFreeUnicodeString RtlFreeUserThreadStack RtlGUIDFromString -RtlGeneratedotName +RtlGenerate8dot3Name RtlGetAce ;RtlGetCallersAddress RtlGetCompressionWorkSpaceSize @@ -488,7 +485,7 @@ RtlGetFirstRange RtlGetFullPathName_U RtlGetGroupSecurityDescriptor RtlGetLastNtStatus -RtlGetLastWinError +RtlGetLastWin32Error RtlGetLongestNtPathLength RtlGetNextRange RtlGetNtGlobalFlags @@ -519,7 +516,7 @@ RtlInitializeBitMap RtlInitializeConditionVariable RtlInitializeContext RtlInitializeCriticalSection -RtlInitializeCriticalSectionEx +;RtlInitializeCriticalSectionEx RtlInitializeCriticalSectionAndSpinCount RtlInitializeGenericTable RtlInitializeGenericTableAvl @@ -533,26 +530,26 @@ RtlInsertElementGenericTable RtlInsertElementGenericTableAvl RtlInsertElementGenericTableFull RtlInsertElementGenericTableFullAvl -RtlIntToUnicodeString +RtlInt64ToUnicodeString RtlIntegerToChar RtlIntegerToUnicodeString RtlInvertRangeList -RtlIpvAddressToStringA -RtlIpvAddressToStringExA -RtlIpvAddressToStringExW -RtlIpvAddressToStringW -RtlIpvStringToAddressA -RtlIpvStringToAddressExA -RtlIpvStringToAddressExW -RtlIpvStringToAddressW -RtlIpvAddressToStringA -RtlIpvAddressToStringExA -RtlIpvAddressToStringExW -RtlIpvAddressToStringW -RtlIpvStringToAddressA -RtlIpvStringToAddressExA -RtlIpvStringToAddressExW -RtlIpvStringToAddressW +RtlIpv4AddressToStringA +RtlIpv4AddressToStringExA +RtlIpv4AddressToStringExW +RtlIpv4AddressToStringW +RtlIpv4StringToAddressA +RtlIpv4StringToAddressExA +RtlIpv4StringToAddressExW +RtlIpv4StringToAddressW +RtlIpv6AddressToStringA +RtlIpv6AddressToStringExA +RtlIpv6AddressToStringExW +RtlIpv6AddressToStringW +RtlIpv6StringToAddressA +RtlIpv6StringToAddressExA +RtlIpv6StringToAddressExW +RtlIpv6StringToAddressW RtlIsDosDeviceName_U RtlIsGenericTableEmpty RtlIsGenericTableEmptyAvl @@ -635,11 +632,11 @@ RtlReleaseSRWLockShared ;RtlRemoteCall RtlRemoveVectoredExceptionHandler RtlResetRtlTranslations -RtlRestoreLastWinError=RtlSetLastWinError +RtlRestoreLastWin32Error=RtlSetLastWin32Error RtlRunDecodeUnicodeString RtlRunEncodeUnicodeString -RtlSecondsSinceToTime -RtlSecondsSinceToTime +RtlSecondsSince1970ToTime +RtlSecondsSince1980ToTime RtlSelfRelativeToAbsoluteSD RtlSelfRelativeToAbsoluteSD2 RtlSetAllBits @@ -653,8 +650,8 @@ RtlSetDaclSecurityDescriptor RtlSetEnvironmentVariable RtlSetGroupSecurityDescriptor RtlSetInformationAcl -RtlSetLastWinError -RtlSetLastWinErrorAndNtStatusFromNtStatus +RtlSetLastWin32Error +RtlSetLastWin32ErrorAndNtStatusFromNtStatus RtlSetOwnerSecurityDescriptor RtlSetProcessIsCritical RtlSetSaclSecurityDescriptor @@ -970,19 +967,9 @@ __isascii __iscsym __iscsymf __toascii -_alldiv -_allmul -_alloca_probe -_allrem -_allshl -_allshr _atoi64 -_aulldiv -_aullrem -_aullshr _chkstk _fltused -_ftol _itoa _itow _i64toa diff --git a/reactos/dll/ntdll/dispatch/amd64/stubs.c b/reactos/dll/ntdll/dispatch/amd64/stubs.c new file mode 100644 index 00000000000..fe7b4a78656 --- /dev/null +++ b/reactos/dll/ntdll/dispatch/amd64/stubs.c @@ -0,0 +1,43 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS NT Library + * FILE: dll/ntdll/dispatch/amd64/stubs.c + * PURPOSE: AMD64 stubs + * PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include + +/* PUBLIC FUNCTIONS **********************************************************/ + +/* + * @unimplemented + */ +VOID +NTAPI +LdrInitializeThunk(ULONG Unknown1, // FIXME: Parameters! + ULONG Unknown2, + ULONG Unknown3, + ULONG Unknown4) +{ + UNIMPLEMENTED; + return; +} + +/* + * @unimplemented + */ +VOID +NTAPI +KiUserApcDispatcher(IN PVOID NormalRoutine, + IN PVOID NormalContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2) +{ + UNIMPLEMENTED; + return; +} diff --git a/reactos/dll/ntdll/ntdll.rbuild b/reactos/dll/ntdll/ntdll.rbuild index d45a85793e7..30ae9246255 100644 --- a/reactos/dll/ntdll/ntdll.rbuild +++ b/reactos/dll/ntdll/ntdll.rbuild @@ -31,6 +31,11 @@ dispatch.S + + + stubs.c + + stubs_asm.s diff --git a/reactos/lib/rtl/amd64/stubs.c b/reactos/lib/rtl/amd64/stubs.c new file mode 100644 index 00000000000..e5ed5f15185 --- /dev/null +++ b/reactos/lib/rtl/amd64/stubs.c @@ -0,0 +1,77 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Run-Time Library + * PURPOSE: AMD64 stubs + * FILE: lib/rtl/amd64/stubs.c + * PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include + +/* PUBLIC FUNCTIONS **********************************************************/ + +/* + * @unimplemented + */ +PVOID +NTAPI +RtlLookupFunctionEntry(IN ULONGLONG ControlPC, + OUT PULONGLONG ImageBase, + OUT PULONGLONG TargetGp) +{ + UNIMPLEMENTED; + return NULL; +} + +/* + * @unimplemented + */ +VOID +NTAPI +RtlInitializeContext(IN HANDLE ProcessHandle, + OUT PCONTEXT ThreadContext, + IN PVOID ThreadStartParam OPTIONAL, + IN PTHREAD_START_ROUTINE ThreadStartAddress, + IN PINITIAL_TEB InitialTeb) +{ + UNIMPLEMENTED; + return; +} + +/* + * @unimplemented + */ +VOID +NTAPI +RtlCaptureContext(OUT PCONTEXT ContextRecord) +{ + UNIMPLEMENTED; + return; +} + +/* + * @unimplemented + */ +PVOID +NTAPI +RtlpGetExceptionAddress(VOID) +{ + UNIMPLEMENTED; + return NULL; +} + +/* + * @unimplemented + */ +BOOLEAN +NTAPI +RtlDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, + IN PCONTEXT Context) +{ + UNIMPLEMENTED; + return FALSE; +} diff --git a/reactos/lib/rtl/rtl.rbuild b/reactos/lib/rtl/rtl.rbuild index e5f9796b3e3..a39fd2eefb2 100644 --- a/reactos/lib/rtl/rtl.rbuild +++ b/reactos/lib/rtl/rtl.rbuild @@ -39,7 +39,10 @@ debug_asm.S + stubs.c + mem.c + memgen.c avl.c From e4a9e9d8dd677fc02fe7e5b94e0b716dfaf3dd20 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 27 Oct 2008 13:00:44 +0000 Subject: [PATCH 375/388] On x64 the 64 bit ring3 teb (gs) shares the generic 64 bit data selector, while the 32 bit teb (fs) has it's own selector. svn path=/branches/ros-amd64-bringup/; revision=37019 --- reactos/dll/win32/kernel32/misc/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/utils.c b/reactos/dll/win32/kernel32/misc/utils.c index 0a61194a821..0e87c22100d 100644 --- a/reactos/dll/win32/kernel32/misc/utils.c +++ b/reactos/dll/win32/kernel32/misc/utils.c @@ -386,12 +386,12 @@ BasepInitializeContext(IN PCONTEXT Context, /* The other registers are undefined */ /* Setup the Segments */ - Context->SegFs = KGDT_64_R3_TEB | RPL_MASK; + Context->SegGs = KGDT_64_DATA | RPL_MASK; Context->SegEs = KGDT_64_DATA | RPL_MASK; Context->SegDs = KGDT_64_DATA | RPL_MASK; Context->SegCs = KGDT_64_R3_CODE | RPL_MASK; Context->SegSs = KGDT_64_DATA | RPL_MASK; - Context->SegGs = 0; + Context->SegFs = KGDT_32_R3_TEB; /* Set the EFLAGS */ Context->EFlags = 0x3000; /* IOPL 3 */ From 3f09a26b0b6a495f078f8d791522e82061c76269 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 27 Oct 2008 13:52:52 +0000 Subject: [PATCH 376/388] update videoprt.spec, add some exports found on vista64 and reorder some functions alphabetically svn path=/branches/ros-amd64-bringup/; revision=37021 --- reactos/drivers/video/videoprt/videoprt.spec | 41 ++++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/reactos/drivers/video/videoprt/videoprt.spec b/reactos/drivers/video/videoprt/videoprt.spec index 61a147cb665..c8924e6b754 100644 --- a/reactos/drivers/video/videoprt/videoprt.spec +++ b/reactos/drivers/video/videoprt/videoprt.spec @@ -1,3 +1,4 @@ +;ScsiPortNotification // vista64 @ stdcall VideoPortAcquireDeviceLock(ptr) @ stdcall VideoPortAcquireSpinLock(ptr ptr ptr) @ stdcall VideoPortAcquireSpinLockAtDpcLevel(ptr ptr) @@ -7,6 +8,7 @@ @ stdcall VideoPortAllocatePool(ptr long long long) ;VideoPortAssociateEventsWithDmaHandle @ stdcall VideoPortCheckForDeviceExistence(ptr long long long long long long) +;VideoPortCheckForDeviceExistence there's a second dummy export with the same name on ms videoprt @ stdcall VideoPortClearEvent(ptr ptr) @ stdcall VideoPortCompareMemory(ptr ptr long) NTOSKRNL.RtlCompareMemory ;VideoPortCompleteDma @@ -14,6 +16,9 @@ @ stdcall VideoPortCreateSecondaryDisplay(ptr ptr long) @ stdcall VideoPortCreateSpinLock(ptr ptr) @ stdcall VideoPortDDCMonitorHelper(ptr ptr ptr long) +;VideoPortDbgReportComplete // vista64 +;VideoPortDbgReportCreate // vista64 +;VideoPortDbgReportSecondaryData // vista64 @ cdecl VideoPortDebugPrint(long ptr) @ stdcall VideoPortDeleteEvent(ptr ptr) @ stdcall VideoPortDeleteSpinLock(ptr ptr) @@ -48,29 +53,31 @@ @ fastcall VideoPortInterlockedExchange(ptr long) NTOSKRNL.InterlockedExchange @ fastcall VideoPortInterlockedIncrement(ptr) NTOSKRNL.InterlockedIncrement @ stdcall VideoPortLockBuffer(ptr ptr long long) +;VideoPortIsNoVesa // 2003 and later ;VideoPortLockPages @ stdcall VideoPortLogError(ptr ptr long long) @ stdcall VideoPortMapBankedMemory(ptr long long ptr ptr ptr long long ptr ptr) ;VideoPortMapDmaMemory @ stdcall VideoPortMapMemory(ptr long long ptr ptr ptr) @ stdcall VideoPortMoveMemory(ptr ptr long) NTOSKRNL.RtlMoveMemory +;VideoPortNotification @ stdcall VideoPortPutDmaAdapter(ptr ptr) @ stdcall VideoPortQueryPerformanceCounter(ptr ptr) @ stdcall VideoPortQueryServices(ptr long ptr) @ stdcall VideoPortQuerySystemTime(ptr) NTOSKRNL.KeQuerySystemTime @ stdcall VideoPortQueueDpc(ptr ptr ptr) -@ stdcall VideoPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR -@ stdcall VideoPortReadPortUshort(ptr) HAL.READ_PORT_USHORT -@ stdcall VideoPortReadPortUlong(ptr) HAL.READ_PORT_ULONG @ stdcall VideoPortReadPortBufferUchar(ptr ptr long) HAL.READ_PORT_BUFFER_UCHAR -@ stdcall VideoPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT @ stdcall VideoPortReadPortBufferUlong(ptr ptr long) HAL.READ_PORT_BUFFER_ULONG -@ stdcall VideoPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR -@ stdcall VideoPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT -@ stdcall VideoPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG +@ stdcall VideoPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT +@ stdcall VideoPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR +@ stdcall VideoPortReadPortUlong(ptr) HAL.READ_PORT_ULONG +@ stdcall VideoPortReadPortUshort(ptr) HAL.READ_PORT_USHORT @ stdcall VideoPortReadRegisterBufferUchar(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_UCHAR -@ stdcall VideoPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT @ stdcall VideoPortReadRegisterBufferUlong(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_ULONG +@ stdcall VideoPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT +@ stdcall VideoPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR +@ stdcall VideoPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG +@ stdcall VideoPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT ;VideoPortReadStateEvent @ stdcall VideoPortRegisterBugcheckCallback(ptr long ptr long) @ stdcall VideoPortReleaseBuffer(ptr ptr) @@ -97,18 +104,18 @@ @ stdcall VideoPortUnmapMemory(ptr ptr ptr) @ stdcall VideoPortVerifyAccessRanges(ptr long ptr) @ stdcall VideoPortWaitForSingleObject(ptr ptr ptr) -@ stdcall VideoPortWritePortUchar(ptr long) HAL.WRITE_PORT_UCHAR -@ stdcall VideoPortWritePortUshort(ptr long) HAL.WRITE_PORT_USHORT -@ stdcall VideoPortWritePortUlong(ptr long) HAL.WRITE_PORT_ULONG @ stdcall VideoPortWritePortBufferUchar(ptr ptr long) HAL.WRITE_PORT_BUFFER_UCHAR -@ stdcall VideoPortWritePortBufferUshort(ptr ptr long) HAL.WRITE_PORT_BUFFER_USHORT @ stdcall VideoPortWritePortBufferUlong(ptr ptr long) HAL.WRITE_PORT_BUFFER_ULONG -@ stdcall VideoPortWriteRegisterUchar(ptr long) NTOSKRNL.WRITE_REGISTER_UCHAR -@ stdcall VideoPortWriteRegisterUshort(ptr long) NTOSKRNL.WRITE_REGISTER_USHORT -@ stdcall VideoPortWriteRegisterUlong(ptr long) NTOSKRNL.WRITE_REGISTER_ULONG +@ stdcall VideoPortWritePortBufferUshort(ptr ptr long) HAL.WRITE_PORT_BUFFER_USHORT +@ stdcall VideoPortWritePortUchar(ptr long) HAL.WRITE_PORT_UCHAR +@ stdcall VideoPortWritePortUlong(ptr long) HAL.WRITE_PORT_ULONG +@ stdcall VideoPortWritePortUshort(ptr long) HAL.WRITE_PORT_USHORT @ stdcall VideoPortWriteRegisterBufferUchar(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR -@ stdcall VideoPortWriteRegisterBufferUshort(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT @ stdcall VideoPortWriteRegisterBufferUlong(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG -@ stdcall VideoPortZeroMemory(ptr long) NTOSKRNL.RtlZeroMemory +@ stdcall VideoPortWriteRegisterBufferUshort(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT +@ stdcall VideoPortWriteRegisterUchar(ptr long) NTOSKRNL.WRITE_REGISTER_UCHAR +@ stdcall VideoPortWriteRegisterUlong(ptr long) NTOSKRNL.WRITE_REGISTER_ULONG +@ stdcall VideoPortWriteRegisterUshort(ptr long) NTOSKRNL.WRITE_REGISTER_USHORT @ stdcall VideoPortZeroDeviceMemory(ptr long) NTOSKRNL.RtlZeroMemory +@ stdcall VideoPortZeroMemory(ptr long) NTOSKRNL.RtlZeroMemory @ stdcall VpNotifyEaData(ptr ptr) From 6abc9b3490383d0351efca2f5c22fb2597b8592e Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Mon, 27 Oct 2008 14:09:17 +0000 Subject: [PATCH 377/388] - Remove broken KGDT_64_R3_TEB svn path=/branches/ros-amd64-bringup/; revision=37022 --- reactos/include/ndk/amd64/ketypes.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 69db15dec5e..32df59f83aa 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -64,8 +64,6 @@ Author: #define KGDT_64_R3_CODE 0x0030 // 33 #define KGDT_TSS 0x0040 #define KGDT_32_R3_TEB 0x0050 // 53 -#define KGDT_64_R3_TEB 0x0000 // FIXME - // // CR4 From 7d9ca3dd8675a71c877f0682f52f756275b08faa Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 30 Oct 2008 10:01:33 +0000 Subject: [PATCH 378/388] remove ntoskrnl.spec svn path=/branches/ros-amd64-bringup/; revision=37089 --- reactos/ntoskrnl/ntoskrnl.spec | 1660 -------------------------------- 1 file changed, 1660 deletions(-) delete mode 100644 reactos/ntoskrnl/ntoskrnl.spec diff --git a/reactos/ntoskrnl/ntoskrnl.spec b/reactos/ntoskrnl/ntoskrnl.spec deleted file mode 100644 index 9fb2550a30c..00000000000 --- a/reactos/ntoskrnl/ntoskrnl.spec +++ /dev/null @@ -1,1660 +0,0 @@ -#include "include/reactos/msvctarget.h" - -@ stdcall CcCanIWrite(ptr long long long) -@ stdcall CcCopyRead(ptr ptr long long ptr ptr) -@ stdcall CcCopyWrite(ptr ptr long long ptr) -@ stdcall CcDeferWrite(ptr ptr ptr ptr long long) -@ stdcall CcFastCopyRead(ptr long long long ptr ptr) -@ stdcall CcFastCopyWrite(ptr long long ptr) -@ extern CcFastMdlReadWait -@ extern CcFastReadNotPossible -@ extern CcFastReadWait -@ stdcall CcFlushCache(ptr ptr long ptr) -@ stdcall CcGetDirtyPages(ptr ptr ptr ptr) -@ stdcall CcGetFileObjectFromBcb(ptr) -@ stdcall CcGetFileObjectFromSectionPtrs(ptr) -@ stdcall CcGetFlushedValidData(ptr long) -@ stdcall CcGetLsnForFileObject(ptr ptr) -@ stdcall CcInitializeCacheMap(ptr ptr long ptr ptr) -@ stdcall CcIsThereDirtyData(ptr) -@ stdcall CcMapData(ptr ptr long long ptr ptr) -@ stdcall CcMdlRead(ptr ptr long ptr ptr) -@ stdcall CcMdlReadComplete(ptr ptr) -@ stdcall CcMdlWriteAbort(ptr ptr) -@ stdcall CcMdlWriteComplete(ptr ptr ptr) -@ stdcall CcPinMappedData(ptr ptr long long ptr) -@ stdcall CcPinRead(ptr ptr long long ptr ptr) -@ stdcall CcPrepareMdlWrite(ptr ptr long ptr ptr) -@ stdcall CcPreparePinWrite(ptr ptr long long long ptr ptr) -@ stdcall CcPurgeCacheSection(ptr ptr long long) -@ stdcall CcRemapBcb(ptr) -@ stdcall CcRepinBcb(ptr) -@ stdcall CcScheduleReadAhead(ptr ptr long) -@ stdcall CcSetAdditionalCacheAttributes(ptr long long) -@ stdcall CcSetBcbOwnerPointer(ptr ptr) -@ stdcall CcSetDirtyPageThreshold(ptr long) -@ stdcall CcSetDirtyPinnedData(ptr ptr) -@ stdcall CcSetFileSizes(ptr ptr) -@ stdcall CcSetLogHandleForFile(ptr ptr ptr) -@ stdcall CcSetReadAheadGranularity(ptr long) -@ stdcall CcUninitializeCacheMap(ptr ptr ptr) -@ stdcall CcUnpinData(ptr) -@ stdcall CcUnpinDataForThread(ptr ptr) -@ stdcall CcUnpinRepinnedBcb(ptr long ptr) -@ stdcall CcWaitForCurrentLazyWriterActivity() -@ stdcall CcZeroData(ptr ptr ptr long) -@ stdcall CmRegisterCallback(ptr ptr ptr) -@ stdcall CmUnRegisterCallback(long long) -@ stdcall DbgBreakPoint() -@ stdcall DbgBreakPointWithStatus(long) -;DbgCommandString -@ stdcall DbgLoadImageSymbols(ptr ptr long) -@ cdecl DbgPrint(str) -@ cdecl DbgPrintEx(long long str) -@ cdecl DbgPrintReturnControlC(str) -@ stdcall DbgPrompt(str ptr long) -@ stdcall DbgQueryDebugFilterState(long long) -@ stdcall DbgSetDebugFilterState(long long long) -#ifdef __x86_64__ -@ fastcall ExAcquireFastMutex(ptr) -#endif -@ fastcall ExAcquireFastMutexUnsafe(ptr) -@ stdcall ExAcquireResourceExclusiveLite(ptr long) -@ stdcall ExAcquireResourceSharedLite(ptr long) -@ fastcall ExAcquireRundownProtection(ptr) ExfAcquireRundownProtection -@ fastcall ExAcquireRundownProtectionCacheAware(ptr) ExfAcquireRundownProtectionCacheAware -@ fastcall ExAcquireRundownProtectionCacheAwareEx(ptr long) ExfAcquireRundownProtectionCacheAwareEx -@ fastcall ExAcquireRundownProtectionEx(ptr long) ExfAcquireRundownProtectionEx -@ stdcall ExAcquireSharedStarveExclusive(ptr long) -@ stdcall ExAcquireSharedWaitForExclusive(ptr long) -@ stdcall ExAllocateCacheAwareRundownProtection(long long) -@ stdcall ExAllocateFromPagedLookasideList(ptr) ExiAllocateFromPagedLookasideList -@ stdcall ExAllocatePool(long long) -@ stdcall ExAllocatePoolWithQuota(long long) -@ stdcall ExAllocatePoolWithQuotaTag(long long long) -@ stdcall ExAllocatePoolWithTag(long long long) -@ stdcall ExAllocatePoolWithTagPriority(long long long long) -@ stdcall ExConvertExclusiveToSharedLite(ptr) -@ stdcall ExCreateCallback(ptr ptr long long) -@ stdcall ExDeleteNPagedLookasideList(ptr) -@ stdcall ExDeletePagedLookasideList(ptr) -@ stdcall ExDeleteResourceLite(ptr) -@ extern ExDesktopObjectType -@ stdcall ExDisableResourceBoostLite(ptr) -@ fastcall ExEnterCriticalRegionAndAcquireFastMutexUnsafe(ptr) -@ stdcall ExEnterCriticalRegionAndAcquireResourceExclusive(ptr) -;ExEnterCriticalRegionAndAcquireResourceShared -;ExEnterCriticalRegionAndAcquireSharedWaitForExclusive -@ stdcall ExEnumHandleTable(ptr ptr ptr ptr) -@ extern ExEventObjectType _ExEventObjectType -@ stdcall ExExtendZone(ptr ptr long) -@ stdcall ExFreeCacheAwareRundownProtection(ptr) -@ stdcall ExFreePool(ptr) -@ stdcall ExFreePoolWithTag(ptr long) -@ stdcall ExFreeToPagedLookasideList(ptr ptr) ExiFreeToPagedLookasideList -@ stdcall ExGetCurrentProcessorCounts(ptr ptr ptr) -@ stdcall ExGetCurrentProcessorCpuUsage(ptr) -@ stdcall ExGetExclusiveWaiterCount(ptr) -@ stdcall ExGetPreviousMode() -@ stdcall ExGetSharedWaiterCount(ptr) -@ stdcall ExInitializeNPagedLookasideList(ptr ptr ptr long long long long) -@ stdcall ExInitializePagedLookasideList(ptr ptr ptr long long long long) -@ stdcall ExInitializeResourceLite(ptr) -@ fastcall ExInitializeRundownProtection(ptr) ExfInitializeRundownProtection -@ stdcall ExInitializeRundownProtectionCacheAware(ptr long) -@ stdcall ExInitializeZone(ptr long ptr long) -@ stdcall ExInterlockedAddLargeInteger(ptr long long ptr) -@ fastcall ExInterlockedAddLargeStatistic(ptr long) -@ stdcall ExInterlockedAddUlong(ptr long ptr) -#ifndef __x86_64__ -@ fastcall ExInterlockedCompareExchange64(ptr ptr ptr ptr) -@ stdcall ExInterlockedDecrementLong(ptr ptr) -@ stdcall ExInterlockedExchangeUlong(ptr long ptr) -#endif -@ stdcall ExInterlockedExtendZone(ptr ptr long ptr) -#ifndef __x86_64__ -@ fastcall ExInterlockedFlushSList(ptr) -@ stdcall ExInterlockedIncrementLong(ptr ptr) -#endif -@ stdcall ExInterlockedInsertHeadList(ptr ptr ptr) -@ stdcall ExInterlockedInsertTailList(ptr ptr ptr) -@ stdcall ExInterlockedPopEntryList(ptr ptr) -#ifndef __x86_64__ -@ fastcall ExInterlockedPopEntrySList(ptr ptr) -#endif -@ stdcall ExInterlockedPushEntryList(ptr ptr ptr) -#ifndef __x86_64__ -@ fastcall ExInterlockedPushEntrySList(ptr ptr ptr) -#endif -@ stdcall ExInterlockedRemoveHeadList(ptr ptr) -@ stdcall ExIsProcessorFeaturePresent(long) -@ stdcall ExIsResourceAcquiredExclusiveLite(ptr) -@ stdcall ExIsResourceAcquiredSharedLite(ptr) -@ stdcall ExLocalTimeToSystemTime(ptr ptr) -@ stdcall ExNotifyCallback(ptr ptr ptr) -@ stdcall ExQueryPoolBlockSize(ptr ptr) -@ stdcall ExQueueWorkItem(ptr long) -@ stdcall ExRaiseAccessViolation() -@ stdcall ExRaiseDatatypeMisalignment() -@ stdcall ExRaiseException(ptr) RtlRaiseException -@ stdcall ExRaiseHardError(long long long ptr long ptr) -@ stdcall ExRaiseStatus(long) RtlRaiseStatus -@ fastcall ExReInitializeRundownProtection(ptr) ExfReInitializeRundownProtection -@ fastcall ExReInitializeRundownProtectionCacheAware(ptr) ExfReInitializeRundownProtectionCacheAware -@ stdcall ExRegisterCallback(ptr ptr ptr) -@ stdcall ExReinitializeResourceLite(ptr) -#ifdef __x86_64__ -@ fastcall ExReleaseFastMutex(ptr) -#endif -@ fastcall ExReleaseFastMutexUnsafe(ptr) -@ fastcall ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(ptr) -@ fastcall ExReleaseResourceAndLeaveCriticalRegion(ptr) -@ stdcall ExReleaseResourceForThreadLite(ptr long) -@ fastcall ExReleaseResourceLite(ptr) -@ fastcall ExReleaseRundownProtection(ptr) ExfReleaseRundownProtection -@ fastcall ExReleaseRundownProtectionCacheAware(ptr) ExfReleaseRundownProtectionCacheAware -@ fastcall ExReleaseRundownProtectionCacheAwareEx(ptr long) ExfReleaseRundownProtectionCacheAwareEx -@ fastcall ExReleaseRundownProtectionEx(ptr long) ExfReleaseRundownProtectionEx -@ fastcall ExRundownCompleted(ptr) ExfRundownCompleted -@ fastcall ExRundownCompletedCacheAware(ptr) ExfRundownCompletedCacheAware -@ extern ExSemaphoreObjectType _ExSemaphoreObjectType -@ stdcall ExSetResourceOwnerPointer(ptr ptr) -@ stdcall ExSetTimerResolution(long long) -@ stdcall ExSizeOfRundownProtectionCacheAware() -@ stdcall ExSystemExceptionFilter() -@ stdcall ExSystemTimeToLocalTime(ptr ptr) -#ifdef __x86_64__ -@ fastcall ExTryToAcquireFastMutex(ptr) -#endif -@ stdcall ExUnregisterCallback(ptr) -@ stdcall ExUuidCreate(ptr) -@ stdcall ExVerifySuite(long) -@ fastcall ExWaitForRundownProtectionRelease(ptr) ExfWaitForRundownProtectionRelease -@ fastcall ExWaitForRundownProtectionReleaseCacheAware(ptr) ExfWaitForRundownProtectionReleaseCacheAware -@ extern ExWindowStationObjectType -@ fastcall ExfAcquirePushLockExclusive(ptr) -@ fastcall ExfAcquirePushLockShared(ptr) -#ifndef __x86_64__ -@ fastcall ExfInterlockedAddUlong(ptr long ptr) -@ fastcall ExfInterlockedCompareExchange64(ptr ptr ptr) -@ fastcall ExfInterlockedInsertHeadList(ptr ptr ptr) -@ fastcall ExfInterlockedInsertTailList(ptr ptr ptr) -@ fastcall ExfInterlockedPopEntryList(ptr ptr) -@ fastcall ExfInterlockedPushEntryList(ptr ptr ptr) -@ fastcall ExfInterlockedRemoveHeadList(ptr ptr) -#endif -@ fastcall ExfReleasePushLock(ptr) -@ fastcall ExfReleasePushLockExclusive(ptr) -@ fastcall ExfReleasePushLockShared(ptr) -@ fastcall ExfTryToWakePushLock(ptr) -@ fastcall ExfUnblockPushLock(ptr ptr) -#ifdef __x86_64__ -@ stdcall ExpInterlockedFlushSList(ptr) -@ stdcall ExpInterlockedPopEntrySList(ptr ptr) -@ stdcall ExpInterlockedPushEntrySList(ptr ptr) -#endif -#ifdef _M_IX86 -@ fastcall Exfi386InterlockedDecrementLong(ptr) -@ fastcall Exfi386InterlockedExchangeUlong(ptr long) -@ fastcall Exfi386InterlockedIncrementLong(ptr) -@ stdcall Exi386InterlockedDecrementLong(ptr) -@ stdcall Exi386InterlockedExchangeUlong(ptr long long) -@ stdcall Exi386InterlockedIncrementLong(ptr) -#endif -#ifdef _M_IX86 -@ fastcall ExiAcquireFastMutex(ptr) ExAcquireFastMutex -@ fastcall ExiReleaseFastMutex(ptr) ExReleaseFastMutex -@ fastcall ExiTryToAcquireFastMutex(ptr) ExTryToAcquireFastMutex -#endif -@ stdcall FsRtlAcquireFileExclusive(ptr) -;FsRtlAddBaseMcbEntry -@ stdcall FsRtlAddLargeMcbEntry(ptr long long long long long long) -@ stdcall FsRtlAddMcbEntry(ptr long long long) -@ stdcall FsRtlAddToTunnelCache(ptr long long ptr ptr long long ptr) -@ stdcall FsRtlAllocateFileLock(ptr ptr) -@ stdcall FsRtlAllocatePool(long long) -@ stdcall FsRtlAllocatePoolWithQuota(long long) -@ stdcall FsRtlAllocatePoolWithQuotaTag(long long long) -@ stdcall FsRtlAllocatePoolWithTag(long long long) -@ stdcall FsRtlAllocateResource() -@ stdcall FsRtlAreNamesEqual(ptr ptr long wstr) -@ stdcall FsRtlBalanceReads(ptr) -@ stdcall FsRtlCheckLockForReadAccess(ptr ptr) -@ stdcall FsRtlCheckLockForWriteAccess(ptr ptr) -@ stdcall FsRtlCheckOplock(ptr ptr ptr ptr ptr) -@ stdcall FsRtlCopyRead(ptr ptr long long long ptr ptr ptr) -@ stdcall FsRtlCopyWrite(ptr ptr long long long ptr ptr ptr) -@ stdcall FsRtlCreateSectionForDataScan(ptr ptr ptr ptr long ptr ptr long long long) -@ stdcall FsRtlCurrentBatchOplock(ptr) -@ stdcall FsRtlDeleteKeyFromTunnelCache(ptr long long) -@ stdcall FsRtlDeleteTunnelCache(ptr) -@ stdcall FsRtlDeregisterUncProvider(ptr) -@ stdcall FsRtlDissectDbcs(long ptr ptr ptr) -@ stdcall FsRtlDissectName(long ptr ptr ptr) -@ stdcall FsRtlDoesDbcsContainWildCards(ptr) -@ stdcall FsRtlDoesNameContainWildCards(ptr) -@ stdcall FsRtlFastCheckLockForRead(ptr ptr ptr long ptr ptr) -@ stdcall FsRtlFastCheckLockForWrite(ptr ptr ptr long ptr ptr) -@ stdcall FsRtlFastUnlockAll(ptr ptr ptr ptr) -@ stdcall FsRtlFastUnlockAllByKey(ptr ptr ptr long ptr) -@ stdcall FsRtlFastUnlockSingle(ptr ptr ptr ptr ptr long ptr long) -@ stdcall FsRtlFindInTunnelCache(ptr long long ptr ptr ptr ptr ptr) -@ stdcall FsRtlFreeFileLock(ptr) -@ stdcall FsRtlGetFileSize(ptr ptr) -;FsRtlGetNextBaseMcbEntry -@ stdcall FsRtlGetNextFileLock(ptr long) -@ stdcall FsRtlGetNextLargeMcbEntry(ptr long ptr ptr ptr) -@ stdcall FsRtlGetNextMcbEntry(ptr long ptr ptr ptr) -@ stdcall FsRtlIncrementCcFastReadNoWait() -@ stdcall FsRtlIncrementCcFastReadNotPossible() -@ stdcall FsRtlIncrementCcFastReadResourceMiss() -@ stdcall FsRtlIncrementCcFastReadWait() -;FsRtlInitializeBaseMcb -@ stdcall FsRtlInitializeFileLock(ptr ptr ptr) -@ stdcall FsRtlInitializeLargeMcb(ptr long) -@ stdcall FsRtlInitializeMcb(ptr long) -@ stdcall FsRtlInitializeOplock(ptr) -@ stdcall FsRtlInitializeTunnelCache(ptr) -@ stdcall FsRtlInsertPerFileObjectContext(ptr ptr) -@ stdcall FsRtlInsertPerStreamContext(ptr ptr) -@ stdcall FsRtlIsDbcsInExpression(ptr ptr) -@ stdcall FsRtlIsFatDbcsLegal(long ptr long long long) -@ stdcall FsRtlIsHpfsDbcsLegal(long ptr long long long) -@ stdcall FsRtlIsNameInExpression(ptr ptr long wstr) -@ stdcall FsRtlIsNtstatusExpected(long) -@ stdcall FsRtlIsPagingFile(ptr) -@ stdcall FsRtlIsTotalDeviceFailure(ptr) -@ extern FsRtlLegalAnsiCharacterArray _FsRtlLegalAnsiCharacterArray -;FsRtlLookupBaseMcbEntry -@ stdcall FsRtlLookupLargeMcbEntry(ptr long long ptr ptr ptr ptr ptr) -;FsRtlLookupLastBaseMcbEntry -;FsRtlLookupLastBaseMcbEntryAndIndex -@ stdcall FsRtlLookupLastLargeMcbEntry(ptr ptr ptr) -@ stdcall FsRtlLookupLastLargeMcbEntryAndIndex(ptr ptr ptr ptr) -@ stdcall FsRtlLookupLastMcbEntry(ptr ptr ptr) -@ stdcall FsRtlLookupMcbEntry(ptr long ptr ptr ptr) -@ stdcall FsRtlLookupPerFileObjectContext(ptr ptr ptr) -@ stdcall FsRtlLookupPerStreamContextInternal(ptr ptr ptr) -@ stdcall FsRtlMdlRead(ptr ptr long long ptr ptr) -@ stdcall FsRtlMdlReadComplete(ptr ptr) -@ stdcall FsRtlMdlReadCompleteDev(ptr ptr ptr) -@ stdcall FsRtlMdlReadDev(ptr ptr long long ptr ptr ptr) -@ stdcall FsRtlMdlWriteComplete(ptr ptr ptr) -@ stdcall FsRtlMdlWriteCompleteDev(ptr ptr ptr ptr) -@ stdcall FsRtlNormalizeNtstatus(long long) -@ stdcall FsRtlNotifyChangeDirectory(ptr ptr ptr ptr long long ptr) -@ stdcall FsRtlNotifyCleanup(ptr ptr ptr) -@ stdcall FsRtlNotifyFilterChangeDirectory(ptr ptr ptr ptr long long long ptr ptr ptr ptr) -@ stdcall FsRtlNotifyFilterReportChange(ptr ptr ptr long ptr ptr long long ptr ptr) -@ stdcall FsRtlNotifyFullChangeDirectory(ptr ptr ptr ptr long long long ptr ptr ptr) -@ stdcall FsRtlNotifyFullReportChange(ptr ptr ptr long ptr ptr long long ptr) -@ stdcall FsRtlNotifyInitializeSync(ptr) -@ stdcall FsRtlNotifyReportChange(ptr ptr ptr ptr long) -@ stdcall FsRtlNotifyUninitializeSync(ptr) -@ stdcall FsRtlNotifyVolumeEvent(ptr long) -;FsRtlNumberOfRunsInBaseMcb -@ stdcall FsRtlNumberOfRunsInLargeMcb(ptr) -@ stdcall FsRtlNumberOfRunsInMcb(ptr) -@ stdcall FsRtlOplockFsctrl(ptr ptr long) -@ stdcall FsRtlOplockIsFastIoPossible(ptr) -@ stdcall FsRtlPostPagingFileStackOverflow(ptr ptr ptr) -@ stdcall FsRtlPostStackOverflow(ptr ptr ptr) -@ stdcall FsRtlPrepareMdlWrite(ptr ptr long long ptr ptr) -@ stdcall FsRtlPrepareMdlWriteDev(ptr ptr long long ptr ptr ptr) -@ stdcall FsRtlPrivateLock(ptr ptr ptr ptr ptr long long long ptr ptr ptr long) -@ stdcall FsRtlProcessFileLock(ptr ptr ptr) -@ stdcall FsRtlRegisterFileSystemFilterCallbacks(ptr ptr) -@ stdcall FsRtlRegisterUncProvider(ptr ptr long) -@ stdcall FsRtlReleaseFile(ptr) -;FsRtlRemoveBaseMcbEntry -@ stdcall FsRtlRemoveLargeMcbEntry(ptr long long long long) -@ stdcall FsRtlRemoveMcbEntry(ptr long long) -@ stdcall FsRtlRemovePerFileObjectContext(ptr ptr ptr) -@ stdcall FsRtlRemovePerStreamContext(ptr ptr ptr) -;FsRtlResetBaseMcb -@ stdcall FsRtlResetLargeMcb(ptr long) -;FsRtlSplitBaseMcb -@ stdcall FsRtlSplitLargeMcb(ptr long long long long) -@ stdcall FsRtlSyncVolumes(long long long) -@ stdcall FsRtlTeardownPerStreamContexts(ptr) -;FsRtlTruncateBaseMcb -@ stdcall FsRtlTruncateLargeMcb(ptr long long) -@ stdcall FsRtlTruncateMcb(ptr long) -;FsRtlUninitializeBaseMcb -@ stdcall FsRtlUninitializeFileLock(ptr) -@ stdcall FsRtlUninitializeLargeMcb(ptr) -@ stdcall FsRtlUninitializeMcb(ptr) -@ stdcall FsRtlUninitializeOplock(ptr) -@ extern HalDispatchTable _HalDispatchTable -@ fastcall HalExamineMBR(ptr long long ptr) -@ extern HalPrivateDispatchTable -;HeadlessDispatch -@ stdcall InbvAcquireDisplayOwnership() -@ stdcall InbvCheckDisplayOwnership() -@ stdcall InbvDisplayString(str) -@ stdcall InbvEnableBootDriver(long) -@ stdcall InbvEnableDisplayString(long) -@ stdcall InbvInstallDisplayStringFilter(ptr) -@ stdcall InbvIsBootDriverInstalled() -@ stdcall InbvNotifyDisplayOwnershipLost(ptr) -@ stdcall InbvResetDisplay() -@ stdcall InbvSetScrollRegion(long long long long) -@ stdcall InbvSetTextColor(long) -@ stdcall InbvSolidColorFill(long long long long long) -@ extern InitSafeBootMode -@ fastcall InterlockedCompareExchange(ptr long long) -@ fastcall InterlockedDecrement(ptr) -@ fastcall InterlockedExchange(ptr long) -@ fastcall InterlockedExchangeAdd(ptr long) -@ fastcall InterlockedIncrement(ptr) -#ifndef __x86_64__ -@ fastcall InterlockedPopEntrySList(ptr) -@ fastcall InterlockedPushEntrySList(ptr ptr) -#endif -@ stdcall IoAcquireCancelSpinLock(ptr) -@ stdcall IoAcquireRemoveLockEx(ptr ptr str long long) -@ stdcall IoAcquireVpbSpinLock(ptr) -@ extern IoAdapterObjectType -@ stdcall IoAllocateAdapterChannel(ptr ptr long ptr ptr) -@ stdcall IoAllocateController(ptr ptr ptr ptr) -@ stdcall IoAllocateDriverObjectExtension(ptr ptr long ptr) -@ stdcall IoAllocateErrorLogEntry(ptr long) -@ stdcall IoAllocateIrp(long long) -@ stdcall IoAllocateMdl(ptr long long long ptr) -@ stdcall IoAllocateWorkItem(ptr) -@ fastcall IoAssignDriveLetters(ptr ptr ptr ptr) -@ stdcall IoAssignResources(ptr ptr ptr ptr ptr ptr) -@ stdcall IoAttachDevice(ptr ptr ptr) -@ stdcall IoAttachDeviceByPointer(ptr ptr) -@ stdcall IoAttachDeviceToDeviceStack(ptr ptr) -@ stdcall IoAttachDeviceToDeviceStackSafe(ptr ptr ptr) -@ stdcall IoBuildAsynchronousFsdRequest(long ptr ptr long ptr ptr) -@ stdcall IoBuildDeviceIoControlRequest(long ptr ptr long ptr long long ptr ptr) -@ stdcall IoBuildPartialMdl(ptr ptr ptr long) -@ stdcall IoBuildSynchronousFsdRequest(long ptr ptr long ptr ptr ptr) -@ stdcall IoCallDriver(ptr ptr) -@ stdcall IoCancelFileOpen(ptr ptr) -@ stdcall IoCancelIrp(ptr) -@ stdcall IoCheckDesiredAccess(ptr long) -@ stdcall IoCheckEaBufferValidity(ptr long ptr) -@ stdcall IoCheckFunctionAccess(long long long long ptr ptr) -@ stdcall IoCheckQuerySetFileInformation(long long long) -@ stdcall IoCheckQuerySetVolumeInformation(long long long) -@ stdcall IoCheckQuotaBufferValidity(ptr long ptr) -@ stdcall IoCheckShareAccess(long long ptr ptr long) -@ stdcall IoCompleteRequest(ptr long) -@ stdcall IoConnectInterrupt(ptr ptr ptr ptr long long long long long long long) -@ stdcall IoCreateController(long) -@ stdcall IoCreateDevice(ptr long ptr long long long ptr) -@ stdcall IoCreateDisk(ptr ptr) -@ stdcall IoCreateDriver(ptr ptr) -@ stdcall IoCreateFile(ptr long ptr ptr ptr long long long long ptr long long ptr long) -@ stdcall IoCreateFileSpecifyDeviceObjectHint(ptr long ptr ptr ptr long long long long ptr long long ptr long ptr) -@ stdcall IoCreateNotificationEvent(ptr ptr) -@ stdcall IoCreateStreamFileObject(ptr ptr) -@ stdcall IoCreateStreamFileObjectEx(ptr ptr ptr) -@ stdcall IoCreateStreamFileObjectLite(ptr ptr) -@ stdcall IoCreateSymbolicLink(ptr ptr) -@ stdcall IoCreateSynchronizationEvent(ptr ptr) -@ stdcall IoCreateUnprotectedSymbolicLink(ptr ptr) -@ stdcall IoCsqInitialize(ptr ptr ptr ptr ptr ptr ptr) -@ stdcall IoCsqInitializeEx(ptr ptr ptr ptr ptr ptr ptr) -@ stdcall IoCsqInsertIrp(ptr ptr ptr) -@ stdcall IoCsqInsertIrpEx(ptr ptr ptr ptr) -@ stdcall IoCsqRemoveIrp(ptr ptr) -@ stdcall IoCsqRemoveNextIrp(ptr ptr) -@ stdcall IoDeleteController(ptr) -@ stdcall IoDeleteDevice(ptr) -@ stdcall IoDeleteDriver(ptr) -@ stdcall IoDeleteSymbolicLink(ptr) -@ stdcall IoDetachDevice(ptr) -@ extern IoDeviceHandlerObjectSize -@ extern IoDeviceHandlerObjectType -@ extern IoDeviceObjectType -@ stdcall IoDisconnectInterrupt(ptr) -@ extern IoDriverObjectType -@ stdcall IoEnqueueIrp(ptr) -@ stdcall IoEnumerateDeviceObjectList(ptr ptr long ptr) -@ stdcall IoEnumerateRegisteredFiltersList(ptr long ptr) -@ stdcall IoFastQueryNetworkAttributes(ptr long long ptr ptr) -@ extern IoFileObjectType _IoFileObjectType -@ stdcall IoForwardAndCatchIrp(ptr ptr) IoForwardIrpSynchronously -@ stdcall IoForwardIrpSynchronously(ptr ptr) -@ stdcall IoFreeController(ptr) -@ stdcall IoFreeErrorLogEntry(ptr) -@ stdcall IoFreeIrp(ptr) -@ stdcall IoFreeMdl(ptr) -@ stdcall IoFreeWorkItem(ptr) -@ stdcall IoGetAttachedDevice(ptr) -@ stdcall IoGetAttachedDeviceReference(ptr) -@ stdcall IoGetBaseFileSystemDeviceObject(ptr) -@ stdcall IoGetBootDiskInformation(ptr long) -@ stdcall IoGetConfigurationInformation() -@ stdcall IoGetCurrentProcess() -@ stdcall IoGetDeviceAttachmentBaseRef(ptr) -@ stdcall IoGetDeviceInterfaceAlias(ptr ptr ptr) -@ stdcall IoGetDeviceInterfaces(ptr ptr long ptr) -@ stdcall IoGetDeviceObjectPointer(ptr long ptr ptr) -@ stdcall IoGetDeviceProperty(ptr long long ptr ptr) -@ stdcall IoGetDeviceToVerify(ptr) -@ stdcall IoGetDiskDeviceObject(ptr ptr) -@ stdcall IoGetDmaAdapter(ptr ptr ptr) -@ stdcall IoGetDriverObjectExtension(ptr ptr) -@ stdcall IoGetFileObjectGenericMapping() -@ stdcall IoGetInitialStack() -@ stdcall IoGetLowerDeviceObject(ptr) -@ fastcall IoGetPagingIoPriority(ptr) -@ stdcall IoGetRelatedDeviceObject(ptr) -@ stdcall IoGetRequestorProcess(ptr) -@ stdcall IoGetRequestorProcessId(ptr) -@ stdcall IoGetRequestorSessionId(ptr ptr) -@ stdcall IoGetStackLimits(ptr ptr) -@ stdcall IoGetTopLevelIrp() -@ stdcall IoInitializeIrp(ptr long long) -@ stdcall IoInitializeRemoveLockEx(ptr long long long long) -@ stdcall IoInitializeTimer(ptr ptr ptr) -@ stdcall IoInvalidateDeviceRelations(ptr long) -@ stdcall IoInvalidateDeviceState(ptr) -@ stdcall IoIsFileOriginRemote(ptr) -@ stdcall IoIsOperationSynchronous(ptr) -@ stdcall IoIsSystemThread(ptr) -@ stdcall IoIsValidNameGraftingBuffer(ptr ptr) -@ stdcall IoIsWdmVersionAvailable(long long) -@ stdcall IoMakeAssociatedIrp(ptr long) -@ stdcall IoOpenDeviceInterfaceRegistryKey(ptr long ptr) -@ stdcall IoOpenDeviceRegistryKey(ptr long long ptr) -@ stdcall IoPageRead(ptr ptr ptr ptr ptr) -@ stdcall IoPnPDeliverServicePowerNotification(long long long long) -@ stdcall IoQueryDeviceDescription(ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall IoQueryFileDosDeviceName(ptr ptr) -@ stdcall IoQueryFileInformation(ptr long long ptr ptr) -@ stdcall IoQueryVolumeInformation(ptr long long ptr ptr) -@ stdcall IoQueueThreadIrp(ptr) -@ stdcall IoQueueWorkItem(ptr ptr long ptr) -@ stdcall IoRaiseHardError(ptr ptr ptr) -@ stdcall IoRaiseInformationalHardError(long ptr ptr) -@ stdcall IoReadDiskSignature(ptr long ptr) -@ extern IoReadOperationCount -@ fastcall IoReadPartitionTable(ptr long long ptr) -@ stdcall IoReadPartitionTableEx(ptr ptr) -@ extern IoReadTransferCount -@ stdcall IoRegisterBootDriverReinitialization(ptr ptr ptr) -@ stdcall IoRegisterDeviceInterface(ptr ptr ptr ptr) -@ stdcall IoRegisterDriverReinitialization(ptr ptr ptr) -@ stdcall IoRegisterFileSystem(ptr) -@ stdcall IoRegisterFsRegistrationChange(ptr ptr) -@ stdcall IoRegisterLastChanceShutdownNotification(ptr) -@ stdcall IoRegisterPlugPlayNotification(long long ptr ptr ptr ptr ptr) -@ stdcall IoRegisterShutdownNotification(ptr) -@ stdcall IoReleaseCancelSpinLock(long) -@ stdcall IoReleaseRemoveLockAndWaitEx(ptr ptr long) -@ stdcall IoReleaseRemoveLockEx(ptr ptr long) -@ stdcall IoReleaseVpbSpinLock(long) -@ stdcall IoRemoveShareAccess(ptr ptr) -@ stdcall IoReportDetectedDevice(ptr long long long ptr ptr long ptr) -@ stdcall IoReportHalResourceUsage(ptr ptr ptr long) -@ stdcall IoReportResourceForDetection(ptr ptr long ptr ptr long ptr) -@ stdcall IoReportResourceUsage(ptr ptr ptr long ptr ptr long long ptr) -@ stdcall IoReportTargetDeviceChange(ptr ptr) -@ stdcall IoReportTargetDeviceChangeAsynchronous(ptr ptr ptr ptr) -@ stdcall IoRequestDeviceEject(ptr) -@ stdcall IoReuseIrp(ptr long) -@ stdcall IoSetCompletionRoutineEx(ptr ptr ptr ptr long long long) -@ stdcall IoSetDeviceInterfaceState(ptr long) -@ stdcall IoSetDeviceToVerify(ptr ptr) -@ stdcall IoSetFileOrigin(ptr long) -@ stdcall IoSetHardErrorOrVerifyDevice(ptr ptr) -@ stdcall IoSetInformation(ptr ptr long ptr) -@ stdcall IoSetIoCompletion(ptr ptr ptr long ptr long) -@ fastcall IoSetPartitionInformation(ptr long long long) -@ stdcall IoSetPartitionInformationEx(ptr long ptr) -@ stdcall IoSetShareAccess(long long ptr ptr) -@ stdcall IoSetStartIoAttributes(ptr long long) -@ stdcall IoSetSystemPartition(ptr) -@ stdcall IoSetThreadHardErrorMode(long) -@ stdcall IoSetTopLevelIrp(ptr) -@ stdcall IoStartNextPacket(ptr long) -@ stdcall IoStartNextPacketByKey(ptr long long) -@ stdcall IoStartPacket(ptr ptr ptr ptr) -@ stdcall IoStartTimer(ptr) -@ extern IoStatisticsLock -@ stdcall IoStopTimer(ptr) -@ stdcall IoSynchronousInvalidateDeviceRelations(ptr long) -@ stdcall IoSynchronousPageWrite(ptr ptr ptr ptr ptr) -@ stdcall IoThreadToProcess(ptr) -;IoTranslateBusAddress -@ stdcall IoUnregisterFileSystem(ptr) -@ stdcall IoUnregisterFsRegistrationChange(ptr ptr) -@ stdcall IoUnregisterPlugPlayNotification(ptr) -@ stdcall IoUnregisterShutdownNotification(ptr) -@ stdcall IoUpdateShareAccess(ptr ptr) -@ stdcall IoValidateDeviceIoControlAccess(ptr long) -@ stdcall IoVerifyPartitionTable(ptr long) -@ stdcall IoVerifyVolume(ptr long) -@ stdcall IoVolumeDeviceToDosName(ptr ptr) -@ stdcall IoWMIAllocateInstanceIds(ptr long ptr) -@ stdcall IoWMIDeviceObjectToInstanceName(ptr ptr ptr) -@ stdcall IoWMIExecuteMethod(ptr ptr long long ptr ptr) -@ stdcall IoWMIHandleToInstanceName(ptr ptr ptr) -@ stdcall IoWMIOpenBlock(ptr long ptr) -@ stdcall IoWMIQueryAllData(ptr ptr ptr) -@ stdcall IoWMIQueryAllDataMultiple(ptr long ptr ptr) -@ stdcall IoWMIQuerySingleInstance(ptr ptr ptr ptr) -@ stdcall IoWMIQuerySingleInstanceMultiple(ptr ptr long ptr ptr) -@ stdcall IoWMIRegistrationControl(ptr long) -@ stdcall IoWMISetNotificationCallback(ptr ptr ptr) -@ stdcall IoWMISetSingleInstance(ptr ptr long long ptr) -@ stdcall IoWMISetSingleItem(ptr ptr long long long ptr) -@ stdcall IoWMISuggestInstanceName(ptr ptr long ptr) -@ stdcall IoWMIWriteEvent(ptr) -@ stdcall IoWriteErrorLogEntry(ptr) -@ extern IoWriteOperationCount -@ fastcall IoWritePartitionTable(ptr long long long ptr) -@ stdcall IoWritePartitionTableEx(ptr ptr) -@ extern IoWriteTransferCount -@ fastcall IofCallDriver(ptr ptr) -@ fastcall IofCompleteRequest(ptr long) -@ stdcall KdChangeOption(long long ptr long ptr ptr) -@ extern KdDebuggerEnabled _KdDebuggerEnabled -@ extern KdDebuggerNotPresent _KdDebuggerNotPresent -@ stdcall KdDisableDebugger() -@ stdcall KdEnableDebugger() -@ extern KdEnteredDebugger -@ stdcall KdPollBreakIn() -@ stdcall KdPowerTransition(long) -@ stdcall KdRefreshDebuggerNotPresent() -@ stdcall KdSystemDebugControl(long ptr long ptr long ptr long) -#ifdef _M_IX86 -@ stdcall Ke386CallBios(long ptr) -;Ke386IoSetAccessProcess -;Ke386QueryIoAccessMap -;Ke386SetIoAccessMap -#endif -@ fastcall KeAcquireGuardedMutex(ptr) -@ fastcall KeAcquireGuardedMutexUnsafe(ptr) -@ fastcall KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr) -@ fastcall KeAcquireInStackQueuedSpinLockForDpc(ptr ptr) -@ stdcall KeAcquireInterruptSpinLock(ptr) -@ stdcall KeAcquireSpinLockAtDpcLevel(ptr) -@ fastcall KeAcquireSpinLockForDpc(ptr) -#ifdef __x86_64__ -@ stdcall KeAcquireSpinLockRaiseToDpc(ptr) -#endif -@ stdcall KeAddSystemServiceTable(ptr ptr long ptr long) -@ stdcall KeAreAllApcsDisabled() -@ stdcall KeAreApcsDisabled() -@ stdcall KeAttachProcess(ptr) -@ stdcall KeBugCheck(long) -@ stdcall KeBugCheckEx(long ptr ptr ptr ptr) -@ stdcall KeCancelTimer(ptr) -@ stdcall KeCapturePersistentThreadState(ptr long long long long long ptr) -@ stdcall KeClearEvent(ptr) -@ stdcall KeConnectInterrupt(ptr) -@ stdcall KeDelayExecutionThread(long long ptr) -@ stdcall KeDeregisterBugCheckCallback(ptr) -@ stdcall KeDeregisterBugCheckReasonCallback(ptr) -@ stdcall KeDeregisterNmiCallback(ptr) -@ stdcall KeDetachProcess() -@ stdcall KeDisconnectInterrupt(ptr) -@ stdcall KeEnterCriticalRegion() _KeEnterCriticalRegion -@ stdcall KeEnterGuardedRegion() _KeEnterGuardedRegion -@ stdcall KeEnterKernelDebugger() -@ stdcall KeFindConfigurationEntry(ptr long long ptr) -@ stdcall KeFindConfigurationNextEntry(ptr long long ptr ptr) -@ stdcall KeFlushEntireTb(long long) -@ stdcall KeFlushQueuedDpcs() -;KeGenericCallDpc -@ stdcall KeGetCurrentThread() -@ stdcall KeGetPreviousMode() -@ stdcall KeGetRecommendedSharedDataAlignment() -#ifdef _M_IX86 -;KeI386AbiosCall -@ stdcall KeI386AllocateGdtSelectors(ptr long) -;KeI386Call16BitCStyleFunction -;KeI386Call16BitFunction -@ stdcall KeI386FlatToGdtSelector(long long long) -;KeI386GetLid -@ extern KeI386MachineType -@ stdcall KeI386ReleaseGdtSelectors(ptr long) -;KeI386ReleaseLid -;KeI386SetGdtSelector -#endif -@ stdcall KeInitializeApc(ptr ptr long ptr ptr ptr long ptr) -@ stdcall KeInitializeCrashDumpHeader(long long ptr long ptr) -@ stdcall KeInitializeDeviceQueue(ptr) -@ stdcall KeInitializeDpc(ptr ptr ptr) -@ stdcall KeInitializeEvent(ptr long long) -@ fastcall KeInitializeGuardedMutex(ptr) -@ stdcall KeInitializeInterrupt(ptr ptr ptr ptr long long long long long long long) -@ stdcall KeInitializeMutant(ptr long) -@ stdcall KeInitializeMutex(ptr long) -@ stdcall KeInitializeQueue(ptr long) -@ stdcall KeInitializeSemaphore(ptr long long) -#ifndef __x86_64__ -@ stdcall KeInitializeSpinLock(ptr) -#endif -@ stdcall KeInitializeThreadedDpc(ptr ptr ptr) -@ stdcall KeInitializeTimer(ptr) -@ stdcall KeInitializeTimerEx(ptr long) -@ stdcall KeInsertByKeyDeviceQueue(ptr ptr long) -@ stdcall KeInsertDeviceQueue(ptr ptr) -@ stdcall KeInsertHeadQueue(ptr ptr) -@ stdcall KeInsertQueue(ptr ptr) -@ stdcall KeInsertQueueApc(ptr ptr ptr long) -@ stdcall KeInsertQueueDpc(ptr ptr ptr) -@ stdcall KeInvalidateAllCaches() -@ stdcall KeIpiGenericCall(ptr ptr) -@ stdcall KeIsAttachedProcess() -@ stdcall KeIsExecutingDpc() -;KeIsWaitListEmpty -@ stdcall KeLeaveCriticalRegion() _KeLeaveCriticalRegion -@ stdcall KeLeaveGuardedRegion() _KeLeaveGuardedRegion -@ extern KeLoaderBlock -@ extern KeNumberProcessors -@ stdcall KeProfileInterrupt(ptr) -@ stdcall KeProfileInterruptWithSource(ptr long) -@ stdcall KePulseEvent(ptr long long) -@ stdcall KeQueryActiveProcessors() -#ifndef __x86_64__ -@ stdcall KeQueryInterruptTime() -#endif -@ stdcall KeQueryPriorityThread(ptr) -@ stdcall KeQueryRuntimeThread(ptr ptr) -#ifndef __x86_64__ -@ stdcall KeQuerySystemTime(ptr) -#endif -@ stdcall KeQueryTickCount(ptr) -@ stdcall KeQueryTimeIncrement() -@ stdcall KeRaiseUserException(long) -@ stdcall KeReadStateEvent(ptr) -@ stdcall KeReadStateMutant(ptr) -@ stdcall KeReadStateMutex(ptr) KeReadStateMutant -@ stdcall KeReadStateQueue(ptr) -@ stdcall KeReadStateSemaphore(ptr) -@ stdcall KeReadStateTimer(ptr) -@ stdcall KeRegisterBugCheckCallback(ptr ptr ptr long ptr) -@ stdcall KeRegisterBugCheckReasonCallback(ptr ptr ptr ptr) -@ stdcall KeRegisterNmiCallback(ptr ptr) -@ fastcall KeReleaseGuardedMutex(ptr) -@ fastcall KeReleaseGuardedMutexUnsafe(ptr) -@ fastcall KeReleaseInStackQueuedSpinLockForDpc(ptr) -@ fastcall KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr) -@ stdcall KeReleaseInterruptSpinLock(ptr long) -@ stdcall KeReleaseMutant(ptr long long long) -@ stdcall KeReleaseMutex(ptr long) -@ stdcall KeReleaseSemaphore(ptr long long long) -#ifdef __x86_64__ -@ stdcall KeReleaseSpinLock(ptr long) -#endif -@ fastcall KeReleaseSpinLockForDpc(ptr long) -@ stdcall KeReleaseSpinLockFromDpcLevel(ptr) -@ stdcall KeRemoveByKeyDeviceQueue(ptr long) -@ stdcall KeRemoveByKeyDeviceQueueIfBusy(ptr long) -@ stdcall KeRemoveDeviceQueue(ptr) -@ stdcall KeRemoveEntryDeviceQueue(ptr ptr) -@ stdcall KeRemoveQueue(ptr long ptr) -@ stdcall KeRemoveQueueDpc(ptr) -@ stdcall KeRemoveSystemServiceTable(long) -@ stdcall KeResetEvent(ptr) -@ stdcall KeRestoreFloatingPointState(ptr) -@ stdcall KeRevertToUserAffinityThread() -@ stdcall KeRundownQueue(ptr) -@ stdcall KeSaveFloatingPointState(ptr) -@ cdecl KeSaveStateForHibernate(ptr) -@ extern KeServiceDescriptorTable -@ stdcall KeSetAffinityThread(ptr long) -@ stdcall KeSetBasePriorityThread(ptr long) -@ stdcall KeSetDmaIoCoherency(long) -@ stdcall KeSetEvent(ptr long long) -@ stdcall KeSetEventBoostPriority(ptr ptr) -@ stdcall KeSetIdealProcessorThread(ptr long) -@ stdcall KeSetImportanceDpc(ptr long) -@ stdcall KeSetKernelStackSwapEnable(long) -@ stdcall KeSetPriorityThread(ptr long) -@ stdcall KeSetProfileIrql(long) -@ stdcall KeSetSystemAffinityThread(long) -@ stdcall KeSetTargetProcessorDpc(ptr long) -@ stdcall KeSetTimeIncrement(long long) -@ stdcall KeSetTimer(ptr long long ptr) -@ stdcall KeSetTimerEx(ptr long long long ptr) -;KeSignalCallDpcDone -;KeSignalCallDpcSynchronize -@ stdcall KeStackAttachProcess(ptr ptr) -@ stdcall KeSynchronizeExecution(ptr ptr ptr) -@ stdcall KeTerminateThread(long) -@ fastcall KeTestSpinLock(ptr) -@ extern KeTickCount -@ fastcall KeTryToAcquireGuardedMutex(ptr) -@ fastcall KeTryToAcquireSpinLockAtDpcLevel(ptr) -@ stdcall KeUnstackDetachProcess(ptr) -@ stdcall KeUpdateRunTime(ptr long) -#ifdef _M_IX86 -@ stdcall KeUpdateSystemTime() -#else -@ stdcall KeUpdateSystemTime(ptr long long) -#endif -@ stdcall KeUserModeCallback(long ptr long ptr ptr) -@ stdcall KeWaitForMultipleObjects(long ptr long long long long ptr ptr) -@ stdcall KeWaitForMutexObject(ptr long long long ptr) KeWaitForSingleObject -@ stdcall KeWaitForSingleObject(ptr long long long ptr) -@ fastcall KefAcquireSpinLockAtDpcLevel(ptr) -@ fastcall KefReleaseSpinLockFromDpcLevel(ptr) -#ifdef _M_IX86 -@ stdcall Kei386EoiHelper() -#endif -@ fastcall KiAcquireSpinLock(ptr) -@ extern KiBugCheckData -@ stdcall KiCheckForKernelApcDelivery() -#ifdef _M_IX86 -@ stdcall KiCoprocessorError() -#endif -@ stdcall KiDeliverApc(long ptr ptr) -#ifdef _M_IX86 -@ stdcall KiDispatchInterrupt() -#endif -@ extern KiEnableTimerWatchdog -@ stdcall KiIpiServiceRoutine(ptr ptr) -@ fastcall KiReleaseSpinLock(ptr) -@ cdecl KiUnexpectedInterrupt() -#ifdef _M_IX86 -;Kii386SpinOnSpinLock -#endif -@ stdcall LdrAccessResource(ptr ptr ptr ptr) -@ stdcall LdrEnumResources(ptr ptr long ptr ptr) -@ stdcall LdrFindResourceDirectory_U(ptr ptr long ptr) -@ stdcall LdrFindResource_U(ptr ptr long ptr) -@ extern LpcPortObjectType -@ stdcall LpcRequestPort(ptr ptr) -@ stdcall LpcRequestWaitReplyPort(ptr ptr ptr) -@ stdcall LsaCallAuthenticationPackage(long long long long long long long) -@ stdcall LsaDeregisterLogonProcess(long long) -@ stdcall LsaFreeReturnBuffer(ptr) -@ stdcall LsaLogonUser(ptr ptr long long ptr long ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall LsaLookupAuthenticationPackage(long long long) -@ stdcall LsaRegisterLogonProcess(ptr ptr ptr) -@ extern Mm64BitPhysicalAddress -@ stdcall MmAddPhysicalMemory(ptr ptr) -@ stdcall MmAddVerifierThunks(ptr long) -@ stdcall MmAdjustWorkingSetSize(long long long long) -@ stdcall MmAdvanceMdl(ptr long) -@ stdcall MmAllocateContiguousMemory(long long long) -@ stdcall MmAllocateContiguousMemorySpecifyCache(long long long long long long long long) -@ stdcall MmAllocateMappingAddress(long long) -@ stdcall MmAllocateNonCachedMemory(long) -@ stdcall MmAllocatePagesForMdl(ptr ptr ptr ptr ptr ptr ptr) -@ stdcall MmAllocatePagesForMdlEx(long long long long long long long long long) -@ stdcall MmBuildMdlForNonPagedPool(ptr) -@ stdcall MmCanFileBeTruncated(ptr ptr) -;MmCommitSessionMappedView -@ stdcall MmCreateMdl(ptr ptr long) -;MmCreateMirror -@ stdcall MmCreateSection(ptr long ptr ptr long long ptr ptr) -@ stdcall MmDisableModifiedWriteOfSection(long) -@ stdcall MmFlushImageSection(ptr long) -@ stdcall MmForceSectionClosed(ptr long) -@ stdcall MmFreeContiguousMemory(ptr) -@ stdcall MmFreeContiguousMemorySpecifyCache(ptr long long) -@ stdcall MmFreeMappingAddress(ptr long) -@ stdcall MmFreeNonCachedMemory(ptr long) -@ stdcall MmFreePagesFromMdl(ptr) -@ stdcall MmGetPhysicalAddress(ptr) -@ stdcall MmGetPhysicalMemoryRanges() -@ stdcall MmGetSystemRoutineAddress(ptr) -@ stdcall MmGetVirtualForPhysical(long long) -@ stdcall MmGrowKernelStack(ptr) -@ extern MmHighestUserAddress -@ stdcall MmIsAddressValid(ptr) -@ stdcall MmIsDriverVerifying(ptr) -;MmIsIoSpaceActive -@ stdcall MmIsNonPagedSystemAddressValid(ptr) -@ stdcall MmIsRecursiveIoFault() -@ stdcall MmIsThisAnNtAsSystem() -@ stdcall MmIsVerifierEnabled(ptr) -@ stdcall MmLockPagableDataSection(ptr) -@ stdcall MmLockPagableImageSection(ptr) MmLockPagableDataSection -@ stdcall MmLockPagableSectionByHandle(ptr) -@ stdcall MmMapIoSpace(long long long long) -@ stdcall MmMapLockedPages(ptr long) -@ stdcall MmMapLockedPagesSpecifyCache(ptr long long ptr long long) -@ stdcall MmMapLockedPagesWithReservedMapping(ptr long ptr long) -@ stdcall MmMapMemoryDumpMdl(ptr) -@ stdcall MmMapUserAddressesToPage(ptr long ptr) -@ stdcall MmMapVideoDisplay(long long long long) -@ stdcall MmMapViewInSessionSpace(ptr ptr ptr) -@ stdcall MmMapViewInSystemSpace(ptr ptr ptr) -@ stdcall MmMapViewOfSection(ptr ptr ptr long long ptr ptr long long long) -@ stdcall MmMarkPhysicalMemoryAsBad(ptr ptr) -@ stdcall MmMarkPhysicalMemoryAsGood(ptr ptr) -@ stdcall MmPageEntireDriver(ptr) -@ stdcall MmPrefetchPages(long ptr) -@ stdcall MmProbeAndLockPages(ptr long long) -@ stdcall MmProbeAndLockProcessPages(ptr ptr long long) -@ stdcall MmProbeAndLockSelectedPages(ptr ptr long long) -@ stdcall MmProtectMdlSystemAddress(ptr long) -@ stdcall MmQuerySystemSize() -@ stdcall MmRemovePhysicalMemory(ptr ptr) -@ stdcall MmResetDriverPaging(ptr) -@ extern MmSectionObjectType -@ stdcall MmSecureVirtualMemory(ptr long long) -@ stdcall MmSetAddressRangeModified(ptr long) -@ stdcall MmSetBankedSection(long long long long long long) -@ stdcall MmSizeOfMdl(ptr long) -@ extern MmSystemRangeStart -@ stdcall MmTrimAllSystemPagableMemory(long) -@ stdcall MmUnlockPagableImageSection(ptr) -@ stdcall MmUnlockPages(ptr) -@ stdcall MmUnmapIoSpace(ptr long) -@ stdcall MmUnmapLockedPages(ptr ptr) -@ stdcall MmUnmapReservedMapping(ptr long ptr) -@ stdcall MmUnmapVideoDisplay(ptr long) -@ stdcall MmUnmapViewInSessionSpace(ptr) -@ stdcall MmUnmapViewInSystemSpace(ptr) -@ stdcall MmUnmapViewOfSection(ptr ptr) -@ stdcall MmUnsecureVirtualMemory(ptr) -@ extern MmUserProbeAddress -@ extern NlsAnsiCodePage -@ extern NlsLeadByteInfo -@ extern NlsMbCodePageTag -@ extern NlsMbOemCodePageTag -@ extern NlsOemCodePage -@ extern NlsOemLeadByteInfo _NlsOemLeadByteInfo -@ stdcall NtAddAtom(wstr long ptr) -@ stdcall NtAdjustPrivilegesToken(ptr long ptr long ptr ptr) -@ stdcall NtAlertThread(ptr) -@ stdcall NtAllocateLocallyUniqueId(ptr) -@ stdcall NtAllocateUuids(ptr ptr ptr ptr) -@ stdcall NtAllocateVirtualMemory(ptr ptr long ptr long long) -@ extern NtBuildNumber -@ stdcall NtClose(ptr) -@ stdcall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall NtCreateEvent(ptr long ptr long long) -@ stdcall NtCreateFile(ptr long ptr ptr ptr long long long long ptr long) -@ stdcall NtCreateSection(ptr long ptr ptr long long ptr) -@ stdcall NtCreateTimer(ptr long ptr long) -@ stdcall NtDeleteAtom(ptr) -@ stdcall NtDeleteFile(ptr) -@ stdcall NtDeviceIoControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) -@ stdcall NtDuplicateObject(ptr ptr ptr ptr long long long) -@ stdcall NtDuplicateToken(ptr long ptr long long ptr) -@ stdcall NtFindAtom(wstr long ptr) -@ stdcall NtFreeVirtualMemory(ptr ptr ptr long) -@ stdcall NtFsControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) -@ extern NtGlobalFlag -@ stdcall NtLockFile(ptr ptr ptr ptr ptr ptr ptr long long long) -@ stdcall NtMakePermanentObject(ptr) -@ stdcall NtMapViewOfSection(ptr ptr ptr long long ptr ptr long long long) -@ stdcall NtNotifyChangeDirectoryFile(ptr ptr ptr ptr ptr ptr long long long) -@ stdcall NtOpenEvent(ptr long ptr) -@ stdcall NtOpenFile(ptr long ptr ptr long long) -@ stdcall NtOpenProcess(ptr long ptr ptr) -@ stdcall NtOpenProcessToken(ptr long ptr) -@ stdcall NtOpenProcessTokenEx(ptr long long ptr) -@ stdcall NtOpenThread(ptr long ptr ptr) -@ stdcall NtOpenThreadToken(ptr long long ptr) -@ stdcall NtOpenThreadTokenEx(ptr long long long ptr) -@ stdcall NtQueryDirectoryFile(ptr ptr ptr ptr ptr ptr long long long ptr long) -@ stdcall NtQueryEaFile(ptr ptr ptr long long ptr long ptr long) -@ stdcall NtQueryInformationAtom(ptr long ptr long ptr) -@ stdcall NtQueryInformationFile(ptr ptr ptr long long) -@ stdcall NtQueryInformationProcess(ptr ptr ptr long ptr) -@ stdcall NtQueryInformationThread(ptr long ptr long ptr) -@ stdcall NtQueryInformationToken(ptr long ptr long ptr) -@ stdcall NtQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) -@ stdcall NtQuerySecurityObject(ptr long ptr long ptr) -@ stdcall NtQuerySystemInformation(long ptr long ptr) -@ stdcall NtQueryVolumeInformationFile(ptr ptr ptr long long) -@ stdcall NtReadFile(ptr ptr ptr ptr ptr ptr long ptr ptr) -@ stdcall NtRequestPort(ptr ptr) -@ stdcall NtRequestWaitReplyPort(ptr ptr ptr) -@ stdcall NtSetEaFile(ptr ptr ptr long) -@ stdcall NtSetEvent(ptr ptr) -@ stdcall NtSetInformationFile(ptr ptr ptr long long) -@ stdcall NtSetInformationProcess(ptr ptr ptr long) -@ stdcall NtSetInformationThread(ptr long ptr long) -@ stdcall NtSetQuotaInformationFile(ptr ptr ptr long) -@ stdcall NtSetSecurityObject(ptr long ptr) -@ stdcall NtSetVolumeInformationFile(ptr ptr ptr long long) -@ stdcall NtShutdownSystem(long) -@ stdcall NtTraceEvent(long long long ptr) -@ stdcall NtUnlockFile(ptr ptr ptr ptr long) -@ stdcall NtVdmControl(long ptr) -@ stdcall NtWaitForSingleObject(ptr long ptr) -@ stdcall NtWriteFile(ptr ptr ptr ptr ptr ptr long ptr ptr) -@ stdcall ObAssignSecurity(ptr ptr ptr ptr) -@ stdcall ObCheckCreateObjectAccess(ptr long ptr ptr long long ptr) -@ stdcall ObCheckObjectAccess(ptr ptr long long ptr) -@ stdcall ObCloseHandle(ptr long) -@ stdcall ObCreateObject(long ptr ptr long ptr long long long ptr) -@ stdcall ObCreateObjectType(ptr ptr ptr ptr) -;ObDeleteCapturedInsertInfo -@ stdcall ObDereferenceObject(ptr) -@ stdcall ObDereferenceObjectDeferDelete(ptr) -@ stdcall ObDereferenceSecurityDescriptor(ptr long) -@ stdcall ObFindHandleForObject(ptr ptr ptr ptr ptr) -@ stdcall ObGetObjectSecurity(ptr ptr ptr) -@ stdcall ObInsertObject(ptr ptr long long ptr ptr) -@ stdcall ObIsKernelHandle(ptr) -@ stdcall ObLogSecurityDescriptor(ptr ptr long) -@ stdcall ObMakeTemporaryObject(ptr) -@ stdcall ObOpenObjectByName(ptr ptr long ptr long ptr ptr) -@ stdcall ObOpenObjectByPointer(ptr long ptr long ptr long ptr) -@ stdcall ObQueryNameString(ptr ptr long ptr) -@ stdcall ObQueryObjectAuditingByHandle(ptr ptr) -@ stdcall ObReferenceObjectByHandle(ptr long ptr long ptr ptr) -@ stdcall ObReferenceObjectByName(ptr long ptr long ptr long ptr ptr) -@ stdcall ObReferenceObjectByPointer(ptr long ptr long) -@ stdcall ObReferenceSecurityDescriptor(ptr long) -@ stdcall ObReleaseObjectSecurity(ptr long) -;ObSetHandleAttributes@12 -@ stdcall ObSetSecurityDescriptorInfo(ptr ptr ptr ptr long ptr) -@ stdcall ObSetSecurityObjectByPointer(ptr long ptr) -@ fastcall ObfDereferenceObject(ptr) -@ fastcall ObfReferenceObject(ptr) -;PfxFindPrefix -;PfxInitialize -;PfxInsertPrefix -;PfxRemovePrefix -@ stdcall PoCallDriver(ptr ptr) -;PoCancelDeviceNotify -@ stdcall PoQueueShutdownWorkItem(ptr) -@ stdcall PoRegisterDeviceForIdleDetection(ptr long long long) -;PoRegisterDeviceNotify -@ stdcall PoRegisterSystemState(ptr long) -@ stdcall PoRequestPowerIrp(ptr long long ptr ptr ptr) -;PoRequestShutdownEvent -;PoSetHiberRange -@ stdcall PoSetPowerState(ptr long long) -@ stdcall PoSetSystemState(long) -;PoShutdownBugCheck -@ stdcall PoStartNextPowerIrp(ptr) -@ stdcall PoUnregisterSystemState(ptr) -@ stdcall ProbeForRead(ptr long long) -@ stdcall ProbeForWrite(ptr long long) -@ stdcall PsAssignImpersonationToken(ptr ptr) -@ stdcall PsChargePoolQuota(ptr long long) -@ stdcall PsChargeProcessNonPagedPoolQuota(ptr long) -@ stdcall PsChargeProcessPagedPoolQuota(ptr long) -@ stdcall PsChargeProcessPoolQuota(ptr long long) -@ stdcall PsCreateSystemProcess(ptr long ptr) -@ stdcall PsCreateSystemThread(ptr long ptr ptr ptr ptr ptr) -@ stdcall PsDereferenceImpersonationToken(ptr) PsDereferencePrimaryToken -@ stdcall PsDereferencePrimaryToken(ptr) -@ stdcall PsDisableImpersonation(ptr ptr) -@ stdcall PsEstablishWin32Callouts(ptr) -@ stdcall PsGetContextThread(ptr ptr long) -@ stdcall PsGetCurrentProcess() IoGetCurrentProcess -@ stdcall PsGetCurrentProcessId() -@ stdcall PsGetCurrentProcessSessionId() -@ stdcall PsGetCurrentProcessWin32Process() -@ stdcall PsGetCurrentThread() KeGetCurrentThread -@ stdcall PsGetCurrentThreadId() -@ stdcall PsGetCurrentThreadPreviousMode() -;PsGetCurrentThreadProcess -;PsGetCurrentThreadProcessId -@ stdcall PsGetCurrentThreadStackBase() -@ stdcall PsGetCurrentThreadStackLimit() -;PsGetCurrentThreadTeb -@ stdcall PsGetCurrentThreadWin32Thread() -;PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion -@ stdcall PsGetJobLock(ptr) -@ stdcall PsGetJobSessionId(ptr) -@ stdcall PsGetJobUIRestrictionsClass(ptr) -@ stdcall PsGetProcessCreateTimeQuadPart(ptr) -@ stdcall PsGetProcessDebugPort(ptr) -@ stdcall PsGetProcessExitProcessCalled(ptr) -@ stdcall PsGetProcessExitStatus(ptr) -@ stdcall PsGetProcessExitTime() -@ stdcall PsGetProcessId(ptr) -@ stdcall PsGetProcessImageFileName(ptr) -@ stdcall PsGetProcessInheritedFromUniqueProcessId(ptr) -@ stdcall PsGetProcessJob(ptr) -@ stdcall PsGetProcessPeb(ptr) -@ stdcall PsGetProcessPriorityClass(ptr) -@ stdcall PsGetProcessSectionBaseAddress(ptr) -@ stdcall PsGetProcessSecurityPort(ptr) -@ stdcall PsGetProcessSessionId(ptr) -;PsGetProcessSessionIdEx -@ stdcall PsGetProcessWin32Process(ptr) -@ stdcall PsGetProcessWin32WindowStation(ptr) -@ stdcall PsGetThreadFreezeCount(ptr) -@ stdcall PsGetThreadHardErrorsAreDisabled(ptr) -@ stdcall PsGetThreadId(ptr) -@ stdcall PsGetThreadProcess(ptr) -@ stdcall PsGetThreadProcessId(ptr) -@ stdcall PsGetThreadSessionId(ptr) -@ stdcall PsGetThreadTeb(ptr) -@ stdcall PsGetThreadWin32Thread(ptr) -@ stdcall PsGetVersion(ptr ptr ptr ptr) -@ stdcall PsImpersonateClient(ptr ptr long long long) -@ extern PsInitialSystemProcess -@ stdcall PsIsProcessBeingDebugged(ptr) -@ stdcall PsIsSystemProcess(ptr) -@ stdcall PsIsSystemThread(ptr) -@ stdcall PsIsThreadImpersonating(ptr) -@ stdcall PsIsThreadTerminating(ptr) -@ extern PsJobType -@ stdcall PsLookupProcessByProcessId(ptr ptr) -@ stdcall PsLookupProcessThreadByCid(ptr ptr ptr) -@ stdcall PsLookupThreadByThreadId(ptr ptr) -@ extern PsProcessType _PsProcessType -@ stdcall PsReferenceImpersonationToken(ptr ptr ptr ptr) -@ stdcall PsReferencePrimaryToken(ptr) -@ stdcall PsRemoveCreateThreadNotifyRoutine(ptr) -@ stdcall PsRemoveLoadImageNotifyRoutine(ptr) -@ stdcall PsRestoreImpersonation(ptr ptr) -@ stdcall PsReturnPoolQuota(ptr long long) -@ stdcall PsReturnProcessNonPagedPoolQuota(ptr long) -@ stdcall PsReturnProcessPagedPoolQuota(ptr long) -@ stdcall PsRevertThreadToSelf(ptr) -@ stdcall PsRevertToSelf() -@ stdcall PsSetContextThread(ptr ptr long) -@ stdcall PsSetCreateProcessNotifyRoutine(ptr long) -@ stdcall PsSetCreateThreadNotifyRoutine(ptr) -@ stdcall PsSetJobUIRestrictionsClass(ptr long) -@ stdcall PsSetLegoNotifyRoutine(ptr) -@ stdcall PsSetLoadImageNotifyRoutine(ptr) -@ stdcall PsSetProcessPriorityByClass(ptr ptr) -@ stdcall PsSetProcessPriorityClass(ptr long) -@ stdcall PsSetProcessSecurityPort(ptr ptr) -@ stdcall PsSetProcessWin32Process(ptr ptr) -@ stdcall PsSetProcessWindowStation(ptr ptr) -@ stdcall PsSetThreadHardErrorsAreDisabled(ptr long) -@ stdcall PsSetThreadWin32Thread(ptr ptr) -@ stdcall PsTerminateSystemThread(long) -@ extern PsThreadType _PsThreadType -;PsWrapApcWow64Thread -#ifndef __x86_64__ -@ stdcall READ_REGISTER_BUFFER_UCHAR(ptr ptr long) -@ stdcall READ_REGISTER_BUFFER_ULONG(ptr ptr long) -@ stdcall READ_REGISTER_BUFFER_USHORT(ptr ptr long) -@ stdcall READ_REGISTER_UCHAR(ptr) -@ stdcall READ_REGISTER_ULONG(ptr) -@ stdcall READ_REGISTER_USHORT(ptr) -#endif -@ stdcall KeRosDumpStackFrames(ptr long) -@ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr) -@ stdcall RtlAddAccessAllowedAce(ptr long long ptr) -@ stdcall RtlAddAccessAllowedAceEx(ptr long long long ptr) -@ stdcall RtlAddAce(ptr long long ptr long) -@ stdcall RtlAddAtomToAtomTable(ptr wstr ptr) -@ stdcall RtlAddRange(ptr long long long long long long ptr ptr) -@ stdcall RtlAllocateAndInitializeSid(ptr long long long long long long long long long ptr) -@ stdcall RtlAllocateHeap(ptr long long) -@ stdcall RtlAnsiCharToUnicodeChar(ptr) -@ stdcall RtlAnsiStringToUnicodeSize(ptr) RtlxAnsiStringToUnicodeSize -@ stdcall RtlAnsiStringToUnicodeString(ptr ptr long) -@ stdcall RtlAppendAsciizToString(ptr str) -@ stdcall RtlAppendStringToString(ptr ptr) -@ stdcall RtlAppendUnicodeStringToString(ptr ptr) -@ stdcall RtlAppendUnicodeToString(ptr wstr) -@ stdcall RtlAreAllAccessesGranted(long long) -@ stdcall RtlAreAnyAccessesGranted(long long) -@ stdcall RtlAreBitsClear(ptr long long) -@ stdcall RtlAreBitsSet(ptr long long) -@ stdcall RtlAssert(str str long str) -@ stdcall RtlCaptureContext(ptr) -@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) -@ stdcall RtlCharToInteger(str long ptr) -@ stdcall RtlCheckRegistryKey(long wstr) -@ stdcall RtlClearAllBits(ptr) -@ stdcall RtlClearBit(ptr long) -@ stdcall RtlClearBits(ptr long long) -@ stdcall RtlCompareMemory(ptr ptr long) -@ stdcall RtlCompareMemoryUlong(ptr long long) -@ stdcall RtlCompareString(ptr ptr long) -@ stdcall RtlCompareUnicodeString(ptr ptr long) -@ stdcall RtlCompressBuffer(long ptr long ptr long long ptr ptr) -@ stdcall RtlCompressChunks(ptr long ptr long ptr long ptr) -@ stdcall RtlConvertLongToLargeInteger(long) -@ stdcall RtlConvertSidToUnicodeString(ptr ptr long) -@ stdcall RtlConvertUlongToLargeInteger(long) -@ stdcall RtlCopyLuid(ptr ptr) -@ stdcall RtlCopyRangeList(ptr ptr) -@ stdcall RtlCopySid(long ptr ptr) -@ stdcall RtlCopyString(ptr ptr) -@ stdcall RtlCopyUnicodeString(ptr ptr) -@ stdcall RtlCreateAcl(ptr long long) -@ stdcall RtlCreateAtomTable(long ptr) -@ stdcall RtlCreateHeap(long ptr long long ptr ptr) -@ stdcall RtlCreateRegistryKey(long wstr) -@ stdcall RtlCreateSecurityDescriptor(ptr long) -@ stdcall RtlCreateSystemVolumeInformationFolder(ptr) -@ stdcall RtlCreateUnicodeString(ptr wstr) -@ stdcall RtlCustomCPToUnicodeN(ptr wstr long ptr ptr long) -@ stdcall RtlDecompressBuffer(long ptr long ptr long ptr) -@ stdcall RtlDecompressChunks(ptr long ptr long ptr long ptr) -@ stdcall RtlDecompressFragment(long ptr long ptr long long ptr ptr) -@ stdcall RtlDelete(ptr) -@ stdcall RtlDeleteAce(ptr long) -@ stdcall RtlDeleteAtomFromAtomTable(ptr ptr) -@ stdcall RtlDeleteElementGenericTable(ptr ptr) -@ stdcall RtlDeleteElementGenericTableAvl(ptr ptr) -@ stdcall RtlDeleteNoSplay(ptr ptr) -@ stdcall RtlDeleteOwnersRanges(ptr ptr) -@ stdcall RtlDeleteRange(ptr long long long long ptr) -@ stdcall RtlDeleteRegistryValue(long wstr wstr) -@ stdcall RtlDescribeChunk(long ptr ptr ptr ptr) -@ stdcall RtlDestroyAtomTable(ptr) -@ stdcall RtlDestroyHeap(ptr) -@ stdcall RtlDowncaseUnicodeString(ptr ptr long) -@ stdcall RtlEmptyAtomTable(ptr long) -@ stdcall RtlEnlargedIntegerMultiply(long long) -@ stdcall RtlEnlargedUnsignedDivide(long long long ptr) -@ stdcall RtlEnlargedUnsignedMultiply(long long) -@ stdcall RtlEnumerateGenericTable(ptr long) -@ stdcall RtlEnumerateGenericTableAvl(ptr long) -@ stdcall RtlEnumerateGenericTableLikeADirectory(ptr ptr ptr long ptr ptr ptr) -@ stdcall RtlEnumerateGenericTableWithoutSplaying(ptr ptr) -@ stdcall RtlEnumerateGenericTableWithoutSplayingAvl(ptr ptr) -@ stdcall RtlEqualLuid(ptr ptr) -@ stdcall RtlEqualSid(ptr ptr) -@ stdcall RtlEqualString(ptr ptr long) -@ stdcall RtlEqualUnicodeString(ptr ptr long) -@ stdcall RtlExtendedIntegerMultiply(long long long) -@ stdcall RtlExtendedLargeIntegerDivide(long long long ptr) -@ stdcall RtlExtendedMagicDivide(long long long long long) -@ stdcall RtlFillMemory(ptr long long) -@ stdcall RtlFillMemoryUlong(ptr long long) -@ stdcall RtlFindClearBits(ptr long long) -@ stdcall RtlFindClearBitsAndSet(ptr long long) -@ stdcall RtlFindClearRuns(ptr ptr long long) -@ stdcall RtlFindFirstRunClear(ptr ptr) -@ stdcall RtlFindLastBackwardRunClear(ptr long ptr) -@ stdcall RtlFindLeastSignificantBit(long long) -@ stdcall RtlFindLongestRunClear(ptr ptr) -@ stdcall RtlFindMessage(ptr long long long ptr) -@ stdcall RtlFindMostSignificantBit(long long) -@ stdcall RtlFindNextForwardRunClear(ptr long ptr) -@ stdcall RtlFindRange(ptr long long long long long long long long ptr ptr ptr) -@ stdcall RtlFindSetBits(ptr long long) -@ stdcall RtlFindSetBitsAndClear(ptr long long) -@ stdcall RtlFindUnicodePrefix(ptr ptr long) -@ stdcall RtlFormatCurrentUserKeyPath(ptr) -@ stdcall RtlFreeAnsiString(ptr) -@ stdcall RtlFreeHeap(ptr long ptr) -@ stdcall RtlFreeOemString(ptr) -@ stdcall RtlFreeRangeList(ptr) -@ stdcall RtlFreeUnicodeString(ptr) -@ stdcall RtlGUIDFromString(ptr ptr) -@ stdcall RtlGenerate8dot3Name(ptr ptr long ptr) -@ stdcall RtlGetAce(ptr long ptr) -@ stdcall RtlGetCallersAddress(ptr ptr) -@ stdcall RtlGetCompressionWorkSpaceSize(long ptr ptr) -@ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) -@ stdcall RtlGetDefaultCodePage(ptr ptr) -@ stdcall RtlGetElementGenericTable(ptr long) -@ stdcall RtlGetElementGenericTableAvl(ptr long) -@ stdcall RtlGetFirstRange(ptr ptr ptr) -@ stdcall RtlGetGroupSecurityDescriptor(ptr ptr ptr) -@ stdcall RtlGetNextRange(ptr ptr long) -@ stdcall RtlGetNtGlobalFlags() -@ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr) -@ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) -@ stdcall RtlGetSetBootStatusData(ptr long long ptr long long) -@ stdcall RtlGetVersion(ptr) -@ stdcall RtlHashUnicodeString(ptr long long ptr) -@ stdcall RtlImageDirectoryEntryToData(ptr long long ptr) -@ stdcall RtlImageNtHeader(ptr) -@ stdcall RtlInitAnsiString(ptr str) -@ stdcall RtlInitAnsiStringEx(ptr str) -@ stdcall RtlInitCodePageTable(ptr ptr) -@ stdcall RtlInitString(ptr str) -@ stdcall RtlInitUnicodeString(ptr wstr) -@ stdcall RtlInitUnicodeStringEx(ptr wstr) -@ stdcall RtlInitializeBitMap(ptr ptr long) -@ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr) -@ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr) -@ stdcall RtlInitializeRangeList(ptr) -@ stdcall RtlInitializeSid(ptr ptr long) -@ stdcall RtlInitializeUnicodePrefix(ptr) -@ stdcall RtlInsertElementGenericTable(ptr ptr long ptr) -@ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) -@ stdcall RtlInsertElementGenericTableFull(ptr ptr long ptr ptr long) -@ stdcall RtlInsertElementGenericTableFullAvl(ptr ptr long ptr ptr ptr) -@ stdcall RtlInsertUnicodePrefix(ptr ptr ptr) -@ stdcall RtlInt64ToUnicodeString(long long long ptr) -@ stdcall RtlIntegerToChar(long long long ptr) -@ stdcall RtlIntegerToUnicode(long long long ptr) -@ stdcall RtlIntegerToUnicodeString(long long ptr) -@ stdcall RtlInvertRangeList(ptr ptr) -@ stdcall RtlIpv4AddressToStringA(ptr ptr) -@ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr) -@ stdcall RtlIpv4AddressToStringExW(ptr long ptr ptr) -@ stdcall RtlIpv4AddressToStringW(ptr ptr) -@ stdcall RtlIpv4StringToAddressA(str long ptr ptr) -@ stdcall RtlIpv4StringToAddressExA(str long ptr ptr) -@ stdcall RtlIpv4StringToAddressExW(wstr long ptr ptr) -@ stdcall RtlIpv4StringToAddressW(wstr long ptr ptr) -@ stdcall RtlIpv6AddressToStringA(ptr ptr) -@ stdcall RtlIpv6AddressToStringExA(ptr long long ptr ptr) -@ stdcall RtlIpv6AddressToStringExW(ptr long long ptr ptr) -@ stdcall RtlIpv6AddressToStringW(ptr ptr) -@ stdcall RtlIpv6StringToAddressA(str ptr ptr) -@ stdcall RtlIpv6StringToAddressExA(str ptr ptr ptr) -@ stdcall RtlIpv6StringToAddressExW(wstr ptr ptr ptr) -@ stdcall RtlIpv6StringToAddressW(wstr ptr ptr) -@ stdcall RtlIsGenericTableEmpty(ptr) -@ stdcall RtlIsGenericTableEmptyAvl(ptr) -@ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr) -@ stdcall RtlIsRangeAvailable(ptr long long long long long long ptr ptr ptr) -@ stdcall RtlIsValidOemCharacter(ptr) -@ stdcall RtlLargeIntegerAdd(long long long long) -@ stdcall RtlLargeIntegerArithmeticShift(long long long) -@ stdcall RtlLargeIntegerDivide(long long long long ptr) -@ stdcall RtlLargeIntegerNegate(long long) -@ stdcall RtlLargeIntegerShiftLeft(long long long) -@ stdcall RtlLargeIntegerShiftRight(long long long) -@ stdcall RtlLargeIntegerSubtract(long long long long) -@ stdcall RtlLengthRequiredSid(long) -@ stdcall RtlLengthSecurityDescriptor(ptr) -@ stdcall RtlLengthSid(ptr) -@ stdcall RtlLockBootStatusData(ptr) -@ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr) -@ stdcall RtlLookupElementGenericTable(ptr ptr) -@ stdcall RtlLookupElementGenericTableAvl(ptr ptr) -@ stdcall RtlLookupElementGenericTableFull(ptr ptr ptr ptr) -@ stdcall RtlLookupElementGenericTableFullAvl(ptr ptr ptr ptr) -@ stdcall RtlMapGenericMask(ptr ptr) -@ stdcall RtlMapSecurityErrorToNtStatus(long) -@ stdcall RtlMergeRangeLists(ptr ptr ptr long) -@ stdcall RtlMoveMemory(ptr ptr long) -@ stdcall RtlMultiByteToUnicodeN(ptr long ptr str long) -@ stdcall RtlMultiByteToUnicodeSize(ptr str long) -@ stdcall RtlNextUnicodePrefix(ptr long) -@ stdcall RtlNtStatusToDosError(long) -@ stdcall RtlNtStatusToDosErrorNoTeb(long) -@ stdcall RtlNumberGenericTableElements(ptr) -@ stdcall RtlNumberGenericTableElementsAvl(ptr) -@ stdcall RtlNumberOfClearBits(ptr) -@ stdcall RtlNumberOfSetBits(ptr) -@ stdcall RtlOemStringToCountedUnicodeString(ptr ptr long) -@ stdcall RtlOemStringToUnicodeSize(ptr) RtlxOemStringToUnicodeSize -@ stdcall RtlOemStringToUnicodeString(ptr ptr long) -@ stdcall RtlOemToUnicodeN(wstr long ptr ptr long) -@ stdcall RtlPinAtomInAtomTable(ptr ptr) -@ fastcall RtlPrefetchMemoryNonTemporal(ptr long) -@ stdcall RtlPrefixString(ptr ptr long) -@ stdcall RtlPrefixUnicodeString(ptr ptr long) -@ stdcall RtlQueryAtomInAtomTable(ptr ptr ptr ptr ptr ptr) -@ stdcall RtlQueryRegistryValues(long wstr ptr ptr ptr) -@ stdcall RtlQueryTimeZoneInformation(ptr) -@ stdcall RtlRaiseException(ptr) -@ stdcall RtlRandom(ptr) -@ stdcall RtlRandomEx(ptr) -@ stdcall RtlRealPredecessor(ptr) -@ stdcall RtlRealSuccessor(ptr) -@ stdcall RtlRemoveUnicodePrefix(ptr ptr) -@ stdcall RtlReserveChunk(long ptr ptr ptr long) -@ stdcall RtlSecondsSince1970ToTime(long ptr) -@ stdcall RtlSecondsSince1980ToTime(long ptr) -@ stdcall RtlSelfRelativeToAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall RtlSelfRelativeToAbsoluteSD2(ptr long) -@ stdcall RtlSetAllBits(ptr) -@ stdcall RtlSetBit(ptr long) -@ stdcall RtlSetBits(ptr long long) -@ stdcall RtlSetDaclSecurityDescriptor(ptr long ptr long) -@ stdcall RtlSetGroupSecurityDescriptor(ptr ptr long) -@ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long) -@ stdcall RtlSetSaclSecurityDescriptor(ptr long ptr long) -@ stdcall RtlSetTimeZoneInformation(ptr) -@ stdcall RtlSizeHeap(ptr long ptr) -@ stdcall RtlSplay(ptr) -@ stdcall RtlStringFromGUID(ptr ptr) -@ stdcall RtlSubAuthorityCountSid(ptr) -@ stdcall RtlSubAuthoritySid(ptr long) -@ stdcall RtlSubtreePredecessor(ptr) -@ stdcall RtlSubtreeSuccessor(ptr) -@ stdcall RtlTestBit(ptr long) -@ stdcall RtlTimeFieldsToTime(ptr ptr) -@ stdcall RtlTimeToElapsedTimeFields(ptr ptr) -@ stdcall RtlTimeToSecondsSince1970(ptr ptr) -@ stdcall RtlTimeToSecondsSince1980(ptr ptr) -@ stdcall RtlTimeToTimeFields(ptr ptr) -;RtlTraceDatabaseAdd -;RtlTraceDatabaseCreate -;RtlTraceDatabaseDestroy -;RtlTraceDatabaseEnumerate -;RtlTraceDatabaseFind -;RtlTraceDatabaseLock -;RtlTraceDatabaseUnlock -;RtlTraceDatabaseValidate -#ifndef __x86_64__ -@ fastcall RtlUlongByteSwap(long) -@ fastcall RtlUlonglongByteSwap(long long) -#endif -@ stdcall RtlUnicodeStringToAnsiSize(ptr) RtlxUnicodeStringToAnsiSize -@ stdcall RtlUnicodeStringToAnsiString(ptr ptr long) -@ stdcall RtlUnicodeStringToCountedOemString(ptr ptr long) -@ stdcall RtlUnicodeStringToInteger(ptr long ptr) -@ stdcall RtlUnicodeStringToOemSize(ptr) RtlxUnicodeStringToOemSize -@ stdcall RtlUnicodeStringToOemString(ptr ptr long) -@ stdcall RtlUnicodeToCustomCPN(ptr ptr long ptr wstr long) -@ stdcall RtlUnicodeToMultiByteN(ptr long ptr wstr long) -@ stdcall RtlUnicodeToMultiByteSize(ptr wstr long) -@ stdcall RtlUnicodeToOemN(ptr long ptr wstr long) -@ stdcall RtlUnlockBootStatusData(ptr) -@ stdcall RtlUnwind(ptr ptr ptr ptr) -@ stdcall RtlUpcaseUnicodeChar(long) -@ stdcall RtlUpcaseUnicodeString(ptr ptr long) -@ stdcall RtlUpcaseUnicodeStringToAnsiString(ptr ptr long) -@ stdcall RtlUpcaseUnicodeStringToCountedOemString(ptr ptr long) -@ stdcall RtlUpcaseUnicodeStringToOemString(ptr ptr long) -@ stdcall RtlUpcaseUnicodeToCustomCPN(ptr ptr long ptr wstr long) -@ stdcall RtlUpcaseUnicodeToMultiByteN(ptr long ptr wstr long) -@ stdcall RtlUpcaseUnicodeToOemN(ptr long ptr wstr long) -@ stdcall RtlUpperChar(long) -@ stdcall RtlUpperString(ptr ptr) -#ifndef __x86_64__ -@ fastcall RtlUshortByteSwap(long) -#endif -@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) -@ stdcall RtlValidSecurityDescriptor(ptr) -@ stdcall RtlValidSid(ptr) -@ stdcall RtlVerifyVersionInfo(ptr long long long) -@ stdcall RtlVolumeDeviceToDosName(ptr ptr) -@ stdcall RtlWalkFrameChain(ptr long long) -@ stdcall RtlWriteRegistryValue(long wstr wstr long ptr long) -@ stdcall RtlZeroHeap(ptr long) -@ stdcall RtlZeroMemory(ptr long) -@ stdcall RtlxAnsiStringToUnicodeSize(ptr) -@ stdcall RtlxOemStringToUnicodeSize(ptr) -@ stdcall RtlxUnicodeStringToAnsiSize(ptr) -@ stdcall RtlxUnicodeStringToOemSize(ptr) -@ stdcall SeAccessCheck(ptr ptr ptr long long ptr ptr long ptr ptr) -@ stdcall SeAppendPrivileges(ptr ptr) -@ stdcall SeAssignSecurity(ptr ptr ptr long ptr ptr ptr) -@ stdcall SeAssignSecurityEx(ptr ptr ptr ptr long long ptr ptr ptr) -@ stdcall SeAuditHardLinkCreation(ptr ptr long) -@ stdcall SeAuditingFileEvents(long ptr) -@ stdcall SeAuditingFileEventsWithContext(long ptr ptr) -@ stdcall SeAuditingFileOrGlobalEvents(long ptr ptr) -@ stdcall SeAuditingHardLinkEvents(long ptr) -@ stdcall SeAuditingHardLinkEventsWithContext(long ptr ptr) -@ stdcall SeCaptureSecurityDescriptor(ptr long long long ptr) -@ stdcall SeCaptureSubjectContext(ptr) -@ stdcall SeCloseObjectAuditAlarm(ptr ptr long) -@ stdcall SeCreateAccessState(ptr ptr long ptr) -@ stdcall SeCreateClientSecurity(ptr ptr long ptr) -@ stdcall SeCreateClientSecurityFromSubjectContext(ptr ptr long ptr) -@ stdcall SeDeassignSecurity(ptr) -@ stdcall SeDeleteAccessState(ptr) -@ stdcall SeDeleteObjectAuditAlarm(ptr ptr) -@ extern SeExports -@ stdcall SeFilterToken(ptr long ptr ptr ptr ptr) -@ stdcall SeFreePrivileges(ptr) -@ stdcall SeImpersonateClient(ptr ptr) -@ stdcall SeImpersonateClientEx(ptr ptr) -@ stdcall SeLockSubjectContext(ptr) -@ stdcall SeMarkLogonSessionForTerminationNotification(ptr) -@ stdcall SeOpenObjectAuditAlarm(ptr ptr ptr ptr ptr long long long ptr) -@ stdcall SeOpenObjectForDeleteAuditAlarm(ptr ptr ptr ptr ptr long long long ptr) -@ stdcall SePrivilegeCheck(ptr ptr long) -@ stdcall SePrivilegeObjectAuditAlarm(ptr ptr long ptr long long) -@ extern SePublicDefaultDacl -@ stdcall SeQueryAuthenticationIdToken(ptr ptr) -@ stdcall SeQueryInformationToken(ptr long ptr) -@ stdcall SeQuerySecurityDescriptorInfo(ptr ptr ptr ptr) -@ stdcall SeQuerySessionIdToken(ptr ptr) -@ stdcall SeRegisterLogonSessionTerminatedRoutine(ptr) -@ stdcall SeReleaseSecurityDescriptor(ptr long long) -@ stdcall SeReleaseSubjectContext(ptr) -@ stdcall SeSetAccessStateGenericMapping(ptr ptr) -;SeSetAuditParameter -@ stdcall SeSetSecurityDescriptorInfo(ptr ptr ptr ptr long ptr) -@ stdcall SeSetSecurityDescriptorInfoEx(ptr ptr ptr ptr long long ptr) -@ stdcall SeSinglePrivilegeCheck(long long long) -@ extern SeSystemDefaultDacl -@ stdcall SeTokenImpersonationLevel(ptr) -@ stdcall SeTokenIsAdmin(ptr) -@ stdcall SeTokenIsRestricted(ptr) -@ stdcall SeTokenIsWriteRestricted(ptr) -@ stdcall SeTokenType(ptr) -@ stdcall SeUnlockSubjectContext(ptr) -@ stdcall SeUnregisterLogonSessionTerminatedRoutine(ptr) -@ stdcall SeValidSecurityDescriptor(long ptr) -@ stdcall VerSetConditionMask(long long long long) -;VfFailDeviceNode -;VfFailDriver -;VfFailSystemBIOS -;VfIsVerificationEnabled -#ifndef __x86_64__ -@ stdcall WRITE_REGISTER_BUFFER_UCHAR(ptr ptr long) -@ stdcall WRITE_REGISTER_BUFFER_ULONG(ptr ptr long) -@ stdcall WRITE_REGISTER_BUFFER_USHORT(ptr ptr long) -@ stdcall WRITE_REGISTER_UCHAR(ptr long) -@ stdcall WRITE_REGISTER_ULONG(ptr long) -@ stdcall WRITE_REGISTER_USHORT(ptr long) -#endif -;WmiFlushTrace -;WmiGetClock -;WmiQueryTrace -@ stdcall WmiQueryTraceInformation(long ptr long ptr ptr) -;WmiStartTrace -;WmiStopTrace -;WmiTraceFastEvent -@ cdecl WmiTraceMessage() -@ stdcall WmiTraceMessageVa(ptr long ptr long long) -;WmiUpdateTrace -;XIPDispatch -@ stdcall ZwAccessCheckAndAuditAlarm(ptr ptr ptr ptr ptr long ptr long ptr ptr ptr) -@ stdcall ZwAddBootEntry(ptr long) -@ stdcall ZwAddDriverEntry(ptr long) -@ stdcall ZwAdjustPrivilegesToken(ptr long ptr long ptr ptr) -@ stdcall ZwAlertThread(ptr) -@ stdcall ZwAllocateVirtualMemory(ptr ptr long ptr long long) -@ stdcall ZwAssignProcessToJobObject(ptr ptr) -@ stdcall ZwCancelIoFile(ptr ptr) -@ stdcall ZwCancelTimer(ptr ptr) -@ stdcall ZwClearEvent(ptr) -@ stdcall ZwClose(ptr) -@ stdcall ZwCloseObjectAuditAlarm(ptr ptr long) -@ stdcall ZwConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall ZwCreateDirectoryObject(ptr long ptr) -@ stdcall ZwCreateEvent(ptr long ptr long long) -@ stdcall ZwCreateFile(ptr long ptr ptr ptr long long long long ptr long) -@ stdcall ZwCreateJobObject(ptr long ptr) -@ stdcall ZwCreateKey(ptr long ptr long ptr long ptr) -@ stdcall ZwCreateSection(ptr long ptr ptr long long ptr) -@ stdcall ZwCreateSymbolicLinkObject(ptr long ptr ptr) -@ stdcall ZwCreateTimer(ptr long ptr long) -@ stdcall ZwDeleteBootEntry(long) -@ stdcall ZwDeleteDriverEntry(long) -@ stdcall ZwDeleteFile(ptr) -@ stdcall ZwDeleteKey(ptr) -@ stdcall ZwDeleteValueKey(ptr ptr) -@ stdcall ZwDeviceIoControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) -@ stdcall ZwDisplayString(ptr) -@ stdcall ZwDuplicateObject(ptr ptr ptr ptr long long long) -@ stdcall ZwDuplicateToken(ptr long ptr long long ptr) -@ stdcall ZwEnumerateBootEntries(ptr ptr) -@ stdcall ZwEnumerateDriverEntries(ptr ptr) -@ stdcall ZwEnumerateKey(ptr long long ptr long ptr) -@ stdcall ZwEnumerateValueKey(ptr long long ptr long ptr) -@ stdcall ZwFlushInstructionCache(ptr ptr long) -@ stdcall ZwFlushKey(ptr) -@ stdcall ZwFlushVirtualMemory(ptr ptr ptr ptr) -@ stdcall ZwFreeVirtualMemory(ptr ptr ptr long) -@ stdcall ZwFsControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) -@ stdcall ZwInitiatePowerAction(long long long long) -@ stdcall ZwIsProcessInJob(ptr ptr) -@ stdcall ZwLoadDriver(ptr) -@ stdcall ZwLoadKey(ptr ptr) -@ stdcall ZwMakeTemporaryObject(ptr) -@ stdcall ZwMapViewOfSection(ptr ptr ptr long long ptr ptr long long long) -@ stdcall ZwModifyBootEntry(ptr) -@ stdcall ZwModifyDriverEntry(ptr) -@ stdcall ZwNotifyChangeKey(ptr ptr ptr ptr ptr long long ptr long long) -@ stdcall ZwOpenDirectoryObject(ptr long ptr) -@ stdcall ZwOpenEvent(ptr long ptr) -@ stdcall ZwOpenFile(ptr long ptr ptr long long) -@ stdcall ZwOpenJobObject(ptr long ptr) -@ stdcall ZwOpenKey(ptr long ptr) -@ stdcall ZwOpenProcess(ptr long ptr ptr) -@ stdcall ZwOpenProcessToken(ptr long ptr) -@ stdcall ZwOpenProcessTokenEx(ptr long long ptr) -@ stdcall ZwOpenSection(ptr long ptr) -@ stdcall ZwOpenSymbolicLinkObject(ptr long ptr) -@ stdcall ZwOpenThread(ptr long ptr ptr) -@ stdcall ZwOpenThreadToken(ptr long long ptr) -@ stdcall ZwOpenThreadTokenEx(ptr long long long ptr) -@ stdcall ZwOpenTimer(ptr long ptr) -@ stdcall ZwPowerInformation(long ptr long ptr long) -@ stdcall ZwPulseEvent(ptr ptr) -@ stdcall ZwQueryBootEntryOrder(ptr ptr) -@ stdcall ZwQueryBootOptions(ptr ptr) -@ stdcall ZwQueryDefaultLocale(long ptr) -@ stdcall ZwQueryDefaultUILanguage(ptr) -@ stdcall ZwQueryDirectoryFile(ptr ptr ptr ptr ptr ptr long long long ptr long) -@ stdcall ZwQueryDirectoryObject(ptr ptr long long long ptr ptr) -@ stdcall ZwQueryDriverEntryOrder(ptr ptr) -@ stdcall ZwQueryEaFile(ptr ptr ptr long long ptr long ptr long) -@ stdcall ZwQueryFullAttributesFile(ptr ptr) -@ stdcall ZwQueryInformationAtom(ptr long ptr long ptr) -@ stdcall ZwQueryInformationFile(ptr ptr ptr long long) -@ stdcall ZwQueryInformationJobObject(ptr long ptr long ptr) -@ stdcall ZwQueryInformationProcess(ptr long ptr long ptr) -@ stdcall ZwQueryInformationThread(ptr long ptr long ptr) -@ stdcall ZwQueryInformationToken(ptr long long long ptr) -@ stdcall ZwQueryInstallUILanguage(ptr) -@ stdcall ZwQueryKey(ptr long ptr long ptr) -@ stdcall ZwQueryObject(ptr long ptr long ptr) -@ stdcall ZwQuerySection(ptr long ptr long ptr) -@ stdcall ZwQuerySecurityObject(ptr long ptr long ptr) -@ stdcall ZwQuerySymbolicLinkObject(ptr ptr ptr) -@ stdcall ZwQuerySystemInformation(long ptr long ptr) -@ stdcall ZwQueryValueKey(ptr ptr long ptr long ptr) -@ stdcall ZwQueryVolumeInformationFile(ptr ptr ptr long long) -@ stdcall ZwReadFile(ptr ptr ptr ptr ptr ptr long ptr ptr) -@ stdcall ZwReplaceKey(ptr ptr ptr) -@ stdcall ZwRequestWaitReplyPort(ptr ptr ptr) -@ stdcall ZwResetEvent(ptr ptr) -@ stdcall ZwRestoreKey(ptr ptr long) -@ stdcall ZwSaveKey(ptr ptr) -@ stdcall ZwSaveKeyEx(ptr ptr long) -@ stdcall ZwSecureConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall ZwSetBootEntryOrder(ptr ptr) -@ stdcall ZwSetBootOptions(ptr long) -@ stdcall ZwSetDefaultLocale(long long) -@ stdcall ZwSetDefaultUILanguage(long) -@ stdcall ZwSetDriverEntryOrder(ptr ptr) -@ stdcall ZwSetEaFile(ptr ptr ptr long) -@ stdcall ZwSetEvent(ptr ptr) -@ stdcall ZwSetInformationFile(ptr ptr ptr long long) -@ stdcall ZwSetInformationJobObject(ptr long ptr long) -@ stdcall ZwSetInformationObject(ptr long ptr long) -@ stdcall ZwSetInformationProcess(ptr long ptr long) -@ stdcall ZwSetInformationThread(ptr long ptr long) -@ stdcall ZwSetSecurityObject(ptr long ptr) -@ stdcall ZwSetSystemInformation(long ptr long) -@ stdcall ZwSetSystemTime(ptr ptr) -@ stdcall ZwSetTimer(ptr ptr ptr ptr long long ptr) -@ stdcall ZwSetValueKey(ptr ptr long long ptr long) -@ stdcall ZwSetVolumeInformationFile(ptr ptr ptr long long) -@ stdcall ZwTerminateJobObject(ptr long) -@ stdcall ZwTerminateProcess(ptr long) -@ stdcall ZwTranslateFilePath(ptr long ptr long) -@ stdcall ZwUnloadDriver(ptr) -@ stdcall ZwUnloadKey(ptr) -@ stdcall ZwUnmapViewOfSection(ptr ptr) -@ stdcall ZwWaitForMultipleObjects(long ptr long long ptr) -@ stdcall ZwWaitForSingleObject(ptr long ptr) -@ stdcall ZwWriteFile(ptr ptr ptr ptr ptr ptr long ptr ptr) -@ stdcall ZwYieldExecution() -;_CIcos -;_CIsin -;_CIsqrt -#ifndef __x86_64 -@ cdecl _abnormal_termination() -#endif -#ifdef _M_IX86 -@ cdecl _alldiv() -@ cdecl _alldvrm() -@ cdecl _allmul() -@ cdecl _alloca_probe() -@ cdecl _allrem() -@ cdecl _allshl() -@ cdecl _allshr() -@ cdecl _aulldiv() -@ cdecl _aulldvrm() -@ cdecl _aullrem() -@ cdecl _aullshr() -#endif -#ifndef __x86_64 -@ cdecl _except_handler2() -@ cdecl _except_handler3() -@ cdecl _global_unwind2() -#endif -@ cdecl _itoa() -@ cdecl _itow() -#ifndef __x86_64 -@ cdecl _local_unwind2() -#endif -@ cdecl _purecall() -@ cdecl _snprintf() -@ cdecl _snwprintf() -@ cdecl _stricmp() -@ cdecl _strlwr() -@ cdecl _strnicmp() -@ cdecl _strnset() -@ cdecl _strrev() -@ cdecl _strset() -@ cdecl _strupr() -@ cdecl _vsnprintf() -@ cdecl _vsnwprintf() -@ cdecl _wcsicmp() -@ cdecl _wcslwr() -@ cdecl _wcsnicmp() -@ cdecl _wcsnset() -@ cdecl _wcsrev() -@ cdecl _wcsupr() -@ cdecl atoi() -@ cdecl atol() -@ cdecl isdigit() -@ cdecl islower() -@ cdecl isprint() -@ cdecl isspace() -@ cdecl isupper() -@ cdecl isxdigit() -@ cdecl mbstowcs() -@ cdecl mbtowc() -@ cdecl memchr() -@ cdecl memcpy() -@ cdecl memmove() -@ cdecl memset() -@ cdecl qsort() -@ cdecl rand() -@ cdecl sprintf() -@ cdecl srand() -@ cdecl strcat() -@ cdecl strchr() -@ cdecl strcmp() -@ cdecl strcpy() -@ cdecl strlen() -@ cdecl strncat() -@ cdecl strncmp() -@ cdecl strncpy() -@ cdecl strrchr() -@ cdecl strspn() -@ cdecl strstr() -@ cdecl swprintf() -@ cdecl tolower() -@ cdecl toupper() -@ cdecl towlower() -@ cdecl towupper() -@ stdcall vDbgPrintEx(long long str ptr) -@ stdcall vDbgPrintExWithPrefix(str long long str ptr) -@ cdecl vsprintf() -@ cdecl wcscat() -@ cdecl wcschr() -@ cdecl wcscmp() -@ cdecl wcscpy() -@ cdecl wcscspn() -@ cdecl wcslen() -@ cdecl wcsncat() -@ cdecl wcsncmp() -@ cdecl wcsncpy() -@ cdecl wcsrchr() -@ cdecl wcsspn() -@ cdecl wcsstr() -@ cdecl wcstombs() -@ cdecl wctomb() From 5a73314ad07a250ede7c7916617cae565be5b442 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 30 Oct 2008 12:55:23 +0000 Subject: [PATCH 379/388] add O_ACCMODE svn path=/branches/ros-amd64-bringup/; revision=37096 --- reactos/include/crt/fcntl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/include/crt/fcntl.h b/reactos/include/crt/fcntl.h index 607a1cb445c..993e21af0ae 100644 --- a/reactos/include/crt/fcntl.h +++ b/reactos/include/crt/fcntl.h @@ -37,6 +37,7 @@ #define O_RDONLY _O_RDONLY #define O_WRONLY _O_WRONLY #define O_RDWR _O_RDWR +#define O_ACCMODE _O_ACCMODE #define O_APPEND _O_APPEND #define O_CREAT _O_CREAT #define O_TRUNC _O_TRUNC From 698706d1075ba4e32912c3bdfd69e67913ba2aa9 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 30 Oct 2008 14:14:06 +0000 Subject: [PATCH 380/388] - add mising files to mingw library - readd getopt (needed by dosfsck) - reorder alphabetically svn path=/branches/ros-amd64-bringup/; revision=37100 --- reactos/lib/3rdparty/mingw/_wgetopt.c | 15 +++ reactos/lib/3rdparty/mingw/getopt.c | 137 ++++++++++++++++++++++++ reactos/lib/3rdparty/mingw/mingw.rbuild | 19 +++- reactos/lib/3rdparty/mingw/tgetopt.h | 90 ++++++++++++++++ 4 files changed, 256 insertions(+), 5 deletions(-) create mode 100644 reactos/lib/3rdparty/mingw/_wgetopt.c create mode 100644 reactos/lib/3rdparty/mingw/getopt.c create mode 100644 reactos/lib/3rdparty/mingw/tgetopt.h diff --git a/reactos/lib/3rdparty/mingw/_wgetopt.c b/reactos/lib/3rdparty/mingw/_wgetopt.c new file mode 100644 index 00000000000..91efed4d702 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/_wgetopt.c @@ -0,0 +1,15 @@ +/* $Id$ +*/ +/* + tgetopt -- POSIX-compliant implementation of getopt() with string-type-generic + semantics + + This is public domain software +*/ + +#include + +#define _UNICODE +#include "getopt.c" + +/* EOF */ diff --git a/reactos/lib/3rdparty/mingw/getopt.c b/reactos/lib/3rdparty/mingw/getopt.c new file mode 100644 index 00000000000..3b0bfedfec4 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/getopt.c @@ -0,0 +1,137 @@ +/* $Id$ +*/ +/* + tgetopt -- POSIX-compliant implementation of getopt() with string-type-generic + semantics + + This is public domain software +*/ + +#include +#include +#include + +#include "tgetopt.h" + +int _topterr = 1; +int _toptind = 1; +int _toptopt; +_TCHAR * _toptarg; + +int _tgetopt(int argc, _TCHAR * const argv[], const _TCHAR * optstring) +{ + static int s_nArgChar = 0; + _TCHAR * pcOptChar; + + /* we're done */ + if(_toptind >= argc) return -1; + + /* last time we reached the end of argv[_toptind] */ + if(s_nArgChar != 0 && argv[_toptind][s_nArgChar] == 0) + { + /* scan the next argument */ + ++ _toptind; + + /* we're done */ + if(_toptind >= argc) return -1; + + s_nArgChar = 0; + } + + /* first time we scan argv[_toptind] */ + if(s_nArgChar == 0) + { + /* argument is NULL - we're done */ + if(argv[_toptind] == NULL) + return (int)-1; + /* argument is empty - we're done */ + else if(argv[_toptind][0] == 0) + return (int)-1; + /* argument begins with '-' */ + else if(argv[_toptind][0] == _T('-')) + { + /* argument is "--" */ + if(argv[_toptind][1] == _T('-')) + { + /* increment optind */ + ++ _toptind; + s_nArgChar = 0; + + /* we're done */ + return (int)-1; + } + /* argument is "-" */ + else if(argv[_toptind][1] == 0) + { + /* we're done */ + return (int)-1; + } + /* possible option */ + else + ++ s_nArgChar; + } + /* argument doesn't begin with a dash - we're done */ + else + return (int)-1; + } + + /* return the current character */ + _toptopt = argv[_toptind][s_nArgChar]; + + /* advance to the next character */ + ++ s_nArgChar; + + /* unrecognized option */ + if(_toptopt == _T(':') || (pcOptChar = _tcschr(optstring, _toptopt)) == NULL) + { + /* print an error message */ + if(_topterr && optstring[0] != _T(':')) + _ftprintf(stderr, _T("%s: illegal option -- %c\n"), argv[0], _toptopt); + + /* return an error */ + return _T('?'); + } + + /* the option requires an argument */ + if(pcOptChar[1] == _T(':')) + { + /* we are at the end of the argument */ + if(argv[_toptind][s_nArgChar] == 0) + { + /* the argument of the option is the next argument */ + ++ _toptind; + s_nArgChar = 0; + + /* this is the last argument */ + if(_toptind >= argc) + { + /* print an error message */ + if(_topterr && optstring[0] != _T(':')) + { + _ftprintf + ( + stderr, + _T("%s: option requires an argument -- %c\n"), + argv[0], + _toptopt + ); + } + + /* return an error */ + return ((optstring[0] == _T(':')) ? _T(':') : _T('?')); + } + + /* return the argument */ + _toptarg = argv[_toptind]; + ++ _toptind; + } + /* the rest of the argument is the argument of the option */ + else + _toptarg = argv[_toptind] + s_nArgChar; + } + + /* success */ + return _toptopt; +} + +/* EOF */ diff --git a/reactos/lib/3rdparty/mingw/mingw.rbuild b/reactos/lib/3rdparty/mingw/mingw.rbuild index 5ff3c242f53..1ae99126f67 100644 --- a/reactos/lib/3rdparty/mingw/mingw.rbuild +++ b/reactos/lib/3rdparty/mingw/mingw.rbuild @@ -4,21 +4,30 @@ include - CRT_fp10.c + _newmode.c + _wgetopt.c + argv.c atonexit.c + binmode.c charmax.c cinitexe.c + CRT_fp10.c + crtdll.c + dllentry.c + dllmain.c gccmain.c + getopt.c gs_support.c merr.c mingw_helpers.c natstart.c - _newmode.c pesect.c - wildcard.c - xtxtmode.c - xncommod.c pseudo-reloc.c + tlssup.c + wildcard.c + xncommod.c + xthdloc.c + xtxtmode.c include diff --git a/reactos/lib/3rdparty/mingw/tgetopt.h b/reactos/lib/3rdparty/mingw/tgetopt.h new file mode 100644 index 00000000000..01e0b1ee489 --- /dev/null +++ b/reactos/lib/3rdparty/mingw/tgetopt.h @@ -0,0 +1,90 @@ +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#include + +#ifdef _UNICODE +#define _toption _woption +#define _toptarg _woptarg +#define _toptind _woptind +#define _topterr _wopterr +#define _toptopt _woptopt +#define _tgetopt _wgetopt +#define _tgetopt_long _wgetopt_long +#define _tgetopt_long_only _wgetopt_long_only +#define _tgetopt_internal _wgetopt_internal +#else +#define _toption option +#define _toptarg optarg +#define _toptind optind +#define _topterr opterr +#define _toptopt optopt +#define _tgetopt getopt +#define _tgetopt_long getopt_long +#define _tgetopt_long_only getopt_long_only +#define _tgetopt_internal _getopt_internal +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +extern char *optarg; +extern int optind; +extern int opterr; +extern int optopt; + +extern wchar_t *_woptarg; +extern int _woptind; +extern int _wopterr; +extern int _woptopt; + +struct option +{ + const char *name; + int has_arg; + int *flag; + int val; +}; + +struct _woption +{ + const wchar_t *name; + int has_arg; + int *flag; + int val; +}; + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +extern int getopt (int argc, char *const *argv, const char *shortopts); +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, const struct option *longopts, int *longind); + +extern int _wgetopt (int argc, wchar_t *const *argv, const wchar_t *shortopts); +extern int _wgetopt_long (int argc, wchar_t *const *argv, const wchar_t *shortopts, + const struct _woption *longopts, int *longind); +extern int _wgetopt_long_only (int argc, wchar_t *const *argv, + const wchar_t *shortopts, + const struct _woption *longopts, int *longind); + +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, const struct option *longopts, int *longind, + int long_only); + +extern int _wgetopt_internal (int argc, wchar_t *const *argv, + const wchar_t *shortopts, + const struct _woption *longopts, int *longind, + int long_only); + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ + From 90b83179f79c6e06fda58670876d8e93f5381436 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 30 Oct 2008 14:15:58 +0000 Subject: [PATCH 381/388] Add explorer back to shell.rbuild. It doesn't compile atm. svn path=/branches/ros-amd64-bringup/; revision=37101 --- reactos/base/shell/shell.rbuild | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/base/shell/shell.rbuild b/reactos/base/shell/shell.rbuild index 8b404606eb6..efdd8f323e7 100644 --- a/reactos/base/shell/shell.rbuild +++ b/reactos/base/shell/shell.rbuild @@ -4,6 +4,9 @@ + + + From 406128c037b26d2bae9138a44061fcf0e85a2945 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 1 Nov 2008 00:30:48 +0000 Subject: [PATCH 382/388] Fix explorer build a bit. svn path=/branches/ros-amd64-bringup/; revision=37122 --- reactos/base/shell/explorer/shell/fatfs.cpp | 4 ++-- reactos/base/shell/explorer/shell/fatfs.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/base/shell/explorer/shell/fatfs.cpp b/reactos/base/shell/explorer/shell/fatfs.cpp index 8750637df9e..ba2017e6b73 100644 --- a/reactos/base/shell/explorer/shell/fatfs.cpp +++ b/reactos/base/shell/explorer/shell/fatfs.cpp @@ -148,8 +148,8 @@ void FATDirectory::read_directory(int scan_flags) w32fd.nFileSizeLow = e.size; // convert date/time attribute into FILETIME - const fdate& date = e.date; - const ftime& time = e.time; + const filedate& date = e.date; + const filetime& time = e.time; SYSTEMTIME stime; FILETIME ftime; diff --git a/reactos/base/shell/explorer/shell/fatfs.h b/reactos/base/shell/explorer/shell/fatfs.h index cf976302785..8c267da7f9e 100644 --- a/reactos/base/shell/explorer/shell/fatfs.h +++ b/reactos/base/shell/explorer/shell/fatfs.h @@ -118,13 +118,13 @@ struct BootSector32 { }; -struct ftime { +struct filetime { WORD sec2 : 5; WORD min : 6; WORD hour : 5; }; -struct fdate { +struct filedate { WORD day : 5; WORD month : 4; WORD year : 7; @@ -150,15 +150,15 @@ struct DEntry_E { char ext[3]; char attr; char rsrvd[10]; - struct ftime time; - struct fdate date; + struct filetime time; + struct filedate date; WORD fclus; DWORD size; }; union DEntry { DEntry_E E; - BYTE B[8+3+1+10+sizeof(struct ftime)+sizeof(struct fdate)+sizeof(WORD)+sizeof(DWORD)]; + BYTE B[8+3+1+10+sizeof(struct filetime)+sizeof(struct filedate)+sizeof(WORD)+sizeof(DWORD)]; }; #pragma pack(pop) From 736c5a96984bd8dff14772fc1e9d77d367a51587 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Sat, 1 Nov 2008 00:31:10 +0000 Subject: [PATCH 383/388] Fix explorer build a bit more. svn path=/branches/ros-amd64-bringup/; revision=37123 --- reactos/include/crt/time.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/include/crt/time.h b/reactos/include/crt/time.h index 97875c444c4..6aa7d9dc6e2 100644 --- a/reactos/include/crt/time.h +++ b/reactos/include/crt/time.h @@ -119,10 +119,10 @@ extern "C" { #define CLOCKS_PER_SEC 1000 - _CRTIMP int _daylight; - _CRTIMP long _dstbias; - _CRTIMP long _timezone; - _CRTIMP char * _tzname[2]; + __MINGW_IMPORT int _daylight; + __MINGW_IMPORT long _dstbias; + __MINGW_IMPORT long _timezone; + __MINGW_IMPORT char * _tzname[2]; _CRTIMP errno_t __cdecl _get_daylight(int *_Daylight); _CRTIMP errno_t __cdecl _get_dstbias(long *_Daylight_savings_bias); From 80b4cfa04ceac76dce8d97d64859a85c3c821c67 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 6 Nov 2008 22:50:47 +0000 Subject: [PATCH 384/388] Fix scsiport, by using pspec again. svn path=/branches/ros-amd64-bringup/; revision=37234 --- .../drivers/storage/scsiport/scsiport.pspec | 51 ++++ .../drivers/storage/scsiport/scsiport.rbuild | 5 +- .../drivers/storage/scsiport/scsiport.spec | 45 ---- reactos/drivers/storage/scsiport/stubs.c | 250 ++++++++++++++++++ 4 files changed, 304 insertions(+), 47 deletions(-) create mode 100644 reactos/drivers/storage/scsiport/scsiport.pspec delete mode 100644 reactos/drivers/storage/scsiport/scsiport.spec create mode 100644 reactos/drivers/storage/scsiport/stubs.c diff --git a/reactos/drivers/storage/scsiport/scsiport.pspec b/reactos/drivers/storage/scsiport/scsiport.pspec new file mode 100644 index 00000000000..65c75471c4d --- /dev/null +++ b/reactos/drivers/storage/scsiport/scsiport.pspec @@ -0,0 +1,51 @@ +#ifdef __x86_64__ +#define MAYBEFWD(x) +#else +#define MAYBEFWD(x) x +#endif + +@ cdecl ScsiDebugPrint() +@ stdcall ScsiPortCompleteRequest(ptr long long long long) +@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long) +@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) MAYBEFWD(NTOSKRNL.RtlConvertUlongToLargeInteger) +@ stdcall ScsiPortFlushDma(ptr) +@ stdcall ScsiPortFreeDeviceBase(ptr ptr) +@ stdcall ScsiPortGetBusData(ptr long long long ptr long) +@ stdcall ScsiPortGetDeviceBase(ptr long long long long long long) +@ stdcall ScsiPortGetLogicalUnit(ptr long long long) +@ stdcall ScsiPortGetPhysicalAddress(ptr ptr ptr long) +@ stdcall ScsiPortGetSrb(ptr long long long long) +@ stdcall ScsiPortGetUncachedExtension(ptr ptr long) +@ stdcall ScsiPortGetVirtualAddress(ptr long long) +@ stdcall ScsiPortInitialize(ptr ptr ptr ptr) +@ stdcall ScsiPortIoMapTransfer(ptr ptr long long) +@ stdcall ScsiPortLogError(ptr ptr long long long long long) +@ stdcall ScsiPortMoveMemory(ptr ptr long) +@ cdecl ScsiPortNotification() +@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_UCHAR) +@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_USHORT) +@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_ULONG) +@ stdcall ScsiPortReadPortUchar(ptr) MAYBEFWD(HAL.READ_PORT_UCHAR) +@ stdcall ScsiPortReadPortUshort(ptr) MAYBEFWD(HAL.READ_PORT_USHORT) +@ stdcall ScsiPortReadPortUlong(ptr) MAYBEFWD(HAL.READ_PORT_ULONG) +@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_UCHAR) +@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_USHORT) +@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_ULONG) +@ stdcall ScsiPortReadRegisterUchar(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_UCHAR) +@ stdcall ScsiPortReadRegisterUshort(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_USHORT) +@ stdcall ScsiPortReadRegisterUlong(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_ULONG) +@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long) +@ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor +@ stdcall ScsiPortValidateRange(ptr long long long long long long) +@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_UCHAR) +@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_USHORT) +@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_ULONG) +@ stdcall ScsiPortWritePortUchar(ptr long) MAYBEFWD(HAL.WRITE_PORT_UCHAR) +@ stdcall ScsiPortWritePortUshort(ptr long) MAYBEFWD(HAL.WRITE_PORT_USHORT) +@ stdcall ScsiPortWritePortUlong(ptr long) MAYBEFWD(HAL.WRITE_PORT_ULONG) +@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR) +@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT) +@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG) +@ stdcall ScsiPortWriteRegisterUchar(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_UCHAR) +@ stdcall ScsiPortWriteRegisterUshort(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_USHORT) +@ stdcall ScsiPortWriteRegisterUlong(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_ULONG) diff --git a/reactos/drivers/storage/scsiport/scsiport.rbuild b/reactos/drivers/storage/scsiport/scsiport.rbuild index 81a67633467..6686e93c752 100644 --- a/reactos/drivers/storage/scsiport/scsiport.rbuild +++ b/reactos/drivers/storage/scsiport/scsiport.rbuild @@ -3,11 +3,12 @@ - + . ntoskrnl hal scsiport.c + stubs.c scsiport.rc - scsiport.spec + scsiport.pspec diff --git a/reactos/drivers/storage/scsiport/scsiport.spec b/reactos/drivers/storage/scsiport/scsiport.spec deleted file mode 100644 index b779b1ee557..00000000000 --- a/reactos/drivers/storage/scsiport/scsiport.spec +++ /dev/null @@ -1,45 +0,0 @@ -@ cdecl ScsiDebugPrint() -@ stdcall ScsiPortCompleteRequest(ptr long long long long) -@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long) -@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) NTOSKRNL.RtlConvertUlongToLargeInteger -@ stdcall ScsiPortFlushDma(ptr) -@ stdcall ScsiPortFreeDeviceBase(ptr ptr) -@ stdcall ScsiPortGetBusData(ptr long long long ptr long) -@ stdcall ScsiPortGetDeviceBase(ptr long long long long long long) -@ stdcall ScsiPortGetLogicalUnit(ptr long long long) -@ stdcall ScsiPortGetPhysicalAddress(ptr ptr ptr long) -@ stdcall ScsiPortGetSrb(ptr long long long long) -@ stdcall ScsiPortGetUncachedExtension(ptr ptr long) -@ stdcall ScsiPortGetVirtualAddress(ptr long long) -@ stdcall ScsiPortInitialize(ptr ptr ptr ptr) -@ stdcall ScsiPortIoMapTransfer(ptr ptr long long) -@ stdcall ScsiPortLogError(ptr ptr long long long long long) -@ stdcall ScsiPortMoveMemory(ptr ptr long) -@ cdecl ScsiPortNotification() -@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) HAL.READ_PORT_BUFFER_UCHAR -@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT -@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) HAL.READ_PORT_BUFFER_ULONG -@ stdcall ScsiPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR -@ stdcall ScsiPortReadPortUshort(ptr) HAL.READ_PORT_USHORT -@ stdcall ScsiPortReadPortUlong(ptr) HAL.READ_PORT_ULONG -@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_UCHAR -@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT -@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_ULONG -@ stdcall ScsiPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR -@ stdcall ScsiPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT -@ stdcall ScsiPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG -@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long) -@ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor -@ stdcall ScsiPortValidateRange(ptr long long long long long long) -@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) HAL.WRITE_PORT_BUFFER_UCHAR -@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) HAL.WRITE_PORT_BUFFER_USHORT -@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) HAL.WRITE_PORT_BUFFER_ULONG -@ stdcall ScsiPortWritePortUchar(ptr long) HAL.WRITE_PORT_UCHAR -@ stdcall ScsiPortWritePortUshort(ptr long) HAL.WRITE_PORT_USHORT -@ stdcall ScsiPortWritePortUlong(ptr long) HAL.WRITE_PORT_ULONG -@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR -@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT -@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG -@ stdcall ScsiPortWriteRegisterUchar(ptr long) NTOSKRNL.WRITE_REGISTER_UCHAR -@ stdcall ScsiPortWriteRegisterUshort(ptr long) NTOSKRNL.WRITE_REGISTER_USHORT -@ stdcall ScsiPortWriteRegisterUlong(ptr long) NTOSKRNL.WRITE_REGISTER_ULONG diff --git a/reactos/drivers/storage/scsiport/stubs.c b/reactos/drivers/storage/scsiport/stubs.c new file mode 100644 index 00000000000..9e286d186f4 --- /dev/null +++ b/reactos/drivers/storage/scsiport/stubs.c @@ -0,0 +1,250 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Storage Stack + * FILE: drivers/storage/scsiport/stubs.c + * PURPOSE: SCSI port driver + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include +#include + +#define NDEBUG +#include + +#ifdef _MSC_VER + #define DDKAPI +#endif + +SCSI_PHYSICAL_ADDRESS +DDKAPI +ScsiPortConvertUlongToPhysicalAddress( + IN ULONG UlongAddress) +{ + return RtlConvertUlongToLargeInteger(UlongAddress); +} + +VOID +DDKAPI +ScsiPortReadPortBufferUchar( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + READ_PORT_BUFFER_UCHAR(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadPortBufferUshort( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + READ_PORT_BUFFER_USHORT(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadPortBufferUlong( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + READ_PORT_BUFFER_ULONG(Port, Buffer, Count); +} + +UCHAR +DDKAPI +ScsiPortReadPortUchar( + IN PUCHAR Port) +{ + return READ_PORT_UCHAR(Port); +} + +USHORT +DDKAPI +ScsiPortReadPortUshort( + IN PUSHORT Port) +{ + return READ_PORT_USHORT(Port); +} + +ULONG +DDKAPI +ScsiPortReadPortUlong( + IN PULONG Port) +{ + return READ_PORT_ULONG(Port); +} + +VOID +DDKAPI +ScsiPortReadRegisterBufferUchar( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + READ_REGISTER_BUFFER_UCHAR(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadRegisterBufferUshort( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + READ_REGISTER_BUFFER_USHORT(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortReadRegisterBufferUlong( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + READ_REGISTER_BUFFER_ULONG(Register, Buffer, Count); +} + +UCHAR +DDKAPI +ScsiPortReadRegisterUchar( + IN PUCHAR Register) +{ + return READ_REGISTER_UCHAR(Register); +} + +USHORT +DDKAPI +ScsiPortReadRegisterUshort( + IN PUSHORT Register) +{ + return READ_REGISTER_USHORT(Register); +} + +ULONG +DDKAPI +ScsiPortReadRegisterUlong( + IN PULONG Register) +{ + return READ_REGISTER_ULONG(Register); +} + +VOID +DDKAPI +ScsiPortWritePortBufferUchar( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWritePortBufferUshort( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWritePortBufferUlong( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWritePortUchar( + IN PUCHAR Port, + IN UCHAR Value) +{ + WRITE_PORT_UCHAR(Port, Value); +} + +VOID +DDKAPI +ScsiPortWritePortUshort( + IN PUSHORT Port, + IN USHORT Value) +{ + WRITE_PORT_USHORT(Port, Value); +} + +VOID +DDKAPI +ScsiPortWritePortUlong( + IN PULONG Port, + IN ULONG Value) +{ + WRITE_PORT_ULONG(Port, Value); +} + +VOID +DDKAPI +ScsiPortWriteRegisterBufferUchar( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWriteRegisterBufferUshort( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWriteRegisterBufferUlong( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count); +} + +VOID +DDKAPI +ScsiPortWriteRegisterUchar( + IN PUCHAR Register, + IN ULONG Value) +{ + WRITE_REGISTER_UCHAR(Register, Value); +} + +VOID +DDKAPI +ScsiPortWriteRegisterUshort( + IN PUSHORT Register, + IN USHORT Value) +{ + WRITE_REGISTER_USHORT(Register, Value); +} + +VOID +DDKAPI +ScsiPortWriteRegisterUlong( + IN PULONG Register, + IN ULONG Value) +{ + WRITE_REGISTER_ULONG(Register, Value); +} + From f3177fc1185a47cab5d4ac6d58a36668d6175cc3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 6 Nov 2008 22:55:04 +0000 Subject: [PATCH 385/388] Don't strip symbolic information from files. In the near future rsym will convert it into Windows compatible unwind info. svn path=/branches/ros-amd64-bringup/; revision=37235 --- reactos/ReactOS-amd64.rbuild | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/ReactOS-amd64.rbuild b/reactos/ReactOS-amd64.rbuild index 3cb37da223f..46d9d728df4 100644 --- a/reactos/ReactOS-amd64.rbuild +++ b/reactos/ReactOS-amd64.rbuild @@ -46,7 +46,6 @@ -Wpointer-arith -Wno-uninitialized -enable-stdcall-fixup - -s -static From 99edb23b9829a064dd5debd04d6e24b03128db2a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 6 Nov 2008 23:05:42 +0000 Subject: [PATCH 386/388] Add DWARF debug sections to ntoskrnl linker script svn path=/branches/ros-amd64-bringup/; revision=37236 --- reactos/ntoskrnl/ntoskrnl_amd64.lnk | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/reactos/ntoskrnl/ntoskrnl_amd64.lnk b/reactos/ntoskrnl/ntoskrnl_amd64.lnk index 3db23c91f0a..4a1fb0a1251 100644 --- a/reactos/ntoskrnl/ntoskrnl_amd64.lnk +++ b/reactos/ntoskrnl/ntoskrnl_amd64.lnk @@ -101,5 +101,69 @@ SECTIONS { [ .stabstr ] } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section. Unlike other targets that fake this by putting the + section VMA at 0, the PE format will not allow it. */ + /* DWARF 1.1 and DWARF 2. */ + .debug_aranges BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_aranges) + } + .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_pubnames) + } + /* DWARF 2. */ + .debug_info BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_info) *(.gnu.linkonce.wi.*) + } + .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_abbrev) + } + .debug_line BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_line) + } + .debug_frame BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_frame) + } + .debug_str BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_str) + } + .debug_loc BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_loc) + } + .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_macinfo) + } + /* SGI/MIPS DWARF 2 extensions. */ + .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_weaknames) + } + .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_funcnames) + } + .debug_typenames BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_typenames) + } + .debug_varnames BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_varnames) + } + /* DWARF 3. */ + .debug_ranges BLOCK(__section_alignment__) (NOLOAD) : + { + *(.debug_ranges) + } } From f46779fc7df05668d0e3fffa5464db5e7376d919 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Mon, 10 Nov 2008 13:27:59 +0000 Subject: [PATCH 387/388] - Remove #ifdef _WIN64 hack in favor of __MINGW_GNUC_PREREQ for pragma macros. - Remove other hacks. - Sync to mingw-w64 trunk. - Prepare a bit for upcoming auto-import war (not _mingw.h) svn path=/branches/ros-amd64-bringup/; revision=37278 --- reactos/include/crt/_mingw.h | 35 ++++++++++++++++++++------------- reactos/include/crt/assert.h | 4 ++-- reactos/include/crt/dos.h | 8 ++++---- reactos/include/crt/fcntl.h | 3 +-- reactos/include/crt/io.h | 2 ++ reactos/include/crt/process.h | 20 +++++++++++-------- reactos/include/crt/share.h | 1 + reactos/include/crt/signal.h | 2 ++ reactos/include/crt/stdio.h | 28 +++++++++++++++++++------- reactos/include/crt/stdlib.h | 15 +++++++------- reactos/include/crt/sys/stat.h | 2 ++ reactos/include/crt/sys/types.h | 4 ++-- reactos/include/crt/sys/utime.h | 10 ++++++++-- reactos/include/crt/time.h | 19 ++++++------------ 14 files changed, 92 insertions(+), 61 deletions(-) diff --git a/reactos/include/crt/_mingw.h b/reactos/include/crt/_mingw.h index 7ee087789f4..d8e5f24e94a 100644 --- a/reactos/include/crt/_mingw.h +++ b/reactos/include/crt/_mingw.h @@ -15,6 +15,13 @@ #define MINGW64_VERSION_STATE "alpha" #endif +#ifdef _WIN64 +#ifdef __stdcall +#undef __stdcall +#endif +#define __stdcall +#endif + #ifndef __GNUC__ # ifndef __MINGW_IMPORT # define __MINGW_IMPORT __declspec(dllimport) @@ -46,12 +53,7 @@ limitations in handling dllimport attribute. */ # define _CRTIMP # endif # endif /* __declspec */ -# ifndef __cdecl -# define __cdecl __attribute__ ((__cdecl__)) -# endif -# ifndef __stdcall -# define __stdcall __attribute__ ((__stdcall__)) -# endif +#endif #if defined (__GNUC__) && defined (__GNUC_MINOR__) #define __MINGW_GNUC_PREREQ(major, minor) \ @@ -125,6 +127,17 @@ limitations in handling dllimport attribute. */ # define __MSVCRT_VERSION__ 0x0700 #endif +#if defined(__GNUC__) +#define __mingw_va_start(v,l) __builtin_va_start(v,l) +#define __mingw_va_end(v) __builtin_va_end(v) +#define __mingw_va_arg(v,l) __builtin_va_arg(v,l) +#define __mingw_va_copy(d,s) __builtin_va_copy(d,s) +#elif defined(_MSC_VER) +#define __mingw_va_start(v,l) __msc_va_start(v,l) +#define __mingw_va_end(v) __msc_va_end(v) +#define __mingw_va_arg(v,l) __msc_va_arg(v,l) +#define __mingw_va_copy(d,s) __msc_va_copy(d,s) +#endif //#ifndef WINVER //#define WINVER 0x0502 @@ -158,12 +171,6 @@ typedef int __int128 __attribute__ ((mode (TI))); #error Only Win32 target is supported! #endif -#if defined (__i386__) -#define _ATTRIBUTES -#else -#define _ATTRIBUTES shared -#endif - #ifdef __cplusplus #ifndef __nothrow #define __nothrow __declspec(nothrow) @@ -199,7 +206,6 @@ extern "C" { #define __CRT_WIDE(_String) L ## _String #define _CRT_WIDE(_String) __CRT_WIDE(_String) #endif - #ifndef _W64 #define _W64 #endif @@ -393,8 +399,10 @@ extern "C" { #ifndef _TIME64_T_DEFINED #define _TIME64_T_DEFINED +//#if _INTEGRAL_MAX_BITS >= 64 typedef __int64 __time64_t; #endif +//#endif #ifndef _TIME_T_DEFINED #define _TIME_T_DEFINED @@ -504,4 +512,3 @@ extern "C" { #pragma pack(pop) #endif -#endif diff --git a/reactos/include/crt/assert.h b/reactos/include/crt/assert.h index a486eb16aeb..6340dabad1a 100644 --- a/reactos/include/crt/assert.h +++ b/reactos/include/crt/assert.h @@ -28,12 +28,12 @@ __CRT_INLINE void __cdecl _Exit(int status) { _exit(status); } #endif -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma push_macro("abort") #undef abort #endif void __cdecl __declspec(noreturn) abort(void); -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma pop_macro("abort") #endif diff --git a/reactos/include/crt/dos.h b/reactos/include/crt/dos.h index 8530582c6ac..294e8fe1b49 100644 --- a/reactos/include/crt/dos.h +++ b/reactos/include/crt/dos.h @@ -38,10 +38,10 @@ extern "C" { _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); #endif -//#if (defined(_X86_) && !defined(__x86_64)) -// void __cdecl _disable(void); -// void __cdecl _enable(void); -//#endif +#if (defined(_X86_) && !defined(__x86_64)) + void __cdecl _disable(void); + void __cdecl _enable(void); +#endif #ifndef NO_OLDNAMES #define diskfree_t _diskfree_t diff --git a/reactos/include/crt/fcntl.h b/reactos/include/crt/fcntl.h index 993e21af0ae..a231484e2e3 100644 --- a/reactos/include/crt/fcntl.h +++ b/reactos/include/crt/fcntl.h @@ -13,8 +13,6 @@ #define _O_RDONLY 0x0000 #define _O_WRONLY 0x0001 #define _O_RDWR 0x0002 - -#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) #define _O_APPEND 0x0008 #define _O_CREAT 0x0100 #define _O_TRUNC 0x0200 @@ -24,6 +22,7 @@ #define _O_WTEXT 0x10000 #define _O_U16TEXT 0x20000 #define _O_U8TEXT 0x40000 +#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) #define _O_RAW _O_BINARY #define _O_NOINHERIT 0x0080 diff --git a/reactos/include/crt/io.h b/reactos/include/crt/io.h index 552dc47cf91..a3c94c6a9f7 100644 --- a/reactos/include/crt/io.h +++ b/reactos/include/crt/io.h @@ -388,7 +388,9 @@ extern "C" { /* Misc stuff */ char *getlogin(void); +#ifdef __USE_MINGW_ALARM unsigned int alarm(unsigned int seconds); +#endif #ifdef __USE_MINGW_ACCESS /* Old versions of MSVCRT access() just ignored X_OK, while the version diff --git a/reactos/include/crt/process.h b/reactos/include/crt/process.h index f5ceabd0029..dd273edb4ff 100644 --- a/reactos/include/crt/process.h +++ b/reactos/include/crt/process.h @@ -36,12 +36,12 @@ extern "C" { __declspec(noreturn) void __cdecl exit(int _Code); _CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code); -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma push_macro("abort") #undef abort #endif void __cdecl __declspec(noreturn) abort(void); -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma pop_macro("abort") #undef abort #endif @@ -136,7 +136,17 @@ extern "C" { #define WAIT_GRANDCHILD _WAIT_GRANDCHILD intptr_t __cdecl cwait(int *_TermStat,intptr_t _ProcHandle,int _Action); +#ifdef __GNUC__ + int __cdecl execl(const char *_Filename,const char *_ArgList,...); + int __cdecl execle(const char *_Filename,const char *_ArgList,...); + int __cdecl execlp(const char *_Filename,const char *_ArgList,...); + int __cdecl execlpe(const char *_Filename,const char *_ArgList,...); +#else + intptr_t __cdecl execl(const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl execle(const char *_Filename,const char *_ArgList,...); + intptr_t __cdecl execlp(const char *_Filename,const char *_ArgList,...); intptr_t __cdecl execlpe(const char *_Filename,const char *_ArgList,...); +#endif intptr_t __cdecl spawnl(int,const char *_Filename,const char *_ArgList,...); intptr_t __cdecl spawnle(int,const char *_Filename,const char *_ArgList,...); intptr_t __cdecl spawnlp(int,const char *_Filename,const char *_ArgList,...); @@ -147,17 +157,11 @@ extern "C" { stupid warnings, define them in POSIX way. This is save, because those methods do not return in success case, so that the return value is not really dependent to its scalar width. */ - int __cdecl execl(const char *_Filename,const char *_ArgList,...); - int __cdecl execle(const char *_Filename,const char *_ArgList,...); - int __cdecl execlp(const char *_Filename,const char *_ArgList,...); int __cdecl execv(const char *_Filename,char *const _ArgList[]); int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]); int __cdecl execvp(const char *_Filename,char *const _ArgList[]); int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]); #else - intptr_t __cdecl execlp(const char *_Filename,const char *_ArgList,...); - intptr_t __cdecl execl(const char *_Filename,const char *_ArgList,...); - intptr_t __cdecl execle(const char *_Filename,const char *_ArgList,...); intptr_t __cdecl execv(const char *_Filename,char *const _ArgList[]); intptr_t __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]); intptr_t __cdecl execvp(const char *_Filename,char *const _ArgList[]); diff --git a/reactos/include/crt/share.h b/reactos/include/crt/share.h index 14b2772c40e..dd7eb60582d 100644 --- a/reactos/include/crt/share.h +++ b/reactos/include/crt/share.h @@ -18,6 +18,7 @@ #define _SH_SECURE 0x80 #ifndef NO_OLDNAMES +#define SH_COMPAT _SH_COMPAT #define SH_DENYRW _SH_DENYRW #define SH_DENYWR _SH_DENYWR #define SH_DENYRD _SH_DENYRD diff --git a/reactos/include/crt/signal.h b/reactos/include/crt/signal.h index 6e9c79734c6..a518f6b311b 100644 --- a/reactos/include/crt/signal.h +++ b/reactos/include/crt/signal.h @@ -33,7 +33,9 @@ extern "C" { #define SIGSEGV 11 #define SIGSYS 12 /* bad argument to system call */ #define SIGPIPE 13 /* write on a pipe with no one to read it */ +#ifdef __USE_MINGW_ALARM #define SIGALRM 14 /* alarm clock */ +#endif #define SIGTERM 15 #define SIGBREAK 21 #define SIGABRT2 22 diff --git a/reactos/include/crt/stdio.h b/reactos/include/crt/stdio.h index 12cbb6866db..efb2fff3662 100644 --- a/reactos/include/crt/stdio.h +++ b/reactos/include/crt/stdio.h @@ -239,7 +239,7 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ int __cdecl vfprintf(FILE *_File,const char *_Format,va_list _ArgList); int __cdecl vprintf(const char *_Format,va_list _ArgList); /* Make sure macros are not defined. */ -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma push_macro("vsnprintf") #pragma push_macro("snprintf") #undef vsnprintf @@ -261,16 +261,23 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ int __cdecl sprintf(char *_Dest,const char *_Format,...); int __cdecl vsprintf(char *_Dest,const char *_Format,va_list _Args); #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ - int __cdecl snprintf(char* s, size_t n, const char* format, ...); + __CRT_INLINE int __cdecl snprintf(char* s, size_t n, const char* format, ...) { + int r; + va_list a; + __mingw_va_start(a, format); + r = _vsnprintf (s, n, format, a); + __mingw_va_end(a); + return r; + } __CRT_INLINE int __cdecl vsnprintf (char* s, size_t n, const char* format,va_list arg) { return _vsnprintf ( s, n, format, arg); } - int __cdecl vscanf(const char * Format, va_list argp); - int __cdecl vfscanf (FILE * fp, const char * Format,va_list argp); - int __cdecl vsscanf (const char * _Str,const char * Format,va_list argp); + int __cdecl vscanf(const char * __restrict__ Format, va_list argp); + int __cdecl vfscanf (FILE * __restrict__ fp, const char * Format,va_list argp); + int __cdecl vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp); #endif /* Restore may prior defined macros snprintf/vsnprintf. */ -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma pop_macro("snprintf") #pragma pop_macro("vsnprintf") #endif @@ -331,7 +338,14 @@ extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...); _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args); #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ - int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); + __CRT_INLINE int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...) { + int r; + va_list a; + __mingw_va_start(a, format); + r = _vsnwprintf (s, n, format, a); + __mingw_va_end(a); + return r; + } __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) { return _vsnwprintf(s,n,format,arg); } int __cdecl vwscanf (const wchar_t *, va_list); int __cdecl vfwscanf (FILE *,const wchar_t *,va_list); diff --git a/reactos/include/crt/stdlib.h b/reactos/include/crt/stdlib.h index 274b8411401..b74bd40a6d2 100644 --- a/reactos/include/crt/stdlib.h +++ b/reactos/include/crt/stdlib.h @@ -68,7 +68,7 @@ extern "C" { typedef struct { float f; } _CRT_FLOAT; -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma push_macro("long") #undef long #endif @@ -77,7 +77,7 @@ extern "C" { long double x; } _LONGDOUBLE; -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma pop_macro("long") #endif @@ -313,12 +313,12 @@ extern "C" { __CRT_INLINE void __cdecl _Exit(int status) { _exit(status); } #endif -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma push_macro("abort") #undef abort #endif void __cdecl __declspec(noreturn) abort(void); -#ifdef _WIN64 //hack for old gcc in ROSBE +#if __MINGW_GNUC_PREREQ(4,4) #pragma pop_macro("abort") #endif #endif @@ -357,7 +357,7 @@ extern "C" { div_t __cdecl div(int _Numerator,int _Denominator); char *__cdecl getenv(const char *_VarName); _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix); - +/* #if _INTEGRAL_MAX_BITS >= 64 */ _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix); _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix); _CRTIMP __int64 __cdecl _atoi64(const char *_String); @@ -366,7 +366,7 @@ extern "C" { _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale); _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix); _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale); - +/* #endif */ ldiv_t __cdecl ldiv(long _Numerator,long _Denominator); _CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix); int __cdecl mblen(const char *_Ch,size_t _MaxCount); @@ -448,6 +448,7 @@ extern "C" { _CRTIMP long __cdecl _wtol(const wchar_t *_Str); _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale); +/* #if _INTEGRAL_MAX_BITS >= 64 */ _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix); _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix); _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str); @@ -456,7 +457,7 @@ extern "C" { _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); - +/* #endif */ #endif #ifndef _POSIX_ diff --git a/reactos/include/crt/sys/stat.h b/reactos/include/crt/sys/stat.h index bababc7e6d6..cc9b8398f76 100644 --- a/reactos/include/crt/sys/stat.h +++ b/reactos/include/crt/sys/stat.h @@ -115,6 +115,7 @@ extern "C" { }; #endif +/* #if _INTEGRAL_MAX_BITS >= 64 */ struct _stat32i64 { _dev_t st_dev; _ino_t st_ino; @@ -156,6 +157,7 @@ extern "C" { __time64_t st_mtime; __time64_t st_ctime; }; +/* #endif */ #define __stat64 _stat64 diff --git a/reactos/include/crt/sys/types.h b/reactos/include/crt/sys/types.h index a09f28ee859..5b474927af2 100644 --- a/reactos/include/crt/sys/types.h +++ b/reactos/include/crt/sys/types.h @@ -15,11 +15,9 @@ #ifdef _USE_32BIT_TIME_T #ifdef _WIN64 #undef _USE_32BIT_TIME_T -#define _USE_64BIT_TIME_T #endif #else #if _INTEGRAL_MAX_BITS < 64 -#undef _USE_64BIT_TIME_T #define _USE_32BIT_TIME_T #endif #endif @@ -31,8 +29,10 @@ typedef long __time32_t; #ifndef _TIME64_T_DEFINED #define _TIME64_T_DEFINED +#if _INTEGRAL_MAX_BITS >= 64 typedef __int64 __time64_t; #endif +#endif #ifndef _TIME_T_DEFINED #define _TIME_T_DEFINED diff --git a/reactos/include/crt/sys/utime.h b/reactos/include/crt/sys/utime.h index 4722cb9a475..0fbbc906320 100644 --- a/reactos/include/crt/sys/utime.h +++ b/reactos/include/crt/sys/utime.h @@ -71,10 +71,12 @@ extern "C" { __time32_t modtime; }; +#if _INTEGRAL_MAX_BITS >= 64 struct __utimbuf64 { __time64_t actime; __time64_t modtime; }; +#endif #ifndef NO_OLDNAMES struct utimbuf { @@ -92,11 +94,14 @@ extern "C" { _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time); _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time); _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time); +#if _INTEGRAL_MAX_BITS >= 64 _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time); _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time); _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time); +#endif #ifndef RC_INVOKED +#ifdef _USE_32BIT_TIME_T __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); } @@ -106,7 +111,7 @@ __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf); } -#elif defined(_USE_64BIT_TIME_T) +#else __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); } @@ -116,9 +121,10 @@ __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf); } +#endif #ifndef NO_OLDNAMES -#ifndef _WIN64 +#ifdef _USE_32BIT_TIME_T __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); } diff --git a/reactos/include/crt/time.h b/reactos/include/crt/time.h index 6aa7d9dc6e2..5e72a78e383 100644 --- a/reactos/include/crt/time.h +++ b/reactos/include/crt/time.h @@ -99,7 +99,7 @@ extern "C" { #define _ctime32 ctime #define _gmtime32 gmtime #define _mktime32 mktime -#define _time32 _time +#define _time32 time #endif #ifndef _TM_DEFINED @@ -147,6 +147,7 @@ extern "C" { _CRTIMP void __cdecl _tzset(void); #endif +#if _INTEGRAL_MAX_BITS >= 64 double __cdecl _difftime64(__time64_t _Time1,__time64_t _Time2); _CRTIMP char *__cdecl _ctime64(const __time64_t *_Time); _CRTIMP struct tm *__cdecl _gmtime64(const __time64_t *_Time); @@ -154,7 +155,7 @@ extern "C" { _CRTIMP __time64_t __cdecl _mktime64(struct tm *_Tm); _CRTIMP __time64_t __cdecl _mkgmtime64(struct tm *_Tm); _CRTIMP __time64_t __cdecl _time64(__time64_t *_Time); - +#endif unsigned __cdecl _getsystime(struct tm *_Tm); unsigned __cdecl _setsystime(struct tm *_Tm,unsigned _MilliSec); @@ -191,7 +192,9 @@ extern "C" { _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale); _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer); _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer); +#if _INTEGRAL_MAX_BITS >= 64 _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time); +#endif #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) #define _INC_WTIME_INL @@ -206,25 +209,15 @@ __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_T #endif #ifndef RC_INVOKED -double __cdecl difftime(time_t _Time1,time_t _Time2); -char *__cdecl ctime(const time_t *_Time); -struct tm *__cdecl gmtime(const time_t *_Time); -struct tm *__cdecl localtime(const time_t *_Time); -struct tm *__cdecl localtime_r(const time_t *_Time,struct tm *); - -time_t __cdecl mktime(struct tm *_Tm); -time_t __cdecl _mkgmtime(struct tm *_Tm); -time_t __cdecl time(time_t *_Time); #ifdef _USE_32BIT_TIME_T -#if 0 __CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); } __CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime32(_Time); } __CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime32(_Time); } +__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return _localtime32(_Time); } __CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime32(_Tm); } __CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime32(_Tm); } __CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time32(_Time); } -#endif #else __CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime64(_Time1,_Time2); } __CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime64(_Time); } From 520d8e7c94c842d0790a94014be6470d25852e82 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 10 Nov 2008 14:55:23 +0000 Subject: [PATCH 388/388] give rsym it's own directory svn path=/branches/ros-amd64-bringup/; revision=37282 --- reactos/tools/{ => rsym}/rsym.c | 0 reactos/tools/{ => rsym}/rsym.h | 0 reactos/tools/{ => rsym}/rsym.mak | 13 +++++++++++-- reactos/tools/{ => rsym}/rsym_common.c | 0 reactos/tools/tools.mak | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) rename reactos/tools/{ => rsym}/rsym.c (100%) rename reactos/tools/{ => rsym}/rsym.h (100%) rename reactos/tools/{ => rsym}/rsym.mak (84%) rename reactos/tools/{ => rsym}/rsym_common.c (100%) diff --git a/reactos/tools/rsym.c b/reactos/tools/rsym/rsym.c similarity index 100% rename from reactos/tools/rsym.c rename to reactos/tools/rsym/rsym.c diff --git a/reactos/tools/rsym.h b/reactos/tools/rsym/rsym.h similarity index 100% rename from reactos/tools/rsym.h rename to reactos/tools/rsym/rsym.h diff --git a/reactos/tools/rsym.mak b/reactos/tools/rsym/rsym.mak similarity index 84% rename from reactos/tools/rsym.mak rename to reactos/tools/rsym/rsym.mak index 527e548f275..5cd46b93e0b 100644 --- a/reactos/tools/rsym.mak +++ b/reactos/tools/rsym/rsym.mak @@ -1,11 +1,20 @@ -RSYM_BASE = $(TOOLS_BASE) +RSYM_BASE = $(TOOLS_BASE)$(SEP)rsym RSYM_BASE_ = $(RSYM_BASE)$(SEP) - RSYM_INT = $(INTERMEDIATE_)$(RSYM_BASE) RSYM_INT_ = $(RSYM_INT)$(SEP) RSYM_OUT = $(OUTPUT_)$(RSYM_BASE) RSYM_OUT_ = $(RSYM_OUT)$(SEP) +$(RSYM_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RSYM_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + RSYM_TARGET = \ $(RSYM_OUT_)rsym$(EXEPOSTFIX) diff --git a/reactos/tools/rsym_common.c b/reactos/tools/rsym/rsym_common.c similarity index 100% rename from reactos/tools/rsym_common.c rename to reactos/tools/rsym/rsym_common.c diff --git a/reactos/tools/tools.mak b/reactos/tools/tools.mak index 256ce7a09e8..88929374c44 100644 --- a/reactos/tools/tools.mak +++ b/reactos/tools/tools.mak @@ -50,4 +50,4 @@ include tools/nci/nci.mak include tools/pefixup.mak include tools/raddr2line.mak include tools/rbuild/rbuild.mak -include tools/rsym.mak +include tools/rsym/rsym.mak