diff --git a/reactos/include/psdk/clusapi.h b/reactos/include/psdk/clusapi.h index 6f07409deb1..c0072487e60 100644 --- a/reactos/include/psdk/clusapi.h +++ b/reactos/include/psdk/clusapi.h @@ -1,16 +1,16 @@ -#ifndef _CLUSAPI_H +#ifndef _CLUSAPI_H #define _CLUSAPI_H #ifdef __cplusplus extern "C" { #endif -DWORD -WINAPI -GetNodeClusterState( - IN LPCWSTR lpszNodeName, - OUT DWORD *pdwClusterState +DWORD +WINAPI +GetNodeClusterState( + IN LPCWSTR lpszNodeName, + OUT DWORD *pdwClusterState ); #ifdef __cplusplus diff --git a/reactos/include/psdk/common.ver b/reactos/include/psdk/common.ver index 3295b44320c..1b5cd9a1dd0 100644 --- a/reactos/include/psdk/common.ver +++ b/reactos/include/psdk/common.ver @@ -1,207 +1,207 @@ -/* - * PROJECT: ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: include/psdk/common.ver - * PURPOSE: Common Version File. - * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) - */ - -// -// Copyright Year -// -#ifndef VER_LEGALCOPYRIGHT_YEARS -#define VER_LEGALCOPYRIGHT_YEARS "2007" -#endif - -// -// Copyright String -// -#ifndef VER_LEGALCOPYRIGHT_STR -#if defined(RC_INVOKED) && !defined(WIN16) -#define VER_LEGALCOPYRIGHT_STR L"\251 ReactOS Foundation. All rights reserved." -#else -#define VER_LEGALCOPYRIGHT_STR "Copyright (c) ReactOS Foundation. All rights reserved." -#endif -#endif - -// -// Product Name String -// -#ifndef VER_PRODUCTNAME_STR -#ifdef RC_INVOKED -#define VER_PRODUCTNAME_STR L"ReactOS\256 Operating System" -#else -#define VER_PRODUCTNAME_STR "ReactOS (R) Operating System" -#endif -#endif - -// -// The File Version is the same as the Product Version -// -#ifndef VER_FILEVERSION -#define VER_FILEVERSION VER_PRODUCTVERSION -#endif -#ifndef VER_FILEVERSION_STR -#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#endif - -// -// If no Original Name was given, use the Internal NAme -// -#ifndef VER_ORIGINALFILENAME_STR -#define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR -#endif - -// -// Allow tagging a Build by Machine/Date -// -#if defined(__BUILDMACHINE__) -#if defined(__BUILDDATE__) -#define B2(x,y) " (" #x "." #y ")" -#define B1(x,y) B2(x, y) -#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__, __BUILDDATE__) -#else -#define B2(x) " built by: " #x -#define B1(x) B2(x) -#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__) -#endif -#if defined(__BUILDMACHINE_LEN__) -#if __BUILDMACHINE_LEN__ >= 25 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#elif __BUILDMACHINE_LEN__ == 24 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 23 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 22 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 21 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 20 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 19 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 18 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 17 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 16 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 15 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 14 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 13 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 12 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 11 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 10 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 9 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 8 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 7 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 6 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 5 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 4 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 3 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 2 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 1 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#else -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#endif -#else -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#endif -#else -#define BUILD_MACHINE_TAG -#define BUILD_MACHINE_TAG_PADDED -#endif - -// -// Set default neutral Unicode Language ID -// -#ifndef VER_VERSION_UNICODE_LANG -#define VER_VERSION_UNICODE_LANG "000004B0" -#endif - -// -// Set default netural ANSI Language ID -// -#ifndef VER_VERSION_ANSI_LANG -#define VER_VERSION_ANSI_LANG "000004E4" -#endif - -// -// Set default netural translation ID -// -#ifndef VER_VERSION_TRANSLATION -#define VER_VERSION_TRANSLATION 0x0000, 0x04B0 -#endif - -// -// Make sure the Resource Compiler called us. -// If so, then build the actual version resource. -// -#ifdef RC_INVOKED - -VS_VERSION_INFO VERSIONINFO -FILEVERSION VER_FILEVERSION -PRODUCTVERSION VER_PRODUCTVERSION -FILEFLAGSMASK VER_FILEFLAGSMASK -FILEFLAGS VER_FILEFLAGS -FILEOS VER_FILEOS -FILETYPE VER_FILETYPE -FILESUBTYPE VER_FILESUBTYPE -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK VER_VERSION_UNICODE_LANG - BEGIN - VALUE "CompanyName", VER_COMPANYNAME_STR - VALUE "FileDescription", VER_FILEDESCRIPTION_STR - VALUE "FileVersion", VER_FILEVERSION_STR BUILD_MACHINE_TAG_PADDED - VALUE "InternalName", VER_INTERNALNAME_STR - VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR - VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR - VALUE "ProductName", VER_PRODUCTNAME_STR - VALUE "ProductVersion", VER_PRODUCTVERSION_STR -#ifdef VER_OLESELFREGISTER - VALUE "OleSelfRegister", "\0" -#endif - END - -#ifdef VER_ANSICP - BLOCK VER_VERSION_ANSI_LANG - BEGIN - VALUE "CompanyName", VER_COMPANYNAME_STR - VALUE "FileDescription", VER_FILEDESCRIPTION_STR EXPORT_TAG - VALUE "FileVersion", VER_FILEVERSION_STR - VALUE "InternalName", VER_INTERNALNAME_STR - VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR - VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR - VALUE "ProductName", VER_PRODUCTNAME_STR - VALUE "ProductVersion", VER_PRODUCTVERSION_STR -#ifdef VER_OLESELFREGISTER - VALUE "OleSelfRegister", "\0" -#endif - END -#endif - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", VER_VERSION_TRANSLATION - END -END - -#endif +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/psdk/common.ver + * PURPOSE: Common Version File. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +// +// Copyright Year +// +#ifndef VER_LEGALCOPYRIGHT_YEARS +#define VER_LEGALCOPYRIGHT_YEARS "2007" +#endif + +// +// Copyright String +// +#ifndef VER_LEGALCOPYRIGHT_STR +#if defined(RC_INVOKED) && !defined(WIN16) +#define VER_LEGALCOPYRIGHT_STR L"\251 ReactOS Foundation. All rights reserved." +#else +#define VER_LEGALCOPYRIGHT_STR "Copyright (c) ReactOS Foundation. All rights reserved." +#endif +#endif + +// +// Product Name String +// +#ifndef VER_PRODUCTNAME_STR +#ifdef RC_INVOKED +#define VER_PRODUCTNAME_STR L"ReactOS\256 Operating System" +#else +#define VER_PRODUCTNAME_STR "ReactOS (R) Operating System" +#endif +#endif + +// +// The File Version is the same as the Product Version +// +#ifndef VER_FILEVERSION +#define VER_FILEVERSION VER_PRODUCTVERSION +#endif +#ifndef VER_FILEVERSION_STR +#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR +#endif + +// +// If no Original Name was given, use the Internal NAme +// +#ifndef VER_ORIGINALFILENAME_STR +#define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR +#endif + +// +// Allow tagging a Build by Machine/Date +// +#if defined(__BUILDMACHINE__) +#if defined(__BUILDDATE__) +#define B2(x,y) " (" #x "." #y ")" +#define B1(x,y) B2(x, y) +#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__, __BUILDDATE__) +#else +#define B2(x) " built by: " #x +#define B1(x) B2(x) +#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__) +#endif +#if defined(__BUILDMACHINE_LEN__) +#if __BUILDMACHINE_LEN__ >= 25 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG +#elif __BUILDMACHINE_LEN__ == 24 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 23 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 22 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 21 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 20 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 19 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 18 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 17 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 16 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 15 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 14 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 13 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 12 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 11 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 10 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 9 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 8 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 7 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 6 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 5 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 4 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 3 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 2 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 1 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#else +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG +#endif +#else +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG +#endif +#else +#define BUILD_MACHINE_TAG +#define BUILD_MACHINE_TAG_PADDED +#endif + +// +// Set default neutral Unicode Language ID +// +#ifndef VER_VERSION_UNICODE_LANG +#define VER_VERSION_UNICODE_LANG "000004B0" +#endif + +// +// Set default netural ANSI Language ID +// +#ifndef VER_VERSION_ANSI_LANG +#define VER_VERSION_ANSI_LANG "000004E4" +#endif + +// +// Set default netural translation ID +// +#ifndef VER_VERSION_TRANSLATION +#define VER_VERSION_TRANSLATION 0x0000, 0x04B0 +#endif + +// +// Make sure the Resource Compiler called us. +// If so, then build the actual version resource. +// +#ifdef RC_INVOKED + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_PRODUCTVERSION +FILEFLAGSMASK VER_FILEFLAGSMASK +FILEFLAGS VER_FILEFLAGS +FILEOS VER_FILEOS +FILETYPE VER_FILETYPE +FILESUBTYPE VER_FILESUBTYPE +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK VER_VERSION_UNICODE_LANG + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR + VALUE "FileVersion", VER_FILEVERSION_STR BUILD_MACHINE_TAG_PADDED + VALUE "InternalName", VER_INTERNALNAME_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_PRODUCTVERSION_STR +#ifdef VER_OLESELFREGISTER + VALUE "OleSelfRegister", "\0" +#endif + END + +#ifdef VER_ANSICP + BLOCK VER_VERSION_ANSI_LANG + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR EXPORT_TAG + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "InternalName", VER_INTERNALNAME_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_PRODUCTVERSION_STR +#ifdef VER_OLESELFREGISTER + VALUE "OleSelfRegister", "\0" +#endif + END +#endif + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", VER_VERSION_TRANSLATION + END +END + +#endif diff --git a/reactos/include/psdk/cryptuiapi.h b/reactos/include/psdk/cryptuiapi.h index a8d7f09cbb6..10575abb0db 100644 --- a/reactos/include/psdk/cryptuiapi.h +++ b/reactos/include/psdk/cryptuiapi.h @@ -1,13 +1,13 @@ - -typedef struct _CRYPTUI_CERT_MGR_STRUCT { - DWORD dwSize; - HWND hwndParent; - DWORD dwFlags; - LPCWSTR pwszTitle; - LPCSTR pszInitUsageOID; -} CRYPTUI_CERT_MGR_STRUCT, - *PCRYPTUI_CERT_MGR_STRUCT; - -typedef const CRYPTUI_CERT_MGR_STRUCT *PCCRYPTUI_CERT_MGR_STRUCT; - -BOOL WINAPI CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr); + +typedef struct _CRYPTUI_CERT_MGR_STRUCT { + DWORD dwSize; + HWND hwndParent; + DWORD dwFlags; + LPCWSTR pwszTitle; + LPCSTR pszInitUsageOID; +} CRYPTUI_CERT_MGR_STRUCT, + *PCRYPTUI_CERT_MGR_STRUCT; + +typedef const CRYPTUI_CERT_MGR_STRUCT *PCCRYPTUI_CERT_MGR_STRUCT; + +BOOL WINAPI CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr); diff --git a/reactos/include/psdk/d3drmdef.h b/reactos/include/psdk/d3drmdef.h index 55da7d77a09..6f769f4af3f 100644 --- a/reactos/include/psdk/d3drmdef.h +++ b/reactos/include/psdk/d3drmdef.h @@ -1,68 +1,68 @@ -/* - * Copyright 2007 Vijay Kiran Kamuju - * Copyright 2007 David ADAM - * - * 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 - */ - -#ifndef __D3DRMDEFS_H__ -#define __D3DRMDEFS_H__ - -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -typedef D3DVALUE D3DRMMATRIX4D[4][4]; -typedef struct _D3DRMQUATERNION -{ - D3DVALUE s; - D3DVECTOR v; -} D3DRMQUATERNION, *LPD3DRMQUATERNION; - -void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D, LPD3DRMQUATERNION); - -LPD3DRMQUATERNION WINAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION ,LPD3DVECTOR,D3DVALUE); -LPD3DRMQUATERNION WINAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION); -LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION, D3DVALUE); - -LPD3DVECTOR WINAPI D3DRMVectorAdd(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorCrossProduct(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); -D3DVALUE WINAPI D3DRMVectorDotProduct(LPD3DVECTOR, LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorNormalize(LPD3DVECTOR); - -#define D3DRMVectorNormalise D3DRMVectorNormalize - -D3DVALUE WINAPI D3DRMVectorModulus(LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorRandom(LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorRotate(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR, D3DVALUE); -LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); -LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR, LPD3DVECTOR, D3DVALUE); -LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); - -D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE, D3DVALUE, D3DVALUE); -D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE); -D3DVALUE WINAPI D3DRMColorGetAlpha(D3DCOLOR); -D3DVALUE WINAPI D3DRMColorGetBlue(D3DCOLOR); -D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR); -D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR); - -#if defined(__cplusplus) -} -#endif - -#endif +/* + * Copyright 2007 Vijay Kiran Kamuju + * Copyright 2007 David ADAM + * + * 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 + */ + +#ifndef __D3DRMDEFS_H__ +#define __D3DRMDEFS_H__ + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef D3DVALUE D3DRMMATRIX4D[4][4]; +typedef struct _D3DRMQUATERNION +{ + D3DVALUE s; + D3DVECTOR v; +} D3DRMQUATERNION, *LPD3DRMQUATERNION; + +void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D, LPD3DRMQUATERNION); + +LPD3DRMQUATERNION WINAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION ,LPD3DVECTOR,D3DVALUE); +LPD3DRMQUATERNION WINAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION); +LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION, D3DVALUE); + +LPD3DVECTOR WINAPI D3DRMVectorAdd(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); +LPD3DVECTOR WINAPI D3DRMVectorCrossProduct(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); +D3DVALUE WINAPI D3DRMVectorDotProduct(LPD3DVECTOR, LPD3DVECTOR); +LPD3DVECTOR WINAPI D3DRMVectorNormalize(LPD3DVECTOR); + +#define D3DRMVectorNormalise D3DRMVectorNormalize + +D3DVALUE WINAPI D3DRMVectorModulus(LPD3DVECTOR); +LPD3DVECTOR WINAPI D3DRMVectorRandom(LPD3DVECTOR); +LPD3DVECTOR WINAPI D3DRMVectorRotate(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR, D3DVALUE); +LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); +LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR, LPD3DVECTOR, D3DVALUE); +LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR); + +D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE, D3DVALUE, D3DVALUE); +D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE); +D3DVALUE WINAPI D3DRMColorGetAlpha(D3DCOLOR); +D3DVALUE WINAPI D3DRMColorGetBlue(D3DCOLOR); +D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR); +D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/reactos/include/psdk/intrin_ppc.h b/reactos/include/psdk/intrin_ppc.h index 8bd3aa68c45..ac7e921e5ad 100644 --- a/reactos/include/psdk/intrin_ppc.h +++ b/reactos/include/psdk/intrin_ppc.h @@ -1,952 +1,952 @@ -/* - Compatibility header for GCC -- GCC equivalents of intrinsic - Microsoft Visual C++ functions. Originally developed for the ReactOS - () and TinyKrnl () - projects. - - Copyright (c) 2006 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 do 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. -*/ - -#ifndef KJK_INTRIN_PPC_H_ -#define KJK_INTRIN_PPC_H_ - -#ifndef __GNUC__ -#error Unsupported compiler -#endif - -/*** Stack frame juggling ***/ -#define _ReturnAddress() (__builtin_return_address(0)) -#define _AddressOfReturnAddress() (&(((void **)(__builtin_frame_address(0)))[1])) -/* TODO: __getcallerseflags but how??? */ - - -/*** Atomic operations ***/ -/* TODO: _ReadBarrier */ -/* TODO: _WriteBarrier */ - -#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 -#define _ReadWriteBarrier() __sync_synchronize() -#else -/* TODO: _ReadWriteBarrier() */ -#endif - -#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 - -static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) -{ - return __sync_val_compare_and_swap(Destination, Comperand, Exchange); -} - -static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) -{ - return __sync_val_compare_and_swap(Destination, Comperand, Exchange); -} - -static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand) -{ - return __sync_val_compare_and_swap(Destination, Comperand, Exchange); -} - -static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) -{ - return __sync_val_compare_and_swap(Destination, Comperand, Exchange); -} - -static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) -{ - return __sync_val_compare_and_swap(Destination, Comperand, Exchange); -} - -static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const 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); -} - -static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) -{ - /* NOTE: ditto */ - __sync_synchronize(); - return __sync_lock_test_and_set(Target, Value); -} - -static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) -{ - return __sync_fetch_and_add(Addend, Value); -} - -static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) -{ - return __sync_fetch_and_and(value, mask); -} - -static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) -{ - return __sync_fetch_and_and(value, mask); -} - -static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) -{ - return __sync_fetch_and_and(value, mask); -} - -static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) -{ - return __sync_fetch_and_or(value, mask); -} - -static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) -{ - return __sync_fetch_and_or(value, mask); -} - -static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) -{ - return __sync_fetch_and_or(value, mask); -} - -static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) -{ - return __sync_fetch_and_xor(value, mask); -} - -static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) -{ - return __sync_fetch_and_xor(value, mask); -} - -static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) -{ - return __sync_fetch_and_xor(value, mask); -} - -#else - -static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) -{ - char retval = Comperand; - __asm__ __volatile__ ( - "sync\n" - "1: lbarx %0,0,%1\n" - " subf. %0,%2,%0\n" - " bne 2f\n" - " stbcx. %3,0,%1\n" - " bne- 1b\n" - "2: isync" - : "=b" (retval) - : "b" (Destination), "r" (Comperand), "r" (Exchange) - : "cr0", "memory"); - return retval; -} - -static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) -{ - short retval = Comperand; - __asm__ __volatile__ ( - "sync\n" - "1: lharx %0,0,%1\n" - " subf. %0,%2,%0\n" - " bne 2f\n" - " sthcx. %3,0,%1\n" - " bne- 1b\n" - "2: isync" - : "=b" (retval) - : "b" (Destination), "r" (Comperand), "r" (Exchange) - : "cr0", "memory"); - return retval; -} - -static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) -{ - unsigned long lo32Retval = (unsigned long)((Comperand >> 0) & 0xFFFFFFFF); - long hi32Retval = (unsigned long)((Comperand >> 32) & 0xFFFFFFFF); - - unsigned long lo32Exchange = (unsigned long)((Exchange >> 0) & 0xFFFFFFFF); - long hi32Exchange = (unsigned long)((Exchange >> 32) & 0xFFFFFFFF); - -#if 0 - __asm__ - ( - "cmpxchg8b %[Destination]" : - "a" (lo32Retval), "d" (hi32Retval) : - [Destination] "rm" (Destination), "b" (lo32Exchange), "c" (hi32Exchange) : - "memory" - ); -#endif - { - union u_ - { - long long ll; - struct s_ - { - unsigned long lo32; - long hi32; - } - s; - } - u = { s : { lo32 : lo32Retval, hi32 : hi32Retval } }; - - return u.ll; - } -} - -static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) -{ - return (void *)_InterlockedCompareExchange - ((long *)Destination, (long) Exchange, (long) Comperand); -} - -static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const long Value) -{ - long retval; - __asm__ __volatile__ ( - "sync\n" - "1: lwarx %0,0,%1\n" - " stwcx. %2,0,%1\n" - " bne- 1b\n" - : "=b" (retval) - : "b" (Target), "b" (Value) - : "cr0", "memory"); - return retval; -} - -static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) -{ - void * retval; - __asm__ __volatile__ ( - "sync\n" - "1: lwarx %0,0,%1\n" - " stwcx. %2,0,%1\n" - " bne- 1b\n" - : "=b" (retval) - : "b" (Target), "b" (Value) - : "cr0", "memory"); - return retval; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) -{ - long x; - long y = *Addend; - long addend = y; - - do - { - x = y; - y = _InterlockedCompareExchange(Addend, addend + Value, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) -{ - char x; - char y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange8(value, x & mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) -{ - short x; - short y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange16(value, x & mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) -{ - long x; - long y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange(value, x & mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) -{ - char x; - char y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange8(value, x | mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) -{ - short x; - short y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange16(value, x | mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) -{ - long x; - long y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange(value, x | mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) -{ - char x; - char y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange8(value, x ^ mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) -{ - short x; - short y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange16(value, x ^ mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) -{ - long x; - long y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange(value, x ^ mask, x); - } - while(y != x); - - return y; -} - -static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * const a, const long b) -{ - long x; - long y; - long mask = ~(1<>= check; - *Index += check; - } - check >>= 1; - } - return 1; - } -} - -/* NOTE: again, the bizarre implementation follows Visual C++ */ -static __inline__ __attribute__((always_inline)) unsigned char _bittest(const long * const a, const long b) -{ - return ((*a) & (1<> (8-shift)); -} - -static __inline__ __attribute__((always_inline)) unsigned short _rotl16(const unsigned short value, const unsigned char shift) -{ - return (value << shift) | (value >> (16-shift)); -} - -static __inline__ __attribute__((always_inline)) unsigned char _rotr8(const unsigned char value, const unsigned char shift) -{ - return (value >> shift) | (value << (8-shift)); -} - -static __inline__ __attribute__((always_inline)) unsigned short _rotr16(const unsigned short value, const unsigned char shift) -{ - return (value >> shift) | (value << (16-shift)); -} - -static __inline__ __attribute__((always_inline)) unsigned long long __ll_lshift(const unsigned long long Mask, int Bit) -{ - return Mask << Bit; -} - -static __inline__ __attribute__((always_inline)) long long __ll_rshift(const long long Mask, const int Bit) -{ - return Mask >> Bit; -} - -static __inline__ __attribute__((always_inline)) unsigned long long __ull_rshift(const unsigned long long Mask, int Bit) -{ - return Mask >> Bit; -} - - -/*** 64-bit math ***/ -static __inline__ __attribute__((always_inline)) long long __emul(const int a, const int b) -{ - return a * b; -} - -static __inline__ __attribute__((always_inline)) unsigned long long __emulu(const unsigned int a, const unsigned int b) -{ - return a * b; -} - - -/*** Port I/O ***/ -static __inline__ __attribute__((always_inline)) unsigned char __inbyte(const unsigned short Port) -{ - int ret; - __asm__( - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "isync\n\t" - "sync\n\t" - "lbz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */ - "mtmsr 5\n\t" : "=r" (ret) : "b" (Port) - ); - return ret; -} - -static __inline__ __attribute__((always_inline)) unsigned short __inword(const unsigned short Port) -{ - int ret; - __asm__( - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "isync\n\t" - "sync\n\t" - "lhz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */ - "mtmsr 5\n\t" : "=r" (ret) : "b" (Port) - ); - return ret; -} - -static __inline__ __attribute__((always_inline)) unsigned long __indword(const unsigned short Port) -{ - int ret; - __asm__( - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "isync\n\t" - "sync\n\t" - "lwz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */ - "mtmsr 5\n\t" : "=r" (ret) : "b" (Port) - ); - return ret; -} - -static __inline__ __attribute__((always_inline)) void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count) -{ - while(Count--) { - *Buffer++ = __inbyte(Port); - } -} - -static __inline__ __attribute__((always_inline)) void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count) -{ - while(Count--) { - *Buffer++ = __inword(Port); - } -} - -static __inline__ __attribute__((always_inline)) void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count) -{ - while(Count--) { - *Buffer++ = __indword(Port); - } -} - -static __inline__ __attribute__((always_inline)) void __outbyte(unsigned short const Port, const unsigned char Data) -{ - __asm__( - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "sync\n\t" - "eieio\n\t" - "stb %1,0(%0)\n\t" /* Set actual value at phys addr r3 */ - "dcbst 0,%1\n\t" - "mtmsr 5\n\t" - "sync\n\t" - "eieio\n\t" : : "b" (Port), "r" (Data) - ); -} - -static __inline__ __attribute__((always_inline)) void __outword(unsigned short const Port, const unsigned short Data) -{ - __asm__( - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "sync\n\t" - "eieio\n\t" - "sth %1,0(%0)\n\t" /* Set actual value at phys addr r3 */ - "dcbst 0,%1\n\t" - "mtmsr 5\n\t" - "sync\n\t" - "eieio\n\t" : : "b" (Port), "b" (Data) - ); -} - -static __inline__ __attribute__((always_inline)) void __outdword(unsigned short const Port, const unsigned long Data) -{ - __asm__( - "mfmsr 5\n\t" - "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ - "mtmsr 6\n\t" - "sync\n\t" - "eieio\n\t" - "stw %1,0(%0)\n\t" /* Set actual value at phys addr r3 */ - "dcbst 0,%1\n\t" - "mtmsr 5\n\t" - "sync\n\t" - "eieio\n\t" : : "b" (Port), "b" (Data) - ); -} - -static __inline__ __attribute__((always_inline)) void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count) -{ - unsigned long count = Count; - const unsigned char *buffer = Buffer; - while(count--) { - __outbyte(Port, *buffer++); - } -} - -static __inline__ __attribute__((always_inline)) void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count) -{ - unsigned long count = Count; - const unsigned short *buffer = Buffer; - while(count--) { - __outword(Port, *buffer++); - } -} - -static __inline__ __attribute__((always_inline)) void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count) -{ - unsigned long count = Count; - const unsigned long *buffer = Buffer; - while(count--) { - __outdword(Port, *buffer++); - } -} - - -/*** System information ***/ -static __inline__ __attribute__((always_inline)) void __cpuid(int CPUInfo[], const int InfoType) -{ - unsigned long lo32; - __asm__("mfpvr" : "=b" (lo32)); -} - -static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void) -{ - unsigned long lo32; - __asm__("mfdec %0" : "=b" (lo32)); - return -lo32; -} - - -/*** Interrupts ***/ -/* Finally decided to do this by enabling single step trap */ -static __inline__ __attribute__((always_inline)) void __debugbreak(void) -{ - -} - -static __inline__ __attribute__((always_inline)) void __int2c(void) -{ - /* Not sure yet */ -} - -#ifndef _ENABLE_DISABLE_DEFINED -#define _ENABLE_DISABLE_DEFINED -static __inline__ __attribute__((always_inline)) void _disable(void) -{ - __asm__ __volatile__("mfmsr 0\n\t" \ - "li 8,0x7fff\n\t" \ - "and 0,8,0\n\t" \ - "mtmsr 0\n\t"); -} - -static __inline__ __attribute__((always_inline)) void _enable(void) -{ - __asm__ __volatile__("mfmsr 0\n\t" \ - "lis 8,0x8000@ha\n\t" \ - "or 0,8,0\n\t" \ - "mtmsr 0\n\t"); -} - -/*** Protected memory management ***/ -static __inline__ __attribute__((always_inline)) unsigned long __readsdr1(void) -{ - unsigned long value; - __asm__("mfsdr1 %0" : "=b" (value)); - return value; -} - -static __inline__ __attribute__((always_inline)) void __writesdr1(const unsigned long long Data) -{ - __asm__("mtsdr1 %0" : : "b" (Data)); -} - -/*** System operations ***/ -/* This likely has a different meaning from the X86 equivalent. We'll keep - * the name cause it fits */ -static __inline__ __attribute__((always_inline)) unsigned long long __readmsr() -{ - unsigned long temp; - __asm__("mfmsr %0" : "=b" (temp)); - return temp; -} - -static __inline__ __attribute__((always_inline)) void __writemsr(const unsigned long Value) -{ - __asm__("mtmsr %0" : : "b" (Value)); -} - -/* We'll make sure of the following: - * IO operations have completed - * Write operations through cache have completed - * We've reloaded anything in the data or instruction cache that might have - * changed in real ram. - */ -static __inline__ __attribute__((always_inline)) void __wbinvd(void) -{ - __asm__("eieio\n\t" - "dcs\n\t" - "sync\n\t" - "isync\n\t"); -} -#endif - -static __inline__ __attribute__((always_inline)) long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value) -{ -#if 0 - __asm__ - ( - "lock; add %[Value], %[Lo32];" - "jae LABEL%=;" - "lock; adc $0, %[Hi32];" - "LABEL%=:;" : - [Lo32] "=m" (*((volatile long *)(Addend) + 0)), [Hi32] "=m" (*((volatile long *)(Addend) + 1)) : - [Value] "ir" (Value) - ); -#endif - return Value; -} - -/*** Miscellaneous ***/ -/* BUGBUG: only good for use in macros. Cannot be taken the address of */ -#define __noop(...) ((void)0) - -/* TODO: __assume. GCC only supports the weaker __builtin_expect */ - -#endif -/* EOF */ +/* + Compatibility header for GCC -- GCC equivalents of intrinsic + Microsoft Visual C++ functions. Originally developed for the ReactOS + () and TinyKrnl () + projects. + + Copyright (c) 2006 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 do 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. +*/ + +#ifndef KJK_INTRIN_PPC_H_ +#define KJK_INTRIN_PPC_H_ + +#ifndef __GNUC__ +#error Unsupported compiler +#endif + +/*** Stack frame juggling ***/ +#define _ReturnAddress() (__builtin_return_address(0)) +#define _AddressOfReturnAddress() (&(((void **)(__builtin_frame_address(0)))[1])) +/* TODO: __getcallerseflags but how??? */ + + +/*** Atomic operations ***/ +/* TODO: _ReadBarrier */ +/* TODO: _WriteBarrier */ + +#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 +#define _ReadWriteBarrier() __sync_synchronize() +#else +/* TODO: _ReadWriteBarrier() */ +#endif + +#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 + +static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) +{ + return __sync_val_compare_and_swap(Destination, Comperand, Exchange); +} + +static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) +{ + return __sync_val_compare_and_swap(Destination, Comperand, Exchange); +} + +static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand) +{ + return __sync_val_compare_and_swap(Destination, Comperand, Exchange); +} + +static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) +{ + return __sync_val_compare_and_swap(Destination, Comperand, Exchange); +} + +static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) +{ + return __sync_val_compare_and_swap(Destination, Comperand, Exchange); +} + +static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const 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); +} + +static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) +{ + /* NOTE: ditto */ + __sync_synchronize(); + return __sync_lock_test_and_set(Target, Value); +} + +static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) +{ + return __sync_fetch_and_add(Addend, Value); +} + +static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) +{ + return __sync_fetch_and_and(value, mask); +} + +static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) +{ + return __sync_fetch_and_and(value, mask); +} + +static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) +{ + return __sync_fetch_and_and(value, mask); +} + +static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) +{ + return __sync_fetch_and_or(value, mask); +} + +static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) +{ + return __sync_fetch_and_or(value, mask); +} + +static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) +{ + return __sync_fetch_and_or(value, mask); +} + +static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) +{ + return __sync_fetch_and_xor(value, mask); +} + +static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) +{ + return __sync_fetch_and_xor(value, mask); +} + +static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) +{ + return __sync_fetch_and_xor(value, mask); +} + +#else + +static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand) +{ + char retval = Comperand; + __asm__ __volatile__ ( + "sync\n" + "1: lbarx %0,0,%1\n" + " subf. %0,%2,%0\n" + " bne 2f\n" + " stbcx. %3,0,%1\n" + " bne- 1b\n" + "2: isync" + : "=b" (retval) + : "b" (Destination), "r" (Comperand), "r" (Exchange) + : "cr0", "memory"); + return retval; +} + +static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand) +{ + short retval = Comperand; + __asm__ __volatile__ ( + "sync\n" + "1: lharx %0,0,%1\n" + " subf. %0,%2,%0\n" + " bne 2f\n" + " sthcx. %3,0,%1\n" + " bne- 1b\n" + "2: isync" + : "=b" (retval) + : "b" (Destination), "r" (Comperand), "r" (Exchange) + : "cr0", "memory"); + return retval; +} + +static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand) +{ + unsigned long lo32Retval = (unsigned long)((Comperand >> 0) & 0xFFFFFFFF); + long hi32Retval = (unsigned long)((Comperand >> 32) & 0xFFFFFFFF); + + unsigned long lo32Exchange = (unsigned long)((Exchange >> 0) & 0xFFFFFFFF); + long hi32Exchange = (unsigned long)((Exchange >> 32) & 0xFFFFFFFF); + +#if 0 + __asm__ + ( + "cmpxchg8b %[Destination]" : + "a" (lo32Retval), "d" (hi32Retval) : + [Destination] "rm" (Destination), "b" (lo32Exchange), "c" (hi32Exchange) : + "memory" + ); +#endif + { + union u_ + { + long long ll; + struct s_ + { + unsigned long lo32; + long hi32; + } + s; + } + u = { s : { lo32 : lo32Retval, hi32 : hi32Retval } }; + + return u.ll; + } +} + +static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) +{ + return (void *)_InterlockedCompareExchange + ((long *)Destination, (long) Exchange, (long) Comperand); +} + +static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const long Value) +{ + long retval; + __asm__ __volatile__ ( + "sync\n" + "1: lwarx %0,0,%1\n" + " stwcx. %2,0,%1\n" + " bne- 1b\n" + : "=b" (retval) + : "b" (Target), "b" (Value) + : "cr0", "memory"); + return retval; +} + +static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) +{ + void * retval; + __asm__ __volatile__ ( + "sync\n" + "1: lwarx %0,0,%1\n" + " stwcx. %2,0,%1\n" + " bne- 1b\n" + : "=b" (retval) + : "b" (Target), "b" (Value) + : "cr0", "memory"); + return retval; +} + +static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) +{ + long x; + long y = *Addend; + long addend = y; + + do + { + x = y; + y = _InterlockedCompareExchange(Addend, addend + Value, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) +{ + char x; + char y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange8(value, x & mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) +{ + short x; + short y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange16(value, x & mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) +{ + long x; + long y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange(value, x & mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) +{ + char x; + char y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange8(value, x | mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) +{ + short x; + short y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange16(value, x | mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) +{ + long x; + long y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange(value, x | mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) +{ + char x; + char y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange8(value, x ^ mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) +{ + short x; + short y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange16(value, x ^ mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) +{ + long x; + long y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange(value, x ^ mask, x); + } + while(y != x); + + return y; +} + +static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * const a, const long b) +{ + long x; + long y; + long mask = ~(1<>= check; + *Index += check; + } + check >>= 1; + } + return 1; + } +} + +/* NOTE: again, the bizarre implementation follows Visual C++ */ +static __inline__ __attribute__((always_inline)) unsigned char _bittest(const long * const a, const long b) +{ + return ((*a) & (1<> (8-shift)); +} + +static __inline__ __attribute__((always_inline)) unsigned short _rotl16(const unsigned short value, const unsigned char shift) +{ + return (value << shift) | (value >> (16-shift)); +} + +static __inline__ __attribute__((always_inline)) unsigned char _rotr8(const unsigned char value, const unsigned char shift) +{ + return (value >> shift) | (value << (8-shift)); +} + +static __inline__ __attribute__((always_inline)) unsigned short _rotr16(const unsigned short value, const unsigned char shift) +{ + return (value >> shift) | (value << (16-shift)); +} + +static __inline__ __attribute__((always_inline)) unsigned long long __ll_lshift(const unsigned long long Mask, int Bit) +{ + return Mask << Bit; +} + +static __inline__ __attribute__((always_inline)) long long __ll_rshift(const long long Mask, const int Bit) +{ + return Mask >> Bit; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __ull_rshift(const unsigned long long Mask, int Bit) +{ + return Mask >> Bit; +} + + +/*** 64-bit math ***/ +static __inline__ __attribute__((always_inline)) long long __emul(const int a, const int b) +{ + return a * b; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __emulu(const unsigned int a, const unsigned int b) +{ + return a * b; +} + + +/*** Port I/O ***/ +static __inline__ __attribute__((always_inline)) unsigned char __inbyte(const unsigned short Port) +{ + int ret; + __asm__( + "mfmsr 5\n\t" + "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ + "mtmsr 6\n\t" + "isync\n\t" + "sync\n\t" + "lbz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */ + "mtmsr 5\n\t" : "=r" (ret) : "b" (Port) + ); + return ret; +} + +static __inline__ __attribute__((always_inline)) unsigned short __inword(const unsigned short Port) +{ + int ret; + __asm__( + "mfmsr 5\n\t" + "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ + "mtmsr 6\n\t" + "isync\n\t" + "sync\n\t" + "lhz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */ + "mtmsr 5\n\t" : "=r" (ret) : "b" (Port) + ); + return ret; +} + +static __inline__ __attribute__((always_inline)) unsigned long __indword(const unsigned short Port) +{ + int ret; + __asm__( + "mfmsr 5\n\t" + "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ + "mtmsr 6\n\t" + "isync\n\t" + "sync\n\t" + "lwz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */ + "mtmsr 5\n\t" : "=r" (ret) : "b" (Port) + ); + return ret; +} + +static __inline__ __attribute__((always_inline)) void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count) +{ + while(Count--) { + *Buffer++ = __inbyte(Port); + } +} + +static __inline__ __attribute__((always_inline)) void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count) +{ + while(Count--) { + *Buffer++ = __inword(Port); + } +} + +static __inline__ __attribute__((always_inline)) void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count) +{ + while(Count--) { + *Buffer++ = __indword(Port); + } +} + +static __inline__ __attribute__((always_inline)) void __outbyte(unsigned short const Port, const unsigned char Data) +{ + __asm__( + "mfmsr 5\n\t" + "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ + "mtmsr 6\n\t" + "sync\n\t" + "eieio\n\t" + "stb %1,0(%0)\n\t" /* Set actual value at phys addr r3 */ + "dcbst 0,%1\n\t" + "mtmsr 5\n\t" + "sync\n\t" + "eieio\n\t" : : "b" (Port), "r" (Data) + ); +} + +static __inline__ __attribute__((always_inline)) void __outword(unsigned short const Port, const unsigned short Data) +{ + __asm__( + "mfmsr 5\n\t" + "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ + "mtmsr 6\n\t" + "sync\n\t" + "eieio\n\t" + "sth %1,0(%0)\n\t" /* Set actual value at phys addr r3 */ + "dcbst 0,%1\n\t" + "mtmsr 5\n\t" + "sync\n\t" + "eieio\n\t" : : "b" (Port), "b" (Data) + ); +} + +static __inline__ __attribute__((always_inline)) void __outdword(unsigned short const Port, const unsigned long Data) +{ + __asm__( + "mfmsr 5\n\t" + "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */ + "mtmsr 6\n\t" + "sync\n\t" + "eieio\n\t" + "stw %1,0(%0)\n\t" /* Set actual value at phys addr r3 */ + "dcbst 0,%1\n\t" + "mtmsr 5\n\t" + "sync\n\t" + "eieio\n\t" : : "b" (Port), "b" (Data) + ); +} + +static __inline__ __attribute__((always_inline)) void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count) +{ + unsigned long count = Count; + const unsigned char *buffer = Buffer; + while(count--) { + __outbyte(Port, *buffer++); + } +} + +static __inline__ __attribute__((always_inline)) void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count) +{ + unsigned long count = Count; + const unsigned short *buffer = Buffer; + while(count--) { + __outword(Port, *buffer++); + } +} + +static __inline__ __attribute__((always_inline)) void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count) +{ + unsigned long count = Count; + const unsigned long *buffer = Buffer; + while(count--) { + __outdword(Port, *buffer++); + } +} + + +/*** System information ***/ +static __inline__ __attribute__((always_inline)) void __cpuid(int CPUInfo[], const int InfoType) +{ + unsigned long lo32; + __asm__("mfpvr" : "=b" (lo32)); +} + +static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void) +{ + unsigned long lo32; + __asm__("mfdec %0" : "=b" (lo32)); + return -lo32; +} + + +/*** Interrupts ***/ +/* Finally decided to do this by enabling single step trap */ +static __inline__ __attribute__((always_inline)) void __debugbreak(void) +{ + +} + +static __inline__ __attribute__((always_inline)) void __int2c(void) +{ + /* Not sure yet */ +} + +#ifndef _ENABLE_DISABLE_DEFINED +#define _ENABLE_DISABLE_DEFINED +static __inline__ __attribute__((always_inline)) void _disable(void) +{ + __asm__ __volatile__("mfmsr 0\n\t" \ + "li 8,0x7fff\n\t" \ + "and 0,8,0\n\t" \ + "mtmsr 0\n\t"); +} + +static __inline__ __attribute__((always_inline)) void _enable(void) +{ + __asm__ __volatile__("mfmsr 0\n\t" \ + "lis 8,0x8000@ha\n\t" \ + "or 0,8,0\n\t" \ + "mtmsr 0\n\t"); +} + +/*** Protected memory management ***/ +static __inline__ __attribute__((always_inline)) unsigned long __readsdr1(void) +{ + unsigned long value; + __asm__("mfsdr1 %0" : "=b" (value)); + return value; +} + +static __inline__ __attribute__((always_inline)) void __writesdr1(const unsigned long long Data) +{ + __asm__("mtsdr1 %0" : : "b" (Data)); +} + +/*** System operations ***/ +/* This likely has a different meaning from the X86 equivalent. We'll keep + * the name cause it fits */ +static __inline__ __attribute__((always_inline)) unsigned long long __readmsr() +{ + unsigned long temp; + __asm__("mfmsr %0" : "=b" (temp)); + return temp; +} + +static __inline__ __attribute__((always_inline)) void __writemsr(const unsigned long Value) +{ + __asm__("mtmsr %0" : : "b" (Value)); +} + +/* We'll make sure of the following: + * IO operations have completed + * Write operations through cache have completed + * We've reloaded anything in the data or instruction cache that might have + * changed in real ram. + */ +static __inline__ __attribute__((always_inline)) void __wbinvd(void) +{ + __asm__("eieio\n\t" + "dcs\n\t" + "sync\n\t" + "isync\n\t"); +} +#endif + +static __inline__ __attribute__((always_inline)) long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value) +{ +#if 0 + __asm__ + ( + "lock; add %[Value], %[Lo32];" + "jae LABEL%=;" + "lock; adc $0, %[Hi32];" + "LABEL%=:;" : + [Lo32] "=m" (*((volatile long *)(Addend) + 0)), [Hi32] "=m" (*((volatile long *)(Addend) + 1)) : + [Value] "ir" (Value) + ); +#endif + return Value; +} + +/*** Miscellaneous ***/ +/* BUGBUG: only good for use in macros. Cannot be taken the address of */ +#define __noop(...) ((void)0) + +/* TODO: __assume. GCC only supports the weaker __builtin_expect */ + +#endif +/* EOF */ diff --git a/reactos/include/psdk/intrin_x86_64.h b/reactos/include/psdk/intrin_x86_64.h index d3f5a12faa9..8b137891791 100644 --- a/reactos/include/psdk/intrin_x86_64.h +++ b/reactos/include/psdk/intrin_x86_64.h @@ -1 +1 @@ - + diff --git a/reactos/include/psdk/multimon.h b/reactos/include/psdk/multimon.h index c3b08ecdfb7..f5dbcd6222d 100644 --- a/reactos/include/psdk/multimon.h +++ b/reactos/include/psdk/multimon.h @@ -1,16 +1,16 @@ -#ifndef __MULTIMON_H -#define __MULTIMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -HMONITOR WINAPI MonitorFromRect(LPCRECT,DWORD); -HMONITOR WINAPI MonitorFromWindow(HWND,DWORD); -HMONITOR WINAPI MonitorFromPoint(POINT,DWORD); - -#ifdef __cplusplus -} -#endif - -#endif /* __MULTIMON_H */ +#ifndef __MULTIMON_H +#define __MULTIMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +HMONITOR WINAPI MonitorFromRect(LPCRECT,DWORD); +HMONITOR WINAPI MonitorFromWindow(HWND,DWORD); +HMONITOR WINAPI MonitorFromPoint(POINT,DWORD); + +#ifdef __cplusplus +} +#endif + +#endif /* __MULTIMON_H */ diff --git a/reactos/include/psdk/ntverp.h b/reactos/include/psdk/ntverp.h index bfcc43240da..e892c6359ab 100644 --- a/reactos/include/psdk/ntverp.h +++ b/reactos/include/psdk/ntverp.h @@ -1,151 +1,151 @@ -/* - * PROJECT: ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: include/psdk/ntverp.h - * PURPOSE: Master Version File. - * This file should be modified only by the official builder - * to update VERSION, VER_PRODUCTVERSION, VER_PRODUCTVERSION_ - * STR and VER_PRODUCTBETA_STR values. - * The VER_PRODUCTBUILD lines must contain the product - * comments and end with the build#. - * The VER_PRODUCTBETA_STR lines must contain the product - * comments and end with "somestring". + * The VER_PRODUCTBETA_STR lines must contain the product + * comments and end with "somestring" - - - activscp.idl - control.idl - dispex.idl - docobj.idl - downloadmgr.idl - hlink.idl - htiframe.idl - iads.idl - indexsrv.idl - mimeinfo.idl - mlang.idl - mshtml.idl - msxml.idl - oaidl.idl - objidl.idl - objsafe.idl - ocidl.idl - ocmm.idl - oledb.idl - oleidl.idl - optary.idl - propidl.idl - pstore.idl - richole.idl - sensevts.idl - servprov.idl - shldisp.idl - shobjidl.idl - shtypes.idl - strmif.idl - tom.idl - unknwn.idl - urlhist.idl - urlmon.idl - mshtmhst.idl - exdisp.idl - wtypes.idl - comcat.idl + + + + activscp.idl + control.idl + dispex.idl + docobj.idl + downloadmgr.idl + hlink.idl + htiframe.idl + iads.idl + indexsrv.idl + mimeinfo.idl + mlang.idl + mshtml.idl + msxml.idl + oaidl.idl + objidl.idl + objsafe.idl + ocidl.idl + ocmm.idl + oledb.idl + oleidl.idl + optary.idl + propidl.idl + pstore.idl + richole.idl + sensevts.idl + servprov.idl + shldisp.idl + shobjidl.idl + shtypes.idl + strmif.idl + tom.idl + unknwn.idl + urlhist.idl + urlmon.idl + mshtmhst.idl + exdisp.idl + wtypes.idl + comcat.idl \ No newline at end of file diff --git a/reactos/include/psdk/wdbgexts.h b/reactos/include/psdk/wdbgexts.h index e1948c48bfb..7e3f003ae4b 100644 --- a/reactos/include/psdk/wdbgexts.h +++ b/reactos/include/psdk/wdbgexts.h @@ -1,191 +1,191 @@ -#ifndef _WDBGEXTS_ -#define _WDBGEXTS_ - -enum -{ - DBGKD_SIMULATION_NONE, - DBGKD_SIMULATION_EXDI -}; - -#define KD_SECONDARY_VERSION_DEFAULT 0 -#define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_1 0 -#define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_2 1 -#define KD_SECONDARY_VERSION_AMD64_CONTEXT 2 -#define CURRENT_KD_SECONDARY_VERSION KD_SECONDARY_VERSION_DEFAULT - -#define DBGKD_VERS_FLAG_MP 0x0001 -#define DBGKD_VERS_FLAG_DATA 0x0002 -#define DBGKD_VERS_FLAG_PTR64 0x0004 -#define DBGKD_VERS_FLAG_NOMM 0x0008 -#define DBGKD_VERS_FLAG_HSS 0x0010 -#define DBGKD_VERS_FLAG_PARTITIONS 0x0020 - -#define KDBG_TAG TAG('K', 'D', 'B', 'G') - -typedef struct _DBGKD_GET_VERSION64 -{ - USHORT MajorVersion; - USHORT MinorVersion; - UCHAR ProtocolVersion; - UCHAR KdSecondaryVersion; - USHORT Flags; - USHORT MachineType; - UCHAR MaxPacketType; - UCHAR MaxStateChange; - UCHAR MaxManipulate; - UCHAR Simulation; - USHORT Unused[1]; - ULONG64 KernBase; - ULONG64 PsLoadedModuleList; - ULONG64 DebuggerDataList; -} DBGKD_GET_VERSION64, *PDBGKD_GET_VERSION64; - -typedef struct _DBGKD_DEBUG_DATA_HEADER64 -{ - LIST_ENTRY64 List; - ULONG OwnerTag; - ULONG Size; -} DBGKD_DEBUG_DATA_HEADER64, *PDBGKD_DEBUG_DATA_HEADER64; - -typedef union _GCC_ULONG64 -{ - ULONG_PTR Pointer; - ULONG64 RealPointer; -} GCC_ULONG64, *PGCC_ULONG64; - -typedef struct _KDDEBUGGER_DATA64 -{ - DBGKD_DEBUG_DATA_HEADER64 Header; - ULONG64 KernBase; - GCC_ULONG64 BreakpointWithStatus; - ULONG64 SavedContext; - USHORT ThCallbackStack; - USHORT NextCallback; - USHORT FramePointer; - USHORT PaeEnabled:1; - GCC_ULONG64 KiCallUserMode; - GCC_ULONG64 KeUserCallbackDispatcher; - GCC_ULONG64 PsLoadedModuleList; - GCC_ULONG64 PsActiveProcessHead; - GCC_ULONG64 PspCidTable; - GCC_ULONG64 ExpSystemResourcesList; - GCC_ULONG64 ExpPagedPoolDescriptor; - GCC_ULONG64 ExpNumberOfPagedPools; - GCC_ULONG64 KeTimeIncrement; - GCC_ULONG64 KeBugCheckCallbackListHead; - GCC_ULONG64 KiBugcheckData; - GCC_ULONG64 IopErrorLogListHead; - GCC_ULONG64 ObpRootDirectoryObject; - GCC_ULONG64 ObpTypeObjectType; - GCC_ULONG64 MmSystemCacheStart; - GCC_ULONG64 MmSystemCacheEnd; - GCC_ULONG64 MmSystemCacheWs; - GCC_ULONG64 MmPfnDatabase; - GCC_ULONG64 MmSystemPtesStart; - GCC_ULONG64 MmSystemPtesEnd; - GCC_ULONG64 MmSubsectionBase; - GCC_ULONG64 MmNumberOfPagingFiles; - GCC_ULONG64 MmLowestPhysicalPage; - GCC_ULONG64 MmHighestPhysicalPage; - GCC_ULONG64 MmNumberOfPhysicalPages; - GCC_ULONG64 MmMaximumNonPagedPoolInBytes; - GCC_ULONG64 MmNonPagedSystemStart; - GCC_ULONG64 MmNonPagedPoolStart; - GCC_ULONG64 MmNonPagedPoolEnd; - GCC_ULONG64 MmPagedPoolStart; - GCC_ULONG64 MmPagedPoolEnd; - GCC_ULONG64 MmPagedPoolInformation; - ULONG64 MmPageSize; - GCC_ULONG64 MmSizeOfPagedPoolInBytes; - GCC_ULONG64 MmTotalCommitLimit; - GCC_ULONG64 MmTotalCommittedPages; - GCC_ULONG64 MmSharedCommit; - GCC_ULONG64 MmDriverCommit; - GCC_ULONG64 MmProcessCommit; - GCC_ULONG64 MmPagedPoolCommit; - GCC_ULONG64 MmExtendedCommit; - GCC_ULONG64 MmZeroedPageListHead; - GCC_ULONG64 MmFreePageListHead; - GCC_ULONG64 MmStandbyPageListHead; - GCC_ULONG64 MmModifiedPageListHead; - GCC_ULONG64 MmModifiedNoWritePageListHead; - GCC_ULONG64 MmAvailablePages; - GCC_ULONG64 MmResidentAvailablePages; - GCC_ULONG64 PoolTrackTable; - GCC_ULONG64 NonPagedPoolDescriptor; - GCC_ULONG64 MmHighestUserAddress; - GCC_ULONG64 MmSystemRangeStart; - GCC_ULONG64 MmUserProbeAddress; - GCC_ULONG64 KdPrintCircularBuffer; - GCC_ULONG64 KdPrintCircularBufferEnd; - GCC_ULONG64 KdPrintWritePointer; - GCC_ULONG64 KdPrintRolloverCount; - GCC_ULONG64 MmLoadedUserImageList; - GCC_ULONG64 NtBuildLab; - GCC_ULONG64 KiNormalSystemCall; - GCC_ULONG64 KiProcessorBlock; - GCC_ULONG64 MmUnloadedDrivers; - GCC_ULONG64 MmLastUnloadedDriver; - GCC_ULONG64 MmTriageActionTaken; - GCC_ULONG64 MmSpecialPoolTag; - GCC_ULONG64 KernelVerifier; - GCC_ULONG64 MmVerifierData; - GCC_ULONG64 MmAllocatedNonPagedPool; - GCC_ULONG64 MmPeakCommitment; - GCC_ULONG64 MmTotalCommitLimitMaximum; - GCC_ULONG64 CmNtCSDVersion; - GCC_ULONG64 MmPhysicalMemoryBlock; - GCC_ULONG64 MmSessionBase; - GCC_ULONG64 MmSessionSize; - GCC_ULONG64 MmSystemParentTablePage; - GCC_ULONG64 MmVirtualTranslationBase; - USHORT OffsetKThreadNextProcessor; - USHORT OffsetKThreadTeb; - USHORT OffsetKThreadKernelStack; - USHORT OffsetKThreadInitialStack; - USHORT OffsetKThreadApcProcess; - USHORT OffsetKThreadState; - USHORT OffsetKThreadBStore; - USHORT OffsetKThreadBStoreLimit; - USHORT SizeEProcess; - USHORT OffsetEprocessPeb; - USHORT OffsetEprocessParentCID; - USHORT OffsetEprocessDirectoryTableBase; - USHORT SizePrcb; - USHORT OffsetPrcbDpcRoutine; - USHORT OffsetPrcbCurrentThread; - USHORT OffsetPrcbMhz; - USHORT OffsetPrcbCpuType; - USHORT OffsetPrcbVendorString; - USHORT OffsetPrcbProcStateContext; - USHORT OffsetPrcbNumber; - USHORT SizeEThread; - GCC_ULONG64 KdPrintCircularBufferPtr; - GCC_ULONG64 KdPrintBufferSize; - GCC_ULONG64 KeLoaderBlock; - USHORT SizePcr; - USHORT OffsetPcrSelfPcr; - USHORT OffsetPcrCurrentPrcb; - USHORT OffsetPcrContainedPrcb; - USHORT OffsetPcrInitialBStore; - USHORT OffsetPcrBStoreLimit; - USHORT OffsetPcrInitialStack; - USHORT OffsetPcrStackLimit; - USHORT OffsetPrcbPcrPage; - USHORT OffsetPrcbProcStateSpecialReg; - USHORT GdtR0Code; - USHORT GdtR0Data; - USHORT GdtR0Pcr; - USHORT GdtR3Code; - USHORT GdtR3Data; - USHORT GdtR3Teb; - USHORT GdtLdt; - USHORT GdtTss; - USHORT Gdt64R3CmCode; - USHORT Gdt64R3CmTeb; - GCC_ULONG64 IopNumTriageDumpDataBlocks; - GCC_ULONG64 IopTriageDumpDataBlocks; - GCC_ULONG64 VfCrashDataBlock; -} KDDEBUGGER_DATA64, *PKDDEBUGGER_DATA64; - -#endif +#ifndef _WDBGEXTS_ +#define _WDBGEXTS_ + +enum +{ + DBGKD_SIMULATION_NONE, + DBGKD_SIMULATION_EXDI +}; + +#define KD_SECONDARY_VERSION_DEFAULT 0 +#define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_1 0 +#define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_2 1 +#define KD_SECONDARY_VERSION_AMD64_CONTEXT 2 +#define CURRENT_KD_SECONDARY_VERSION KD_SECONDARY_VERSION_DEFAULT + +#define DBGKD_VERS_FLAG_MP 0x0001 +#define DBGKD_VERS_FLAG_DATA 0x0002 +#define DBGKD_VERS_FLAG_PTR64 0x0004 +#define DBGKD_VERS_FLAG_NOMM 0x0008 +#define DBGKD_VERS_FLAG_HSS 0x0010 +#define DBGKD_VERS_FLAG_PARTITIONS 0x0020 + +#define KDBG_TAG TAG('K', 'D', 'B', 'G') + +typedef struct _DBGKD_GET_VERSION64 +{ + USHORT MajorVersion; + USHORT MinorVersion; + UCHAR ProtocolVersion; + UCHAR KdSecondaryVersion; + USHORT Flags; + USHORT MachineType; + UCHAR MaxPacketType; + UCHAR MaxStateChange; + UCHAR MaxManipulate; + UCHAR Simulation; + USHORT Unused[1]; + ULONG64 KernBase; + ULONG64 PsLoadedModuleList; + ULONG64 DebuggerDataList; +} DBGKD_GET_VERSION64, *PDBGKD_GET_VERSION64; + +typedef struct _DBGKD_DEBUG_DATA_HEADER64 +{ + LIST_ENTRY64 List; + ULONG OwnerTag; + ULONG Size; +} DBGKD_DEBUG_DATA_HEADER64, *PDBGKD_DEBUG_DATA_HEADER64; + +typedef union _GCC_ULONG64 +{ + ULONG_PTR Pointer; + ULONG64 RealPointer; +} GCC_ULONG64, *PGCC_ULONG64; + +typedef struct _KDDEBUGGER_DATA64 +{ + DBGKD_DEBUG_DATA_HEADER64 Header; + ULONG64 KernBase; + GCC_ULONG64 BreakpointWithStatus; + ULONG64 SavedContext; + USHORT ThCallbackStack; + USHORT NextCallback; + USHORT FramePointer; + USHORT PaeEnabled:1; + GCC_ULONG64 KiCallUserMode; + GCC_ULONG64 KeUserCallbackDispatcher; + GCC_ULONG64 PsLoadedModuleList; + GCC_ULONG64 PsActiveProcessHead; + GCC_ULONG64 PspCidTable; + GCC_ULONG64 ExpSystemResourcesList; + GCC_ULONG64 ExpPagedPoolDescriptor; + GCC_ULONG64 ExpNumberOfPagedPools; + GCC_ULONG64 KeTimeIncrement; + GCC_ULONG64 KeBugCheckCallbackListHead; + GCC_ULONG64 KiBugcheckData; + GCC_ULONG64 IopErrorLogListHead; + GCC_ULONG64 ObpRootDirectoryObject; + GCC_ULONG64 ObpTypeObjectType; + GCC_ULONG64 MmSystemCacheStart; + GCC_ULONG64 MmSystemCacheEnd; + GCC_ULONG64 MmSystemCacheWs; + GCC_ULONG64 MmPfnDatabase; + GCC_ULONG64 MmSystemPtesStart; + GCC_ULONG64 MmSystemPtesEnd; + GCC_ULONG64 MmSubsectionBase; + GCC_ULONG64 MmNumberOfPagingFiles; + GCC_ULONG64 MmLowestPhysicalPage; + GCC_ULONG64 MmHighestPhysicalPage; + GCC_ULONG64 MmNumberOfPhysicalPages; + GCC_ULONG64 MmMaximumNonPagedPoolInBytes; + GCC_ULONG64 MmNonPagedSystemStart; + GCC_ULONG64 MmNonPagedPoolStart; + GCC_ULONG64 MmNonPagedPoolEnd; + GCC_ULONG64 MmPagedPoolStart; + GCC_ULONG64 MmPagedPoolEnd; + GCC_ULONG64 MmPagedPoolInformation; + ULONG64 MmPageSize; + GCC_ULONG64 MmSizeOfPagedPoolInBytes; + GCC_ULONG64 MmTotalCommitLimit; + GCC_ULONG64 MmTotalCommittedPages; + GCC_ULONG64 MmSharedCommit; + GCC_ULONG64 MmDriverCommit; + GCC_ULONG64 MmProcessCommit; + GCC_ULONG64 MmPagedPoolCommit; + GCC_ULONG64 MmExtendedCommit; + GCC_ULONG64 MmZeroedPageListHead; + GCC_ULONG64 MmFreePageListHead; + GCC_ULONG64 MmStandbyPageListHead; + GCC_ULONG64 MmModifiedPageListHead; + GCC_ULONG64 MmModifiedNoWritePageListHead; + GCC_ULONG64 MmAvailablePages; + GCC_ULONG64 MmResidentAvailablePages; + GCC_ULONG64 PoolTrackTable; + GCC_ULONG64 NonPagedPoolDescriptor; + GCC_ULONG64 MmHighestUserAddress; + GCC_ULONG64 MmSystemRangeStart; + GCC_ULONG64 MmUserProbeAddress; + GCC_ULONG64 KdPrintCircularBuffer; + GCC_ULONG64 KdPrintCircularBufferEnd; + GCC_ULONG64 KdPrintWritePointer; + GCC_ULONG64 KdPrintRolloverCount; + GCC_ULONG64 MmLoadedUserImageList; + GCC_ULONG64 NtBuildLab; + GCC_ULONG64 KiNormalSystemCall; + GCC_ULONG64 KiProcessorBlock; + GCC_ULONG64 MmUnloadedDrivers; + GCC_ULONG64 MmLastUnloadedDriver; + GCC_ULONG64 MmTriageActionTaken; + GCC_ULONG64 MmSpecialPoolTag; + GCC_ULONG64 KernelVerifier; + GCC_ULONG64 MmVerifierData; + GCC_ULONG64 MmAllocatedNonPagedPool; + GCC_ULONG64 MmPeakCommitment; + GCC_ULONG64 MmTotalCommitLimitMaximum; + GCC_ULONG64 CmNtCSDVersion; + GCC_ULONG64 MmPhysicalMemoryBlock; + GCC_ULONG64 MmSessionBase; + GCC_ULONG64 MmSessionSize; + GCC_ULONG64 MmSystemParentTablePage; + GCC_ULONG64 MmVirtualTranslationBase; + USHORT OffsetKThreadNextProcessor; + USHORT OffsetKThreadTeb; + USHORT OffsetKThreadKernelStack; + USHORT OffsetKThreadInitialStack; + USHORT OffsetKThreadApcProcess; + USHORT OffsetKThreadState; + USHORT OffsetKThreadBStore; + USHORT OffsetKThreadBStoreLimit; + USHORT SizeEProcess; + USHORT OffsetEprocessPeb; + USHORT OffsetEprocessParentCID; + USHORT OffsetEprocessDirectoryTableBase; + USHORT SizePrcb; + USHORT OffsetPrcbDpcRoutine; + USHORT OffsetPrcbCurrentThread; + USHORT OffsetPrcbMhz; + USHORT OffsetPrcbCpuType; + USHORT OffsetPrcbVendorString; + USHORT OffsetPrcbProcStateContext; + USHORT OffsetPrcbNumber; + USHORT SizeEThread; + GCC_ULONG64 KdPrintCircularBufferPtr; + GCC_ULONG64 KdPrintBufferSize; + GCC_ULONG64 KeLoaderBlock; + USHORT SizePcr; + USHORT OffsetPcrSelfPcr; + USHORT OffsetPcrCurrentPrcb; + USHORT OffsetPcrContainedPrcb; + USHORT OffsetPcrInitialBStore; + USHORT OffsetPcrBStoreLimit; + USHORT OffsetPcrInitialStack; + USHORT OffsetPcrStackLimit; + USHORT OffsetPrcbPcrPage; + USHORT OffsetPrcbProcStateSpecialReg; + USHORT GdtR0Code; + USHORT GdtR0Data; + USHORT GdtR0Pcr; + USHORT GdtR3Code; + USHORT GdtR3Data; + USHORT GdtR3Teb; + USHORT GdtLdt; + USHORT GdtTss; + USHORT Gdt64R3CmCode; + USHORT Gdt64R3CmTeb; + GCC_ULONG64 IopNumTriageDumpDataBlocks; + GCC_ULONG64 IopTriageDumpDataBlocks; + GCC_ULONG64 VfCrashDataBlock; +} KDDEBUGGER_DATA64, *PKDDEBUGGER_DATA64; + +#endif