NO CODE CHANGE

[KERNEL32]: Final part of the re-structure: move the last few files from "misc" into "client". Now "misc" is mostly composed of Wine-based code (which will soon by Winesynched) that provides functionality such as INI, .rsrc parsing and LZip expansion, as well as the RS232-based APIs. The rest of "client" is NT-layer glue, much of it buggy and in need of help.
[KERNEL32]: Move "Beep" from environ.c to deviceio.c... seems to make more sense there.
[KERNEL32]: Set kernel32_handle since Wine-synched code will depend on this.
[KERNEL32]: Link with winelib, don't link with normaliz anymore.

svn path=/trunk/; revision=52752
This commit is contained in:
Alex Ionescu 2011-07-21 02:55:56 +00:00
parent fcd58d94bb
commit 2d6abdac2d
16 changed files with 114 additions and 117 deletions

View file

@ -11,15 +11,28 @@ set_rc_compiler()
spec2def(kernel32.dll kernel32.spec)
list(APPEND SOURCE
client/atom.c
client/compname.c
client/debugger.c
client/dllmain.c
client/environ.c
client/except.c
client/fiber.c
client/handle.c
client/heapmem.c
client/job.c
client/loader.c
client/perfcnt.c
client/power.c
client/proc.c
client/resntfy.c
client/session.c
client/synch.c
client/sysinfo.c
client/timerqueue.c
client/utils.c
client/thread.c
client/version.c
client/virtmem.c
client/vista.c
client/file/backup.c
@ -48,28 +61,15 @@ list(APPEND SOURCE
client/file/tape.c
client/file/volume.c
client/misc/actctx.c
client/misc/atom.c
client/misc/comm.c
client/misc/commdcb.c
client/misc/computername.c
client/misc/dllmain.c
client/misc/env.c
client/misc/handle.c
client/misc/ldr.c
client/misc/lzexpand.c
client/misc/muldiv.c
client/misc/perfcnt.c
client/misc/power.c
client/misc/profile.c
client/misc/res.c
client/misc/resntfy.c
client/misc/stubs.c
client/misc/sysinfo.c
client/misc/time.c
client/misc/timerqueue.c
client/misc/toolhelp.c
client/misc/utils.c
client/misc/version.c
winnls/string/casemap.c
winnls/string/chartype.c
winnls/string/collation.c
@ -98,7 +98,7 @@ add_library(kernel32 SHARED ${SOURCE})
set_entrypoint(kernel32 DllMain@12)
set_image_base(kernel32 ${baseaddress_kernel32})
target_link_libraries(kernel32 chkstk ${PSEH_LIB})
target_link_libraries(kernel32 wine chkstk ${PSEH_LIB})
add_importlibs(kernel32 ntdll)
add_pch(kernel32 k32.h)

View file

@ -26,6 +26,7 @@ WCHAR BaseDefaultPathBuffer[6140];
HANDLE hProcessHeap = NULL;
HMODULE hCurrentModule = NULL;
HMODULE kernel32_handle = NULL;
HANDLE hBaseDir = NULL;
PPEB Peb;
ULONG SessionId;
@ -323,7 +324,7 @@ DllMain(HANDLE hDll,
RtlInitializeHandleTable(0xFFFF,
sizeof(BASE_HEAP_HANDLE_ENTRY),
&BaseHeapHandleTable);
hCurrentModule = hDll;
kernel32_handle = hCurrentModule = hDll;
DPRINT("Heap: %p\n", hProcessHeap);
/*

View file

@ -19,85 +19,6 @@
/* FUNCTIONS ******************************************************************/
/*
* @implemented
*/
BOOL
WINAPI
Beep (DWORD dwFreq, DWORD dwDuration)
{
HANDLE hBeep;
UNICODE_STRING BeepDevice;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
BEEP_SET_PARAMETERS BeepSetParameters;
NTSTATUS Status;
/* check the parameters */
if ((dwFreq >= 0x25 && dwFreq <= 0x7FFF) ||
(dwFreq == 0x0 && dwDuration == 0x0))
{
/* open the device */
RtlInitUnicodeString(&BeepDevice,
L"\\Device\\Beep");
InitializeObjectAttributes(&ObjectAttributes,
&BeepDevice,
0,
NULL,
NULL);
Status = NtCreateFile(&hBeep,
FILE_READ_DATA | FILE_WRITE_DATA,
&ObjectAttributes,
&IoStatusBlock,
NULL,
0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_OPEN_IF,
0,
NULL,
0);
if (NT_SUCCESS(Status))
{
/* Set beep data */
BeepSetParameters.Frequency = dwFreq;
BeepSetParameters.Duration = dwDuration;
Status = NtDeviceIoControlFile(hBeep,
NULL,
NULL,
NULL,
&IoStatusBlock,
IOCTL_BEEP_SET,
&BeepSetParameters,
sizeof(BEEP_SET_PARAMETERS),
NULL,
0);
/* do an alertable wait if necessary */
if (NT_SUCCESS(Status) &&
(dwFreq != 0x0 || dwDuration != 0x0) && dwDuration != MAXDWORD)
{
SleepEx(dwDuration,
TRUE);
}
NtClose(hBeep);
}
}
else
Status = STATUS_INVALID_PARAMETER;
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus (Status);
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/

View file

@ -14,6 +14,85 @@
/* FUNCTIONS ******************************************************************/
/*
* @implemented
*/
BOOL
WINAPI
Beep (DWORD dwFreq, DWORD dwDuration)
{
HANDLE hBeep;
UNICODE_STRING BeepDevice;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
BEEP_SET_PARAMETERS BeepSetParameters;
NTSTATUS Status;
/* check the parameters */
if ((dwFreq >= 0x25 && dwFreq <= 0x7FFF) ||
(dwFreq == 0x0 && dwDuration == 0x0))
{
/* open the device */
RtlInitUnicodeString(&BeepDevice,
L"\\Device\\Beep");
InitializeObjectAttributes(&ObjectAttributes,
&BeepDevice,
0,
NULL,
NULL);
Status = NtCreateFile(&hBeep,
FILE_READ_DATA | FILE_WRITE_DATA,
&ObjectAttributes,
&IoStatusBlock,
NULL,
0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_OPEN_IF,
0,
NULL,
0);
if (NT_SUCCESS(Status))
{
/* Set beep data */
BeepSetParameters.Frequency = dwFreq;
BeepSetParameters.Duration = dwDuration;
Status = NtDeviceIoControlFile(hBeep,
NULL,
NULL,
NULL,
&IoStatusBlock,
IOCTL_BEEP_SET,
&BeepSetParameters,
sizeof(BEEP_SET_PARAMETERS),
NULL,
0);
/* do an alertable wait if necessary */
if (NT_SUCCESS(Status) &&
(dwFreq != 0x0 || dwDuration != 0x0) && dwDuration != MAXDWORD)
{
SleepEx(dwDuration,
TRUE);
}
NtClose(hBeep);
}
}
else
Status = STATUS_INVALID_PARAMETER;
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus (Status);
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/

View file

@ -7,16 +7,12 @@
<include base="kernel32">include</include>
<include base="ReactOS">include/reactos/subsys</include>
<library>pseh</library>
<library>normalize</library>
<library>wine</library>
<library>ntdll</library>
<define name="_KERNEL32_" />
<redefine name="_WIN32_WINNT">0x0600</redefine>
<dependency>errcodes</dependency>
<pch>k32.h</pch>
<group compilerset="gcc">
<compilerflag compiler="cxx">-fno-exceptions</compilerflag>
<compilerflag compiler="cxx">-fno-rtti</compilerflag>
</group>
<directory name="client">
<if property="ARCH" value="i386">
<directory name="i386">
@ -30,17 +26,30 @@
<file>thread.S</file>
</directory>
</if>
<file>atom.c</file>
<file>compname.c</file>
<file>debugger.c</file>
<file>dllmain.c</file>
<file>environ.c</file>
<file>except.c</file>
<file>vista.c</file>
<file>synch.c</file>
<file>fiber.c</file>
<file>thread.c</file>
<file>handle.c</file>
<file>heapmem.c</file>
<file>virtmem.c</file>
<file>job.c</file>
<file>loader.c</file>
<file>perfcnt.c</file>
<file>power.c</file>
<file>proc.c</file>
<file>resntfy.c</file>
<file>session.c</file>
<file>synch.c</file>
<file>sysinfo.c</file>
<file>timerqueue.c</file>
<file>thread.c</file>
<file>utils.c</file>
<file>version.c</file>
<file>virtmem.c</file>
<file>vista.c</file>
<directory name="file">
<file>backup.c</file>
<file>bintype.c</file>
@ -70,28 +79,15 @@
</directory>
<directory name="misc">
<file>actctx.c</file>
<file>atom.c</file>
<file>comm.c</file>
<file>commdcb.c</file>
<file>computername.c</file>
<file>dllmain.c</file>
<file>env.c</file>
<file>handle.c</file>
<file>ldr.c</file>
<file>lzexpand.c</file>
<file>muldiv.c</file>
<file>perfcnt.c</file>
<file>power.c</file>
<file>resntfy.c</file>
<file>profile.c</file>
<file>res.c</file>
<file>stubs.c</file>
<file>sysinfo.c</file>
<file>time.c</file>
<file>timerqueue.c</file>
<file>toolhelp.c</file>
<file>version.c</file>
<file>profile.c</file>
<file>utils.c</file>
</directory>
</directory>
<directory name="winnls">